[webkit-changes] [WebKit/WebKit] afc8fb: Fix style invalidation for ancestor documents of f...

Tim Nguyen noreply at github.com
Wed Jan 18 09:14:14 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: afc8fb2561c8dbe9ab8c68ad076285c2d8cd673a
      https://github.com/WebKit/WebKit/commit/afc8fb2561c8dbe9ab8c68ad076285c2d8cd673a
  Author: Tim Nguyen <ntim at apple.com>
  Date:   2023-01-18 (Wed, 18 Jan 2023)

  Changed paths:
    A LayoutTests/fullscreen/fullscreen-enclosing-iframe-size-expected.html
    A LayoutTests/fullscreen/fullscreen-enclosing-iframe-size.html
    M Source/WebCore/dom/FullscreenManager.cpp

  Log Message:
  -----------
  Fix style invalidation for ancestor documents of fullscreen element
https://bugs.webkit.org/show_bug.cgi?id=250750
rdar://104238564

Reviewed by Darin Adler.

We were just calling `document().resolveStyle(Document::ResolveStyleType::Rebuild)` only on the document the fullscreen request came from,
the ancestor documents were not covered. We need to call that method for frames in reverse tree order, in order to have the correct sequence
of layouts:
1. Apply fullscreen styles to iframe contents
2. Append iframe contents to top layer
3. Apply fullscreen styles to iframe, make iframe contents dirty
4. Append iframe to top layer

As opposed to the incorrect sequence which leads to dirty renderers:
1. Apply fullscreen styles to iframe, make iframe contents dirty
2. Append iframe to top layer
3. Apply fullscreen styles to iframe contents
4. Append iframe contents to top layer (which is dirty because of step 1)

We preserve the tree order for queuing events as mandated by the spec.

* LayoutTests/fullscreen/fullscreen-enclosing-iframe-size-expected.html: Added.
* LayoutTests/fullscreen/fullscreen-enclosing-iframe-size.html: Added.
* Source/WebCore/dom/FullscreenManager.cpp:
(WebCore::FullscreenManager::willEnterFullscreen):

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




More information about the webkit-changes mailing list