mdn / yari

The platform code behind MDN Web Docs
Mozilla Public License 2.0
1.18k stars 503 forks source link

Some images still get stretched #1927

Closed peterbe closed 3 years ago

peterbe commented 3 years ago

Compare https://developer.mozilla.org/en-US/docs/Tools/Storage_Inspector/Cookies and http://localhost:3000/en-US/docs/Tools/Storage_Inspector/Cookies#Context_menu The HTML is:

<p>
<img alt="" src="https://mdn.mozillademos.org/files/16811/cookie_table_widget_context.png" 
  style="border: 1px solid black; display: block; height: 250px; margin-left: auto; margin-right: auto; width: 924px;" data-flaw="image1" loading="lazy">
</p>

and there's lots of these. I don't know what's up with all the other stuff in that inline things but the width and height numbers are correct. The PNG is 924x250.

If we write that code that injects width="XXX" height="YYY" into the <img> tag, the image is still stretched incorrectly.

ghost commented 3 years ago

I think the best thing is to use <picture> so you stay in the Front End area.

I remember i suggested compute attributes via BE, it seem was a bad idea.

Personally i can't see localhost (DevOps issue?)

Screenshot_20201204-005416.png

schalkneethling commented 3 years ago

Screenshot 2020-12-12 at 18 55 34

I don't know. If I remove the inline style and replace it with width and height attributes, it looks fine to me.

ghost commented 3 years ago

Screenshot_20201212-175927.png

Still stretched from Firefox mobile for Android.