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

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, 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.

~TJ

Received on Friday, 21 June 2013 16:29:33 UTC