mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:38:12 +00:00
LibWeb: Handle currently ignored WebIDL::ExceptionOr<T>
s
This commit is contained in:
parent
f01d90aa63
commit
acfb546048
38 changed files with 153 additions and 149 deletions
|
@ -76,25 +76,25 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Text>> Text::split_text(size_t offset)
|
|||
// 2. For each live range whose start node is node and start offset is greater than offset, set its start node to new node and decrease its start offset by offset.
|
||||
for (auto& range : Range::live_ranges()) {
|
||||
if (range->start_container() == this && range->start_offset() > offset)
|
||||
range->set_start(*new_node, range->start_offset() - offset);
|
||||
TRY(range->set_start(*new_node, range->start_offset() - offset));
|
||||
}
|
||||
|
||||
// 3. For each live range whose end node is node and end offset is greater than offset, set its end node to new node and decrease its end offset by offset.
|
||||
for (auto& range : Range::live_ranges()) {
|
||||
if (range->end_container() == this && range->end_offset() > offset)
|
||||
range->set_end(*new_node, range->end_offset() - offset);
|
||||
TRY(range->set_end(*new_node, range->end_offset() - 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.
|
||||
for (auto& range : Range::live_ranges()) {
|
||||
if (range->start_container() == this && range->start_offset() == index() + 1)
|
||||
range->set_start(*range->start_container(), range->start_offset() + 1);
|
||||
TRY(range->set_start(*range->start_container(), range->start_offset() + 1));
|
||||
}
|
||||
|
||||
// 5. For each live range whose end node is parent and end offset is equal to the index of node plus 1, increase its end offset by 1.
|
||||
for (auto& range : Range::live_ranges()) {
|
||||
if (range->end_container() == parent.ptr() && range->end_offset() == index() + 1) {
|
||||
range->set_end(*range->end_container(), range->end_offset() + 1);
|
||||
TRY(range->set_end(*range->end_container(), range->end_offset() + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue