Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting rootMargin #486

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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