Bug 1290233 - remove uses of nsIXULChromeRegistry from inspector; r?gregtatum draft
authorTom Tromey <tom@tromey.com>
Wed, 17 Aug 2016 09:09:40 -0600
changeset 402609 7b8940f89fc5244371dc55c283e553973aa33230
parent 401182 52fa735c7cec7333737999f62a43856e7306f6ba
child 528725 80c04f81329a82ae9f8b1a751f64568f2162bc03
push id26715
push userbmo:ttromey@mozilla.com
push dateThu, 18 Aug 2016 15:08:15 +0000
reviewersgregtatum
bugs1290233
milestone51.0a1
Bug 1290233 - remove uses of nsIXULChromeRegistry from inspector; r?gregtatum MozReview-Commit-ID: 4MtmQ2Z4fmm
devtools/client/inspector/computed/computed.js
devtools/client/inspector/layout/layout.js
--- a/devtools/client/inspector/computed/computed.js
+++ b/devtools/client/inspector/computed/computed.js
@@ -150,20 +150,16 @@ function CssComputedView(inspector, docu
   this.styleWindow = this.styleDocument.defaultView;
   this.pageStyle = pageStyle;
 
   this.propertyViews = [];
 
   let cssProperties = getCssProperties(inspector.toolbox);
   this._outputParser = new OutputParser(document, cssProperties.supportsType);
 
-  let chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"]
-    .getService(Ci.nsIXULChromeRegistry);
-  this.getRTLAttr = chromeReg.isLocaleRTL("global") ? "rtl" : "ltr";
-
   // Create bound methods.
   this.focusWindow = this.focusWindow.bind(this);
   this._onContextMenu = this._onContextMenu.bind(this);
   this._onClick = this._onClick.bind(this);
   this._onCopy = this._onCopy.bind(this);
   this._onFilterStyles = this._onFilterStyles.bind(this);
   this._onClearSearch = this._onClearSearch.bind(this);
   this._onIncludeBrowserStyles = this._onIncludeBrowserStyles.bind(this);
@@ -825,17 +821,16 @@ PropertyInfo.prototype = {
  *        The CssComputedView instance we are working with.
  * @param {String} name
  *        The CSS property name for which this PropertyView
  *        instance will render the rules.
  */
 function PropertyView(tree, name) {
   this.tree = tree;
   this.name = name;
-  this.getRTLAttr = tree.getRTLAttr;
 
   this.link = "https://developer.mozilla.org/CSS/" + name;
 
   this._propertyInfo = new PropertyInfo(tree, name);
 }
 
 PropertyView.prototype = {
   // The parent element which contains the open attribute
--- a/devtools/client/inspector/layout/layout.js
+++ b/devtools/client/inspector/layout/layout.js
@@ -1,19 +1,16 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-/* eslint-disable mozilla/reject-some-requires */
-const {Cc, Ci} = require("chrome");
-/* eslint-enable mozilla/reject-some-requires */
 const {Task} = require("devtools/shared/task");
 const {InplaceEditor, editableItem} =
       require("devtools/client/shared/inplace-editor");
 const {ReflowFront} = require("devtools/shared/fronts/layout");
 const {LocalizationHelper} = require("devtools/client/shared/l10n");
 const {getCssProperties} = require("devtools/shared/fronts/css-properties");
 
 const STRINGS_URI = "chrome://devtools/locale/shared.properties";
@@ -318,23 +315,16 @@ LayoutView.prototype = {
         element: this.doc.querySelector(dimension.selector)
       }, (element, event) => {
         this.initEditor(element, event, dimension);
       });
     }
 
     this.onNewNode();
 
-    // Mark document as RTL or LTR:
-    let chromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"]
-                    .getService(Ci.nsIXULChromeRegistry);
-    let dir = chromeReg.isLocaleRTL("global");
-    let container = this.doc.getElementById("layout-container");
-    container.setAttribute("dir", dir ? "rtl" : "ltr");
-
     let nodeGeometry = this.doc.getElementById("layout-geometry-editor");
     this.onGeometryButtonClick = this.onGeometryButtonClick.bind(this);
     nodeGeometry.addEventListener("click", this.onGeometryButtonClick);
   },
 
   initBoxModelHighlighter: function () {
     let highlightElts = this.doc.querySelectorAll("#layout-container *[title]");
     this.onHighlightMouseOver = this.onHighlightMouseOver.bind(this);