Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 194f9227e3d8a1cbb52927c4ccd4815642a3b278
https://github.com/WebKit/WebKit/commit/194f9227e3d8a1cbb52927c4ccd4815642a3b278
Author: Sam Weinig <[email protected]>
Date: 2026-02-16 (Mon, 16 Feb 2026)
Changed paths:
M Source/WTF/wtf/EnumeratedArray.h
M Source/WebCore/css/parser/CSSPropertyParserConsumer+Display.cpp
Log Message:
-----------
Use a more declarative style for parsing the CSS display property
https://bugs.webkit.org/show_bug.cgi?id=307692
Reviewed by Antti Koivisto.
Streamline the parser for the CSS display property by dispatching
from a single switch and using a compile time generated mapping of
<display-outside> + <display-inside> pairs to CSSValueIDs.
* Source/WTF/wtf/EnumeratedArray.h:
- Make remaining functions constexpr.
* Source/WebCore/css/parser/CSSPropertyParserConsumer+Display.cpp:
(WebCore::CSSPropertyParserHelpers::makeDisplayOutsideInsideMap):
- Generate a compile time mapping of <display-outside> + <display-inside>
pairs to CSSValueIDs, using EnumeratedArray as the backing to allow a
nice syntax for lookup.
(WebCore::CSSPropertyParserHelpers::consumeAfterInitialDisplayOutside):
(WebCore::CSSPropertyParserHelpers::consumeAfterInitialDisplayInside):
(WebCore::CSSPropertyParserHelpers::consumeDisplay):
- Implement the initial dispatch using a single switch on all possible
initial keywords and two generic helpers for the <display-outside> then
<display-inside> case and the <display-inside> then <display-inside> case.
Canonical link: https://commits.webkit.org/307644@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications