[webkit-changes] [WebKit/WebKit] 409eb0: Regression(260713 at main) https://www.theverge.com/2...

Chris Dumez noreply at github.com
Wed Jun 21 21:12:24 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 409eb08416e5072a678a4d7dbb9c7f6febdeeabe
      https://github.com/WebKit/WebKit/commit/409eb08416e5072a678a4d7dbb9c7f6febdeeabe
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-06-21 (Wed, 21 Jun 2023)

  Changed paths:
    M LayoutTests/http/tests/lazyload/synchronous-frame-creation-expected.txt
    M LayoutTests/http/tests/lazyload/synchronous-frame-creation.html
    M Source/WebCore/loader/FrameLoader.cpp

  Log Message:
  -----------
  Regression(260713 at main) https://www.theverge.com/2023/5/17/23686294/montana-tiktok-ban-signed-governor-gianforte-court load never completes
https://bugs.webkit.org/show_bug.cgi?id=258361
rdar://109517889

Reviewed by Ryosuke Niwa.

In 260713 at main, I made it so that lazily loaded iframes synchronously get an
initial empty document until they get closed to the viewport and actually get
loaded. This was to align with the specification and Chrome.

However, there was an unintentional side effect from this change. The load event
of the parent frame would no longer fire until the lazy iframe actually gets
loaded, which is incorrect. After investigation, I figured out that the lazy
iframes delay the load event of its parent because FrameLoader::subframeIsLoading()
returns true, because the lazy iframe has a policy DocumentLoader.

This policy DocumentLoader gets set by FrameLoader::init() before setting the
provisional DocumentLoader and it doesn't actually get cleared until a load
occurs in the frame.

To address the issue, I am updating FrameLoader::init() to clear the policy
DocumentLoader after setting the provisional one. No policy decision occurs
for the initial empty document so this policy DocumentLoder is not needed
and would not get cleared otherwise since it is supposed to happen after
the policy decision has been made.

* LayoutTests/http/tests/lazyload/synchronous-frame-creation-expected.txt:
* LayoutTests/http/tests/lazyload/synchronous-frame-creation.html:
Update test added in 260713 at main to verify that the load event actually
fires and to move the lazy iframe out of the viewport in order to reproduce
the bug.

* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::init):

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




More information about the webkit-changes mailing list