-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split descriptors out of properties dictionary in CSSProperties.json #7832
Split descriptors out of properties dictionary in CSSProperties.json #7832
Conversation
EWS run on previous version of this PR (hash 3aa5d12) |
3aa5d12
to
bd465e7
Compare
bd465e7
to
d23b9ea
Compare
EWS run on previous version of this PR (hash d23b9ea)
|
d23b9ea
to
a29649e
Compare
EWS run on current version of this PR (hash a29649e)
|
Ready to rock and roll. |
"inherits": { | ||
"codegen-properties": { | ||
"settings-flag": "cssCustomPropertiesAndValuesEnabled", | ||
"parser-grammar": "true | false" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
https://bugs.webkit.org/show_bug.cgi?id=249558 rdar://103497902 Reviewed by Antti Koivisto. Adds a new top level object to CSSProperties.json, "descriptors", which contains mappings from CSS rule types (e.g. @font-face, @counter-style) to a map of the descriptors that rule type supports. This allows us to remove the 'descriptor-only' properties from the main 'properties' map, and also accurately specify the descriptors that shared names with properties. This is important as some descriptors share a name with a property but have different grammars. With the new data in CSSProperties.json, we now generate parse functions for the new rule types specified: @counter-style, @font-face, @font-palette-values. and @Property. While not too many of the descriptors can be generated right now, the main "parse...Descriptor" functions can be, and this adds the foundation for generating more as we add more capabilities to the parser. To differentiate between style properties and descriptors when exporting consumer functions, descriptors have a prefix based on their rule type added. For example, @font-face defines a "font-display" descriptor, which is needed elsewhere, so we export a function called `CSSPropertyParsing::consumeFontFaceFontDisplay()`. * Source/WebCore/css/CSSProperties.json: Move/copy descriptors to new section. Remove support for descriptor-only now that it can be inferred. * Source/WebCore/css/parser/CSSParserFastPaths.cpp: (WebCore::CSSParserFastPaths::isKeywordValidForStyleProperty): (WebCore::CSSParserFastPaths::isKeywordFastPathEligibleStyleProperty): (WebCore::parseKeywordValue): (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): Deleted. (WebCore::CSSParserFastPaths::isKeywordPropertyID): Deleted. * Source/WebCore/css/parser/CSSParserFastPaths.h: Update for more precise names that differentiate between properties and descriptors. * Source/WebCore/css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseValue): Remove unnecessary passing of the CSSParserContext to a member function. It can access it via *this. (WebCore::CSSPropertyParser::parseSingleValue): Update for rename from parse() to parseStyleProperty(). (WebCore::CSSPropertyParser::parseCounterStyleDescriptor): (WebCore::CSSPropertyParser::parseFontFaceDescriptor): (WebCore::CSSPropertyParser::parseFontFaceDescriptorShorthand): (WebCore::CSSPropertyParser::parseFontPaletteValuesDescriptor): Call through to the new generated parsers. (WebCore::consumeCounterStyleSystem): Deleted. (WebCore::consumeCounterStyleSymbol): Deleted. (WebCore::consumeCounterStyleNegative): Deleted. (WebCore::consumeCounterStyleRangeBound): Deleted. (WebCore::consumeCounterStyleRange): Deleted. (WebCore::consumeCounterStylePad): Deleted. (WebCore::consumeCounterStyleSymbols): Deleted. (WebCore::consumeCounterStyleAdditiveSymbols): Deleted. (WebCore::consumeCounterStyleSpeakAs): Deleted. (WebCore::consumeBasePaletteDescriptor): Deleted. (WebCore::consumeOverrideColorsDescriptor): Deleted. Moved to CSSPropertyParserHelpers.cpp for consistency. * Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeBackgroundSize): (WebCore::CSSPropertyParserHelpers::consumeFontFaceFontFamily): (WebCore::CSSPropertyParserHelpers::consumeFontPaletteValuesOverrideColors): (WebCore::CSSPropertyParserHelpers::consumeCounterStyleSystem): (WebCore::CSSPropertyParserHelpers::consumeCounterStyleSymbol): (WebCore::CSSPropertyParserHelpers::consumeCounterStyleNegative): (WebCore::CSSPropertyParserHelpers::consumeCounterStyleRangeBound): (WebCore::CSSPropertyParserHelpers::consumeCounterStyleRange): (WebCore::CSSPropertyParserHelpers::consumeCounterStylePad): (WebCore::CSSPropertyParserHelpers::consumeCounterStyleSymbols): (WebCore::CSSPropertyParserHelpers::consumeCounterStyleAdditiveSymbols): (WebCore::CSSPropertyParserHelpers::consumeCounterStyleSpeakAs): (WebCore::CSSPropertyParserHelpers::consumeFontFamilyDescriptor): Deleted. * Source/WebCore/css/parser/CSSPropertyParserHelpers.h: Moved functions from CSSPropertyParser. Renamed consumeFontFamilyDescriptor to consumeFontFaceFontFamily to better align with naming convention. * Source/WebCore/css/process-css-properties.py: Adds support for the new 'descriptors' top level object and generalizes parser code generation to support them. * Source/WebCore/inspector/agents/InspectorCSSAgent.cpp: (WebCore::InspectorCSSAgent::getSupportedCSSProperties): Update for renames. * Tools/Scripts/webkitpy/style/checkers/jsonchecker.py: Add checker support for the new sections. Remove support for descriptor-only. Canonical link: https://commits.webkit.org/258084@main
a29649e
to
229a3a2
Compare
Committed 258084@main (229a3a2): https://commits.webkit.org/258084@main Reviewed commits have been landed. Closing PR #7832 and removing active labels. |
229a3a2
a29649e
π§ͺ mac-AS-debug-wk2