Bug 1103993 - part 1 - Rename the style-inspector's highlight methods; r=bgrins
authorPatrick Brosset <pbrosset@mozilla.com>
Wed, 26 Nov 2014 10:18:07 +0100
changeset 217677 906e87fee4a6c9857c3d17e7b3ec383672a041fc
parent 217676 2273193cc52582acd6d89f4963c10d191866815e
child 217678 bcb6a96a383b8be08a1dc251e1bf5a8f58b7997f
push id27887
push userryanvm@gmail.com
push dateThu, 27 Nov 2014 02:08:38 +0000
treeherdermozilla-central@c63e741bca2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1103993
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1103993 - part 1 - Rename the style-inspector's highlight methods; r=bgrins
browser/devtools/styleinspector/computed-view.js
browser/devtools/styleinspector/rule-view.js
browser/devtools/styleinspector/style-inspector.js
--- a/browser/devtools/styleinspector/computed-view.js
+++ b/browser/devtools/styleinspector/computed-view.js
@@ -279,22 +279,22 @@ CssHtmlTree.prototype = {
   _handlePrefChange: function(event, data) {
     if (this._computed && (data.pref == "devtools.defaultColorUnit" ||
         data.pref == PREF_ORIG_SOURCES)) {
       this.refreshPanel();
     }
   },
 
   /**
-   * Update the highlighted element. The CssHtmlTree panel will show the style
-   * information for the given element.
+   * Update the view with a new selected element.
+   * The CssHtmlTree panel will show the style information for the given element.
    * @param {NodeFront} aElement The highlighted node to get styles for.
    * @returns a promise that will be resolved when highlighting is complete.
    */
-  highlight: function(aElement) {
+  selectElement: function(aElement) {
     if (!aElement) {
       this.viewedElement = null;
       this.noResults.hidden = false;
 
       if (this._refreshProcess) {
         this._refreshProcess.cancel();
       }
       // Hiding all properties
--- a/browser/devtools/styleinspector/rule-view.js
+++ b/browser/devtools/styleinspector/rule-view.js
@@ -1445,17 +1445,17 @@ CssRuleView.prototype = {
       this.showUserAgentStyles = Services.prefs.getBoolPref(pref);
     }
 
     // Reselect the currently selected element
     let refreshOnPrefs = [PREF_UA_STYLES, PREF_DEFAULT_COLOR_UNIT];
     if (refreshOnPrefs.indexOf(pref) > -1) {
       let element = this._viewedElement;
       this._viewedElement = null;
-      this.highlight(element);
+      this.selectElement(element);
     }
   },
 
   _onSourcePrefChanged: function() {
     if (this.menuitemSources) {
       let isEnabled = Services.prefs.getBoolPref(PREF_ORIG_SOURCES);
       this.menuitemSources.setAttribute("checked", isEnabled);
     }
@@ -1524,22 +1524,22 @@ CssRuleView.prototype = {
     if (this.elementStyle) {
       this.elementStyle.destroy();
     }
 
     this.popup.destroy();
   },
 
   /**
-   * Update the highlighted element.
+   * Update the view with a new selected element.
    *
    * @param {NodeActor} aElement
    *        The node whose style rules we'll inspect.
    */
-  highlight: function(aElement) {
+  selectElement: function(aElement) {
     if (this._viewedElement === aElement) {
       return promise.resolve(undefined);
     }
 
     this.clear();
 
     this._viewedElement = aElement;
     if (!this._viewedElement) {
--- a/browser/devtools/styleinspector/style-inspector.js
+++ b/browser/devtools/styleinspector/style-inspector.js
@@ -97,23 +97,23 @@ RuleViewTool.prototype = {
     if (!this.view) {
       // Skip the event if RuleViewTool has been destroyed.
       return;
     }
     this.view.setPageStyle(this.inspector.pageStyle);
 
     if (!this.inspector.selection.isConnected() ||
         !this.inspector.selection.isElementNode()) {
-      this.view.highlight(null);
+      this.view.selectElement(null);
       return;
     }
 
     if (!aEvent || aEvent == "new-node-front") {
       let done = this.inspector.updating("rule-view");
-      this.view.highlight(this.inspector.selection.nodeFront).then(done, done);
+      this.view.selectElement(this.inspector.selection.nodeFront).then(done, done);
     }
   },
 
   refresh: function RVT_refresh() {
     this.view.refreshPanel();
   },
 
   _clearUserProperties: function() {
@@ -158,17 +158,17 @@ function ComputedViewTool(aInspector, aW
 
   this._onSelect = this.onSelect.bind(this);
   this.inspector.selection.on("detached", this._onSelect);
   this.inspector.selection.on("new-node-front", this._onSelect);
   this.refresh = this.refresh.bind(this);
   this.inspector.on("layout-change", this.refresh);
   this.inspector.selection.on("pseudoclass", this.refresh);
 
-  this.view.highlight(null);
+  this.view.selectElement(null);
 
   this.onSelect();
 }
 
 exports.ComputedViewTool = ComputedViewTool;
 
 ComputedViewTool.prototype = {
   onSelect: function CVT_onSelect(aEvent)
@@ -176,23 +176,23 @@ ComputedViewTool.prototype = {
     if (!this.view) {
       // Skip the event if ComputedViewTool has been destroyed.
       return;
     }
     this.view.setPageStyle(this.inspector.pageStyle);
 
     if (!this.inspector.selection.isConnected() ||
         !this.inspector.selection.isElementNode()) {
-      this.view.highlight(null);
+      this.view.selectElement(null);
       return;
     }
 
     if (!aEvent || aEvent == "new-node-front") {
       let done = this.inspector.updating("computed-view");
-      this.view.highlight(this.inspector.selection.nodeFront).then(() => {
+      this.view.selectElement(this.inspector.selection.nodeFront).then(() => {
         done();
       });
     }
   },
 
   refresh: function CVT_refresh() {
     this.view.refreshPanel();
   },