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
221164
Update consumeNumberRaw() to return an Optional<double> rather than using a bool/out parameter pattern
https://bugs.webkit.org/show_bug.cgi?id=221164
Summary
Update consumeNumberRaw() to return an Optional<double> rather than using a b...
Sam Weinig
Reported
2021-01-29 16:11:15 PST
Update consumeNumberRaw() to return an Optional<double> rather than using a bool/out parameter pattern
Attachments
Patch
(26.47 KB, patch)
2021-01-29 16:12 PST
,
Sam Weinig
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Sam Weinig
Comment 1
2021-01-29 16:12:18 PST
Created
attachment 418783
[details]
Patch
Darin Adler
Comment 2
2021-01-29 17:09:15 PST
Comment on
attachment 418783
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=418783&action=review
Seems like a helper that does a number or a percentage and converts the percentage just by dividing by 100 would simplify code in a few different places.
> Source/WebCore/css/parser/CSSPropertyParser.cpp:5038 > + if (auto num = consumeNumberRaw(m_range)) {
Could have expanded the name num to number since touching this code.
> Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp:780 > + alpha = clampTo<double>(*percent / 100.0f, 0.0, 1.0);
The "f" here seems wrong. Was in the old code too, but wrong.
Sam Weinig
Comment 3
2021-01-29 17:45:20 PST
Comment on
attachment 418783
[details]
Patch Will address feedback in follow up already in the pipeline.
EWS
Comment 4
2021-01-29 18:13:51 PST
Committed
r272094
: <
https://trac.webkit.org/changeset/272094
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 418783
[details]
.
Radar WebKit Bug Importer
Comment 5
2021-01-29 18:14:13 PST
<
rdar://problem/73780435
>
Sam Weinig
Comment 6
2021-01-29 20:14:05 PST
(In reply to Sam Weinig from
comment #3
)
> Comment on
attachment 418783
[details]
> Patch > > Will address feedback in follow up already in the pipeline.
Specifically, they are addressed by
https://bugs.webkit.org/show_bug.cgi?id=221174
.
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