Files
firefox/testing/web-platform/mozilla/tests/focus/Selection_setBaseAndExtent.html
T
Masayuki Nakano 462139cd3e Bug 1318312 part.1 Add automated tests for checking focus move at using Selection API r=smaug
Adding automated tests as web platform tests (only for mozilla) for focus move at using Selection API.

Although, there is no standards of relation between Selection API and focus, we should move focus when Selection API moves selections into only an editing host or outside of focused editing host.

Chrome moves focus as this rules, therefore, user can modify contenteditable editor immediately after web app moves selection.

Edge does NOT move focus at using Selection API.  However, user can modify contenteditable editor similar to Chrome.  We can guess that Edge doesn't need to move focus in its design because perhaps, Edge decides if it's editable only with primary selected range.

We cannot take the Edge behavior due to our editor design.  So, we can take only Chrome's approach for improving the compatibility.

MozReview-Commit-ID: JuLiSMgqODm
2017-03-13 22:30:28 +09:00

806 lines
59 KiB
HTML

<!doctype html>
<meta charset=utf-8>
<title>focus move tests caused by a call of Selection.setBaseAndExtent()</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<p id="staticBefore">static text</p>
<div id="editor" contenteditable><p>content of editor</p></div>
<div id="outerEditor" contenteditable
><p>content of outer editor</p><div id="staticInEditor" contenteditable="false"
><p>static content of outer editor</p><div id="innerEditor" contenteditable
><p>content of inner editor</p></div></div></div>
<p id="staticAfter">static text</p>
<p><a id="anchor" href="about:blank">anchor</a></p>
<script>
"use strict";
var staticBefore = {
element: document.getElementById("staticBefore"),
textNode: document.getElementById("staticBefore").firstChild,
textLength: document.getElementById("staticBefore").firstChild.length
};
var editor = {
element: document.getElementById("editor"),
textNode: document.getElementById("editor").firstChild.firstChild,
textLength: document.getElementById("editor").firstChild.firstChild.length
};
var outerEditor = {
element: document.getElementById("outerEditor"),
textNode: document.getElementById("outerEditor").firstChild.firstChild,
textLength: document.getElementById("outerEditor").firstChild.firstChild.length
};
var staticInEditor = {
element: document.getElementById("staticInEditor"),
textNode: document.getElementById("staticInEditor").firstChild,
textLength: document.getElementById("staticInEditor").firstChild.length
};
var innerEditor = {
element: document.getElementById("innerEditor"),
textNode: document.getElementById("innerEditor").firstChild.firstChild,
textLength: document.getElementById("innerEditor").firstChild.firstChild.length
};
var staticAfter = {
element: document.getElementById("staticAfter"),
textNode: document.getElementById("staticAfter").firstChild,
textLength: document.getElementById("staticAfter").firstChild.length
};
var anchor = {
element: document.getElementById("anchor"),
textNode: document.getElementById("anchor").firstChild,
textLength: document.getElementById("anchor").firstChild.length
};
function resetFocusAndSelectionRange(aFocus)
{
document.getSelection().removeAllRanges();
if (document.activeElement) {
document.activeElement.blur();
}
if (aFocus) {
aFocus.element.focus();
document.getSelection().collapse(aFocus.textNode, 0);
} else {
document.getSelection().collapse(staticBefore.textNode, 0);
}
}
/**
* NOTE: When you add/modify something in this file, you should add same test to Selection_addRange.html too.
*/
// Selection.setBaseAndExtent() with collapsed range.
test(function() {
resetFocusAndSelectionRange();
document.getSelection().setBaseAndExtent(staticBefore.textNode, 0,
staticBefore.textNode, 0);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'staticBefore' when active element is the <body>");
test(function() {
resetFocusAndSelectionRange();
document.getSelection().setBaseAndExtent(editor.textNode, 0,
editor.textNode, 0);
assert_equals(document.activeElement, editor.element);
}, "Active element should be 'editor' after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'editor' when active element is the <body>");
test(function() {
resetFocusAndSelectionRange();
document.getSelection().setBaseAndExtent(outerEditor.textNode, 0,
outerEditor.textNode, 0);
assert_equals(document.activeElement, outerEditor.element);
}, "Active element should be 'outerEditor' after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'outerEditor' when active element is the <body>");
test(function() {
resetFocusAndSelectionRange();
document.getSelection().setBaseAndExtent(staticInEditor.textNode, 0,
staticInEditor.textNode, 0);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'staticInEditor' when active element is the <body>");
test(function() {
resetFocusAndSelectionRange();
document.getSelection().setBaseAndExtent(innerEditor.textNode, 0,
innerEditor.textNode, 0);
assert_equals(document.activeElement, innerEditor.element);
}, "Active element should be 'innerEditor' after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'innerEditor' when active element is the <body>");
test(function() {
resetFocusAndSelectionRange();
document.getSelection().setBaseAndExtent(staticAfter.textNode, 0,
staticAfter.textNode, 0);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'staticAfter' when active element is the <body>");
test(function() {
resetFocusAndSelectionRange();
document.getSelection().setBaseAndExtent(anchor.textNode, 0,
anchor.textNode, 0);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'anchor' when active element is the <body>");
test(function() {
resetFocusAndSelectionRange(editor);
document.getSelection().setBaseAndExtent(staticBefore.textNode, 0,
staticBefore.textNode, 0);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'staticBefore' when active element is 'editor'");
test(function() {
resetFocusAndSelectionRange(editor);
document.getSelection().setBaseAndExtent(editor.textNode, 0,
editor.textNode, 0);
assert_equals(document.activeElement, editor.element);
}, "Active element should be 'editor' after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'editor' when active element is 'editor'");
test(function() {
resetFocusAndSelectionRange(editor);
document.getSelection().setBaseAndExtent(outerEditor.textNode, 0,
outerEditor.textNode, 0);
assert_equals(document.activeElement, outerEditor.element);
}, "Active element should be 'outerEditor' after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'outerEditor' when active element is 'editor'");
test(function() {
resetFocusAndSelectionRange(editor);
document.getSelection().setBaseAndExtent(staticInEditor.textNode, 0,
staticInEditor.textNode, 0);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'staticInEditor' when active element is 'editor'");
test(function() {
resetFocusAndSelectionRange(editor);
document.getSelection().setBaseAndExtent(innerEditor.textNode, 0,
innerEditor.textNode, 0);
assert_equals(document.activeElement, innerEditor.element);
}, "Active element should be 'innerEditor' after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'innerEditor' when active element is 'editor'");
test(function() {
resetFocusAndSelectionRange(editor);
document.getSelection().setBaseAndExtent(staticAfter.textNode, 0,
staticAfter.textNode, 0);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'staticAfter' when active element is 'editor'");
test(function() {
resetFocusAndSelectionRange(editor);
document.getSelection().setBaseAndExtent(anchor.textNode, 0,
anchor.textNode, 0);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'anchor' when active element is 'editor'");
test(function() {
resetFocusAndSelectionRange(outerEditor);
document.getSelection().setBaseAndExtent(staticBefore.textNode, 0,
staticBefore.textNode, 0);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'staticBefore' when active element is 'outerEditor'");
test(function() {
resetFocusAndSelectionRange(outerEditor);
document.getSelection().setBaseAndExtent(editor.textNode, 0,
editor.textNode, 0);
assert_equals(document.activeElement, editor.element);
}, "Active element should be 'editor' after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'editor' when active element is 'outerEditor'");
test(function() {
resetFocusAndSelectionRange(outerEditor);
document.getSelection().setBaseAndExtent(outerEditor.textNode, 0,
outerEditor.textNode, 0);
assert_equals(document.activeElement, outerEditor.element);
}, "Active element should be 'outerEditor' after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'outerEditor' when active element is 'outerEditor'");
test(function() {
resetFocusAndSelectionRange(outerEditor);
document.getSelection().setBaseAndExtent(staticInEditor.textNode, 0,
staticInEditor.textNode, 0);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'staticInEditor' when active element is 'outerEditor'");
test(function() {
resetFocusAndSelectionRange(outerEditor);
document.getSelection().setBaseAndExtent(innerEditor.textNode, 0,
innerEditor.textNode, 0);
assert_equals(document.activeElement, innerEditor.element);
}, "Active element should be 'innerEditor' after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'innerEditor' when active element is 'outerEditor'");
test(function() {
resetFocusAndSelectionRange(outerEditor);
document.getSelection().setBaseAndExtent(staticAfter.textNode, 0,
staticAfter.textNode, 0);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'staticAfter' when active element is 'outerEditor'");
test(function() {
resetFocusAndSelectionRange(outerEditor);
document.getSelection().setBaseAndExtent(anchor.textNode, 0,
anchor.textNode, 0);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'anchor' when active element is 'outerEditor'");
test(function() {
resetFocusAndSelectionRange(staticInEditor);
document.getSelection().setBaseAndExtent(staticBefore.textNode, 0,
staticBefore.textNode, 0);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'staticBefore' when active element is the <body> and selection is in 'staticInEditor'");
test(function() {
resetFocusAndSelectionRange(staticInEditor);
document.getSelection().setBaseAndExtent(editor.textNode, 0,
editor.textNode, 0);
assert_equals(document.activeElement, editor.element);
}, "Active element should be 'editor' after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'editor' when active element is the <body> and selection is in 'staticInEditor'");
test(function() {
resetFocusAndSelectionRange(staticInEditor);
document.getSelection().setBaseAndExtent(outerEditor.textNode, 0,
outerEditor.textNode, 0);
assert_equals(document.activeElement, outerEditor.element);
}, "Active element should be 'outerEditor' after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'outerEditor' when active element is the <body> and selection is in 'staticInEditor'");
test(function() {
resetFocusAndSelectionRange(staticInEditor);
document.getSelection().setBaseAndExtent(staticInEditor.textNode, 0,
staticInEditor.textNode, 0);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'staticInEditor' when active element is the <body> and selection is in 'staticInEditor'");
test(function() {
resetFocusAndSelectionRange(staticInEditor);
document.getSelection().setBaseAndExtent(innerEditor.textNode, 0,
innerEditor.textNode, 0);
assert_equals(document.activeElement, innerEditor.element);
}, "Active element should be 'innerEditor' after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'innerEditor' when active element is the <body> and selection is in 'staticInEditor'");
test(function() {
resetFocusAndSelectionRange(staticInEditor);
document.getSelection().setBaseAndExtent(staticAfter.textNode, 0,
staticAfter.textNode, 0);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'staticAfter' when active element is the <body> and selection is in 'staticInEditor'");
test(function() {
resetFocusAndSelectionRange(staticInEditor);
document.getSelection().setBaseAndExtent(anchor.textNode, 0,
anchor.textNode, 0);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'anchor' when active element is the <body> and selection is in 'staticInEditor'");
test(function() {
resetFocusAndSelectionRange(innerEditor);
document.getSelection().setBaseAndExtent(staticBefore.textNode, 0,
staticBefore.textNode, 0);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'staticBefore' when active element is 'innerEditor'");
test(function() {
resetFocusAndSelectionRange(innerEditor);
document.getSelection().setBaseAndExtent(editor.textNode, 0,
editor.textNode, 0);
assert_equals(document.activeElement, editor.element);
}, "Active element should be 'editor' after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'editor' when active element is 'innerEditor'");
test(function() {
resetFocusAndSelectionRange(innerEditor);
document.getSelection().setBaseAndExtent(outerEditor.textNode, 0,
outerEditor.textNode, 0);
assert_equals(document.activeElement, outerEditor.element);
}, "Active element should be 'outerEditor' after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'outerEditor' when active element is 'innerEditor'");
test(function() {
resetFocusAndSelectionRange(innerEditor);
document.getSelection().setBaseAndExtent(staticInEditor.textNode, 0,
staticInEditor.textNode, 0);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'staticInEditor' when active element is 'innerEditor'");
test(function() {
resetFocusAndSelectionRange(innerEditor);
document.getSelection().setBaseAndExtent(innerEditor.textNode, 0,
innerEditor.textNode, 0);
assert_equals(document.activeElement, innerEditor.element);
}, "Active element should be 'innerEditor' after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'innerEditor' when active element is 'innerEditor'");
test(function() {
resetFocusAndSelectionRange(innerEditor);
document.getSelection().setBaseAndExtent(staticAfter.textNode, 0,
staticAfter.textNode, 0);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'staticAfter' when active element is 'innerEditor'");
test(function() {
resetFocusAndSelectionRange(innerEditor);
document.getSelection().setBaseAndExtent(anchor.textNode, 0,
anchor.textNode, 0);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'anchor' when active element is 'innerEditor'");
test(function() {
resetFocusAndSelectionRange(anchor);
document.getSelection().setBaseAndExtent(staticBefore.textNode, 0,
staticBefore.textNode, 0);
assert_equals(document.activeElement, anchor.element);
}, "Active element should be 'anchor' after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'staticBefore' when active element is 'anchor'");
test(function() {
resetFocusAndSelectionRange(anchor);
document.getSelection().setBaseAndExtent(editor.textNode, 0,
editor.textNode, 0);
assert_equals(document.activeElement, editor.element);
}, "Active element should be 'editor' after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'editor' when active element is 'anchor'");
test(function() {
resetFocusAndSelectionRange(anchor);
document.getSelection().setBaseAndExtent(outerEditor.textNode, 0,
outerEditor.textNode, 0);
assert_equals(document.activeElement, outerEditor.element);
}, "Active element should be 'outerEditor' after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'outerEditor' when active element is 'anchor'");
test(function() {
resetFocusAndSelectionRange(anchor);
document.getSelection().setBaseAndExtent(staticInEditor.textNode, 0,
staticInEditor.textNode, 0);
assert_equals(document.activeElement, anchor.element);
}, "Active element should be 'anchor' after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'staticInEditor' when active element is 'anchor'");
test(function() {
resetFocusAndSelectionRange(anchor);
document.getSelection().setBaseAndExtent(innerEditor.textNode, 0,
innerEditor.textNode, 0);
assert_equals(document.activeElement, innerEditor.element);
}, "Active element should be 'innerEditor' after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'innerEditor' when active element is 'anchor'");
test(function() {
resetFocusAndSelectionRange(anchor);
document.getSelection().setBaseAndExtent(staticAfter.textNode, 0,
staticAfter.textNode, 0);
assert_equals(document.activeElement, anchor.element);
}, "Active element should be 'anchor' after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'staticAfter' when active element is 'anchor'");
test(function() {
resetFocusAndSelectionRange(anchor);
document.getSelection().setBaseAndExtent(anchor.textNode, 0,
anchor.textNode, 0);
assert_equals(document.activeElement, anchor.element);
}, "Active element should be 'anchor' after Selection.setBaseAndExtent() with collapsed range at start of the first text node of 'anchor' when active element is 'anchor'");
// Selection.setBaseAndExtent() with non-collapsed range in a node.
test(function() {
resetFocusAndSelectionRange();
document.getSelection().setBaseAndExtent(staticBefore.textNode, 0,
staticBefore.textNode, staticBefore.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range in the first text node of 'staticBefore' when active element is the <body>");
test(function() {
resetFocusAndSelectionRange();
document.getSelection().setBaseAndExtent(editor.textNode, 0,
editor.textNode, editor.textLength);
assert_equals(document.activeElement, editor.element);
}, "Active element should be 'editor' after Selection.setBaseAndExtent() with a range in start of the first text node of 'editor' when active element is the <body>");
test(function() {
resetFocusAndSelectionRange();
document.getSelection().setBaseAndExtent(outerEditor.textNode, 0,
outerEditor.textNode, outerEditor.textLength);
assert_equals(document.activeElement, outerEditor.element);
}, "Active element should be 'outerEditor' after Selection.setBaseAndExtent() with a range in start of the first text node of 'outerEditor' when active element is the <body>");
test(function() {
resetFocusAndSelectionRange();
document.getSelection().setBaseAndExtent(staticInEditor.textNode, 0,
staticInEditor.textNode, staticInEditor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range in start of the first text node of 'staticInEditor' when active element is the <body>");
test(function() {
resetFocusAndSelectionRange();
document.getSelection().setBaseAndExtent(innerEditor.textNode, 0,
innerEditor.textNode, innerEditor.textLength);
assert_equals(document.activeElement, innerEditor.element);
}, "Active element should be 'innerEditor' after Selection.setBaseAndExtent() with a range in start of the first text node of 'innerEditor' when active element is the <body>");
test(function() {
resetFocusAndSelectionRange();
document.getSelection().setBaseAndExtent(staticAfter.textNode, 0,
staticAfter.textNode, staticAfter.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range in start of the first text node of 'staticAfter' when active element is the <body>");
test(function() {
resetFocusAndSelectionRange();
document.getSelection().setBaseAndExtent(anchor.textNode, 0,
anchor.textNode, anchor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range in start of the first text node of 'anchor' when active element is the <body>");
test(function() {
resetFocusAndSelectionRange(editor);
document.getSelection().setBaseAndExtent(staticBefore.textNode, 0,
staticBefore.textNode, staticBefore.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range in the first text node of 'staticBefore' when active element is 'editor'");
test(function() {
resetFocusAndSelectionRange(editor);
document.getSelection().setBaseAndExtent(editor.textNode, 0,
editor.textNode, editor.textLength);
assert_equals(document.activeElement, editor.element);
}, "Active element should be 'editor' after Selection.setBaseAndExtent() with a range in start of the first text node of 'editor' when active element is 'editor'");
test(function() {
resetFocusAndSelectionRange(editor);
document.getSelection().setBaseAndExtent(outerEditor.textNode, 0,
outerEditor.textNode, outerEditor.textLength);
assert_equals(document.activeElement, outerEditor.element);
}, "Active element should be 'outerEditor' after Selection.setBaseAndExtent() with a range in start of the first text node of 'outerEditor' when active element is 'editor'");
test(function() {
resetFocusAndSelectionRange(editor);
document.getSelection().setBaseAndExtent(staticInEditor.textNode, 0,
staticInEditor.textNode, staticInEditor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range in start of the first text node of 'staticInEditor' when active element is 'editor'");
test(function() {
resetFocusAndSelectionRange(editor);
document.getSelection().setBaseAndExtent(innerEditor.textNode, 0,
innerEditor.textNode, innerEditor.textLength);
assert_equals(document.activeElement, innerEditor.element);
}, "Active element should be 'innerEditor' after Selection.setBaseAndExtent() with a range in start of the first text node of 'innerEditor' when active element is 'editor'");
test(function() {
resetFocusAndSelectionRange(editor);
document.getSelection().setBaseAndExtent(staticAfter.textNode, 0,
staticAfter.textNode, staticAfter.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range in start of the first text node of 'staticAfter' when active element is 'editor'");
test(function() {
resetFocusAndSelectionRange(editor);
document.getSelection().setBaseAndExtent(anchor.textNode, 0,
anchor.textNode, anchor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range in start of the first text node of 'anchor' when active element is 'editor'");
test(function() {
resetFocusAndSelectionRange(outerEditor);
document.getSelection().setBaseAndExtent(staticBefore.textNode, 0,
staticBefore.textNode, staticBefore.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range in the first text node of 'staticBefore' when active element is 'outerEditor'");
test(function() {
resetFocusAndSelectionRange(outerEditor);
document.getSelection().setBaseAndExtent(editor.textNode, 0,
editor.textNode, editor.textLength);
assert_equals(document.activeElement, editor.element);
}, "Active element should be 'editor' after Selection.setBaseAndExtent() with a range in start of the first text node of 'editor' when active element is 'outerEditor'");
test(function() {
resetFocusAndSelectionRange(outerEditor);
document.getSelection().setBaseAndExtent(outerEditor.textNode, 0,
outerEditor.textNode, outerEditor.textLength);
assert_equals(document.activeElement, outerEditor.element);
}, "Active element should be 'outerEditor' after Selection.setBaseAndExtent() with a range in start of the first text node of 'outerEditor' when active element is 'outerEditor'");
test(function() {
resetFocusAndSelectionRange(outerEditor);
document.getSelection().setBaseAndExtent(staticInEditor.textNode, 0,
staticInEditor.textNode, staticInEditor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range in start of the first text node of 'staticInEditor' when active element is 'outerEditor'");
test(function() {
resetFocusAndSelectionRange(outerEditor);
document.getSelection().setBaseAndExtent(innerEditor.textNode, 0,
innerEditor.textNode, innerEditor.textLength);
assert_equals(document.activeElement, innerEditor.element);
}, "Active element should be 'innerEditor' after Selection.setBaseAndExtent() with a range in start of the first text node of 'innerEditor' when active element is 'outerEditor'");
test(function() {
resetFocusAndSelectionRange(outerEditor);
document.getSelection().setBaseAndExtent(staticAfter.textNode, 0,
staticAfter.textNode, staticAfter.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range in start of the first text node of 'staticAfter' when active element is 'outerEditor'");
test(function() {
resetFocusAndSelectionRange(outerEditor);
document.getSelection().setBaseAndExtent(anchor.textNode, 0,
anchor.textNode, anchor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range in start of the first text node of 'anchor' when active element is 'outerEditor'");
test(function() {
resetFocusAndSelectionRange(staticInEditor);
document.getSelection().setBaseAndExtent(staticBefore.textNode, 0,
staticBefore.textNode, staticBefore.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range in the first text node of 'staticBefore' when active element is 'outerEditor' and selection is in 'staticInEditor'");
test(function() {
resetFocusAndSelectionRange(staticInEditor);
document.getSelection().setBaseAndExtent(editor.textNode, 0,
editor.textNode, editor.textLength);
assert_equals(document.activeElement, editor.element);
}, "Active element should be 'editor' after Selection.setBaseAndExtent() with a range in start of the first text node of 'editor' when active element is 'outerEditor' and selection is in 'staticInEditor'");
test(function() {
resetFocusAndSelectionRange(staticInEditor);
document.getSelection().setBaseAndExtent(outerEditor.textNode, 0,
outerEditor.textNode, outerEditor.textLength);
assert_equals(document.activeElement, outerEditor.element);
}, "Active element should be 'outerEditor' after Selection.setBaseAndExtent() with a range in start of the first text node of 'outerEditor' when active element is 'outerEditor' and selection is in 'staticInEditor'");
test(function() {
resetFocusAndSelectionRange(staticInEditor);
document.getSelection().setBaseAndExtent(staticInEditor.textNode, 0,
staticInEditor.textNode, staticInEditor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range in start of the first text node of 'staticInEditor' when active element is 'outerEditor' and selection is in 'staticInEditor'");
test(function() {
resetFocusAndSelectionRange(staticInEditor);
document.getSelection().setBaseAndExtent(innerEditor.textNode, 0,
innerEditor.textNode, innerEditor.textLength);
assert_equals(document.activeElement, innerEditor.element);
}, "Active element should be 'innerEditor' after Selection.setBaseAndExtent() with a range in start of the first text node of 'innerEditor' when active element is 'outerEditor' and selection is in 'staticInEditor'");
test(function() {
resetFocusAndSelectionRange(staticInEditor);
document.getSelection().setBaseAndExtent(staticAfter.textNode, 0,
staticAfter.textNode, staticAfter.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range in start of the first text node of 'staticAfter' when active element is 'outerEditor' and selection is in 'staticInEditor'");
test(function() {
resetFocusAndSelectionRange(staticInEditor);
document.getSelection().setBaseAndExtent(anchor.textNode, 0,
anchor.textNode, anchor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range in start of the first text node of 'anchor' when active element is 'outerEditor' and selection is in 'staticInEditor'");
test(function() {
resetFocusAndSelectionRange(innerEditor);
document.getSelection().setBaseAndExtent(staticBefore.textNode, 0,
staticBefore.textNode, staticBefore.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range in the first text node of 'staticBefore' when active element is 'innerEditor'");
test(function() {
resetFocusAndSelectionRange(innerEditor);
document.getSelection().setBaseAndExtent(editor.textNode, 0,
editor.textNode, editor.textLength);
assert_equals(document.activeElement, editor.element);
}, "Active element should be 'editor' after Selection.setBaseAndExtent() with a range in start of the first text node of 'editor' when active element is 'innerEditor'");
test(function() {
resetFocusAndSelectionRange(innerEditor);
document.getSelection().setBaseAndExtent(outerEditor.textNode, 0,
outerEditor.textNode, outerEditor.textLength);
assert_equals(document.activeElement, outerEditor.element);
}, "Active element should be 'outerEditor' after Selection.setBaseAndExtent() with a range in start of the first text node of 'outerEditor' when active element is 'innerEditor'");
test(function() {
resetFocusAndSelectionRange(innerEditor);
document.getSelection().setBaseAndExtent(staticInEditor.textNode, 0,
staticInEditor.textNode, staticInEditor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range in start of the first text node of 'staticInEditor' when active element is 'innerEditor'");
test(function() {
resetFocusAndSelectionRange(innerEditor);
document.getSelection().setBaseAndExtent(innerEditor.textNode, 0,
innerEditor.textNode, innerEditor.textLength);
assert_equals(document.activeElement, innerEditor.element);
}, "Active element should be 'innerEditor' after Selection.setBaseAndExtent() with a range in start of the first text node of 'innerEditor' when active element is 'innerEditor'");
test(function() {
resetFocusAndSelectionRange(innerEditor);
document.getSelection().setBaseAndExtent(staticAfter.textNode, 0,
staticAfter.textNode, staticAfter.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range in start of the first text node of 'staticAfter' when active element is 'innerEditor'");
test(function() {
resetFocusAndSelectionRange(innerEditor);
document.getSelection().setBaseAndExtent(anchor.textNode, 0,
anchor.textNode, anchor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range in start of the first text node of 'anchor' when active element is 'innerEditor'");
test(function() {
resetFocusAndSelectionRange(anchor);
document.getSelection().setBaseAndExtent(staticBefore.textNode, 0,
staticBefore.textNode, staticBefore.textLength);
assert_equals(document.activeElement, anchor.element);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range in the first text node of 'staticBefore' when active element is 'anchor'");
test(function() {
resetFocusAndSelectionRange(anchor);
document.getSelection().setBaseAndExtent(editor.textNode, 0,
editor.textNode, editor.textLength);
assert_equals(document.activeElement, editor.element);
}, "Active element should be 'editor' after Selection.setBaseAndExtent() with a range in start of the first text node of 'editor' when active element is 'anchor'");
test(function() {
resetFocusAndSelectionRange(anchor);
document.getSelection().setBaseAndExtent(outerEditor.textNode, 0,
outerEditor.textNode, outerEditor.textLength);
assert_equals(document.activeElement, outerEditor.element);
}, "Active element should be 'outerEditor' after Selection.setBaseAndExtent() with a range in start of the first text node of 'outerEditor' when active element is 'anchor'");
test(function() {
resetFocusAndSelectionRange(anchor);
document.getSelection().setBaseAndExtent(staticInEditor.textNode, 0,
staticInEditor.textNode, staticInEditor.textLength);
assert_equals(document.activeElement, anchor.element);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range in start of the first text node of 'staticInEditor' when active element is 'anchor'");
test(function() {
resetFocusAndSelectionRange(anchor);
document.getSelection().setBaseAndExtent(innerEditor.textNode, 0,
innerEditor.textNode, innerEditor.textLength);
assert_equals(document.activeElement, innerEditor.element);
}, "Active element should be 'innerEditor' after Selection.setBaseAndExtent() with a range in start of the first text node of 'innerEditor' when active element is 'anchor'");
test(function() {
resetFocusAndSelectionRange(anchor);
document.getSelection().setBaseAndExtent(staticAfter.textNode, 0,
staticAfter.textNode, staticAfter.textLength);
assert_equals(document.activeElement, anchor.element);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range in start of the first text node of 'staticAfter' when active element is 'anchor'");
test(function() {
resetFocusAndSelectionRange(anchor);
document.getSelection().setBaseAndExtent(anchor.textNode, 0,
anchor.textNode, anchor.textLength);
assert_equals(document.activeElement, anchor.element);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range in start of the first text node of 'anchor' when active element is 'anchor'");
// Selection.setBaseAndExtent() with a range across editing host boundary.
test(function() {
resetFocusAndSelectionRange();
document.getSelection().setBaseAndExtent(staticBefore.textNode, 0,
editor.textNode, editor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range between start of the first text node of 'staticBefore' and end of the first text node of 'editor' (no common editing host) when active element is the <body>");
test(function() {
resetFocusAndSelectionRange();
document.getSelection().setBaseAndExtent(editor.textNode, 0,
outerEditor.textNode, outerEditor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range between start of the first text node of 'editor' and end of the first text node of 'outerEditor' (no common editing host) when active element is the <body>");
test(function() {
resetFocusAndSelectionRange();
document.getSelection().setBaseAndExtent(outerEditor.textNode, 0,
staticInEditor.textNode, staticInEditor.textLength);
assert_equals(document.activeElement, outerEditor.element);
}, "Active element should be 'outerEditor' after Selection.setBaseAndExtent() with a range between start of the first text node of 'outerEditor' and end of the first text node of 'staticInEditor' (common editing host is outerEditor) when active element is the <body>");
test(function() {
resetFocusAndSelectionRange();
document.getSelection().setBaseAndExtent(staticInEditor.textNode, 0,
innerEditor.textNode, innerEditor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range between start of the first text node of 'staticInEditor' and end of the first text node of 'innerEditor' (no common editing host) when active element is the <body>");
test(function() {
resetFocusAndSelectionRange();
document.getSelection().setBaseAndExtent(outerEditor.textNode, 0,
innerEditor.textNode, innerEditor.textLength);
assert_equals(document.activeElement, outerEditor.element);
}, "Active element should be 'outerEditor' after Selection.setBaseAndExtent() with a range between start of the first text node of 'outerEditor' and end of the first text node of 'innerEditor' (common editing host is outerEditor) when active element is the <body>");
test(function() {
resetFocusAndSelectionRange();
document.getSelection().setBaseAndExtent(innerEditor.textNode, 0,
staticAfter.textNode, staticAfter.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range between start of the first text node of 'innerEditor' and end of the first text node of 'staticAfter' (no common editing host) when active element is the <body>");
test(function() {
resetFocusAndSelectionRange();
document.getSelection().setBaseAndExtent(innerEditor.textNode, 0,
anchor.textNode, anchor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range between start of the first text node of 'innerEditor' and end of the first text node of 'anchor' (no common editing host) when active element is the <body>");
test(function() {
resetFocusAndSelectionRange(editor);
document.getSelection().setBaseAndExtent(staticBefore.textNode, 0,
editor.textNode, editor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range between start of the first text node of 'staticBefore' and end of the first text node of 'editor' (no common editing host) when active element is 'editor'");
test(function() {
resetFocusAndSelectionRange(editor);
document.getSelection().setBaseAndExtent(editor.textNode, 0,
outerEditor.textNode, outerEditor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range between start of the first text node of 'editor' and end of the first text node of 'outerEditor' (no common editing host) when active element is 'editor'");
test(function() {
resetFocusAndSelectionRange(editor);
document.getSelection().setBaseAndExtent(outerEditor.textNode, 0,
staticInEditor.textNode, staticInEditor.textLength);
assert_equals(document.activeElement, outerEditor.element);
}, "Active element should be 'outerEditor' after Selection.setBaseAndExtent() with a range between start of the first text node of 'outerEditor' and end of the first text node of 'staticInEditor' (common editing host is outerEditor) when active element is 'editor'");
test(function() {
resetFocusAndSelectionRange(editor);
document.getSelection().setBaseAndExtent(staticInEditor.textNode, 0,
innerEditor.textNode, innerEditor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range between start of the first text node of 'staticInEditor' and end of the first text node of 'innerEditor' (no common editing host) when active element is 'editor'");
test(function() {
resetFocusAndSelectionRange(editor);
document.getSelection().setBaseAndExtent(outerEditor.textNode, 0,
innerEditor.textNode, innerEditor.textLength);
assert_equals(document.activeElement, outerEditor.element);
}, "Active element should be 'outerEditor' after Selection.setBaseAndExtent() with a range between start of the first text node of 'outerEditor' and end of the first text node of 'innerEditor' (common editing host is outerEditor) when active element is 'editor'");
test(function() {
resetFocusAndSelectionRange(editor);
document.getSelection().setBaseAndExtent(innerEditor.textNode, 0,
staticAfter.textNode, staticAfter.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range between start of the first text node of 'innerEditor' and end of the first text node of 'staticAfter' (no common editing host) when active element is 'editor'");
test(function() {
resetFocusAndSelectionRange(editor);
document.getSelection().setBaseAndExtent(innerEditor.textNode, 0,
anchor.textNode, anchor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range between start of the first text node of 'innerEditor' and end of the first text node of 'anchor' (no common editing host) when active element is 'editor'");
test(function() {
resetFocusAndSelectionRange(outerEditor);
document.getSelection().setBaseAndExtent(staticBefore.textNode, 0,
editor.textNode, editor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range between start of the first text node of 'staticBefore' and end of the first text node of 'editor' (no common editing host) when active element is 'outerEditor'");
test(function() {
resetFocusAndSelectionRange(outerEditor);
document.getSelection().setBaseAndExtent(editor.textNode, 0,
outerEditor.textNode, outerEditor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range between start of the first text node of 'editor' and end of the first text node of 'outerEditor' (no common editing host) when active element is 'outerEditor'");
test(function() {
resetFocusAndSelectionRange(outerEditor);
document.getSelection().setBaseAndExtent(outerEditor.textNode, 0,
staticInEditor.textNode, staticInEditor.textLength);
assert_equals(document.activeElement, outerEditor.element);
}, "Active element should be 'outerEditor' after Selection.setBaseAndExtent() with a range between start of the first text node of 'outerEditor' and end of the first text node of 'staticInEditor' (common editing host is outerEditor) when active element is 'outerEditor'");
test(function() {
resetFocusAndSelectionRange(outerEditor);
document.getSelection().setBaseAndExtent(staticInEditor.textNode, 0,
innerEditor.textNode, innerEditor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range between start of the first text node of 'staticInEditor' and end of the first text node of 'innerEditor' (no common editing host) when active element is 'outerEditor'");
test(function() {
resetFocusAndSelectionRange(outerEditor);
document.getSelection().setBaseAndExtent(outerEditor.textNode, 0,
innerEditor.textNode, innerEditor.textLength);
assert_equals(document.activeElement, outerEditor.element);
}, "Active element should be 'outerEditor' after Selection.setBaseAndExtent() with a range between start of the first text node of 'outerEditor' and end of the first text node of 'innerEditor' (common editing host is outerEditor) when active element is 'outerEditor'");
test(function() {
resetFocusAndSelectionRange(outerEditor);
document.getSelection().setBaseAndExtent(innerEditor.textNode, 0,
staticAfter.textNode, staticAfter.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range between start of the first text node of 'innerEditor' and end of the first text node of 'staticAfter' (no common editing host) when active element is 'outerEditor'");
test(function() {
resetFocusAndSelectionRange(outerEditor);
document.getSelection().setBaseAndExtent(innerEditor.textNode, 0,
anchor.textNode, anchor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range between start of the first text node of 'innerEditor' and end of the first text node of 'anchor' (no common editing host) when active element is 'outerEditor'");
test(function() {
resetFocusAndSelectionRange(innerEditor);
document.getSelection().setBaseAndExtent(staticBefore.textNode, 0,
editor.textNode, editor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range between start of the first text node of 'staticBefore' and end of the first text node of 'editor' (no common editing host) when active element is 'innerEditor'");
test(function() {
resetFocusAndSelectionRange(innerEditor);
document.getSelection().setBaseAndExtent(editor.textNode, 0,
outerEditor.textNode, outerEditor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range between start of the first text node of 'editor' and end of the first text node of 'outerEditor' (no common editing host) when active element is 'innerEditor'");
test(function() {
resetFocusAndSelectionRange(innerEditor);
document.getSelection().setBaseAndExtent(outerEditor.textNode, 0,
staticInEditor.textNode, staticInEditor.textLength);
assert_equals(document.activeElement, outerEditor.element);
}, "Active element should be 'outerEditor' after Selection.setBaseAndExtent() with a range between start of the first text node of 'outerEditor' and end of the first text node of 'staticInEditor' (common editing host is outerEditor) when active element is 'innerEditor'");
test(function() {
resetFocusAndSelectionRange(innerEditor);
document.getSelection().setBaseAndExtent(staticInEditor.textNode, 0,
innerEditor.textNode, innerEditor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range between start of the first text node of 'staticInEditor' and end of the first text node of 'innerEditor' (no common editing host) when active element is 'innerEditor'");
test(function() {
resetFocusAndSelectionRange(innerEditor);
document.getSelection().setBaseAndExtent(outerEditor.textNode, 0,
innerEditor.textNode, innerEditor.textLength);
assert_equals(document.activeElement, outerEditor.element);
}, "Active element should be 'outerEditor' after Selection.setBaseAndExtent() with a range between start of the first text node of 'outerEditor' and end of the first text node of 'innerEditor' (common editing host is outerEditor) when active element is 'innerEditor'");
test(function() {
resetFocusAndSelectionRange(innerEditor);
document.getSelection().setBaseAndExtent(innerEditor.textNode, 0,
staticAfter.textNode, staticAfter.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range between start of the first text node of 'innerEditor' and end of the first text node of 'staticAfter' (no common editing host) when active element is 'innerEditor'");
test(function() {
resetFocusAndSelectionRange(innerEditor);
document.getSelection().setBaseAndExtent(innerEditor.textNode, 0,
anchor.textNode, anchor.textLength);
assert_equals(document.activeElement, document.body);
}, "Active element should be the <body> after Selection.setBaseAndExtent() with a range between start of the first text node of 'innerEditor' and end of the first text node of 'anchor' (no common editing host) when active element is 'innerEditor'");
test(function() {
resetFocusAndSelectionRange(anchor);
document.getSelection().setBaseAndExtent(staticBefore.textNode, 0,
editor.textNode, editor.textLength);
assert_equals(document.activeElement, anchor.element);
}, "Active element should be 'anchor' after Selection.setBaseAndExtent() with a range between start of the first text node of 'staticBefore' and end of the first text node of 'editor' (no common editing host) when active element is 'anchor'");
test(function() {
resetFocusAndSelectionRange(anchor);
document.getSelection().setBaseAndExtent(editor.textNode, 0,
outerEditor.textNode, outerEditor.textLength);
assert_equals(document.activeElement, anchor.element);
}, "Active element should be 'anchor' after Selection.setBaseAndExtent() with a range between start of the first text node of 'editor' and end of the first text node of 'outerEditor' (no common editing host) when active element is 'anchor'");
test(function() {
resetFocusAndSelectionRange(anchor);
document.getSelection().setBaseAndExtent(outerEditor.textNode, 0,
staticInEditor.textNode, staticInEditor.textLength);
assert_equals(document.activeElement, outerEditor.element);
}, "Active element should be 'outerEditor' after Selection.setBaseAndExtent() with a range between start of the first text node of 'outerEditor' and end of the first text node of 'staticInEditor' (common editing host is outerEditor) when active element is 'anchor'");
test(function() {
resetFocusAndSelectionRange(anchor);
document.getSelection().setBaseAndExtent(staticInEditor.textNode, 0,
innerEditor.textNode, innerEditor.textLength);
assert_equals(document.activeElement, anchor.element);
}, "Active element should be 'anchor' after Selection.setBaseAndExtent() with a range between start of the first text node of 'staticInEditor' and end of the first text node of 'innerEditor' (no common editing host) when active element is 'anchor'");
test(function() {
resetFocusAndSelectionRange(anchor);
document.getSelection().setBaseAndExtent(outerEditor.textNode, 0,
innerEditor.textNode, innerEditor.textLength);
assert_equals(document.activeElement, outerEditor.element);
}, "Active element should be 'outerEditor' after Selection.setBaseAndExtent() with a range between start of the first text node of 'outerEditor' and end of the first text node of 'innerEditor' (common editing host is outerEditor) when active element is 'anchor'");
test(function() {
resetFocusAndSelectionRange(anchor);
document.getSelection().setBaseAndExtent(innerEditor.textNode, 0,
staticAfter.textNode, staticAfter.textLength);
assert_equals(document.activeElement, anchor.element);
}, "Active element should be 'anchor' after Selection.setBaseAndExtent() with a range between start of the first text node of 'innerEditor' and end of the first text node of 'staticAfter' (no common editing host) when active element is 'anchor'");
test(function() {
resetFocusAndSelectionRange(anchor);
document.getSelection().setBaseAndExtent(innerEditor.textNode, 0,
anchor.textNode, anchor.textLength);
assert_equals(document.activeElement, anchor.element);
}, "Active element should be 'anchor' after Selection.setBaseAndExtent() with a range between start of the first text node of 'innerEditor' and end of the first text node of 'anchor' (no common editing host) when active element is 'anchor'");
</script>