⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 93978 in webkit


Ignore:
Timestamp:
Aug 29, 2011, 8:15:30 AM (15 years ago)
Author:
apavlov@chromium.org
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:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r93977 r93978  
     12011-08-29  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Web Inspector: <button hidden>..</button> has a different computed "display" value than "none"
     4        https://bugs.webkit.org/show_bug.cgi?id=67124
     5
     6        Reviewed by Yury Semikhatsky.
     7
     8        * inspector/elements/elements-panel-styles-expected.txt:
     9        * inspector/styles/styles-computed-trace-expected.txt:
     10        * inspector/styles/styles-computed-trace.html:
     11
    1122011-08-25  Pavel Podivilov  <podivilov@chromium.org>
    213
  • trunk/LayoutTests/inspector/elements/elements-panel-styles-expected.txt

    r92192 r93978  
    6262/-- overloaded --/ font-style: normal !important;
    6363
     64[expanded] div[align=left] { ()
     65text-align: -webkit-left;
     66
    6467[expanded] div { (user agent stylesheet)
    6568/-- overloaded --/ display: block;
    66 
    67 [expanded] div[align=left] { ()
    68 text-align: -webkit-left;
    6969
    7070======== Inherited from div#container ========
  • trunk/LayoutTests/inspector/styles/styles-computed-trace-expected.txt

    r87617 r93978  
    4545
    4646
     47==== Computed style for ID3 ====
     48[expanded]  ()
     49-webkit-appearance: button;
     50    button - button user agent stylesheet
     51-webkit-box-align: center;
     52    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - center user agent stylesheet
     53background-color: #DDD;
     54    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - buttonface user agent stylesheet
     55border-bottom-color: #DDD;
     56    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - buttonface user agent stylesheet
     57border-bottom-style: outset;
     58    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - outset user agent stylesheet
     59border-bottom-width: 2px;
     60    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - 2px user agent stylesheet
     61border-left-color: #DDD;
     62    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - buttonface user agent stylesheet
     63border-left-style: outset;
     64    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - outset user agent stylesheet
     65border-left-width: 2px;
     66    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - 2px user agent stylesheet
     67border-right-color: #DDD;
     68    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - buttonface user agent stylesheet
     69border-right-style: outset;
     70    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - outset user agent stylesheet
     71border-right-width: 2px;
     72    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - 2px user agent stylesheet
     73border-top-color: #DDD;
     74    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - buttonface user agent stylesheet
     75border-top-style: outset;
     76    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - outset user agent stylesheet
     77border-top-width: 2px;
     78    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - 2px user agent stylesheet
     79box-sizing: border-box;
     80    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - border-box user agent stylesheet
     81color: black;
     82    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - buttontext user agent stylesheet
     83    /-- overloaded --/ input, textarea, keygen, select, button, isindex - initial user agent stylesheet
     84cursor: default;
     85    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - default user agent stylesheet
     86display: none;
     87    button[hidden] - none
     88    /-- overloaded --/ input, textarea, keygen, select, button, isindex - inline-block user agent stylesheet
     89font-family: Arial;
     90    /-- overloaded --/ #id1 - Courier styles-computed-trace.html:18
     91    /-- overloaded --/ #id1 - Times styles-computed-trace.html:13
     92    /-- overloaded --/ body - Arial styles-computed-trace.html:4
     93font-size: 13px;
     94font-style: normal;
     95font-variant: normal;
     96font-weight: normal;
     97letter-spacing: normal;
     98    input, textarea, keygen, select, button, isindex - normal user agent stylesheet
     99line-height: normal;
     100    input, textarea, keygen, select, button, isindex - normal user agent stylesheet
     101margin-bottom: 2px;
     102    input, textarea, keygen, select, button, isindex - 0em user agent stylesheet
     103margin-left: 2px;
     104    input, textarea, keygen, select, button, isindex - 0em user agent stylesheet
     105margin-right: 2px;
     106    input, textarea, keygen, select, button, isindex - 0em user agent stylesheet
     107margin-top: 2px;
     108    input, textarea, keygen, select, button, isindex - 0em user agent stylesheet
     109padding-bottom: 1px;
     110    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - 1px user agent stylesheet
     111    /-- overloaded --/ input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - 3px user agent stylesheet
     112padding-left: 6px;
     113    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - 6px user agent stylesheet
     114    /-- overloaded --/ input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - 6px user agent stylesheet
     115padding-right: 6px;
     116    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - 6px user agent stylesheet
     117    /-- overloaded --/ input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - 6px user agent stylesheet
     118padding-top: 1px;
     119    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - 1px user agent stylesheet
     120    /-- overloaded --/ input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - 2px user agent stylesheet
     121text-align: center;
     122    input[type="button"], input[type="submit"], input[type="reset"], input[type="file"] ::-webkit-file-upload-button, button - center user agent stylesheet
     123    /-- overloaded --/ input, textarea, keygen, select, button, isindex - -webkit-auto user agent stylesheet
     124text-indent: 0px;
     125    input, textarea, keygen, select, button, isindex - 0px user agent stylesheet
     126text-shadow: none;
     127    input, textarea, keygen, select, button, isindex - none user agent stylesheet
     128text-transform: none;
     129    input, textarea, keygen, select, button, isindex - none user agent stylesheet
     130word-spacing: 0px;
     131    input, textarea, keygen, select, button, isindex - normal user agent stylesheet
    47132
     133[expanded] element.style { ()
     134
     135======== Matched CSS Rules ========
     136[expanded] button[hidden] { ()
     137display: none;
     138
     139
     140
  • trunk/LayoutTests/inspector/styles/styles-computed-trace.html

    r89804 r93978  
    5151        InspectorTest.addResult("==== Computed style for ID2 ====");
    5252        InspectorTest.dumpSelectedElementStyles(false, true);
     53        InspectorTest.selectNodeAndWaitForStyles("id3", step3);
     54    }
     55
     56    function step3()
     57    {
     58        InspectorTest.addResult("==== Computed style for ID3 ====");
     59        InspectorTest.dumpSelectedElementStyles(false, true);
    5360        InspectorTest.completeTest();
    5461    }
     62
    5563}
    5664</script>
     
    6573<div id="id2">
    6674</div>
     75<button id="id3" hidden />
    6776</div>
    6877
  • trunk/Source/WebCore/ChangeLog

    r93977 r93978  
     12011-08-29  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Web Inspector: <button hidden>..</button> has a different computed "display" value than "none"
     4        https://bugs.webkit.org/show_bug.cgi?id=67124
     5
     6        Attribute styles have a higher priority than user agent styles and thus should be rendered above them.
     7
     8        Reviewed by Yury Semikhatsky.
     9
     10        * inspector/front-end/StylesSidebarPane.js:
     11        (WebInspector.StylesSidebarPane.prototype._rebuildStyleRules):
     12        (WebInspector.StylesSidebarPane.prototype._rebuildStyleRules.get continue):
     13
    1142011-08-25  Pavel Podivilov  <podivilov@chromium.org>
    215
  • trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js

    r93035 r93978  
    368368        var styleRules = [];
    369369
     370        function addStyleAttributes()
     371        {
     372            for (var name in styles.styleAttributes) {
     373                var attrStyle = { style: styles.styleAttributes[name], editable: false };
     374                attrStyle.selectorText = WebInspector.panels.elements.treeOutline.nodeNameToCorrectCase(node.nodeName()) + "[" + name;
     375                if (node.getAttribute(name))
     376                    attrStyle.selectorText += "=" + node.getAttribute(name);
     377                attrStyle.selectorText += "]";
     378                styleRules.push(attrStyle);
     379            }
     380        }
     381
    370382        styleRules.push({ computedStyle: true, selectorText: "", style: nodeComputedStyle, editable: false });
    371383
     
    379391        if (styles.matchedCSSRules.length)
    380392            styleRules.push({ isStyleSeparator: true, text: WebInspector.UIString("Matched CSS Rules") });
     393        var addedStyleAttributes;
    381394        for (var i = styles.matchedCSSRules.length - 1; i >= 0; --i) {
    382395            var rule = styles.matchedCSSRules[i];
    383396            if (!WebInspector.settings.showUserAgentStyles.get() && (rule.isUser || rule.isUserAgent))
    384397                continue;
     398            if ((rule.isUser || rule.isUserAgent) && !addedStyleAttributes) {
     399                // Show element's Style Attributes after all author rules.
     400                addedStyleAttributes = true;
     401                addStyleAttributes();
     402            }
    385403            styleRules.push({ style: rule.style, selectorText: rule.selectorText, sourceURL: rule.sourceURL, rule: rule, editable: !!(rule.style && rule.style.id) });
    386404        }
    387405
    388         // Show element's Style Attributes after all rules.
    389         var styleAttributes = {};
    390         for (var name in styles.styleAttributes) {
    391             var attrStyle = { style: styles.styleAttributes[name], editable: false };
    392             attrStyle.selectorText = WebInspector.panels.elements.treeOutline.nodeNameToCorrectCase(node.nodeName()) + "[" + name;
    393             if (node.getAttribute(name))
    394                 attrStyle.selectorText += "=" + node.getAttribute(name);
    395             attrStyle.selectorText += "]";
    396             styleRules.push(attrStyle);
    397         }
     406        if (!addedStyleAttributes)
     407            addStyleAttributes();
    398408
    399409        // Walk the node structure and identify styles with inherited properties.
Note: See TracChangeset for help on using the changeset viewer.