Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't allow Selection in nodes not in the document; #7087

Merged
merged 1 commit into from
Aug 31, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions selection/removeAllRanges.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@
var range = rangeFromEndpoints([paras[0].firstChild, 0, paras[0].firstChild, 1]);

function testRange(rangeDesc, method) {
var endpoints = eval(testRanges[i]);
if (endpoints.length && (!isSelectableNode(endpoints[0]) ||
!isSelectableNode(endpoints[2]))) {
return;
}
test(function() {
setSelectionForwards(eval(rangeDesc));
setSelectionForwards(endpoints);
selection[method]();
assert_equals(selection.rangeCount, 0,
"After " + method + "(), rangeCount must be 0");
Expand All @@ -28,7 +33,7 @@

// Copy-pasted from above
test(function() {
setSelectionBackwards(eval(rangeDesc));
setSelectionBackwards(endpoints);
selection[method]();
assert_equals(selection.rangeCount, 0,
"After " + method + "(), rangeCount must be 0");
Expand Down