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

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

Issue 1510353002: PrintContext::pageProperty() shouldn't use 0 as page height. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: code review 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutView.cpp ('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/page/PrintContext.cpp
diff --git a/third_party/WebKit/Source/core/page/PrintContext.cpp b/third_party/WebKit/Source/core/page/PrintContext.cpp
index c02388f1138db5181ddd587d29afcf8c53c5824f..e62a2d2cefcc08afda9dd5c3b930c1c77984733d 100644
--- a/third_party/WebKit/Source/core/page/PrintContext.cpp
+++ b/third_party/WebKit/Source/core/page/PrintContext.cpp
@@ -259,7 +259,9 @@ String PrintContext::pageProperty(LocalFrame* frame, const char* propertyName, i
{
Document* document = frame->document();
PrintContext printContext(frame);
- printContext.begin(800); // Any width is OK here.
+ // Any non-zero size is OK here. We don't care about actual layout. We just want to collect
+ // @page rules and figure out what declarations apply on a given page (that may or may not exist).
+ printContext.begin(800, 1000);
document->updateLayout();
rune 2015/12/10 09:44:50 printContext.begin() will update the style/layout.
mstensho (USE GERRIT) 2015/12/10 09:45:58 Done.
RefPtr<ComputedStyle> style = document->styleForPage(pageNumber);
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutView.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698