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

Fix the timing of running the IntersectionObserver algorithm #331

Merged
merged 1 commit into from
Nov 30, 2018

Conversation

szager-chromium
Copy link
Collaborator

As discussed in the TAG review, IntersectionObserver should run its
algorithm after requestAnimationFrame callbacks, not before.

As discussed in the TAG review, IntersectionObserver should run its
algorithm *after* requestAnimationFrame callbacks, not before.
@marcoscaceres
Copy link
Member

@szager-chromium, thanks! Is there a web platform test to verify the new behavior?

@szager-chromium
Copy link
Collaborator Author

@marcoscaceres All of the existing WPT tests already expect that behavior; the previous spec language was just wrong, and I'm pretty sure all of the browsers just ignored it and did the Right Thing.

@marcoscaceres
Copy link
Member

Excellent! thank you for confirming.

@szager-chromium szager-chromium merged commit 042453c into master Nov 30, 2018
dbaron added a commit to dbaron/IntersectionObserver that referenced this pull request Dec 18, 2018
…bserver.

Since the HTML spec has been updated to reference IntersectionObserver,
this change stops monkeypatching the HTML spec to make a change that
already exists in it.  (To some degree this is followup to w3c#331.)
Instead, it points out where the integration exists in the HTML spec.
This avoids having two normative definitions of the same thing that
slightly disagree with each other.

It's worth noting that the monkeypatch is slightly different from what's
in HTML; where this spec's monkeypatch said "for each
IntersectionObserver whose root is in the DOMtree of that Document", the
HTML spec says "for that Document, passing in now as the timestamp".
Given the text in #run-the-update-intersection-observations-steps, the
text in HTML is correct regarding both differences, since the algorithm
both (a) expects a time and (b) builds a list of all roots in the
Document.

This also marks the definition that HTML uses as <dfn export>; this
really only serves to silence a bikeshed warning (which appears when
removing the monkeypatch) since the HTML spec isn't written using
bikeshed; however, it also means that the reference HTML makes could be
done in a spec that used bikeshed, so it deserves to be exported.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants