[webkit-changes] [WebKit/WebKit] 945622: [Cocoa] Copying and pasting adaptive image glyphs ...

Aditya Keerthi noreply at github.com
Mon Aug 19 13:06:23 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9456228689d44ef687ffd5782a5323f07c6f233d
      https://github.com/WebKit/WebKit/commit/9456228689d44ef687ffd5782a5323f07c6f233d
  Author: Aditya Keerthi <akeerthi at apple.com>
  Date:   2024-08-19 (Mon, 19 Aug 2024)

  Changed paths:
    M Source/WebCore/loader/ImageLoader.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/AdaptiveImageGlyph.mm

  Log Message:
  -----------
  [Cocoa] Copying and pasting adaptive image glyphs across Mail compose windows drops content
https://bugs.webkit.org/show_bug.cgi?id=278256
rdar://130606666

Reviewed by Sihui Liu and Wenson Hsieh.

When copying and pasting web content across Mail compose windows, content is
serialized into a web archive. The archive only contains subresources which
have already been loaded.

The above is problematic for adaptive image glyphs, which are represented as a
<picture> element containing a HEIC and a fallback PNG. Since the HEIC is selected
during <source> matching, the fallback PNG never gets loaded. Consequently,
when saving content as a web archive, the fallback PNG is dropped.

Web archives should contain both adaptive image glyphs resources. However, the
fallback data is unavailable in the web content process, and a sync IPC to the
network process is undesirable when saving to a web archive. As a result, fix
by always loading both the HEIC and fallback PNG for adaptive image glyphs, unlike
regular source selection. This ensures both resources are always available.

* Source/WebCore/loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement):

Always load the fallback PNG for adaptive image glyphs, in addition to the
selected source (HEIC).

* Tools/TestWebKitAPI/Tests/WebKitCocoa/AdaptiveImageGlyph.mm:
(TestWebKitAPI::TEST(AdaptiveImageGlyph, InsertWKAttachmentsCopyFromWebViewPasteToWebView)):

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



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


More information about the webkit-changes mailing list