Bug 698762 - Remove unmatched rules from style inspector. r=robcee

This commit is contained in:
Mihai Sucan 2011-11-06 12:26:09 +02:00
Родитель 55f10af7c2
Коммит c4a5689616
4 изменённых файлов: 3 добавлений и 45 удалений

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

@ -444,7 +444,6 @@ function PropertyView(aTree, aName)
this.link = "https://developer.mozilla.org/en/CSS/" + aName;
this.templateMatchedSelectors = aTree.styleDocument.getElementById("templateMatchedSelectors");
this.templateUnmatchedSelectors = aTree.styleDocument.getElementById("templateUnmatchedSelectors");
}
PropertyView.prototype = {
@ -575,11 +574,8 @@ PropertyView.prototype = {
if (!this.tree.viewedElement || !this.visible) {
this.valueNode.innerHTML = "";
this.matchedSelectorsContainer.hidden = true;
this.unmatchedSelectorsContainer.hidden = true;
this.unmatchedSelectorTable.innerHTML = "";
this.matchedSelectorsContainer.innerHTML = "";
this.matchedExpander.removeAttribute("open");
this.unmatchedExpander.removeAttribute("open");
return;
}
@ -595,7 +591,7 @@ PropertyView.prototype = {
let hasMatchedSelectors = this.hasMatchedSelectors;
this.matchedSelectorsContainer.hidden = !hasMatchedSelectors;
if (hasMatchedSelectors || this.hasUnmatchedSelectors) {
if (hasMatchedSelectors) {
this.propertyHeader.classList.add("expandable");
} else {
this.propertyHeader.classList.remove("expandable");
@ -654,7 +650,6 @@ PropertyView.prototype = {
refreshAllSelectors: function PropertyView_refreshAllSelectors()
{
this.refreshMatchedSelectors();
this.refreshUnmatchedSelectors();
},
/**
@ -702,9 +697,6 @@ PropertyView.prototype = {
{
if (aEvent.target.className != "helplink") {
this.matchedExpanded = !this.matchedExpanded;
if (!this.hasMatchedSelectors && this.hasUnmatchedSelectors) {
this.unmatchedExpanded = !this.unmatchedExpanded;
}
this.refreshAllSelectors();
aEvent.preventDefault();
}

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

@ -71,7 +71,6 @@
<xul:label class="legendKey bestmatch">&bestMatch;</xul:label>
<xul:label class="legendKey matched">&matched;</xul:label>
<xul:label class="legendKey parentmatch">&parentMatch;</xul:label>
<xul:label class="legendKey unmatched">&unmatched;</xul:label>
<xul:spacer flex="1"/>
<xul:resizer dir="bottomright"/>
</xul:hbox>
@ -136,14 +135,6 @@ To visually debug the templates without running firefox, alter the display:none
<div save="${matchedSelectorsContainer}" class="rulelink">
</div>
<div save="${unmatchedSelectorsContainer}" class="rulelink">
<div save="${unmatchedTitleBlock}" onclick="${unmatchedSelectorsClick}"
class="rule-unmatched">
<div save="${unmatchedExpander}" class="expander"/>
<div save="${unmatchedSelectorsTitleNode}">&unmatchedSelectors;</div>
</div>
<div save="${unmatchedSelectorTable}" class="unmatchedSelectorTable"/>
</div>
</div>
</div>
@ -171,31 +162,6 @@ To visually debug the templates without running firefox, alter the display:none
</loop>
</table>
</div>
<!--
A templateUnmatchedSelectors sits inside each templateProperties showing the
list of selectors that do not affect that property. Each needs data like this:
{
unmatchedSelectorViews: ..., // from cssHtmlTree.propertyViews[name].unmatchedSelectorViews
}
This is a template so the parent does not need to be a table, except that
using a div as the parent causes the DOM to muck with the tr elements
-->
<div id="templateUnmatchedSelectors">
<table>
<loop foreach="selector in ${unmatchedSelectorViews}">
<tr>
<td dir="ltr" class="rule-text ${selector.statusClass}">
${selector.humanReadableText(__element)}
</td>
<td class="rule-link">
<a target="_blank" href="view-source:${selector.selectorInfo.href}" class="link"
title="${selector.selectorInfo.href}">${selector.selectorInfo.source}</a>
</td>
</tr>
</loop>
</table>
</div>
</div>
</xul:window>

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

@ -38,7 +38,7 @@ function runTests()
ok(stylePanel.isOpen(), "style inspector is open");
testMatchedSelectors();
testUnmatchedSelectors();
//testUnmatchedSelectors();
info("finishing up");
Services.obs.addObserver(finishUp, "StyleInspector-closed", false);

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

@ -64,7 +64,7 @@ function SI_CheckProperty()
let cssLogic = stylePanel.cssLogic;
let propertyInfo = cssLogic.getPropertyInfo("color");
ok(propertyInfo.matchedRuleCount > 0, "color property has matching rules");
ok(propertyInfo.unmatchedRuleCount > 0, "color property has unmatched rules");
//ok(propertyInfo.unmatchedRuleCount > 0, "color property has unmatched rules");
}
function finishUp()