-
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
AMP Image loading issue on long form story page. #9397
Comments
Some investigations: 1- This only happens if the page is |
Interesting. Ok, i'll continue to dig in and try to find the cause of the issue. Thanks. |
@gregdevs Still an AMP bug regardless, we are just hitting a race condition on that page that we are not hitting on some similar pages. |
/cc @rsimha-amp Something to consider for image diffing infrastructure, how one lands on an AMP page (considering SRP, cache transformations, viewer pre-rendering, all play a role) matters on the final rendered result. Ideally we can account for these (or at minimum start with the common case which is SRP + cache + viewer rather than direct canonical link hit) |
I'm debugging it now. Very close to finding the root cause. |
The issue is the images think they're wayyyyyyy further down the page (some 10000px more) than they actually are. If I manually request a remeasure on the images, they get their correct positions, and rendering works properly (they're either This is caused by an
This caption element pushes all the images down. By the time the carousel is "attached", its images have already had their first measure. Then the carousel attaches, and causes all it's children to |
Interesting, |
Right, the carousel has not been stubbed yet, so it doesn't have |
This is another that would be fixed by #9279. @dvoytenko I think we should merge it while we work on Layers. |
Whoa, interesting. I checked another page that is similar content type without the carousel and yes, the images load as expected. https://www.google.com/amp/abcnews.go.com/amp/US/deepdive/disappearing-beaches-sea-level-rise-39427567 |
@jridgewell I'd prefer if at this time we did something like this: remeasure everything once stubbing is done. Again, I don't think the #9279 would really address enough of issues here, b/c this not only affects AMP element's children, but it affects siblings. Actually, it looks like it affects siblings more. I think we already have a relayout-all signals in resources - we may need to trigger it again. |
@jridgewell any updates on the comment above? Thanks. |
This has to wait for Layers to fix. |
Still repros. We need to fix this immediately. I don't see how this can be related to #9279 |
Working on it now. We can do a really dirty fix by requesting remeasures of everything after build/layout. Layers code will do this, though it'll be a bit smarter. |
I don't think remeasures after build/layout would work - no guarantee that siblings are fully stubbed correctly. I think we need to figure out a way to estimate completion of stubbing for everything or by groups and request remeasures based on that. We now do something similar for font, but we need to find a way to do it for stubbing as well, unfortunately. |
Can't we just debounce a remeasure after calling |
|
Was thinking something like debounce over 1 or 2 seconds. |
|
With @cramforce 's change,
I think we just need, for now, to signal resources manager to debounce remeasures some time after |
…ntil build time. Fixes ampproject#9397 This change is dangerous and might break things, but I think it is the right thing to do. Children of `layout=responsive` elements should not be allowed to effect the height of the element. This should probably be extended to `fixed-height`.
This newly raised issue: #10300 is related but for |
Thanks everyone. Looks like the issue has been resolved. Much appreciated! |
I understand this might have been fixed in the meantime, but just leaving this here: I'm having what I think is the same issue, except this happens with It only happens if the page is prereneded. |
Link? |
@jridgewell https://www.google.pt/amp/s/www.publico.pt/2017/08/01/sociedade/noticia/agencia-do-medicamento-porto-concorre-com-mais-18-cidades-1780977/amp Scroll down to the bottom of the page. Weirdly, it only fails when clicking from a search results page. It loads when opening the prerendered URL directly. |
It's not the same issue exactly (the element's cached top offset is correct). I'll look into this to figure it out. |
@diniscorreia: This was an issue with prerendering in a viewer context, and has been fixed. |
@jridgewell awesome, thanks! |
@jridgewell @aghassemi I Have the same issue with AMP image loading, sometimes images loaded for a long time, or even I just have seen a white box instead of the image. And with just resize the page even for 1 px, all images have been load immediately, It seems to need a shock to load images:). |
@jridgewell @aghassemi I have the same issue with AMP images loading. Initial viewport(top 1000px) sections images are loading correctly but when we scroll down page (after some 1000px) not loading AMP images. As per my observation after AMP page rendering amp-image tag should be converted to like this - but getting AMP image tag like this after top (1000 px) - When we resize the page, AMP images loading correctly. Thanks. |
What's the issue?
AMP Images don't seem to load after the first few hundred pixels from the top of the browser as you scroll a long form story. Reference > https://www.google.com/amp/abcnews.go.com/amp/International/International/deepdive/syrian-refugee-children-photos-this-is-home-42066342
How do we reproduce the issue?
Attached screenshots.
The text was updated successfully, but these errors were encountered: