I'm attempting to use icons in an svg file in a ui.xml file like:

    <svg><use xlink:href=/icons.svg#foo-icon /></svg>

But with a variable, so:

    <svg><use xlink:href="{someExpression}" /></svg>

However, because of the xlink namespace (which the browser requires,
AFAICT), UiBinder and SafeHtml end up disagreeing on whether this is a
SafeUri-requiring attribute.

E.g. here is the UiBinder logic, which ignores namespace because it uses
local name:

https://github.com/gwtproject/gwt/blob/master/user/src/com/google/gwt/uibinder/elementparsers/HtmlInterpreter.java#L48

And here is the SafeHtml logic, which does looks at namespace+attribute due
to the underlying jsilver implementation:

https://github.com/gwtproject/gwt/blob/master/user/src/com/google/gwt/safehtml/rebind/SafeHtmlTemplatesImplMethodCreator.java#L301

https://code.google.com/p/jsilver/source/browse/trunk/src/com/google/streamhtmlparser/impl/HtmlParserImpl.java#237

So, it ends up failing because UiBinder generated SafeUri, but SafeHtml
says "this attribute shouldn't be a SafeUri, did you SafeHtml or String".

I'm wondering how to make them agree...while in this scenario it is true
that xlink:href is a URI, so UiBinder was right, in theory there could be
other namespaces where that is not the case, and the heuristic of "any
attribute named href is a uri, regardless of namespace" could be wrong.

Any great ideas?

...I suppose the other option is to just turn off safe html templates for
now.

- Stephen

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CANnRKuWxgJQeuutcu8PGmFzufA4ZrCZxu60_KbUAsJxobGHbgw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to