Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7183724a2a58dca5e6b63994c9e6c24ed9b2703f
      
https://github.com/WebKit/WebKit/commit/7183724a2a58dca5e6b63994c9e6c24ed9b2703f
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-10-14 (Wed, 14 Oct 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/compat/webkit-device-pixel-ratio-serialization-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/compat/webkit-device-pixel-ratio-serialization.html
    M Source/WebCore/css/query/GenericMediaQuerySerialization.cpp

  Log Message:
  -----------
  -webkit-{min,max}-device-pixel-ratio serializes as 
{min,max}--webkit-device-pixel-ratio
https://bugs.webkit.org/show_bug.cgi?id=327079
rdar://189687289

Reviewed by Antti Koivisto.

This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.

The media query parser stores `-webkit-min-device-pixel-ratio` as the feature
name `-webkit-device-pixel-ratio` with a >= comparison. The serializer then put
`min-` in front of the whole name, giving `min--webkit-device-pixel-ratio`. That
output shows up in MediaQueryList.media, MediaList.mediaText and
CSSMediaRule.conditionText. The same happened with `max-`.

When a feature name starts with `-webkit-`, the serializer now writes the vendor
prefix first and then `min-`/`max-`, so the original
`-webkit-min-device-pixel-ratio` form round-trips. This matches the alias names
in the Compat spec 
(https://compat.spec.whatwg.org/#css-media-queries-webkit-device-pixel-ratio)
and what Chrome and Firefox output.

The parser still accepts `min--webkit-device-pixel-ratio`. The Compat spec says
`min-`/`max-` prefixes must not apply to `-webkit-device-pixel-ratio`, but every
engine accepts that form, so rejecting it would hurt compatibility. It is
deliberately left unchanged and untested.

Test: 
imported/w3c/web-platform-tests/compat/webkit-device-pixel-ratio-serialization.html

* 
LayoutTests/imported/w3c/web-platform-tests/compat/webkit-device-pixel-ratio-serialization-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/compat/webkit-device-pixel-ratio-serialization.html:
 Added.
* Source/WebCore/css/query/GenericMediaQuerySerialization.cpp:
(WebCore::MQ::serialize):

Canonical link: https://commits.webkit.org/323731@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to