Commit 2a74bd40 authored by thatcher's avatar thatcher
Browse files

Reviewed by Hyatt.

        Corrects the cascade order for mapped attributes.
        Shows "inline stylesheet" rather than "null" for rules in <style> tags.

        * WebInspector.subproj/webInspector/inspector.js:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@12267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 59076c7b
2006-01-20 Timothy Hatcher <timothy@apple.com>
Reviewed by Hyatt.
Corrects the cascade order for mapped attributes.
Shows "inline stylesheet" rather than "null" for rules in <style> tags.
* WebInspector.subproj/webInspector/inspector.js:
2006-01-19 Timothy Hatcher <timothy@apple.com>
 
Reviewed by Eric.
......@@ -291,11 +291,6 @@ function updateStylePane() {
var propertyCount = new Array();
styleRules = new Array();
var matchedStyleRules = focusedNode.ownerDocument.defaultView.getMatchedCSSRules(focusedNode, "");
for (var i = 0; i < matchedStyleRules.length; i++) {
styleRules.push(matchedStyleRules[i]);
}
var focusedNodeName = focusedNode.nodeName.toLowerCase();
for (i = 0; i < focusedNode.attributes.length; i++) {
var attr = focusedNode.attributes[i];
......@@ -308,9 +303,14 @@ function updateStylePane() {
}
}
var matchedStyleRules = focusedNode.ownerDocument.defaultView.getMatchedCSSRules(focusedNode, "");
for (var i = 0; i < matchedStyleRules.length; i++) {
styleRules.push(matchedStyleRules[i]);
}
if (focusedNode.style.length) {
var inlineStyle = new Object();
inlineStyle.selectorText = "Inline Style";
inlineStyle.selectorText = "Inline Style Attribute";
inlineStyle.style = focusedNode.style;
inlineStyle.subtitle = "element's \"style\" attribute";
styleRules.push(inlineStyle);
......@@ -335,16 +335,16 @@ function updateStylePane() {
cell.textContent = cell.title;
row.appendChild(cell);
if (styleRules[i].parentStyleSheet != null || styleRules[i].subtitle != null) {
cell = document.createElement("div");
cell.className = "cell stylesheet";
if (styleRules[i].subtitle != null)
cell.title = styleRules[i].subtitle;
else
cell.title = styleRules[i].parentStyleSheet.href;
cell.textContent = cell.title;
row.appendChild(cell);
}
cell = document.createElement("div");
cell.className = "cell stylesheet";
if (styleRules[i].subtitle != null)
cell.title = styleRules[i].subtitle;
else if (styleRules[i].parentStyleSheet != null && styleRules[i].parentStyleSheet.href != null)
cell.title = styleRules[i].parentStyleSheet.href;
else
cell.title = "inline stylesheet";
cell.textContent = cell.title;
row.appendChild(cell);
row.styleRuleIndex = i;
row.addEventListener("click", styleRuleSelect, true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment