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

🐛 amp-next-page: Fix rendering within shadow documents #16789

Merged
merged 4 commits into from Jul 20, 2018

Conversation

peterjosling
Copy link
Contributor

If amp-next-page tries to load in a shadow document, the service gets registered against the AmpDoc rather than the window, and getService() tries to read it from the window.

Fixes #16666

If `amp-next-page` tries to load in a shadow document, the service gets registered against the AmpDoc rather than the window.

Fixes ampproject#16666
@peterjosling
Copy link
Contributor Author

@aghassemi

@aghassemi aghassemi self-requested a review July 19, 2018 16:52
});
this.register_(configJson, separator);
}
getServicePromiseForDoc(this.getAmpDoc(), SERVICE_ID).then(service => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please return the promise to eliminate any possibility of a race between buildCallback and layoutCallback (it is a little know fact that buildCallback can return a promise)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh cool! Done.

@aghassemi
Copy link
Contributor

@peterjosling Just some unit test failures related to the component. Will merge when green. Thanks!

@peterjosling
Copy link
Contributor Author

Done.

@codecov-io
Copy link

Codecov Report

Merging #16789 into master will decrease coverage by <.01%.
The diff coverage is 85%.

@@            Coverage Diff             @@
##           master   #16789      +/-   ##
==========================================
- Coverage   78.15%   78.14%   -0.01%     
==========================================
  Files         560      561       +1     
  Lines       40635    40755     +120     
==========================================
+ Hits        31757    31847      +90     
- Misses       8878     8908      +30
Flag Coverage Δ
#integration_tests 34.46% <ø> (-0.1%) ⬇️
#unit_tests 77.19% <85%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 134611d...fc46962. Read the comment docs.

@aghassemi aghassemi merged commit 715e37a into ampproject:master Jul 20, 2018
@peterjosling peterjosling deleted the next-page/shadow-fix branch July 23, 2018 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants