WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
232874
Refactor consumeWillChange()
https://bugs.webkit.org/show_bug.cgi?id=232874
Summary
Refactor consumeWillChange()
Tim Nguyen (:ntim)
Reported
2021-11-09 03:05:39 PST
See
bug 232868 comment 9
Attachments
Patch
(3.47 KB, patch)
2021-11-09 03:14 PST
,
Tim Nguyen (:ntim)
no flags
Details
Formatted Diff
Diff
Patch
(3.80 KB, patch)
2021-11-09 03:21 PST
,
Tim Nguyen (:ntim)
koivisto
: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Tim Nguyen (:ntim)
Comment 1
2021-11-09 03:14:53 PST
Created
attachment 443671
[details]
Patch
Tim Nguyen (:ntim)
Comment 2
2021-11-09 03:21:38 PST
Created
attachment 443672
[details]
Patch
Antti Koivisto
Comment 3
2021-11-09 04:06:09 PST
Comment on
attachment 443672
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=443672&action=review
> Source/WebCore/css/parser/CSSPropertyParser.cpp:-502 > // Every comma-separated list of identifiers is a valid will-change value, > // unless the list includes an explicitly disallowed identifier. > - while (true) { > - if (range.peek().type() != IdentToken) > + while (!range.atEnd()) { > + switch (range.peek().id()) { > + case CSSValueNone: > + case CSSValueAll: > + case CSSValueAuto: > return nullptr; > - CSSPropertyID propertyID = cssPropertyID(range.peek().value()); > - if (propertyID != CSSPropertyInvalid) { > - // Now "all" is used by both CSSValue and CSSPropertyValue. > - // Need to return nullptr when currentValue is CSSPropertyAll. > - if (propertyID == CSSPropertyWillChange || propertyID == CSSPropertyAll) > - return nullptr; > - values->append(CSSValuePool::singleton().createIdentifierValue(propertyID)); > - range.consumeIncludingWhitespace(); > - } else {
It is not clear to me how this is better. The primary purpose of this loop is to consume property identifiers which the old code made clear. After your change the loop looks like it is about CSSValues and property IDs are a buried special case.
Tim Nguyen (:ntim)
Comment 4
2021-11-09 04:51:47 PST
(In reply to Antti Koivisto from
comment #3
)
> Comment on
attachment 443672
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=443672&action=review
> > > Source/WebCore/css/parser/CSSPropertyParser.cpp:-502 > > // Every comma-separated list of identifiers is a valid will-change value, > > // unless the list includes an explicitly disallowed identifier. > > - while (true) { > > - if (range.peek().type() != IdentToken) > > + while (!range.atEnd()) { > > + switch (range.peek().id()) { > > + case CSSValueNone: > > + case CSSValueAll: > > + case CSSValueAuto: > > return nullptr; > > - CSSPropertyID propertyID = cssPropertyID(range.peek().value()); > > - if (propertyID != CSSPropertyInvalid) { > > - // Now "all" is used by both CSSValue and CSSPropertyValue. > > - // Need to return nullptr when currentValue is CSSPropertyAll. > > - if (propertyID == CSSPropertyWillChange || propertyID == CSSPropertyAll) > > - return nullptr; > > - values->append(CSSValuePool::singleton().createIdentifierValue(propertyID)); > > - range.consumeIncludingWhitespace(); > > - } else { > > It is not clear to me how this is better. The primary purpose of this loop > is to consume property identifiers which the old code made clear. > > After your change the loop looks like it is about CSSValues and property IDs > are a buried special case.
This is how the spec defines things, defines values first, and property IDs are just a special cases of <custom-ident>, so to me this is actually easier to read.
Antti Koivisto
Comment 5
2021-11-09 04:57:27 PST
Comment on
attachment 443672
[details]
Patch Ok then!
Tim Nguyen (:ntim)
Comment 6
2021-11-09 05:08:29 PST
Committed
r285492
(
244016@main
): <
https://commits.webkit.org/244016@main
>
Radar WebKit Bug Importer
Comment 7
2021-11-09 05:09:21 PST
<
rdar://problem/85198621
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug