diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2013-04-23 14:22:30 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-04-23 12:26:54 +0000 |
commit | 9c6d4b4add253b96feb2d8bc41354c44bb8834d6 (patch) | |
tree | f2d023b76af00925962e8ee741c7243d60f1eaf2 | |
parent | 2c29e7b1d28f67642d4c1d9d8e8201a141dbe80a (diff) | |
download | vaadin-framework-9c6d4b4add253b96feb2d8bc41354c44bb8834d6.tar.gz vaadin-framework-9c6d4b4add253b96feb2d8bc41354c44bb8834d6.zip |
Fix fragment handling regression caused by #10769 (#11686)7.0.5
Due to the way Window.Location.createUrlBuilder works, a location URI with no
fragment (as opposed to an empty fragment) was sent on Webkit browsers when
the client-side location had an empty fragment.
TestBench test: FragmentChangeEvents.html
Change-Id: Ie2e8dc3fffc13aaa53105b54e07b1f81f3878f1b
-rw-r--r-- | client/src/com/vaadin/client/ui/VUI.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/client/src/com/vaadin/client/ui/VUI.java b/client/src/com/vaadin/client/ui/VUI.java index 9a73aa5f8f..4817bf9304 100644 --- a/client/src/com/vaadin/client/ui/VUI.java +++ b/client/src/com/vaadin/client/ui/VUI.java @@ -29,6 +29,7 @@ import com.google.gwt.event.logical.shared.ResizeHandler; import com.google.gwt.event.logical.shared.ValueChangeEvent; import com.google.gwt.event.logical.shared.ValueChangeHandler; import com.google.gwt.event.shared.HandlerRegistration; +import com.google.gwt.http.client.URL; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.History; @@ -133,10 +134,17 @@ public class VUI extends SimplePanel implements ResizeHandler, // Send the location to the server if the fragment has changed // and flush active connectors in UI. if (!newFragment.equals(currentFragment) && connection != null) { - - // Ensure the fragment is properly encoded in all browsers - // (#10769) - String location = Window.Location.createUrlBuilder() + /* + * Ensure the fragment is properly encoded in all browsers + * (#10769) + * + * createUrlBuilder does not properly pass an empty fragment to + * UrlBuilder on Webkit browsers so do it manually (#11686) + */ + String location = Window.Location + .createUrlBuilder() + .setHash( + URL.decodeQueryString(Window.Location.getHash())) .buildString(); currentFragment = newFragment; |