Bug 238153

Summary: Implement CSSNumericValue.mul, div, add, sub, max, and min
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, macpherson, menard, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
ews-feeder: commit-queue-
Patch
none
Patch none

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>