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="utilities-test.js"></script> | 4 <script src="utilities-test.js"></script> |
5 <script> | 5 <script> |
6 function test() | 6 function test() |
7 { | 7 { |
8 function dumpTextNodesAsString(node) | 8 function dumpTextNodesAsString(node) |
9 { | 9 { |
10 var result = ""; | 10 var result = ""; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 for (var i = 0; i < strings.length; i++) { | 54 for (var i = 0; i < strings.length; i++) { |
55 var span = document.createElement("span"); | 55 var span = document.createElement("span"); |
56 span.textContent = strings[i]; | 56 span.textContent = strings[i]; |
57 element.appendChild(span); | 57 element.appendChild(span); |
58 } | 58 } |
59 return element; | 59 return element; |
60 } | 60 } |
61 | 61 |
62 function range(offset, length) | 62 function range(offset, length) |
63 { | 63 { |
64 return new Common.SourceRange(offset, length); | 64 return new TextUtils.SourceRange(offset, length); |
65 } | 65 } |
66 | 66 |
67 performTestForElement(textElement(["function"]), [range(0, 8)]); // Highligh
t whole text node. | 67 performTestForElement(textElement(["function"]), [range(0, 8)]); // Highligh
t whole text node. |
68 performTestForElement(textElement(["function"]), [range(0, 7)]); // Highligh
t only text node beginning. | 68 performTestForElement(textElement(["function"]), [range(0, 7)]); // Highligh
t only text node beginning. |
69 performTestForElement(textElement(["function"]), [range(1, 7)]); // Highligh
t only text node ending. | 69 performTestForElement(textElement(["function"]), [range(1, 7)]); // Highligh
t only text node ending. |
70 performTestForElement(textElement(["function"]), [range(1, 6)]); // Highligh
t in the middle of text node. | 70 performTestForElement(textElement(["function"]), [range(1, 6)]); // Highligh
t in the middle of text node. |
71 | 71 |
72 performTestForElement(textElement(["function", " ", "functionName"]), [range
(0, 21)]); // Highlight all text in 3 text nodes. | 72 performTestForElement(textElement(["function", " ", "functionName"]), [range
(0, 21)]); // Highlight all text in 3 text nodes. |
73 performTestForElement(textElement(["function", " ", "functionName"]), [range
(0, 20)]); // Highlight all text in 3 text nodes except for the last character. | 73 performTestForElement(textElement(["function", " ", "functionName"]), [range
(0, 20)]); // Highlight all text in 3 text nodes except for the last character. |
74 performTestForElement(textElement(["function", " ", "functionName"]), [range
(1, 20)]); // Highlight all text in 3 text nodes except for the first character. | 74 performTestForElement(textElement(["function", " ", "functionName"]), [range
(1, 20)]); // Highlight all text in 3 text nodes except for the first character. |
75 performTestForElement(textElement(["function", " ", "functionName"]), [range
(1, 19)]); // Highlight all text in 3 text nodes except for the first and the la
st characters. | 75 performTestForElement(textElement(["function", " ", "functionName"]), [range
(1, 19)]); // Highlight all text in 3 text nodes except for the first and the la
st characters. |
76 performTestForElement(textElement(["function", " ", "functionName"]), [range
(7, 3)]); // Highlight like that "functio[n f]unctionName" | 76 performTestForElement(textElement(["function", " ", "functionName"]), [range
(7, 3)]); // Highlight like that "functio[n f]unctionName" |
77 | 77 |
78 performTestForElement(textElement(["function", " ", "functionName"]), [range
(0, 1), range(8, 1), range(9, 1)]); // Highlight first characters in text nodes. | 78 performTestForElement(textElement(["function", " ", "functionName"]), [range
(0, 1), range(8, 1), range(9, 1)]); // Highlight first characters in text nodes. |
79 performTestForElement(textElement(["function", " ", "functionName"]), [range
(7, 1), range(8, 1), range(20, 1)]); // Highlight last characters in text node. | 79 performTestForElement(textElement(["function", " ", "functionName"]), [range
(7, 1), range(8, 1), range(20, 1)]); // Highlight last characters in text node. |
80 performTestForElement(textElement(["function", " ", "functionName"]), [range
(0, 1), range(7, 3), range(20, 1)]); // Highlight like that: "[f]unctio[n f]unct
ionNam[e]" | 80 performTestForElement(textElement(["function", " ", "functionName"]), [range
(0, 1), range(7, 3), range(20, 1)]); // Highlight like that: "[f]unctio[n f]unct
ionNam[e]" |
81 InspectorTest.completeTest(); | 81 InspectorTest.completeTest(); |
82 } | 82 } |
83 </script> | 83 </script> |
84 </head> | 84 </head> |
85 <body onload="runTest()"> | 85 <body onload="runTest()"> |
86 <p>Tests how utilities functions highlight text and then revert/re-apply hig
hlighting changes.</p> | 86 <p>Tests how utilities functions highlight text and then revert/re-apply hig
hlighting changes.</p> |
87 <a href="https://bugs.webkit.org/show_bug.cgi?id=70244">Bug 70244</a> | 87 <a href="https://bugs.webkit.org/show_bug.cgi?id=70244">Bug 70244</a> |
88 </body> | 88 </body> |
89 </html> | 89 </html> |
OLD | NEW |