Re: img issue: should we restrict the URI

Laurens Holst schreef: 
>>> Out of 104879 pages with at least one <img src>, from my collection 
>>> of pages from dmoz.org, there are 529 (0.5%) with at least one empty 
>>> <img src="">.
>>>
>>> I don't see any obvious pattern in those pages - there's a mixture 
>>> of old and new pages, dynamic and static pages, hand-written and 
>>> various generators, etc. So it doesn't appear to be the result of a 
>>> single tool.
>>>     
>>
>> Based primarily on #2 above and on Philip's research, I've made the 
>> spec say to ignore <img src=""> if the base URI of the element is the 
>> same as the document's address.
>>   
> [...]
> If you choose to specify this, may I suggest defining it differently: 
> make the spec say to ignore images where the (resolved) URI of the 
> element matches the document URI? That seems a rule that simplifies 
> the logic and where the implementation doesn’t need to perform two 
> checks (value = "" && this.baseURI == document.documentURI). Here the 
> explicit baseURI check seems a bit odd and unrelated, and working on 
> raw values (presuming knowledge about the resolving function) instead 
> of the result after resolving the URI.
>
> By the way, for reference, the Bugzilla bug that (recently) changed 
> Mozilla’s behaviour:
>
> https://bugzilla.mozilla.org/show_bug.cgi?id=444931

Note by the way that if I understand the patch attached to that bug 
correctly, the Mozilla implementation again does something different:

value = "" && resolveURI(value, this.baseURI) == document.documentURI.

(Where value is the attribute value.) Although this is effectively the 
same, the Mozilla version does not depend on knowledge of the URI 
resolving mechanism, which I think is better.

Both Mozilla and the currently specced behaviour special-case this for 
empty src attributes only, which I guess is slightly better than 
applying this generically, so that there is at least a workaround.

~Laurens

-- 
Note: New email address! Please update your address book.

~~ Ushiko-san! Kimi wa doushite, Ushiko-san nan da!! ~~
Laurens Holst, student, Utrecht University, the Netherlands
Website: www.grauw.nl. Backbase employee; www.backbase.com

Received on Friday, 9 January 2009 10:50:55 UTC