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

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

Issue 2350163002: Prevent LayoutTest setting -1 page scale factor. (Closed)
Patch Set: Prevent test from setting -1 page scale factor. 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 | « third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-invalid-page-scale-factor-expected.txt ('k') | 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..81cfd730be6f005f1c8046781db9011928180900 100644
--- a/third_party/WebKit/Source/core/testing/Internals.cpp
+++ b/third_party/WebKit/Source/core/testing/Internals.cpp
@@ -1878,6 +1878,10 @@ float Internals::pageScaleFactor(ExceptionState& exceptionState)
void Internals::setPageScaleFactor(float scaleFactor, ExceptionState& exceptionState)
{
+ // -1 is the initial value of page scale factor in blink, it should never be
+ // set by external methods.
+ if (scaleFactor == -1)
bokan 2016/09/20 17:32:09 it's not the initial value. It's a value used by t
sunxd 2016/09/20 17:47:10 Done.
+ 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 | « third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-invalid-page-scale-factor-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698