| Summary: | REGRESSION(261836@main): Incorrect caret placement after hitting enter key in long text | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Michael Catanzaro <mcatanzaro> | ||||||||||||
| Component: | Layout and Rendering | Assignee: | zalan <zalan> | ||||||||||||
| Status: | RESOLVED FIXED | ||||||||||||||
| Severity: | Normal | CC: | bfulgham, bugs-noreply, darin, koivisto, mcatanzaro, simon.fraser, webkit-bug-importer, zalan | ||||||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||||||
| Version: | WebKit Nightly Build | ||||||||||||||
| Hardware: | PC | ||||||||||||||
| OS: | Linux | ||||||||||||||
| Attachments: |
|
||||||||||||||
|
Description
Michael Catanzaro
2023-04-04 05:31:22 PDT
Bisected this to https://commits.webkit.org/261836@main "[IFC][Partial layout] Populate InlineDamage::m_trailingDisplayBoxes for subsequent partial layout" Created attachment 465965 [details]
Test case
This is a manual test as inserting "new line" programmatically works fine.
> Then press Enter, then Backspace, then Enter again. It will break. This does
> not happen with smaller amounts of text: you need a certain amount of text
> to trigger the bug.
Thank you for the test case! Looking into it now.
(In reply to zalan from comment #2) > Created attachment 465965 [details] > Test case > > This is a manual test as inserting "new line" programmatically works fine. I actually cannot reproduce the bug following this test case unless I add step two "press enter, then backspace" before step three "press enter" (In reply to Michael Catanzaro from comment #4) > (In reply to zalan from comment #2) > > Created attachment 465965 [details] > > Test case > > > > This is a manual test as inserting "new line" programmatically works fine. > > I actually cannot reproduce the bug following this test case unless I add > step two "press enter, then backspace" before step three "press enter" I was using MiniBrowser with WK1 and I was able to repro it, but you are right with WK2, those additional steps are required. Not sure what's up with WK1 -will upload a new test case. Created attachment 465967 [details]
Patch
This fixes this issue, but I still need to come up with a test case. Created attachment 465968 [details]
Test case
Created attachment 465970 [details]
Patch
Created attachment 465971 [details]
[fast-cq]Patch
Don’t need the braces on this line:
std::optional<size_t> offset { };
(In reply to Darin Adler from comment #12) > Don’t need the braces on this line: > > std::optional<size_t> offset { }; Indeed. The reason I tend to add is it lets me omit an extra { } at the callsites leadingInlineItemPositionByDamagedBox({ *previousSibling },... vs. leadingInlineItemPositionByDamagedBox({ *previousSibling, { } },... (error: missing field 'offset' initializer [-Werror,-Wmissing-field-initializers] damagedLine = leadingInlineItemPositionByDamagedBox({ *previousSibling }, m_inlineItems, displayBoxes());) Committed 263113@main (b6df426f37df): <https://commits.webkit.org/263113@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 465971 [details]. (In reply to zalan from comment #13) > (In reply to Darin Adler from comment #12) > > Don’t need the braces on this line: > > > > std::optional<size_t> offset { }; > Indeed. The reason I tend to add is it lets me omit an extra { } at the > callsites I see. Seems like a good reason to keep it. |