| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or
g/TR/html4/loose.dtd"> | 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or
g/TR/html4/loose.dtd"> |
| 2 <html> | 2 <html id="documentElement"> |
| 3 <head> | 3 <head> |
| 4 <script src="../../http/tests/inspector/inspector-test.js"></script> | 4 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 function initializeShadowDOM() | 6 function initializeShadowDOM() |
| 7 { | 7 { |
| 8 var shadow = document.querySelector('#shadow-host').createShadowRoot(); | 8 var shadow = document.querySelector('#shadow-host').createShadowRoot(); |
| 9 var template = document.querySelector('#shadow-dom-template'); | 9 var template = document.querySelector('#shadow-dom-template'); |
| 10 | 10 |
| 11 // Avoid matching this function | 11 // Avoid matching this function |
| 12 shadow.appendChild(template.content.cloneNode(true)); | 12 shadow.appendChild(template.content.cloneNode(true)); |
| 13 } | 13 } |
| 14 | 14 |
| 15 function test() | 15 function test() |
| 16 { | 16 { |
| 17 var omitInnerHTML; |
| 17 | 18 |
| 18 function searchCallback(next, resultCount) | 19 function searchCallback(next, resultCount) |
| 19 { | 20 { |
| 20 if (resultCount == 0) { | 21 if (resultCount == 0) { |
| 21 InspectorTest.addResult("Nothing found"); | 22 InspectorTest.addResult("Nothing found"); |
| 22 WebInspector.domModel.cancelSearch(); | 23 WebInspector.domModel.cancelSearch(); |
| 23 next(); | 24 next(); |
| 24 } | 25 } |
| 25 | 26 |
| 26 for (var i = 0; i < resultCount; ++i) | 27 for (var i = 0; i < resultCount; ++i) |
| 27 WebInspector.domModel.searchResult(i, searchResultCallback.bind(this
, i + 1 === resultCount)); | 28 WebInspector.domModel.searchResult(i, searchResultCallback.bind(this
, i + 1 === resultCount)); |
| 28 | 29 |
| 29 function searchResultCallback(isLastItem, node) | 30 function searchResultCallback(isLastItem, node) |
| 30 { | 31 { |
| 31 node.getOuterHTML(addSearchResult.bind(this, isLastItem)); | 32 node.getOuterHTML(addSearchResult.bind(this, isLastItem)); |
| 32 } | 33 } |
| 33 | 34 |
| 34 function addSearchResult(isLastItem, error, markupVa_lue) | 35 function addSearchResult(isLastItem, error, markupVa_lue) |
| 35 { | 36 { |
| 37 if (omitInnerHTML) |
| 38 markupVa_lue = markupVa_lue.substr(0, markupVa_lue.indexOf(">")
+ 1); |
| 36 InspectorTest.addResult(markupVa_lue.split("").join(" ")); | 39 InspectorTest.addResult(markupVa_lue.split("").join(" ")); |
| 37 if (isLastItem) { | 40 if (isLastItem) { |
| 38 WebInspector.domModel.cancelSearch(); | 41 WebInspector.domModel.cancelSearch(); |
| 39 next(); | 42 next(); |
| 40 } | 43 } |
| 41 } | 44 } |
| 42 } | 45 } |
| 43 | 46 |
| 44 function setUp(next) | 47 function setUp(next) |
| 45 { | 48 { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 function testExactAttributeName(next) | 103 function testExactAttributeName(next) |
| 101 { | 104 { |
| 102 WebInspector.domModel.performSearch("valu" + "e", false, searchCallb
ack.bind(this, next)); | 105 WebInspector.domModel.performSearch("valu" + "e", false, searchCallb
ack.bind(this, next)); |
| 103 }, | 106 }, |
| 104 | 107 |
| 105 function testExactAttributeVal_ue(next) | 108 function testExactAttributeVal_ue(next) |
| 106 { | 109 { |
| 107 WebInspector.domModel.performSearch("In" + "putVa" + "l", false, sea
rchCallback.bind(this, next)); | 110 WebInspector.domModel.performSearch("In" + "putVa" + "l", false, sea
rchCallback.bind(this, next)); |
| 108 }, | 111 }, |
| 109 | 112 |
| 113 function testExactAttributeVal_ueOnRoot(next) |
| 114 { |
| 115 omitInnerHTML = true; |
| 116 WebInspector.domModel.performSearch("documen" + "tElement", false, s
earchCallback.bind(this, next)); |
| 117 }, |
| 118 |
| 110 function testExactAttributeVal_ueWithQuotes(next) | 119 function testExactAttributeVal_ueWithQuotes(next) |
| 111 { | 120 { |
| 121 omitInnerHTML = false; |
| 112 WebInspector.domModel.performSearch("\"fo" + "o\"", false, searchCal
lback.bind(this, next)); | 122 WebInspector.domModel.performSearch("\"fo" + "o\"", false, searchCal
lback.bind(this, next)); |
| 113 }, | 123 }, |
| 114 | 124 |
| 115 function testPartialAttributeVal_ue(next) | 125 function testPartialAttributeVal_ue(next) |
| 116 { | 126 { |
| 117 WebInspector.domModel.performSearch("n" + "putVa" + "l", false, sear
chCallback.bind(this, next)); | 127 WebInspector.domModel.performSearch("n" + "putVa" + "l", false, sear
chCallback.bind(this, next)); |
| 118 }, | 128 }, |
| 119 | 129 |
| 120 function testXPathAttribute(next) | 130 function testXPathAttribute(next) |
| 121 { | 131 { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 <template id="shadow-dom-template"> | 198 <template id="shadow-dom-template"> |
| 189 <div id="shadow-dom-outer"> | 199 <div id="shadow-dom-outer"> |
| 190 <content></content> | 200 <content></content> |
| 191 </div> | 201 </div> |
| 192 </div> | 202 </div> |
| 193 </template> | 203 </template> |
| 194 <textarea></textarea> | 204 <textarea></textarea> |
| 195 | 205 |
| 196 </body> | 206 </body> |
| 197 </html> | 207 </html> |
| OLD | NEW |