Commit dc8d7f20 authored by Xiaocheng Hu's avatar Xiaocheng Hu Committed by Commit Bot

Fail earlier when parsing "@scroll-timeline" with flag disabled

Before we implemented @scroll-timeline, the parser would convert a
"@scroll-timeline" into CSSAtRuleInvalid, and then go through the
ConsumeErroneousAtRule() code path. Now even with the flag disabled, we
still parse "@scroll-timeline" into CSSAtRuleScrollTimeline and then go
through the ConsumeScrollTimeline() code path and fail inside.

This patch parses "@scroll-timeline" into CSSAtRuleInvalid() so that the
when the flag is disabled, parser behavior is exactly the same as if we
haven't implemented it at all.

Change-Id: Ib83bbc19fe2715f52d10a9ce5d351670dcb8bd15
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2522050
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: default avatarRune Lillesveen <futhark@chromium.org>
Reviewed-by: default avatarAnders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824640}
parent 5b7019ed
......@@ -32,8 +32,11 @@ CSSAtRuleID CssAtRuleID(StringView name) {
return kCSSAtRuleCounterStyle;
return kCSSAtRuleInvalid;
}
if (EqualIgnoringASCIICase(name, "scroll-timeline"))
return kCSSAtRuleScrollTimeline;
if (EqualIgnoringASCIICase(name, "scroll-timeline")) {
if (RuntimeEnabledFeatures::CSSScrollTimelineEnabled())
return kCSSAtRuleScrollTimeline;
return kCSSAtRuleInvalid;
}
if (EqualIgnoringASCIICase(name, "supports"))
return kCSSAtRuleSupports;
if (EqualIgnoringASCIICase(name, "viewport"))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment