Skip to content

HTMLImageElement

Generated from idl/html.webidl when the site was built at 7aa23e2.

HTMLImageElement is an interface in idl/html.webidl, inheriting HTMLElement, exposed in Window. What it does is on MDN; this page says what niso has of it.

The web features its members belong to, each with its Baseline status on the web and how much of the feature’s WPT suite passes in niso (see Web platform support).

Feature On the web In niso Members
<img> Widely available Partial 24% 129 of 537 subtests pass 9
constructor
[HTMLConstructor] constructor();
attribute
attribute DOMString alt;
int32_t niso_html_image_element_get_alt(niso_dom* dom, niso_handle self, niso_str* out);
int32_t niso_html_image_element_set_alt(niso_dom* dom, niso_handle self, const char* value, size_t value_len);
attribute
attribute USVString src;
int32_t niso_html_image_element_get_src(niso_dom* dom, niso_handle self, niso_str* out);
int32_t niso_html_image_element_set_src(niso_dom* dom, niso_handle self, const char* value, size_t value_len);
attribute
attribute unsigned long width;
int32_t niso_html_image_element_get_width(niso_dom* dom, niso_handle self, uint32_t* out);
int32_t niso_html_image_element_set_width(niso_dom* dom, niso_handle self, uint32_t value);
attribute
attribute unsigned long height;
int32_t niso_html_image_element_get_height(niso_dom* dom, niso_handle self, uint32_t* out);
int32_t niso_html_image_element_set_height(niso_dom* dom, niso_handle self, uint32_t value);
attribute
readonly attribute unsigned long naturalWidth;
int32_t niso_html_image_element_get_natural_width(niso_dom* dom, niso_handle self, uint32_t* out);
attribute
readonly attribute unsigned long naturalHeight;
int32_t niso_html_image_element_get_natural_height(niso_dom* dom, niso_handle self, uint32_t* out);
attribute
readonly attribute boolean complete;
int32_t niso_html_image_element_get_complete(niso_dom* dom, niso_handle self, bool* out);
attribute
attribute DOMString? crossOrigin;
int32_t niso_html_image_element_get_cross_origin(niso_dom* dom, niso_handle self, niso_str* out);
int32_t niso_html_image_element_set_cross_origin(niso_dom* dom, niso_handle self, const char* value, size_t value_len);

Members the web has, by the BCD keys web-features 3.45.0 lists, that idl/ doesn’t declare. The list is partial: web-features lists only the keys it maps to a feature.

  • Image (<img>)
  • attributionSrc (Attribution reporting)
  • decode (<img>)
  • decoding (<img>)
  • fetchPriority (Fetch priority)
  • isMap (Image maps)
  • loading (Lazy-loading images and iframes)
  • referrerPolicy (Referrer policy)
  • sharedStorageWritable (Shared storage)
  • sizes (srcset and sizes)
  • srcset (srcset and sizes)
  • useMap (Image maps)
  • x (<img>)
  • y (<img>)