Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2f1d182fbf18f5b0685a5d19c979b56ca8f9a950
      
https://github.com/WebKit/WebKit/commit/2f1d182fbf18f5b0685a5d19c979b56ca8f9a950
  Author: Wenson Hsieh <[email protected]>
  Date:   2025-05-09 (Fri, 09 May 2025)

  Changed paths:
    A 
LayoutTests/fast/css/viewport-units-after-changing-obscured-content-insets-expected.html
    A 
LayoutTests/fast/css/viewport-units-after-changing-obscured-content-insets.html
    M Source/WebCore/page/LocalFrameView.cpp

  Log Message:
  -----------
  [macOS] webkit.org doesn't render completely after showing/hiding the sidebar
https://bugs.webkit.org/show_bug.cgi?id=292744
rdar://149499441

Reviewed by Megan Gardner and Aditya Keerthi.

Changing obscured content insets on macOS (e.g. changing sidebar width, or 
navigation bar height by
toggling the favorites bar) causes the viewport size for CSS viewport units to 
change, but currently
doesn't invalidate any element styles that are dependent on viewport units. As 
a result, `vw` and
`vh` may become stale when changing obscured content insets, until the user 
resizes the window (or
otherwise forces style to be recalculated for elements that use viewport 
units). On webkit.org, this
ends up being the width of the main content, which has `width: 100vw;`.

To fix this, we call `updateViewportUnitsOnResize()` when obscured content 
insets change.

* 
LayoutTests/fast/css/viewport-units-after-changing-obscured-content-insets-expected.html:
 Added.
* 
LayoutTests/fast/css/viewport-units-after-changing-obscured-content-insets.html:
 Added.

Add a layout test to verify that adding and then removing top/left content 
insets leaves viewport
units in its original state. The test ends up being flaky without this fix.

* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::obscuredContentInsetsDidChange):

See above.

Canonical link: https://commits.webkit.org/294711@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