amp-carousel cropping the item DOM height in desktop UA
What's the issue?
When using amp-carousel in desktop UA && adding carousel item as non-amp-img DOM, since i-amphtml-slides-container has overflow-x: auto !important, height: 100% !important will be calculated minusing the scroll bar's height, which will end up to shorter container height and item being cropped.
An image like this...
...will end up showing like this in amp-carousel when the items are surrounded by <a> tag (<a href="/"><amp-img></amp-img></a>)
Live example: AliExpress

How do we reproduce the issue?
Repro page: https://amp-carousel-size-test.glitch.me/
- Add carousel items as non-
amp-imgDOM e.g. <div>, <a>... - Open the page in desktop UA
*If using Mac's trackpad, scrollbar is automatically hidden so you will need to use a mouse or reproduce by setting always to Show scroll bars.
*If you remove padding-bottom: 20px from i-amphtml-slides-container, it's very clear that the scroll bar height is breaking the container height.

Suggestion
What do you think about simply inheriting i-amphtml-slides-container's height from parent rather than height: 100%?
https://github.com/uskay/amphtml/commit/a99fc21023b380036c87037cab196129ef2fb192#diff-99d5d6d12e0d5695a02b76fbd2ef5353

What browsers are affected?
All browsers (which will show scroll bars on overflow-x: auto)
Which AMP version is affected?
Powered by AMP ⚡ HTML – Version 1809142227020
TIL, it is also defined here that height percentage will be calculated based on the padding box height when the element itself is absolute
https://www.w3.org/TR/CSS22/visudet.html#the-height-property
I guess the definition padding box here is the same as Element.clientHeight?
inner height of an element in pixels, including padding but not the horizontal scrollbar height, border, or margin https://developer.mozilla.org/en-US/docs/Web/API/Element/clientHeight
-- adding comments start (13:07 JST) -- This spec could be more relavant
In the case of a scrollbar being placed on an edge of the element's box, it should be inserted between the inner border edge and the outer padding edge. Any space taken up by the scrollbars should be taken out of (subtracted from the dimensions of) the containing block formed by the element with the scrollbars. https://www.w3.org/TR/CSS22/visufx.html#propdef-overflow
-- adding comments end --
Which makes a lot of sense regarding this issue.
- having
overflow-x: automight lead to showing a horizontal scroll bar e.g. using a mouse in desktop UA - having
i-amphtml-slides-containerasposition: absolute&&height: 100%will calculate the element height subtracting the horizontal scrollbar height (vs the item's actual size should be the same as the parent <amp-carousel>) - And having
overflow-y: hiddenwill crop the item based on the calculated height above
Adding @aghassemi to this thread.
Thanks for the detailed report and investigation!
This issue hasn't been updated in awhile. @aghassemi Do you have any updates?
Let's verify in the new carousel.