Bug 248659 - auto-functions is useless if the parser doesn't accept `auto`
Summary: auto-functions is useless if the parser doesn't accept `auto`
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-12-02 07:43 PST by Oriol Brufau
Modified: 2022-12-09 07:44 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oriol Brufau 2022-12-02 07:43:17 PST
In CSSProperties.json, properties can be defined with "auto-functions":true, this generates a style builder like

    static void applyValueOrphans(BuilderState& builderState, CSSValue& value)
    {
        if (downcast<CSSPrimitiveValue>(value).valueID() == CSSValueAuto) {
            builderState.style().setHasAutoOrphans();
            return;
        }
        builderState.style().setOrphans(downcast<CSSPrimitiveValue>(value));
    }

However, this is useless if the parser doesn't accept `auto` as a valid keyword!

So I think that an error should be reported if parser-grammar doesn't contain "auto", or something like that.
Or maybe don't require that but let auto-functions automatically imply that `auto` is a valid keyword.

But the current state is bad, it means that orphans:initial doesn't map to any value of its grammar, and getComputedStyle().orphans can return "auto" which is not a supported value.

Both `orphans` and `widows` are affected.
Comment 1 Radar WebKit Bug Importer 2022-12-09 07:44:15 PST
<rdar://problem/103180481>