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:
Dão Gottwald 2018-12-11 14:18:21 +00:00
Родитель 6ade81cf51
Коммит 3d299c83ff
3 изменённых файлов: 3 добавлений и 11 удалений

Просмотреть файл

@ -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";