LibWeb: Return a MarkedVector from Document::elements_from_point

A plain vector is not protected from GC.
This commit is contained in:
Timothy Flynn 2024-10-24 16:12:02 -04:00 committed by Tim Flynn
parent 9682b150ac
commit 0286eb4e3e
Notes: github-actions[bot] 2024-10-24 23:00:54 +00:00
2 changed files with 3 additions and 3 deletions

View file

@ -4838,10 +4838,10 @@ Element const* Document::element_from_point(double x, double y)
}
// https://drafts.csswg.org/cssom-view/#dom-document-elementsfrompoint
Vector<JS::NonnullGCPtr<Element>> Document::elements_from_point(double x, double y)
JS::MarkedVector<JS::NonnullGCPtr<Element>> Document::elements_from_point(double x, double y)
{
// 1. Let sequence be a new empty sequence.
Vector<JS::NonnullGCPtr<Element>> sequence;
JS::MarkedVector<JS::NonnullGCPtr<Element>> sequence(heap());
// 2. If either argument is negative, x is greater than the viewport width excluding the size of a rendered scroll bar (if any),
// or y is greater than the viewport height excluding the size of a rendered scroll bar (if any),

View file

@ -656,7 +656,7 @@ public:
WebIDL::ExceptionOr<void> set_design_mode(String const&);
Element const* element_from_point(double x, double y);
Vector<JS::NonnullGCPtr<Element>> elements_from_point(double x, double y);
JS::MarkedVector<JS::NonnullGCPtr<Element>> elements_from_point(double x, double y);
JS::GCPtr<Element const> scrolling_element() const;
void set_needs_to_resolve_paint_only_properties() { m_needs_to_resolve_paint_only_properties = true; }