| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/elements-test.js"></script> | 4 <script src="../../http/tests/inspector/elements-test.js"></script> |
| 5 <script src="edit-dom-test.js"></script> | 5 <script src="edit-dom-test.js"></script> |
| 6 <script> | 6 <script> |
| 7 | 7 |
| 8 function test() | 8 function test() |
| 9 { | 9 { |
| 10 // Save time on style updates. | 10 // Save time on style updates. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 InspectorTest.editNodePartAndRun(node, "webkit-html-attribute",
"bar=\"edited attribute\"", done, true); | 32 InspectorTest.editNodePartAndRun(node, "webkit-html-attribute",
"bar=\"edited attribute\"", done, true); |
| 33 } | 33 } |
| 34 }, | 34 }, |
| 35 | 35 |
| 36 function testEditShadowDOMAsHTML(next) | 36 function testEditShadowDOMAsHTML(next) |
| 37 { | 37 { |
| 38 InspectorTest.domActionTestForNodeId("testEditAuthorShadowDOMAsHTML"
, "authorShadowDOMElement", testBody, next); | 38 InspectorTest.domActionTestForNodeId("testEditAuthorShadowDOMAsHTML"
, "authorShadowDOMElement", testBody, next); |
| 39 | 39 |
| 40 function testBody(node, done) | 40 function testBody(node, done) |
| 41 { | 41 { |
| 42 var treeElement = WebInspector.panels.elements.treeOutline.findT
reeElement(node); | 42 var treeElement = InspectorTest.firstElementsTreeOutline().findT
reeElement(node); |
| 43 treeElement._editAsHTML(); | 43 treeElement._editAsHTML(); |
| 44 InspectorTest.runAfterPendingDispatches(step2); | 44 InspectorTest.runAfterPendingDispatches(step2); |
| 45 | 45 |
| 46 function step2() | 46 function step2() |
| 47 { | 47 { |
| 48 InspectorTest.addResult(treeElement._editing.codeMirror.getV
alue()); | 48 InspectorTest.addResult(treeElement._editing.codeMirror.getV
alue()); |
| 49 treeElement._editing.codeMirror.setValue("<span foo=\"shadow
-span\"><span id=\"inner-shadow-span\">Shadow span contents</span></span>"); | 49 treeElement._editing.codeMirror.setValue("<span foo=\"shadow
-span\"><span id=\"inner-shadow-span\">Shadow span contents</span></span>"); |
| 50 var event = InspectorTest.createKeyEvent("Enter"); | 50 var event = InspectorTest.createKeyEvent("Enter"); |
| 51 event.isMetaOrCtrlForTest = true; | 51 event.isMetaOrCtrlForTest = true; |
| 52 treeElement._htmlEditElement.dispatchEvent(event); | 52 treeElement._htmlEditElement.dispatchEvent(event); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 77 var container = document.getElementById(id); | 77 var container = document.getElementById(id); |
| 78 var root = container.createShadowRoot(); | 78 var root = container.createShadowRoot(); |
| 79 root.innerHTML = html; | 79 root.innerHTML = html; |
| 80 } | 80 } |
| 81 | 81 |
| 82 createRootWithContents("testEditAuthorShadowDOMAsHTML", "<div id='authorShadowDO
MElement'></div>"); | 82 createRootWithContents("testEditAuthorShadowDOMAsHTML", "<div id='authorShadowDO
MElement'></div>"); |
| 83 createRootWithContents("testSetAuthorShadowDOMElementAttribute", "<div foo='attr
ibute value' id='shadow-node-to-set-attribute'></div>"); | 83 createRootWithContents("testSetAuthorShadowDOMElementAttribute", "<div foo='attr
ibute value' id='shadow-node-to-set-attribute'></div>"); |
| 84 </script> | 84 </script> |
| 85 </body> | 85 </body> |
| 86 </html> | 86 </html> |
| OLD | NEW |