Changeset 184003 in webkit
- Timestamp:
- May 8, 2015, 12:01:03 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
-
Source/WTF/ChangeLog (modified) (1 diff)
-
Source/WTF/wtf/text/StringView.h (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/CSSPrimitiveValue.cpp (modified) (1 diff)
-
Source/WebCore/platform/graphics/StringTruncator.cpp (modified) (1 diff)
-
Source/WebCore/platform/graphics/TextRun.h (modified) (2 diffs)
-
Source/WebCore/platform/mac/DragImageMac.mm (modified) (2 diffs)
-
Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/TextPainter.cpp (modified) (2 diffs)
-
Source/WebKit/mac/ChangeLog (modified) (1 diff)
-
Source/WebKit/mac/Misc/WebKitNSStringExtras.mm (modified) (2 diffs)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WTF/StringView.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r183996 r184003 1 2015-05-08 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r183996. 4 https://bugs.webkit.org/show_bug.cgi?id=144806 5 6 ASan detected use-after free (Requested by ap on #webkit). 7 8 Reverted changeset: 9 10 "Remove convenience constructors for TextRun" 11 https://bugs.webkit.org/show_bug.cgi?id=144752 12 http://trac.webkit.org/changeset/183996 13 1 14 2015-05-08 Myles C. Maxfield <mmaxfield@apple.com> 2 15 -
trunk/Source/WTF/wtf/text/StringView.h
r183996 r184003 59 59 StringView(const String&); 60 60 StringView(const StringImpl&); 61 StringView(const StringImpl*);62 61 StringView(const LChar*, unsigned length); 63 62 StringView(const UChar*, unsigned length); … … 271 270 else 272 271 initialize(string.characters16(), string.length()); 273 }274 275 inline StringView::StringView(const StringImpl* string)276 {277 if (!string)278 return;279 280 setUnderlyingString(string);281 if (string->is8Bit())282 initialize(string->characters8(), string->length());283 else284 initialize(string->characters16(), string->length());285 272 } 286 273 -
trunk/Source/WebCore/ChangeLog
r184001 r184003 1 2015-05-08 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r183996. 4 https://bugs.webkit.org/show_bug.cgi?id=144806 5 6 ASan detected use-after free (Requested by ap on #webkit). 7 8 Reverted changeset: 9 10 "Remove convenience constructors for TextRun" 11 https://bugs.webkit.org/show_bug.cgi?id=144752 12 http://trac.webkit.org/changeset/183996 13 1 14 2015-05-08 Eric Carlson <eric.carlson@apple.com> 2 15 -
trunk/Source/WebCore/css/CSSPrimitiveValue.cpp
r183996 r184003 1052 1052 result.reserveCapacity(6 + m_value.string->length()); 1053 1053 result.appendLiteral("attr("); 1054 result.append( String(m_value.string));1054 result.append(m_value.string); 1055 1055 result.append(')'); 1056 1056 -
trunk/Source/WebCore/platform/graphics/StringTruncator.cpp
r183996 r184003 195 195 static float stringWidth(const FontCascade& renderer, const UChar* characters, unsigned length, bool disableRoundingHacks) 196 196 { 197 TextRun run( StringView(characters, length));197 TextRun run(characters, length); 198 198 if (disableRoundingHacks) 199 199 run.disableRoundingHacks(); -
trunk/Source/WebCore/platform/graphics/TextRun.h
r183996 r184003 53 53 typedef unsigned RoundingHacks; 54 54 55 explicit TextRun(StringView text, float xpos = 0, float expansion = 0, ExpansionBehavior expansionBehavior = AllowTrailingExpansion | ForbidLeadingExpansion, TextDirection direction = LTR, bool directionalOverride = false, bool characterScanForCodePath = true, RoundingHacks roundingHacks = RunRounding | WordRounding)56 : m_text( text)57 , m_charactersLength( text.length())55 explicit TextRun(StringView s, float xpos = 0, float expansion = 0, ExpansionBehavior expansionBehavior = AllowTrailingExpansion | ForbidLeadingExpansion, TextDirection direction = LTR, bool directionalOverride = false, bool characterScanForCodePath = true, RoundingHacks roundingHacks = RunRounding | WordRounding) 56 : m_text(s) 57 , m_charactersLength(s.length()) 58 58 , m_tabSize(0) 59 59 , m_xpos(xpos) … … 71 71 } 72 72 73 explicit TextRun(const String& s) 74 : TextRun(StringView(s)) 75 { 76 } 77 78 TextRun(const LChar* c, unsigned len) 79 : TextRun(StringView(c, len)) 80 { 81 } 82 83 TextRun(const UChar* c, unsigned len) 84 : TextRun(StringView(c, len)) 85 { 86 } 87 73 88 TextRun subRun(unsigned startOffset, unsigned length) const 74 89 { -
trunk/Source/WebCore/platform/mac/DragImageMac.mm
r183996 r184003 193 193 if (canUseFastRenderer(buffer.data(), length)) { 194 194 FontCascade webCoreFont(FontPlatformData(reinterpret_cast<CTFontRef>(font), [font pointSize])); 195 TextRun run( StringView(buffer.data(), length));195 TextRun run(buffer.data(), length); 196 196 run.disableRoundingHacks(); 197 197 return webCoreFont.width(run); … … 225 225 226 226 FontCascade webCoreFont(FontPlatformData(reinterpret_cast<CTFontRef>(font), [font pointSize]), Antialiased); 227 TextRun run( StringView(buffer.data(), length));227 TextRun run(buffer.data(), length); 228 228 run.disableRoundingHacks(); 229 229 -
trunk/Source/WebCore/rendering/SimpleLineLayoutTextFragmentIterator.cpp
r183996 r184003 41 41 , wrapLines(style.autoWrap()) 42 42 , breakWordOnOverflow(style.overflowWrap() == BreakOverflowWrap && (wrapLines || preserveNewline)) 43 , spaceWidth(font.width(TextRun( StringView(&space, 1))))43 , spaceWidth(font.width(TextRun(&space, 1))) 44 44 , tabWidth(collapseWhitespace ? 0 : style.tabSize()) 45 45 , locale(style.locale()) … … 198 198 if (measureWithEndSpace) 199 199 ++segmentTo; 200 TextRun run( StringView(segment.text.substring(segmentFrom, segmentTo - segmentFrom)));200 TextRun run(segment.text.characters<CharacterType>() + segmentFrom, segmentTo - segmentFrom); 201 201 run.setXPos(xPosition); 202 202 run.setTabSize(!!m_style.tabWidth, m_style.tabWidth); -
trunk/Source/WebCore/rendering/TextPainter.cpp
r183996 r184003 171 171 updateGraphicsContext(m_context, m_textPaintStyle, UseEmphasisMarkColor); 172 172 173 static NeverDestroyed<TextRun> objectReplacementCharacterTextRun( StringView(&objectReplacementCharacter, 1));173 static NeverDestroyed<TextRun> objectReplacementCharacterTextRun(&objectReplacementCharacter, 1); 174 174 TextRun& emphasisMarkTextRun = m_combinedText ? objectReplacementCharacterTextRun.get() : m_textRun; 175 175 FloatPoint emphasisMarkTextOrigin = m_combinedText ? FloatPoint(boxOrigin.x() + m_boxRect.width() / 2, boxOrigin.y() + m_font.fontMetrics().ascent()) : m_textOrigin; … … 197 197 updateGraphicsContext(m_context, m_selectionPaintStyle, UseEmphasisMarkColor); 198 198 199 DEPRECATED_DEFINE_STATIC_LOCAL(TextRun, objectReplacementCharacterTextRun, ( StringView(&objectReplacementCharacter, 1)));199 DEPRECATED_DEFINE_STATIC_LOCAL(TextRun, objectReplacementCharacterTextRun, (&objectReplacementCharacter, 1)); 200 200 TextRun& emphasisMarkTextRun = m_combinedText ? objectReplacementCharacterTextRun : m_textRun; 201 201 FloatPoint emphasisMarkTextOrigin = m_combinedText ? FloatPoint(boxOrigin.x() + m_boxRect.width() / 2, boxOrigin.y() + m_font.fontMetrics().ascent()) : m_textOrigin; -
trunk/Source/WebKit/mac/ChangeLog
r183996 r184003 1 2015-05-08 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r183996. 4 https://bugs.webkit.org/show_bug.cgi?id=144806 5 6 ASan detected use-after free (Requested by ap on #webkit). 7 8 Reverted changeset: 9 10 "Remove convenience constructors for TextRun" 11 https://bugs.webkit.org/show_bug.cgi?id=144752 12 http://trac.webkit.org/changeset/183996 13 1 14 2015-05-08 Myles C. Maxfield <mmaxfield@apple.com> 2 15 -
trunk/Source/WebKit/mac/Misc/WebKitNSStringExtras.mm
r183996 r184003 94 94 95 95 FontCascade webCoreFont(FontPlatformData(reinterpret_cast<CTFontRef>(font), [font pointSize]), fontSmoothingIsAllowed ? AutoSmoothing : Antialiased); 96 TextRun run( StringView(buffer.data(), length));96 TextRun run(buffer.data(), length); 97 97 run.disableRoundingHacks(); 98 98 … … 140 140 if (canUseFastRenderer(buffer.data(), length)) { 141 141 FontCascade webCoreFont(FontPlatformData(reinterpret_cast<CTFontRef>(font), [font pointSize])); 142 TextRun run( StringView(buffer.data(), length));142 TextRun run(buffer.data(), length); 143 143 run.disableRoundingHacks(); 144 144 return webCoreFont.width(run); -
trunk/Tools/ChangeLog
r183996 r184003 1 2015-05-08 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, rolling out r183996. 4 https://bugs.webkit.org/show_bug.cgi?id=144806 5 6 ASan detected use-after free (Requested by ap on #webkit). 7 8 Reverted changeset: 9 10 "Remove convenience constructors for TextRun" 11 https://bugs.webkit.org/show_bug.cgi?id=144752 12 http://trac.webkit.org/changeset/183996 13 1 14 2015-05-08 Myles C. Maxfield <mmaxfield@apple.com> 2 15 -
trunk/Tools/TestWebKitAPI/Tests/WTF/StringView.cpp
r183996 r184003 698 698 } 699 699 700 TEST(WTF, StringView8Bit)701 {702 StringView nullView;703 StringView emptyView = StringView::empty();704 EXPECT_TRUE(StringView().is8Bit());705 EXPECT_TRUE(StringView::empty().is8Bit());706 707 LChar* lcharPtr = nullptr;708 UChar* ucharPtr = nullptr;709 EXPECT_TRUE(StringView(lcharPtr, 0).is8Bit());710 EXPECT_FALSE(StringView(ucharPtr, 0).is8Bit());711 712 EXPECT_TRUE(StringView(String(lcharPtr, 0)).is8Bit());713 EXPECT_TRUE(StringView(String(ucharPtr, 0)).is8Bit());714 715 EXPECT_TRUE(StringView(String().impl()).is8Bit());716 EXPECT_TRUE(StringView(emptyString().impl()).is8Bit());717 }718 719 700 } // namespace TestWebKitAPI
Note:
See TracChangeset
for help on using the changeset viewer.