Title: [294912] trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js
Revision
294912
Author
drou...@apple.com
Date
2022-05-26 17:01:47 -0700 (Thu, 26 May 2022)

Log Message

REGRESSION (250994@main): inspector/css/css-property.html is consistently failing
https://bugs.webkit.org/show_bug.cgi?id=240986
<rdar://problem/94001813>

Reviewed by Patrick Angle.

* Source/WebInspectorUI/UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.prototype._updateName.changeCount):
Don't adjust `WI.CSSProperty._cachedNameCounts` when updating `WI.objectStores.cssPropertyNameCounts`
as the latter will not work in LayoutTests (to avoid having to reset state between tests).

Canonical link: https://commits.webkit.org/251033@main

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js (294911 => 294912)


--- trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js	2022-05-26 23:59:16 UTC (rev 294911)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js	2022-05-27 00:01:47 UTC (rev 294912)
@@ -557,22 +557,19 @@
             if (!propertyName || this._implicit || this._anonymous || !this._enabled)
                 return;
 
-            let oldCount = WI.CSSProperty._cachedNameCounts[propertyName];
+            let cachedCount = WI.CSSProperty._cachedNameCounts[propertyName];
 
             // Allow property counts to be updated if the property name has already been counted before.
             // This can happen when inspecting a device that has different CSS properties enabled.
-            if (isNaN(oldCount) && !WI.cssManager.propertyNameCompletions.isValidPropertyName(propertyName))
+            if (isNaN(cachedCount) && !WI.cssManager.propertyNameCompletions.isValidPropertyName(propertyName))
                 return;
 
-            console.assert(delta > 0 || oldCount >= delta, oldCount, delta);
-            let newCount = Math.max(0, (oldCount || 0) + delta);
-            WI.CSSProperty._cachedNameCounts[propertyName] = newCount;
+            console.assert(delta > 0 || cachedCount >= delta, cachedCount, delta);
+            WI.CSSProperty._cachedNameCounts[propertyName] = Math.max(0, (cachedCount || 0) + delta);
 
             WI.objectStores.cssPropertyNameCounts.get(propertyName).then((storedCount) => {
                 console.assert(delta > 0 || storedCount >= delta, storedCount, delta);
-                storedCount = Math.max(0, (storedCount || 0) + delta);
-                WI.CSSProperty._cachedNameCounts[propertyName] = storedCount;
-                WI.objectStores.cssPropertyNameCounts.put(storedCount, propertyName);
+                WI.objectStores.cssPropertyNameCounts.put(Math.max(0, (storedCount || 0) + delta), propertyName);
             });
 
             if (propertyName !== this.canonicalName)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to