mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 7ef7de3f34b1 (bug 594002) because of browser_480148.js failures on Linux.
This commit is contained in:
parent
9dbec5120e
commit
2e1c50ed90
@ -2708,20 +2708,12 @@
|
|||||||
var width = 0;
|
var width = 0;
|
||||||
var scrollButtonWidth = this.getAttribute("overflow") != "true" ? 0 :
|
var scrollButtonWidth = this.getAttribute("overflow") != "true" ? 0 :
|
||||||
this.mTabstrip._scrollButtonDown.scrollWidth;
|
this.mTabstrip._scrollButtonDown.scrollWidth;
|
||||||
var paddingStart = this.mTabstrip.scrollboxPaddingStart;
|
|
||||||
|
|
||||||
for (var i = this.tabbrowser._numPinnedTabs - 1; i >= 0; i--) {
|
for (var i = this.tabbrowser._numPinnedTabs - 1; i >= 0; i--) {
|
||||||
let tab = this.childNodes[i];
|
let tab = this.childNodes[i];
|
||||||
width += tab.scrollWidth;
|
width += tab.scrollWidth;
|
||||||
if (this.getAttribute("overflow") != "true")
|
tab.style.MozMarginStart = - (width + scrollButtonWidth) + "px";
|
||||||
tab.style.MozMarginStart = - (width + scrollButtonWidth) + "px";
|
|
||||||
else
|
|
||||||
tab.style.MozMarginStart = - (width + scrollButtonWidth + paddingStart) + "px";
|
|
||||||
}
|
}
|
||||||
if (width == 0 || this.getAttribute("overflow") != "true")
|
this.style.MozMarginStart = width + "px";
|
||||||
this.style.MozMarginStart = width + "px";
|
|
||||||
else
|
|
||||||
this.style.MozMarginStart = width + paddingStart + "px";
|
|
||||||
this.mTabstrip.ensureElementIsVisible(this.selectedItem, false);
|
this.mTabstrip.ensureElementIsVisible(this.selectedItem, false);
|
||||||
]]></body>
|
]]></body>
|
||||||
</method>
|
</method>
|
||||||
|
@ -46,16 +46,14 @@ function runOverflowTests(aEvent) {
|
|||||||
var element;
|
var element;
|
||||||
|
|
||||||
gBrowser.selectedTab = firstScrollable();
|
gBrowser.selectedTab = firstScrollable();
|
||||||
ok(left(scrollbox) <= left(firstScrollable()), "Selecting the first tab scrolls it into view " +
|
isLeft(firstScrollable(), "Selecting the first tab scrolls it into view");
|
||||||
"(" + left(scrollbox) + " <= " + left(firstScrollable()) + ")");
|
|
||||||
|
|
||||||
element = nextRightElement();
|
element = nextRightElement();
|
||||||
EventUtils.synthesizeMouse(downButton, 1, 1, {});
|
EventUtils.synthesizeMouse(downButton, 1, 1, {});
|
||||||
isRight(element, "Scrolled one tab to the right with a single click");
|
isRight(element, "Scrolled one tab to the right with a single click");
|
||||||
|
|
||||||
gBrowser.selectedTab = tabs[tabs.length - 1];
|
gBrowser.selectedTab = tabs[tabs.length - 1];
|
||||||
ok(right(gBrowser.selectedTab) <= right(scrollbox), "Selecting the last tab scrolls it into view " +
|
isRight(gBrowser.selectedTab, "Selecting the last tab scrolls it into view");
|
||||||
"(" + right(gBrowser.selectedTab) + " <= " + right(scrollbox) + ")");
|
|
||||||
|
|
||||||
element = nextLeftElement();
|
element = nextLeftElement();
|
||||||
EventUtils.synthesizeMouse(upButton, 1, 1, {});
|
EventUtils.synthesizeMouse(upButton, 1, 1, {});
|
||||||
@ -66,13 +64,11 @@ function runOverflowTests(aEvent) {
|
|||||||
isLeft(element, "Scrolled one page of tabs with a double click");
|
isLeft(element, "Scrolled one page of tabs with a double click");
|
||||||
|
|
||||||
EventUtils.synthesizeMouse(upButton, 1, 1, {clickCount: 3});
|
EventUtils.synthesizeMouse(upButton, 1, 1, {clickCount: 3});
|
||||||
var firstScrollableLeft = left(firstScrollable());
|
isLeft(firstScrollable(), "Scrolled to the start with a triple click");
|
||||||
ok(left(scrollbox) <= firstScrollableLeft, "Scrolled to the start with a triple click " +
|
|
||||||
"(" + left(scrollbox) + " <= " + firstScrollableLeft + ")");
|
|
||||||
|
|
||||||
for (var i = 2; i; i--)
|
for (var i = 2; i; i--)
|
||||||
EventUtils.synthesizeMouseScroll(scrollbox, 1, 1, {axis: "horizontal", delta: -1});
|
EventUtils.synthesizeMouseScroll(scrollbox, 1, 1, {axis: "horizontal", delta: -1});
|
||||||
is(left(firstScrollable()), firstScrollableLeft, "Remained at the start with the mouse wheel");
|
isLeft(firstScrollable(), "Remained at the start with the mouse wheel");
|
||||||
|
|
||||||
element = nextRightElement();
|
element = nextRightElement();
|
||||||
EventUtils.synthesizeMouseScroll(scrollbox, 1, 1, {axis: "horizontal", delta: 1});
|
EventUtils.synthesizeMouseScroll(scrollbox, 1, 1, {axis: "horizontal", delta: 1});
|
||||||
|
@ -26,10 +26,7 @@
|
|||||||
collapsed="true"
|
collapsed="true"
|
||||||
xbl:inherits="orient"
|
xbl:inherits="orient"
|
||||||
oncommand="_autorepeatbuttonScroll(event);"/>
|
oncommand="_autorepeatbuttonScroll(event);"/>
|
||||||
<xul:scrollbox class="arrowscrollbox-scrollbox"
|
<xul:scrollbox xbl:inherits="orient,align,pack,dir" flex="1" anonid="scrollbox">
|
||||||
anonid="scrollbox"
|
|
||||||
flex="1"
|
|
||||||
xbl:inherits="orient,align,pack,dir">
|
|
||||||
<children/>
|
<children/>
|
||||||
</xul:scrollbox>
|
</xul:scrollbox>
|
||||||
<xul:autorepeatbutton class="autorepeatbutton-down"
|
<xul:autorepeatbutton class="autorepeatbutton-down"
|
||||||
@ -138,26 +135,7 @@
|
|||||||
this._scrollbox.scrollWidth;
|
this._scrollbox.scrollWidth;
|
||||||
]]></getter>
|
]]></getter>
|
||||||
</property>
|
</property>
|
||||||
<property name="scrollPaddingRect" readonly="true">
|
|
||||||
<getter><![CDATA[
|
|
||||||
// This assumes that this._scrollbox doesn't have any border.
|
|
||||||
var outerRect = this.scrollClientRect;
|
|
||||||
var innerRect = {};
|
|
||||||
innerRect.left = outerRect.left - this._scrollbox.scrollLeft;
|
|
||||||
innerRect.top = outerRect.top - this._scrollbox.scrollTop;
|
|
||||||
innerRect.right = innerRect.left + this._scrollbox.scrollWidth;
|
|
||||||
innerRect.bottom = innerRect.top + this._scrollbox.scrollHeight;
|
|
||||||
return innerRect;
|
|
||||||
]]></getter>
|
|
||||||
</property>
|
|
||||||
<property name="scrollboxPaddingStart" readonly="true">
|
|
||||||
<getter><![CDATA[
|
|
||||||
var ltr = (window.getComputedStyle(this, null).direction == "ltr");
|
|
||||||
var paddingStartName = ltr ? "padding-left" : "padding-right";
|
|
||||||
var scrollboxStyle = window.getComputedStyle(this._scrollbox, null);
|
|
||||||
return parseFloat(scrollboxStyle.getPropertyValue(paddingStartName));
|
|
||||||
]]></getter>
|
|
||||||
</property>
|
|
||||||
<property name="scrollPosition">
|
<property name="scrollPosition">
|
||||||
<getter><![CDATA[
|
<getter><![CDATA[
|
||||||
return this.orient == "vertical" ?
|
return this.orient == "vertical" ?
|
||||||
@ -208,23 +186,6 @@
|
|||||||
rect = element.getBoundingClientRect();
|
rect = element.getBoundingClientRect();
|
||||||
var elementStart = vertical ? rect.top : rect.left;
|
var elementStart = vertical ? rect.top : rect.left;
|
||||||
var elementEnd = vertical ? rect.bottom : rect.right;
|
var elementEnd = vertical ? rect.bottom : rect.right;
|
||||||
|
|
||||||
var scrollPaddingRect = this.scrollPaddingRect;
|
|
||||||
let style = window.getComputedStyle(this._scrollbox, null);
|
|
||||||
var scrollContentRect = {
|
|
||||||
left: scrollPaddingRect.left + parseFloat(style.paddingLeft),
|
|
||||||
top: scrollPaddingRect.top + parseFloat(style.paddingTop),
|
|
||||||
right: scrollPaddingRect.right - parseFloat(style.paddingRight),
|
|
||||||
bottom: scrollPaddingRect.bottom - parseFloat(style.paddingBottom)
|
|
||||||
};
|
|
||||||
|
|
||||||
if (elementStart <= (vertical ? scrollContentRect.top : scrollContentRect.left)) {
|
|
||||||
elementStart = vertical ? scrollPaddingRect.top : scrollPaddingRect.left;
|
|
||||||
}
|
|
||||||
if (elementEnd >= (vertical ? scrollContentRect.bottom : scrollContentRect.right)) {
|
|
||||||
elementEnd = vertical ? scrollPaddingRect.bottom : scrollPaddingRect.right;
|
|
||||||
}
|
|
||||||
|
|
||||||
var amountToScroll;
|
var amountToScroll;
|
||||||
|
|
||||||
if (elementStart < containerStart) {
|
if (elementStart < containerStart) {
|
||||||
@ -582,10 +543,7 @@
|
|||||||
onmouseup="if (event.button == 0) _stopScroll();"
|
onmouseup="if (event.button == 0) _stopScroll();"
|
||||||
onmouseover="_continueScroll(-1);"
|
onmouseover="_continueScroll(-1);"
|
||||||
onmouseout="_pauseScroll();"/>
|
onmouseout="_pauseScroll();"/>
|
||||||
<xul:scrollbox class="arrowscrollbox-scrollbox"
|
<xul:scrollbox xbl:inherits="orient,align,pack,dir" flex="1" anonid="scrollbox">
|
||||||
anonid="scrollbox"
|
|
||||||
flex="1"
|
|
||||||
xbl:inherits="orient,align,pack,dir">
|
|
||||||
<children/>
|
<children/>
|
||||||
</xul:scrollbox>
|
</xul:scrollbox>
|
||||||
<xul:toolbarbutton class="scrollbutton-down" collapsed="true"
|
<xul:toolbarbutton class="scrollbutton-down" collapsed="true"
|
||||||
|
Loading…
Reference in New Issue
Block a user