2010-04-30 Shinichiro Hamaji <hamaji@chromium.org>
authorhamaji@chromium.org <hamaji@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 May 2010 05:34:28 +0000 (05:34 +0000)
committerhamaji@chromium.org <hamaji@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 1 May 2010 05:34:28 +0000 (05:34 +0000)
        Reviewed by Darin Adler.

        Add layoutTestController.setPrinting()
        https://bugs.webkit.org/show_bug.cgi?id=37203

        * platform/mac/Skipped:
        * platform/mac/printing/media-queries-print-expected.txt:
2010-04-30  Shinichiro Hamaji  <hamaji@chromium.org>

        Reviewed by Darin Adler.

        Add layoutTestController.setPrinting()
        https://bugs.webkit.org/show_bug.cgi?id=37203

        Use the renderer's width insteead of screen's width as the width of
        a screen depends on machines.

        * rendering/RenderTreeAsText.cpp:
        (WebCore::externalRepresentation):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@58629 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/platform/mac/Skipped
LayoutTests/platform/mac/printing/media-queries-print-expected.txt
WebCore/ChangeLog
WebCore/rendering/RenderTreeAsText.cpp

index 0d2fdd0..e5fcd95 100644 (file)
@@ -1,3 +1,13 @@
+2010-04-30  Shinichiro Hamaji  <hamaji@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Add layoutTestController.setPrinting()
+        https://bugs.webkit.org/show_bug.cgi?id=37203
+
+        * platform/mac/Skipped:
+        * platform/mac/printing/media-queries-print-expected.txt:
+
 2010-04-28  Joseph Pecoraro  <joepeck@webkit.org>
 
         Reviewed by Oliver Hunt.
index 949a956..3a2a184 100644 (file)
@@ -175,8 +175,5 @@ fast/dom/icon-url-property.html
 # Doesn't support WOFF yet.
 fast/css/font-face-woff.html
 
-# It seems this depends on the size of physical screen?
-printing/media-queries-print.html
-
 # EventSendingController does not send events on areas outside the WebView.
 scrollbars/scrollbar-click-does-not-blur-content.html
index 3012aee..b07ef87 100644 (file)
@@ -1,10 +1,10 @@
-layer at (0,0) size 2400x585
-  RenderView at (0,0) size 2400x585
-layer at (0,0) size 2400x585
-  RenderBlock {HTML} at (0,0) size 2400x585
-    RenderBody {BODY} at (8,8) size 2384x569
+layer at (0,0) size 1000x585
+  RenderView at (0,0) size 1000x585
+layer at (0,0) size 1000x585
+  RenderBlock {HTML} at (0,0) size 1000x585
+    RenderBody {BODY} at (8,8) size 984x569
       RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#008000]
-      RenderBlock (anonymous) at (0,100) size 2384x18
+      RenderBlock (anonymous) at (0,100) size 984x18
         RenderInline {SPAN} at (0,0) size 533x18
           RenderText {#text} at (0,0) size 533x18
             text run at (0,0) width 533: "When printing, you should see a green square above and this text should be italic."
index 3bfc93f..9b54c0c 100644 (file)
@@ -1,3 +1,16 @@
+2010-04-30  Shinichiro Hamaji  <hamaji@chromium.org>
+
+        Reviewed by Darin Adler.
+
+        Add layoutTestController.setPrinting()
+        https://bugs.webkit.org/show_bug.cgi?id=37203
+
+        Use the renderer's width insteead of screen's width as the width of
+        a screen depends on machines.
+
+        * rendering/RenderTreeAsText.cpp:
+        (WebCore::externalRepresentation):
+
 2010-04-30  Joseph Pecoraro  <joepeck@webkit.org>
 
         Reviewed by Timothy Hatcher.
index e4b8db0..311854e 100644 (file)
@@ -29,7 +29,6 @@
 #include "CSSMutableStyleDeclaration.h"
 #include "CharacterNames.h"
 #include "Document.h"
-#include "DOMWindow.h"
 #include "Frame.h"
 #include "FrameView.h"
 #include "HTMLElement.h"
@@ -45,7 +44,6 @@
 #include "RenderTableCell.h"
 #include "RenderView.h"
 #include "RenderWidget.h"
-#include "Screen.h"
 #include "SelectionController.h"
 #include "TextStream.h"
 #include <wtf/UnusedParam.h>
@@ -621,8 +619,11 @@ static void writeSelection(TextStream& ts, const RenderObject* o)
 String externalRepresentation(Frame* frame, RenderAsTextBehavior behavior)
 {
     PrintContext printContext(frame);
-    if (behavior & RenderAsTextPrintingMode)
-        printContext.begin(frame->domWindow()->screen()->width());
+    if (behavior & RenderAsTextPrintingMode) {
+        if (!frame->contentRenderer())
+            return String();
+        printContext.begin(frame->contentRenderer()->width());
+    }
 
     frame->document()->updateLayout();