Firefox can remove "overflow" property wrongly, by horizontal overflow/underflow on a vertical tab bar.

This commit is contained in:
Piro / SHIMODA Hiroshi 2012-01-15 03:42:51 +09:00
parent 17c7280d05
commit c604a72eec

View File

@ -1264,6 +1264,13 @@ TreeStyleTabBrowser.prototype = {
this.updateTabCollapsed(aTab, aTab.getAttribute(this.kCOLLAPSED) == 'true', true); this.updateTabCollapsed(aTab, aTab.getAttribute(this.kCOLLAPSED) == 'true', true);
}, this); }, this);
// for updateTabbarOverflow(), we should reset the "overflow" now.
b.mTabContainer.removeAttribute('overflow');
let (container = this.document.getAnonymousElementByAttribute(b.mTabContainer, 'class', 'tabs-container')) {
if (container)
container.removeAttribute('overflow');
}
this.updateTabbarState(false); this.updateTabbarState(false);
var self = this; var self = this;
@ -1717,19 +1724,12 @@ TreeStyleTabBrowser.prototype = {
var d = this.document; var d = this.document;
var b = this.mTabBrowser; var b = this.mTabBrowser;
b.mTabContainer.removeAttribute('overflow'); b.mTabContainer.removeAttribute('overflow');
var container = d.getAnonymousElementByAttribute(b.mTabContainer, 'class', 'tabs-container'); var container = d.getAnonymousElementByAttribute(b.mTabContainer, 'class', 'tabs-container') || b.mTabContainer;
if (!container) {
if (this.ownerToolbar)
container = b.mTabContainer;
else
return;
}
if (container != b.mTabContainer)
container.removeAttribute('overflow'); container.removeAttribute('overflow');
var scrollBox = this.scrollBox; var scrollBox = this.scrollBox;
this.window.setTimeout(function() {
scrollBox = d.getAnonymousElementByAttribute(scrollBox, 'anonid', 'scrollbox'); scrollBox = d.getAnonymousElementByAttribute(scrollBox, 'anonid', 'scrollbox');
if (scrollBox) scrollBox = d.getAnonymousNodes(scrollBox)[0]; if (scrollBox) scrollBox = d.getAnonymousNodes(scrollBox)[0];
if ( if (
@ -1740,13 +1740,14 @@ TreeStyleTabBrowser.prototype = {
) )
) { ) {
b.mTabContainer.setAttribute('overflow', true); b.mTabContainer.setAttribute('overflow', true);
if (container != b.mTabContainer)
container.setAttribute('overflow', true); container.setAttribute('overflow', true);
} }
else { else {
b.mTabContainer.removeAttribute('overflow'); b.mTabContainer.removeAttribute('overflow');
if (container != b.mTabContainer)
container.removeAttribute('overflow'); container.removeAttribute('overflow');
} }
}, 100);
}, },
reinitAllTabs : function TSTBrowser_reinitAllTabs(aSouldUpdateCount) reinitAllTabs : function TSTBrowser_reinitAllTabs(aSouldUpdateCount)
@ -4068,7 +4069,15 @@ TreeStyleTabBrowser.prototype = {
if (horizontal) return; if (horizontal) return;
aEvent.stopPropagation(); aEvent.stopPropagation();
this.positionPinnedTabsWithDelay(); this.positionPinnedTabsWithDelay();
if (aEvent.detail == 1) return; if (aEvent.detail == 1) {
/**
* By horizontal overflow/underflow, Firefox can wrongly
* removes "overflow" attribute for vertical tab bar.
* We have to override the result.
*/
this.updateTabbarOverflow();
}
else {
if (aEvent.type == 'overflow') { if (aEvent.type == 'overflow') {
tabs.setAttribute('overflow', 'true'); tabs.setAttribute('overflow', 'true');
this.scrollBoxObject.ensureElementIsVisible(tabs.selectedItem); this.scrollBoxObject.ensureElementIsVisible(tabs.selectedItem);
@ -4076,6 +4085,7 @@ TreeStyleTabBrowser.prototype = {
else { else {
tabs.removeAttribute('overflow'); tabs.removeAttribute('overflow');
} }
}
}, },
onResize : function TSTBrowser_onResize(aEvent) onResize : function TSTBrowser_onResize(aEvent)