зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1511112 - Remove remaining style flushes for getting the UI direction in browser/, except PlacesUIUtils.jsm. r=florian
Differential Revision: https://phabricator.services.mozilla.com/D13536 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
6ade81cf51
Коммит
3d299c83ff
|
@ -2122,13 +2122,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|||
}
|
||||
|
||||
// Set the direction of the popup based on the textbox (bug 649840).
|
||||
// getComputedStyle causes a layout flush, so avoid calling it if a
|
||||
// direction has already been set.
|
||||
if (!this.style.direction) {
|
||||
this.style.direction =
|
||||
aElement.ownerGlobal.getComputedStyle(aElement).direction;
|
||||
}
|
||||
let popupDirection = this.style.direction;
|
||||
let popupDirection = this.style.direction = (RTL_UI ? "rtl" : "ltr");
|
||||
|
||||
// Make the popup span the width of the window. First, set its width.
|
||||
let documentRect =
|
||||
|
|
|
@ -258,9 +258,7 @@ class PageAction {
|
|||
|
||||
headerLabel.value = await this.getStrings(content.heading_text);
|
||||
headerLink.setAttribute("href", SUMO_BASE_URL + content.info_icon.sumo_path);
|
||||
const isRTL = this.window.getComputedStyle(notification).direction === "rtl";
|
||||
const attribute = isRTL ? "left" : "right";
|
||||
headerLink.setAttribute(attribute, 0);
|
||||
headerLink.setAttribute(this.window.RTL_UI ? "left" : "right", 0);
|
||||
headerImage.setAttribute("tooltiptext", await this.getStrings(content.info_icon.label, "tooltiptext"));
|
||||
headerLink.onclick = () => this._sendTelemetry({message_id: id, bucket_id: content.bucket_id, event: "RATIONALE"});
|
||||
|
||||
|
|
|
@ -548,7 +548,7 @@
|
|||
arrowbox.style.transform = "translate(0, " + -offset + "px)";
|
||||
|
||||
// The assigned side stays the same regardless of direction.
|
||||
var isRTL = (window.getComputedStyle(this).direction == "rtl");
|
||||
let isRTL = this.matches(":-moz-locale-dir(rtl)");
|
||||
|
||||
if (position.indexOf("start_") == 0) {
|
||||
container.dir = "reverse";
|
||||
|
|
Загрузка…
Ссылка в новой задаче