-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Currently, the .naturalWidth and .naturalHeight attributes of HTMLImageElement take on the value 0 when the image doesn't have an intrinsic width/height. This is unfortunate, because images can actually have a zero intrinsic width/height, and you can't tell the difference between these two states. (It's also just generally a bad practice to use a sentinel value like this.)
For Typed OM level 2, when I expose the intrinsic sizes of images, I want to mostly match up with HTML, but am planning on making the attributes nullable instead, so that a number indicates the actual intrinsic size, and null means no size in that axis. CSS has a lot more stretchy images.
In w3c/css-houdini-drafts#714 (comment), @annevk wonders if we could make this change for HTML as well.