Patchset #2: Extracts isValidUriCharset from isValidUri, with a specific test. Adds test cases to test suites. Adds a few tests and fixes another few (including a risk of false positives in SafeHtmlHostedModeUtilsTest). Fixed copyright dates on a the new files.
Note that I didn't duplicated the fromTrustedString tests for fromSafeConstant. I ran "ant -Dgwt.junit.testcase.includes='**/SafeHtml*Suite.class' test.dev.htmlunit test.web.htmlunit" to validate the tests, in addition to launching them in Eclipse. http://gwt-code-reviews.appspot.com/1449814/diff/5/user/src/com/google/gwt/safehtml/shared/SafeUriHostedModeUtils.java File user/src/com/google/gwt/safehtml/shared/SafeUriHostedModeUtils.java (left): http://gwt-code-reviews.appspot.com/1449814/diff/5/user/src/com/google/gwt/safehtml/shared/SafeUriHostedModeUtils.java#oldcode48 user/src/com/google/gwt/safehtml/shared/SafeUriHostedModeUtils.java:48: + " <>\"{}|\\\\^`\u0000-\u001F\u001F-\uD7FF\uE000-\uFFFD" // href-ucschar There was a bug here, where \u001F-\uD7FF should have been \u007F-\D7FF. http://gwt-code-reviews.appspot.com/1449814/diff/5/user/src/com/google/gwt/safehtml/shared/SafeUriHostedModeUtils.java File user/src/com/google/gwt/safehtml/shared/SafeUriHostedModeUtils.java (right): http://gwt-code-reviews.appspot.com/1449814/diff/5/user/src/com/google/gwt/safehtml/shared/SafeUriHostedModeUtils.java#newcode136 user/src/com/google/gwt/safehtml/shared/SafeUriHostedModeUtils.java:136: uri = UriUtils.encodeAllowEscapes(uri); This is a "breaking change", as it now allows "%foo" ("%" not followed by 2-hex-digits) where it previously didn't. Given that we allow otherwise-erroneous unescaped unicode chars (along with a few others, such as unescaped "<" and ">"), and that browsers allow "%foo", I think it's a change for the better. http://gwt-code-reviews.appspot.com/1449814/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors