Bug 947952 - Rename "non-*" attributes in the Variables View to avoid double negation, r=paul

This commit is contained in:
Victor Porof 2013-12-09 18:58:55 +02:00
Родитель 96f85be705
Коммит 4c3b50869b
13 изменённых файлов: 76 добавлений и 76 удалений

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

@ -484,22 +484,22 @@ function testOriginalRawDataIntegrity(arr, obj) {
function testAnonymousHeaders(fooScope, anonymousVar, anonymousScope, barVar, bazProperty) {
is(fooScope.header, true,
"A named scope should have a header visible.");
is(fooScope.target.hasAttribute("non-header"), false,
is(fooScope.target.hasAttribute("untitled"), false,
"The non-header attribute should not be applied to scopes with headers.");
is(anonymousScope.header, false,
"An anonymous scope should have a header visible.");
is(anonymousScope.target.hasAttribute("non-header"), true,
is(anonymousScope.target.hasAttribute("untitled"), true,
"The non-header attribute should not be applied to scopes without headers.");
is(barVar.header, true,
"A named variable should have a header visible.");
is(barVar.target.hasAttribute("non-header"), false,
is(barVar.target.hasAttribute("untitled"), false,
"The non-header attribute should not be applied to variables with headers.");
is(anonymousVar.header, false,
"An anonymous variable should have a header visible.");
is(anonymousVar.target.hasAttribute("non-header"), true,
is(anonymousVar.target.hasAttribute("untitled"), true,
"The non-header attribute should not be applied to variables without headers.");
}

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

@ -72,29 +72,29 @@ function testVariablesAndPropertiesFiltering() {
is(constr2Var.expanded, true,
"The constr2Var should be expanded.");
is(localScope.target.querySelectorAll(".variables-view-variable:not([non-match])").length, 1,
is(localScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 1,
"There should be 1 variable displayed in the local scope.");
is(withScope.target.querySelectorAll(".variables-view-variable:not([non-match])").length, 0,
is(withScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 0,
"There should be 0 variables displayed in the with scope.");
is(functionScope.target.querySelectorAll(".variables-view-variable:not([non-match])").length, 0,
is(functionScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 0,
"There should be 0 variables displayed in the function scope.");
isnot(globalScope.target.querySelectorAll(".variables-view-variable:not([non-match])").length, 0,
isnot(globalScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 0,
"There should be some variables displayed in the global scope.");
is(withScope.target.querySelectorAll(".variables-view-property:not([non-match])").length, 0,
is(withScope.target.querySelectorAll(".variables-view-property:not([unmatched])").length, 0,
"There should be 0 properties displayed in the with scope.");
is(functionScope.target.querySelectorAll(".variables-view-property:not([non-match])").length, 0,
is(functionScope.target.querySelectorAll(".variables-view-property:not([unmatched])").length, 0,
"There should be 0 properties displayed in the function scope.");
is(globalScope.target.querySelectorAll(".variables-view-property:not([non-match])").length, 0,
is(globalScope.target.querySelectorAll(".variables-view-property:not([unmatched])").length, 0,
"There should be 0 properties displayed in the global scope.");
is(localScope.target.querySelectorAll(".variables-view-variable:not([non-match]) > .title > .name")[0].getAttribute("value"),
is(localScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[0].getAttribute("value"),
"__proto__", "The only inner variable displayed should be '__proto__'");
is(localScope.target.querySelectorAll(".variables-view-property:not([non-match]) > .title > .name")[0].getAttribute("value"),
is(localScope.target.querySelectorAll(".variables-view-property:not([unmatched]) > .title > .name")[0].getAttribute("value"),
"constructor", "The first inner property displayed should be 'constructor'");
is(localScope.target.querySelectorAll(".variables-view-property:not([non-match]) > .title > .name")[1].getAttribute("value"),
is(localScope.target.querySelectorAll(".variables-view-property:not([unmatched]) > .title > .name")[1].getAttribute("value"),
"__proto__", "The second inner property displayed should be '__proto__'");
is(localScope.target.querySelectorAll(".variables-view-property:not([non-match]) > .title > .name")[2].getAttribute("value"),
is(localScope.target.querySelectorAll(".variables-view-property:not([unmatched]) > .title > .name")[2].getAttribute("value"),
"constructor", "The third inner property displayed should be 'constructor'");
}

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

@ -72,36 +72,36 @@ function testVariablesAndPropertiesFiltering() {
is(constr2Var.expanded, true,
"The constr2Var should be expanded.");
is(localScope.target.querySelectorAll(".variables-view-variable:not([non-match])").length, 1,
is(localScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 1,
"There should be 1 variable displayed in the local scope.");
is(withScope.target.querySelectorAll(".variables-view-variable:not([non-match])").length, 0,
is(withScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 0,
"There should be 0 variables displayed in the with scope.");
is(functionScope.target.querySelectorAll(".variables-view-variable:not([non-match])").length, 0,
is(functionScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 0,
"There should be 0 variables displayed in the function scope.");
is(globalScope.target.querySelectorAll(".variables-view-variable:not([non-match])").length, 0,
is(globalScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 0,
"There should be no variables displayed in the global scope.");
is(localScope.target.querySelectorAll(".variables-view-property:not([non-match])").length, 4,
is(localScope.target.querySelectorAll(".variables-view-property:not([unmatched])").length, 4,
"There should be 4 properties displayed in the local scope.");
is(withScope.target.querySelectorAll(".variables-view-property:not([non-match])").length, 0,
is(withScope.target.querySelectorAll(".variables-view-property:not([unmatched])").length, 0,
"There should be 0 properties displayed in the with scope.");
is(functionScope.target.querySelectorAll(".variables-view-property:not([non-match])").length, 0,
is(functionScope.target.querySelectorAll(".variables-view-property:not([unmatched])").length, 0,
"There should be 0 properties displayed in the function scope.");
is(globalScope.target.querySelectorAll(".variables-view-property:not([non-match])").length, 0,
is(globalScope.target.querySelectorAll(".variables-view-property:not([unmatched])").length, 0,
"There should be 0 properties displayed in the global scope.");
is(localScope.target.querySelectorAll(".variables-view-variable:not([non-match]) > .title > .name")[0].getAttribute("value"),
is(localScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[0].getAttribute("value"),
"__proto__", "The only inner variable displayed should be '__proto__'");
is(localScope.target.querySelectorAll(".variables-view-property:not([non-match]) > .title > .name")[0].getAttribute("value"),
is(localScope.target.querySelectorAll(".variables-view-property:not([unmatched]) > .title > .name")[0].getAttribute("value"),
"constructor", "The first inner property displayed should be 'constructor'");
is(localScope.target.querySelectorAll(".variables-view-property:not([non-match]) > .title > .name")[1].getAttribute("value"),
is(localScope.target.querySelectorAll(".variables-view-property:not([unmatched]) > .title > .name")[1].getAttribute("value"),
"__proto__", "The second inner property displayed should be '__proto__'");
is(localScope.target.querySelectorAll(".variables-view-property:not([non-match]) > .title > .name")[2].getAttribute("value"),
is(localScope.target.querySelectorAll(".variables-view-property:not([unmatched]) > .title > .name")[2].getAttribute("value"),
"constructor", "The third inner property displayed should be 'constructor'");
is(localScope.target.querySelectorAll(".variables-view-property:not([non-match]) > .title > .name")[3].getAttribute("value"),
is(localScope.target.querySelectorAll(".variables-view-property:not([unmatched]) > .title > .name")[3].getAttribute("value"),
"name", "The fourth inner property displayed should be 'name'");
is(localScope.target.querySelectorAll(".variables-view-property:not([non-match]) > .title > .value")[3].getAttribute("value"),
is(localScope.target.querySelectorAll(".variables-view-property:not([unmatched]) > .title > .value")[3].getAttribute("value"),
"\"Function\"", "The fourth inner property displayed should be '\"Function\"'");
}

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

@ -58,20 +58,20 @@ function testVariablesAndPropertiesFiltering() {
is(globalScope.expanded, true,
"The globalScope should be expanded.");
is(localScope.target.querySelectorAll(".variables-view-variable:not([non-match])").length, 1,
is(localScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 1,
"There should be 1 variable displayed in the local scope.");
is(withScope.target.querySelectorAll(".variables-view-variable:not([non-match])").length, 0,
is(withScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 0,
"There should be 0 variables displayed in the with scope.");
is(functionScope.target.querySelectorAll(".variables-view-variable:not([non-match])").length, 0,
is(functionScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 0,
"There should be 0 variables displayed in the function scope.");
is(localScope.target.querySelectorAll(".variables-view-property:not([non-match])").length, 0,
is(localScope.target.querySelectorAll(".variables-view-property:not([unmatched])").length, 0,
"There should be 0 properties displayed in the local scope.");
is(withScope.target.querySelectorAll(".variables-view-property:not([non-match])").length, 0,
is(withScope.target.querySelectorAll(".variables-view-property:not([unmatched])").length, 0,
"There should be 0 properties displayed in the with scope.");
is(functionScope.target.querySelectorAll(".variables-view-property:not([non-match])").length, 0,
is(functionScope.target.querySelectorAll(".variables-view-property:not([unmatched])").length, 0,
"There should be 0 properties displayed in the function scope.");
is(globalScope.target.querySelectorAll(".variables-view-property:not([non-match])").length, 0,
is(globalScope.target.querySelectorAll(".variables-view-property:not([unmatched])").length, 0,
"There should be 0 properties displayed in the global scope.");
}
@ -79,9 +79,9 @@ function testVariablesAndPropertiesFiltering() {
typeText(gSearchBox, "*one");
testFiltered("one");
isnot(globalScope.target.querySelectorAll(".variables-view-variable:not([non-match])").length, 0,
isnot(globalScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 0,
"There should be some variables displayed in the global scope.");
is(localScope.target.querySelectorAll(".variables-view-variable:not([non-match]) > .title > .name")[0].getAttribute("value"),
is(localScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[0].getAttribute("value"),
"one", "The only inner variable displayed should be 'one'");
}
@ -104,9 +104,9 @@ function testVariablesAndPropertiesFiltering() {
typeText(gSearchBox, "*two");
testFiltered("two");
is(globalScope.target.querySelectorAll(".variables-view-variable:not([non-match])").length, 0,
is(globalScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length, 0,
"There should be no variables displayed in the global scope.");
is(localScope.target.querySelectorAll(".variables-view-variable:not([non-match]) > .title > .name")[0].getAttribute("value"),
is(localScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[0].getAttribute("value"),
"two", "The only inner variable displayed should be 'two'");
}

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

@ -58,7 +58,7 @@ function testVariablesAndPropertiesFiltering() {
assertScopeExpansion([true, true, true, true]);
assertVariablesCountAtLeast([0, 0, 1, 0]);
is(functionScope.target.querySelectorAll(".variables-view-variable:not([non-match]) > .title > .name")[0].getAttribute("value"),
is(functionScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[0].getAttribute("value"),
"arguments", "The arguments pseudoarray should be visible.");
is(functionScope.get("arguments").expanded, false,
"The arguments pseudoarray in functionScope should not be expanded.");
@ -69,12 +69,12 @@ function testVariablesAndPropertiesFiltering() {
assertScopeExpansion([true, true, true, true]);
assertVariablesCountAtLeast([0, 0, 1, 1]);
is(functionScope.target.querySelectorAll(".variables-view-variable:not([non-match]) > .title > .name")[0].getAttribute("value"),
is(functionScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[0].getAttribute("value"),
"arguments", "The arguments pseudoarray should be visible.");
is(functionScope.get("arguments").expanded, false,
"The arguments pseudoarray in functionScope should not be expanded.");
is(globalScope.target.querySelectorAll(".variables-view-variable:not([non-match]) > .title > .name")[0].getAttribute("value"),
is(globalScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[0].getAttribute("value"),
"EventTarget", "The EventTarget object should be visible.");
is(globalScope.get("EventTarget").expanded, false,
"The EventTarget object in globalScope should not be expanded.");
@ -85,17 +85,17 @@ function testVariablesAndPropertiesFiltering() {
assertScopeExpansion([true, true, true, true]);
assertVariablesCountAtLeast([0, 1, 3, 1]);
is(functionScope.target.querySelectorAll(".variables-view-variable:not([non-match]) > .title > .name")[0].getAttribute("value"),
is(functionScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[0].getAttribute("value"),
"aNumber", "The aNumber param should be visible.");
is(functionScope.get("aNumber").expanded, false,
"The aNumber param in functionScope should not be expanded.");
is(functionScope.target.querySelectorAll(".variables-view-variable:not([non-match]) > .title > .name")[1].getAttribute("value"),
is(functionScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[1].getAttribute("value"),
"a", "The a variable should be visible.");
is(functionScope.get("a").expanded, false,
"The a variable in functionScope should not be expanded.");
is(functionScope.target.querySelectorAll(".variables-view-variable:not([non-match]) > .title > .name")[2].getAttribute("value"),
is(functionScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[2].getAttribute("value"),
"arguments", "The arguments pseudoarray should be visible.");
is(functionScope.get("arguments").expanded, false,
"The arguments pseudoarray in functionScope should not be expanded.");
@ -106,37 +106,37 @@ function testVariablesAndPropertiesFiltering() {
assertScopeExpansion([true, true, true, true]);
assertVariablesCountAtLeast([4, 1, 3, 1]);
is(localScope.target.querySelectorAll(".variables-view-variable:not([non-match]) > .title > .name")[0].getAttribute("value"),
is(localScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[0].getAttribute("value"),
"this", "The this reference should be visible.");
is(localScope.get("this").expanded, false,
"The this reference in localScope should not be expanded.");
is(localScope.target.querySelectorAll(".variables-view-variable:not([non-match]) > .title > .name")[1].getAttribute("value"),
is(localScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[1].getAttribute("value"),
"one", "The one variable should be visible.");
is(localScope.get("one").expanded, false,
"The one variable in localScope should not be expanded.");
is(localScope.target.querySelectorAll(".variables-view-variable:not([non-match]) > .title > .name")[2].getAttribute("value"),
is(localScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[2].getAttribute("value"),
"two", "The two variable should be visible.");
is(localScope.get("two").expanded, false,
"The two variable in localScope should not be expanded.");
is(localScope.target.querySelectorAll(".variables-view-variable:not([non-match]) > .title > .name")[3].getAttribute("value"),
is(localScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[3].getAttribute("value"),
"__proto__", "The __proto__ reference should be visible.");
is(localScope.get("__proto__").expanded, false,
"The __proto__ reference in localScope should not be expanded.");
is(functionScope.target.querySelectorAll(".variables-view-variable:not([non-match]) > .title > .name")[0].getAttribute("value"),
is(functionScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[0].getAttribute("value"),
"aNumber", "The aNumber param should be visible.");
is(functionScope.get("aNumber").expanded, false,
"The aNumber param in functionScope should not be expanded.");
is(functionScope.target.querySelectorAll(".variables-view-variable:not([non-match]) > .title > .name")[1].getAttribute("value"),
is(functionScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[1].getAttribute("value"),
"a", "The a variable should be visible.");
is(functionScope.get("a").expanded, false,
"The a variable in functionScope should not be expanded.");
is(functionScope.target.querySelectorAll(".variables-view-variable:not([non-match]) > .title > .name")[2].getAttribute("value"),
is(functionScope.target.querySelectorAll(".variables-view-variable:not([unmatched]) > .title > .name")[2].getAttribute("value"),
"arguments", "The arguments pseudoarray should be visible.");
is(functionScope.get("arguments").expanded, false,
"The arguments pseudoarray in functionScope should not be expanded.");
@ -162,19 +162,19 @@ function testVariablesAndPropertiesFiltering() {
}
function assertVariablesCountAtLeast(aCounts) {
ok(localScope.target.querySelectorAll(".variables-view-variable:not([non-match])").length >= aCounts[0],
ok(localScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length >= aCounts[0],
"There should be " + aCounts[0] +
" variable displayed in the local scope (" + step + ").");
ok(withScope.target.querySelectorAll(".variables-view-variable:not([non-match])").length >= aCounts[1],
ok(withScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length >= aCounts[1],
"There should be " + aCounts[1] +
" variable displayed in the with scope (" + step + ").");
ok(functionScope.target.querySelectorAll(".variables-view-variable:not([non-match])").length >= aCounts[2],
ok(functionScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length >= aCounts[2],
"There should be " + aCounts[2] +
" variable displayed in the function scope (" + step + ").");
ok(globalScope.target.querySelectorAll(".variables-view-variable:not([non-match])").length >= aCounts[3],
ok(globalScope.target.querySelectorAll(".variables-view-variable:not([unmatched])").length >= aCounts[3],
"There should be " + aCounts[3] +
" variable displayed in the global scope (" + step + ").");

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

@ -19,9 +19,9 @@ function test() {
is(tooltip.querySelectorAll(".variables-view-container").length, 1,
"There should be one variables view container added to the tooltip.");
is(tooltip.querySelectorAll(".variables-view-scope[non-header]").length, 1,
is(tooltip.querySelectorAll(".variables-view-scope[untitled]").length, 1,
"There should be one scope with no header displayed.");
is(tooltip.querySelectorAll(".variables-view-variable[non-header]").length, 1,
is(tooltip.querySelectorAll(".variables-view-variable[untitled]").length, 1,
"There should be one variable with no header displayed.");
is(tooltip.querySelectorAll(".variables-view-property").length, 2,

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

@ -19,9 +19,9 @@ function test() {
is(tooltip.querySelectorAll(".variables-view-container").length, 1,
"There should be one variables view container added to the tooltip.");
is(tooltip.querySelectorAll(".variables-view-scope[non-header]").length, 1,
is(tooltip.querySelectorAll(".variables-view-scope[untitled]").length, 1,
"There should be one scope with no header displayed.");
is(tooltip.querySelectorAll(".variables-view-variable[non-header]").length, 1,
is(tooltip.querySelectorAll(".variables-view-variable[untitled]").length, 1,
"There should be one variable with no header displayed.");
is(tooltip.querySelectorAll(".variables-view-property").length, 7,

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

@ -33,9 +33,9 @@ function test() {
is(tooltip.querySelectorAll(".devtools-tooltip-simple-text").length, 0,
"There should be no simple text node added to the tooltip.");
is(tooltip.querySelectorAll(".variables-view-scope[non-header]").length, 1,
is(tooltip.querySelectorAll(".variables-view-scope[untitled]").length, 1,
"There should be one scope with no header displayed.");
is(tooltip.querySelectorAll(".variables-view-variable[non-header]").length, 1,
is(tooltip.querySelectorAll(".variables-view-variable[untitled]").length, 1,
"There should be one variable with no header displayed.");
ok(tooltip.querySelectorAll(".variables-view-property").length >= propertyCount,

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

@ -1476,7 +1476,7 @@ Scope.prototype = {
if (this._isHeaderVisible || !this._nameString) {
return;
}
this._target.removeAttribute("non-header");
this._target.removeAttribute("untitled");
this._isHeaderVisible = true;
},
@ -1489,7 +1489,7 @@ Scope.prototype = {
return;
}
this.expand();
this._target.setAttribute("non-header", "");
this._target.setAttribute("untitled", "");
this._isHeaderVisible = false;
},
@ -1928,10 +1928,10 @@ Scope.prototype = {
}
if (aStatus) {
this._isMatch = true;
this.target.removeAttribute("non-match");
this.target.removeAttribute("unmatched");
} else {
this._isMatch = false;
this.target.setAttribute("non-match", "");
this.target.setAttribute("unmatched", "");
}
},

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

@ -50,9 +50,9 @@
overflow: hidden;
}
.variables-view-scope[non-header] > .title,
.variable-or-property[non-header] > .title,
.variable-or-property[non-match] > .title {
.variables-view-scope[untitled] > .title,
.variable-or-property[untitled] > .title,
.variable-or-property[unmatched] > .title {
display: none;
}

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

@ -467,7 +467,7 @@
cursor: text;
}
.variable-or-property:not([non-header]) > .variables-view-element-details {
.variable-or-property:not([untitled]) > .variables-view-element-details {
-moz-margin-start: 10px;
}
@ -632,7 +632,7 @@
min-height: 24px;
}
.variable-or-property[non-match] {
.variable-or-property[unmatched] {
border: none;
margin: 0;
}

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

@ -461,7 +461,7 @@
cursor: text;
}
.variable-or-property:not([non-header]) > .variables-view-element-details {
.variable-or-property:not([untitled]) > .variables-view-element-details {
-moz-margin-start: 10px;
}
@ -626,7 +626,7 @@
min-height: 24px;
}
.variable-or-property[non-match] {
.variable-or-property[unmatched] {
border: none;
margin: 0;
}

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

@ -464,7 +464,7 @@
cursor: text;
}
.variable-or-property:not([non-header]) > .variables-view-element-details {
.variable-or-property:not([untitled]) > .variables-view-element-details {
-moz-margin-start: 10px;
}
@ -629,7 +629,7 @@
min-height: 24px;
}
.variable-or-property[non-match] {
.variable-or-property[unmatched] {
border: none;
margin: 0;
}