Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Unified Diff: LayoutTests/editing/execCommand/move-up-down-should-skip-hidden-elements.html

Issue 20049007: Speed up moving cursor/selection up or down past non-renderered elements. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/editing/execCommand/move-up-down-should-skip-hidden-elements-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | LayoutTests/editing/execCommand/move-up-down-should-skip-hidden-elements-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698