https://bugs.webkit.org/show_bug.cgi?id=226926
Patch by Frédéric Wang <fwang@igalia.com> on 2021-07-28
Reviewed by Ryosuke Niwa.
Source/WebCore:
In r179944 and r180050, special handling was added for display: grid/flex nodes in
Position::isCandidate in order to make them editable but the same logic was not added in
PositionIterator::isCandidate. This patch fixes that inconsistency as well as the
corresponding debug ASSERT and release nullptr dereference.
Tests: fast/editing/apply-relative-font-style-change-crash-001.html
fast/editing/apply-relative-font-style-change-crash-002.html
* dom/PositionIterator.cpp:
(WebCore::PositionIterator::isCandidate const): Handle flexbox and grid.
LayoutTests:
Add regression tests.
* fast/editing/apply-relative-font-style-change-crash-001-expected.txt: Added.
* fast/editing/apply-relative-font-style-change-crash-001-expected.txt: Added.
* fast/editing/apply-relative-font-style-change-crash-002.html: Added.
* fast/editing/apply-relative-font-style-change-crash-002.html: Added.
Canonical link: https://commits.webkit.org/240025@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280381 268f45cc-cd09-0410-ab3c-d52691b4dbfc