Closed Bug 2043347 Opened 21 days ago Closed 7 days ago

Text Fragments: It's not possible to create a range based text directive if start and end are equal and can't expand

Categories

(Core :: DOM: Core & HTML, defect)

defect

Tracking

()

RESOLVED FIXED
153 Branch
Tracking Status
firefox153 --- fixed

People

(Reporter: jjaschke, Assigned: jjaschke)

Details

Attachments

(2 files)

Attached file testcase.html

STR: Open attached file, select all, click Copy Link to Highlight

Expected Results: the valid text directive is :~:text=test,test
Actual Results: The algorithm fails to create a text directive.

Analysis:
This happens because RangeBasedTextDirectiveCreator::FindAllMatchingCandidates() uses the start point of the target range as search start for finding all matches for the end word. If the start word is the same as the end word, it is a match. However, the spec mandates that the search starts at the end of the start content ("potentialMatch"). If the end word can't be expanded (nothing else inside the range, and end of document/no suffix possible), this would be ambiguous and the algorithm bails.

There is an r+ patch which didn't land and no activity in this bug for 1 week.
:jjaschke, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.

Flags: needinfo?(smaug)
Flags: needinfo?(jjaschke)
Flags: needinfo?(smaug)
Flags: needinfo?(jjaschke)
Pushed by jjaschke@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/c76424fb7b76 https://hg.mozilla.org/integration/autoland/rev/f22608dce605 Text Fragments: Follow spec when searching for end terms in case of range-based matching. r=dom-core-reviewers,smaug
Status: ASSIGNED → RESOLVED
Closed: 7 days ago
Resolution: --- → FIXED
Target Milestone: --- → 153 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: