Changeset 31080 in webkit


Ignore:
Timestamp:
Mar 16, 2008 1:15:41 PM (16 years ago)
Author:
Darin Adler
Message:

2008-03-16 Darin Adler <Darin Adler>

Reviewed by Mitz.

This is causing intermittent crashes on some existing test cases on the buildbot
too; I don't have a 100% test case right now, but it should be easy to add one later
and this does fix a crash in a test we already have.

  • dom/CharacterData.cpp: (WebCore::CharacterData::CharacterData): Initialize m_data to the empty string, not the null string. The class assumes the string can never being null. (WebCore::CharacterData::setData): If asked to set the data to the null string, set it to the empty string instead. This matches what the (non-empty) constructor has always done.
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r31079 r31080  
     12008-03-16  Darin Adler  <darin@apple.com>
     2
     3        Reviewed by Mitz.
     4
     5        - fix http://bugs.webkit.org/show_bug.cgi?id=17876
     6          Attempting to visit Ofcom page causes crash
     7
     8        This is causing intermittent crashes on some existing test cases on the buildbot
     9        too; I don't have a 100% test case right now, but it should be easy to add one later
     10        and this does fix a crash in a test we already have.
     11
     12        * dom/CharacterData.cpp:
     13        (WebCore::CharacterData::CharacterData): Initialize m_data to the empty string,
     14        not the null string. The class assumes the string can never being null.
     15        (WebCore::CharacterData::setData): If asked to set the data to the null string,
     16        set it to the empty string instead. This matches what the (non-empty) constructor
     17        has always done.
     18
    1192008-03-15  Timothy Hatcher  <timothy@apple.com>
    220
  • trunk/WebCore/dom/CharacterData.cpp

    r31075 r31080  
    3636CharacterData::CharacterData(Document *doc)
    3737    : EventTargetNode(doc)
     38    , m_data(StringImpl::empty())
    3839{
    3940}
     
    5758    }
    5859
    59     if (equal(m_data.get(), data.impl()))
     60    StringImpl* dataImpl = data.impl() ? data.impl() : StringImpl::empty();
     61    if (equal(m_data.get(), dataImpl))
    6062        return;
    6163
    6264    int oldLength = length();
    6365    RefPtr<StringImpl> oldStr = m_data;
    64     m_data = data.impl();
     66    m_data = dataImpl;
    6567   
    6668    if ((!renderer() || !rendererIsNeeded(renderer()->style())) && attached()) {
Note: See TracChangeset for help on using the changeset viewer.