Bug 247118

Summary: [MQ4] Add schemas for resolution and -webkit-device-pixel-ratio features
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: CSSAssignee: Antti Koivisto <koivisto>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, cmarcelo, 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: 247124    
Bug Blocks: 180234    
Attachments:
Description Flags
Patch none

Antti Koivisto
Reported 2022-10-27 02:11:50 PDT
Support resolution features
Attachments
Patch (10.06 KB, patch)
2022-10-27 02:22 PDT, Antti Koivisto
no flags
Radar WebKit Bug Importer
Comment 1 2022-10-27 02:13:03 PDT
Antti Koivisto
Comment 2 2022-10-27 02:22:57 PDT
Tim Nguyen (:ntim)
Comment 3 2022-10-27 07:04:13 PDT
Comment on attachment 463270 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=463270&action=review > Source/WebCore/css/query/GenericMediaQueryParser.cpp:64 > + if (name.startsWith("-webkit-min-"_s)) > + return { "-webkit-"_s + StringView(name).substring(12), ComparisonOperator::GreaterThanOrEqual }; > + if (name.startsWith("-webkit-max-"_s)) > + return { "-webkit-"_s + StringView(name).substring(12), ComparisonOperator::LessThanOrEqual }; Does this make us support -webkit-min/max for _all_ the range based media queries? If so, I think we should just check specific names here. Also, how does this even work? As implemented, it sounds like this would just work for `-webkit-min--webkit-device-pixel-ratio` as opposed to `-webkit-min-device-pixel-ratio`.
Antti Koivisto
Comment 4 2022-10-27 07:08:44 PDT
> Does this make us support -webkit-min/max for _all_ the range based media > queries? If so, I think we should just check specific names here. The generated name contains -webkit- prefix which won't match any known feature and the parsing will fail during validation. > Also, how does this even work? As implemented, it sounds like this would > just work for `-webkit-min--webkit-device-pixel-ratio` as opposed to > `-webkit-min-device-pixel-ratio`. I don't understand.
Tim Nguyen (:ntim)
Comment 5 2022-10-27 07:11:47 PDT
(In reply to Antti Koivisto from comment #4) > > Also, how does this even work? As implemented, it sounds like this would > > just work for `-webkit-min--webkit-device-pixel-ratio` as opposed to > > `-webkit-min-device-pixel-ratio`. > > I don't understand. Isn't the schema name `-webkit-device-pixel-ratio`, how does it match `device-pixel-ratio` (e.g. without the -webkit- prefix)?
Antti Koivisto
Comment 6 2022-10-27 07:12:54 PDT
The idea here is to replace -webkit-max- prefix with -webkit- prefix to get the actual feature name. This is equivalent to stripping away min-/max- prefix in the usual case.
EWS
Comment 7 2022-10-27 07:49:11 PDT
Committed 256064@main (b0723e965bf6): <https://commits.webkit.org/256064@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 463270 [details].
Note You need to log in before you can comment on or make changes to this bug.