[webkit-changes] [WebKit/WebKit] cc5ecd: FrameLoader::didFirstLayout() shouldn't restore sc...

Ryosuke Niwa noreply at github.com
Wed May 10 23:12:21 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cc5ecdf646e371725cb2eb0f54bd47904a0d79c9
      https://github.com/WebKit/WebKit/commit/cc5ecdf646e371725cb2eb0f54bd47904a0d79c9
  Author: Ryosuke Niwa <rniwa at webkit.org>
  Date:   2023-05-10 (Wed, 10 May 2023)

  Changed paths:
    M Source/WebCore/loader/FrameLoader.cpp
    M Source/WebCore/loader/FrameLoader.h
    M Source/WebCore/page/Page.cpp
    M Source/WebCore/page/Page.h

  Log Message:
  -----------
  FrameLoader::didFirstLayout() shouldn't restore scroll position and view state synchronously
https://bugs.webkit.org/show_bug.cgi?id=256626

Reviewed by Simon Fraser.

It's problematic to restore scroll position and view state synchronously as that could involve
nested layout / script execution (due to focusing of an element).

Delay this work until the next rendering update to make FrameLoader::didFirstLayout free of
script executions.

* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::didFirstLayout):
(WebCore::FrameLoader::restoreScrollPositionAndViewStateSoon):
(WebCore::FrameLoader::restoreScrollPositionAndViewStateNowIfNeeded):
* Source/WebCore/loader/FrameLoader.h:
* Source/WebCore/page/Page.cpp:
(WebCore::Page::updateRendering):
(WebCore::operator<<):
* Source/WebCore/page/Page.h:

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




More information about the webkit-changes mailing list