Title: [279946] trunk/Source/WebInspectorUI
- Revision
- 279946
- Author
- rcali...@apple.com
- Date
- 2021-07-15 07:59:28 -0700 (Thu, 15 Jul 2021)
Log Message
Web Inspector: Regression (r278607) Jump to CSS variable declaration from Computed panel not working
https://bugs.webkit.org/show_bug.cgi?id=227811
<rdar://problem/80339360>
Reviewed by Devin Rousso.
When attempting to highlight a hidden unused CSS variable, use the same method to identify a corresponding WI.CSSProperty
as used with other CSS property types. The method checks the canonical property name instead of strict object equality.
When a CSS variable is shown in the Computed panel, its corresponding WI.CSSProperty instance has slightly different
properties than the WI.CSSProperty used in the Styles panel. The instances are generated by different calls to
WI.DOMNodeStyles._parseStylePropertyPayload(), one for the payload of matching styles and another for computed styles.
* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.highlightProperty.propertiesMatch):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.highlightProperty.hasMatchingLonghandProperty):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.highlightProperty):
Modified Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (279945 => 279946)
--- trunk/Source/WebInspectorUI/ChangeLog 2021-07-15 14:26:00 UTC (rev 279945)
+++ trunk/Source/WebInspectorUI/ChangeLog 2021-07-15 14:59:28 UTC (rev 279946)
@@ -1,3 +1,23 @@
+2021-07-15 Razvan Caliman <rcali...@apple.com>
+
+ Web Inspector: Regression (r278607) Jump to CSS variable declaration from Computed panel not working
+ https://bugs.webkit.org/show_bug.cgi?id=227811
+ <rdar://problem/80339360>
+
+ Reviewed by Devin Rousso.
+
+ When attempting to highlight a hidden unused CSS variable, use the same method to identify a corresponding WI.CSSProperty
+ as used with other CSS property types. The method checks the canonical property name instead of strict object equality.
+
+ When a CSS variable is shown in the Computed panel, its corresponding WI.CSSProperty instance has slightly different
+ properties than the WI.CSSProperty used in the Styles panel. The instances are generated by different calls to
+ WI.DOMNodeStyles._parseStylePropertyPayload(), one for the payload of matching styles and another for computed styles.
+
+ * UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
+ (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.highlightProperty.propertiesMatch):
+ (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.highlightProperty.hasMatchingLonghandProperty):
+ (WI.SpreadsheetCSSStyleDeclarationEditor.prototype.highlightProperty):
+
2021-07-14 Devin Rousso <drou...@apple.com>
Implement Array.prototype.findLast and Array.prototype.findLastIndex
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js (279945 => 279946)
--- trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js 2021-07-15 14:26:00 UTC (rev 279945)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js 2021-07-15 14:59:28 UTC (rev 279946)
@@ -311,13 +311,13 @@
highlightProperty(property)
{
- if (!property.overridden && this._hiddenUnusedVariables.has(property)) {
+ if (!property.overridden && this._hiddenUnusedVariables.find(propertiesMatch)) {
this._pendingPropertyToHighlight = property;
this.propertyVisibilityMode = WI.SpreadsheetCSSStyleDeclarationEditor.PropertyVisibilityMode.ShowAll;
return true;
}
- let propertiesMatch = (cssProperty) => {
+ function propertiesMatch(cssProperty) {
if (cssProperty.attached && !cssProperty.overridden) {
if (cssProperty.canonicalName === property.canonicalName || hasMatchingLonghandProperty(cssProperty))
return true;
@@ -324,9 +324,9 @@
}
return false;
- };
+ }
- let hasMatchingLonghandProperty = (cssProperty) => {
+ function hasMatchingLonghandProperty(cssProperty) {
let cssProperties = cssProperty.relatedLonghandProperties;
if (!cssProperties.length)
@@ -338,7 +338,7 @@
}
return false;
- };
+ }
for (let i = 0; i < this._propertyViews.length; ++i) {
if (propertiesMatch(this._propertyViews[i].property)) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes