amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

[amp-next-page] [1.0] AMP.combinedCss is intermittently unavailable in the amp-next-page shadow root element

Open iingato opened this issue 6 years ago • 2 comments

What's the issue?

A dropdown with hidden attribute on it, inside next-page-replace-annotated element (https://amp.dev/documentation/components/amp-next-page/#preventing-page-element-duplication), is visible when amp-next-page bootstraps.

Debugging suggests Global AMP.combinedCss may be empty or unavailable when it runs, either because multidoc was running in embedded frame/worker chunk mode, or some other reason. Seems related to esm mode potentially? https://github.com/ampproject/amphtml/blob/master/extensions/amp-next-page/1.0/service.js#L604 Screen Shot 2020-11-29 at 1 22 38 PM https://github.com/ampproject/amphtml/blob/master/extensions/amp-next-page/1.0/service.js#L692 https://github.com/ampproject/amphtml/blob/aaf686e4ffbb157123ec3bc4f3c32643fd4bbcc6/src/amp.js#L158

How do we reproduce the issue?

  1. Open google.com in Chrome in mobile emulator.
  2. Search "forbes road to the cloudarchitecture security and the refactor". You should come to this article: https://www.google.com/amp/s/www.forbes.com/sites/forbesdigitalgroup/2020/09/11/forbes-road-to-the-cloudarchitecture-security-and-the-refactor/amp/.
  3. Scroll in the article towards the second article in the stream.
  4. Observe the account dropdown (Account, Contact Preferences, Signout, etc.) shows up when amp-next-page article bootstraps. Observe dropdown is not there when scrolling back up fully, only when you scroll to the second page again does it show. You cannot close it because you are not signed in. Sign out does nothing. Observe it DOES have the hidden attribute on it (which means it should not be visible).
  5. Refresh the page and observe this does not repro. This also does not reproduce on domain, eg https://www.forbes.com/sites/forbesdigitalgroup/2020/09/11/forbes-road-to-the-cloudarchitecture-security-and-the-refactor/amp/. Note, this only seems to repro for me with the https://cdn.ampproject.org/rtv/012011070101001/v0/amp-next-page-1.0.mjs version, not the js version of the script. (It only repros in ESM mode)

Repro screen recordings: https://drive.google.com/file/d/1ftI_hHnYJBVj8SE1ekWdFB8MX5u2CVCH/view?usp=sharing https://drive.google.com/file/d/1WUYxySR-Hg9Wn4VtHjj94pVdTlZw8IEl/view?usp=sharing

What browsers are affected?

All including Chrome (mobile emulator Pixel 2 and on device)

Which AMP version is affected?

2011070101001

iingato avatar Nov 29 '20 19:11 iingato

cc: @bharrigan

iingato avatar Nov 29 '20 19:11 iingato

This was recently resolved with a change to ensure CSS is brought in from valid locations.

kristoferbaxter avatar Jan 27 '21 18:01 kristoferbaxter