[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/khtml/html
From:       Maks Orlovich <maksim () kde ! org>
Date:       2008-05-26 19:24:07
Message-ID: 1211829847.822305.31837.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 812983 by orlovich:

More sensible option behavior when the first kid isn't text....
BUG:161196


 M  +10 -14    html_formimpl.cpp  


--- trunk/KDE/kdelibs/khtml/html/html_formimpl.cpp #812982:812983
@@ -2608,21 +2608,17 @@
 
 DOMString HTMLOptionElementImpl::text() const
 {
-    if (firstChild() && firstChild()->nodeType() == Node::TEXT_NODE) {
-	if (firstChild()->nextSibling()) {
-	    DOMString ret = "";
-	    NodeImpl *n = firstChild();
-	    for (; n; n = n->nextSibling()) {
-		if (n->nodeType() == Node::TEXT_NODE ||
-		    n->nodeType() == Node::CDATA_SECTION_NODE)
-		    ret += n->nodeValue();
-	    }
-	    return ret;
-	}
-	else
-	    return firstChild()->nodeValue();
+    if (firstChild() && firstChild()->nodeType() == Node::TEXT_NODE && !firstChild()->nextSibling())
+        return firstChild()->nodeValue();
+
+    DOMString ret = "";
+    NodeImpl *n = firstChild();
+    for (; n; n = n->nextSibling()) {
+        if (n->nodeType() == Node::TEXT_NODE ||
+            n->nodeType() == Node::CDATA_SECTION_NODE)
+            ret += n->nodeValue();
     }
-    return "";
+    return ret;
 }
 
 long HTMLOptionElementImpl::index() const
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic