diff options
7 files changed, 58 insertions, 7 deletions
diff --git a/client/src/com/vaadin/client/BrowserInfo.java b/client/src/com/vaadin/client/BrowserInfo.java index e32e9b65f0..fab393eedc 100644 --- a/client/src/com/vaadin/client/BrowserInfo.java +++ b/client/src/com/vaadin/client/BrowserInfo.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -327,7 +327,7 @@ public class BrowserInfo { * otherwise <code>false</code> */ public boolean requiresOverflowAutoFix() { - return (getWebkitVersion() > 0 || getOperaVersion() >= 11) + return (getWebkitVersion() > 0 || getOperaVersion() >= 11 || isFirefox()) && Util.getNativeScrollbarSize() > 0; } diff --git a/client/src/com/vaadin/client/ComponentLocator.java b/client/src/com/vaadin/client/ComponentLocator.java index 3338147465..e69c55d445 100644 --- a/client/src/com/vaadin/client/ComponentLocator.java +++ b/client/src/com/vaadin/client/ComponentLocator.java @@ -436,8 +436,10 @@ public class ComponentLocator { if (w == null) { return null; } - - if (w instanceof VUI) { + String elementId = w.getElement().getId(); + if (elementId != null && !elementId.isEmpty()) { + return "PID_S" + elementId; + } else if (w instanceof VUI) { return ""; } else if (w instanceof VWindow) { Connector windowConnector = ConnectorMap.get(client) diff --git a/client/src/com/vaadin/client/ui/ui/VUI.java b/client/src/com/vaadin/client/ui/ui/VUI.java index 8d534053ed..096b0b60ba 100644 --- a/client/src/com/vaadin/client/ui/ui/VUI.java +++ b/client/src/com/vaadin/client/ui/ui/VUI.java @@ -37,6 +37,7 @@ import com.vaadin.client.BrowserInfo; import com.vaadin.client.ComponentConnector; import com.vaadin.client.ConnectorMap; import com.vaadin.client.Focusable; +import com.vaadin.client.LayoutManager; import com.vaadin.client.VConsole; import com.vaadin.client.ui.ShortcutActionHandler; import com.vaadin.client.ui.ShortcutActionHandler.ShortcutActionHandlerOwner; @@ -286,7 +287,12 @@ public class VUI extends SimplePanel implements ResizeHandler, sendClientResized(); - connector.getLayoutManager().layoutNow(); + LayoutManager layoutManager = connector.getLayoutManager(); + if (layoutManager.isLayoutRunning()) { + layoutManager.layoutLater(); + } else { + layoutManager.layoutNow(); + } } } diff --git a/server/src/com/vaadin/server/VaadinServlet.java b/server/src/com/vaadin/server/VaadinServlet.java index 9d1d79d8b1..0620035274 100644 --- a/server/src/com/vaadin/server/VaadinServlet.java +++ b/server/src/com/vaadin/server/VaadinServlet.java @@ -288,6 +288,11 @@ public class VaadinServlet extends HttpServlet implements Constants { // Handles AJAX UIDL requests communicationManager.handleUidlRequest(request, response, servletWrapper, uI); + + // Ensure that the browser does not cache UIDL responses. + // iOS 6 Safari requires this (#9732) + response.setHeader("Cache-Control", "no-cache"); + return; } else if (requestType == RequestType.BROWSER_DETAILS) { // Browser details - not related to a specific UI diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/HiddenTabSheetBrowserResize.java b/tests/testbench/com/vaadin/tests/components/tabsheet/HiddenTabSheetBrowserResize.java new file mode 100644 index 0000000000..0fdb579997 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/tabsheet/HiddenTabSheetBrowserResize.java @@ -0,0 +1,38 @@ +package com.vaadin.tests.components.tabsheet; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Label; +import com.vaadin.ui.TabSheet; + +public class HiddenTabSheetBrowserResize extends TestBase { + + @Override + public void setup() { + final TabSheet tabSheet = new TabSheet(); + + tabSheet.addTab(new Label("Label1"), "Tab1"); + tabSheet.addTab(new Label("Label2"), "Tab2"); + + Button toggleButton = new Button("Toggle TabSheet", + new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + tabSheet.setVisible(!tabSheet.isVisible()); + } + }); + addComponent(toggleButton); + addComponent(tabSheet); + } + + @Override + protected String getDescription() { + return "TabSheet content disappears if browser window resized when the TabSheet is hidden"; + } + + @Override + protected Integer getTicketNumber() { + return 9508; + } + +} diff --git a/uitest/src/com/vaadin/tests/integration/IntegrationTestApplication.java b/uitest/src/com/vaadin/tests/integration/IntegrationTestApplication.java index 41b7b020f5..916af7129e 100644 --- a/uitest/src/com/vaadin/tests/integration/IntegrationTestApplication.java +++ b/uitest/src/com/vaadin/tests/integration/IntegrationTestApplication.java @@ -38,7 +38,7 @@ public class IntegrationTestApplication extends LegacyApplication { table.addListener(new ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { - selectedLabel.setValue(table.getValue().toString()); + selectedLabel.setValue(String.valueOf(table.getValue())); } }); window.addComponent(selectedLabel); diff --git a/uitest/src/com/vaadin/tests/integration/IntegrationTestUI.java b/uitest/src/com/vaadin/tests/integration/IntegrationTestUI.java index 05683e7b4e..61214ede8c 100755 --- a/uitest/src/com/vaadin/tests/integration/IntegrationTestUI.java +++ b/uitest/src/com/vaadin/tests/integration/IntegrationTestUI.java @@ -34,7 +34,7 @@ public class IntegrationTestUI extends UI { table.addValueChangeListener(new ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { - selectedLabel.setValue(table.getValue().toString()); + selectedLabel.setValue(String.valueOf(table.getValue())); } }); addComponent(selectedLabel); |