|
7024 | 7024 | }, |
7025 | 7025 | { |
7026 | 7026 | "html": "<a id=\"the-img-element:queue-a-microtask\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-microtask\">Queue a microtask</a> to perform the following steps:", |
7027 | | - "rationale": "if", |
| 7027 | + "rationale": "let", |
7028 | 7028 | "steps": [ |
7029 | 7029 | { |
7030 | | - "html": "<p>If any of the following are true:</p>\n\n <ul><li><p><a id=\"the-img-element:this\" href=\"https://webidl.spec.whatwg.org/#this\" data-x-internal=\"this\">this</a>'s <a id=\"the-img-element:node-document\" href=\"https://dom.spec.whatwg.org/#concept-node-document\" data-x-internal=\"node-document\">node document</a> is not <a id=\"the-img-element:fully-active\" href=\"https://html.spec.whatwg.org/multipage/document-sequences.html#fully-active\">fully active</a>;\n or</p></li><li><p><a id=\"the-img-element:this-2\" href=\"https://webidl.spec.whatwg.org/#this\" data-x-internal=\"this\">this</a>'s <a id=\"the-img-element:current-request-4\" href=\"https://html.spec.whatwg.org/multipage/images.html#current-request\">current request</a>'s <a href=\"https://html.spec.whatwg.org/multipage/images.html#img-req-state\" id=\"the-img-element:img-req-state-3\">state</a> is <a href=\"https://html.spec.whatwg.org/multipage/images.html#img-error\" id=\"the-img-element:img-error-2\">broken</a>,</p></li></ul>\n\n <p>then reject <var>promise</var> with an <a id=\"the-img-element:encodingerror-2\" href=\"https://webidl.spec.whatwg.org/#encodingerror\" data-x-internal=\"encodingerror\">\"<code>EncodingError</code>\"</a>\n <code id=\"the-img-element:domexception-2\"><a data-x-internal=\"domexception\" href=\"https://webidl.spec.whatwg.org/#dfn-DOMException\">DOMException</a></code>.</p>" |
| 7030 | + "html": "<p>Let <var>global</var> be <a id=\"the-img-element:this\" href=\"https://webidl.spec.whatwg.org/#this\" data-x-internal=\"this\">this</a>'s <a id=\"the-img-element:concept-relevant-global\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#concept-relevant-global\">relevant global\n object</a>.</p>" |
| 7031 | + }, |
| 7032 | + { |
| 7033 | + "html": "<p>If any of the following are true:</p>\n\n <ul><li><p><a id=\"the-img-element:this-2\" href=\"https://webidl.spec.whatwg.org/#this\" data-x-internal=\"this\">this</a>'s <a id=\"the-img-element:node-document\" href=\"https://dom.spec.whatwg.org/#concept-node-document\" data-x-internal=\"node-document\">node document</a> is not <a id=\"the-img-element:fully-active\" href=\"https://html.spec.whatwg.org/multipage/document-sequences.html#fully-active\">fully active</a>;\n or</p></li><li><p><a id=\"the-img-element:this-3\" href=\"https://webidl.spec.whatwg.org/#this\" data-x-internal=\"this\">this</a>'s <a id=\"the-img-element:current-request-4\" href=\"https://html.spec.whatwg.org/multipage/images.html#current-request\">current request</a>'s <a href=\"https://html.spec.whatwg.org/multipage/images.html#img-req-state\" id=\"the-img-element:img-req-state-3\">state</a> is <a href=\"https://html.spec.whatwg.org/multipage/images.html#img-error\" id=\"the-img-element:img-error-2\">broken</a>,</p></li></ul>\n\n <p>then reject <var>promise</var> with an <a id=\"the-img-element:encodingerror-2\" href=\"https://webidl.spec.whatwg.org/#encodingerror\" data-x-internal=\"encodingerror\">\"<code>EncodingError</code>\"</a>\n <code id=\"the-img-element:domexception-2\"><a data-x-internal=\"domexception\" href=\"https://webidl.spec.whatwg.org/#dfn-DOMException\">DOMException</a></code>.</p>" |
7031 | 7034 | }, |
7032 | 7035 | { |
7033 | 7036 | "html": "Otherwise, <a id=\"the-img-element:in-parallel-2\" href=\"https://html.spec.whatwg.org/multipage/infrastructure.html#in-parallel\">in parallel</a>, wait for one of the following cases to occur, and\n perform the corresponding actions:", |
|
7038 | 7041 | "steps": [ |
7039 | 7042 | { |
7040 | 7043 | "case": "This img element's node document stops being fully active", |
7041 | | - "html": "<p>Reject <var>promise</var> with an <a id=\"the-img-element:encodingerror-3\" href=\"https://webidl.spec.whatwg.org/#encodingerror\" data-x-internal=\"encodingerror\">\"<code>EncodingError</code>\"</a>\n <code id=\"the-img-element:domexception-3\"><a data-x-internal=\"domexception\" href=\"https://webidl.spec.whatwg.org/#dfn-DOMException\">DOMException</a></code>.</p>" |
| 7044 | + "html": "<p><a id=\"the-img-element:queue-a-global-task\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-global-task\">Queue a global task</a> on the <a id=\"the-img-element:dom-manipulation-task-source\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#dom-manipulation-task-source\">DOM manipulation task source</a> with\n <var>global</var> to reject <var>promise</var> with an\n <a id=\"the-img-element:encodingerror-3\" href=\"https://webidl.spec.whatwg.org/#encodingerror\" data-x-internal=\"encodingerror\">\"<code>EncodingError</code>\"</a> <code id=\"the-img-element:domexception-3\"><a data-x-internal=\"domexception\" href=\"https://webidl.spec.whatwg.org/#dfn-DOMException\">DOMException</a></code>.</p>" |
7042 | 7045 | }, |
7043 | 7046 | { |
7044 | 7047 | "case": "This img element's current request changes or is mutated", |
7045 | | - "html": "<p>Reject <var>promise</var> with an <a id=\"the-img-element:encodingerror-3\" href=\"https://webidl.spec.whatwg.org/#encodingerror\" data-x-internal=\"encodingerror\">\"<code>EncodingError</code>\"</a>\n <code id=\"the-img-element:domexception-3\"><a data-x-internal=\"domexception\" href=\"https://webidl.spec.whatwg.org/#dfn-DOMException\">DOMException</a></code>.</p>" |
| 7048 | + "html": "<p><a id=\"the-img-element:queue-a-global-task\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-global-task\">Queue a global task</a> on the <a id=\"the-img-element:dom-manipulation-task-source\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#dom-manipulation-task-source\">DOM manipulation task source</a> with\n <var>global</var> to reject <var>promise</var> with an\n <a id=\"the-img-element:encodingerror-3\" href=\"https://webidl.spec.whatwg.org/#encodingerror\" data-x-internal=\"encodingerror\">\"<code>EncodingError</code>\"</a> <code id=\"the-img-element:domexception-3\"><a data-x-internal=\"domexception\" href=\"https://webidl.spec.whatwg.org/#dfn-DOMException\">DOMException</a></code>.</p>" |
7046 | 7049 | }, |
7047 | 7050 | { |
7048 | 7051 | "case": "This img element's current request's state becomes broken", |
7049 | | - "html": "<p>Reject <var>promise</var> with an <a id=\"the-img-element:encodingerror-3\" href=\"https://webidl.spec.whatwg.org/#encodingerror\" data-x-internal=\"encodingerror\">\"<code>EncodingError</code>\"</a>\n <code id=\"the-img-element:domexception-3\"><a data-x-internal=\"domexception\" href=\"https://webidl.spec.whatwg.org/#dfn-DOMException\">DOMException</a></code>.</p>" |
| 7052 | + "html": "<p><a id=\"the-img-element:queue-a-global-task\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-global-task\">Queue a global task</a> on the <a id=\"the-img-element:dom-manipulation-task-source\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#dom-manipulation-task-source\">DOM manipulation task source</a> with\n <var>global</var> to reject <var>promise</var> with an\n <a id=\"the-img-element:encodingerror-3\" href=\"https://webidl.spec.whatwg.org/#encodingerror\" data-x-internal=\"encodingerror\">\"<code>EncodingError</code>\"</a> <code id=\"the-img-element:domexception-3\"><a data-x-internal=\"domexception\" href=\"https://webidl.spec.whatwg.org/#dfn-DOMException\">DOMException</a></code>.</p>" |
7050 | 7053 | }, |
7051 | 7054 | { |
7052 | 7055 | "case": "This img element's current request's state becomes completely available", |
7053 | | - "html": "<p><a href=\"https://html.spec.whatwg.org/multipage/images.html#img-decoding-process\" id=\"the-img-element:img-decoding-process-3\">Decode</a> the image.</p>\n\n <p>If decoding does not need to be performed for this image (for example because it is a\n vector graphic), resolve <var>promise</var> with undefined.</p>\n\n <p>If decoding fails (for example due to invalid image data), reject <var>promise</var> with\n an <a id=\"the-img-element:encodingerror-4\" href=\"https://webidl.spec.whatwg.org/#encodingerror\" data-x-internal=\"encodingerror\">\"<code>EncodingError</code>\"</a> <code id=\"the-img-element:domexception-4\"><a data-x-internal=\"domexception\" href=\"https://webidl.spec.whatwg.org/#dfn-DOMException\">DOMException</a></code>.</p>\n\n <p>If the decoding process completes successfully, resolve <var>promise</var> with\n undefined.</p>\n\n <p>User agents should ensure that the decoded media data stays readily available until at\n least the end of the next successful <a id=\"the-img-element:update-the-rendering\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering\">update the rendering</a> step in the\n <a id=\"the-img-element:event-loop\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#event-loop\">event loop</a>. This is an important part of the API contract, and should not be\n broken if at all possible. (Typically, this would only be violated in low-memory situations\n that require evicting decoded image data, or when the image is too large to keep in decoded\n form for this period of time.)</p>" |
| 7056 | + "html": "<p><a href=\"https://html.spec.whatwg.org/multipage/images.html#img-decoding-process\" id=\"the-img-element:img-decoding-process-3\">Decode</a> the image.</p>\n\n <p>If decoding does not need to be performed for this image (for example because it is a\n vector graphic) or the decoding process completes successfully, then <a id=\"the-img-element:queue-a-global-task-2\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-global-task\">queue a global\n task</a> on the <a id=\"the-img-element:dom-manipulation-task-source-2\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#dom-manipulation-task-source\">DOM manipulation task source</a> with <var>global</var> to\n resolve <var>promise</var> with undefined.</p>\n\n <p>If decoding fails (for example due to invalid image data), then <a id=\"the-img-element:queue-a-global-task-3\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-global-task\">queue a global\n task</a> on the <a id=\"the-img-element:dom-manipulation-task-source-3\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#dom-manipulation-task-source\">DOM manipulation task source</a> with <var>global</var> to\n reject <var>promise</var> with an <a id=\"the-img-element:encodingerror-4\" href=\"https://webidl.spec.whatwg.org/#encodingerror\" data-x-internal=\"encodingerror\">\"<code>EncodingError</code>\"</a>\n <code id=\"the-img-element:domexception-4\"><a data-x-internal=\"domexception\" href=\"https://webidl.spec.whatwg.org/#dfn-DOMException\">DOMException</a></code>.</p>\n\n <p>User agents should ensure that the decoded media data stays readily available until at\n least the end of the next successful <a id=\"the-img-element:update-the-rendering\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering\">update the rendering</a> step in the\n <a id=\"the-img-element:event-loop\" href=\"https://html.spec.whatwg.org/multipage/webappapis.html#event-loop\">event loop</a>. This is an important part of the API contract, and should not be\n broken if at all possible. (Typically, this would only be violated in low-memory situations\n that require evicting decoded image data, or when the image is too large to keep in decoded\n form for this period of time.)</p>" |
7054 | 7057 | } |
7055 | 7058 | ] |
7056 | 7059 | } |
|
0 commit comments