Title: [93978] trunk
Revision
93978
Author
[email protected]
Date
2011-08-29 08:15:30 -0700 (Mon, 29 Aug 2011)

Log Message

Web Inspector: <button hidden>..</button> has a different computed "display" value than "none"
https://bugs.webkit.org/show_bug.cgi?id=67124

Source/WebCore:

Attribute styles have a higher priority than user agent styles and thus should be rendered above them.

Reviewed by Yury Semikhatsky.

* inspector/front-end/StylesSidebarPane.js:
(WebInspector.StylesSidebarPane.prototype._rebuildStyleRules):
(WebInspector.StylesSidebarPane.prototype._rebuildStyleRules.get continue):

LayoutTests:

Reviewed by Yury Semikhatsky.

* inspector/elements/elements-panel-styles-expected.txt:
* inspector/styles/styles-computed-trace-expected.txt:
* inspector/styles/styles-computed-trace.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (93977 => 93978)


--- trunk/LayoutTests/ChangeLog	2011-08-29 15:14:07 UTC (rev 93977)
+++ trunk/LayoutTests/ChangeLog	2011-08-29 15:15:30 UTC (rev 93978)
@@ -1,3 +1,14 @@
+2011-08-29  Alexander Pavlov  <[email protected]>
+
+        Web Inspector: <button hidden>..</button> has a different computed "display" value than "none"
+        https://bugs.webkit.org/show_bug.cgi?id=67124
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/elements/elements-panel-styles-expected.txt:
+        * inspector/styles/styles-computed-trace-expected.txt:
+        * inspector/styles/styles-computed-trace.html:
+
 2011-08-25  Pavel Podivilov  <[email protected]>
 
         Web Inspector: rename sourceFile to (raw|ui)SourceCode in DebuggerPresentationModel.

Modified: trunk/LayoutTests/inspector/elements/elements-panel-styles-expected.txt (93977 => 93978)


--- trunk/LayoutTests/inspector/elements/elements-panel-styles-expected.txt	2011-08-29 15:14:07 UTC (rev 93977)
+++ trunk/LayoutTests/inspector/elements/elements-panel-styles-expected.txt	2011-08-29 15:15:30 UTC (rev 93978)
@@ -61,12 +61,12 @@
     border-bottom-left-radius: 5px 5px;
 /-- overloaded --/ font-style: normal !important;
 
+[expanded] div[align=left] { ()
+text-align: -webkit-left;
+
 [expanded] div { (user agent stylesheet)
 /-- overloaded --/ display: block;
 
-[expanded] div[align=left] { ()
-text-align: -webkit-left;
-
 ======== Inherited from div#container ========
 [expanded] #container { (elements-panel-styles.css:5)
 font-family: serif;

Modified: trunk/LayoutTests/inspector/styles/styles-computed-trace-expected.txt (93977 => 93978)


--- trunk/LayoutTests/inspector/styles/styles-computed-trace-expected.txt	2011-08-29 15:14:07 UTC (rev 93977)
+++ trunk/LayoutTests/inspector/styles/styles-computed-trace-expected.txt	2011-08-29 15:15:30 UTC (rev 93978)
@@ -44,4 +44,97 @@
 [expanded] element.style { ()
 
 
+==== Computed style for ID3 ====
+[expanded]  ()
+-webkit-appearance: button;
+    button - button user agent stylesheet
+-webkit-box-align: center;
+    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - center user agent stylesheet
+background-color: #DDD;
+    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - buttonface user agent stylesheet
+border-bottom-color: #DDD;
+    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - buttonface user agent stylesheet
+border-bottom-style: outset;
+    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - outset user agent stylesheet
+border-bottom-width: 2px;
+    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - 2px user agent stylesheet
+border-left-color: #DDD;
+    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - buttonface user agent stylesheet
+border-left-style: outset;
+    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - outset user agent stylesheet
+border-left-width: 2px;
+    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - 2px user agent stylesheet
+border-right-color: #DDD;
+    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - buttonface user agent stylesheet
+border-right-style: outset;
+    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - outset user agent stylesheet
+border-right-width: 2px;
+    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - 2px user agent stylesheet
+border-top-color: #DDD;
+    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - buttonface user agent stylesheet
+border-top-style: outset;
+    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - outset user agent stylesheet
+border-top-width: 2px;
+    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - 2px user agent stylesheet
+box-sizing: border-box;
+    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - border-box user agent stylesheet
+color: black;
+    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - buttontext user agent stylesheet
+    /-- overloaded --/ input, textarea, keygen, select, button, isindex - initial user agent stylesheet
+cursor: default;
+    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - default user agent stylesheet
+display: none;
+    button[hidden] - none 
+    /-- overloaded --/ input, textarea, keygen, select, button, isindex - inline-block user agent stylesheet
+font-family: Arial;
+    /-- overloaded --/ #id1 - Courier styles-computed-trace.html:18
+    /-- overloaded --/ #id1 - Times styles-computed-trace.html:13
+    /-- overloaded --/ body - Arial styles-computed-trace.html:4
+font-size: 13px;
+font-style: normal;
+font-variant: normal;
+font-weight: normal;
+letter-spacing: normal;
+    input, textarea, keygen, select, button, isindex - normal user agent stylesheet
+line-height: normal;
+    input, textarea, keygen, select, button, isindex - normal user agent stylesheet
+margin-bottom: 2px;
+    input, textarea, keygen, select, button, isindex - 0em user agent stylesheet
+margin-left: 2px;
+    input, textarea, keygen, select, button, isindex - 0em user agent stylesheet
+margin-right: 2px;
+    input, textarea, keygen, select, button, isindex - 0em user agent stylesheet
+margin-top: 2px;
+    input, textarea, keygen, select, button, isindex - 0em user agent stylesheet
+padding-bottom: 1px;
+    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - 1px user agent stylesheet
+    /-- overloaded --/ input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - 3px user agent stylesheet
+padding-left: 6px;
+    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - 6px user agent stylesheet
+    /-- overloaded --/ input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - 6px user agent stylesheet
+padding-right: 6px;
+    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - 6px user agent stylesheet
+    /-- overloaded --/ input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - 6px user agent stylesheet
+padding-top: 1px;
+    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - 1px user agent stylesheet
+    /-- overloaded --/ input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - 2px user agent stylesheet
+text-align: center;
+    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - center user agent stylesheet
+    /-- overloaded --/ input, textarea, keygen, select, button, isindex - -webkit-auto user agent stylesheet
+text-indent: 0px;
+    input, textarea, keygen, select, button, isindex - 0px user agent stylesheet
+text-shadow: none;
+    input, textarea, keygen, select, button, isindex - none user agent stylesheet
+text-transform: none;
+    input, textarea, keygen, select, button, isindex - none user agent stylesheet
+word-spacing: 0px;
+    input, textarea, keygen, select, button, isindex - normal user agent stylesheet
 
+[expanded] element.style { ()
+
+======== Matched CSS Rules ========
+[expanded] button[hidden] { ()
+display: none;
+
+
+

Modified: trunk/LayoutTests/inspector/styles/styles-computed-trace.html (93977 => 93978)


--- trunk/LayoutTests/inspector/styles/styles-computed-trace.html	2011-08-29 15:14:07 UTC (rev 93977)
+++ trunk/LayoutTests/inspector/styles/styles-computed-trace.html	2011-08-29 15:15:30 UTC (rev 93978)
@@ -50,8 +50,16 @@
     {
         InspectorTest.addResult("==== Computed style for ID2 ====");
         InspectorTest.dumpSelectedElementStyles(false, true);
+        InspectorTest.selectNodeAndWaitForStyles("id3", step3);
+    }
+
+    function step3()
+    {
+        InspectorTest.addResult("==== Computed style for ID3 ====");
+        InspectorTest.dumpSelectedElementStyles(false, true);
         InspectorTest.completeTest();
     }
+
 }
 </script>
 </head>
@@ -64,6 +72,7 @@
 <div id="id1">
 <div id="id2">
 </div>
+<button id="id3" hidden />
 </div>
 
 </body>

Modified: trunk/Source/WebCore/ChangeLog (93977 => 93978)


--- trunk/Source/WebCore/ChangeLog	2011-08-29 15:14:07 UTC (rev 93977)
+++ trunk/Source/WebCore/ChangeLog	2011-08-29 15:15:30 UTC (rev 93978)
@@ -1,3 +1,16 @@
+2011-08-29  Alexander Pavlov  <[email protected]>
+
+        Web Inspector: <button hidden>..</button> has a different computed "display" value than "none"
+        https://bugs.webkit.org/show_bug.cgi?id=67124
+
+        Attribute styles have a higher priority than user agent styles and thus should be rendered above them.
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/front-end/StylesSidebarPane.js:
+        (WebInspector.StylesSidebarPane.prototype._rebuildStyleRules):
+        (WebInspector.StylesSidebarPane.prototype._rebuildStyleRules.get continue):
+
 2011-08-25  Pavel Podivilov  <[email protected]>
 
         Web Inspector: rename sourceFile to (raw|ui)SourceCode in DebuggerPresentationModel.

Modified: trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js (93977 => 93978)


--- trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js	2011-08-29 15:14:07 UTC (rev 93977)
+++ trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js	2011-08-29 15:15:30 UTC (rev 93978)
@@ -367,6 +367,18 @@
 
         var styleRules = [];
 
+        function addStyleAttributes()
+        {
+            for (var name in styles.styleAttributes) {
+                var attrStyle = { style: styles.styleAttributes[name], editable: false };
+                attrStyle.selectorText = WebInspector.panels.elements.treeOutline.nodeNameToCorrectCase(node.nodeName()) + "[" + name;
+                if (node.getAttribute(name))
+                    attrStyle.selectorText += "=" + node.getAttribute(name);
+                attrStyle.selectorText += "]";
+                styleRules.push(attrStyle);
+            }
+        }
+
         styleRules.push({ computedStyle: true, selectorText: "", style: nodeComputedStyle, editable: false });
 
         // Inline style has the greatest specificity.
@@ -378,23 +390,21 @@
         // Add rules in reverse order to match the cascade order.
         if (styles.matchedCSSRules.length)
             styleRules.push({ isStyleSeparator: true, text: WebInspector.UIString("Matched CSS Rules") });
+        var addedStyleAttributes;
         for (var i = styles.matchedCSSRules.length - 1; i >= 0; --i) {
             var rule = styles.matchedCSSRules[i];
             if (!WebInspector.settings.showUserAgentStyles.get() && (rule.isUser || rule.isUserAgent))
                 continue;
+            if ((rule.isUser || rule.isUserAgent) && !addedStyleAttributes) {
+                // Show element's Style Attributes after all author rules.
+                addedStyleAttributes = true;
+                addStyleAttributes();
+            }
             styleRules.push({ style: rule.style, selectorText: rule.selectorText, sourceURL: rule.sourceURL, rule: rule, editable: !!(rule.style && rule.style.id) });
         }
 
-        // Show element's Style Attributes after all rules.
-        var styleAttributes = {};
-        for (var name in styles.styleAttributes) {
-            var attrStyle = { style: styles.styleAttributes[name], editable: false };
-            attrStyle.selectorText = WebInspector.panels.elements.treeOutline.nodeNameToCorrectCase(node.nodeName()) + "[" + name;
-            if (node.getAttribute(name))
-                attrStyle.selectorText += "=" + node.getAttribute(name);
-            attrStyle.selectorText += "]";
-            styleRules.push(attrStyle);
-        }
+        if (!addedStyleAttributes)
+            addStyleAttributes();
 
         // Walk the node structure and identify styles with inherited properties.
         var parentNode = node.parentNode;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to