[Bug 5846] Accessing Object Parameters from an Embedded SVG

http://www.w3.org/Bugs/Public/show_bug.cgi?id=5846


Ian 'Hixie' Hickson <ian@hixie.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |WONTFIX




--- Comment #7 from Ian 'Hixie' Hickson <ian@hixie.ch>  2008-07-16 19:56:45 ---
(In reply to comment #5)
> 1) Query Parameters.  Can someone point me to documentation on these?

They're the "?xxx" part of URLs. See RFC3986. You can obtain them from the
location.search attribute in HTML5. Changing them on the fly requires
reloading, but if you're doing on-the-fly changes then that's exactly what
postMessage() was designed for, so use that.


> a) SVG Text labels that are populated via object parameters
> 
> <object data="http://openclipart/funkyWordArt.svg">
>   <param name="theText" value="Hello World!"/>
>   <param name="fillColor" value="PapayaWhip" />
> </object>

That's not a use case, it's an example of how it could be used. What I mean by
use case is an actual example of an actual site that is currently working
around the lack of this feature, or that would be able to do something
dramatically better if this feature was available.


> b) Link targets in the SVG that are configurable.  Embed clip art into my site
> and parts of the image link to different things depending on the page that
> embedded the clip art.  I can see MANY uses for this, like a 'bug' image that
> links to a specific bug 
>   <object data="http://openclipart/bug.svg">
>     <param name="theLink" value="http://bugzilla/bug1234" />
>   </object>
>   <object data="http://openclipart/bug.svg">
>     <param name="theLink" value="http://bugzilla/bug5678" />
>   </object>

Just use query arguments:

   <img src="http://openclipart/bug.svg?http://bugzilla/bug5678" alt="Bug
5678">

...or even better, so that the page remains accessible to all users:

   <a href="http://bugzilla/bug5678"><img
      src="http://openclipart/bug.svg?http://bugzilla/bug5678"
      alt="Bug 5678"></a>


> c) Allow the embedding document to specify a stylesheet to use for the SVG

<iframe seamless> does this now, if you want the parent stylesheet to cascade
in. If you don't, just use query parameters. They work today.


> 3) Evidence.  "Is there any evidence showing that people actually _do_ specify
> <param>s for HTML and SVG objects?"
>
> This seems an odd question to me.  Since it is currently not possible to do
> this across domains, obviously NO ONE is doing that.

Ok, so we don't _have_ to do it. Now the question is, does providing this offer
a compelling solution to something that otherwise wouldn't be possible? As far
as I can tell, the answer is "no".

(In reply to comment #6)
> * This issue comes from an author request. An early deployer points out that
> the spec has a hole because he fell into it - counts for something, no?

It's good feedback to have, but realistically we need much more than a single
request to justify adding a feature, especially for something that has very
little uptake in the first place (like SVG) and that has workarounds (like
query parameters and postMessage()).


> * While there is no such HTML+SVG usage that I could find, the proposed
> feature is very similar to Flash's "flashvars" PARAM. There's precedence for
> simplifying "markup -> script inside OBJECT" communication when you consider
> <param name="flashvars"> and this is very, very common in real-life usage.

It isn't clear to me that flashvars are the best solution to this for Flash
either.


> Using postMessage here seems like a lot of overhead and "scaffolding" for a
> very simple use case.

In the case of merely sending static data, I agree; query parameters are the
way to go for that. They allow the server to statically update the file as well
as allowing the SVG file itself to read the data.


> I agree with that. I think feature parity with plugin implementation matters
> though - including comparing SVG features to Flash features.

Feature parity is not a goal. Making the platform useful and powerful is the
goal, with the high priority items getting the first chance.

I'm marking this WONTFIX again because until such time as there really is a lot
of SVG out there I don't think it makes sense to worry about this. The only
cost of the query syntax is caching, and it is far too early to worry about
that kind of optimisation for a technology as young as SVG-in-HTML, IMHO.


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Wednesday, 16 July 2008 19:57:21 UTC