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

Unified Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 2350163002: Prevent LayoutTest setting -1 page scale factor. (Closed)
Patch Set: Apply the comments. Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/testing/Internals.cpp
diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp
index 5420021b8ae163c2b7c9301edd74d4f079612e0b..50c5e1b56a560945c6d539674bd95fd56cad5717 100644
--- a/third_party/WebKit/Source/core/testing/Internals.cpp
+++ b/third_party/WebKit/Source/core/testing/Internals.cpp
@@ -1878,6 +1878,8 @@ float Internals::pageScaleFactor(ExceptionState& exceptionState)
void Internals::setPageScaleFactor(float scaleFactor, ExceptionState& exceptionState)
{
+ if (scaleFactor <= 0)
+ return;
Document* document = contextDocument();
if (!document || !document->page()) {
exceptionState.throwDOMException(InvalidAccessError, document ? "The document's page cannot be retrieved." : "No context document can be obtained.");
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698