Changeset 273512 in webkit
- Timestamp:
- Feb 25, 2021, 2:14:16 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/text/canvas-font-resolution-2-expected.html (added)
-
LayoutTests/fast/text/canvas-font-resolution-2.html (added)
-
LayoutTests/fast/text/canvas-font-resolution-expected.txt (added)
-
LayoutTests/fast/text/canvas-font-resolution.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (modified) (2 diffs)
-
Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h (modified) (1 diff)
-
Source/WebCore/style/StyleResolveForFontRaw.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r273507 r273512 1 2021-02-25 Myles C. Maxfield <mmaxfield@apple.com> 2 3 REGRESSION(r269957): Empty font names passed to canvas2d cause all text routines to crash 4 https://bugs.webkit.org/show_bug.cgi?id=222402 5 <rdar://problem/72621268> 6 7 Reviewed by Darin Adler and Chris Lord. 8 9 * fast/text/canvas-font-resolution-2-expected.html: Added. 10 * fast/text/canvas-font-resolution-2.html: Added. 11 * fast/text/canvas-font-resolution-expected.txt: Added. 12 * fast/text/canvas-font-resolution.html: Added. 13 1 14 2021-02-25 Amir Mark Jr <amir_mark@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r273511 r273512 1 2021-02-25 Myles C. Maxfield <mmaxfield@apple.com> 2 3 REGRESSION(r269957): Empty font names passed to canvas2d cause all text routines to crash 4 https://bugs.webkit.org/show_bug.cgi?id=222402 5 <rdar://problem/72621268> 6 7 Reviewed by Darin Adler and Chris Lord. 8 9 It looks like it was simply an oversight from that patch. If the font name is empty, 10 CanvasRenderingContext2D::setFont() will set the font object to one that doesn't have 11 its internal FontCascadeFonts pointer set. 12 13 Tests: fast/text/canvas-font-resolution-2.html 14 fast/text/canvas-font-resolution.html 15 16 * html/canvas/CanvasRenderingContext2D.cpp: 17 (WebCore::CanvasRenderingContext2D::setFont): 18 * html/canvas/CanvasRenderingContext2DBase.h: 19 (WebCore::CanvasRenderingContext2DBase::FontProxy::isPopulated const): 20 * style/StyleResolveForFontRaw.cpp: 21 (WebCore::Style::resolveForFontRaw): 22 1 23 2021-02-25 Alex Christensen <achristensen@webkit.org> 2 24 -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r270197 r273512 113 113 return; 114 114 115 // The parse succeeded.116 String newFontSafeCopy(newFont); // Create a string copy since newFont can be deleted inside realizeSaves.117 realizeSaves();118 modifiableState().unparsedFont = newFontSafeCopy;119 120 115 // Map the <canvas> font into the text style. If the font uses keywords like larger/smaller, these will work 121 116 // relative to the canvas. … … 132 127 } 133 128 134 if (auto fontStyle = Style::resolveForFontRaw(*fontRaw, WTFMove(fontDescription), document)) 135 modifiableState().font.initialize(document.fontSelector(), *fontStyle); 129 auto fontStyle = Style::resolveForFontRaw(*fontRaw, WTFMove(fontDescription), document); 130 if (!fontStyle) 131 return; 132 133 String newFontSafeCopy(newFont); // Create a string copy since newFont can be deleted inside realizeSaves. 134 realizeSaves(); 135 modifiableState().unparsedFont = newFontSafeCopy; 136 137 modifiableState().font.initialize(document.fontSelector(), *fontStyle); 138 ASSERT(state().font.realized()); 139 ASSERT(state().font.isPopulated()); 136 140 } 137 141 -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.h
r271646 r273512 242 242 void drawBidiText(GraphicsContext&, const TextRun&, const FloatPoint&, FontCascade::CustomFontNotReadyAction) const; 243 243 244 #if ASSERT_ENABLED 245 bool isPopulated() const { return m_font.fonts(); } 246 #endif 247 244 248 private: 245 249 void update(FontSelector&); -
trunk/Source/WebCore/style/StyleResolveForFontRaw.cpp
r272805 r273512 74 74 switchOn(item, [&] (CSSValueID ident) { 75 75 isGenericFamily = ident != CSSValueWebkitBody; 76 family = isGenericFamily ? CSSPropertyParserHelpers::genericFontFamilyFromValueID(ident) 77 : AtomString(document.settings().standardFontFamily()); 76 family = isGenericFamily ? CSSPropertyParserHelpers::genericFontFamilyFromValueID(ident) : AtomString(document.settings().standardFontFamily()); 78 77 }, [&] (const String& familyString) { 79 78 family = familyString;
Note:
See TracChangeset
for help on using the changeset viewer.