mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 08:57:35 +00:00
LibWeb: Fix two spec transcription mistakes in live range updating
This scores us another point on Acid3. :^)
This commit is contained in:
parent
57296393ed
commit
68f3feb1d1
1 changed files with 3 additions and 3 deletions
|
@ -323,7 +323,7 @@ void Node::insert_before(NonnullRefPtr<Node> node, RefPtr<Node> child, bool supp
|
|||
|
||||
// 2. For each live range whose end node is parent and end offset is greater than child’s index, increase its end offset by count.
|
||||
for (auto& range : Range::live_ranges()) {
|
||||
if (range->start_container() == this && range->end_offset() > child->index())
|
||||
if (range->end_container() == this && range->end_offset() > child->index())
|
||||
range->set_end(*range->end_container(), range->end_offset() + count);
|
||||
}
|
||||
}
|
||||
|
@ -426,13 +426,13 @@ void Node::remove(bool suppress_observers)
|
|||
|
||||
// 6. For each live range whose start node is parent and start offset is greater than index, decrease its start offset by 1.
|
||||
for (auto& range : Range::live_ranges()) {
|
||||
if (range->start_container() == this && range->start_offset() > index)
|
||||
if (range->start_container() == parent && range->start_offset() > index)
|
||||
range->set_start(*range->start_container(), range->start_offset() - 1);
|
||||
}
|
||||
|
||||
// 7. For each live range whose end node is parent and end offset is greater than index, decrease its end offset by 1.
|
||||
for (auto& range : Range::live_ranges()) {
|
||||
if (range->end_container() == this && range->end_offset() > index)
|
||||
if (range->end_container() == parent && range->end_offset() > index)
|
||||
range->set_end(*range->end_container(), range->end_offset() - 1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue