Changeset 1912
- Timestamp:
- 08/24/02 23:41:13 (6 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 5 modified
-
ChangeLog-2002-12-03 (modified) (1 diff)
-
ChangeLog-2003-10-25 (modified) (1 diff)
-
ChangeLog-2005-08-23 (modified) (1 diff)
-
khtml/css/css_valueimpl.cpp (modified) (1 diff)
-
kwq/KWQString.mm (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog-2002-12-03
r1910 r1912 1 2002-08-24 Darin Adler <darin@apple.com> 2 3 - fixed 3032072 -- Crash on reload in DOM::DocumentImpl::~DocumentImpl [unified]() 4 5 This was a tough one to debug. 6 Turned out to be a subtle bug in our new QConstString implementation. 7 8 * kwq/KWQString.mm: 9 (QStringData::makeAscii): Don't invalidate the Unicode buffer unless the ASCII 10 buffer is taking over the internal buffer from the Unicode. In other cases, it's 11 important not to invalidate the Unicode because it can result in the Unicode being 12 freed and re-created when unicode() is called, which is disastrous in the QConstString 13 case because we can't free the Unicode. 14 (QStringData::makeUnicode): Make the corresponding change for ASCII too. In this 15 case, it's just an optimization, not a bug fix. 16 (QString::insert), (QString::remove), (QString::fill), (QString::operator+=): 17 Mark the other string invalid whenever we modify either the ASCII or the Unicode 18 string. This was handled correctly for some operations before, but not all, and it 19 now matters because makeAscii and makeUnicode will now allow this state. 20 21 Fixed a separate QString problem; I think I may have introduced this one. 22 23 * kwq/KWQString.mm: 24 (QString::getNSString): Since by ASCII, we actually mean ISO Latin 1, we can't use 25 [NSString stringWithCString:]. Use CFStringCreateWithCString instead, pass 26 CFStringCreateWithCString as the encoding, and use autorelease. We shouldn't really 27 use the term ASCII in this class for the 8-bit-per-character buffer. Something more 28 like Latin1 would be a more accurate way to refer to it. Maybe I'll do that renaming 29 after talking to Richard about it on Monday. 30 31 Fixed a small storage leak. 32 33 * khtml/css/css_valueimpl.cpp: (CSSPrimitiveValueImpl::cleanup): Added braces to 34 fix obviously-incorrect if/else grouping. 35 1 36 2002-08-23 Darin Adler <darin@apple.com> 2 37 -
trunk/WebCore/ChangeLog-2003-10-25
r1910 r1912 1 2002-08-24 Darin Adler <darin@apple.com> 2 3 - fixed 3032072 -- Crash on reload in DOM::DocumentImpl::~DocumentImpl [unified]() 4 5 This was a tough one to debug. 6 Turned out to be a subtle bug in our new QConstString implementation. 7 8 * kwq/KWQString.mm: 9 (QStringData::makeAscii): Don't invalidate the Unicode buffer unless the ASCII 10 buffer is taking over the internal buffer from the Unicode. In other cases, it's 11 important not to invalidate the Unicode because it can result in the Unicode being 12 freed and re-created when unicode() is called, which is disastrous in the QConstString 13 case because we can't free the Unicode. 14 (QStringData::makeUnicode): Make the corresponding change for ASCII too. In this 15 case, it's just an optimization, not a bug fix. 16 (QString::insert), (QString::remove), (QString::fill), (QString::operator+=): 17 Mark the other string invalid whenever we modify either the ASCII or the Unicode 18 string. This was handled correctly for some operations before, but not all, and it 19 now matters because makeAscii and makeUnicode will now allow this state. 20 21 Fixed a separate QString problem; I think I may have introduced this one. 22 23 * kwq/KWQString.mm: 24 (QString::getNSString): Since by ASCII, we actually mean ISO Latin 1, we can't use 25 [NSString stringWithCString:]. Use CFStringCreateWithCString instead, pass 26 CFStringCreateWithCString as the encoding, and use autorelease. We shouldn't really 27 use the term ASCII in this class for the 8-bit-per-character buffer. Something more 28 like Latin1 would be a more accurate way to refer to it. Maybe I'll do that renaming 29 after talking to Richard about it on Monday. 30 31 Fixed a small storage leak. 32 33 * khtml/css/css_valueimpl.cpp: (CSSPrimitiveValueImpl::cleanup): Added braces to 34 fix obviously-incorrect if/else grouping. 35 1 36 2002-08-23 Darin Adler <darin@apple.com> 2 37 -
trunk/WebCore/ChangeLog-2005-08-23
r1910 r1912 1 2002-08-24 Darin Adler <darin@apple.com> 2 3 - fixed 3032072 -- Crash on reload in DOM::DocumentImpl::~DocumentImpl [unified]() 4 5 This was a tough one to debug. 6 Turned out to be a subtle bug in our new QConstString implementation. 7 8 * kwq/KWQString.mm: 9 (QStringData::makeAscii): Don't invalidate the Unicode buffer unless the ASCII 10 buffer is taking over the internal buffer from the Unicode. In other cases, it's 11 important not to invalidate the Unicode because it can result in the Unicode being 12 freed and re-created when unicode() is called, which is disastrous in the QConstString 13 case because we can't free the Unicode. 14 (QStringData::makeUnicode): Make the corresponding change for ASCII too. In this 15 case, it's just an optimization, not a bug fix. 16 (QString::insert), (QString::remove), (QString::fill), (QString::operator+=): 17 Mark the other string invalid whenever we modify either the ASCII or the Unicode 18 string. This was handled correctly for some operations before, but not all, and it 19 now matters because makeAscii and makeUnicode will now allow this state. 20 21 Fixed a separate QString problem; I think I may have introduced this one. 22 23 * kwq/KWQString.mm: 24 (QString::getNSString): Since by ASCII, we actually mean ISO Latin 1, we can't use 25 [NSString stringWithCString:]. Use CFStringCreateWithCString instead, pass 26 CFStringCreateWithCString as the encoding, and use autorelease. We shouldn't really 27 use the term ASCII in this class for the 8-bit-per-character buffer. Something more 28 like Latin1 would be a more accurate way to refer to it. Maybe I'll do that renaming 29 after talking to Richard about it on Monday. 30 31 Fixed a small storage leak. 32 33 * khtml/css/css_valueimpl.cpp: (CSSPrimitiveValueImpl::cleanup): Added braces to 34 fix obviously-incorrect if/else grouping. 35 1 36 2002-08-23 Darin Adler <darin@apple.com> 2 37 -
trunk/WebCore/khtml/css/css_valueimpl.cpp
r1655 r1912 372 372 { } 373 373 else if(m_type < CSSPrimitiveValue::CSS_COUNTER) 374 if(m_value.string) m_value.string->deref();374 { if(m_value.string) m_value.string->deref(); } 375 375 else if(m_type == CSSPrimitiveValue::CSS_COUNTER) 376 376 m_value.counter->deref(); -
trunk/WebCore/kwq/KWQString.mm
r1903 r1912 596 596 *tp++ = *fp++; 597 597 str = ©Buf[0]; 598 _isUnicodeValid = 0; 598 599 } 599 600 else … … 616 617 *cp = 0; 617 618 618 _isUnicodeValid = 0;619 619 _isAsciiValid = 1; 620 620 } … … 644 644 *tp++ = *fp++; 645 645 str = ©Buf[0]; 646 _isAsciiValid = 0; 646 647 } 647 648 else … … 663 664 664 665 _isUnicodeValid = 1; 665 _isAsciiValid = 0;666 666 } 667 667 else if (!_isUnicodeValid) … … 778 778 779 779 if (dataHandle[0]->_isAsciiValid) { 780 return [ NSString stringWithCString:(const char *)ascii()];780 return [(NSString *)CFStringCreateWithCString(kCFAllocatorDefault, ascii(), kCFStringEncodingISOLatin1) autorelease]; 781 781 } 782 782 … … 2062 2062 // Insert characters. 2063 2063 memcpy (targetChars+index, insertChars, insertLength); 2064 2065 dataHandle[0]->_isUnicodeValid = 0; 2064 2066 } 2065 2067 else if (dataHandle[0]->_isUnicodeValid){ … … 2128 2130 } 2129 2131 2132 dataHandle[0]->_isAsciiValid = 0; 2130 2133 } 2131 2134 … … 2153 2156 targetChars[index] = insertChar; 2154 2157 targetChars[dataHandle[0]->_length] = 0; 2158 2159 dataHandle[0]->_isUnicodeValid = 0; 2155 2160 } 2156 2161 else { … … 2191 2196 targetChars[index] = ch; 2192 2197 targetChars[dataHandle[0]->_length] = 0; 2198 2199 dataHandle[0]->_isUnicodeValid = 0; 2193 2200 } 2194 2201 else if (dataHandle[0]->_isUnicodeValid){ … … 2292 2299 sizeof(char)*(olen-index-len) ); 2293 2300 setLength( olen-len ); 2301 dataHandle[0]->_isUnicodeValid = 0; 2294 2302 } 2295 2303 else if (dataHandle[0]->_isUnicodeValid){ … … 2417 2425 while (len--) 2418 2426 *nd++ = (char)qc; 2427 dataHandle[0]->_isUnicodeValid = 0; 2419 2428 } 2420 2429 else { … … 2461 2470 QSTRING_FAILURE("invalid character cache"); 2462 2471 dataHandle[0]->_length += qs.data()->_length; 2472 dataHandle[0]->_isAsciiValid = 0; 2463 2473 return *this; 2464 2474 } … … 2471 2481 *tp = 0; 2472 2482 dataHandle[0]->_length += qs.data()->_length; 2483 dataHandle[0]->_isUnicodeValid = 0; 2473 2484 return *this; 2474 2485 }