HTMLImageElement.idl 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #import <Fetch/Request.idl>
  2. #import <HTML/HTMLElement.idl>
  3. #import <HTML/Scripting/Fetching.idl>
  4. // https://html.spec.whatwg.org/multipage/images.html#image-decoding-hint
  5. [MissingValueDefault=auto, InvalidValueDefault=auto]
  6. enum Decoding {
  7. "sync",
  8. "async",
  9. "auto"
  10. };
  11. // https://html.spec.whatwg.org/multipage/embedded-content.html#htmlimageelement
  12. [Exposed=Window, LegacyFactoryFunction=Image(optional unsigned long width, optional unsigned long height)]
  13. interface HTMLImageElement : HTMLElement {
  14. [HTMLConstructor] constructor();
  15. [CEReactions, Reflect] attribute DOMString alt;
  16. [CEReactions, Reflect, URL] attribute USVString src;
  17. [CEReactions, Reflect] attribute DOMString srcset;
  18. [CEReactions, Reflect] attribute DOMString sizes;
  19. [CEReactions, Enumerated=CORSSettingsAttribute, Reflect=crossorigin] attribute DOMString? crossOrigin;
  20. [CEReactions, Reflect=usemap] attribute DOMString useMap;
  21. [CEReactions, Reflect=ismap] attribute boolean isMap;
  22. [CEReactions] attribute unsigned long width;
  23. [CEReactions] attribute unsigned long height;
  24. readonly attribute unsigned long naturalWidth;
  25. readonly attribute unsigned long naturalHeight;
  26. readonly attribute boolean complete;
  27. readonly attribute USVString currentSrc;
  28. [CEReactions, Reflect=referrerpolicy, Enumerated=ReferrerPolicy] attribute DOMString referrerPolicy;
  29. [CEReactions, Enumerated=Decoding, Reflect] attribute DOMString decoding;
  30. [CEReactions, Enumerated=LazyLoadingAttribute, Reflect] attribute DOMString loading;
  31. [CEReactions, Enumerated=FetchPriorityAttribute, Reflect=fetchpriority] attribute DOMString fetchPriority;
  32. Promise<undefined> decode();
  33. // Obsolete
  34. [CEReactions, Reflect] attribute DOMString name;
  35. [CEReactions, Reflect, URL] attribute USVString lowsrc;
  36. [CEReactions, Reflect] attribute DOMString align;
  37. [CEReactions, Reflect] attribute unsigned long hspace;
  38. [CEReactions, Reflect] attribute unsigned long vspace;
  39. [CEReactions, Reflect=longdesc, URL] attribute USVString longDesc;
  40. [CEReactions, LegacyNullToEmptyString, Reflect] attribute DOMString border;
  41. // https://drafts.csswg.org/cssom-view/#extensions-to-the-htmlimageelement-interface
  42. [FIXME] readonly attribute long x;
  43. [FIXME] readonly attribute long y;
  44. };