LGTM
http://gwt-code-reviews.appspot.com/1447812/diff/1/user/src/com/google/gwt/safehtml/rebind/SafeHtmlTemplatesImplMethodCreator.java File user/src/com/google/gwt/safehtml/rebind/SafeHtmlTemplatesImplMethodCreator.java (right): http://gwt-code-reviews.appspot.com/1447812/diff/1/user/src/com/google/gwt/safehtml/rebind/SafeHtmlTemplatesImplMethodCreator.java#newcode432 user/src/com/google/gwt/safehtml/rebind/SafeHtmlTemplatesImplMethodCreator.java:432: if (isSafeUri(parameterType)) { On 2011/06/03 07:39:23, xtof wrote:
On 2011/06/02 13:47:05, jlabanca wrote: > Is it safe to use safeUri in a text context? Seems like a mistake
at the
least.
It would be safe here, since it's going to be HTML escaped just like
any other
string. I can't think of too many reasons anyone would legitimately do
this.
Perhaps in a template used to linkify URLs, as in "<a href='{0}'>{0}</a>" where {0} is a SafeUri. Seems like a pretty unlikely scenario, and I think I'll remove this
special case
here in the interest of simplicity. In any case, per your comment
above I've
made the change so that this would throw an error.
I don't think its even possible. The check in emitParameterExpression ensures that SafeUri is only used in a URL_ATTRIBUTE_ENTIRE context. http://gwt-code-reviews.appspot.com/1447812/diff/1003/user/test/com/google/gwt/safehtml/client/SafeHtmlTemplatesTest.java File user/test/com/google/gwt/safehtml/client/SafeHtmlTemplatesTest.java (right): http://gwt-code-reviews.appspot.com/1447812/diff/1003/user/test/com/google/gwt/safehtml/client/SafeHtmlTemplatesTest.java#newcode58 user/test/com/google/gwt/safehtml/client/SafeHtmlTemplatesTest.java:58: @Template("<span><b>{0}</b><span>{1}</span>") Missing a closing span. If you aren't testing something specific to the malformed HTML, I suggest you add the closing span back on. http://gwt-code-reviews.appspot.com/1447812/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors