Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5178278df2e968475df523946dd4caf468069d57
      
https://github.com/WebKit/WebKit/commit/5178278df2e968475df523946dd4caf468069d57
  Author: Alan Baradlay <[email protected]>
  Date:   2026-08-23 (Sun, 23 Aug 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/cssom/stylesheets-in-non-rendered-document-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/css/cssom/stylesheets-in-non-rendered-document.html
    M Source/WebCore/dom/Document.cpp
    M Source/WebCore/dom/Document.h
    M Source/WebCore/dom/Node.cpp
    M Source/WebCore/loader/FrameLoader.cpp
    M Source/WebCore/loader/HistoryController.cpp
    M Source/WebCore/loader/ImageLoader.cpp
    M Source/WebCore/style/StyleScope.cpp

  Log Message:
  -----------
  [cleanup] Ask whether a document is fully active rather than whether it has a 
render tree
https://bugs.webkit.org/show_bug.cgi?id=322292
<rdar://problem/185534759>

Reviewed by Antti Koivisto.

These call sites checked whether a document had a render tree when what they 
meant was whether it can ever render, which is what separates a
document in a page from one made by DOMParser or held by a template. The spec 
calls that fully active, and its "Updating the image data"
algorithm names it directly. A non-rendered placeholder is fully active yet 
never gets a render tree, so Document::canEverRender() asks
both.

https://html.spec.whatwg.org/multipage/images.html#updating-the-image-data

Test: 
imported/w3c/web-platform-tests/css/cssom/stylesheets-in-non-rendered-document.html

* Source/WebCore/dom/Document.h:
* Source/WebCore/dom/Document.cpp:
(WebCore::Document::canEverRender const):
* Source/WebCore/dom/Node.cpp:
(WebCore::Node::computeEditabilityWithStyle const):
* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::clear):
* Source/WebCore/loader/HistoryController.cpp:
(WebCore::HistoryController::saveDocumentState):
* Source/WebCore/loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement):
(WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
(WebCore::ImageLoader::dispatchPendingLoadEvent):
(WebCore::ImageLoader::dispatchPendingErrorEvent):
* Source/WebCore/style/StyleScope.cpp:
(WebCore::Style::Scope::updateActiveStyleSheets):
(WebCore::Style::Scope::styleSheetsForStyleSheetList):
* 
LayoutTests/imported/w3c/web-platform-tests/css/cssom/stylesheets-in-non-rendered-document.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/cssom/stylesheets-in-non-rendered-document-expected.txt:
 Added.

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



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

Reply via email to