Changeset 62016 in webkit
- Timestamp:
- Jun 28, 2010 10:00:39 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r62015 r62016 1 2010-06-28 Robin Cao <robin.cao@torchmobile.com.cn> 2 3 Reviewed by Dan Bernstein. 4 5 canvas fillText with @font-face crashes 6 https://bugs.webkit.org/show_bug.cgi?id=35486 7 8 The font object in CanvasRenderingContext2D may become invalid at some point. 9 Override recalcStyle() in HTMLCanvasElement, and update the font object from there if needed. 10 11 A test already exists: canvas/philip/tests/2d.text.draw.fontface.repeat.html 12 13 * html/HTMLCanvasElement.cpp: 14 (WebCore::HTMLCanvasElement::recalcStyle): 15 * html/HTMLCanvasElement.h: 16 * html/canvas/CanvasRenderingContext2D.cpp: 17 (WebCore::CanvasRenderingContext2D::updateFont): 18 * html/canvas/CanvasRenderingContext2D.h: 19 1 20 2010-06-28 Lucas De Marchi <lucas.demarchi@profusion.mobi> 2 21 -
trunk/WebCore/html/HTMLCanvasElement.cpp
r61293 r62016 2 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 4 5 * 5 6 * Redistribution and use in source and binary forms, with or without … … 279 280 #endif 280 281 281 } 282 void HTMLCanvasElement::recalcStyle(StyleChange change) 283 { 284 HTMLElement::recalcStyle(change); 285 286 // Update font if needed. 287 if (change == Force && m_context && m_context->is2d()) { 288 CanvasRenderingContext2D* ctx = static_cast<CanvasRenderingContext2D*>(m_context.get()); 289 ctx->updateFont(); 290 } 291 } 292 293 } -
trunk/WebCore/html/HTMLCanvasElement.h
r60342 r62016 2 2 * Copyright (C) 2004, 2006, 2009, 2010 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 4 5 * 5 6 * Redistribution and use in source and binary forms, with or without … … 102 103 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 103 104 105 virtual void recalcStyle(StyleChange); 106 104 107 void reset(); 105 108 -
trunk/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r61970 r62016 5 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 6 6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> 7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 7 8 * 8 9 * Redistribution and use in source and binary forms, with or without … … 1502 1503 state().m_realizedFont = true; 1503 1504 } 1504 1505 1506 void CanvasRenderingContext2D::updateFont() 1507 { 1508 if (!state().m_realizedFont) 1509 return; 1510 1511 const Font& font = state().m_font; 1512 font.update(font.fontSelector()); 1513 } 1514 1505 1515 String CanvasRenderingContext2D::textAlign() const 1506 1516 { -
trunk/WebCore/html/canvas/CanvasRenderingContext2D.h
r61877 r62016 194 194 String font() const; 195 195 void setFont(const String&); 196 void updateFont(); 196 197 197 198 String textAlign() const;
Note: See TracChangeset
for help on using the changeset viewer.