summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/mac/WebView/WebFrame.mm
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit/mac/WebView/WebFrame.mm')
-rw-r--r--Source/WebKit/mac/WebView/WebFrame.mm20
1 files changed, 9 insertions, 11 deletions
diff --git a/Source/WebKit/mac/WebView/WebFrame.mm b/Source/WebKit/mac/WebView/WebFrame.mm
index 154156a..4d1c752 100644
--- a/Source/WebKit/mac/WebView/WebFrame.mm
+++ b/Source/WebKit/mac/WebView/WebFrame.mm
@@ -587,16 +587,11 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
}
// Used by pagination code called from AppKit when a standalone web page is printed.
-- (NSArray*)_computePageRectsWithPrintWidthScaleFactor:(float)printWidthScaleFactor printHeight:(float)printHeight
+- (NSArray*)_computePageRectsWithPrintScaleFactor:(float)printScaleFactor pageSize:(NSSize)pageSize
{
NSMutableArray* pages = [NSMutableArray arrayWithCapacity:5];
- if (printWidthScaleFactor <= 0) {
- LOG_ERROR("printWidthScaleFactor has bad value %.2f", printWidthScaleFactor);
- return pages;
- }
-
- if (printHeight <= 0) {
- LOG_ERROR("printHeight has bad value %.2f", printHeight);
+ if (printScaleFactor <= 0) {
+ LOG_ERROR("printScaleFactor has bad value %.2f", printScaleFactor);
return pages;
}
@@ -612,8 +607,11 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
if (!documentView)
return pages;
- float docWidth = root->layer()->width();
- float printWidth = docWidth / printWidthScaleFactor;
+ float docWidth = root->docWidth();
+ float docHeight = root->docHeight();
+
+ float printWidth = root->style()->isHorizontalWritingMode() ? docWidth / printScaleFactor : pageSize.width;
+ float printHeight = root->style()->isHorizontalWritingMode() ? pageSize.height : docHeight / printScaleFactor;
PrintContext printContext(_private->coreFrame);
printContext.computePageRectsWithPageSize(FloatSize(printWidth, printHeight), true);
@@ -915,7 +913,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
- (BOOL)_canProvideDocumentSource
{
Frame* frame = _private->coreFrame;
- String mimeType = frame->loader()->writer()->mimeType();
+ String mimeType = frame->document()->loader()->writer()->mimeType();
PluginData* pluginData = frame->page() ? frame->page()->pluginData() : 0;
if (WebCore::DOMImplementation::isTextMIMEType(mimeType) ||