Changeset 260723 in webkit


Ignore:
Timestamp:
Apr 26, 2020 12:37:24 AM (4 years ago)
Author:
cathiechen
Message:

fast/scrolling/scroll-behavior-invalidate-if-disabled.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=210917

Reviewed by Darin Adler.

The flaky failure is caused by reusing the CSSPropertyInfo value cached propertyInfoCache
after experimental flags changed. Add propertyInfoFromJavaScriptCSSPropertyName
to perform disabled checking after parsing. If the property is disabled, it will return
an invalid CSSPropertyInfo instead.

  • css/CSSStyleDeclaration.cpp:

(WebCore::CSSStyleDeclaration::getCSSPropertyIDFromJavaScriptPropertyName):
(WebCore::CSSStyleDeclaration::namedItem):
(WebCore::CSSStyleDeclaration::setNamedItem):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r260722 r260723  
     12020-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
    1182020-04-25  Ross Kirsling  <ross.kirsling@sony.com>
    219
  • trunk/Source/WebCore/css/CSSStyleDeclaration.cpp

    r260491 r260723  
    153153};
    154154
    155 static CSSPropertyInfo parseJavaScriptCSSPropertyName(const AtomString& propertyName, const Settings* settingsPtr)
     155static CSSPropertyInfo parseJavaScriptCSSPropertyName(const AtomString& propertyName)
    156156{
    157157    using CSSPropertyInfoMap = HashMap<String, CSSPropertyInfo>;
     
    251251    if (auto propertyID = hashTableEntry ? hashTableEntry->id : 0) {
    252252        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);
    258256    }
    259257    return propertyInfo;
    260258}
    261259
     260static 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
    262269}
    263270
    264271CSSPropertyID CSSStyleDeclaration::getCSSPropertyIDFromJavaScriptPropertyName(const AtomString& propertyName)
    265272{
    266     return parseJavaScriptCSSPropertyName(propertyName, nullptr).propertyID;
     273    return propertyInfoFromJavaScriptCSSPropertyName(propertyName, nullptr).propertyID;
    267274}
    268275
    269276Optional<Variant<String, double>> CSSStyleDeclaration::namedItem(const AtomString& propertyName)
    270277{
    271     auto* settingsPtr = parentElement() ? &parentElement()->document().settings() : nullptr;
    272     auto propertyInfo = parseJavaScriptCSSPropertyName(propertyName, settingsPtr);
     278    auto* settings = parentElement() ? &parentElement()->document().settings() : nullptr;
     279    auto propertyInfo = propertyInfoFromJavaScriptCSSPropertyName(propertyName, settings);
    273280    if (!propertyInfo.propertyID)
    274281        return WTF::nullopt;
     
    292299ExceptionOr<void> CSSStyleDeclaration::setNamedItem(const AtomString& propertyName, String value, bool& propertySupported)
    293300{
    294     auto* settingsPtr = parentElement() ? &parentElement()->document().settings() : nullptr;
    295     auto propertyInfo = parseJavaScriptCSSPropertyName(propertyName, settingsPtr);
     301    auto* settings = parentElement() ? &parentElement()->document().settings() : nullptr;
     302    auto propertyInfo = propertyInfoFromJavaScriptCSSPropertyName(propertyName, settings);
    296303    if (!propertyInfo.propertyID) {
    297304        propertySupported = false;
Note: See TracChangeset for help on using the changeset viewer.