Skip to content

✨Implement Display Locking on amp-accordion#25867

Merged
caroqliu merged 33 commits intoampproject:masterfrom
caroqliu:display-locking-accordion
Feb 29, 2020
Merged

✨Implement Display Locking on amp-accordion#25867
caroqliu merged 33 commits intoampproject:masterfrom
caroqliu:display-locking-accordion

Conversation

@caroqliu
Copy link
Copy Markdown
Contributor

@caroqliu caroqliu commented Dec 4, 2019

No description provided.

@caroqliu caroqliu requested a review from dvoytenko January 29, 2020 22:12
Copy link
Copy Markdown
Contributor

@dvoytenko dvoytenko left a comment

Choose a reason for hiding this comment

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

This looks very good. Few comments, but very very close.

@caroqliu caroqliu requested a review from dvoytenko February 12, 2020 20:16
amp-accordion > section:not([expanded]) amp-audio,
amp-accordion > section:not([expanded]) amp-video,
amp-accordion > section:not([expanded]) amp-youtube {
display: none !important;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

@caroqliu caroqliu Feb 14, 2020

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

#26967 should be merged before we go forward with the change, though I have updated the selector accordingly here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@caroqliu caroqliu requested a review from dvoytenko February 26, 2020 20:34
Copy link
Copy Markdown
Contributor

@dvoytenko dvoytenko left a comment

Choose a reason for hiding this comment

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

This is approved with one comment. Please confirm the requested test has been performed before merging.

@caroqliu caroqliu merged commit b8b1997 into ampproject:master Feb 29, 2020
robinvanopstal added a commit to jungvonmatt/amphtml that referenced this pull request Mar 2, 2020
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants