Changeset 142863 in webkit
- Timestamp:
- Feb 14, 2013 2:23:17 AM (11 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r142810 r142863 1 2013-02-14 Eric Seidel <eric@webkit.org> 2 3 REGRESSION(r142712): attribute values show up as "(null)" instead of null with the threaded parser 4 https://bugs.webkit.org/show_bug.cgi?id=109784 5 6 Reviewed by Benjamin Poulain. 7 8 When I changed many callsites to use the (existing) String(Vector) constructor 9 I inadvertantly made those callsites convert empty vectors to null strings 10 instead of empty strings (like String(UChar,size_t) does). 11 12 This is due to an oddity/bug in our Vector implementation where data() 13 will be 0 if the Vector is empty, but only if it doesn't have inline capacity. 14 https://bugs.webkit.org/show_bug.cgi?id=109792 15 16 This changes String(Vector) to exactly match the behavior of String(vector.data(), vector.size()). 17 18 This regression was easily detectable with the threaded parser, because we use String 19 instead of AtomicString in our CompactToken (used to send the Token data 20 between threads). The main-thread parser path uses AtomicHTMLToken which 21 uses AtomicString(Vector) and does not have this bug. 22 23 * wtf/text/WTFString.h: 24 (String): 25 (WTF::String::String): 26 1 27 2013-02-13 Zan Dobersek <zdobersek@igalia.com> 2 28 -
trunk/Source/WTF/wtf/text/WTFString.h
r142689 r142863 111 111 // Construct a string by copying the contents of a vector. To avoid 112 112 // copying, consider using String::adopt instead. 113 // CAUTION: Vectors with size 0 will return empty strings if they have inlineCapacity 114 // and null strings if they don't. This is due to https://bugs.webkit.org/show_bug.cgi?id=109792 115 // and is done to match String(UChar*, size_t) behavior. 113 116 template<size_t inlineCapacity> 114 117 explicit String(const Vector<UChar, inlineCapacity>&); … … 536 539 template<size_t inlineCapacity> 537 540 String::String(const Vector<UChar, inlineCapacity>& vector) 538 : m_impl(vector. size() ? StringImpl::create(vector.data(), vector.size()) : 0)541 : m_impl(vector.data() ? StringImpl::create(vector.data(), vector.size()) : 0) 539 542 { 540 543 }
Note: See TracChangeset
for help on using the changeset viewer.