summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2010-11-25 14:25:55 +0000
committerArtur Signell <artur.signell@itmill.com>2010-11-25 14:25:55 +0000
commit976eab68767a2a69183073cc360ba3c117161e92 (patch)
tree95bdf448b0588d5f56df4ee307e7dd3435ea7ac5 /src/com
parent504a33ecd4a160c3ff1f71d714bc4992d5427d1c (diff)
downloadvaadin-framework-976eab68767a2a69183073cc360ba3c117161e92.tar.gz
vaadin-framework-976eab68767a2a69183073cc360ba3c117161e92.zip
Workaround for Safari 4 issue with #6003 - Word wrap doesn't work in TextArea
svn changeset:16164/svn branch:6.5
Diffstat (limited to 'src/com')
-rw-r--r--src/com/vaadin/terminal/gwt/client/BrowserInfo.java4
-rw-r--r--src/com/vaadin/terminal/gwt/client/Util.java17
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VTextField.java5
3 files changed, 26 insertions, 0 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/BrowserInfo.java b/src/com/vaadin/terminal/gwt/client/BrowserInfo.java
index 7578d104b8..8855e41594 100644
--- a/src/com/vaadin/terminal/gwt/client/BrowserInfo.java
+++ b/src/com/vaadin/terminal/gwt/client/BrowserInfo.java
@@ -173,6 +173,10 @@ public class BrowserInfo {
return browserDetails.isSafari();
}
+ public boolean isSafari4() {
+ return isSafari() && browserDetails.getBrowserMajorVersion() == 4;
+ }
+
public boolean isIE6() {
return isIE() && browserDetails.getBrowserMajorVersion() == 6;
}
diff --git a/src/com/vaadin/terminal/gwt/client/Util.java b/src/com/vaadin/terminal/gwt/client/Util.java
index 5d4e8d1dc4..ee7fd112aa 100644
--- a/src/com/vaadin/terminal/gwt/client/Util.java
+++ b/src/com/vaadin/terminal/gwt/client/Util.java
@@ -13,6 +13,7 @@ import java.util.Set;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.dom.client.DivElement;
import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Style;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Element;
@@ -888,4 +889,20 @@ public class Util {
return null;
}
+ /**
+ * Force webkit to redraw an element
+ *
+ * @param element
+ * The element that should be redrawn
+ */
+ public static void forceWebkitRedraw(Element element) {
+ Style style = element.getStyle();
+ String s = style.getProperty("webkitTransform");
+ if (s == null || s.length() == 0) {
+ style.setProperty("webkitTransform", "scale(1)");
+ } else {
+ style.setProperty("webkitTransform", "");
+ }
+ }
+
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTextField.java b/src/com/vaadin/terminal/gwt/client/ui/VTextField.java
index 33639501e8..959155af23 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VTextField.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VTextField.java
@@ -5,6 +5,7 @@
package com.vaadin.terminal.gwt.client.ui;
import com.google.gwt.core.client.Scheduler;
+import com.google.gwt.dom.client.Style;
import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
@@ -563,6 +564,10 @@ public class VTextField extends TextBoxBase implements Paintable, Field,
getElement().setAttribute("wrap", "off");
getElement().getStyle().setOverflow(Overflow.AUTO);
}
+ if (BrowserInfo.get().isSafari4()) {
+ // Force redraw as Safari 4 does not properly update the screen
+ Util.forceWebkitRedraw(getElement());
+ }
wordwrap = enabled;
}
}