Changeset 294912 in webkit
- Timestamp:
- May 26, 2022, 5:01:47 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/UserInterface/Models/CSSProperty.js
r294862 r294912 558 558 return; 559 559 560 let oldCount = WI.CSSProperty._cachedNameCounts[propertyName];560 let cachedCount = WI.CSSProperty._cachedNameCounts[propertyName]; 561 561 562 562 // Allow property counts to be updated if the property name has already been counted before. 563 563 // 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)) 565 565 return; 566 566 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); 570 569 571 570 WI.objectStores.cssPropertyNameCounts.get(propertyName).then((storedCount) => { 572 571 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); 576 573 }); 577 574
Note:
See TracChangeset
for help on using the changeset viewer.