Diff
Modified: trunk/LayoutTests/ChangeLog (132767 => 132768)
--- trunk/LayoutTests/ChangeLog 2012-10-29 08:17:28 UTC (rev 132767)
+++ trunk/LayoutTests/ChangeLog 2012-10-29 08:30:38 UTC (rev 132768)
@@ -1,3 +1,15 @@
+2012-10-29 Alexander Pavlov <[email protected]>
+
+ Web Inspector: [Styles] Handle non-parsedOk properties as inactive ones
+ https://bugs.webkit.org/show_bug.cgi?id=100119
+
+ Reviewed by Vsevolod Vlasov.
+
+ * http/tests/inspector/elements-test.js:
+ (initialize_ElementTest.InspectorTest.dumpStyleTreeItem):
+ * inspector/styles/inactive-properties-expected.txt: Added.
+ * inspector/styles/inactive-properties.html: Added.
+
2012-10-29 Nandor Huszka <[email protected]>
[Qt] Unreviewed gardening.
Modified: trunk/LayoutTests/http/tests/inspector/elements-test.js (132767 => 132768)
--- trunk/LayoutTests/http/tests/inspector/elements-test.js 2012-10-29 08:17:28 UTC (rev 132767)
+++ trunk/LayoutTests/http/tests/inspector/elements-test.js 2012-10-29 08:30:38 UTC (rev 132768)
@@ -310,7 +310,7 @@
if (treeItem.listItemElement.hasStyleClass("inherited"))
return;
var typePrefix = "";
- if (treeItem.listItemElement.hasStyleClass("overloaded") || treeItem.listItemElement.hasStyleClass("inactive"))
+ if (treeItem.listItemElement.hasStyleClass("overloaded") || treeItem.listItemElement.hasStyleClass("inactive") || treeItem.listItemElement.hasStyleClass("not-parsed-ok"))
typePrefix += "/-- overloaded --/ ";
if (treeItem.listItemElement.hasStyleClass("disabled"))
typePrefix += "/-- disabled --/ ";
Added: trunk/LayoutTests/inspector/styles/inactive-properties-expected.txt (0 => 132768)
--- trunk/LayoutTests/inspector/styles/inactive-properties-expected.txt (rev 0)
+++ trunk/LayoutTests/inspector/styles/inactive-properties-expected.txt 2012-10-29 08:30:38 UTC (rev 132768)
@@ -0,0 +1,32 @@
+Tests that effectively inactive properties are displayed correctly in the sidebar.
+
+Test
+[expanded]
+display: block;
+ div - block user agent stylesheet
+text-align: right;
+ /-- overloaded --/ #inspected - left inactive-properties.html:20
+ /-- overloaded --/ #inspected - bar inactive-properties.html:20
+ #inspected - right inactive-properties.html:20
+ /-- overloaded --/ div[Attributes Style] - -webkit-left
+
+[expanded]
+element.style { ()
+
+======== Matched CSS Rules ========
+[expanded]
+#inspected { (inactive-properties.html:20)
+/-- overloaded --/ text-align: left;
+/-- overloaded --/ text-align: bar;
+text-align: right;
+
+[expanded]
+div[Attributes Style] { ()
+/-- overloaded --/ text-align: -webkit-left;
+
+[expanded]
+div { (user agent stylesheet)
+display: block;
+
+
+
Added: trunk/LayoutTests/inspector/styles/inactive-properties.html (0 => 132768)
--- trunk/LayoutTests/inspector/styles/inactive-properties.html (rev 0)
+++ trunk/LayoutTests/inspector/styles/inactive-properties.html 2012-10-29 08:30:38 UTC (rev 132768)
@@ -0,0 +1,38 @@
+<html>
+<head>
+<script src=""
+<script src=""
+<script>
+
+function test()
+{
+ InspectorTest.selectNodeAndWaitForStylesWithComputed("inspected", step1);
+
+ function step1()
+ {
+ InspectorTest.dumpSelectedElementStyles(false, false);
+ InspectorTest.completeTest();
+ }
+}
+
+</script>
+<style>
+#inspected {
+ text-align: left;
+ text-align: bar;
+ text-align: right;
+}
+</style>
+</head>
+
+<body _onload_="runTest()">
+<p>
+Tests that effectively inactive properties are displayed correctly in the sidebar.
+</p>
+
+<div id="container">
+ <div id="inspected" align="left">Test</div>
+</div>
+
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (132767 => 132768)
--- trunk/Source/WebCore/ChangeLog 2012-10-29 08:17:28 UTC (rev 132767)
+++ trunk/Source/WebCore/ChangeLog 2012-10-29 08:30:38 UTC (rev 132768)
@@ -1,3 +1,20 @@
+2012-10-29 Alexander Pavlov <[email protected]>
+
+ Web Inspector: [Styles] Handle non-parsedOk properties as inactive ones
+ https://bugs.webkit.org/show_bug.cgi?id=100119
+
+ Reviewed by Vsevolod Vlasov.
+
+ Test: inspector/styles/inactive-properties.html
+
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylesSidebarPane.createExclamationMark):
+ (WebInspector.ComputedStylePropertiesSection.prototype.rebuildComputedTrace):
+ * inspector/front-end/elementsPanel.css:
+ (.styles-section.computed-style .properties li.not-parsed-ok):
+ (.styles-section.computed-style .properties li.not-parsed-ok img.exclamation-mark):
+ (.styles-section .properties .not-parsed-ok):
+
2012-10-29 Eric Seidel <[email protected]>
Make rendering tables with <colgroups> twice as fast by avoiding walking the DOM for colgroups 4 times for each cell
Modified: trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js (132767 => 132768)
--- trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js 2012-10-29 08:17:28 UTC (rev 132767)
+++ trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js 2012-10-29 08:30:38 UTC (rev 132768)
@@ -131,6 +131,14 @@
return match[1];
}
+WebInspector.StylesSidebarPane.createExclamationMark = function(propertyName)
+{
+ var exclamationElement = document.createElement("img");
+ exclamationElement.className = "exclamation-mark";
+ exclamationElement.title = WebInspector.CSSCompletions.cssPropertiesMetainfo.keySet()[propertyName.toLowerCase()] ? WebInspector.UIString("Invalid property value.") : WebInspector.UIString("Unknown property name.");
+ return exclamationElement;
+}
+
WebInspector.StylesSidebarPane.prototype = {
_contextMenuEventFired: function(event)
{
@@ -1456,8 +1464,10 @@
treeElement.appendChild(childElement);
if (property.inactive || section.isPropertyOverloaded(property.name))
childElement.listItemElement.addStyleClass("overloaded");
- if (!property.parsedOk)
+ if (!property.parsedOk) {
childElement.listItemElement.addStyleClass("not-parsed-ok");
+ childElement.listItemElement.insertBefore(WebInspector.StylesSidebarPane.createExclamationMark(property.name), childElement.listItemElement.firstChild);
+ }
}
}
}
@@ -1940,10 +1950,7 @@
this.listItemElement.addStyleClass("not-parsed-ok");
// Add a separate exclamation mark IMG element with a tooltip.
- var exclamationElement = document.createElement("img");
- exclamationElement.className = "exclamation-mark";
- exclamationElement.title = WebInspector.CSSCompletions.cssPropertiesMetainfo.keySet()[this.property.name.toLowerCase()] ? WebInspector.UIString("Invalid property value.") : WebInspector.UIString("Unknown property name.");
- this.listItemElement.insertBefore(exclamationElement, this.listItemElement.firstChild);
+ this.listItemElement.insertBefore(WebInspector.StylesSidebarPane.createExclamationMark(this.property.name), this.listItemElement.firstChild);
}
if (this.property.inactive)
this.listItemElement.addStyleClass("inactive");
Modified: trunk/Source/WebCore/inspector/front-end/elementsPanel.css (132767 => 132768)
--- trunk/Source/WebCore/inspector/front-end/elementsPanel.css 2012-10-29 08:17:28 UTC (rev 132767)
+++ trunk/Source/WebCore/inspector/front-end/elementsPanel.css 2012-10-29 08:30:38 UTC (rev 132768)
@@ -178,6 +178,10 @@
margin-left: 0px;
}
+.styles-section.computed-style .properties li.not-parsed-ok {
+ margin-left: -6px;
+}
+
.styles-section .properties li.not-parsed-ok img.exclamation-mark {
content: url(Images/warningIcon.png);
opacity: 0.75;
@@ -194,6 +198,10 @@
z-index: 1;
}
+.styles-section.computed-style .properties li.not-parsed-ok img.exclamation-mark {
+ left: 0;
+}
+
.styles-section .header {
white-space: nowrap;
-webkit-background-origin: padding;
@@ -388,7 +396,10 @@
margin-left: 16px;
}
-.styles-section .properties .overloaded, .styles-section .properties .inactive, .styles-section .properties .disabled {
+.styles-section .properties .overloaded,
+.styles-section .properties .inactive,
+.styles-section .properties .disabled,
+.styles-section .properties .not-parsed-ok {
text-decoration: line-through;
}