Title: [200952] trunk/Source/WebInspectorUI
- Revision
- 200952
- Author
- bb...@apple.com
- Date
- 2016-05-16 11:26:32 -0700 (Mon, 16 May 2016)
Log 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 <grao...@apple.com> 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):
Modified Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (200951 => 200952)
--- trunk/Source/WebInspectorUI/ChangeLog 2016-05-16 18:23:22 UTC (rev 200951)
+++ trunk/Source/WebInspectorUI/ChangeLog 2016-05-16 18:26:32 UTC (rev 200952)
@@ -1,3 +1,23 @@
+2016-05-16 Antoine Quint <grao...@apple.com>
+
+ Web Inspector: Computed style shows both prefixed and unprefixed variants of properties
+ https://bugs.webkit.org/show_bug.cgi?id=157674
+ <rdar://problem/24339756>
+
+ 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):
+
2016-05-14 Timothy Hatcher <timo...@apple.com>
Web Inspector: DataGrid _updateVisibleRows dominates profiles of timeline recordings when data grid (Overview or TimelineDataGrids) is showing
Modified: trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js (200951 => 200952)
--- trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js 2016-05-16 18:23:22 UTC (rev 200951)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js 2016-05-16 18:26:32 UTC (rev 200952)
@@ -199,10 +199,8 @@
this._overriddenStatusChangedTimeout = setTimeout(delayed.bind(this), 0);
}
- get implicit()
- {
- return this._implicit;
- }
+ get implicit() { return this._implicit; }
+ set implicit(implicit) { this._implicit = implicit; }
get anonymous()
{
Modified: trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js (200951 => 200952)
--- trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js 2016-05-16 18:23:22 UTC (rev 200951)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/DOMNodeStyles.js 2016-05-16 18:26:32 UTC (rev 200952)
@@ -150,6 +150,8 @@
propertyPayload.implicit = !this._propertyNameToEffectivePropertyMap[canonicalName];
var property = this._parseStylePropertyPayload(propertyPayload, NaN, this._computedStyle);
+ if (!property.implicit)
+ property.implicit = !this._isPropertyFoundInMatchingRules(property.name);
properties.push(property);
}
@@ -953,6 +955,13 @@
}
}
}
+
+ _isPropertyFoundInMatchingRules(propertyName)
+ {
+ return this._orderedStyles.some((style) => {
+ return style.properties.some((property) => property.name === propertyName);
+ });
+ }
};
WebInspector.DOMNodeStyles.Event = {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes