Skip to content

Commit

Permalink
Allow setting rootMargin
Browse files Browse the repository at this point in the history
Part of w3c#428.
  • Loading branch information
zcorpan committed Oct 26, 2021
1 parent cac7ad2 commit 9c77efd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 <a>parse a root margin</a>
from the given value.
If a list is returned,
set |this|'s internal {{[[rootMargin]]}} slot to that.
Otherwise, <a>throw</a> a {{SyntaxError}} exception.
: <dfn>thresholds</dfn>
::
A list of thresholds, sorted in increasing numeric order,
Expand Down

0 comments on commit 9c77efd

Please sign in to comment.