- From: Jonas Sicking <jonas@sicking.cc>
- Date: Mon, 25 Oct 2010 19:48:20 -0700
- To: "Tab Atkins Jr." <jackalmage@gmail.com>
- Cc: Anne van Kesteren <annevk@opera.com>, Arun Ranganathan <arun@mozilla.com>, public-webapps <public-webapps@w3.org>, Arthur Barstow <art.barstow@nokia.com>, Adam Barth <abarth@gmail.com>, Darin Fisher <darin@google.com>
On Mon, Oct 25, 2010 at 6:10 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote: > On Mon, Oct 25, 2010 at 5:59 PM, Jonas Sicking <jonas@sicking.cc> wrote: >> On Mon, Oct 25, 2010 at 5:56 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote: >>> On Mon, Oct 25, 2010 at 5:51 PM, Jonas Sicking <jonas@sicking.cc> wrote: >>>> On Mon, Oct 25, 2010 at 5:04 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote: >>>>> On Mon, Oct 25, 2010 at 4:48 PM, Jonas Sicking <jonas@sicking.cc> wrote: >>>>>> Like I said, I think creating an OM that covers all the cases here >>>>>> would create something very complex. I'd love to see a useful proposal >>>>>> for <http://dev.w3.org/csswg/css3-images/>. >>>>> >>>>> It doesn't seem overly difficult. Using the proposed Values API, >>>>> you'd do something like "elem.style.values.backgroundImage.url = >>>>> [DOMURL goes here]". >>>> >>>> That doesn't cover nearly all the ways you can use URLs as defined in >>>> http://dev.w3.org/csswg/css3-images/ which support multiple levels of >>>> fallback images, with snapping and resolution as well as gradients and >>>> fallback colors. And with used in a property like backgroundImage, you >>>> can have several combined instances of those. Consider: >>>> >>>> style="background-image: image(sun.svg, 'sun.png' snap 150dpi), >>>> image(wavy.svg, 'wavy.png' 150dpi, 'wavy.gif', radial-gradient(...))" >>> >>> This would be part of the <url> interface, and would be accepted >>> anywhere a <url> is currently accepted. Exposing the correct >>> interface of function arguments would be a job for the function >>> interface in the Values API, and is designed to be orthogonal. >> >> Note that the syntax for images is significantly different from the >> syntax for urls. So I suspect you mean <image> rather than <url> >> above. > > No, I meant <url>, which happens to be a type of <image> as well. I > don't know what it would mean for me to mean <image>, as that covers > much more than what you can produce with a blob. > > >> However it still leaves my original statement unanswered: >> >> "Like I said, I think creating an OM that covers all the cases here >> would create something very complex. I'd love to see a useful proposal >> for <http://dev.w3.org/csswg/css3-images/>" > > I outlined how it would work above, I thought. Any property that can > take a <url> should, in the Values API, be able to take a url object > like we're describing here. Any function that can take a <url> as an > argument should do the same. The exact interface for exposing > function arguments hasn't been nailed down yet, but once you can do > so, using it should be the same as using an ordinary property which > just takes a <url>. The question is, how do you use a DOMURL together with all the other features of <image>. Using the createObjectURL proposal I can do: elem.style.backgroundImage = "image('" + createObjectURL(file1) + "' snap 150dpi)," + "image('" + createObjectURL(file2) + "' 150dpi, radial-gradient(...))"; How would I do the equivalent if createObjectURL isn't available? / Jonas
Received on Tuesday, 26 October 2010 02:49:14 UTC