-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Conversation
7d8a6f8
to
25db4cf
Compare
25db4cf
to
61e7b2c
Compare
61e7b2c
to
3594afb
Compare
7fa4fee
to
b6f6a48
Compare
b6f6a48
to
9918244
Compare
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
@@ -398,6 +398,29 @@ function css() { | |||
return compileCss(); | |||
} | |||
|
|||
const cssEntryPoints = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/cc @erwinmombay
ads/inabox/frame-overlay-manager.js
Outdated
@@ -65,6 +65,7 @@ export class FrameOverlayManager { | |||
this.isExpanded_ = true; | |||
this.viewportChangedSinceExpand_ = false; | |||
this.collapsedRect_ = collapsedRect; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert?
There was a problem hiding this comment.
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_() { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
7426f1b
to
ee6afca
Compare
There was a problem hiding this 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.
ads/inabox/frame-overlay-manager.js
Outdated
@@ -65,6 +65,7 @@ export class FrameOverlayManager { | |||
this.isExpanded_ = true; | |||
this.viewportChangedSinceExpand_ = false; | |||
this.collapsedRect_ = collapsedRect; | |||
|
There was a problem hiding this comment.
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_() { |
There was a problem hiding this comment.
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.
ee6afca
to
b5c9c86
Compare
* @return {boolean} | ||
* @private | ||
*/ | ||
isInAd_() { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
66a4b94
to
9d8066c
Compare
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. |
@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. |
22ef2a9
to
d2efb5b
Compare
tags: { # <amp-lightbox close-button> in A4A. | ||
html_format: AMP4ADS | ||
html_format: EXPERIMENTAL | ||
tag_name: "AMP-LIGHTBOX" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
tags: { # <amp-lightbox close-button> in AMP4ADS. | ||
html_format: AMP4ADS | ||
tag_name: "AMP-LIGHTBOX" | ||
spect_name: "amp-lightbox [AMP4ADS]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spec
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 spaces before comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
* 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
No description provided.