mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:37:35 +00:00
LibWeb: Fix spec transcription mistake in Range.extractContents()
The spec text and code didn't match up. Thanks to Tim for spotting this! :^)
This commit is contained in:
parent
ac8a8459d0
commit
4d49c607f8
1 changed files with 3 additions and 2 deletions
|
@ -671,8 +671,9 @@ ExceptionOr<NonnullRefPtr<DocumentFragment>> Range::extract()
|
|||
// 1. Let clone be a clone of original start node.
|
||||
auto clone = original_start_node->clone_node();
|
||||
|
||||
// 2. Set the data of clone to the result of substringing data with node original start node, offset original start offset, and count original start node’s length minus original start offset.
|
||||
auto result = static_cast<CharacterData const&>(*original_start_node).substring_data(original_start_offset, original_end_offset - original_start_offset);
|
||||
// 2. Set the data of clone to the result of substringing data with node original start node, offset original start offset,
|
||||
// and count original start node’s length minus original start offset.
|
||||
auto result = static_cast<CharacterData const&>(*original_start_node).substring_data(original_start_offset, original_start_node->length() - original_start_offset);
|
||||
if (result.is_exception())
|
||||
return result.exception();
|
||||
verify_cast<CharacterData>(*clone).set_data(result.release_value());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue