Index: Source/core/html/canvas/CanvasRenderingContext2D.cpp |
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp |
index 8825d1842718098d9dd353f2a3a8cc1a7ae9b5e0..c576916701b9bb45c9905610f317115943237bb9 100644 |
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp |
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp |
@@ -1950,6 +1950,7 @@ void CanvasRenderingContext2D::setFont(const String& newFont) |
// Map the <canvas> font into the text style. If the font uses keywords like larger/smaller, these will work |
// relative to the canvas. |
RefPtr<RenderStyle> newStyle = RenderStyle::create(); |
+ canvas()->document().updateRenderTreeIfNeeded(); |
if (RenderStyle* computedStyle = canvas()->computedStyle()) { |
FontDescription elementFontDescription(computedStyle->fontDescription()); |
// Reset the computed size to avoid inheriting the zoom factor from the <canvas> element. |