✨Implement Display Locking on amp-accordion#25867
✨Implement Display Locking on amp-accordion#25867caroqliu merged 33 commits intoampproject:masterfrom
Conversation
dvoytenko
left a comment
There was a problem hiding this comment.
This looks very good. Few comments, but very very close.
| amp-accordion > section:not([expanded]) amp-audio, | ||
| amp-accordion > section:not([expanded]) amp-video, | ||
| amp-accordion > section:not([expanded]) amp-youtube { | ||
| display: none !important; |
There was a problem hiding this comment.
This is clever. But is it an optimization or necessity? There are many more playable elements. If necessity: one option for us is to simply do ...:not([expanded]) .i-amphtml-fill-content. That might catch more cases than we want, but should be pretty close. But before you do this, please explain whether this is necessary and why.
There was a problem hiding this comment.
Why is .i-amphtml-fill-content an appropriate catchall for playable elements? It looks like it is applied to many non-video cases, i.e. amp-list subelements which are more likely to contain searchable content and therefore which we don't want to hide.
As for why this is necessary -- without this change, playable elements can continue playing within the collapsed section.
/cc @alanorozco who had some ideas about precisely selecting playable elements.
There was a problem hiding this comment.
#26967 should be merged before we go forward with the change, though I have updated the selector accordingly here.
There was a problem hiding this comment.
TBH, we could even just catch all AMP elements here. :not([expanded]) .i-amphtml-element { display: none}. Right?
And to clarify one more time: did you test that when this version of accordion is closed, the video players indeed stop playing?
There was a problem hiding this comment.
I'm not sure this makes sense for i.e. amp-list rendering text, amp-truncate-text, amp-fit-text, etc. where we could get a lot more by making those available. For the components that are neither media players nor text heavy, I don't see huge need for them to be display: none or not, so it may be better to get the gains by selecting for media players explicitly over all elements.
There was a problem hiding this comment.
Right. That's actually a pretty bad idea. Thats for catching that and let's not do that :)
However, please confirm: re video player stopping to work correctly with this experiment.
dvoytenko
left a comment
There was a problem hiding this comment.
This is approved with one comment. Please confirm the requested test has been performed before merging.
* master: Launch `amp-next-page` v2 & clean up experiment (ampproject#27035) ✨Implement Display Locking on amp-accordion (ampproject#25867) 📖<amp-next-page> documentation and validation (ampproject#26841) Improve visibility event tests (ampproject#26847) amp-geo: Fall back to API for country (ampproject#26407) ✨ Add customization options to <amp-story-quiz> (ampproject#26714) navigation: Minor test improvements (ampproject#26926) ♻️ Alias video.fullscreen action for symmetry with interface names (ampproject#27017) ✨ Implements `amp-analytics` support for `amp-next-page` (ampproject#26451) ✨ amp-video-iframe integration: global jwplayer() singleton by default (ampproject#26969) Fix unit tests broken by ampproject#26687 (ampproject#27000) Filter redirect info from emails (ampproject#27012) 📖 Make amp-bind doc valid, fix amp-form stories filter (ampproject#27003) url-replacements: Minor test improvement (ampproject#26930) viewport: Minor test improvement (ampproject#26931) amp-consent fullscreen warning (ampproject#26467) dep-check: USE CAPS FOR IMPORTANCE (ampproject#26993) fix img url (ampproject#26987) # Conflicts: # extensions/amp-next-page/amp-next-page.md
No description provided.