W3C home > Mailing lists > Public > www-style@w3.org > April 2008

Re: fallback color for background-image (ISSUE-5)

From: Patrick Garies <pgaries@fastmail.us>
Date: Sun, 06 Apr 2008 03:21:50 -0500
Message-ID: <47F8881E.9070805@fastmail.us>
To: Brad Kemper <brkemper@comcast.net>
CC: www-style@w3.org

Patrick Garies wrote:
>  There’s really no need to hijack another specification. Just define a
>  new at‐rule:
>
>  h1 { background: transparent url("image.png"); } @missing
>  resource("image.png") { /* missing is a synonym for disabled,
>  blocked, unsupported, malformed, inaccessible, incomplete, etc.
>  resources */ h1 { background-color: black; } }
>
>  Another Potential Scenario:
>
>  <object type="image/png" data="image.png"> <p>This is a sentence.</p>
>  <p>This is a sentence.</p> </object>
>
>  object { display: block; margin: 1em; background: crimson; } @missing
>  resource("image.png") { object { background: transparent; }
>  object::before { content: "Fall‐Back Content:"; display: block;
>  color: red; font-weight: bolder; } }
>
>  — Patrick Garies

I guess that I should note that I chose the format @missing 
resource("string") over something like @missing "string" since the 
former can be extended. For example:

@missing namespaces("http://www.w3.org/1999/xhtml")
@missing media-types("text/javascript", "text/ecmascript", 
"application/javascript", "application/ecmascript")
@missing declarations("color", "currentColor", forestgreen)
@missing values("currentColor", "color", "background-color")
@missing values(string, "text-align");
@missing properties("opacity", "-moz-opacity")
@missing at-rule("namespace")

— Patrick Garies
Received on Sunday, 6 April 2008 08:22:28 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:04 GMT