Nested media attributes cause JS Error on resize
Short description of your issue:
amp-video elements with media="(orientation: portrait)" tag inside of a amp-carousel with media="(max-width: 599px)" will trigger a JS Error on resize.
discoverResourcesForElement_ -> element is undefined and classList property can not be read.
How do we reproduce the issue?
- Open https://p2er.github.io/amp-articleslider/stacked-media-carousel.html in portrait viewport with window width < 599px
- Navigate to second slide
- Increase browser window width above > 599px
What browsers are affected?
Tested on Chrome 57 on Mac OS X. Does also happen on Safari 10.1. Very likely to occur on all browsers.
Which AMP version is affected?
AMP Version 0.1 affected. Can be reproduced every time.
Stack Trace
resources-impl.js:1805 Uncaught TypeError: Cannot read property 'classList' of undefined at Mh (https://cdn.ampproject.org/v0.js:274:190) at https://cdn.ampproject.org/v0.js:274:155 at Array.forEach (native) at oh (https://cdn.ampproject.org/v0.js:274:113) at Eh (https://cdn.ampproject.org/v0.js:274:48) at bh.f.updateInViewport (https://cdn.ampproject.org/v0.js:255:406) at P.f.updateInViewport (https://cdn.ampproject.org/v0.js:146:62) at T (https://cdn.ampproject.org/v0/amp-carousel-0.1.js:29:222) at V (https://cdn.ampproject.org/v0/amp-carousel-0.1.js:30:94) at https://cdn.ampproject.org/v0/amp-carousel-0.1.js:28:106
Intention
The media attribute on the videos would be used to swap content for portrait and landscape dimensions. Surrounding carousel would only be visible on mobile devices and therefore hidden at a certain width.
This issue hasn't been updated in awhile. @aghassemi Do you have any updates?
This issue hasn't been updated in awhile. @aghassemi Do you have any updates?
This issue hasn't been updated in awhile. @aghassemi Do you have any updates?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.