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.
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.
Yes, actually StyleBuilder.cpp already has static const CSSPropertyID firstLowPriorityProperty = static_cast<CSSPropertyID>(lastHighPriorityProperty + 1);
<rdar://problem/90799486>
Created attachment 455784 [details] Patch
Created attachment 455785 [details] Patch for EWS
Created attachment 455789 [details] Patch
Created attachment 455791 [details] Patch for EWS
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].