From 9c77efd94a254a354a551274251b6f351373f9d4 Mon Sep 17 00:00:00 2001 From: Simon Pieters Date: Wed, 27 Oct 2021 00:02:18 +0200 Subject: [PATCH] Allow setting rootMargin Part of #428. --- index.bs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index 9018d65..e31f37d 100644 --- a/index.bs +++ b/index.bs @@ -218,7 +218,7 @@ use-cases. Per-{{observe()}} options could be provided in the future if the need interface IntersectionObserver { constructor(IntersectionObserverCallback callback, optional IntersectionObserverInit options = {}); readonly attribute (Element or Document)? root; - readonly attribute DOMString rootMargin; + attribute DOMString rootMargin; readonly attribute FrozenArray<double> thresholds; undefined observe(Element target); undefined unobserve(Element target); @@ -279,7 +279,14 @@ interface IntersectionObserver { this is not guaranteed to be identical to the |options|.{{IntersectionObserverInit/rootMargin}} passed to the {{IntersectionObserver}} constructor. If no {{IntersectionObserverInit/rootMargin}} was passed to the {{IntersectionObserver}} - constructor, the value of this attribute is "0px 0px 0px 0px". + constructor, and the {{IntersectionObserver/rootMargin}} setter has not been invoked, + the value of this attribute is "0px 0px 0px 0px". + + On setting, attempt to parse a root margin + from the given value. + If a list is returned, + set |this|'s internal {{[[rootMargin]]}} slot to that. + Otherwise, throw a {{SyntaxError}} exception. : thresholds :: A list of thresholds, sorted in increasing numeric order,