Skip to content

Conversation

@westonruter
Copy link
Member

I found that when an amp-img had a fill layout and it was inside of a parent which was responsive (with 16x9 dimensions on an amp-youtube), the isTiny check was returning true unexpectedly. This updates the getDimensionsFromParent logic to return the max integer as the width/height when the element has a responsive layout.

Also renames Element::addAttributes() to Element::setAttributes() per #119 (comment).

@westonruter westonruter requested a review from schlessera April 10, 2021 05:41
@westonruter westonruter force-pushed the update/tiny-image-detection branch from 6cd61a3 to 40144be Compare April 10, 2021 05:42
westonruter added a commit to ampproject/amp-wp that referenced this pull request Apr 10, 2021
@schlessera schlessera added DOM Optimizer SSR Related to the serverside rendering of the Optimizer Bug Something isn't working labels Apr 10, 2021
@schlessera schlessera added this to the 0.4.0 milestone Apr 10, 2021
@schlessera schlessera merged commit 29d5207 into main Apr 10, 2021
@schlessera schlessera deleted the update/tiny-image-detection branch April 10, 2021 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working DOM Optimizer SSR Related to the serverside rendering of the Optimizer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants