<when-property-is name="user.agent" value="ie6"/>
</replace-with>
+ <!-- Safari needs a different implementation due to GWT bug. See #4279 (vaadin trac) -->
+ <replace-with class="com.vaadin.terminal.gwt.client.ui.richtextarea.CustomWebkitRichTextArea">
+ <when-type-is class="com.google.gwt.user.client.ui.impl.RichTextAreaImpl" />
+ <when-property-is name="user.agent" value="safari" />
+ </replace-with>
+
<generate-with class="com.vaadin.terminal.gwt.widgetsetutils.WidgetMapGenerator">
<when-type-is class="com.vaadin.terminal.gwt.client.WidgetMap"/>
</generate-with>
--- /dev/null
+/**
+ *
+ */
+package com.vaadin.terminal.gwt.client.ui.richtextarea;
+
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
+import com.google.gwt.user.client.Element;
+import com.google.gwt.user.client.ui.impl.RichTextAreaImplSafari;
+
+/**
+ * TODO remove me when GWT RichTextArea is fixed. See #4279 (vaadin trac)
+ *
+ */
+class CustomWebkitRichTextArea extends RichTextAreaImplSafari {
+ public CustomWebkitRichTextArea() {
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ hookBlur(getElement());
+ }
+ });
+ }
+
+ private native void hookBlur(Element iframe)
+ /*-{
+
+ iframe.contentDocument.documentElement.onblur = function(evt) {
+ if (iframe.__listener) {
+ iframe.__listener.@com.google.gwt.user.client.ui.Widget::onBrowserEvent(Lcom/google/gwt/user/client/Event;)(evt);
+ }
+ };
+
+
+ }-*/;
+}
\ No newline at end of file