Skip to content
This repository

Image width/height attributes in IE differs from other browsers. #2142

ibolmo opened this Issue · 2 comments

3 participants

Olmo Maldonado Arian Stolwijk Darren Waddell
Olmo Maldonado

If the image is inserted in the DOM, then IE will set width/height to the src's width/height. If there's no src, then it will still set a width/height except to the placeholder's width/height:

Internet Explorer placeholder example

Typical of IE it decides to mess with the width/height attribute and we should help the developer have a consistent experience.

  1. When we set the src the image width/height stays the same even if the new src has different dimensions. We could overload and removeAttributes width/height.
  2. When we remove width/height attributes it'll reuse the src, if the src is not set it'll use the placeholders width/height. We could setAttribute width/height to 0, if src attribute is not set.

Question is whether this behavior is expected. Need to research what the other browsers, since this behavior is not well explained in the W3C specs.

Arian Stolwijk

isn't this related to #2129?

Darren Waddell

Closing as per #2129

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.