Bug 1472555 - Part 2 - Convert DOM tests to use the "richlistbox" element. r=bz
MozReview-Commit-ID: 4byIEZCsyw7
--- a/dom/tests/mochitest/chrome/window_focus.xul
+++ b/dom/tests/mochitest/chrome/window_focus.xul
@@ -294,17 +294,17 @@ function mouseWillTriggerFocus(element)
if (element.namespaceURI == "http://www.w3.org/1999/xhtml") {
// links are special. They can be focused but show no focus ring
if (element.localName == "a" || element.localName == "div" ||
element.localName == "select" ||
element.localName == "input" && (element.type == "text" ||
element.type == "password")) {
return true;
}
- } else if (element.localName == "listbox") {
+ } else if (element.localName == "richlistbox") {
return true;
}
return false;
}
function mouseOnElement(element, expectedElement, focusChanged, testid)
{
@@ -452,17 +452,17 @@ function startTest()
var element = getById("t" + idx);
// skip area elements, as getBoundingClientRect doesn't return their actual coordinates
if (element.localName == "area")
continue;
mouseOnElement(element, getById("t" + idx), true, "mouse on element t" + idx);
var expectedWindow = (element.ownerGlobal == gChildWindow) ? gChildWindow : window;
- if (element.localName == "listbox" && expectedWindow == window &&
+ if (element.localName == "richlistbox" && expectedWindow == window &&
navigator.platform.indexOf("Mac") == 0) {
// after focusing a listbox on Mac, clear the focus before continuing.
setFocusTo(null, window);
}
}
ok(t19.selectionStart == t19.selectionEnd, "input focused from mouse selection");
@@ -1629,34 +1629,34 @@ SimpleTest.waitForFocus(startTest);
The elements with ids starting with n are:
odd numbered ids - not focusable with -moz-user-focus: none
even numbered ids - focusable but not part of the tab order
-->
<vbox id="buttonbox">
<hbox id="innerbox">
<button id="t4" accesskey="h" label="no tabindex"/>
<button id="o1" accesskey="i" label="tabindex = -1" tabindex="-1"/>
- <listbox id="t5" label="tabindex = 0" tabindex="0" rows="1">
- <listitem/>
- </listbox>
+ <richlistbox id="t5" label="tabindex = 0" tabindex="0" width="50">
+ <richlistitem height="10"/>
+ </richlistbox>
<button id="t1" label="tabindex = 2" tabindex="2"/>
</hbox>
<hbox>
<button id="o2" accesskey="o" style="-moz-user-focus: ignore;" label="no tabindex"/>
<button id="o4" style="-moz-user-focus: ignore;" label="tabindex = -1" tabindex="-1"/>
<button id="t6" style="-moz-user-focus: ignore;" label="tabindex = 0" tabindex="0"/>
<button id="t2" style="-moz-user-focus: ignore;" label="tabindex = 2" tabindex="2"/>
</hbox>
<hbox id="specialroot">
<button id="t7" style="-moz-user-focus: normal;" label="no tabindex"/>
<button id="o3" style="-moz-user-focus: normal;" label="tabindex = -1" tabindex="-1"/>
<button id="t8" style="-moz-user-focus: normal;" label="tabindex = 0" tabindex="0"/>
- <listbox id="t3" style="-moz-user-focus: normal;" label="tabindex = 2" tabindex="2" rows="1">
- <listitem/>
- </listbox>
+ <richlistbox id="t3" style="-moz-user-focus: normal;" label="tabindex = 2" tabindex="2" width="50">
+ <richlistitem height="10"/>
+ </richlistbox>
</hbox>
<hbox>
<button accesskey="p" style="display: none;"/> <button accesskey="q" style="visibility: collapse;"/>
<button style="display: none;" tabindex="2"/> <button style="visibility: collapse;" tabindex="2"/>
</hbox>
<hbox>
<button id="o20" accesskey="s" label="no tabindex" disabled="true"/>
<button id="o22" label="tabindex = -1" tabindex="-1" disabled="true"/>
@@ -1704,17 +1704,17 @@ SimpleTest.waitForFocus(startTest);
<description label="o" accesskey="v"/>
<button id="t38"/>
<!-- The 't' element tests end here so it doesn't matter that these elements are tabbable -->
<label id="aj" value="j" accesskey="j" control="o9"/>
<label id="ak" accesskey="k" control="n4">k</label>
<checkbox id="o5"/><checkbox id="o7"/><hbox><checkbox id="o9"/></hbox>
<checkbox id="o13"/><checkbox id="o15"/><checkbox id="o17"/><checkbox id="o19"/><checkbox id="o21"/><checkbox id="o23"/><checkbox id="o25"/>
<checkbox id="n2"/><checkbox id="n4"/>
-<listbox id="last" width="20" rows="1"/>
+<richlistbox id="last" width="20" height="20"/>
<iframe id="ifa" width="40" height="60" style="-moz-user-focus: ignore;" type="content"
src="data:text/html,<input id=fra size='2'><input id='fra-b' size='2'>
<iframe src='data:text/html,<input id=frc><iframe src="data:text/html,<input id=frd>"></iframe>'></iframe>"/>
<iframe id="ifb" width="20" height="20" style="-moz-user-focus: ignore;"
src="data:text/html,<input id=frd></iframe>"/>
</hbox>
--- a/dom/tests/mochitest/general/test_focusrings.xul
+++ b/dom/tests/mochitest/general/test_focusrings.xul
@@ -156,19 +156,19 @@ function testHTMLElements(list, isMac, e
}
}
SimpleTest.waitForFocus(runTest);
]]>
</script>
-<listbox id="l1" class="plain" height="20"/>
-<listbox id="l2" class="plain" height="20"/>
-<listbox id="l3" class="plain" height="20"/>
+<richlistbox id="l1" class="plain" height="20"/>
+<richlistbox id="l2" class="plain" height="20"/>
+<richlistbox id="l3" class="plain" height="20"/>
<button id="b1" label="Button"/>
<button id="b2" label="Button"/>
<button id="b3" label="Button"/>
<iframe id="child" src="file_focusrings.html"/>
<body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>