Bug 248396

Summary: [MQ4] Disallow negative values
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: CSSAssignee: Antti Koivisto <koivisto>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, eric.carlson, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, jer.noble, macpherson, menard, ntim, philipj, sergio, webkit-bug-importer, youssefdevelops, y_soliman, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 248391    
Attachments:
Description Flags
Patch
none
Patch none

Antti Koivisto
Reported 2022-11-28 07:33:54 PST
Disallow negative values for now even though they are allowed by the spec (https://www.w3.org/TR/mediaqueries-4/#false-in-the-negative-range). The current WPTs don't yet follow this behavior and no other engine implements it. It is better enabled separately. Also other parsing and evaluation fixes.
Attachments
Patch (33.48 KB, patch)
2022-11-28 07:43 PST, Antti Koivisto
no flags
Patch (34.29 KB, patch)
2022-11-28 10:18 PST, Antti Koivisto
no flags
Antti Koivisto
Comment 1 2022-11-28 07:43:58 PST
Tim Nguyen (:ntim)
Comment 2 2022-11-28 08:17:48 PST
(Fwiw I think the main reason they're allowed is for calc())
Antti Koivisto
Comment 3 2022-11-28 10:14:07 PST
(In reply to Tim Nguyen (:ntim) from comment #2) > (Fwiw I think the main reason they're allowed is for calc()) They are still allowed for calc() (matching others).
Radar WebKit Bug Importer
Comment 4 2022-11-28 10:16:15 PST
Antti Koivisto
Comment 5 2022-11-28 10:18:06 PST
Darin Adler
Comment 6 2022-11-28 10:22:48 PST
Not sure I feel about using { } instead of std::nullopt for std::optional return values.
Antti Koivisto
Comment 7 2022-11-28 10:53:35 PST
(In reply to Darin Adler from comment #6) > Not sure I feel about using { } instead of std::nullopt for std::optional > return values. It is a pretty common pattern in WebKit. I don't see the benefits of being more verbose.
Darin Adler
Comment 8 2022-11-28 11:24:34 PST
(In reply to Antti Koivisto from comment #7) > It is a pretty common pattern in WebKit. I don't see the benefits of being > more verbose. OK, agreed.
EWS
Comment 9 2022-11-28 23:50:58 PST
Committed 257105@main (aacea0b8da7d): <https://commits.webkit.org/257105@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 463764 [details].
Note You need to log in before you can comment on or make changes to this bug.