summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2022-04-02 00:44:16 +0300
committerIdan Horowitz <idan.horowitz@gmail.com>2022-04-02 13:13:37 +0300
commit6f7cab91a7f09ca3eee89ea8a426c5bc01733916 (patch)
tree08a1111a313a5f5284554649ec4a7954da07cf71 /Userland/Libraries/LibWeb
parentb172b56757e25e3fe040738479f4ad55410a6605 (diff)
downloadserenity-6f7cab91a7f09ca3eee89ea8a426c5bc01733916.zip
LibWeb: Use the specification defined types in IntersectionObserverInit
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r--Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.h4
-rw-r--r--Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.idl9
2 files changed, 5 insertions, 8 deletions
diff --git a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.h b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.h
index 0edc146398..9039205418 100644
--- a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.h
+++ b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.h
@@ -13,9 +13,9 @@
namespace Web::IntersectionObserver {
struct IntersectionObserverInit {
- DOM::Node* root { nullptr };
+ Optional<Variant<NonnullRefPtr<DOM::Element>, NonnullRefPtr<DOM::Document>>> root;
String root_margin { "0px"sv };
- JS::Value threshold { 0 };
+ Variant<double, Vector<double>> threshold { 0 };
};
// https://w3c.github.io/IntersectionObserver/#intersection-observer-interface
diff --git a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.idl b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.idl
index 1cc24b6a93..122859d825 100644
--- a/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.idl
+++ b/Userland/Libraries/LibWeb/IntersectionObserver/IntersectionObserver.idl
@@ -1,3 +1,4 @@
+#import <DOM/Document.idl>
#import <DOM/Element.idl>
#import <DOM/Node.idl>
@@ -16,11 +17,7 @@ interface IntersectionObserver {
};
dictionary IntersectionObserverInit {
- // FIXME: Should be: (Element or Document)?
- Node? root = null;
-
+ (Element or Document)? root = null;
DOMString rootMargin = "0px";
-
- // FIXME: Should be: (double or sequence<double>)
- any threshold = 0;
+ (double or sequence<double>) threshold = 0;
};