Changeset 140485 in webkit


Ignore:
Timestamp:
Jan 22, 2013 4:06:35 PM (11 years ago)
Author:
tonyg@chromium.org
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):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r140484 r140485  
     12013-01-22  Tony Gentilcore  <tonyg@chromium.org>
     2
     3        Fix assertions in make8BitFrom16BitSource() with threaded parser
     4        https://bugs.webkit.org/show_bug.cgi?id=107596
     5
     6        Reviewed by Adam Barth.
     7
     8        This fixes an assertion in several fast/parser tests. We need to keep track of whether the data is all 8bit.
     9        Luckily this doesn't cost us any size on CompactHTMLToken because the bitfields are collapsed (verified by COMPILE_ASSERT).
     10
     11        No new tests because covered by existing fast/parser tests.
     12
     13        * html/parser/CompactHTMLToken.cpp:
     14        (WebCore::CompactHTMLToken::CompactHTMLToken):
     15        * html/parser/CompactHTMLToken.h:
     16        (WebCore::CompactHTMLToken::isAll8BitData):
     17        (CompactHTMLToken):
     18        * html/parser/HTMLToken.h:
     19        (WebCore::AtomicHTMLToken::AtomicHTMLToken):
     20
    1212013-01-22  Tony Gentilcore  <tonyg@chromium.org>
    222
  • trunk/Source/WebCore/html/parser/CompactHTMLToken.cpp

    r140467 r140485  
    4545CompactHTMLToken::CompactHTMLToken(const HTMLToken& token, const TextPosition& textPosition)
    4646    : m_type(token.type())
     47    , m_isAll8BitData(false)
    4748    , m_textPosition(textPosition)
    4849{
     
    7273    case HTMLTokenTypes::Comment:
    7374    case HTMLTokenTypes::Character:
    74         if (token.isAll8BitData())
     75        if (token.isAll8BitData()) {
    7576            m_data = String::make8BitFrom16BitSource(token.data().data(), token.data().size());
    76         else
     77            m_isAll8BitData = true;
     78        } else
    7779            m_data = String(token.data().data(), token.data().size());
    7880        break;
  • trunk/Source/WebCore/html/parser/CompactHTMLToken.h

    r140478 r140485  
    6565    const String& data() const { return m_data; }
    6666    bool selfClosing() const { return m_selfClosing; }
     67    bool isAll8BitData() const { return m_isAll8BitData; }
    6768    const Vector<CompactAttribute>& attributes() const { return m_attributes; }
    6869    const TextPosition& textPosition() const { return m_textPosition; }
     
    7677    unsigned m_type : 4;
    7778    unsigned m_selfClosing : 1;
     79    unsigned m_isAll8BitData : 1;
    7880
    7981    String m_data; // "name", "characters", or "data" depending on m_type
  • trunk/Source/WebCore/html/parser/HTMLToken.h

    r140403 r140485  
    243243            m_externalCharacters = token.data().characters();
    244244            m_externalCharactersLength = token.data().length();
     245            m_isAll8BitData = token.isAll8BitData();
    245246            break;
    246247        default:
Note: See TracChangeset for help on using the changeset viewer.