mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 733339 - part 3: make the content window passed to gPageStyleMenu.switchStyleSheet optional. r=dolske
This commit is contained in:
parent
1a317a9cc9
commit
20bb7944b3
@ -292,7 +292,7 @@
|
||||
<menu id="pageStyleMenu" label="&pageStyleMenu.label;"
|
||||
accesskey="&pageStyleMenu.accesskey;" observes="isImage">
|
||||
<menupopup onpopupshowing="gPageStyleMenu.fillPopup(this);"
|
||||
oncommand="gPageStyleMenu.switchStyleSheet(window.content, event.target.getAttribute('data'));">
|
||||
oncommand="gPageStyleMenu.switchStyleSheet(event.target.getAttribute('data'));">
|
||||
<menuitem id="menu_pageStyleNoStyle"
|
||||
label="&pageStyleNoStyle.label;"
|
||||
accesskey="&pageStyleNoStyle.accesskey;"
|
||||
|
@ -6175,9 +6175,9 @@ var gPageStyleMenu = {
|
||||
this._stylesheetSwitchAll(frameset.frames[i], title);
|
||||
},
|
||||
|
||||
switchStyleSheet: function (contentWindow, title) {
|
||||
switchStyleSheet: function (title, contentWindow) {
|
||||
getMarkupDocumentViewer().authorStyleDisabled = false;
|
||||
this._stylesheetSwitchAll(contentWindow, title);
|
||||
this._stylesheetSwitchAll(contentWindow || content, title);
|
||||
},
|
||||
|
||||
disableStyle: function () {
|
||||
@ -6188,7 +6188,9 @@ var gPageStyleMenu = {
|
||||
/* Legacy global page-style functions */
|
||||
var getAllStyleSheets = gPageStyleMenu.getAllStyleSheets.bind(gPageStyleMenu);
|
||||
var stylesheetFillPopup = gPageStyleMenu.fillPopup.bind(gPageStyleMenu);
|
||||
var stylesheetSwitchAll = gPageStyleMenu.switchStyleSheet.bind(gPageStyleMenu);
|
||||
function stylesheetSwitchAll(contentWindow, title) {
|
||||
gPageStyleMenu.switchStyleSheet(title, contentWindow);
|
||||
}
|
||||
function setStyleDisabled(disabled) {
|
||||
if (disabled)
|
||||
gPageStyleMenu.disableStyle();
|
||||
|
@ -50,7 +50,7 @@ function test() {
|
||||
Array.forEach(tab.linkedBrowser.contentDocument.styleSheets, function(aSS, aIx) {
|
||||
pendingCount++;
|
||||
let ssTitle = aSS.title;
|
||||
gPageStyleMenu.switchStyleSheet(tab.linkedBrowser.contentWindow, ssTitle);
|
||||
gPageStyleMenu.switchStyleSheet(ssTitle, tab.linkedBrowser.contentWindow);
|
||||
|
||||
let newTab = gBrowser.duplicateTab(tab);
|
||||
newTab.linkedBrowser.addEventListener("load", function(aEvent) {
|
||||
|
Loading…
Reference in New Issue
Block a user