svn changeset:16164/svn branch:6.5tags/6.7.0.beta1
@@ -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; | |||
} |
@@ -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", ""); | |||
} | |||
} | |||
} |
@@ -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; | |||
} | |||
} |