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

List:       kde-commits
Subject:    KDE/kdelibs/khtml/html
From:       Germain Garand <germain () ebooksfrance ! org>
Date:       2010-01-18 4:21:51
Message-ID: 1263788511.305540.492.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1076387 by ggarand:

port patch from Alexey Proskuryakov <ap@apple.com>

"HTML tags are wrongfully parsed when setting innerHTML of a SCRIPT
 element"

WC/r53023/#32962/

 M  +7 -0      html_elementimpl.cpp  


--- trunk/KDE/kdelibs/khtml/html/html_elementimpl.cpp #1076386:1076387
@@ -508,6 +508,13 @@
 
 void HTMLElementImpl::setInnerHTML( const DOMString &html, int &exceptioncode )
 {
+    if (id() == ID_SCRIPT || id() == ID_STYLE) {
+        // Script and CSS source shouldn't be parsed as HTML.
+        removeChildren();
+        appendChild(document()->createTextNode(html), exceptioncode);
+        return;
+    }
+
     DocumentFragment fragment = createContextualFragment( html );
     if ( fragment.isNull() ) {
         exceptioncode = DOMException::NO_MODIFICATION_ALLOWED_ERR;
[prev in list] [next in list] [prev in thread] [next in thread] 

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