76f3f97c6e
https://bugs.webkit.org/show_bug.cgi?id=223364 Patch by Frédéric Wang <fwang@igalia.com> on 2021-03-23 Reviewed by Ryosuke Niwa. Source/WebCore: When the editing code creates a span to apply font style change, it may not have editable style if the document sets extra style (e.g. user-select: all). This is causing a debug ASSERT in AppendNodeCommand::AppendNodeCommand when the span is inserted and a nullptr dereference later in release mode. This patch ensures that we skip the font style change when that happens. Test: editing/style/apply-font-style-change-crash.html * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange): Skip the font style change if the span insertion failed. (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement): After inserting the new element, ensure that the conditions from the ASSERT of AppendNodeCommand::AppendNodeCommand hold and return failure if they don't. * editing/ApplyStyleCommand.h: Return a boolean indicating success. LayoutTests: Add regression test. * editing/style/apply-font-style-change-crash-expected.txt: Added. * editing/style/apply-font-style-change-crash.html: Added. Canonical link: https://commits.webkit.org/235647@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274865 268f45cc-cd09-0410-ab3c-d52691b4dbfc |
||
---|---|---|
.. | ||
async-clipboard | ||
caret | ||
deleting | ||
editability | ||
editable-region | ||
execCommand | ||
find | ||
input | ||
inserting | ||
mac | ||
pasteboard | ||
resources | ||
secure-input | ||
selection | ||
spelling | ||
style | ||
text-iterator | ||
text-placeholder | ||
undo | ||
undo-manager | ||
unsupported-content | ||
document-marker-null-check-expected.txt | ||
document-marker-null-check.html | ||
editing.js | ||
editingStyle.css |