mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 18:00:16 +00:00
LibWeb: Return a MarkedVector from Document::elements_from_point
A plain vector is not protected from GC.
This commit is contained in:
parent
9682b150ac
commit
0286eb4e3e
Notes:
github-actions[bot]
2024-10-24 23:00:54 +00:00
Author: https://github.com/trflynn89
Commit: 0286eb4e3e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1949
Reviewed-by: https://github.com/awesomekling ✅
2 changed files with 3 additions and 3 deletions
|
@ -4838,10 +4838,10 @@ Element const* Document::element_from_point(double x, double y)
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://drafts.csswg.org/cssom-view/#dom-document-elementsfrompoint
|
// 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.
|
// 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),
|
// 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),
|
// or y is greater than the viewport height excluding the size of a rendered scroll bar (if any),
|
||||||
|
|
|
@ -656,7 +656,7 @@ public:
|
||||||
WebIDL::ExceptionOr<void> set_design_mode(String const&);
|
WebIDL::ExceptionOr<void> set_design_mode(String const&);
|
||||||
|
|
||||||
Element const* element_from_point(double x, double y);
|
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;
|
JS::GCPtr<Element const> scrolling_element() const;
|
||||||
|
|
||||||
void set_needs_to_resolve_paint_only_properties() { m_needs_to_resolve_paint_only_properties = true; }
|
void set_needs_to_resolve_paint_only_properties() { m_needs_to_resolve_paint_only_properties = true; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue