Bug 1305007 - RTL: set dir attr. when loading devtools HTML document;r=bgrins
Toolbox sets the dir attribute on a panel document element when loading a panel, if the panel is using a HTML document. Using the ForceRTL addon, the dir attribute should be automatically updated whenever the direction is changed by the addon. MozReview-Commit-ID: 2r18APw7IBs
This commit is contained in:
@@ -335,6 +335,7 @@ Toolbox.prototype = {
|
|||||||
get splitConsole() {
|
get splitConsole() {
|
||||||
return this._splitConsole;
|
return this._splitConsole;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the focused state of the split console
|
* Get the focused state of the split console
|
||||||
*/
|
*/
|
||||||
@@ -1267,6 +1268,16 @@ Toolbox.prototype = {
|
|||||||
// backward compatibility with existing extensions do a check
|
// backward compatibility with existing extensions do a check
|
||||||
// for a promise return value.
|
// for a promise return value.
|
||||||
let built = definition.build(iframe.contentWindow, this);
|
let built = definition.build(iframe.contentWindow, this);
|
||||||
|
|
||||||
|
// Set the dir attribute on the documents of panels using HTML.
|
||||||
|
let docEl = iframe.contentWindow.document.documentElement;
|
||||||
|
if (docEl.namespaceURI === HTML_NS) {
|
||||||
|
let top = this.win.top;
|
||||||
|
let topDocEl = top.document.documentElement;
|
||||||
|
let isRtl = top.getComputedStyle(topDocEl).direction === "rtl";
|
||||||
|
docEl.setAttribute("dir", isRtl ? "rtl" : "ltr");
|
||||||
|
}
|
||||||
|
|
||||||
if (!(typeof built.then == "function")) {
|
if (!(typeof built.then == "function")) {
|
||||||
let panel = built;
|
let panel = built;
|
||||||
iframe.panel = panel;
|
iframe.panel = panel;
|
||||||
|
|||||||
@@ -4,9 +4,6 @@
|
|||||||
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||||
"DTD/xhtml1-strict.dtd">
|
"DTD/xhtml1-strict.dtd">
|
||||||
%htmlDTD;
|
%htmlDTD;
|
||||||
<!ENTITY % globalDTD
|
|
||||||
SYSTEM "chrome://global/locale/global.dtd">
|
|
||||||
%globalDTD;
|
|
||||||
]>
|
]>
|
||||||
|
|
||||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
@@ -19,7 +16,7 @@
|
|||||||
<link rel="stylesheet" href="chrome://devtools/skin/components-frame.css" type="text/css"/>
|
<link rel="stylesheet" href="chrome://devtools/skin/components-frame.css" type="text/css"/>
|
||||||
<link rel="stylesheet" href="chrome://devtools/skin/components-h-split-box.css" type="text/css"/>
|
<link rel="stylesheet" href="chrome://devtools/skin/components-h-split-box.css" type="text/css"/>
|
||||||
</head>
|
</head>
|
||||||
<body class="theme-body" dir="&locale.dir;">
|
<body class="theme-body">
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|
||||||
<script type="application/javascript;version=1.8"
|
<script type="application/javascript;version=1.8"
|
||||||
|
|||||||
Reference in New Issue
Block a user