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

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

Issue 2320303002: Reset VisualViewport position after same page navigation (Closed)
Patch Set: update comment 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
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 c1649019cf2650b5694fe53b79a3a1cb984c5a5b..fafda870db862a92b1310a777d94075f5a160c63 100644
--- a/third_party/WebKit/Source/core/testing/Internals.cpp
+++ b/third_party/WebKit/Source/core/testing/Internals.cpp
@@ -1838,6 +1838,17 @@ String Internals::pageSizeAndMarginsInPixels(int pageNumber, int width, int heig
return PrintContext::pageSizeAndMarginsInPixels(frame(), pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft);
}
+float Internals::pageScaleFactor(ExceptionState& exceptionState)
+{
+ Document* document = contextDocument();
+ if (!document || !document->page()) {
+ exceptionState.throwDOMException(InvalidAccessError, document ? "The document's page cannot be retrieved." : "No context document can be obtained.");
+ return 0;
+ }
+ Page* page = document->page();
+ return page->frameHost().visualViewport().pageScale();
+}
+
void Internals::setPageScaleFactor(float scaleFactor, ExceptionState& exceptionState)
{
Document* document = contextDocument();
« no previous file with comments | « third_party/WebKit/Source/core/testing/Internals.h ('k') | third_party/WebKit/Source/core/testing/Internals.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698