Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(674)

Unified Diff: Source/core/html/canvas/CanvasRenderingContext2D.cpp

Issue 552053003: CanvasRenderingContext2D should update the render tree to avoid stale computed style. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed unnecessary code from tests! Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/canvas/canvas-set-font-with-updated-style-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « LayoutTests/fast/canvas/canvas-set-font-with-updated-style-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698