RESOLVED FIXED 238345
[css-cascade] makeprop.pl should sort deferred properties at the end
https://bugs.webkit.org/show_bug.cgi?id=238345
Summary [css-cascade] makeprop.pl should sort deferred properties at the end
Oriol Brufau
Reported 2022-03-24 13:06:36 PDT
Currently, the CSSPropertyID enum is sorted like this: 1. Special meaning: CSSPropertyInvalid and CSSPropertyCustom 2. High priority properties: firstCSSProperty..lastHighPriorityProperty 3. Low priority properties: (lastHighPriorityProperty+1)..lastCSSProperty However, among low priority ones, there are some that are not cascaded with the others, they are deferred and applied in parse order. These should be sorted into their own category at the end: 1. Special meaning: CSSPropertyInvalid and CSSPropertyCustom 2. High priority properties: firstCSSProperty..lastHighPriorityProperty 3. Low priority properties: (lastHighPriorityProperty+1)..lastLowPriorityProperty 4. Deferred properties: (lastLowPriorityProperty+1)..lastCSSProperty This would help bug 238260.
Attachments
Patch (14.98 KB, patch)
2022-03-25 10:52 PDT, Oriol Brufau
no flags
Patch for EWS (48.15 KB, patch)
2022-03-25 10:53 PDT, Oriol Brufau
no flags
Patch (14.99 KB, patch)
2022-03-25 11:49 PDT, Oriol Brufau
no flags
Patch for EWS (48.16 KB, patch)
2022-03-25 11:50 PDT, Oriol Brufau
no flags
Darin Adler
Comment 1 2022-03-24 13:55:44 PDT
Since this is a generated file, I suggest we generate first/last constants for each section. first/lastCSSProperty first/lastHighPriorityCSSProperty first/lastLowPriorityCSSProperty first/lastDeferredCSSProperty That way, most code that wants to make checks can be written without depending on the ordering at all; the few places that do depend on the ordering can be written in the clearest fashion possible. Somewhere we could even put functions so we don't have to use these constants directly so often: bool isHighPriority(CSSPropertyID); bool isLowPriority(CSSPropertyID); bool isDeferred(CSSPropertyID); Or whatever predicates we need. I think it helps when code can write such things so they read cleanly even if they are just expanding to < and > checks.
Oriol Brufau
Comment 2 2022-03-24 14:22:34 PDT
Yes, actually StyleBuilder.cpp already has static const CSSPropertyID firstLowPriorityProperty = static_cast<CSSPropertyID>(lastHighPriorityProperty + 1);
Radar WebKit Bug Importer
Comment 3 2022-03-24 16:06:24 PDT
Oriol Brufau
Comment 4 2022-03-25 10:52:16 PDT
Oriol Brufau
Comment 5 2022-03-25 10:53:03 PDT
Created attachment 455785 [details] Patch for EWS
Oriol Brufau
Comment 6 2022-03-25 11:49:18 PDT
Oriol Brufau
Comment 7 2022-03-25 11:50:01 PDT
Created attachment 455791 [details] Patch for EWS
EWS
Comment 8 2022-04-08 15:48:20 PDT
Committed r292639 (249459@main): <https://commits.webkit.org/249459@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 455789 [details].
Note You need to log in before you can comment on or make changes to this bug.