Author: [EMAIL PROTECTED]
Date: Fri Oct  3 06:51:42 2008
New Revision: 3704

Modified:
    trunk/user/src/com/google/gwt/dom/client/DOMImplMozillaOld.java

Log:
Using fall back text content for old Mozilla.
Desk check by jgw.

Modified: trunk/user/src/com/google/gwt/dom/client/DOMImplMozillaOld.java
==============================================================================
--- trunk/user/src/com/google/gwt/dom/client/DOMImplMozillaOld.java      
(original)
+++ trunk/user/src/com/google/gwt/dom/client/DOMImplMozillaOld.java     Fri  
Oct  3 06:51:42 2008
@@ -63,4 +63,34 @@
      return top +
         
@com.google.gwt.user.client.impl.DocumentRootImpl::documentRoot.scrollTop;
    }-*/;
+
+  @Override
+  public native String getInnerText(Element node) /*-{
+    // To mimic IE's 'innerText' property in the W3C DOM, we need to  
recursively
+    // concatenate all child text nodes (depth first).
+    var text = '', child = node.firstChild;
+    while (child) {
+      // 1 == Element node
+      if (child.nodeType == 1) {
+        text +=  
[EMAIL PROTECTED]::getInnerText(Lcom/google/gwt/dom/client/Element;)(child);
+      } else if (child.nodeValue) {
+        text += child.nodeValue;
+      }
+      child = child.nextSibling;
+    }
+    return text;
+  }-*/;
+
+  @Override
+  public native void setInnerText(Element elem, String text) /*-{
+    // Remove all children first.
+    while (elem.firstChild) {
+      elem.removeChild(elem.firstChild);
+    }
+    // Add a new text node.
+    if (text != null) {
+      elem.appendChild($doc.createTextNode(text));
+    }
+  }-*/;
+
  }

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to