Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 8c86f543c7bf066dbbdc8a2b09a65d282de7fceb
https://github.com/WebKit/WebKit/commit/8c86f543c7bf066dbbdc8a2b09a65d282de7fceb
Author: Pascoe <[email protected]>
Date: 2026-05-12 (Tue, 12 May 2026)
Changed paths:
A
LayoutTests/http/tests/site-isolation/device-media-features-in-cross-origin-iframe-expected.txt
A
LayoutTests/http/tests/site-isolation/device-media-features-in-cross-origin-iframe.html
A
LayoutTests/http/tests/site-isolation/resources/device-media-features-iframe.html
M Source/WebCore/css/query/MediaQueryFeatures.cpp
Log Message:
-----------
CSS media-queries report zero under site isolation
<https://bugs.webkit.org/show_bug.cgi?id=314654>
<rdar://163298936>
Reviewed by Charlie Wolfe.
The `device-width`, `device-height`, and `device-aspect-ratio` media
features evaluated to zero in cross-origin iframes because they read
screen size via `localMainFrame()->screenSize()`. Under site isolation
the main frame in a cross-origin iframe's web process is a `RemoteFrame`,
so `localMainFrame()` returns nullptr and the evaluators fall through to
zero. Read `screenSize()` from the current local frame instead, matching
the pattern used by `Screen::width()` / `Screen::height()`.
Test:
http/tests/site-isolation/device-media-features-in-cross-origin-iframe.html
*
LayoutTests/http/tests/site-isolation/device-media-features-in-cross-origin-iframe-expected.txt:
Added.
*
LayoutTests/http/tests/site-isolation/device-media-features-in-cross-origin-iframe.html:
Added.
*
LayoutTests/http/tests/site-isolation/resources/device-media-features-iframe.html:
Added.
* Source/WebCore/css/query/MediaQueryFeatures.cpp:
(WebCore::MQ::Features::deviceAspectRatioFeatureSchema):
(WebCore::MQ::Features::deviceHeightFeatureSchema):
(WebCore::MQ::Features::deviceWidthFeatureSchema):
Canonical link: https://commits.webkit.org/313116@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications