Changeset 260723 in webkit
- Timestamp:
- Apr 26, 2020 12:37:24 AM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r260722 r260723 1 2020-04-26 Cathie Chen <cathiechen@igalia.com> 2 3 fast/scrolling/scroll-behavior-invalidate-if-disabled.html is a flaky failure 4 https://bugs.webkit.org/show_bug.cgi?id=210917 5 6 Reviewed by Darin Adler. 7 8 The flaky failure is caused by reusing the CSSPropertyInfo value cached propertyInfoCache 9 after experimental flags changed. Add propertyInfoFromJavaScriptCSSPropertyName 10 to perform disabled checking after parsing. If the property is disabled, it will return 11 an invalid CSSPropertyInfo instead. 12 13 * css/CSSStyleDeclaration.cpp: 14 (WebCore::CSSStyleDeclaration::getCSSPropertyIDFromJavaScriptPropertyName): 15 (WebCore::CSSStyleDeclaration::namedItem): 16 (WebCore::CSSStyleDeclaration::setNamedItem): 17 1 18 2020-04-25 Ross Kirsling <ross.kirsling@sony.com> 2 19 -
trunk/Source/WebCore/css/CSSStyleDeclaration.cpp
r260491 r260723 153 153 }; 154 154 155 static CSSPropertyInfo parseJavaScriptCSSPropertyName(const AtomString& propertyName , const Settings* settingsPtr)155 static CSSPropertyInfo parseJavaScriptCSSPropertyName(const AtomString& propertyName) 156 156 { 157 157 using CSSPropertyInfoMap = HashMap<String, CSSPropertyInfo>; … … 251 251 if (auto propertyID = hashTableEntry ? hashTableEntry->id : 0) { 252 252 auto id = static_cast<CSSPropertyID>(propertyID); 253 if (isEnabledCSSProperty(id) && isCSSPropertyEnabledBySettings(id, settingsPtr)) { 254 propertyInfo.hadPixelOrPosPrefix = hadPixelOrPosPrefix; 255 propertyInfo.propertyID = id; 256 propertyInfoCache.get().add(propertyNameString, propertyInfo); 257 } 253 propertyInfo.hadPixelOrPosPrefix = hadPixelOrPosPrefix; 254 propertyInfo.propertyID = id; 255 propertyInfoCache.get().add(propertyNameString, propertyInfo); 258 256 } 259 257 return propertyInfo; 260 258 } 261 259 260 static CSSPropertyInfo propertyInfoFromJavaScriptCSSPropertyName(const AtomString& propertyName, const Settings* settings) 261 { 262 auto propertyInfo = parseJavaScriptCSSPropertyName(propertyName); 263 auto id = propertyInfo.propertyID; 264 if (!isEnabledCSSProperty(id) || !isCSSPropertyEnabledBySettings(id, settings)) 265 return { CSSPropertyInvalid, false }; 266 return propertyInfo; 267 } 268 262 269 } 263 270 264 271 CSSPropertyID CSSStyleDeclaration::getCSSPropertyIDFromJavaScriptPropertyName(const AtomString& propertyName) 265 272 { 266 return p arseJavaScriptCSSPropertyName(propertyName, nullptr).propertyID;273 return propertyInfoFromJavaScriptCSSPropertyName(propertyName, nullptr).propertyID; 267 274 } 268 275 269 276 Optional<Variant<String, double>> CSSStyleDeclaration::namedItem(const AtomString& propertyName) 270 277 { 271 auto* settings Ptr= parentElement() ? &parentElement()->document().settings() : nullptr;272 auto propertyInfo = p arseJavaScriptCSSPropertyName(propertyName, settingsPtr);278 auto* settings = parentElement() ? &parentElement()->document().settings() : nullptr; 279 auto propertyInfo = propertyInfoFromJavaScriptCSSPropertyName(propertyName, settings); 273 280 if (!propertyInfo.propertyID) 274 281 return WTF::nullopt; … … 292 299 ExceptionOr<void> CSSStyleDeclaration::setNamedItem(const AtomString& propertyName, String value, bool& propertySupported) 293 300 { 294 auto* settings Ptr= parentElement() ? &parentElement()->document().settings() : nullptr;295 auto propertyInfo = p arseJavaScriptCSSPropertyName(propertyName, settingsPtr);301 auto* settings = parentElement() ? &parentElement()->document().settings() : nullptr; 302 auto propertyInfo = propertyInfoFromJavaScriptCSSPropertyName(propertyName, settings); 296 303 if (!propertyInfo.propertyID) { 297 304 propertySupported = false;
Note: See TracChangeset
for help on using the changeset viewer.