Backed out changeset 80fc4351eba3 (bug 1157293)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 06 May 2015 11:22:22 +0200
changeset 273924 7ef7668d87e28d94fe9049d45c08bb4eeed4bb46
parent 273923 982706aac495e024aec734383adcf22f7973a2e8
child 273925 be5b6c9881206dd782ddf033ed161f6ce465dd47
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1157293
milestone40.0a1
backs out80fc4351eba389442a868ce3a3d6d45517695d04
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
Backed out changeset 80fc4351eba3 (bug 1157293)
browser/devtools/styleinspector/rule-view.js
browser/devtools/styleinspector/ruleview.css
browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_01.js
browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_02.js
browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_03.js
browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_04.js
browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_05.js
browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_06.js
browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_clear.js
browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_expander.js
--- a/browser/devtools/styleinspector/rule-view.js
+++ b/browser/devtools/styleinspector/rule-view.js
@@ -2131,17 +2131,17 @@ CssRuleView.prototype = {
 
       if (isPropertyHighlighted || isComputedHighlighted) {
         isHighlighted = true;
       }
 
       // Expand the computed list if a computed rule is highlighted and the
       // property rule is not highlighted
       if (!isPropertyHighlighted && isComputedHighlighted &&
-          !editor.computed.hasAttribute("user-open")) {
+          !editor.computed.classList.contains("user-open")) {
         editor.expandForFilter();
         this._editorsExpandedForFilter.push(editor);
       }
     }
 
     return isHighlighted;
   },
 
@@ -3043,53 +3043,52 @@ TextPropertyEditor.prototype = {
     }
     this.prop.setEnabled(!checked);
     aEvent.stopPropagation();
   },
 
   /**
    * Handles clicks on the computed property expander. If the computed list is
    * open due to user expanding or style filtering, collapse the computed list
-   * and close the expander. Otherwise, add user-open attribute which is used to
+   * and close the expander. Otherwise, add .user-open class which is used to
    * expand the computed list and tracks whether or not the computed list is
    * expanded by manually by the user.
    */
   _onExpandClicked: function(aEvent) {
-    if (this.computed.hasAttribute("filter-open") ||
-        this.computed.hasAttribute("user-open")) {
+    if (this.computed.classList.contains("filter-open") ||
+        this.computed.classList.contains("user-open")) {
       this.expander.removeAttribute("open");
-      this.computed.removeAttribute("filter-open");
-      this.computed.removeAttribute("user-open");
+      this.computed.classList.remove("filter-open");
+      this.computed.classList.remove("user-open");
     } else {
       this.expander.setAttribute("open", "true");
-      this.computed.setAttribute("user-open", "");
+      this.computed.classList.add("user-open");
     }
 
     aEvent.stopPropagation();
   },
 
   /**
    * Expands the computed list when a computed property is matched by the style
-   * filtering. The filter-open attribute is used to track whether or not the
+   * filtering. The .filter-open class is used to track whether or not the
    * computed list was toggled opened by the filter.
    */
   expandForFilter: function() {
-    if (!this.computed.hasAttribute("user-open")) {
+    if (!this.computed.classList.contains("user-open")) {
+      this.computed.classList.add("filter-open");
       this.expander.setAttribute("open", "true");
-      this.computed.setAttribute("filter-open", "");
     }
   },
 
   /**
    * Collapses the computed list that was expanded by style filtering.
    */
   collapseForFilter: function() {
-    this.computed.removeAttribute("filter-open");
-
-    if (!this.computed.hasAttribute("user-open")) {
+    this.computed.classList.remove("filter-open");
+    if (!this.computed.classList.contains("user-open")) {
       this.expander.removeAttribute("open");
     }
   },
 
   /**
    * Called when the property name's inplace editor is closed.
    * Ignores the change if the user pressed escape, otherwise
    * commits it.
--- a/browser/devtools/styleinspector/ruleview.css
+++ b/browser/devtools/styleinspector/ruleview.css
@@ -51,23 +51,22 @@ body {
   cursor: text;
   padding-right: 15px;
 }
 
 .ruleview-propertyvaluecontainer a {
   cursor: pointer;
 }
 
-.ruleview-computedlist,
+.ruleview-computedlist:not(.user-open),
 .ruleview-warning[hidden] {
   display: none;
 }
 
-.ruleview-computedlist[user-open],
-.ruleview-computedlist[filter-open] {
+.ruleview-computedlist.filter-open {
   display: block;
 }
 
 .ruleview-expandable-container {
   display: none;
 }
 
 .show-expandable-container + .ruleview-expandable-container {
--- a/browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_01.js
+++ b/browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_01.js
@@ -47,17 +47,18 @@ function* testAddTextInFilter(inspector,
   let rule = getRuleViewRuleEditor(ruleView, 1).rule;
   let ruleEditor = rule.textProps[0].editor;
   let computed = ruleEditor.computed;
 
   is(rule.selectorText, "#testid", "Second rule is #testid.");
   ok(!ruleEditor.expander.getAttribute("open"), "Expander is closed.");
   ok(ruleEditor.container.classList.contains("ruleview-highlight"),
     "margin text property is correctly highlighted.");
-  ok(!computed.hasAttribute("filter-open"), "margin computed list is closed.");
+  ok(!computed.classList.contains("filter-open"),
+    "margin computed list is closed.");
 
   ok(!computed.children[0].classList.contains("ruleview-highlight"),
     "margin-top computed property is not highlighted.");
   ok(computed.children[1].classList.contains("ruleview-highlight"),
     "margin-right computed property is correctly highlighted.");
   ok(!computed.children[2].classList.contains("ruleview-highlight"),
     "margin-bottom computed property is not highlighted.");
   ok(computed.children[3].classList.contains("ruleview-highlight"),
--- a/browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_02.js
+++ b/browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_02.js
@@ -47,17 +47,18 @@ function* testAddTextInFilter(inspector,
   let rule = getRuleViewRuleEditor(ruleView, 1).rule;
   let ruleEditor = rule.textProps[0].editor;
   let computed = ruleEditor.computed;
 
   is(rule.selectorText, "#testid", "Second rule is #testid.");
   ok(!ruleEditor.expander.getAttribute("open"), "Expander is closed.");
   ok(ruleEditor.container.classList.contains("ruleview-highlight"),
     "margin text property is correctly highlighted.");
-  ok(!computed.hasAttribute("filter-open"), "margin computed list is closed.");
+  ok(!computed.classList.contains("filter-open"),
+    "margin computed list is closed.");
 
   ok(computed.children[0].classList.contains("ruleview-highlight"),
     "margin-top computed property is correctly highlighted.");
   ok(computed.children[1].classList.contains("ruleview-highlight"),
     "margin-right computed property is correctly highlighted.");
   ok(computed.children[2].classList.contains("ruleview-highlight"),
     "margin-bottom computed property is correctly highlighted.");
   ok(computed.children[3].classList.contains("ruleview-highlight"),
--- a/browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_03.js
+++ b/browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_03.js
@@ -47,17 +47,18 @@ function* testAddTextInFilter(inspector,
   let rule = getRuleViewRuleEditor(ruleView, 1).rule;
   let ruleEditor = rule.textProps[0].editor;
   let computed = ruleEditor.computed;
 
   is(rule.selectorText, "#testid", "Second rule is #testid.");
   ok(ruleEditor.expander.getAttribute("open"), "Expander is open.");
   ok(!ruleEditor.container.classList.contains("ruleview-highlight"),
     "margin text property is not highlighted.");
-  ok(computed.hasAttribute("filter-open"), "margin computed list is open.");
+  ok(computed.classList.contains("filter-open"),
+    "margin computed list is open.");
 
   ok(computed.children[0].classList.contains("ruleview-highlight"),
     "margin-top computed property is not highlighted.");
   ok(!computed.children[1].classList.contains("ruleview-highlight"),
     "margin-right computed property is not highlighted.");
   ok(!computed.children[2].classList.contains("ruleview-highlight"),
     "margin-bottom computed property is not highlighted.");
   ok(!computed.children[3].classList.contains("ruleview-highlight"),
--- a/browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_04.js
+++ b/browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_04.js
@@ -47,17 +47,18 @@ function* testAddTextInFilter(inspector,
   let rule = getRuleViewRuleEditor(ruleView, 1).rule;
   let ruleEditor = rule.textProps[0].editor;
   let computed = ruleEditor.computed;
 
   is(rule.selectorText, "#testid", "Second rule is #testid.");
   ok(!ruleEditor.expander.getAttribute("open"), "Expander is closed.");
   ok(ruleEditor.container.classList.contains("ruleview-highlight"),
     "margin text property is correctly highlighted.");
-  ok(!computed.hasAttribute("filter-open"), "margin computed list is closed.");
+  ok(!computed.classList.contains("filter-open"),
+    "margin computed list is closed.");
 
   ok(computed.children[0].classList.contains("ruleview-highlight"),
     "margin-top computed property is correctly highlighted.");
   ok(!computed.children[1].classList.contains("ruleview-highlight"),
     "margin-right computed property is not highlighted.");
   ok(computed.children[2].classList.contains("ruleview-highlight"),
     "margin-bottom computed property is correctly highlighted.");
   ok(!computed.children[3].classList.contains("ruleview-highlight"),
--- a/browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_05.js
+++ b/browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_05.js
@@ -47,17 +47,18 @@ function* testAddTextInFilter(inspector,
   let rule = getRuleViewRuleEditor(ruleView, 1).rule;
   let ruleEditor = rule.textProps[0].editor;
   let computed = ruleEditor.computed;
 
   is(rule.selectorText, "#testid", "Second rule is #testid.");
   ok(ruleEditor.expander.getAttribute("open"), "Expander is open.");
   ok(!ruleEditor.container.classList.contains("ruleview-highlight"),
     "margin text property is not highlighted.");
-  ok(computed.hasAttribute("filter-open"), "margin computed list is open.");
+  ok(computed.classList.contains("filter-open"),
+    "margin computed list is open.");
 
   ok(computed.children[0].classList.contains("ruleview-highlight"),
     "margin-top computed property is correctly highlighted.");
   ok(!computed.children[1].classList.contains("ruleview-highlight"),
     "margin-right computed property is not highlighted.");
   ok(!computed.children[2].classList.contains("ruleview-highlight"),
     "margin-bottom computed property is not highlighted.");
   ok(!computed.children[3].classList.contains("ruleview-highlight"),
--- a/browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_06.js
+++ b/browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_06.js
@@ -48,17 +48,18 @@ function* testAddTextInFilter(inspector,
   let rule = getRuleViewRuleEditor(ruleView, 1).rule;
   let ruleEditor = rule.textProps[0].editor;
   let computed = ruleEditor.computed;
 
   is(rule.selectorText, "#testid", "Second rule is #testid.");
   ok(ruleEditor.expander.getAttribute("open"), "Expander is open.");
   ok(!ruleEditor.container.classList.contains("ruleview-highlight"),
     "margin text property is not highlighted.");
-  ok(computed.hasAttribute("filter-open"), "margin computed list is open.");
+  ok(computed.classList.contains("filter-open"),
+    "margin computed list is open.");
 
   ok(computed.children[0].classList.contains("ruleview-highlight"),
     "margin-top computed property is correctly highlighted.");
   ok(computed.children[1].classList.contains("ruleview-highlight"),
     "margin-right computed property is correctly highlighted.");
   ok(computed.children[2].classList.contains("ruleview-highlight"),
     "margin-bottom computed property is correctly highlighted.");
   ok(computed.children[3].classList.contains("ruleview-highlight"),
@@ -84,17 +85,18 @@ function* testRemoveTextInFilter(inspect
   let rule = getRuleViewRuleEditor(ruleView, 1).rule;
   let ruleEditor = rule.textProps[0].editor;
   let computed = ruleEditor.computed;
 
   is(rule.selectorText, "#testid", "Second rule is #testid.");
   ok(!ruleEditor.expander.getAttribute("open"), "Expander is closed.");
   ok(ruleEditor.container.classList.contains("ruleview-highlight"),
     "margin text property is correctly highlighted.");
-  ok(!computed.hasAttribute("filter-open"), "margin computed list is closed.");
+  ok(!computed.classList.contains("filter-open"),
+    "margin computed list is closed.");
 
   ok(computed.children[0].classList.contains("ruleview-highlight"),
     "margin-top computed property is correctly highlighted.");
   ok(computed.children[1].classList.contains("ruleview-highlight"),
     "margin-right computed property is correctly highlighted.");
   ok(computed.children[2].classList.contains("ruleview-highlight"),
     "margin-bottom computed property is correctly highlighted.");
   ok(computed.children[3].classList.contains("ruleview-highlight"),
--- a/browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_clear.js
+++ b/browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_clear.js
@@ -48,17 +48,18 @@ function* testAddTextInFilter(inspector,
   let rule = getRuleViewRuleEditor(ruleView, 1).rule;
   let ruleEditor = rule.textProps[0].editor;
   let computed = ruleEditor.computed;
 
   is(rule.selectorText, "#testid", "Second rule is #testid.");
   ok(!ruleEditor.expander.getAttribute("open"), "Expander is closed.");
   ok(ruleEditor.container.classList.contains("ruleview-highlight"),
     "margin text property is correctly highlighted.");
-  ok(!computed.hasAttribute("filter-open"), "margin computed list is closed.");
+  ok(!computed.classList.contains("filter-open"),
+    "margin computed list is closed.");
 
   ok(!computed.children[0].classList.contains("ruleview-highlight"),
     "margin-top computed property is not highlighted.");
   ok(computed.children[1].classList.contains("ruleview-highlight"),
     "margin-right computed property is correctly highlighted.");
   ok(!computed.children[2].classList.contains("ruleview-highlight"),
     "margin-bottom computed property is not highlighted.");
   ok(computed.children[3].classList.contains("ruleview-highlight"),
@@ -83,10 +84,11 @@ function* testClearSearchFilter(inspecto
   ok(!searchField.value, "Search filter is cleared");
   ok(!doc.querySelectorAll(".ruleview-highlight").length,
     "No rules are higlighted");
 
   let ruleEditor = getRuleViewRuleEditor(ruleView, 1).rule.textProps[0].editor;
   let computed = ruleEditor.computed;
 
   ok(!ruleEditor.expander.getAttribute("open"), "Expander is closed.");
-  ok(!computed.hasAttribute("filter-open"), "margin computed list is closed.");
+  ok(!computed.classList.contains("filter-open"),
+    "margin computed list is closed.");
 }
--- a/browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_expander.js
+++ b/browser/devtools/styleinspector/test/browser_ruleview_search-filter-computed-list_expander.js
@@ -49,20 +49,20 @@ function* testOpenExpanderAndAddTextInFi
   is(ruleView.element.children.length, 2, "Should have 2 rules.");
   is(getRuleViewRuleEditor(ruleView, 0).rule.selectorText, "element",
     "First rule is inline element.");
 
   is(rule.selectorText, "#testid", "Second rule is #testid.");
   ok(ruleEditor.expander.getAttribute("open"), "Expander is open.");
   ok(ruleEditor.container.classList.contains("ruleview-highlight"),
     "margin text property is correctly highlighted.");
-  ok(!computed.hasAttribute("filter-open"),
+  ok(!computed.classList.contains("filter-open"),
     "margin computed list does not contain filter-open class.");
-  ok(computed.hasAttribute("user-open"),
-    "margin computed list contains user-open attribute.");
+  ok(computed.classList.contains("user-open"),
+    "margin computed list contains user-open class.");
 
   ok(!computed.children[0].classList.contains("ruleview-highlight"),
     "margin-top computed property is not highlighted.");
   ok(computed.children[1].classList.contains("ruleview-highlight"),
     "margin-right computed property is correctly highlighted.");
   ok(!computed.children[2].classList.contains("ruleview-highlight"),
     "margin-bottom computed property is not highlighted.");
   ok(computed.children[3].classList.contains("ruleview-highlight"),
@@ -87,13 +87,13 @@ function* testClearSearchFilter(inspecto
   ok(!searchField.value, "Search filter is cleared");
   ok(!doc.querySelectorAll(".ruleview-highlight").length,
     "No rules are higlighted");
 
   let ruleEditor = getRuleViewRuleEditor(ruleView, 1).rule.textProps[0].editor;
   let computed = ruleEditor.computed;
 
   ok(ruleEditor.expander.getAttribute("open"), "Expander is open.");
-  ok(!computed.hasAttribute("filter-open"),
+  ok(!computed.classList.contains("filter-open"),
     "margin computed list does not contain filter-open class.");
-  ok(computed.hasAttribute("user-open"),
-    "margin computed list contains user-open attribute.");
+  ok(computed.classList.contains("user-open"),
+    "margin computed list contains user-open class.");
 }