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

✨ Render close button for lightbox ads in inabox #16886

Merged
merged 24 commits into from
Jul 24, 2018

Conversation

alanorozco
Copy link
Member

No description provided.

@codecov-io
Copy link

codecov-io commented Jul 19, 2018

Codecov Report

Merging #16886 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master   #16886      +/-   ##
==========================================
- Coverage   77.93%   77.92%   -0.02%     
==========================================
  Files         562      562              
  Lines       41156    41140      -16     
==========================================
- Hits        32075    32058      -17     
- Misses       9081     9082       +1
Flag Coverage Δ
#integration_tests 36.16% <0%> (-0.01%) ⬇️
#unit_tests 76.98% <100%> (-0.01%) ⬇️

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 11a3de7...c1cac8d. Read the comment docs.

@@ -398,6 +398,29 @@ function css() {
return compileCss();
}

const cssEntryPoints = [
Copy link
Contributor

Choose a reason for hiding this comment

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

@@ -65,6 +65,7 @@ export class FrameOverlayManager {
this.isExpanded_ = true;
this.viewportChangedSinceExpand_ = false;
this.collapsedRect_ = collapsedRect;

Copy link
Contributor

Choose a reason for hiding this comment

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

revert?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

* @return {boolean}
* @private
*/
isInabox_() {
Copy link
Contributor

Choose a reason for hiding this comment

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

what do you think we make the close button a feature generic to amp-lightbox in both FIE or regular AMP. The feature is enabled by having element attribute "close-button".

We then let the A4A validator to ensure its existence in ads.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a great idea, and decreases complexity! Done.

Copy link
Member Author

@alanorozco alanorozco left a comment

Choose a reason for hiding this comment

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

And now the commit line count is negative! Thanks for the idea @lannka.

@@ -65,6 +65,7 @@ export class FrameOverlayManager {
this.isExpanded_ = true;
this.viewportChangedSinceExpand_ = false;
this.collapsedRect_ = collapsedRect;

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

* @return {boolean}
* @private
*/
isInabox_() {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a great idea, and decreases complexity! Done.

* @return {boolean}
* @private
*/
isInAd_() {
Copy link
Contributor

Choose a reason for hiding this comment

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

or, can we just check if the element is in an iframe? Is there a way to check if the owner document is the one AMP runtime is on?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member Author

Choose a reason for hiding this comment

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

Reverted.

* @private
*/
isInIframe_() {
return this.win != this.win.top;
Copy link
Contributor

Choose a reason for hiding this comment

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

this will not work in Search Viewer.

I'm wondering if there is a way to check which window the AMP runtime is installed
maybe @choumx knows

Copy link
Member Author

Choose a reason for hiding this comment

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

True, I forgot about that case.

@alanorozco
Copy link
Member Author

I have no idea why this set of tests keeps failing on Travis. I haven't found a way to reproduce locally.

These tests are related to Adsense and Doubleclick implementations, very unrelated to this PR. @keithwrightbos Any ideas?

@lannka Anything known about these errors would be valuable info for me.

@alanorozco
Copy link
Member Author

@honeybadgerdontcare Added validation rules specific for A4A. Implementation is still guarded by experiment flag.

Validation rules should provide context as to why the tag was forked.

tags: { # <amp-lightbox close-button> in A4A.
html_format: AMP4ADS
html_format: EXPERIMENTAL
tag_name: "AMP-LIGHTBOX"
Copy link
Contributor

Choose a reason for hiding this comment

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

tag_name is unique except when there is also a spec_name. Perhaps spec_name: "amp-lightbox [a4a]" or amp4ads instead of a4a. also, why are both html_format: EXPERIMENTAL?

@Gregable since I'm out tomorrow.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Not sure why the original tag is marked allowed in experimental.

@alanorozco alanorozco requested a review from Gregable July 24, 2018 18:31
tags: { # <amp-lightbox close-button> in AMP4ADS.
html_format: AMP4ADS
tag_name: "AMP-LIGHTBOX"
spect_name: "amp-lightbox [AMP4ADS]"
Copy link
Member

Choose a reason for hiding this comment

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

spec

Copy link
Member Author

Choose a reason for hiding this comment

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

Whoops, done.

@@ -58,3 +58,32 @@ tags: { # <amp-lightbox>
supported_layouts: NODISPLAY
}
}
tags: { # <amp-lightbox close-button> in AMP4ADS.
Copy link
Member

Choose a reason for hiding this comment

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

2 spaces before comment

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@alanorozco alanorozco merged commit d4a3fd5 into ampproject:master Jul 24, 2018
@alanorozco alanorozco deleted the inabox-lightbox branch July 24, 2018 21:46
ghost pushed a commit to devunrulymedia/amphtml that referenced this pull request Aug 2, 2018
* Render close button for lightbox ads in inabox

* Refactor css entry points

* Fix transitions

* Decrease complexity by using `close-button` attribute

* Put things where they belong

* Types, lint

* Bundle size

* Change transition times

* Remove unused

* Add validation rules for A4A.

* 👨🏻 Add self as owner of <amp-lightbox>

* Clarification

* Address review

* Bundle size

* Address review

* Mock getComputedStyle
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.

7 participants