Title: [260723] trunk/Source/WebCore
- Revision
- 260723
- Author
- [email protected]
- Date
- 2020-04-26 00:37:24 -0700 (Sun, 26 Apr 2020)
Log 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):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (260722 => 260723)
--- trunk/Source/WebCore/ChangeLog 2020-04-26 05:07:21 UTC (rev 260722)
+++ trunk/Source/WebCore/ChangeLog 2020-04-26 07:37:24 UTC (rev 260723)
@@ -1,3 +1,20 @@
+2020-04-26 Cathie Chen <[email protected]>
+
+ 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):
+
2020-04-25 Ross Kirsling <[email protected]>
[JSC] isCallable is redundant with isFunction
Modified: trunk/Source/WebCore/css/CSSStyleDeclaration.cpp (260722 => 260723)
--- trunk/Source/WebCore/css/CSSStyleDeclaration.cpp 2020-04-26 05:07:21 UTC (rev 260722)
+++ trunk/Source/WebCore/css/CSSStyleDeclaration.cpp 2020-04-26 07:37:24 UTC (rev 260723)
@@ -152,7 +152,7 @@
bool hadPixelOrPosPrefix;
};
-static CSSPropertyInfo parseJavaScriptCSSPropertyName(const AtomString& propertyName, const Settings* settingsPtr)
+static CSSPropertyInfo parseJavaScriptCSSPropertyName(const AtomString& propertyName)
{
using CSSPropertyInfoMap = HashMap<String, CSSPropertyInfo>;
static NeverDestroyed<CSSPropertyInfoMap> propertyInfoCache;
@@ -250,26 +250,33 @@
auto* hashTableEntry = findProperty(name, outputLength);
if (auto propertyID = hashTableEntry ? hashTableEntry->id : 0) {
auto id = static_cast<CSSPropertyID>(propertyID);
- if (isEnabledCSSProperty(id) && isCSSPropertyEnabledBySettings(id, settingsPtr)) {
- propertyInfo.hadPixelOrPosPrefix = hadPixelOrPosPrefix;
- propertyInfo.propertyID = id;
- propertyInfoCache.get().add(propertyNameString, propertyInfo);
- }
+ propertyInfo.hadPixelOrPosPrefix = hadPixelOrPosPrefix;
+ propertyInfo.propertyID = id;
+ propertyInfoCache.get().add(propertyNameString, propertyInfo);
}
return propertyInfo;
}
+static CSSPropertyInfo propertyInfoFromJavaScriptCSSPropertyName(const AtomString& propertyName, const Settings* settings)
+{
+ auto propertyInfo = parseJavaScriptCSSPropertyName(propertyName);
+ auto id = propertyInfo.propertyID;
+ if (!isEnabledCSSProperty(id) || !isCSSPropertyEnabledBySettings(id, settings))
+ return { CSSPropertyInvalid, false };
+ return propertyInfo;
}
+}
+
CSSPropertyID CSSStyleDeclaration::getCSSPropertyIDFromJavaScriptPropertyName(const AtomString& propertyName)
{
- return parseJavaScriptCSSPropertyName(propertyName, nullptr).propertyID;
+ return propertyInfoFromJavaScriptCSSPropertyName(propertyName, nullptr).propertyID;
}
Optional<Variant<String, double>> CSSStyleDeclaration::namedItem(const AtomString& propertyName)
{
- auto* settingsPtr = parentElement() ? &parentElement()->document().settings() : nullptr;
- auto propertyInfo = parseJavaScriptCSSPropertyName(propertyName, settingsPtr);
+ auto* settings = parentElement() ? &parentElement()->document().settings() : nullptr;
+ auto propertyInfo = propertyInfoFromJavaScriptCSSPropertyName(propertyName, settings);
if (!propertyInfo.propertyID)
return WTF::nullopt;
@@ -291,8 +298,8 @@
ExceptionOr<void> CSSStyleDeclaration::setNamedItem(const AtomString& propertyName, String value, bool& propertySupported)
{
- auto* settingsPtr = parentElement() ? &parentElement()->document().settings() : nullptr;
- auto propertyInfo = parseJavaScriptCSSPropertyName(propertyName, settingsPtr);
+ auto* settings = parentElement() ? &parentElement()->document().settings() : nullptr;
+ auto propertyInfo = propertyInfoFromJavaScriptCSSPropertyName(propertyName, settings);
if (!propertyInfo.propertyID) {
propertySupported = false;
return { };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes