[whatwg] <img> element comments

Matthew Raymond mattraymond at earthlink.net
Sat Nov 4 13:27:18 PST 2006


Lachlan Hunt wrote:
> Ian Hickson wrote:
>> On Fri, 3 Nov 2006, Anne van Kesteren wrote:
>>> * It should probably mention 'img.src = foo' (that loading directly 
>>> starts). I thought that 'img.setAttribute("src", foo)' even did 
>>> different things in browsers (when the element is not yet inserted into 
>>> the document) so reflect might not be accurate.
>> I couldn't find a difference. Any idea what it was?
> 
> I don't know of any difference and I don't think there should be any, 
> even if some implementations currently do.  It would only be confusing 
> for authors if they behaved differently.

   Right. There can be differences between the initial value of an
attribute contained in markup and the instantaneous value in the DOM,
such as the case with <input value=""> or <option selected>, but with
<img>, I can't think of a situation where the |src| value could change
from the initial value in markup. Setting the |src| attribute's
instantaneous value and setting the value in markup are one and the same
in this case.



More information about the whatwg mailing list