Re: Treat background-image: url("") as background-image: none; in CSS proposal.

On Jun 21, 2013, at 9:28 AM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:

> On Fri, Jun 21, 2013 at 5:28 AM, Bjoern Hoehrmann <derhoermi@gmx.net> wrote:
>> * Daniel Glazman wrote:
>>> On 21/06/13 09:43, Tab Atkins Jr. wrote:
>>>> On Thu, Jun 20, 2013 at 11:39 PM, Vsevolod Vlasov <vsevik@chromium.org> wrote:
>>>>> TLDR: I'd like background-image: url("") to have the same behavior as
>>>>> background-image: none; in CSS.
>>>> 
>>>> That would be a weird and invasive change for such an obvious
>>>> implementation bug.  "" is a perfectly valid relative url, and it's
>>>> certainly possible for it to evaluate to an image, or anything else.
>>>> It seems pretty clear that we should just fix the error in Blink, not
>>>> spread a hack around the issue to CSS itself.
>>> 
>>> Absolutely. Content negociation makes it possible to reply
>>> an image to that URL. It really seems you're trying to fix
>>> a browser-specific issue with a global hack.
>> 
>> The empty string is a same-document reference and should not result in a
>> retrieval action, just like clicking on <a href='#example'> should not
>> result in the browser reloading the document.
> 
> Not quite.  While anything with a hash in it is a same-doc reference,
> a url without a hash *should* be re-retrieved (subject to caching
> semantics, etc.).  Clicking on <a href="">I'm a self link!</a> reloads
> the page, as it should,

Is this assuming you are on a server-defined default page, such as "index.html" or "default.htm" or whatever?

> while <a href="#">I'm a hash link!</a> does
> not.
> 
>> Since text/css resources
>> are not images, there is no background image that could be rendered. If
>> the declaration is in a HTML or SVG document, you would have a cyclic
>> dependency (the document has to be rendered to render its background),
>> and if CSS does not define how to break the cycle, there is nothing to
>> render either. See <http://tools.ietf.org/html/rfc3986#section-4.4>.
> 
> CSS doesn't allow you to render HTML documents as images, but the SVG
> case is definitely interesting.

If I have "index.asp" defined as a first choice default page in ISS, then I would expect "index.asp" in the same directory to be served as a relative URL. Within that asp code, I can set the response header to make it content-type of "image/jpeg" or whatever, and maybe generate some binary data programatically. Or not, as I could just keep the image invisible and use it for tracking. 

Received on Saturday, 22 June 2013 00:36:49 UTC