Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e1c3e2ea1083c60d52c2de3da7da4a76273cd4f5
https://github.com/WebKit/WebKit/commit/e1c3e2ea1083c60d52c2de3da7da4a76273cd4f5
Author: Ahmad Saleem <[email protected]>
Date: 2026-06-30 (Tue, 30 Jun 2026)
Changed paths:
M Source/WebCore/editing/ReplaceSelectionCommand.cpp
Log Message:
-----------
Remove dead null check in ReplaceSelectionCommand::doApply
https://bugs.webkit.org/show_bug.cgi?id=318200
rdar://181004952
Reviewed by Chris Dumez.
The `if (refNode)` guard before `fragment.removeNode(*refNode)` is dead
code: refNode is guaranteed non-null at this point because the function
already returns early when the fragment is empty
(`if (fragment.isEmpty() || !fragment.firstChild()) return;`), and the
preceding line dereferences refNode unconditionally via
`refNode->nextSibling()`. Drop the guard and call removeNode directly.
No change in behavior.
* Source/WebCore/editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::doApply):
Canonical link: https://commits.webkit.org/316232@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications