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

🐛 [amp-image-slider] Conservative loading with tweak over hints #17477

Merged
merged 4 commits into from Aug 15, 2018

Conversation

kevinkassimo
Copy link
Member

@kevinkassimo kevinkassimo commented Aug 13, 2018

Per #17446

  • Hide hints until the images finished loading, or failed to load.

1st slider below loads correctly.
2nd fails and toggles amp-imgs' own fallbacks.
loading-improve

Caveat:

  1. If layer is not enabled, three dots would not show
  2. If layer is not enabled, if amp-imgs' fallback are also amp-imgs or other amp components, they would not show (due to slider taking the ownership)

@cathyxz cathyxz requested review from cathyxz and nainar August 14, 2018 01:18
@cathyxz
Copy link
Contributor

cathyxz commented Aug 14, 2018

/cc @nainar to verify behavior matches specs.

@@ -312,7 +312,7 @@ export class AmpImageSlider extends AMP.BaseElement {
const rightAmpImage = dev().assertElement(this.rightAmpImage_);
leftAmpImage.signals().whenSignal(CommonSignals.LOAD_END).then(() => {
if (leftAmpImage.childElementCount > 0) {
const img = leftAmpImage.firstChild;
Copy link
Contributor

Choose a reason for hiding this comment

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

Great catch.

@nainar
Copy link
Contributor

nainar commented Aug 14, 2018

@kevinkassimo looks good to me as per the spec in the issue. (Could you link the issue here please?)

However want to allow discussion on the main issue to conclude. Give me a bit to loop back on this?

@kevinkassimo
Copy link
Member Author

@nainar Sure

@nainar
Copy link
Contributor

nainar commented Aug 15, 2018

Let's land this. The product is experimental we can always revert.

@cathyxz cathyxz merged commit 2f9a6b3 into ampproject:master Aug 15, 2018
Enriqe pushed a commit to Enriqe/amphtml that referenced this pull request Nov 28, 2018
…roject#17477)

* Use visibility trick on container to hide before images complete loading

* Fix false DOM order assumption

.firstChild causes issues for SSR

* Hide hint until amp-img finished loading

* Add fallback example
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.

None yet

4 participants