Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ff176e1f45d70cf935dbe7b87373409a819d4d20
      
https://github.com/WebKit/WebKit/commit/ff176e1f45d70cf935dbe7b87373409a819d4d20
  Author: Brent Fulgham <[email protected]>
  Date:   2026-10-13 (Tue, 13 Oct 2026)

  Changed paths:
    A 
LayoutTests/resize-observer/resize-observer-iframe-scrollbar-on-owner-element-expected.txt
    A 
LayoutTests/resize-observer/resize-observer-iframe-scrollbar-on-owner-element.html
    M Source/WebCore/page/LocalFrameView.cpp
    M Source/WebCore/page/LocalFrameView.h

  Log Message:
  -----------
  frames using custom scrollbar continually resize
https://bugs.webkit.org/show_bug.cgi?id=324485
<rdar://186222322>

Reviewed by Cole Carley.

A subframe can get a custom `::-webkit-scrollbar` from two places: the child 
document's
`<body>`/`<html>`, or the `<iframe>`/`<frame>` element in the parent document.

When WebKit builds the scrollbar, it looks at both sources. When it decided 
whether the
scrollbar will take up layout space, it was only referring to the child 
document. This
meant that if a frame has an owner with a scrollbar rule that indicates "no 
scrollbar here
takes space", but the iframe rule does require space, the layout gets confused.

This fix updates `ScrollView::updateScrollbars()` so that it lays out the child 
before
deciding whether room might be needed for a scrollbar, and uses the true 
content height.

Test: resize-observer/resize-observer-iframe-scrollbar-on-owner-element.html

* 
LayoutTests/resize-observer/resize-observer-iframe-scrollbar-on-owner-element-expected.txt:
 Added.
* 
LayoutTests/resize-observer/resize-observer-iframe-scrollbar-on-owner-element.html:
 Added.
* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::usesCustomScrollbarStyle const):
(WebCore::LocalFrameView::createScrollbar):
(WebCore::LocalFrameView::canShowNonOverlayScrollbars const):
* Source/WebCore/page/LocalFrameView.h:

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



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

Reply via email to