Skip to content
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-img: wrong source is picked #13084

Closed
tbll opened this issue Jan 27, 2018 · 1 comment
Closed

amp-img: wrong source is picked #13084

tbll opened this issue Jan 27, 2018 · 1 comment

Comments

@tbll
Copy link

tbll commented Jan 27, 2018

Tested on Chrome. <amp-img> and <img> pick different sources. <amp-img> will pick a very large source even though sizes says 10vw.

<!doctype html>

<html amp lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
    <script async src="https://cdn.ampproject.org/v0.js"></script>
    <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
    <style amp-custom>
      img, amp-img {
        width: 10vw;
        height: auto;
      }
    </style>
  </head>
  <body>
    <amp-img src='http://placehold.it/720x440'
      width='720' height='480'
      sizes="10vw"
      srcset="http://placehold.it/360x240 360w, http://placehold.it/720x480 720w, http://placehold.it/1080x720 1080w,  http://placehold.it/1440x960 1440w">
    </amp-img>
    <img src='http://placehold.it/720x440'
      width='720' height='480'
      sizes="10vw"
      srcset="http://placehold.it/360x240 360w, http://placehold.it/720x480 720w, http://placehold.it/1080x720 1080w,  http://placehold.it/1440x960 1440w">
  </body>
</html>
@tbll
Copy link
Author

tbll commented Jan 27, 2018

Dupe: #11575

@tbll tbll closed this as completed Jan 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant