Index: LayoutTests/editing/text-iterator/script-tests/basic-iteration.js |
=================================================================== |
--- LayoutTests/editing/text-iterator/script-tests/basic-iteration.js (revision 146097) |
+++ LayoutTests/editing/text-iterator/script-tests/basic-iteration.js (working copy) |
@@ -1,5 +1,16 @@ |
description('Unit tests for WebCore text iterator'); |
+function appendBrElement(node) |
+{ |
+ node.appendChild(document.createElement('br')); |
+} |
+ |
+function addShadowTreeWithDivElement(node) |
+{ |
+ node.webkitCreateShadowRoot(); |
+ internals.oldestShadowRoot(node).innerHTML = '<div>b</div>'; |
+} |
+ |
var subframe = document.createElement('iframe'); |
document.body.appendChild(subframe); |
@@ -31,6 +42,12 @@ |
shouldBe('range.selectNodeContents(testDocument.body); internals.rangeAsText(range)', '"hey"'); |
shouldBe('range.setStartBefore(testDocument.body); range.setEndAfter(testDocument.body); internals.rangeAsText(range)', '"hey"'); |
+testDocument.body.innerHTML = '<input id="a" value="b" />'; |
+var input = testDocument.querySelector('input'); |
+shouldBe('range.selectNodeContents(internals.oldestShadowRoot(input)); internals.rangeAsText(range)', '"b"'); |
+ |
+shouldBe('appendBrElement(internals.oldestShadowRoot(input).childNodes[0]); range.selectNodeContents(internals.oldestShadowRoot(input)); internals.rangeAsText(range)', '"b"'); |
+ |
document.body.removeChild(subframe); |
var successfullyParsed = true; |