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

Check sandboxed analytics component parentElement exist #12746

Merged
merged 1 commit into from Jan 10, 2018

Conversation

zhouyx
Copy link
Contributor

@zhouyx zhouyx commented Jan 9, 2018

Closes #12062

@@ -305,6 +305,10 @@ export class AmpAnalytics extends AMP.BaseElement {
// replace selector and selectionMethod
if (this.isSandbox_) {
// Only support selection of parent element for analytics in scope
if (!this.element.parentElement) {
// In case parent element has been removed from DOM, do nothing
Copy link
Contributor

Choose a reason for hiding this comment

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

How would this happen?

Copy link
Contributor Author

@zhouyx zhouyx Jan 9, 2018

Choose a reason for hiding this comment

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

We do call removeElement. For example, user remove sticky ad that has analytics component as a child.

@zhouyx zhouyx merged commit 5c5c7aa into ampproject:master Jan 10, 2018
@zhouyx zhouyx deleted the check-parentElement branch January 10, 2018 00:00
gzgogo pushed a commit to gzgogo/amphtml that referenced this pull request Jan 26, 2018
RanAbram pushed a commit to RanAbram/amphtml that referenced this pull request Mar 12, 2018
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