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

Unified Diff: third_party/WebKit/LayoutTests/fast/forms/selection-functions.html

Issue 1437813002: Set selection to INPUT/TEXTAREA before dispatching 'focus' event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improve selection-functions.html Created 5 years, 1 month 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 | third_party/WebKit/LayoutTests/fast/forms/selection-functions-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/forms/selection-functions.html
diff --git a/third_party/WebKit/LayoutTests/fast/forms/selection-functions.html b/third_party/WebKit/LayoutTests/fast/forms/selection-functions.html
index e256af5e84b268fbe17fb4e2ac44d27f78542e1c..71faa29d66ebbf25ffdf04f8d9570a6ee527ec42 100644
--- a/third_party/WebKit/LayoutTests/fast/forms/selection-functions.html
+++ b/third_party/WebKit/LayoutTests/fast/forms/selection-functions.html
@@ -88,6 +88,19 @@
elt.selectionEnd = 7;
display(elt);
+ print("");
+ print("selectionStart and selectionEnd in focus handler don't return wrong values 0,0:");
+ elt.selectionStart = elt.selectionEnd = 7;
+ // Need to clear selection. Selection API calls above modified
+ // both of real selection and |elt|'s cached selection even
+ // though |elt| has no focus.
+ // We'd like to check the behavior in case that real selection
+ // and the cached selection are mismatched.
+ getSelection().removeAllRanges();
+ // selectionStart and selectionEnd are still 7.
+ elt.onfocus = function() { display(elt); };
+ elt.focus();
+
elt.value = "";
}
function testButtonSelectionAccess(button, access)
@@ -121,4 +134,4 @@
<hr />
<p id="console"></p>
</body>
-</html>
+</html>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/forms/selection-functions-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698