I followed the approach from the SafeStyles for the checks in the generator, with the exception that I log a warning rather than throw when a SafeUri is used outside a URL attribute context.
I updated the ClippedImageImpl's internal SafeHtmlTemplates so it doesn't log such a warning, and fixed a couple of errors here as well (getHostPageBaseURL vs. getModuleBaseURL, and missing .asString()). http://gwt-code-reviews.appspot.com/1380806/diff/5003/user/src/com/google/gwt/user/client/ui/Image.java File user/src/com/google/gwt/user/client/ui/Image.java (right): http://gwt-code-reviews.appspot.com/1380806/diff/5003/user/src/com/google/gwt/user/client/ui/Image.java#newcode145 user/src/com/google/gwt/user/client/ui/Image.java:145: impl.createStructure(UriUtils.fromTrustedString(url), left, top, width, height)); On 2011/03/29 20:11:11, xtof wrote:
- introduce UriUtils#fromUntrustedString, with the same implementation
as
fromTrustedString, but documented to be used as an "unsafe cast" from
String to
SafeUri, to be used to support legacy APIs.
Done. http://gwt-code-reviews.appspot.com/1380806/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
