|
@@ -587,12 +587,12 @@ JS::NonnullGCPtr<Geometry::DOMRect> Element::get_bounding_client_rect() const
|
|
// FIXME: Support inline layout nodes as well.
|
|
// FIXME: Support inline layout nodes as well.
|
|
auto* paint_box = this->paint_box();
|
|
auto* paint_box = this->paint_box();
|
|
if (!paint_box)
|
|
if (!paint_box)
|
|
- return Geometry::DOMRect::create_with_global_object(window(), 0, 0, 0, 0);
|
|
|
|
|
|
+ return Geometry::DOMRect::construct_impl(realm(), 0, 0, 0, 0);
|
|
|
|
|
|
VERIFY(document().browsing_context());
|
|
VERIFY(document().browsing_context());
|
|
auto viewport_offset = document().browsing_context()->viewport_scroll_offset();
|
|
auto viewport_offset = document().browsing_context()->viewport_scroll_offset();
|
|
|
|
|
|
- return Geometry::DOMRect::create(window(), paint_box->absolute_rect().translated(-viewport_offset.x(), -viewport_offset.y()));
|
|
|
|
|
|
+ return Geometry::DOMRect::create(realm(), paint_box->absolute_rect().translated(-viewport_offset.x(), -viewport_offset.y()));
|
|
}
|
|
}
|
|
|
|
|
|
// https://drafts.csswg.org/cssom-view/#dom-element-getclientrects
|
|
// https://drafts.csswg.org/cssom-view/#dom-element-getclientrects
|
|
@@ -602,7 +602,7 @@ JS::NonnullGCPtr<Geometry::DOMRectList> Element::get_client_rects() const
|
|
|
|
|
|
// 1. If the element on which it was invoked does not have an associated layout box return an empty DOMRectList object and stop this algorithm.
|
|
// 1. If the element on which it was invoked does not have an associated layout box return an empty DOMRectList object and stop this algorithm.
|
|
if (!layout_node() || !layout_node()->is_box())
|
|
if (!layout_node() || !layout_node()->is_box())
|
|
- return Geometry::DOMRectList::create(window(), move(rects));
|
|
|
|
|
|
+ return Geometry::DOMRectList::create(realm(), move(rects));
|
|
|
|
|
|
// FIXME: 2. If the element has an associated SVG layout box return a DOMRectList object containing a single DOMRect object that describes
|
|
// FIXME: 2. If the element has an associated SVG layout box return a DOMRectList object containing a single DOMRect object that describes
|
|
// the bounding box of the element as defined by the SVG specification, applying the transforms that apply to the element and its ancestors.
|
|
// the bounding box of the element as defined by the SVG specification, applying the transforms that apply to the element and its ancestors.
|
|
@@ -616,7 +616,7 @@ JS::NonnullGCPtr<Geometry::DOMRectList> Element::get_client_rects() const
|
|
|
|
|
|
auto bounding_rect = get_bounding_client_rect();
|
|
auto bounding_rect = get_bounding_client_rect();
|
|
rects.append(*bounding_rect);
|
|
rects.append(*bounding_rect);
|
|
- return Geometry::DOMRectList::create(window(), move(rects));
|
|
|
|
|
|
+ return Geometry::DOMRectList::create(realm(), move(rects));
|
|
}
|
|
}
|
|
|
|
|
|
int Element::client_top() const
|
|
int Element::client_top() const
|