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

Unified Diff: third_party/WebKit/LayoutTests/editing/selection/collapse/table-caret-3.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/table-caret-3.html
diff --git a/third_party/WebKit/LayoutTests/editing/selection/collapse/table-caret-3.html b/third_party/WebKit/LayoutTests/editing/selection/collapse/table-caret-3.html
index 5f4f5d2b10e006ce18d174cb99045790ea09603f..a89b43b4f7cc0e1ec2f47ccedbc2ce79819f6a28 100644
--- a/third_party/WebKit/LayoutTests/editing/selection/collapse/table-caret-3.html
+++ b/third_party/WebKit/LayoutTests/editing/selection/collapse/table-caret-3.html
@@ -12,9 +12,14 @@ table, td {
<script>
test(function () {
var selection = window.getSelection();
- selection.collapse(sample, sample.childNodes.length);
+ let childLength = sample.childNodes.length;
+ selection.collapse(sample, childLength);
assert_true(selection.isCollapsed, 'isCollapsed');
- assert_equals(selection.anchorNode, div, 'anchorNode');
- assert_equals(selection.anchorOffset, 2, 'anchorOffset');
+
+ assert_equals(selection.anchorNode, sample, 'DOM anchorNode');
+ assert_equals(selection.anchorOffset, childLength, 'DOM anchorOffset');
+ assert_exists(window, 'internals');
+ assert_equals(internals.visibleSelectionAnchorNode, div, 'Canonicalized anchorNode');
+ assert_equals(internals.visibleSelectionAnchorOffset, 2, 'Canonicalized anchorOffset');
});
</script>

Powered by Google App Engine
This is Rietveld 408576698