Changeset 35078 in webkit
- Timestamp:
- Jul 9, 2008 4:17:50 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r35076 r35078 1 2008-07-09 Eric Seidel <eric@webkit.org> 2 3 Reviewed by aroben. 4 5 * platform/mac/printing: Added. 6 * platform/mac/printing/media-queries-print-expected.txt: Added. 7 * platform/qt/Skipped: skip printing and webarchives 8 * platform/win/Skipped: skip printing tests 9 * printing: Added. 10 * printing/media-queries-print.html: Added. 11 1 12 2008-07-09 Eric Seidel <eric@webkit.org> 2 13 -
trunk/LayoutTests/platform/gtk/Skipped
r34776 r35078 8 8 # Missing AccessibilityController implementation 9 9 accessibility 10 printing -
trunk/LayoutTests/platform/qt/Skipped
r34776 r35078 1 1 # ------- missing features in DRT 2 2 accessibility 3 printing 3 4 editing/selection/4975120.html 4 5 editing/selection/5109817.html … … 865 866 svg/hixie/viewbox/preserveAspectRatio/001.xml 866 867 svg/hixie/viewbox/preserveAspectRatio/002.xml 867 webarchive/archive-empty-frame-dom.html868 webarchive/archive-empty-frame-source.html869 webarchive/archive-with-unencoded-url.html870 webarchive/test-body-background.html871 webarchive/test-duplicate-resources.html872 webarchive/test-frameset.html873 webarchive/test-img-src.html874 webarchive/test-input-src.html875 webarchive/test-link-href.html876 webarchive/test-object-data.html877 webarchive/test-script-src.html878 webarchive/test-table-background.html879 webarchive/test-td-background.html880 webarchive/loading/test-loading-archive.html881 868 882 869 # ------- <video> support -
trunk/LayoutTests/platform/win/Skipped
r34794 r35078 408 408 # Still need to implement AccessibilityController for DumpRenderTree on Windows 409 409 accessibility 410 411 # No support for print-to-pdf in Windows DRT 412 printing 413 -
trunk/WebKitTools/ChangeLog
r35076 r35078 1 2008-07-09 Eric Seidel <eric@webkit.org> 2 3 Reviewed by aroben. 4 5 * DumpRenderTree/LayoutTestController.cpp: 6 (LayoutTestController::LayoutTestController): 7 (dumpAsPDFCallback): 8 (LayoutTestController::staticFunctions): 9 * DumpRenderTree/LayoutTestController.h: 10 (LayoutTestController::dumpAsPDF): 11 (LayoutTestController::setDumpAsPDF): 12 * DumpRenderTree/mac/DumpRenderTree.mm: 13 (dumpFrameAsPDF): 14 (dump): 15 1 16 2008-07-09 Eric Seidel <eric@webkit.org> 2 17 -
trunk/WebKitTools/DumpRenderTree/LayoutTestController.cpp
r34972 r35078 37 37 LayoutTestController::LayoutTestController(bool testRepaintDefault, bool testRepaintSweepHorizontallyDefault) 38 38 : m_dumpAsText(false) 39 , m_dumpAsPDF(false) 39 40 , m_dumpBackForwardList(false) 40 41 , m_dumpChildFrameScrollPositions(false) … … 71 72 } 72 73 74 static JSValueRef dumpAsPDFCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 75 { 76 LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); 77 controller->setDumpAsPDF(true); 78 return JSValueMakeUndefined(context); 79 } 80 73 81 static JSValueRef dumpBackForwardListCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 74 82 { … … 670 678 { "display", displayCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 671 679 { "dumpAsText", dumpAsTextCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 680 { "printToPDF", dumpAsPDFCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 672 681 { "dumpBackForwardList", dumpBackForwardListCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 673 682 { "dumpChildFramesAsText", dumpChildFramesAsTextCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, -
trunk/WebKitTools/DumpRenderTree/LayoutTestController.h
r34972 r35078 73 73 void setDumpAsText(bool dumpAsText) { m_dumpAsText = dumpAsText; } 74 74 75 bool dumpAsPDF() const { return m_dumpAsPDF; } 76 void setDumpAsPDF(bool dumpAsPDF) { m_dumpAsPDF = dumpAsPDF; } 77 75 78 bool dumpBackForwardList() const { return m_dumpBackForwardList; } 76 79 void setDumpBackForwardList(bool dumpBackForwardList) { m_dumpBackForwardList = dumpBackForwardList; } … … 141 144 private: 142 145 bool m_dumpAsText; 146 bool m_dumpAsPDF; 143 147 bool m_dumpBackForwardList; 144 148 bool m_dumpChildFrameScrollPositions; -
trunk/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
r35076 r35078 607 607 } 608 608 609 static NSData *dumpFrameAsPDF(WebFrame *frame) 610 { 611 if (!frame) 612 return nil; 613 614 // Sadly we have to dump to a file and then read from that file again 615 // +[NSPrintOperation PDFOperationWithView:insideRect:] requires a rect and prints to a single page 616 // likewise +[NSView dataWithPDFInsideRect:] also prints to a single continuous page 617 // The goal of this function is to test "real" printing across multiple pages. 618 // FIXME: It's possible there might be printing SPI to let us print a multi-page PDF to an NSData object 619 NSString *path = @"/tmp/test.pdf"; 620 621 NSMutableDictionary *printInfoDict = [NSMutableDictionary dictionaryWithDictionary:[[NSPrintInfo sharedPrintInfo] dictionary]]; 622 [printInfoDict setObject:NSPrintSaveJob forKey:NSPrintJobDisposition]; 623 [printInfoDict setObject:path forKey:NSPrintSavePath]; 624 625 NSPrintInfo *printInfo = [[NSPrintInfo alloc] initWithDictionary:printInfoDict]; 626 [printInfo setHorizontalPagination:NSAutoPagination]; 627 [printInfo setVerticalPagination:NSAutoPagination]; 628 [printInfo setVerticallyCentered:NO]; 629 630 NSPrintOperation *printOperation = [NSPrintOperation printOperationWithView:[frame frameView] printInfo:printInfo]; 631 [printOperation setShowPanels:NO]; 632 [printOperation runOperation]; 633 634 [printInfo release]; 635 636 NSData *pdfData = [NSData dataWithContentsOfFile:path]; 637 [[NSFileManager defaultManager] removeFileAtPath:path handler:nil]; 638 639 return pdfData; 640 } 641 609 642 static void convertMIMEType(NSMutableString *mimeType) 610 643 { … … 831 864 if (layoutTestController->dumpAsText()) { 832 865 resultString = dumpFramesAsText(mainFrame); 866 } else if (layoutTestController->dumpAsPDF()) { 867 resultData = dumpFrameAsPDF(mainFrame); 868 resultMimeType = @"application/pdf"; 833 869 } else if (layoutTestController->dumpDOMAsWebArchive()) { 834 870 WebArchive *webArchive = [[mainFrame DOMDocument] webArchive];
Note: See TracChangeset
for help on using the changeset viewer.