| Summary: | Update consumeNumberRaw() to return an Optional<double> rather than using a bool/out parameter pattern | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Sam Weinig <sam> | ||||
| Component: | New Bugs | Assignee: | Sam Weinig <sam> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | darin, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, macpherson, menard, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=221174 | ||||||
| Attachments: |
|
||||||
|
Description
Sam Weinig
2021-01-29 16:11:15 PST
Created attachment 418783 [details]
Patch
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. Comment on attachment 418783 [details]
Patch
Will address feedback in follow up already in the pipeline.
Committed r272094: <https://trac.webkit.org/changeset/272094> All reviewed patches have been landed. Closing bug and clearing flags on attachment 418783 [details]. (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. |