Text-Fragments: Check if a start element is directly adjacent to the prefix is wrong if both are in the same node
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox128 | --- | fixed |
People
(Reporter: jjaschke, Assigned: jjaschke)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
Bug 1899567 - Text Fragments: Ensure that the start element directly follows the prefix. r=#dom-core
48 bytes,
text/x-phabricator-request
|
Details | Review |
In the case where a text fragment has a prefix element, the start element must be following directly (only whitespace / invisible content is allowed).
This line in FragmentDirective::FindRangeForTextDirective()
indicates that this check is currently wrong, as it only checks that prefix and start have the same start node. It needs to check for the StartOffset
as well, or should be changed to use nsRange::StartRef()
instead.
This should fix the last remaining failed WPT in find-range-from-text-directive.html.
Assignee | ||
Updated•1 month ago
|
Assignee | ||
Comment 1•1 month ago
|
||
Assignee | ||
Comment 2•1 month ago
|
||
The start element of a text directive must follow the prefix directly,
only whitespace or invisible content is allowed in between.
The check for this only compared the start boundary
parent nodes of the ranges used for searching,
therefore allowing arbitrary text between prefix and start,
as long as they are in the same text node.
This patch fixes this by using nsRange::StartRef()
instead,
which compares RangeBoundary
objects instead,
thus also taking the offsets into account.
Pushed by jjaschke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a82cf8a3a53f Text Fragments: Ensure that the start element directly follows the prefix. r=dom-core,avandolder
Comment 4•1 month ago
|
||
bugherder |
Description
•