Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: daef4406a4a794886a82eb1af1274bf0e5cd1236
      
https://github.com/WebKit/WebKit/commit/daef4406a4a794886a82eb1af1274bf0e5cd1236
  Author: Tim Horton <[email protected]>
  Date:   2026-10-07 (Wed, 07 Oct 2026)

  Changed paths:
    M Source/WebCore/page/LocalFrameView.cpp
    M Source/WebCore/rendering/RenderAttachment.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKAttachmentTests.mm

  Log Message:
  -----------
  Dragging <attachment>s from Mail loses the icon and background
https://bugs.webkit.org/show_bug.cgi?id=326617
rdar://189360687

Reviewed by Gerald Squelart.

Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKAttachmentTests.mm

* Source/WebCore/rendering/RenderAttachment.cpp:
(WebCore::RenderAttachment::paintWideLayoutAttachmentOnly const):
When doing a subtree paint, we need to reset the subtreePaintRoot so that the 
shadow children paint.

* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::paintContentsForSnapshot):
Due to the above, we now paint the attachment background. But, when snapshotting
with selection hidden, because the attachment root changes its style based on
the selection state, we also need to update style after temporarily updating
the selection state (see HTMLAttachmentElement::addSelectionClasses).

* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKAttachmentTests.mm:
(TestWebKitAPI::webViewWithLoadedWideLayoutAttachment):
(TestWebKitAPI::TEST(WKAttachmentTestsMac, WideLayoutIconInNodeSnapshot)):
(TestWebKitAPI::TEST(WKAttachmentTestsMac, 
WideLayoutSnapshotExcludesSelectionBackground)):
Add tests that validate the two changes.

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



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

Reply via email to