Trunkで自動スクロールできなくなっていた

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@6715 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2010-06-23 12:00:33 +00:00
parent beac4ea4a6
commit 82af6340fb
2 changed files with 26 additions and 9 deletions

View File

@ -23,7 +23,7 @@ if (typeof window == 'undefined') {
}
(function() {
const currentRevision = 3;
const currentRevision = 4;
if (!('piro.sakura.ne.jp' in window)) window['piro.sakura.ne.jp'] = {};
@ -43,13 +43,7 @@ if (typeof window == 'undefined') {
processAutoScroll : function(aEvent)
{
var target = aEvent.originalTarget;
var b = target.ownerDocument.evaluate(
'ancestor-or-self::*[local-name()="tabbrowser"]',
target,
null,
Ci.nsIDOMXPathResult.FIRST_ORDERED_NODE_TYPE,
null
).singleNodeValue;
var b = this.getTabBrowserFromChild(target);
if (!b) return false;
var tabs = b.mTabContainer;
@ -117,6 +111,29 @@ if (typeof window == 'undefined') {
return true;
},
getTabBrowserFromChild : function(aTabBrowserChild)
{
if (aTabBrowserChild.localName == 'tabbrowser') // itself
return aTabBrowserChild;
if (aTabBrowserChild.tabbrowser) // tabs, Firefox 3.7 or later
return aTabBrowserChild.tabbrowser;
if (aTabBrowserChild.id == 'TabsToolbar') // tabs toolbar, Firefox 3.7 or later
return aTabBrowserChild.getElementsByTagName('tabs')[0].tabbrowser;
var b = aTabBrowserChild.ownerDocument.evaluate(
'ancestor::*[local-name()="tabbrowser"] | '+
'ancestor::*[local-name()="tabs" and @tabbrowser] |'+
'ancestor::*[local-name()="toolbar" and @id="TabsToolbar"]/descendant::*[local-name()="tabs"]',
aTabBrowserChild,
null,
Ci.nsIDOMXPathResult.FIRST_ORDERED_NODE_TYPE,
null
).singleNodeValue;
return (b && b.tabbrowser) || b;
},
getScrollBox : function(aTabBrowser)
{
return aTabBrowser.ownerDocument.getAnonymousElementByAttribute(aTabBrowser.mTabContainer, 'class', 'tabs-frame') || // Tab Mix Plus

View File

@ -930,7 +930,7 @@ var TreeStyleTabUtils = {
var b = this.evaluateXPath(
'ancestor::xul:tabbrowser | '+
'ancestor::xul:tabs[@tabbrowser] |'+
'ancestor::xul:toolbar[@id="TabsToolbar"]',
'ancestor::xul:toolbar[@id="TabsToolbar"]/descendant::xul:tabs',
aTabBrowserChild,
Ci.nsIDOMXPathResult.FIRST_ORDERED_NODE_TYPE
).singleNodeValue;