Changeset 58386 in webkit
- Timestamp:
- Apr 28, 2010 12:30:16 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r58385 r58386 1 2010-04-27 Shinichiro Hamaji <hamaji@chromium.org> 2 3 Reviewed by Darin Adler and Eric Seidel. 4 5 Add layoutTestController.setPrinting() 6 https://bugs.webkit.org/show_bug.cgi?id=37203 7 8 Now we can test media queries with the new function because the 9 render tree has the color information of the box. 10 11 Note that the pixel test is currently failing. We'll need another 12 patch to enable printing mode for pixel tests. 13 14 * platform/mac/Skipped: 15 * platform/mac/printing/media-queries-print-expected.checksum: Added. 16 * platform/mac/printing/media-queries-print-expected.png: Added. 17 * platform/mac/printing/media-queries-print-expected.txt: Added. 18 * printing/media-queries-print.html: 19 1 20 2010-04-27 Yuzo Fujishima <yuzo@google.com> 2 21 -
trunk/LayoutTests/platform/mac/Skipped
r58111 r58386 38 38 # see bug https://bugs.webkit.org/show_bug.cgi?id=20011 -- Printing tests should use ImageDiff 39 39 printing/compositing-layer-printing.html 40 printing/media-queries-print.html41 40 42 41 # Skip because fix for https://bugs.webkit.org/show_bug.cgi?id=26770 was reverted -
trunk/LayoutTests/printing/media-queries-print.html
r35078 r58386 17 17 <script> 18 18 if (window.layoutTestController) 19 layoutTestController. printToPDF();19 layoutTestController.setPrinting(); 20 20 </script> 21 21 <body> -
trunk/WebCore/ChangeLog
r58385 r58386 1 2010-04-27 Shinichiro Hamaji <hamaji@chromium.org> 2 3 Reviewed by Darin Adler and Eric Seidel. 4 5 Add layoutTestController.setPrinting() 6 https://bugs.webkit.org/show_bug.cgi?id=37203 7 8 Added RenderAsTextPrintingMode as a behavior of externalRepresentation. 9 10 Now ~PrintContext() calls end() automatically. 11 12 * page/PrintContext.cpp: 13 (WebCore::PrintContext::~PrintContext): 14 * rendering/RenderTreeAsText.cpp: 15 (WebCore::externalRepresentation): 16 * rendering/RenderTreeAsText.h: 17 (WebCore::): 18 1 19 2010-04-27 Yuzo Fujishima <yuzo@google.com> 2 20 -
trunk/WebCore/page/PrintContext.cpp
r57384 r58386 39 39 PrintContext::~PrintContext() 40 40 { 41 ASSERT(!m_isPrinting); 41 if (m_isPrinting) 42 end(); 42 43 m_pageRects.clear(); 43 44 } -
trunk/WebCore/rendering/RenderTreeAsText.cpp
r58212 r58386 35 35 #include "HTMLNames.h" 36 36 #include "InlineTextBox.h" 37 #include "PrintContext.h" 37 38 #include "RenderBR.h" 38 39 #include "RenderFileUploadControl.h" … … 44 45 #include "RenderView.h" 45 46 #include "RenderWidget.h" 47 #include "Screen.h" 46 48 #include "SelectionController.h" 47 49 #include "TextStream.h" … … 618 620 String externalRepresentation(Frame* frame, RenderAsTextBehavior behavior) 619 621 { 622 PrintContext printContext(frame); 623 if (behavior & RenderAsTextPrintingMode) 624 printContext.begin(frame->domWindow()->screen()->width()); 625 620 626 frame->document()->updateLayout(); 621 627 -
trunk/WebCore/rendering/RenderTreeAsText.h
r57986 r58386 40 40 RenderAsTextShowLayerNesting = 1 << 1, // Annotate the layer lists. 41 41 RenderAsTextShowCompositedLayers = 1 << 2, // Show which layers are composited. 42 RenderAsTextShowAddresses = 1 << 3 // Show layer and renderer addresses. 42 RenderAsTextShowAddresses = 1 << 3, // Show layer and renderer addresses. 43 RenderAsTextPrintingMode = 1 << 4 // Dump the tree in printing mode. 43 44 }; 44 45 typedef unsigned RenderAsTextBehavior; 45 46 47 // You don't need pageWidthInPixels if you don't specify RenderAsTextInPrintingMode. 46 48 String externalRepresentation(Frame*, RenderAsTextBehavior = RenderAsTextBehaviorNormal); 47 49 void write(TextStream&, const RenderObject&, int indent = 0, RenderAsTextBehavior = RenderAsTextBehaviorNormal); -
trunk/WebKit/mac/ChangeLog
r58266 r58386 1 2010-04-27 Shinichiro Hamaji <hamaji@chromium.org> 2 3 Reviewed by Darin Adler and Eric Seidel. 4 5 Add layoutTestController.setPrinting() 6 https://bugs.webkit.org/show_bug.cgi?id=37203 7 8 * Misc/WebCoreStatistics.h: 9 * Misc/WebCoreStatistics.mm: 10 (-[WebFrame renderTreeAsExternalRepresentationForPrinting:]): 11 1 12 2010-04-25 Sam Weinig <sam@webkit.org> 2 13 -
trunk/WebKit/mac/Misc/WebCoreStatistics.h
r54672 r58386 84 84 85 85 @interface WebFrame (WebKitDebug) 86 - (NSString *)renderTreeAsExternalRepresentation ;86 - (NSString *)renderTreeAsExternalRepresentationForPrinting:(BOOL)forPrinting; 87 87 - (NSString *)counterValueForElement:(DOMElement*)element; 88 88 - (int)pageNumberForElement:(DOMElement*)element:(float)pageWidthInPixels:(float)pageHeightInPixels; -
trunk/WebKit/mac/Misc/WebCoreStatistics.mm
r55750 r58386 256 256 @implementation WebFrame (WebKitDebug) 257 257 258 - (NSString *)renderTreeAsExternalRepresentation 259 { 260 return externalRepresentation(_private->coreFrame );258 - (NSString *)renderTreeAsExternalRepresentationForPrinting:(BOOL)forPrinting 259 { 260 return externalRepresentation(_private->coreFrame, forPrinting ? RenderAsTextPrintingMode : RenderAsTextBehaviorNormal); 261 261 } 262 262 -
trunk/WebKitTools/ChangeLog
r58380 r58386 1 2010-04-27 Shinichiro Hamaji <hamaji@chromium.org> 2 3 Reviewed by Darin Adler and Eric Seidel. 4 5 Add layoutTestController.setPrinting() 6 https://bugs.webkit.org/show_bug.cgi?id=37203 7 8 * DumpRenderTree/LayoutTestController.cpp: 9 (LayoutTestController::LayoutTestController): 10 (setPrintingCallback): 11 (LayoutTestController::staticFunctions): 12 * DumpRenderTree/LayoutTestController.h: 13 (LayoutTestController::isPrinting): 14 (LayoutTestController::setIsPrinting): 15 * DumpRenderTree/mac/DumpRenderTree.mm: 16 (dump): 17 1 18 2010-04-27 Michael Nordman <michaeln@google.com> 2 19 -
trunk/WebKitTools/DumpRenderTree/LayoutTestController.cpp
r58111 r58386 77 77 , m_geolocationPermission(false) 78 78 , m_handlesAuthenticationChallenges(false) 79 , m_isPrinting(false) 79 80 , m_testPathOrURL(testPathOrURL) 80 81 , m_expectedPixelHash(expectedPixelHash) … … 957 958 controller->setSpatialNavigationEnabled(JSValueToBoolean(context, arguments[0])); 958 959 960 return JSValueMakeUndefined(context); 961 } 962 963 static JSValueRef setPrintingCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 964 { 965 LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); 966 controller->setIsPrinting(true); 959 967 return JSValueMakeUndefined(context); 960 968 } … … 1583 1591 { "setPersistentUserStyleSheetLocation", setPersistentUserStyleSheetLocationCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1584 1592 { "setPopupBlockingEnabled", setPopupBlockingEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1593 { "setPrinting", setPrintingCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1585 1594 { "setPrivateBrowsingEnabled", setPrivateBrowsingEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1586 1595 { "setSelectTrailingWhitespaceEnabled", setSelectTrailingWhitespaceEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, -
trunk/WebKitTools/DumpRenderTree/LayoutTestController.h
r58111 r58386 212 212 void setHandlesAuthenticationChallenges(bool handlesAuthenticationChallenges) { m_handlesAuthenticationChallenges = handlesAuthenticationChallenges; } 213 213 214 bool isPrinting() const { return m_isPrinting; } 215 void setIsPrinting(bool isPrinting) { m_isPrinting = isPrinting; } 216 214 217 const std::string& authenticationUsername() const { return m_authenticationUsername; } 215 218 void setAuthenticationUsername(std::string username) { m_authenticationUsername = username; } … … 302 305 bool m_geolocationPermission; 303 306 bool m_handlesAuthenticationChallenges; 307 bool m_isPrinting; 304 308 305 309 std::string m_authenticationUsername; -
trunk/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
r58072 r58386 1086 1086 } else { 1087 1087 sizeWebViewForCurrentTest(); 1088 resultString = [mainFrame renderTreeAsExternalRepresentation ];1088 resultString = [mainFrame renderTreeAsExternalRepresentationForPrinting:gLayoutTestController->isPrinting()]; 1089 1089 } 1090 1090 … … 1117 1117 1118 1118 if (dumpPixels && !dumpAsText) 1119 // FIXME: when isPrinting is set, dump the image with page separators. 1119 1120 dumpWebViewAsPixelsAndCompareWithExpected(gLayoutTestController->expectedPixelHash()); 1120 1121
Note: See TracChangeset
for help on using the changeset viewer.