RESOLVED FIXED 226770
CSSOM test for serializing font-variant fails
https://bugs.webkit.org/show_bug.cgi?id=226770
Summary CSSOM test for serializing font-variant fails
Rob Buis
Reported 2021-06-08 08:02:40 PDT
CSSOM test for serializing font-variant fails, see css/cssom/serialize-values.html.
Attachments
Patch (11.01 KB, patch)
2021-06-08 09:33 PDT, Rob Buis
no flags
Patch (19.33 KB, patch)
2021-06-08 11:12 PDT, Rob Buis
no flags
Patch (24.83 KB, patch)
2021-06-08 13:18 PDT, Rob Buis
no flags
Patch (30.62 KB, patch)
2021-06-18 13:09 PDT, Rob Buis
no flags
Patch (30.92 KB, patch)
2021-06-19 01:07 PDT, Rob Buis
no flags
Patch (33.28 KB, patch)
2021-06-19 03:10 PDT, Rob Buis
no flags
Patch (30.79 KB, patch)
2021-06-21 10:11 PDT, Rob Buis
no flags
Rob Buis
Comment 1 2021-06-08 09:33:28 PDT
Rob Buis
Comment 2 2021-06-08 11:12:44 PDT
Rob Buis
Comment 3 2021-06-08 13:18:49 PDT
Radar WebKit Bug Importer
Comment 4 2021-06-15 08:03:16 PDT
Rob Buis
Comment 5 2021-06-18 13:09:06 PDT
Rob Buis
Comment 6 2021-06-19 01:07:36 PDT
Rob Buis
Comment 7 2021-06-19 03:10:58 PDT
Darin Adler
Comment 8 2021-06-20 19:19:25 PDT
Comment on attachment 431793 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=431793&action=review > Source/WebCore/css/parser/CSSPropertyParser.cpp:758 > + if (variant) { > + switch (*variant) { Could write this instead: switch (variant.value_or(FontVariantEastAsianVariant::Normal)) { Then we don’t have to nest the entire switch statement inside an if statement. It’s also such a mess how these functions map an enumeration value to a CSS value but don’t share any of the code to create the identifier and append. We could make this a lot tidier with a bit of refactoring. > Source/WebCore/css/parser/CSSPropertyParser.cpp:4969 > + addProperty(CSSPropertyFontVariantCaps, CSSPropertyFontVariant, CSSValuePool::singleton().createIdentifierValue(CSSValueNormal), important, true); > + addProperty(CSSPropertyFontVariantEastAsian, CSSPropertyFontVariant, CSSValuePool::singleton().createIdentifierValue(CSSValueNormal), important, true); > + addProperty(CSSPropertyFontVariantPosition, CSSPropertyFontVariant, CSSValuePool::singleton().createIdentifierValue(CSSValueNormal), important, true); This ", true" stuff is unreadable. This is why we don}t use booleans for arguments where we pass constants.
Rob Buis
Comment 9 2021-06-21 10:11:43 PDT
Rob Buis
Comment 10 2021-06-21 10:15:46 PDT
Comment on attachment 431793 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=431793&action=review >> Source/WebCore/css/parser/CSSPropertyParser.cpp:758 >> + switch (*variant) { > > Could write this instead: > > switch (variant.value_or(FontVariantEastAsianVariant::Normal)) { > > Then we don’t have to nest the entire switch statement inside an if statement. It’s also such a mess how these functions map an enumeration value to a CSS value but don’t share any of the code to create the identifier and append. We could make this a lot tidier with a bit of refactoring. That does seem nicer, fixed.
EWS
Comment 11 2021-06-21 11:19:02 PDT
Committed r279070 (238990@main): <https://commits.webkit.org/238990@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 431872 [details].
Note You need to log in before you can comment on or make changes to this bug.