mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:27:44 +00:00
LibWeb: Stub Range.getBoundingClientRect
This seems to be used by Discord around the chat message box, but didn't explore very far.
This commit is contained in:
parent
1e9cc2e211
commit
34c130b336
3 changed files with 13 additions and 0 deletions
|
@ -15,6 +15,7 @@
|
|||
#include <LibWeb/DOM/ProcessingInstruction.h>
|
||||
#include <LibWeb/DOM/Range.h>
|
||||
#include <LibWeb/DOM/Text.h>
|
||||
#include <LibWeb/Geometry/DOMRect.h>
|
||||
#include <LibWeb/HTML/Window.h>
|
||||
|
||||
namespace Web::DOM {
|
||||
|
@ -1102,4 +1103,11 @@ WebIDL::ExceptionOr<void> Range::delete_contents()
|
|||
return {};
|
||||
}
|
||||
|
||||
// https://w3c.github.io/csswg-drafts/cssom-view/#dom-range-getboundingclientrect
|
||||
JS::NonnullGCPtr<Geometry::DOMRect> Range::get_bounding_client_rect() const
|
||||
{
|
||||
dbgln("(STUBBED) Range::get_bounding_client_rect()");
|
||||
return Geometry::DOMRect::construct_impl(realm(), 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -82,6 +82,8 @@ public:
|
|||
|
||||
static HashTable<Range*>& live_ranges();
|
||||
|
||||
JS::NonnullGCPtr<Geometry::DOMRect> get_bounding_client_rect() const;
|
||||
|
||||
private:
|
||||
explicit Range(Document&);
|
||||
Range(Node& start_container, u32 start_offset, Node& end_container, u32 end_offset);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#import <DOM/Node.idl>
|
||||
#import <DOM/AbstractRange.idl>
|
||||
#import <Geometry/DOMRect.idl>
|
||||
|
||||
[Exposed=Window]
|
||||
interface Range : AbstractRange {
|
||||
|
@ -38,6 +39,8 @@ interface Range : AbstractRange {
|
|||
|
||||
boolean intersectsNode(Node node);
|
||||
|
||||
DOMRect getBoundingClientRect();
|
||||
|
||||
stringifier;
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue