Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 819df563a4f63736b23e5617bdf7f3320f90bed6
      
https://github.com/WebKit/WebKit/commit/819df563a4f63736b23e5617bdf7f3320f90bed6
  Author: Sammy Gill <[email protected]>
  Date:   2025-10-16 (Thu, 16 Oct 2025)

  Changed paths:
    M LayoutTests/TestExpectations
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-viewport/zoom/container-queries-block-size-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-viewport/zoom/container-queries-block-size.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-viewport/zoom/container-queries-height-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-viewport/zoom/container-queries-height.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-viewport/zoom/container-queries-inline-size-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-viewport/zoom/container-queries-inline-size.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-viewport/zoom/reference/container-queries-block-size-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-viewport/zoom/reference/container-queries-height-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-viewport/zoom/reference/container-queries-inline-size-ref.html
    M Source/WebCore/css/query/ContainerQueryFeatures.cpp
    M Source/WebCore/rendering/style/RenderStyleConstants.h

  Log Message:
  -----------
  [CSS Zoom] Evaluate container queries against unzoomed sizes.
https://bugs.webkit.org/show_bug.cgi?id=300066
rdar://161861142

Reviewed by Antti Koivisto, Sam Weinig, and Matthieu Dubet.

There was a CSSWG resolution which clarified the behavior between the
zoom property and resolving container queries in terms of what size
values the container query should use. The resolution was to use the
unscaled dimensions of the principle box.

https://github.com/w3c/csswg-drafts/issues/10268

This patch aligns WebKit with other engines by removing the scale from
the principle box when evaluating a container query since we apply zoom
to the renderer's sizes during layout. There are two exceptions we use
to decide not to apply this logic:

1.) If the computed value of the propery is a non-fixed value.
Technically the spec only calls out the auto or percent cases but it
seems other engines also do not apply zoom to other non-fixed values
(e.g. intrinsic keywords).

2.) If the RenderStyle associated with the principle box has the
useSVGZoomRulesForLength bit set. This is because we handle zoom
differently since we seem to scale the entire document. This may be
correct but I opt for the safest case here which is to not change
functionality.

Tests: 
imported/w3c/web-platform-tests/css/css-viewport/zoom/container-queries-block-size.html
       
imported/w3c/web-platform-tests/css/css-viewport/zoom/container-queries-height.html
       
imported/w3c/web-platform-tests/css/css-viewport/zoom/container-queries-inline-size.html
       
imported/w3c/web-platform-tests/css/css-viewport/zoom/reference/container-queries-block-size-ref.html
       
imported/w3c/web-platform-tests/css/css-viewport/zoom/reference/container-queries-height-ref.html
       
imported/w3c/web-platform-tests/css/css-viewport/zoom/reference/container-queries-inline-size-ref.html
I also added a few more tests to cover container queries against the
container height and also make sure we are checking the inline/block
dimensions correctly.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to