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

List:       kde-commits
Subject:    [kdelibs/KDE/4.7] khtml/html: Disallow XML-style flat tag for all
From:       Allan Sandfeld <kde () carewolf ! com>
Date:       2011-11-09 18:00:08
Message-ID: 20111109180008.2D22EA60A6 () git ! kde ! org
[Download RAW message or body]

Git commit db819299ed81466cb45b3fef69e8f489edbeeb30 by Allan Sandfeld.
Committed on 09/08/2011 at 16:53.
Pushed by carewolf into branch 'KDE/4.7'.

Disallow XML-style flat tag for all HTML tags except SCRIPT

The test was incomplete and allowed selfclosing HTML-tags such as <li/> and <td/>.

BUG: 136463

M  +4    -4    khtml/html/htmltokenizer.cpp

http://commits.kde.org/kdelibs/db819299ed81466cb45b3fef69e8f489edbeeb30

diff --git a/khtml/html/htmltokenizer.cpp b/khtml/html/htmltokenizer.cpp
index b64e83d..24fee18 100644
--- a/khtml/html/htmltokenizer.cpp
+++ b/khtml/html/htmltokenizer.cpp
@@ -1468,11 +1468,11 @@ void HTMLTokenizer::parseTag(TokenizerString &src)
 #if defined(TOKEN_DEBUG) && TOKEN_DEBUG > 0
             kDebug( 6036 ) << "appending Tag: " << tagID;
 #endif
-            // If the tag requires an end tag it cannot be flat,
-            // unless we are using the HTML parser to parse XHTML
-            // The only exception is SCRIPT and priority 0 tokens.
+            // When parsing HTML flat tags like <div /> should 
+	    // be ignored, the only exception is SCRIPT, and 
+	    // tags with forbidden end-tags
             if (tagID < ID_CLOSE_TAG && tagID != ID_SCRIPT &&
-                DOM::endTagRequirement(tagID) == DOM::REQUIRED &&
+                DOM::endTagRequirement(tagID) != DOM::FORBIDDEN &&
                 parser->doc()->htmlMode() != DocumentImpl::XHtml)
                 currToken.flat = false;
 

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

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