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

Consolidated frame attribute assigning. #7841

Merged
merged 3 commits into from
Mar 6, 2017
Merged

Consolidated frame attribute assigning. #7841

merged 3 commits into from
Mar 6, 2017

Conversation

bradfrizzell
Copy link
Contributor

Consolidated the attributes assigned on iframes to achieve parity between 3p and a4a.

mode: getModeObject(),
canary: isCanary(parentWindow),
hidden: !viewer.isVisible(),
initialIntersection: element.getIntersectionChangeEntry ?
Copy link
Contributor

Choose a reason for hiding this comment

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

is this check needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this method does not exist for the A4A ad element. Without this check, it fails in the A4A cases.

Copy link
Contributor

Choose a reason for hiding this comment

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

isn't "A4A ad element" the same as amp-ad element? It should have this method. are you saying this method does not exist in runtime? or just in test?

Copy link
Contributor Author

@bradfrizzell bradfrizzell Mar 1, 2017

Choose a reason for hiding this comment

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

No, I was referring to the <amp-a4a> element, not the <amp-ad> element. The <amp-a4a> element does not have getIntersectionChangeEntry defined on it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm that's really weird then. I'll look into it a little deeper.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed the issue. I had thought that the A4A path didn't have the getIntersectionChangeEntry because in all of our tests the element didn't have it. But it turns out that this way because our tests weren't really making an AMP element, they were just making a dummy HTML element with some amount of AMP element methods attached to it. Didn't take that long to realize the test itself was what was broken, but took me and Taymon a fair while to actually get to the root cause.

Thanks for catching my error here, Hongfei! Showed the team some potential issues with our testing that we are going to try to fix as soon as we can.

@lannka lannka merged commit 878e48c into ampproject:master Mar 6, 2017
@bradfrizzell bradfrizzell deleted the frizz-refactor-use-of-ampcontext branch March 6, 2017 18:35
kmh287 pushed a commit to kmh287/amphtml that referenced this pull request Mar 13, 2017
* Consolidated frame attribute assigning.

* Fixed broken test infrastructure; Fixed attributes

* Add iframe-attributes.js to whitelist for getModeObject
mrjoro pushed a commit to mrjoro/amphtml that referenced this pull request Apr 28, 2017
* Consolidated frame attribute assigning.

* Fixed broken test infrastructure; Fixed attributes

* Add iframe-attributes.js to whitelist for getModeObject
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