Title: [140485] trunk/Source/WebCore
Revision
140485
Author
[email protected]
Date
2013-01-22 16:06:35 -0800 (Tue, 22 Jan 2013)

Log Message

Fix assertions in make8BitFrom16BitSource() with threaded parser
https://bugs.webkit.org/show_bug.cgi?id=107596

Reviewed by Adam Barth.

This fixes an assertion in several fast/parser tests. We need to keep track of whether the data is all 8bit.
Luckily this doesn't cost us any size on CompactHTMLToken because the bitfields are collapsed (verified by COMPILE_ASSERT).

No new tests because covered by existing fast/parser tests.

* html/parser/CompactHTMLToken.cpp:
(WebCore::CompactHTMLToken::CompactHTMLToken):
* html/parser/CompactHTMLToken.h:
(WebCore::CompactHTMLToken::isAll8BitData):
(CompactHTMLToken):
* html/parser/HTMLToken.h:
(WebCore::AtomicHTMLToken::AtomicHTMLToken):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (140484 => 140485)


--- trunk/Source/WebCore/ChangeLog	2013-01-23 00:03:01 UTC (rev 140484)
+++ trunk/Source/WebCore/ChangeLog	2013-01-23 00:06:35 UTC (rev 140485)
@@ -1,5 +1,25 @@
 2013-01-22  Tony Gentilcore  <[email protected]>
 
+        Fix assertions in make8BitFrom16BitSource() with threaded parser
+        https://bugs.webkit.org/show_bug.cgi?id=107596
+
+        Reviewed by Adam Barth.
+
+        This fixes an assertion in several fast/parser tests. We need to keep track of whether the data is all 8bit.
+        Luckily this doesn't cost us any size on CompactHTMLToken because the bitfields are collapsed (verified by COMPILE_ASSERT).
+
+        No new tests because covered by existing fast/parser tests.
+
+        * html/parser/CompactHTMLToken.cpp:
+        (WebCore::CompactHTMLToken::CompactHTMLToken):
+        * html/parser/CompactHTMLToken.h:
+        (WebCore::CompactHTMLToken::isAll8BitData):
+        (CompactHTMLToken):
+        * html/parser/HTMLToken.h:
+        (WebCore::AtomicHTMLToken::AtomicHTMLToken):
+
+2013-01-22  Tony Gentilcore  <[email protected]>
+
         Fix ASSERT(!hasInsertionPoint()) in threaded HTML parser
         https://bugs.webkit.org/show_bug.cgi?id=107593
 

Modified: trunk/Source/WebCore/html/parser/CompactHTMLToken.cpp (140484 => 140485)


--- trunk/Source/WebCore/html/parser/CompactHTMLToken.cpp	2013-01-23 00:03:01 UTC (rev 140484)
+++ trunk/Source/WebCore/html/parser/CompactHTMLToken.cpp	2013-01-23 00:06:35 UTC (rev 140485)
@@ -44,6 +44,7 @@
 
 CompactHTMLToken::CompactHTMLToken(const HTMLToken& token, const TextPosition& textPosition)
     : m_type(token.type())
+    , m_isAll8BitData(false)
     , m_textPosition(textPosition)
 {
     switch (m_type) {
@@ -71,9 +72,10 @@
         // Fall through!
     case HTMLTokenTypes::Comment:
     case HTMLTokenTypes::Character:
-        if (token.isAll8BitData())
+        if (token.isAll8BitData()) {
             m_data = String::make8BitFrom16BitSource(token.data().data(), token.data().size());
-        else
+            m_isAll8BitData = true;
+        } else
             m_data = String(token.data().data(), token.data().size());
         break;
     default:

Modified: trunk/Source/WebCore/html/parser/CompactHTMLToken.h (140484 => 140485)


--- trunk/Source/WebCore/html/parser/CompactHTMLToken.h	2013-01-23 00:03:01 UTC (rev 140484)
+++ trunk/Source/WebCore/html/parser/CompactHTMLToken.h	2013-01-23 00:06:35 UTC (rev 140485)
@@ -64,6 +64,7 @@
     HTMLTokenTypes::Type type() const { return static_cast<HTMLTokenTypes::Type>(m_type); }
     const String& data() const { return m_data; }
     bool selfClosing() const { return m_selfClosing; }
+    bool isAll8BitData() const { return m_isAll8BitData; }
     const Vector<CompactAttribute>& attributes() const { return m_attributes; }
     const TextPosition& textPosition() const { return m_textPosition; }
 
@@ -75,6 +76,7 @@
 private:
     unsigned m_type : 4;
     unsigned m_selfClosing : 1;
+    unsigned m_isAll8BitData : 1;
 
     String m_data; // "name", "characters", or "data" depending on m_type
     Vector<CompactAttribute> m_attributes;

Modified: trunk/Source/WebCore/html/parser/HTMLToken.h (140484 => 140485)


--- trunk/Source/WebCore/html/parser/HTMLToken.h	2013-01-23 00:03:01 UTC (rev 140484)
+++ trunk/Source/WebCore/html/parser/HTMLToken.h	2013-01-23 00:06:35 UTC (rev 140485)
@@ -242,6 +242,7 @@
         case HTMLTokenTypes::Character:
             m_externalCharacters = token.data().characters();
             m_externalCharactersLength = token.data().length();
+            m_isAll8BitData = token.isAll8BitData();
             break;
         default:
             break;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to