[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

kenneth at webkit.org kenneth at webkit.org
Thu Oct 29 20:48:55 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit ca3b305ae43a958ce2a7b6ce106d79ccaf8aa081
Author: kenneth at webkit.org <kenneth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 20 17:03:50 2009 +0000

    Update the tests to test the new render functionality, and take
    into consideration that render() clips to the frame itself as well
    as the viewport.
    
    Patch by Kenneth Rohde Christiansen <kenneth at webkit.org> on 2009-10-20
    Reviewed by Adam Barth.
    
    QWebFrame::render() now always clips, so the old tests were bogus.
    
    Rendering pure contents (no scrollbars etc) without clipping can now
    be accomplished using QWebFrame::documentElement()->render(...)
    
    * Api/qwebframe.cpp:
    * Api/qwebframe.h:
    * Api/qwebframe_p.h:
    (QWebFramePrivate::QWebFramePrivate):
    * tests/qwebframe/tst_qwebframe.cpp:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49866 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index ec2c587..5f24e26 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,5 +1,24 @@
 2009-10-20  Kenneth Rohde Christiansen  <kenneth at webkit.org>
 
+        Reviewed by Adam Barth.
+
+        Update the tests to test the new render functionality, and take
+        into consideration that render() clips to the frame itself as well
+        as the viewport.
+
+        QWebFrame::render() now always clips, so the old tests were bogus.
+
+        Rendering pure contents (no scrollbars etc) without clipping can now
+        be accomplished using QWebFrame::documentElement()->render(...)
+
+        * Api/qwebframe.cpp:
+        * Api/qwebframe.h:
+        * Api/qwebframe_p.h:
+        (QWebFramePrivate::QWebFramePrivate):
+        * tests/qwebframe/tst_qwebframe.cpp:
+
+2009-10-20  Kenneth Rohde Christiansen  <kenneth at webkit.org>
+
         Rubberstamped by Adam Barth.
 
         As we do not support rendering a QWebFrame without it being clipped
diff --git a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
index 80c9d72..7cc62b0 100644
--- a/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
+++ b/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp
@@ -2691,26 +2691,24 @@ void tst_QWebFrame::render()
 
     QPicture picture;
 
-    // render clipping to Viewport
-    frame->setClipRenderToViewport(true);
+    QSize size = page.mainFrame()->contentsSize();
+    page.setViewportSize(size);
+
+    // render contents layer only (the iframe is smaller than the image, so it will have scrollbars)
     QPainter painter1(&picture);
-    frame->render(&painter1);
+    frame->render(&painter1, QWebFrame::ContentsLayer);
     painter1.end();
 
-    QSize size = page.mainFrame()->contentsSize();
-    page.setViewportSize(size);
-    QCOMPARE(size.width(), picture.boundingRect().width());   // 100px
-    QCOMPARE(size.height(), picture.boundingRect().height()); // 100px
+    QCOMPARE(size.width(), picture.boundingRect().width() + frame->scrollBarGeometry(Qt::Vertical).width());
+    QCOMPARE(size.height(), picture.boundingRect().height() + frame->scrollBarGeometry(Qt::Horizontal).height());
 
-    // render without clipping to Viewport
-    frame->setClipRenderToViewport(false);
+    // render everything, should be the size of the iframe
     QPainter painter2(&picture);
-    frame->render(&painter2);
+    frame->render(&painter2, QWebFrame::AllLayers);
     painter2.end();
 
-    QImage resource(":/image.png");
-    QCOMPARE(resource.width(), picture.boundingRect().width());   // resource width: 128px
-    QCOMPARE(resource.height(), picture.boundingRect().height()); // resource height: 128px
+    QCOMPARE(size.width(), picture.boundingRect().width());   // width: 100px
+    QCOMPARE(size.height(), picture.boundingRect().height()); // height: 100px
 }
 
 void tst_QWebFrame::scrollPosition()

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list