| Summary: | document.execCommand('insertOrderedList'); can hang browser on removing list | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
| Component: | HTML Editing | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW --- | ||
| Severity: | Normal | CC: | rniwa, webkit-bug-importer, wenson_hsieh |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| URL: | https://jsfiddle.net/qLnwv728/show | ||
|
Description
Ahmad Saleem
2023-06-17 17:36:34 PDT
Hanging test case is in URL field. Forgot to add. Change in 'Source/WebCore/editing/Editing.cpp' and following function 'firstEditablePositionAfterPositionInRoot':
From Line 271 onward:
Node* nonEditableNode = nullptr;
while (candidate.deprecatedNode() && !isEditablePosition(candidate) && candidate.deprecatedNode()->isDescendantOf(*highestRoot)) {
nonEditableNode = candidate.deprecatedNode();
candidate = isAtomicNode(candidate.deprecatedNode()) ? positionInParentAfterNode(candidate.deprecatedNode()) : nextVisuallyDistinctCandidate(candidate);
}
if (candidate.deprecatedNode() && candidate.deprecatedNode() != highestRoot && !candidate.deprecatedNode()->isDescendantOf(*highestRoot))
return { };
if (nonEditableNode && nonEditableNode->isDescendantOf(candidate.deprecatedNode()))
candidate = nextVisuallyDistinctCandidate(candidate);
return candidate;
}
(In reply to Ahmad Saleem from comment #3) > Change in 'Source/WebCore/editing/Editing.cpp' and following function > 'firstEditablePositionAfterPositionInRoot': > > From Line 271 onward: > > Node* nonEditableNode = nullptr; > while (candidate.deprecatedNode() && !isEditablePosition(candidate) && > candidate.deprecatedNode()->isDescendantOf(*highestRoot)) { > nonEditableNode = candidate.deprecatedNode(); > candidate = isAtomicNode(candidate.deprecatedNode()) ? > positionInParentAfterNode(candidate.deprecatedNode()) : > nextVisuallyDistinctCandidate(candidate); > } > if (candidate.deprecatedNode() && candidate.deprecatedNode() != > highestRoot && !candidate.deprecatedNode()->isDescendantOf(*highestRoot)) > return { }; > if (nonEditableNode && > nonEditableNode->isDescendantOf(candidate.deprecatedNode())) > candidate = nextVisuallyDistinctCandidate(candidate); > return candidate; > } This fixes hanging test case but the problem is that the test case uses 'assert_selection.js' and does not produce 'passing' test output. :-( Something is wrong with 'assert_selection.js' while using in WebKit. Draft PR - https://github.com/WebKit/WebKit/pull/29422 It is leading to legit WPT failure - which we are passing earlier. :-( Failing - imported/w3c/web-platform-tests/editing/run/forwarddelete.html?6001-last
> PASS [["forwarddelete",""]] "foo<span>bar[]<span contenteditable=false>baz</span></span>qux" compare innerHTML
> FAIL [["forwarddelete",""]] "foo<span>bar[]<span contenteditable=false>baz</span></span>qux" compare innerHTML assert_equals: Unexpected innerHTML (after normalizing inline style) expected "foo<span>bar</span>qux" but got "foo<span>bar</span>ux"
PR attempt - https://github.com/WebKit/WebKit/pull/29422 It leads to legit failure in following WPT: imported/w3c/web-platform-tests/editing/run/forwarddelete.html?6001-7000 and following fails: > [["forwarddelete",""]] "foo<span>bar[]<span contenteditable=false>baz</span></span>qux" compare innerHTML > FAIL [["forwarddelete",""]] "foo<span>bar[]<span contenteditable=false>baz</span></span>qux" compare innerHTML assert_equals: Unexpected innerHTML (after normalizing inline style) expected "foo<span>bar</span>qux" but got "foo<span>bar</span>ux" |