Bug 1157293 - Part 2: Renamed styleinspector-open class to user-open. r=bgrins

This commit is contained in:
Gabriel Luong 2015-05-02 23:40:00 +02:00
Родитель c1f59a3a0c
Коммит 17a2bb8701
3 изменённых файлов: 14 добавлений и 14 удалений

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

@ -2136,7 +2136,7 @@ CssRuleView.prototype = {
// Expand the computed list if a computed rule is highlighted and the
// property rule is not highlighted
if (!isPropertyHighlighted && isComputedHighlighted &&
!editor.computed.classList.contains("styleinspector-open")) {
!editor.computed.classList.contains("user-open")) {
editor.expandForFilter();
this._editorsExpandedForFilter.push(editor);
}
@ -3048,19 +3048,19 @@ TextPropertyEditor.prototype = {
/**
* 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 .styleinspector-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.
* 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.classList.contains("filter-open") ||
this.computed.classList.contains("styleinspector-open")) {
this.computed.classList.contains("user-open")) {
this.expander.removeAttribute("open");
this.computed.classList.remove("filter-open");
this.computed.classList.remove("styleinspector-open");
this.computed.classList.remove("user-open");
} else {
this.expander.setAttribute("open", "true");
this.computed.classList.add("styleinspector-open");
this.computed.classList.add("user-open");
}
aEvent.stopPropagation();
@ -3072,7 +3072,7 @@ TextPropertyEditor.prototype = {
* computed list was toggled opened by the filter.
*/
expandForFilter: function() {
if (!this.computed.classList.contains("styleinspector-open")) {
if (!this.computed.classList.contains("user-open")) {
this.computed.classList.add("filter-open");
this.expander.setAttribute("open", "true");
}
@ -3083,7 +3083,7 @@ TextPropertyEditor.prototype = {
*/
collapseForFilter: function() {
this.computed.classList.remove("filter-open");
if (!this.computed.classList.contains("styleinspector-open")) {
if (!this.computed.classList.contains("user-open")) {
this.expander.removeAttribute("open");
}
},

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

@ -56,7 +56,7 @@ body {
cursor: pointer;
}
.ruleview-computedlist:not(.styleinspector-open),
.ruleview-computedlist:not(.user-open),
.ruleview-warning[hidden] {
display: none;
}

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

@ -56,8 +56,8 @@ function* testOpenExpanderAndAddTextInFilter(inspector, ruleView) {
"margin text property is correctly highlighted.");
ok(!computed.classList.contains("filter-open"),
"margin computed list does not contain filter-open class.");
ok(computed.classList.contains("styleinspector-open"),
"margin computed list contains styleinspector-open class.");
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.");
@ -94,6 +94,6 @@ function* testClearSearchFilter(inspector, ruleView) {
ok(ruleEditor.expander.getAttribute("open"), "Expander is open.");
ok(!computed.classList.contains("filter-open"),
"margin computed list does not contain filter-open class.");
ok(computed.classList.contains("styleinspector-open"),
"margin computed list contains styleinspector-open class.");
ok(computed.classList.contains("user-open"),
"margin computed list contains user-open class.");
}