Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b0139bf5a5423c8991e258815d264c076a6c1a13
      
https://github.com/WebKit/WebKit/commit/b0139bf5a5423c8991e258815d264c076a6c1a13
  Author: Tim Horton <[email protected]>
  Date:   2026-04-07 (Tue, 07 Apr 2026)

  Changed paths:
    A 
LayoutTests/editing/pasteboard/paste-style-block-generic-font-family-expected.html
    A LayoutTests/editing/pasteboard/paste-style-block-generic-font-family.html
    M Source/WebCore/editing/markup.cpp

  Log Message:
  -----------
  REGRESSION (292858@main): Pasting HTML renders sans-serif font as Times
https://bugs.webkit.org/show_bug.cgi?id=311688
rdar://173162166

Reviewed by Ryosuke Niwa and Aditya Keerthi.

292858@main removed the default initialization of the standard font families
in Settings, in favor of the code that syncs them from WebKit. This is fine,
except for disconnected Pages, which don't have WebKit backing them.

It turns out that SVGImage and other disconnected Pages already propagate
these settings from the parent context, but the paste sanitization page
did not! This would *still* be fine, as the generic font family name
survives sanitization, but in the process, it pollutes the FontCascadeCache
with the incorrect family, and the cache keying is such that the invalid
entry persists and infects the parent context (if this is the first time
it's been encountered).

Fix this by propagating the generic font families into the paste sanitization
page just like we do for SVGImage.

Test: editing/pasteboard/paste-style-block-generic-font-family.html

* 
LayoutTests/editing/pasteboard/paste-style-block-generic-font-family-expected.html:
 Added.
* LayoutTests/editing/pasteboard/paste-style-block-generic-font-family.html: 
Added.
* Source/WebCore/editing/markup.cpp:
(WebCore::createPageForSanitizingWebContent):

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



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

Reply via email to