mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1140878 - Move SwitchDocumentDirection() to toolkit/content/browser-content.js so it can be safely used in e10s. r=mconley
This commit is contained in:
parent
e80d9e5e73
commit
320c3c45bf
@ -317,7 +317,9 @@
|
||||
hidden="true"
|
||||
label="&bidiSwitchPageDirectionItem.label;"
|
||||
accesskey="&bidiSwitchPageDirectionItem.accesskey;"
|
||||
oncommand="SwitchDocumentDirection(window.content)"/>
|
||||
oncommand="gBrowser.selectedBrowser
|
||||
.messageManager
|
||||
.sendAsyncMessage('SwitchDocumentDirection');"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
|
||||
|
@ -6489,17 +6489,6 @@ function AddKeywordForSearchField() {
|
||||
}, window);
|
||||
}
|
||||
|
||||
function SwitchDocumentDirection(aWindow) {
|
||||
// document.dir can also be "auto", in which case it won't change
|
||||
if (aWindow.document.dir == "ltr" || aWindow.document.dir == "") {
|
||||
aWindow.document.dir = "rtl";
|
||||
} else if (aWindow.document.dir == "rtl") {
|
||||
aWindow.document.dir = "ltr";
|
||||
}
|
||||
for (var run = 0; run < aWindow.frames.length; run++)
|
||||
SwitchDocumentDirection(aWindow.frames[run]);
|
||||
}
|
||||
|
||||
function convertFromUnicode(charset, str)
|
||||
{
|
||||
try {
|
||||
|
@ -1649,7 +1649,7 @@ nsContextMenu.prototype = {
|
||||
},
|
||||
|
||||
switchPageDirection: function CM_switchPageDirection() {
|
||||
SwitchDocumentDirection(this.browser.contentWindowAsCPOW);
|
||||
this.browser.messageManager.sendAsyncMessage("SwitchDocumentDirection");
|
||||
},
|
||||
|
||||
mediaCommand : function CM_mediaCommand(command, data) {
|
||||
|
@ -540,3 +540,19 @@ let Printing = {
|
||||
}
|
||||
Printing.init();
|
||||
|
||||
function SwitchDocumentDirection(aWindow) {
|
||||
// document.dir can also be "auto", in which case it won't change
|
||||
if (aWindow.document.dir == "ltr" || aWindow.document.dir == "") {
|
||||
aWindow.document.dir = "rtl";
|
||||
} else if (aWindow.document.dir == "rtl") {
|
||||
aWindow.document.dir = "ltr";
|
||||
}
|
||||
for (let run = 0; run < aWindow.frames.length; run++) {
|
||||
SwitchDocumentDirection(aWindow.frames[run]);
|
||||
}
|
||||
}
|
||||
|
||||
addMessageListener("SwitchDocumentDirection", () => {
|
||||
SwitchDocumentDirection(content.window);
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user