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

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/size-feature-fractional-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/size-feature-fractional.html
    M Source/WebCore/css/query/ContainerQueryFeatures.cpp

  Log Message:
  -----------
  Container size queries truncate fractional container sizes to integers
https://bugs.webkit.org/show_bug.cgi?id=327038
rdar://189653185

Reviewed by Alan Baradlay.

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

The width, height, inline-size and block-size container features
unzoomed the container's content box size with
Style::unapplyingZoom<int>, which converted the LayoutUnit to an int
before comparing it with the query. On a 100.5px container,
(width > 100px) did not match and (width <= 100px) did. Under zoom > 1,
the int code path in unapplyingZoom adds 1 before dividing, so a 100.5px
container with zoom: 2 was evaluated as 101px and matched
(width > 100.5px).

Unzoom as a LayoutUnit instead. evaluateLengthFeature already takes a
LayoutUnit, so the int conversion only lost precision. The aspect-ratio
and orientation features already used the unrounded LayoutUnit sizes.

Test: 
imported/w3c/web-platform-tests/css/css-conditional/container-queries/size-feature-fractional.html

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/size-feature-fractional-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/container-queries/size-feature-fractional.html:
 Added.
* Source/WebCore/css/query/ContainerQueryFeatures.cpp:

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



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

Reply via email to