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

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: No need to call updateLayout() manually. PrintContext::begin() does it for us. 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..6372b310e5ed99f5e8613f26fe4757e287853aa2 100644
--- a/third_party/WebKit/Source/core/page/PrintContext.cpp
+++ b/third_party/WebKit/Source/core/page/PrintContext.cpp
@@ -259,8 +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.
- document->updateLayout();
+ // 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);
RefPtr<ComputedStyle> style = document->styleForPage(pageNumber);
// Implement formatters for properties we care about.
« 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