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

Unified Diff: third_party/WebKit/LayoutTests/fast/text/pre-wrap-trailing-tab.html

Issue 2695193002: Selection API: setBaseAndExtent() and selectAllChildren() should create new Range based on the spec… (Closed)
Patch Set: rebase Created 3 years, 10 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
Index: third_party/WebKit/LayoutTests/fast/text/pre-wrap-trailing-tab.html
diff --git a/third_party/WebKit/LayoutTests/fast/text/pre-wrap-trailing-tab.html b/third_party/WebKit/LayoutTests/fast/text/pre-wrap-trailing-tab.html
index 5f5e1a75e873977393c1bfe41f49f244cb26008f..6ce979431e945786f53eae3b9a45cc8d17728bd1 100644
--- a/third_party/WebKit/LayoutTests/fast/text/pre-wrap-trailing-tab.html
+++ b/third_party/WebKit/LayoutTests/fast/text/pre-wrap-trailing-tab.html
@@ -1,8 +1,6 @@
<!DOCTYPE html>
<html>
-<body><div id="tests"><div style="width: 1ex; font-size: 1em; white-space: pre-wrap;"
-></div><div style="width: 1ex; font-size: 1em; white-space: pre-wrap; word-wrap: break-word;"
-></div><textarea style="width: 1ex; font-size: 1em;"
+<body><div id="tests"><textarea style="width: 1ex; font-size: 1em;"
></textarea></div><pre id="log"></pre><script>
function assertEqual(name, length, endOffset)
@@ -16,20 +14,14 @@ function assertEqual(name, length, endOffset)
var tests = document.getElementById('tests').childNodes;
var log = document.getElementById('log');
-log.textContent = 'This test ensures WebKit renders the trailing whitespace properly. You should see PASS thrice below.\n';
+log.textContent = 'This test ensures WebKit renders the trailing whitespace properly. You should see a PASS below.\n';
var letter = 'a';
for (var i = 0; i < tests.length; i++, letter = String.fromCharCode(letter.charCodeAt(0) + 1)) {
- if (tests[i].select) {
- tests[i].value = letter + '\t';
- tests[i].focus();
- tests[i].select();
- var endOffset = tests[i].selectionEnd;
- } else {
- tests[i].textContent = letter + '\t';
- window.getSelection().selectAllChildren(tests[i]);
- var endOffset = window.getSelection().getRangeAt(0).endOffset;
- }
+ tests[i].value = letter + '\t';
+ tests[i].focus();
+ tests[i].select();
+ var endOffset = tests[i].selectionEnd;
assertEqual('test ' + i, 2, endOffset);
}

Powered by Google App Engine
This is Rietveld 408576698