Index: LayoutTests/editing/execCommand/move-up-down-should-skip-hidden-elements.html |
diff --git a/LayoutTests/editing/execCommand/move-up-down-should-skip-hidden-elements.html b/LayoutTests/editing/execCommand/move-up-down-should-skip-hidden-elements.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ea9ad4ed1d3b70cc88c40857fc15a25b80550650 |
--- /dev/null |
+++ b/LayoutTests/editing/execCommand/move-up-down-should-skip-hidden-elements.html |
@@ -0,0 +1,49 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<script src="../../fast/js/resources/js-test-pre.js"></script> |
+<title>Test moving up and down through non-renderered elements.</title> |
+</head> |
+<body> |
+<div id="before" hidden></div> |
+<h1 id="first_line">First line of rendered text</h1> |
+<div id="after" hidden></div> |
+ |
+<p id="description"></p> |
+<div id="console"></div> |
+ |
+<script> |
+description("Test moving up and down through non-renderered elements. This test should execute quickly if it's working correctly; a timeout is a failure."); |
leviw_travelin_and_unemployed
2013/07/24 18:13:56
Could this be a Magnitude test instead? See Layout
dmazzoni
2013/07/24 18:22:11
Happy to use Magnitude where it makes sense.
In t
leviw_travelin_and_unemployed
2013/07/26 04:40:11
Sounds reasonable. LGTM :)
|
+ |
+var before = document.getElementById("before"); |
+var after = document.getElementById("after"); |
+for (var i = 0; i < 1000; i++) { |
+ before.appendChild(document.createElement("meta")); |
+ after.appendChild(document.createElement("meta")); |
+} |
+ |
+function selectFirstLine() { |
+ var selection = document.getSelection(); |
+ selection.removeAllRanges(); |
+ var range = document.createRange(); |
+ range.selectNode(document.getElementById("first_line")); |
+ selection.addRange(range); |
+} |
+ |
+for (var i = 0; i < 100; i++) { |
+ selectFirstLine(); |
+ if (window.testRunner) |
+ testRunner.execCommand("MoveUpAndModifySelection"); |
+ |
+ selectFirstLine(); |
+ if (window.testRunner) |
+ testRunner.execCommand("MoveDownAndModifySelection"); |
+} |
+ |
+before.textContent = ""; |
+after.textContent = ""; |
+ |
+</script> |
+<script src="../../fast/js/resources/js-test-post.js"></script> |
+</body> |
+</html> |