Bug 258254

Summary: document.execCommand('insertOrderedList'); can hang browser on removing list
Product: WebKit Reporter: Ahmad Saleem <ahmad.saleem792>
Component: HTML EditingAssignee: 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

Ahmad Saleem
Reported 2023-06-17 17:36:34 PDT
Hi Team, This seems to another test case, which hangs tab (only tab) and make it non-interactive, if we follow the instructions as per test case. It is from crbug.com/653732 ^ I came across this bug while looking into: crbug.com/571420, which has following commit: Blink Commit: https://chromium.googlesource.com/chromium/src.git/+/f15d4cc339737df653274e39726ae0d14d409b18 ^ Test Case from above in JSFiddle: https://jsfiddle.net/5y09um8b/ ^^ Safari Technology Preview 172 and Firefox Nightly 116 both fail above. I think we should fix hanging issue and ensure that Safari remain interactive, so raising it for tracking and fixing purposes. Thanks!
Attachments
Ahmad Saleem
Comment 1 2023-06-17 17:37:03 PDT
Hanging test case is in URL field. Forgot to add.
Radar WebKit Bug Importer
Comment 2 2023-06-24 17:37:14 PDT
Ahmad Saleem
Comment 3 2023-06-26 13:48:14 PDT
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; }
Ahmad Saleem
Comment 4 2023-06-26 13:50:07 PDT
(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.
Ahmad Saleem
Comment 5 2024-06-15 22:26:04 PDT
Draft PR - https://github.com/WebKit/WebKit/pull/29422 It is leading to legit WPT failure - which we are passing earlier. :-(
Ahmad Saleem
Comment 6 2024-06-15 22:27:12 PDT
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"
Ahmad Saleem
Comment 7 2024-06-24 04:03:36 PDT
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"
Note You need to log in before you can comment on or make changes to this bug.