mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 00:35:44 +00:00
Bug 1613155 - Set dir property on the HTML element instead of <root>. r=andreio
Differential Revision: https://phabricator.services.mozilla.com/D61591 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
f4ac3e0dc0
commit
45bea3317f
@ -304,7 +304,7 @@ export class ASRouterUISurface extends React.PureComponent {
|
||||
}
|
||||
if (endpoint && endpoint.dir === "rtl") {
|
||||
//Set `dir = rtl` on the HTML
|
||||
this.props.document.getElementById("root").dir = "rtl";
|
||||
this.props.document.dir = "rtl";
|
||||
}
|
||||
ASRouterUtils.addListener(this.onMessageFromParent);
|
||||
this.requestMessage(endpoint);
|
||||
|
@ -2367,7 +2367,7 @@ class ASRouterUISurface extends react__WEBPACK_IMPORTED_MODULE_6___default.a.Pur
|
||||
|
||||
if (endpoint && endpoint.dir === "rtl") {
|
||||
//Set `dir = rtl` on the HTML
|
||||
this.props.document.getElementById("root").dir = "rtl";
|
||||
this.props.document.dir = "rtl";
|
||||
}
|
||||
|
||||
ASRouterUtils.addListener(this.onMessageFromParent);
|
||||
|
@ -204,11 +204,12 @@ describe("ASRouterUISurface", () => {
|
||||
assert.property(stub.firstCall.args[0].detail.data, "sidebar_text");
|
||||
});
|
||||
|
||||
it("should set `dir=rtl` on the page's root element if the dir param is set", () => {
|
||||
it("should set `dir=rtl` on the page's <html> element if the dir param is set", () => {
|
||||
assert.notPropertyVal(fakeDocument, "dir", "rtl");
|
||||
sandbox.stub(ASRouterUtils, "getPreviewEndpoint").returns({ dir: "rtl" });
|
||||
|
||||
wrapper = mount(<ASRouterUISurface document={fakeDocument} />);
|
||||
assert.propertyVal(root, "dir", "rtl");
|
||||
assert.propertyVal(fakeDocument, "dir", "rtl");
|
||||
});
|
||||
|
||||
describe("snippets", () => {
|
||||
|
Loading…
Reference in New Issue
Block a user