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

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

Issue 2417683002: Disable scroll anchoring when in printing mode (Closed)
Patch Set: Created 4 years, 2 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/page/PrintContext.cpp
diff --git a/third_party/WebKit/Source/core/page/PrintContext.cpp b/third_party/WebKit/Source/core/page/PrintContext.cpp
index 930a7689bc31509985441e763a6c8a16cd82cfbe..6531da5b8f02542feeefbc76735d40caffdb0900 100644
--- a/third_party/WebKit/Source/core/page/PrintContext.cpp
+++ b/third_party/WebKit/Source/core/page/PrintContext.cpp
@@ -176,6 +176,8 @@ void PrintContext::begin(float width, float height) {
originalPageSize, FloatSize(width * printingMinimumShrinkFactor,
height * printingMinimumShrinkFactor));
+ m_frame->view()->setDisableScrollAnchoringForPrinting(true);
+
// This changes layout, so callers need to make sure that they don't paint to
// screen while in printing mode.
m_frame->setPrinting(
@@ -187,6 +189,7 @@ void PrintContext::end() {
ASSERT(m_isPrinting);
m_isPrinting = false;
m_frame->setPrinting(false, FloatSize(), FloatSize(), 0);
+ m_frame->view()->setDisableScrollAnchoringForPrinting(false);
m_linkedDestinations.clear();
m_linkedDestinationsValid = false;
}

Powered by Google App Engine
This is Rietveld 408576698