Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 75bbb1a345f3ff296e72eaea48c86f668e26b9b8
      
https://github.com/WebKit/WebKit/commit/75bbb1a345f3ff296e72eaea48c86f668e26b9b8
  Author: Aleksei Marchenko <[email protected]>
  Date:   2026-04-06 (Mon, 06 Apr 2026)

  Changed paths:
    A 
LayoutTests/model-element/model-element-determines-if-scroll-gesture-updates-position-information-after-bfcache-expected.txt
    A 
LayoutTests/model-element/model-element-determines-if-scroll-gesture-updates-position-information-after-bfcache.html
    M 
LayoutTests/model-element/model-element-determines-if-scroll-gesture-updates-position-information-frames.html
    M Source/WebCore/Modules/model-element/HTMLModelElement.cpp
    M Source/WebCore/Modules/model-element/HTMLModelElement.h
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/dom/Document.h
    M Source/WebCore/page/Page.cpp
    M Source/WebCore/page/Page.h
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

  Log Message:
  -----------
  [ModelElement] stagemode=orbit does not allow user interaction after 
back/forward navigation
https://bugs.webkit.org/show_bug.cgi?id=310932
rdar://173267221

Reviewed by Etienne Segonzac and Mike Wyrzykowski.

Model element counting was tied to DOM insertion/removal
(insertionSteps/removingSteps), which required special handling in
Document::destroyRenderTree and createRenderTree for BFCache since
DOM nodes stay connected while renderers are torn down. Move the
counting to didAttachRenderers/willDetachRenderers instead, which
naturally follows the renderer lifecycle and correctly handles BFCache
restore without extra bookkeeping. This removes the document-level
m_modelElementCount entirely — the page-level count is now maintained
directly by HTMLModelElement.

The WKScrollView's UIScrollViewPanGestureRecognizer can begin before
_modelInteractionPanGestureRecognizer reaches
gestureRecognizerShouldBegin:, causing UIKit to fail the model pan
gesture since the two do not allow simultaneous recognition. Add a
dynamic failure requirement in shouldBeRequiredToFailByGestureRecognizer:
so that when hasModelElement() is true, the scroll view pan waits for
the model pan to resolve first. When hasModelElement() is false, no
requirement is imposed, preserving zero-latency scrolling.

model-element-determines-if-scroll-gesture-updates-position-information-frames.html:
wait for iframe load events in the test before scrolling, so model
elements inside iframes are counted before the gesture is evaluated.

Test: 
model-element/model-element-determines-if-scroll-gesture-updates-position-information-after-bfcache.html

* 
LayoutTests/model-element/model-element-determines-if-scroll-gesture-updates-position-information-after-bfcache-expected.txt:
 Added.
* 
LayoutTests/model-element/model-element-determines-if-scroll-gesture-updates-position-information-after-bfcache.html:
 Added.
* 
LayoutTests/model-element/model-element-determines-if-scroll-gesture-updates-position-information-frames.html:
* Source/WebCore/Modules/model-element/HTMLModelElement.cpp:
(WebCore::HTMLModelElement::didAttachRenderers):
(WebCore::HTMLModelElement::willDetachRenderers):
(WebCore::HTMLModelElement::insertionSteps):
(WebCore::HTMLModelElement::removingSteps):
* Source/WebCore/Modules/model-element/HTMLModelElement.h:
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::destroyRenderTree):
(WebCore::Document::incrementModelElementCount): Deleted.
(WebCore::Document::decrementModelElementCount): Deleted.
* Source/WebCore/dom/Document.h:
(WebCore::Document::hasModelElement const): Deleted.
* Source/WebCore/page/Page.cpp:
(WebCore::Page::decrementModelElementCount):
* Source/WebCore/page/Page.h:
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView gestureRecognizer:shouldBeRequiredToFailByGestureRecognizer:]):

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



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

Reply via email to