mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 910741 fix opening tabs from clicked links in share panel, r=felipe
This commit is contained in:
parent
4b78a28954
commit
a2404b3aa3
@ -322,7 +322,10 @@ SocialUI = {
|
||||
let containerParent = container.parentNode;
|
||||
if (containerParent.classList.contains("social-panel") &&
|
||||
containerParent instanceof Ci.nsIDOMXULPopupElement) {
|
||||
containerParent.hidePopup();
|
||||
// allow the link traversal to finish before closing the panel
|
||||
setTimeout(() => {
|
||||
containerParent.hidePopup();
|
||||
}, 0);
|
||||
}
|
||||
},
|
||||
|
||||
@ -693,7 +696,7 @@ SocialShare = {
|
||||
|
||||
onHidden: function() {
|
||||
this.shareButton.removeAttribute("open");
|
||||
this.iframe.setAttribute("src", "data:text/plain;charset=utf8,")
|
||||
this.iframe.setAttribute("src", "data:text/plain;charset=utf8,");
|
||||
this.currentShare = null;
|
||||
},
|
||||
|
||||
|
@ -133,12 +133,10 @@ var tests = {
|
||||
|
||||
function onTabOpen(event) {
|
||||
gBrowser.tabContainer.removeEventListener("TabOpen", onTabOpen, true);
|
||||
is(panel.state, "closed", "flyout should be closed");
|
||||
ok(true, "Link should open a new tab");
|
||||
executeSoon(function(){
|
||||
waitForCondition(function() { return panel.state == "closed" }, function() {
|
||||
gBrowser.removeTab(event.target);
|
||||
next();
|
||||
});
|
||||
}, "panel should close after tab open");
|
||||
}
|
||||
|
||||
let panel = document.getElementById("social-flyout-panel");
|
||||
@ -154,7 +152,7 @@ var tests = {
|
||||
if (e.data.result == "shown") {
|
||||
// click on our test link
|
||||
is(panel.state, "open", "flyout should be open");
|
||||
gBrowser.tabContainer.addEventListener("TabOpen", onTabOpen, true);
|
||||
gBrowser.tabContainer.addEventListener("TabOpen", onTabOpen, true);
|
||||
let iframe = panel.firstChild;
|
||||
iframe.contentDocument.getElementById('traversal').click();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user