[whatwg] The src-N proposal
james at hoppipolla.co.uk
Wed Nov 20 03:30:18 PST 2013
On 19/11/13 22:07, Simon Pieters wrote:
> The selection algorithm would only consider <source> elements that are
> previous siblings of the <img> if the parent is a <picture> element, and
> would be called in place of the current 'process the image candidates'
> in the spec (called from 'update the image data'). 'Update the image
> data' gets run when an img element is created, has its src or
> crossorigin (or srcset if we still want that on img) attributes
> changed/set/removed, is inserted or removed from its parent, when
> <source> is inserted to a <picture> as a previous sibling, or a <source>
> that is a previous sibling is removed from <picture>, or when a <source>
> that is a previous sibling and is in <picture> has its src or srcset (or
> whatever attributes we want to use on <source>) attributes
> changed/set/removed. 'Update the image data' aborts if the
> parser-created flag is set. When img is inserted to the document, if the
> parser-created flag is set, the flag is first unset and then 'update the
> image data' is run but without the await a stable state step.
This seems like a nice proposal. There seems to be a minor problem that
elements created through innerHTML will have the parser created flag set
and so will not start loading until they are inserted into the document.
So you probably want to call the flag the "delayed load" flag or
somesuch, and only set it if the parser isn't in the fragment case.
More information about the whatwg