Bug 238153 - Implement CSSNumericValue.mul, div, add, sub, max, and min
Summary: Implement CSSNumericValue.mul, div, add, sub, max, and min
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-03-21 14:02 PDT by Alex Christensen
Modified: 2022-03-21 20:24 PDT (History)
8 users (show)

See Also:


Attachments
Patch (42.67 KB, patch)
2022-03-21 14:06 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (42.46 KB, patch)
2022-03-21 14:57 PDT, Alex Christensen
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (42.54 KB, patch)
2022-03-21 15:16 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (58.74 KB, patch)
2022-03-21 19:15 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2022-03-21 14:02:50 PDT
Implement CSSNumericValue.mul, div, add, sub, max, and min
Comment 1 Alex Christensen 2022-03-21 14:06:55 PDT
Created attachment 455275 [details]
Patch
Comment 2 Alex Christensen 2022-03-21 14:57:39 PDT
Created attachment 455278 [details]
Patch
Comment 3 Alex Christensen 2022-03-21 15:16:15 PDT
Created attachment 455279 [details]
Patch
Comment 4 Simon Fraser (smfr) 2022-03-21 17:42:34 PDT
Comment on attachment 455279 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=455279&action=review

> Source/WebCore/css/typedom/CSSNumericValue.cpp:56
> +        return static_cast<CSSMathNegate&>(value.get()).value();

Shouldn't we be using is<> and downcast<> here and everywhere?

> Source/WebCore/css/typedom/CSSNumericValue.cpp:72
> +        if (thisValue.unit() == "number") {

Maybe units should be AtomStrings.
Comment 5 Alex Christensen 2022-03-21 18:15:38 PDT
(In reply to Simon Fraser (smfr) from comment #4)
> Comment on attachment 455279 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=455279&action=review
> 
> > Source/WebCore/css/typedom/CSSNumericValue.cpp:56
> > +        return static_cast<CSSMathNegate&>(value.get()).value();
> 
> Shouldn't we be using is<> and downcast<> here and everywhere?

Yes.  That makes the code much nicer.

> > Source/WebCore/css/typedom/CSSNumericValue.cpp:72
> > +        if (thisValue.unit() == "number") {
> 
> Maybe units should be AtomStrings.

Or just CSSUnitType.  I added a fixme comment because that's more involved and less related to the other changes.
Comment 6 Alex Christensen 2022-03-21 19:15:54 PDT
Created attachment 455316 [details]
Patch
Comment 7 EWS 2022-03-21 20:23:54 PDT
Committed r291597 (248690@main): <https://commits.webkit.org/248690@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 455316 [details].
Comment 8 Radar WebKit Bug Importer 2022-03-21 20:24:17 PDT
<rdar://problem/90609949>