| <html> |
| <head> |
| <script src="../../inspector-test.js"></script> |
| <script src="../../debugger-test.js"></script> |
| <script src="../../elements-test.js"></script> |
| <script src="../../isolated-filesystem-test.js"></script> |
| <style>#inspected { |
| color: red; |
| } |
| /*# sourceURL=http://localhost:8000/inspector/elements/styles/foo.css */ |
| </style> |
| <script> |
| |
| async function test() |
| { |
| InspectorTest.markStep('testEditingRulesInElementsPanelDoesNotAddSourceURLToOriginalFile'); |
| |
| var uiSourceCode = await InspectorTest.waitForUISourceCode('foo.css'); |
| await uiSourceCode.requestContent(); |
| InspectorTest.addResult("Dumping uiSourceCode content:"); |
| InspectorTest.addResult(uiSourceCode.workingCopy()); |
| InspectorTest.selectNodeAndWaitForStyles("inspected", nodeSelected); |
| |
| var uiSourceCode; |
| |
| function nodeSelected() |
| { |
| InspectorTest.addResult("Dumping matched rules:"); |
| InspectorTest.dumpSelectedElementStyles(true); |
| InspectorTest.addResult("Editing styles from elements panel:"); |
| var treeElement = InspectorTest.getMatchedStylePropertyTreeItem("color"); |
| treeElement.startEditing(); |
| treeElement.nameElement.textContent = "color"; |
| treeElement.nameElement.dispatchEvent(InspectorTest.createKeyEvent("Enter")); |
| |
| // Commit editing. |
| treeElement.valueElement.textContent = "green"; |
| treeElement.valueElement.firstChild.select(); |
| treeElement.valueElement.dispatchEvent(InspectorTest.createKeyEvent("Enter")); |
| uiSourceCode.addEventListener(Workspace.UISourceCode.Events.WorkingCopyCommitted, stylesEdited, this); |
| } |
| |
| function stylesEdited() |
| { |
| InspectorTest.addResult("Styles edited."); |
| InspectorTest.addResult("Dumping matched rules:"); |
| InspectorTest.dumpSelectedElementStyles(true); |
| InspectorTest.addResult("Dumping uiSourceCode content:"); |
| InspectorTest.addResult(uiSourceCode.workingCopy()); |
| InspectorTest.completeTest(); |
| } |
| }; |
| </script> |
| </head> |
| <body onload="runTest()"> |
| <div id="inspected"></div> |
| <p>Tests file system project mappings.</p> |
| </body> |
| </html> |