Text Fragments: Treat `<br>` as block boundary
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox153 | --- | fixed |
People
(Reporter: jjaschke, Assigned: jjaschke)
Details
Attachments
(2 files)
Case 1: open the attached file, select the second "test", and hit "Copy Link to Highlight" in the context menu.
Expected Results: :~:text=test-,test
Actual Results: :~:text=testtest
Case 2: open the attached file, select both "test", hit "Copy Link to Highlight" in the context menu.
Expected Results: :~:text=test,test
Actual Results: :~:text=test%20test
Note that there is no whitespace between the first and second test, only a <br> element. The <br> is ignored, and the algorithm doesn't see a word boundary, and therefore treats these two words as one. If there is whitespace added (data:text/html,test<br> test), case 1 works, case 2 is still broken.
I believe the right way of fixing this is to treat <br> as a block boundary, which both allows the text before the <br> to be used as prefix, and which enforces range-based matching if the target range spans across a <br>.
| Assignee | ||
Updated•21 days ago
|
| Assignee | ||
Comment 1•21 days ago
|
||
Treat <br> as block-level in NodeHasBlockLevelDisplay so that text across
<br> is not concatenated.
Without this, the text directive for
foo<br>bar
would be :~:text=foobar, not :~:text=foo,bar.
Comment 3•7 days ago
|
||
| bugherder | ||
Description
•