Branch: refs/heads/webkitglib/2.52
Home: https://github.com/WebKit/WebKit
Commit: e15f3b4cabe9a01675ef7731eed5e52a07a3c86b
https://github.com/WebKit/WebKit/commit/e15f3b4cabe9a01675ef7731eed5e52a07a3c86b
Author: Tim Horton <[email protected]>
Date: 2026-04-08 (Wed, 08 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:
-----------
Cherry-pick 310757@main (b0139bf5a542).
https://bugs.webkit.org/show_bug.cgi?id=311688
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
Canonical link: https://commits.webkit.org/305877.381@webkitglib/2.52
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications