[whatwg] Inconsistent behavior for empty-string URLs
Nicholas Zakas
nzakas at yahoo-inc.com
Mon Dec 21 11:03:01 PST 2009
Here are the results of testing various tags with empty URLs across
different browsers. The table below indicates how many requests are sent
when the given tag is encountered on the page (curiously, Firefox 3
sometimes sends two extra requests). Even though the <link> tags don't
show it in the table, they all had href="".
IE7 IE8 FF3 FF3.5
SF4 Ch3 Op10
<img src=""> 1 1 1 0 1
1 0
<link rel="stylesheet"> 0 0 1 1 1
1 0
<link rel="icon"> 0 0 2 1
1 1 0
<link rel="shortcut icon"> 0 0 2 1 1
1 0
<link rel="prefetch"> 0 0 2 0 0
0 0
<script src=""> 0 0 1 1 1
1 0
<iframe src=""> 0 0 0 0 0
0 0
<input type="image" src=""> 1 1 1 0 1
1 0
<object data=""> 0 0 1 1
0 0 0
<embed src=""> 0 0 0 0 0
0 0
<html manifest=""> 0 0 0 0 1
0 0
For the most part, no two browsers act the same. Safari and Chrome are
the closest (not surprising).
Apply a base URL via <base> in all cases didn't change the results,
except in IE, where it prevented the extra image request from being
made.
-Nicholas
______________________________________________
Commander Lock: "Damnit Morpheus, not everyone believes what you
believe!"
Morpheus: "My beliefs do not require them to."
-----Original Message-----
From: whatwg-bounces at lists.whatwg.org
[mailto:whatwg-bounces at lists.whatwg.org] On Behalf Of Simon Pieters
Sent: Friday, December 18, 2009 2:25 AM
To: Jonas Sicking
Cc: Maciej Stachowiak; whatwg at lists.whatwg.org; Nicholas Zakas; Aryeh
Gregor
Subject: Re: [whatwg] Inconsistent behavior for empty-string URLs
On Fri, 18 Dec 2009 01:51:44 +0100, Simon Pieters <simonp at opera.com>
wrote:
> On Thu, 17 Dec 2009 22:58:03 +0100, Simon Pieters <simonp at opera.com>
> wrote:
>
>> I asked Philip to provide some data about pages using empty
attributes
>> for these:
>>
>> <Philip`> zcorpan:
http://philip.html5.org/data/empty-url-attributes.txt
>> <Philip`> zcorpan:
>> http://philip.html5.org/data/empty-url-link-attributes.txt
>>
>>
>> I have not looked at these yet,
>
> (and still haven't, just made the data slightly more digestible)
I've now looked at a selection of random URLs.
Conclusion: None of these seem to need a request to be made. img should
fire an error event. iframe and frame should use about:blank.
>> but it would probably be good to do so before changing things, so we
>> have an idea what the compat impact is.
>
> http://simon.html5.org/dump/empty-url-attributes.xml
>
> <img src>, 3221 occurrences
Some pages use these as spacers.
http://10-0-1-1.category.datapicks.com/.html has:
<img alt="! Advanced Applet Suite"
onerror="this.src='http://www.datapicks.com/icon.gif';" src=""
align="left" border="0" vspace="3" hspace="5" width="32" height="32">
...which suggests that we need to fire an error event (the page works as
intended in Chrome and but has broken image boxes in Opera and Firefox).
Similarly
http://dailysofts.com/program/366/5247/MacDrive_6_for_Windows.html has:
<img alt="Stamp It" onerror="this.src='/icon.gif';" src="" align="left"
border="0" height="32" width="32">
http://album.cando360.com/photo/personal_2453.html has:
<img src="" id="GlobalUserLogined_MyHeaderImg" />
...which seems like something that is filled in when the user is logged
in, maybe with script.
Similarly
http://managedhealthcareexecutive.modernmedicine.com/mhe/article/article
Detail.jsp?id=367917&sk=&date=&%0A%09%09%09&pageID=2
has:
<img id="randomImage" src="" alt="Word Verification Image Loading,
please
wait..."/>
> <script src>, 248 occurrences
These seem to be mostly not-filled-in boiletplate.
> <iframe src>, 1862 occurrences
These seem to just want to get an about:blank iframe for various
reasons.
> <video src>, 0 occurrences
> <video poster>, 0 occurrences
> <audio src>, 0 occurrences
> <object data>, 0 occurrences
> <embed src>, 74 occurrences
These seem to be not-filled-in object/embed plugin boilerplates. Not
sure
if they need to invoke the plugin (from type or other) or not.
> <source src>, 0 occurrences
> <input src>, 55 occurrences
Not sure what to make of these. Some are not type=image, some seem to be
invisible submit buttons...
> <command icon>, 0 occurrences
> <html manifest>, 0 occurrences
> <applet code>, 0 occurrences
> <frame src>, 53 occurrences
Mostly a blank main frame getting filled in with script or by clicking a
link in another frame.
> <body background>, 1665 occurrences
Pages with no background image...
> http://simon.html5.org/dump/empty-url-link-attributes.xml
>
> <link rel=icon>, 243 occurrences
Not-filled-in boilerplate.
> <link rel=prefetch>, 0 occurrences
> <link rel=stylesheet>, 115 occurrences
Not-filled-in boilerplate.
--
Simon Pieters
Opera Software
More information about the whatwg
mailing list