Changeset 200952 in webkit


Ignore:
Timestamp:
May 16, 2016 11:26:32 AM (8 years ago)
Author:
BJ Burg
Message:

Web Inspector: Computed style shows both prefixed and unprefixed variants of properties
https://bugs.webkit.org/show_bug.cgi?id=157674
<rdar://problem/24339756>

Patch by Antoine Quint <Antoine Quint> on 2016-05-16
Reviewed by Timothy Hatcher.

We make the CSSProperty implicit property read-write, and in the case where a computed style
has a property marked as explicit, we also check that it's found in matching rules to consider
it non-implicit. This correctly filters out variants of properties set explicitly.

  • UserInterface/Models/CSSProperty.js:

(WebInspector.CSSProperty.prototype.set implicit):

  • UserInterface/Models/DOMNodeStyles.js:

(WebInspector.DOMNodeStyles.prototype.refresh.fetchedComputedStyle):
(WebInspector.DOMNodeStyles.prototype.refresh):
(WebInspector.DOMNodeStyles.prototype._isPropertyFoundInMatchingRules):
(WebInspector.DOMNodeStyles):

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r200949 r200952  
     12016-05-16  Antoine Quint  <graouts@apple.com>
     2
     3        Web Inspector: Computed style shows both prefixed and unprefixed variants of properties
     4        https://bugs.webkit.org/show_bug.cgi?id=157674
     5        <rdar://problem/24339756>
     6
     7        Reviewed by Timothy Hatcher.
     8
     9        We make the CSSProperty `implicit` property read-write, and in the case where a computed style
     10        has a property marked as explicit, we also check that it's found in matching rules to consider
     11        it non-implicit. This correctly filters out variants of properties set explicitly.
     12
     13        * UserInterface/Models/CSSProperty.js:
     14        (WebInspector.CSSProperty.prototype.set implicit):
     15        * UserInterface/Models/DOMNodeStyles.js:
     16        (WebInspector.DOMNodeStyles.prototype.refresh.fetchedComputedStyle):
     17        (WebInspector.DOMNodeStyles.prototype.refresh):
     18        (WebInspector.DOMNodeStyles.prototype._isPropertyFoundInMatchingRules):
     19        (WebInspector.DOMNodeStyles):
     20
    1212016-05-14  Timothy Hatcher  <timothy@apple.com>
    222
  • trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js

    r196597 r200952  
    200200    }
    201201
    202     get implicit()
    203     {
    204         return this._implicit;
    205     }
     202    get implicit() { return this._implicit; }
     203    set implicit(implicit) { this._implicit = implicit; }
    206204
    207205    get anonymous()
  • trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js

    r196867 r200952  
    151151
    152152                var property = this._parseStylePropertyPayload(propertyPayload, NaN, this._computedStyle);
     153                if (!property.implicit)
     154                    property.implicit = !this._isPropertyFoundInMatchingRules(property.name);
    153155                properties.push(property);
    154156            }
     
    954956        }
    955957    }
     958
     959    _isPropertyFoundInMatchingRules(propertyName)
     960    {
     961        return this._orderedStyles.some((style) => {
     962            return style.properties.some((property) => property.name === propertyName);
     963        });
     964    }
    956965};
    957966
Note: See TracChangeset for help on using the changeset viewer.