diff options
Diffstat (limited to 'widget/tests/window_imestate_iframes.html')
-rw-r--r-- | widget/tests/window_imestate_iframes.html | 100 |
1 files changed, 74 insertions, 26 deletions
diff --git a/widget/tests/window_imestate_iframes.html b/widget/tests/window_imestate_iframes.html index c8b182977f..3c2d0908ae 100644 --- a/widget/tests/window_imestate_iframes.html +++ b/widget/tests/window_imestate_iframes.html @@ -49,6 +49,8 @@ function onUnload() { var gFocusObservingElement = null; var gBlurObservingElement = null; +var canTabMoveFocusToRootElement = + !SpecialPowers.getBoolPref("dom.disable_tab_focus_to_root_element"); function onFocus(aEvent) { if (aEvent.target != gFocusObservingElement) { @@ -201,18 +203,30 @@ function runTests() { root = iframe.contentDocument.documentElement; resetFocusToInput("initializing for iframe_not_editable"); - testTabKey(true, root, false, prev, true, - false, "input#prev[readonly] -> html"); - testTabKey(true, editor, true, root, false, - true, "html -> input in the subdoc"); + if (canTabMoveFocusToRootElement) { + testTabKey(true, root, false, prev, true, + false, "input#prev[readonly] -> html"); + testTabKey(true, editor, true, root, false, + true, "html -> input in the subdoc"); + } else { + testTabKey(true, editor, true, prev, true, + true, "input#prev[readonly] -> input in the subdoc"); + } testTabKey(true, next, true, editor, true, false, "input in the subdoc -> input#next[readonly]"); testTabKey(false, editor, true, next, true, true, "input#next[readonly] -> input in the subdoc"); - testTabKey(false, root, false, editor, true, - false, "input in the subdoc -> html"); - testTabKey(false, prev, true, root, false, - false, "html -> input#next[readonly]"); + if (canTabMoveFocusToRootElement) { + testTabKey(false, root, false, editor, true, + false, "input in the subdoc -> html"); + testTabKey(false, prev, true, root, false, + false, "html -> input#next[readonly]"); + } else { + testTabKey(false, prev, true, editor, true, + false, "input in the subdoc -> input#prev[readonly]"); + testTabKey(false, next, true, prev, true, + false, "input#prev[readonly] -> input#next[readonly]"); + } iframe.style.display = "none"; @@ -236,8 +250,13 @@ function runTests() { resetFocusToParentHTML("testing iframe_html"); testTabKey(true, editor, true, html, false, true, "html of parent -> html[contentediable=true]"); - testTabKey(false, html, false, editor, true, - false, "html[contenteditable=true] -> html of parent"); + if (canTabMoveFocusToRootElement) { + testTabKey(false, html, false, editor, true, + false, "html[contenteditable=true] -> html of parent"); + } else { + testTabKey(false, next, true, editor, true, + false, "html[contenteditable=true] -> input#next[readonly]"); + } prev.style.display = "inline"; resetFocusToInput("after parent html <-> html[contenteditable=true]"); @@ -270,8 +289,13 @@ function runTests() { resetFocusToParentHTML("testing iframe_designMode"); testTabKey(true, root, false, html, false, true, "html of parent -> html in designMode"); - testTabKey(false, html, false, root, false, - false, "html in designMode -> html of parent"); + if (canTabMoveFocusToRootElement) { + testTabKey(false, html, false, root, false, + false, "html[contenteditable=true] -> html of parent"); + } else { + testTabKey(false, next, true, root, false, + false, "html in designMode -> html of parent"); + } prev.style.display = "inline"; resetFocusToInput("after parent html <-> html in designMode"); @@ -302,8 +326,13 @@ function runTests() { resetFocusToParentHTML("testing iframe_body"); testTabKey(true, editor, true, html, false, true, "html of parent -> body[contentediable=true]"); - testTabKey(false, html, false, editor, true, - false, "body[contenteditable=true] -> html of parent"); + if (canTabMoveFocusToRootElement) { + testTabKey(false, html, false, editor, true, + false, "body[contenteditable=true] -> html of parent"); + } else { + testTabKey(false, next, true, editor, true, + false, "body[contenteditable=true] -> input#next[readonly]"); + } prev.style.display = "inline"; resetFocusToInput("after parent html <-> body[contenteditable=true]"); @@ -321,25 +350,44 @@ function runTests() { root = iframe.contentDocument.documentElement; resetFocusToInput("initializing for iframe_p"); - testTabKey(true, root, false, prev, true, - false, "input#prev[readonly] -> html (has p[contenteditable=true])"); - testTabKey(true, editor, true, root, false, - true, "html (has p[contenteditable=true]) -> p[contentediable=true]"); + if (canTabMoveFocusToRootElement) { + testTabKey(true, root, false, prev, true, + false, "input#prev[readonly] -> html (has p[contenteditable=true])"); + testTabKey(true, editor, true, root, false, + true, "html (has p[contenteditable=true]) -> p[contentediable=true]"); + } else { + testTabKey(true, editor, true, prev, true, + true, "input#prev[readonly] -> p[contenteditable=true]"); + } testTabKey(true, next, true, editor, true, false, "p[contentediable=true] -> input#next[readonly]"); testTabKey(false, editor, true, next, true, true, "input#next[readonly] -> p[contentediable=true]"); - testTabKey(false, root, false, editor, true, - false, "p[contenteditable=true] -> html (has p[contenteditable=true])"); - testTabKey(false, prev, true, root, false, - false, "html (has p[contenteditable=true]) -> input#prev[readonly]"); + if (canTabMoveFocusToRootElement) { + testTabKey(false, root, false, editor, true, + false, "p[contenteditable=true] -> html (has p[contenteditable=true])"); + testTabKey(false, prev, true, root, false, + false, "html (has p[contenteditable=true]) -> input#prev[readonly]"); + } else { + testTabKey(false, prev, true, editor, true, + false, "p[contenteditable=true] -> html (has p[contenteditable=true])"); + testTabKey(false, next, true, prev, true, + false, "html (has p[contenteditable=true]) -> input#next[readonly]"); + } prev.style.display = "none"; resetFocusToParentHTML("testing iframe_p"); - testTabKey(true, root, false, html, false, - false, "html of parent -> html (has p[contentediable=true])"); - testTabKey(false, html, false, root, false, - false, "html (has p[contentediable=true]) -> html of parent"); + if (canTabMoveFocusToRootElement) { + testTabKey(true, root, false, html, false, + false, "html of parent -> html (has p[contentediable=true])"); + testTabKey(false, html, false, root, false, + false, "html (has p[contentediable=true]) -> html of parent"); + } else { + testTabKey(true, editor, true, html, false, + true, "html of parent -> p[contentediable=true]"); + testTabKey(false, next, true, editor, true, + false, "p[contentediable=true] -> input#next[readonly]"); + } prev.style.display = "inline"; resetFocusToInput("after parent html <-> html (has p[contentediable=true])"); |