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

Unified Diff: third_party/WebKit/Source/core/page/PrintContext.cpp

Issue 1558503003: Internals: throw an exception when page height or width is 0. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
Index: third_party/WebKit/Source/core/page/PrintContext.cpp
diff --git a/third_party/WebKit/Source/core/page/PrintContext.cpp b/third_party/WebKit/Source/core/page/PrintContext.cpp
index 3bcbfa79f16b12541ca8f852d6d8331f6617c75d..1dc1f198989279bbdc5d206ee72ab951aeda8567 100644
--- a/third_party/WebKit/Source/core/page/PrintContext.cpp
+++ b/third_party/WebKit/Source/core/page/PrintContext.cpp
@@ -150,6 +150,9 @@ void PrintContext::computePageRectsWithPageSizeInternal(const FloatSize& pageSiz
void PrintContext::begin(float width, float height)
{
+ ASSERT(width > 0);
+ ASSERT(height > 0);
+
// This function can be called multiple times to adjust printing parameters without going back to screen mode.
m_isPrinting = true;

Powered by Google App Engine
This is Rietveld 408576698