Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d359a18a7a212d1820e28fa1543d356253fa1394
https://github.com/WebKit/WebKit/commit/d359a18a7a212d1820e28fa1543d356253fa1394
Author: Taher Ali <[email protected]>
Date: 2026-02-25 (Wed, 25 Feb 2026)
Changed paths:
A
LayoutTests/fast/events/resize-event-not-fired-during-page-scale-expected.txt
A LayoutTests/fast/events/resize-event-not-fired-during-page-scale.html
M Source/WebCore/page/LocalFrameView.cpp
M Source/WebCore/page/LocalFrameView.h
Log Message:
-----------
REGRESSION (302097@main): pinch to zoom makes content jump or disappear
https://bugs.webkit.org/show_bug.cgi?id=308156
rdar://169593089
Reviewed by Simon Fraser.
302097@main added frameScaleFactor as a trigger for firing resize events
in scheduleResizeEventIfNeeded(). On macOS, the main frame's
frameScaleFactor() returns pageScaleFactor(), which changes when
pinch-to-zoom commits. This caused resize event to fire even though
the viewport didn't actually resize.
innerWidth/innerHeight have always taken frameScaleFactor into account
(in mapFromLayoutToCSSUnits), so they report smaller values at higher
zoom levels. When the spurious resize event fires, sites that use
JS-driven responsive breakpoints read the smaller innerWidth and
switch to a mobile layout. This mismatch causes content to
jump or disappear (e.g., roadburn.com/nightbus collapses from
two-column to single-column layout on pinch zoom).
Note: innerWidth/innerHeight changing during pinch-to-zoom may itself
be a bug worth investigating separately. Chrome does not change these
values on pinch zoom nor fire a resize event.
This fix simply undoes the frameScaleFactor addition from 302097@main
to recover from the regression. Cmd+/- (page zoom) and CSS zoom changes
still correctly fire resize events. only pinch-to-zoom no longer does.
*
LayoutTests/fast/events/resize-event-not-fired-during-page-scale-expected.txt:
Added.
* LayoutTests/fast/events/resize-event-not-fired-during-page-scale.html: Added.
* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::scheduleResizeEventIfNeeded):
* Source/WebCore/page/LocalFrameView.h:
Canonical link: https://commits.webkit.org/308244@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications