Changeset 294912 in webkit


Ignore:
Timestamp:
May 26, 2022, 5:01:47 PM (3 years ago)
Author:
Devin Rousso
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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js

    r294862 r294912  
    558558                return;
    559559
    560             let oldCount = WI.CSSProperty._cachedNameCounts[propertyName];
     560            let cachedCount = WI.CSSProperty._cachedNameCounts[propertyName];
    561561
    562562            // Allow property counts to be updated if the property name has already been counted before.
    563563            // This can happen when inspecting a device that has different CSS properties enabled.
    564             if (isNaN(oldCount) && !WI.cssManager.propertyNameCompletions.isValidPropertyName(propertyName))
     564            if (isNaN(cachedCount) && !WI.cssManager.propertyNameCompletions.isValidPropertyName(propertyName))
    565565                return;
    566566
    567             console.assert(delta > 0 || oldCount >= delta, oldCount, delta);
    568             let newCount = Math.max(0, (oldCount || 0) + delta);
    569             WI.CSSProperty._cachedNameCounts[propertyName] = newCount;
     567            console.assert(delta > 0 || cachedCount >= delta, cachedCount, delta);
     568            WI.CSSProperty._cachedNameCounts[propertyName] = Math.max(0, (cachedCount || 0) + delta);
    570569
    571570            WI.objectStores.cssPropertyNameCounts.get(propertyName).then((storedCount) => {
    572571                console.assert(delta > 0 || storedCount >= delta, storedCount, delta);
    573                 storedCount = Math.max(0, (storedCount || 0) + delta);
    574                 WI.CSSProperty._cachedNameCounts[propertyName] = storedCount;
    575                 WI.objectStores.cssPropertyNameCounts.put(storedCount, propertyName);
     572                WI.objectStores.cssPropertyNameCounts.put(Math.max(0, (storedCount || 0) + delta), propertyName);
    576573            });
    577574
Note: See TracChangeset for help on using the changeset viewer.