transitionendイベントを自力で捕捉するのをやめた

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@7206 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2010-09-15 02:24:41 +00:00
parent e7b9ee61e7
commit bd69ffca98
2 changed files with 13 additions and 29 deletions

View File

@ -74,13 +74,21 @@ tabbrowser[treestyletab-mode="vertical"] .tabs-stack > *:first-child + * > hbox:
-moz-box-flex: 1 !important; -moz-box-flex: 1 !important;
} }
.tabbrowser-tabs[treestyletab-mode="vertical"] /**
.tabbrowser-tab:not([treestyletab-removed="true"]):not([pinned]), * Firefox 4.0 finishes opening and closing processes of tabs by its
.tabbrowser-tabs[treestyletab-mode="vertical"] * "transitionend" events about max-width property. I think this is very
.tabbrowser-tab:not([treestyletab-removed="true"]):not([fadein]) { * dirty and specific implementation but it won't fixed.
max-width: none !important; * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=585417#c3 )
* So we have to define max-width for both states [fadein] (means "completely
* opened") and :not([fadein]) (means "in opening/removing process".
*/
.tabbrowser-tabs[treestyletab-mode="vertical"] .tabbrowser-tab:not([pinned]) {
max-width: 65000px !important;
min-width: 1px !important; min-width: 1px !important;
} }
.tabbrowser-tabs[treestyletab-mode="vertical"] .tabbrowser-tab:not([pinned])[fadein] {
max-width: 65001px !important;
}
/* pinned tabs on Firefox 4.0 */ /* pinned tabs on Firefox 4.0 */
.tabbrowser-tabs[treestyletab-mode="vertical"] .tabbrowser-tabs[treestyletab-mode="vertical"]

View File

@ -278,7 +278,6 @@ TreeStyleTabBrowser.prototype = {
b.mTabContainer.addEventListener('TabMove', this, true); b.mTabContainer.addEventListener('TabMove', this, true);
b.mTabContainer.addEventListener('SSTabRestoring', this, true); b.mTabContainer.addEventListener('SSTabRestoring', this, true);
b.mTabContainer.addEventListener('SSTabRestored', this, true); b.mTabContainer.addEventListener('SSTabRestored', this, true);
b.mTabContainer.addEventListener('transitionend', this, true);
b.mTabContainer.addEventListener('DOMAttrModified', this, true); b.mTabContainer.addEventListener('DOMAttrModified', this, true);
b.mTabContainer.addEventListener('mouseover', this, true); b.mTabContainer.addEventListener('mouseover', this, true);
b.mTabContainer.addEventListener('mouseout', this, true); b.mTabContainer.addEventListener('mouseout', this, true);
@ -1565,7 +1564,6 @@ TreeStyleTabBrowser.prototype = {
b.mTabContainer.removeEventListener('TabMove', this, true); b.mTabContainer.removeEventListener('TabMove', this, true);
b.mTabContainer.removeEventListener('SSTabRestoring', this, true); b.mTabContainer.removeEventListener('SSTabRestoring', this, true);
b.mTabContainer.removeEventListener('SSTabRestored', this, true); b.mTabContainer.removeEventListener('SSTabRestored', this, true);
b.mTabContainer.removeEventListener('transitionend', this, true);
b.mTabContainer.removeEventListener('DOMAttrModified', this, true); b.mTabContainer.removeEventListener('DOMAttrModified', this, true);
b.mTabContainer.removeEventListener('mouseover', this, true); b.mTabContainer.removeEventListener('mouseover', this, true);
b.mTabContainer.removeEventListener('mouseout', this, true); b.mTabContainer.removeEventListener('mouseout', this, true);
@ -1917,9 +1915,6 @@ TreeStyleTabBrowser.prototype = {
case 'SSTabRestored': case 'SSTabRestored':
return this.onTabRestored(aEvent); return this.onTabRestored(aEvent);
case 'transitionend':
return this.onTabAnimationEnd(aEvent);
case 'DOMAttrModified': case 'DOMAttrModified':
return this.onDOMAttrModified(aEvent); return this.onDOMAttrModified(aEvent);
@ -2830,25 +2825,6 @@ TreeStyleTabBrowser.prototype = {
TreeStyleTabService.restoringTree = TreeStyleTabService.getRestoringTabsCount() > 0; TreeStyleTabService.restoringTree = TreeStyleTabService.getRestoringTabsCount() > 0;
}, },
onTabAnimationEnd : function TSTBrowser_onTabAnimationEnd(aEvent)
{
/*
"transitionend" event isn't fired multiplly, so, Firefox's
default handler possibly fails to handle animation end
because it watches only "max-width" property.
For safety, I decided to clean up all of removing tabs
by any animation end.
*/
var tab = aEvent.target;
var b = this.browser;
if (tab.localName == 'tab' && b) {
if (tab.getAttribute('fadein') == 'true')
b.tabContainer._handleNewTab(tab);
else if (b._removingTabs.indexOf(tab) > -1)
b._endRemoveTab(tab);
}
},
onDOMAttrModified : function TSTBrowser_onDOMAttrModified(aEvent) onDOMAttrModified : function TSTBrowser_onDOMAttrModified(aEvent)
{ {
switch (aEvent.attrName) switch (aEvent.attrName)