Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: fbcf2df28f68bcf7e550c995c4c751f7c819e5c3
      
https://github.com/WebKit/WebKit/commit/fbcf2df28f68bcf7e550c995c4c751f7c819e5c3
  Author: Wenson Hsieh <[email protected]>
  Date:   2025-03-31 (Mon, 31 Mar 2025)

  Changed paths:
    M Source/WebCore/dom/Document.h
    M Source/WebCore/rendering/RenderLayer.cpp

  Log Message:
  -----------
  [Page color sampler] Reduce time spent under Document::isTopDocument() when 
painting snapshots
https://bugs.webkit.org/show_bug.cgi?id=290786
rdar://148267864

Reviewed by Abrar Rahman Protyasha.

Replace the check for `renderer.document().isTopDocument()` with 
`renderer.frame().isMainFrame()`
instead. The former can be surprisingly expensive, as it requires us to go from 
`Page` → `Frame` →
`Document` in the common case, and could also require us to walk up the frame 
tree (by frame owner
element) in the worst case.

* Source/WebCore/dom/Document.h:

Drive-by fix: remove an unused declaration of the method `localTopDocument()`, 
which has no
corresponding definition in `Document`. This appears to have been added by 
accident in 288238@main.

* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to