зеркало из https://github.com/mozilla/gecko-dev.git
Bug 596687 - Don't dispatch TabAttrModified after TabClose. r+a=gavin
This commit is contained in:
Родитель
a3ea4001e7
Коммит
58a8831eae
|
@ -888,6 +888,9 @@
|
|||
<method name="_tabAttrModified">
|
||||
<parameter name="aTab"/>
|
||||
<body><![CDATA[
|
||||
if (this._removingTabs.indexOf(aTab) > -1)
|
||||
return;
|
||||
|
||||
// This event should be dispatched when any of these attributes change:
|
||||
// label, crop, busy, image, selected
|
||||
var event = document.createEvent("Events");
|
||||
|
|
|
@ -152,6 +152,7 @@ _BROWSER_FILES = \
|
|||
browser_bug581947.js \
|
||||
browser_bug585830.js \
|
||||
browser_bug592338.js \
|
||||
browser_bug596687.js \
|
||||
browser_contextSearchTabPosition.js \
|
||||
browser_ctrlTab.js \
|
||||
browser_discovery.js \
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
function test() {
|
||||
var tab = gBrowser.addTab(null, {skipAnimation: true});
|
||||
gBrowser.selectedTab = tab;
|
||||
|
||||
var gotTabAttrModified = false;
|
||||
var gotTabClose = false;
|
||||
|
||||
tab.addEventListener("TabClose", function () {
|
||||
gotTabClose = true;
|
||||
|
||||
tab.addEventListener("TabAttrModified", function () {
|
||||
gotTabAttrModified = true;
|
||||
}, false);
|
||||
}, false);
|
||||
|
||||
gBrowser.removeTab(tab);
|
||||
|
||||
ok(gotTabClose, "should have got the TabClose event");
|
||||
ok(!gotTabAttrModified, "shouldn't have got the TabAttrModified event after TabClose");
|
||||
}
|
Загрузка…
Ссылка в новой задаче