Changeset 117958 in webkit


Ignore:
Timestamp:
May 22, 2012 5:22:10 AM (12 years ago)
Author:
apavlov@chromium.org
Message:

Web Inspector: [Styles] Odd synthetic shorthands may appear in the style
https://bugs.webkit.org/show_bug.cgi?id=87081

Reviewed by Vsevolod Vlasov.

Source/WebCore:

  • inspector/front-end/StylesSidebarPane.js:

(WebInspector.StylePropertiesSection.prototype.onpopulate):

LayoutTests:

  • inspector/elements/elements-panel-styles-expected.txt:
  • inspector/elements/resources/elements-panel-styles.css:

(.foo):

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r117957 r117958  
     12012-05-22  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Web Inspector: [Styles] Odd synthetic shorthands may appear in the style
     4        https://bugs.webkit.org/show_bug.cgi?id=87081
     5
     6        Reviewed by Vsevolod Vlasov.
     7
     8        * inspector/elements/elements-panel-styles-expected.txt:
     9        * inspector/elements/resources/elements-panel-styles.css:
     10        (.foo):
     11
    1122012-05-22  Hayato Ito  <hayato@chromium.org>
    213
  • trunk/LayoutTests/inspector/elements/elements-panel-styles-expected.txt

    r107220 r117958  
    1111    .foo - 5px elements-panel-styles.css:14
    1212color: blue;
    13     .foo, .foo::before - blue elements-panel-styles.css:21
     13    .foo, .foo::before - blue elements-panel-styles.css:22
    1414    /-- overloaded --/ .foo - black elements-panel-styles.css:14
    1515display: none;
     
    2727    .foo - 2px elements-panel-styles.css:14
    2828margin-left: 0px;
    29     .foo - 0px elements-panel-styles.css:14
     29    .foo - 1px elements-panel-styles.css:14
    3030margin-right: 0px;
    3131    .foo - 0px elements-panel-styles.css:14
     
    4545
    4646[expanded]
    47 .foo  { (elements-panel-styles.css:39)
     47.foo  { (elements-panel-styles.css:40)
    4848
    4949[expanded]
    50 .foo, .foo::before  { (elements-panel-styles.css:21)
     50.foo, .foo::before  { (elements-panel-styles.css:22)
    5151content: "[before Foo]";
    5252color: blue;
     
    5555.foo  { (elements-panel-styles.css:14)
    5656/-- overloaded --/ color: black;
     57margin-left: 1px;
    5758margin: 10px 0 2px;
     59    margin-left: 1px;
    5860    margin-top: 10px;
    5961    margin-right: 0px;
    6062    margin-bottom: 2px;
    61     margin-left: 0px;
    6263border-radius: 5px;
    6364    border-top-left-radius: 5px;
     
    8990======== Pseudo ::before element ========
    9091[expanded]
    91 .foo::before  { (elements-panel-styles.css:43)
     92.foo::before  { (elements-panel-styles.css:44)
    9293
    9394[expanded]
    94 .foo::before  { (elements-panel-styles.css:26)
     95.foo::before  { (elements-panel-styles.css:27)
    9596color: red;
    9697
    9798[expanded]
    98 .foo, .foo::before  { (elements-panel-styles.css:21)
     99.foo, .foo::before  { (elements-panel-styles.css:22)
    99100content: "[before Foo]";
    100101/-- overloaded --/ color: blue;
     
    103104======== Pseudo ::after element ========
    104105[expanded]
    105 .foo::after  { (elements-panel-styles.css:34)
     106.foo::after  { (elements-panel-styles.css:35)
    106107font-family: courier;
    107108content: "[after Foo 2]";
    108109
    109110[expanded]
    110 .foo::after  { (elements-panel-styles.css:30)
     111.foo::after  { (elements-panel-styles.css:31)
    111112/-- overloaded --/ content: "[after Foo]";
    112113color: green;
  • trunk/LayoutTests/inspector/elements/resources/elements-panel-styles.css

    r90630 r117958  
    1414.foo {
    1515    color: black;
     16    margin-left: 1px;
    1617    margin: 10px 0 2px;
    1718    border-radius: 5px;
  • trunk/Source/WebCore/ChangeLog

    r117957 r117958  
     12012-05-22  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Web Inspector: [Styles] Odd synthetic shorthands may appear in the style
     4        https://bugs.webkit.org/show_bug.cgi?id=87081
     5
     6        Reviewed by Vsevolod Vlasov.
     7
     8        * inspector/front-end/StylesSidebarPane.js:
     9        (WebInspector.StylePropertiesSection.prototype.onpopulate):
     10
    1112012-05-22  Hayato Ito  <hayato@chromium.org>
    212
  • trunk/Source/WebCore/inspector/front-end/StylesSidebarPane.js

    r117794 r117958  
    11411141        for (var i = 0; i < this.uniqueProperties.length; ++i) {
    11421142            var property = this.uniqueProperties[i];
    1143             var disabled = property.disabled;
    1144             var shorthand = !disabled ? property.shorthand : null;
    1145 
    1146             if (shorthand && shorthand in handledProperties)
    1147                 continue;
     1143            var shorthand = !property.disabled && !property.inactive ? property.shorthand : null;
    11481144
    11491145            if (shorthand) {
    1150                 property = style.getLiveProperty(shorthand);
    1151                 if (!property)
     1146                if (shorthand in handledProperties)
     1147                    continue;
     1148                // We should only create synthetic shorthands if they are not present in the style source (i.e. we are dealing with a source-less style).
     1149                if (!style.getLiveProperty(shorthand))
    11521150                    property = new WebInspector.CSSProperty(style, style.allProperties.length, shorthand, style.getShorthandValue(shorthand), style.getShorthandPriority(shorthand), "style", true, true, "", undefined);
     1151                else
     1152                    shorthand = null;
    11531153            }
    11541154
     
    11581158
    11591159            var isShorthand = !!(property.isLive && (shorthand || shorthandNames[property.name]));
     1160            if (isShorthand && (property.name in handledProperties))
     1161                continue;
    11601162            var inherited = this.isPropertyInherited(property.name);
    11611163            var overloaded = this.isPropertyOverloaded(property.name, isShorthand);
Note: See TracChangeset for help on using the changeset viewer.