|
@@ -306,11 +306,8 @@ WebIDL::ExceptionOr<void> Selection::set_base_and_extent(JS::NonnullGCPtr<DOM::N
|
|
if (focus_offset > focus_node->length())
|
|
if (focus_offset > focus_node->length())
|
|
return WebIDL::IndexSizeError::create(realm(), "Focus offset points outside of the focus node"_fly_string);
|
|
return WebIDL::IndexSizeError::create(realm(), "Focus offset points outside of the focus node"_fly_string);
|
|
|
|
|
|
- // 2. If the roots of anchorNode or focusNode are not the document associated with this, abort these steps.
|
|
|
|
- if (&anchor_node->root() != m_document.ptr())
|
|
|
|
- return {};
|
|
|
|
-
|
|
|
|
- if (&focus_node->root() != m_document.ptr())
|
|
|
|
|
|
+ // 2. If document associated with this is not a shadow-including inclusive ancestor of anchorNode or focusNode, abort these steps.
|
|
|
|
+ if (!(m_document->is_shadow_including_inclusive_ancestor_of(anchor_node) || m_document->is_shadow_including_inclusive_ancestor_of(focus_node)))
|
|
return {};
|
|
return {};
|
|
|
|
|
|
// 3. Let anchor be the boundary point (anchorNode, anchorOffset) and let focus be the boundary point (focusNode, focusOffset).
|
|
// 3. Let anchor be the boundary point (anchorNode, anchorOffset) and let focus be the boundary point (focusNode, focusOffset).
|