You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Should we select an image source synchronously when updating the image data? #8207
Queue a microtask to perform the rest of this algorithm, allowing the task that invoked this algorithm to continue.
...
Let selected source and selected pixel density be the URL and pixel density that results from selecting an image source, respectively.
Basically, this part is unclear to me now. The 9th step is in a microtask when updating the image data. However, right now if the <img> element is under <picture>, the width and height attributes of <source> elements affect the <img>'s style. That means, we have to make sure this <img> element chooses the correct source for any DOM mutations and for any updates on those <source> elements under the same <picture> element. So we can get the correct result (e.g. getComputedStyle() calls) after these DOM mutations.
After checking the implementation in Blink and WebKit, it seems both select the image URL synchronously. In Gecko, we would like to follow this so we can pass the wpt, picture-aspect-ratio.html.
Just wondering are there any concerns to make the update of image source run asynchronously in the spec? Otherwise, it may be great to address this in the spec. (Or maybe I missed something.) Thanks.
Activity
script: Update source set synchronously for `<img>` style computation (…
script: Update source set synchronously for `<img>` style computation (…
script: Update source set synchronously for `<img>` style computation…