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

Unified Diff: Source/core/html/HTMLCanvasElement.cpp

Issue 1350883002: Fix bug where setting canvas size to 0 was treated as if context was lost (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix layout test Created 5 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-lose-restore-googol-size.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLCanvasElement.cpp
diff --git a/Source/core/html/HTMLCanvasElement.cpp b/Source/core/html/HTMLCanvasElement.cpp
index 6dc6f92d1556336a741cd0d237d79c7bb972ab68..fc74f13b75eaf385ef5ef2d985b8cbc77280ab6c 100644
--- a/Source/core/html/HTMLCanvasElement.cpp
+++ b/Source/core/html/HTMLCanvasElement.cpp
@@ -692,7 +692,7 @@ PassOwnPtr<ImageBufferSurface> HTMLCanvasElement::createImageBufferSurface(const
void HTMLCanvasElement::createImageBuffer()
{
createImageBufferInternal(nullptr);
- if (m_didFailToCreateImageBuffer && m_context->is2d())
+ if (m_didFailToCreateImageBuffer && m_context->is2d() && !size().isEmpty())
m_context->loseContext(CanvasRenderingContext::SyntheticLostContext);
}
« no previous file with comments | « LayoutTests/fast/canvas/canvas-lose-restore-googol-size.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698