mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-18 15:32:22 +00:00
LibWeb: Compare start container to parent in Text.splitText()
Tiny mistake in the implementation of the spec; fixes 16 FAILs in the WPT `/dom/ranges/Range-mutations-splitText.html` tests.
This commit is contained in:
parent
732e3fa82f
commit
dee81f3545
Notes:
github-actions[bot]
2024-08-27 11:14:02 +00:00
Author: https://github.com/gmta
Commit: dee81f3545
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1203
1 changed files with 1 additions and 1 deletions
|
@ -98,7 +98,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Text>> Text::split_text(size_t offset)
|
||||||
|
|
||||||
// 4. For each live range whose start node is parent and start offset is equal to the index of node plus 1, increase its start offset by 1.
|
// 4. For each live range whose start node is parent and start offset is equal to the index of node plus 1, increase its start offset by 1.
|
||||||
for (auto& range : Range::live_ranges()) {
|
for (auto& range : Range::live_ranges()) {
|
||||||
if (range->start_container() == this && range->start_offset() == index() + 1)
|
if (range->start_container() == parent.ptr() && range->start_offset() == index() + 1)
|
||||||
TRY(range->set_start(*range->start_container(), range->start_offset() + 1));
|
TRY(range->set_start(*range->start_container(), range->start_offset() + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue