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

Unified Diff: third_party/WebKit/LayoutTests/editing/selection/collapse/collapse_before_select.html

Issue 2697313005: Selection API: collapse() should recreate an internal Range. (Closed)
Patch Set: Add NeedsRebaseline for platform-dependent tests 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/editing/selection/collapse/collapse_before_select.html
diff --git a/third_party/WebKit/LayoutTests/editing/selection/collapse/collapse_before_select.html b/third_party/WebKit/LayoutTests/editing/selection/collapse/collapse_before_select.html
index b21119f411f1e6fa1529d8e20816fd9dda0682b0..e7e71320bb8c74856aabca7b008cae4c112257a6 100644
--- a/third_party/WebKit/LayoutTests/editing/selection/collapse/collapse_before_select.html
+++ b/third_party/WebKit/LayoutTests/editing/selection/collapse/collapse_before_select.html
@@ -10,9 +10,15 @@ test(function() {
selection.collapse(select, 0);
var anchor = document.getElementById('anchor');
- assert_equals(selection.anchorNode, anchor, 'anchorNode');
- assert_equals(selection.anchorOffset, 0, 'anchorOffset');
- assert_equals(selection.focusNode, anchor, 'focusNode');
- assert_equals(selection.focusOffset, 0, 'focusOffset');
-}, 'can not place caret inside SELECT element');
+ assert_equals(selection.anchorNode, select, 'DOM anchorNode');
+ assert_equals(selection.anchorOffset, 0, 'DOM anchorOffset');
+ assert_equals(selection.focusNode, select, 'DOM focusNode');
+ assert_equals(selection.focusOffset, 0, 'DOM focusOffset');
+
+ assert_exists(window, 'internals');
+ assert_equals(internals.visibleSelectionAnchorNode, anchor, 'Canonicalized anchorNode');
+ assert_equals(internals.visibleSelectionAnchorOffset, 0, 'Canonicalized anchorOffset');
+ assert_equals(internals.visibleSelectionFocusNode, anchor, 'Canonicalized focusNode');
+ assert_equals(internals.visibleSelectionFocusOffset, 0, 'Canonicalized focusOffset');
+}, 'can not place canonicalized caret inside SELECT element');
</script>

Powered by Google App Engine
This is Rietveld 408576698