LibWeb: Stub Range::get_client_rects()

Fixes "Application error: a client-side exception has occurred (see
the browser console for more information)." on https://kotlinlang.org/
This commit is contained in:
Aliaksandr Kalenik 2024-01-19 13:55:37 +01:00 committed by Andreas Kling
parent a0462f495c
commit 02d5ed44cb
3 changed files with 10 additions and 0 deletions

View file

@ -18,6 +18,7 @@
#include <LibWeb/DOM/Text.h>
#include <LibWeb/DOMParsing/InnerHTML.h>
#include <LibWeb/Geometry/DOMRect.h>
#include <LibWeb/Geometry/DOMRectList.h>
#include <LibWeb/HTML/HTMLHtmlElement.h>
#include <LibWeb/HTML/Window.h>
#include <LibWeb/Layout/Viewport.h>
@ -1146,6 +1147,13 @@ WebIDL::ExceptionOr<void> Range::delete_contents()
return {};
}
// https://drafts.csswg.org/cssom-view/#dom-element-getclientrects
JS::NonnullGCPtr<Geometry::DOMRectList> Range::get_client_rects() const
{
dbgln("(STUBBED) Range::get_client_rects()");
return Geometry::DOMRectList::create(realm(), {});
}
// https://w3c.github.io/csswg-drafts/cssom-view/#dom-range-getboundingclientrect
JS::NonnullGCPtr<Geometry::DOMRect> Range::get_bounding_client_rect() const
{

View file

@ -85,6 +85,7 @@ public:
static HashTable<Range*>& live_ranges();
JS::NonnullGCPtr<Geometry::DOMRectList> get_client_rects() const;
JS::NonnullGCPtr<Geometry::DOMRect> get_bounding_client_rect() const;
bool contains_node(Node const&) const;

View file

@ -40,6 +40,7 @@ interface Range : AbstractRange {
boolean intersectsNode(Node node);
DOMRectList getClientRects();
DOMRect getBoundingClientRect();
stringifier;