Bug 585946 - Location / search bar splitter moves to the end of the toolbar when toggling "tabs on top". r=neil

This commit is contained in:
Dão Gottwald 2012-03-25 18:10:36 +02:00
Родитель 32c252e50a
Коммит 724fa1a182
4 изменённых файлов: 59 добавлений и 4 удалений

Просмотреть файл

@ -2624,6 +2624,7 @@ function UpdateUrlbarSearchSplitterState()
splitter.id = "urlbar-search-splitter";
splitter.setAttribute("resizebefore", "flex");
splitter.setAttribute("resizeafter", "flex");
splitter.setAttribute("skipintoolbarset", "true");
splitter.className = "chromeclass-toolbar-additional";
}
urlbar.parentNode.insertBefore(splitter, ibefore);

Просмотреть файл

@ -109,10 +109,6 @@ _TEST_FILES = findbar_window.xul \
RegisterUnregisterChrome.js \
test_panel.xul \
window_panel.xul \
$(NULL)
_TEST_FILES += \
test_bug360220.xul \
test_bug365773.xul \
test_bug382990.xul \
@ -122,6 +118,7 @@ _TEST_FILES += \
test_bug554279.xul \
test_bug557987.xul\
test_bug562554.xul \
test_bug585946.xul \
test_button.xul \
test_closemenu_attribute.xul \
test_colorpicker_popup.xul \

Просмотреть файл

@ -0,0 +1,51 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
<window title="Toolbar" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="startTest();">
<script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<toolbox>
<toolbarpalette/>
<toolbar id="toolbar" defaultset="node1,node2">
<toolbarbutton id="node1" label="node1" removable="true"/>
<toolbarbutton id="node2" label="node2" removable="true"/>
</toolbar>
</toolbox>
<!-- test resuls are displayed in the html:body -->
<body xmlns="http://www.w3.org/1999/xhtml"
style="height: 300px; overflow: auto;"/>
<!-- test code goes here -->
<script type="application/javascript"><![CDATA[
SimpleTest.waitForExplicitFinish();
function startTest() {
var toolbar = $("toolbar");
var splitter = document.createElement("splitter");
splitter.setAttribute("id", "dynsplitter");
splitter.setAttribute("skipintoolbarset", "true");
toolbar.insertBefore(splitter, $("node2"));
function checkPos() {
is($("dynsplitter").previousSibling, $("node1"));
is($("dynsplitter").nextSibling, $("node2"));
}
checkPos();
toolbar.style.MozBinding = "url(chrome://global/content/bindings/toolbar.xml#toolbar-drag)";
toolbar.clientTop; // style flush
checkPos();
SimpleTest.finish();
}
]]></script>
</window>

Просмотреть файл

@ -180,6 +180,9 @@
<parameter name="aNode"/>
<body>
<![CDATA[
if (aNode.getAttribute("skipintoolbarset") == "true")
return "";
switch (aNode.localName) {
case "toolbarseparator":
return "separator";
@ -213,6 +216,9 @@
<setter>
<![CDATA[
if (val == this.currentSet)
return;
var ids = (val == "__empty") ? [] : val.split(",");
var nodeidx = 0;