patch: resolve DOM src and href attributes against base

Dirk Mueller mueller at kde.org
Mon Nov 3 01:38:10 CET 2003


On Thursday 30 October 2003 17:48, Maciej Stachowiak wrote:

> > why did you remove the special-casing of <img src> ?
> Retrieving the src attribute of <img src=""> from JavaScript returns
> the base document URL from the src attribute in other browsers. 

No, only in IE. Anyway, the <img src=""> case is not interesting, because it 
does not matter. it is very unlikely that your html document containing this 
construct would be a validly displayable image, so no webauthor would ever do 
that. 

The point is, web authors want to distinguish the <img> case from the <img 
src=foo> case. Your patch breaks this, because you return the document base 
url for <img>. (where ATTR_SRC is a null string). 

> tested and <img src> does the same, at least in Mozilla.

Not in my Mozilla (1.4.0). anyway, the isEmpty/isNull difference is not 
important, because nobody is going to use <img src> anyway. But as Mozilla 
does not expand <img src=""> to the document base url, we did it this way. 

> > its not as if we added that code just for fun..
> Well I didn't take it out just for fun - I tested. Why did you add it?

Its more important for HTMLScriptElement::src. where you just broke the 
difference between <script> and <script src>. 

Maciej, please take a look at our tree, we have that code in there correctly 
for a very long time already. 


-- 
> Looking for a KDE-related EMail-Alias ? Get one at kdemail.net for FREE! <


More information about the Khtml-devel mailing list