Source/WebCore: WebCore part of <rdar://problem/10442663> Paginated display does...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Feb 2012 00:01:45 +0000 (00:01 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Feb 2012 00:01:45 +0000 (00:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=77505

Reviewed by Darin Adler.

* page/Page.h:
(WebCore::Page::Pagination::Pagination): Added initializer for the behavesLikeColumns member
variable.
(WebCore::Page::Pagination::operator==): Added comparison of behavesLikeColumns values.
(Pagination): Added behavesLikeColumns member variable. When set to false (the default),
paginated display respects the page-break-{before,after} properties rather than the
column-break-{before,after} ones.
* rendering/ColumnInfo.h:
(WebCore::ColumnInfo::ColumnInfo): Added initializer for the m_paginationUnit member.
(WebCore::ColumnInfo::paginationUnit): Added this getter.
(WebCore::ColumnInfo::setPaginationUnit): Added this setter.
(ColumnInfo): Added m_paginationUnit member. It defaults to Column.
* rendering/LayoutState.h:
(WebCore::LayoutState::isPaginatingColumns): Changed to check the pagination unit.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::layoutBlock): Added code to set the pagination unit in the ColumnInfo.
(WebCore::RenderBlock::paginationUnit): Added. The base class implementation returns Column.
* rendering/RenderBlock.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::paginationUnit): Added this override that returns Page, unless
this is the RenderView for the main frame and pagination is set to behave like columns.
* rendering/RenderView.h:

Source/WebKit/mac: WebKit/mac part of <rdar://problem/10442663> Paginated display does not respect page-break-{before,after}
https://bugs.webkit.org/show_bug.cgi?id=77505

Reviewed by Darin Adler.

* WebView/WebView.mm:
(-[WebView _setPaginationBehavesLikeColumns:]): Added this setter.
(-[WebView _paginationBehavesLikeColumns]): Added this getter.
* WebView/WebViewPrivate.h:

Source/WebKit2: WebKit2 part of <rdar://problem/10442663> Paginated display does not respect page-break-{before,after}
https://bugs.webkit.org/show_bug.cgi?id=77505

Reviewed by Darin Adler.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode): Encode paginationBehavesLikeColumns.
(WebKit::WebPageCreationParameters::decode): Decode paginationBehavesLikeColumns.
* Shared/WebPageCreationParameters.h:
(WebPageCreationParameters): Added paginationBehavesLikeColumns boolean.
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPaginationBehavesLikeColumns): Added this setter.
(WKPageGetPaginationBehavesLikeColumns): Added this getter.
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/API/mac/WKBrowsingContextController.mm:
(-[WKBrowsingContextController setPaginationBehavesLikeColumns:]): Added this Objective-C
wrapper around WKPageSetPaginationBehavesLikeColumns.
(-[WKBrowsingContextController paginationBehavesLikeColumns]): Added this Objective-C wrapper
around WKPageGetPaginationBehavesLikeColumns.
* UIProcess/API/mac/WKBrowsingContextControllerPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy): Added call to setPaginationBehavesLikeColumns() with
the value from the creation parameters.
(WebKit::WebPageProxy::setPaginationBehavesLikeColumns): Added this setter.
(WebKit::WebPageProxy::creationParameters): Populate paginationBehavesLikeColumns.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::paginationBehavesLikeColumns): Added this getter.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setPaginationBehavesLikeColumns): Added this setter.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in: Added SetPaginationBehavesLikeColumns message.

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

23 files changed:
Source/WebCore/ChangeLog
Source/WebCore/page/Page.h
Source/WebCore/rendering/ColumnInfo.h
Source/WebCore/rendering/LayoutState.h
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlock.h
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/RenderView.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/mac/WebView/WebViewPrivate.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPageCreationParameters.cpp
Source/WebKit2/Shared/WebPageCreationParameters.h
Source/WebKit2/UIProcess/API/C/WKPage.cpp
Source/WebKit2/UIProcess/API/C/WKPagePrivate.h
Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.mm
Source/WebKit2/UIProcess/API/mac/WKBrowsingContextControllerPrivate.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in

index 2534d3e5b9278bba82b606913621c163df545fca..3a9d499c4c47af4b0b22e27b1eabd879b7f82e31 100644 (file)
@@ -1,3 +1,33 @@
+2012-02-01  Dan Bernstein  <mitz@apple.com>
+
+        WebCore part of <rdar://problem/10442663> Paginated display does not respect page-break-{before,after}
+        https://bugs.webkit.org/show_bug.cgi?id=77505
+
+        Reviewed by Darin Adler.
+
+        * page/Page.h:
+        (WebCore::Page::Pagination::Pagination): Added initializer for the behavesLikeColumns member
+        variable.
+        (WebCore::Page::Pagination::operator==): Added comparison of behavesLikeColumns values.
+        (Pagination): Added behavesLikeColumns member variable. When set to false (the default),
+        paginated display respects the page-break-{before,after} properties rather than the
+        column-break-{before,after} ones.
+        * rendering/ColumnInfo.h:
+        (WebCore::ColumnInfo::ColumnInfo): Added initializer for the m_paginationUnit member.
+        (WebCore::ColumnInfo::paginationUnit): Added this getter.
+        (WebCore::ColumnInfo::setPaginationUnit): Added this setter.
+        (ColumnInfo): Added m_paginationUnit member. It defaults to Column.
+        * rendering/LayoutState.h:
+        (WebCore::LayoutState::isPaginatingColumns): Changed to check the pagination unit.
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::layoutBlock): Added code to set the pagination unit in the ColumnInfo.
+        (WebCore::RenderBlock::paginationUnit): Added. The base class implementation returns Column.
+        * rendering/RenderBlock.h:
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::paginationUnit): Added this override that returns Page, unless
+        this is the RenderView for the main frame and pagination is set to behave like columns.
+        * rendering/RenderView.h:
+
 2012-02-01  Florin Malita  <fmalita@google.com>
 
         Backgrounds in HTML inside foreignObject don't draw
index 35bb3730d06d6cac3cf42965340824d383e748b3..887893f9fad03289596fe64110ce303753db10f0 100644 (file)
@@ -271,6 +271,7 @@ namespace WebCore {
 
             Pagination()
                 : mode(Unpaginated)
+                , behavesLikeColumns(false)
                 , pageLength(0)
                 , gap(0)
             {
@@ -278,10 +279,11 @@ namespace WebCore {
 
             bool operator==(const Pagination& other) const
             {
-                return mode == other.mode && pageLength == other.pageLength && gap == other.gap;
+                return mode == other.mode && behavesLikeColumns == other.behavesLikeColumns && pageLength == other.pageLength && gap == other.gap;
             }
 
             Mode mode;
+            bool behavesLikeColumns;
             unsigned pageLength;
             unsigned gap;
         };
index fd2e9bf72e3751e6ffc23399f357f695f51dc4b8..94b130d3f795c0acdcde7eb2177bdec3ffe9fe87 100644 (file)
@@ -44,6 +44,7 @@ public:
         , m_forcedBreaks(0)
         , m_maximumDistanceBetweenForcedBreaks(0)
         , m_forcedBreakOffset(0)
+        , m_paginationUnit(Column)
     {
     }
 
@@ -93,6 +94,10 @@ public:
         m_forcedBreakOffset = offsetFromFirstPage;
     }
 
+    enum PaginationUnit { Column, Page };
+    PaginationUnit paginationUnit() const { return m_paginationUnit; }
+    void setPaginationUnit(PaginationUnit paginationUnit) { m_paginationUnit = paginationUnit; }
+
 private:
     LayoutUnit m_desiredColumnWidth;
     unsigned m_desiredColumnCount;
@@ -104,6 +109,7 @@ private:
     int m_forcedBreaks; // FIXME: We will ultimately need to cache more information to balance around forced breaks properly.
     int m_maximumDistanceBetweenForcedBreaks;
     int m_forcedBreakOffset;
+    PaginationUnit m_paginationUnit;
 };
 
 }
index 6b860b9fa9ced65e989cdc2ea10d9788d34dcea7..951be3f7b2d1e6bb38574ab75d52548ab225a48b 100644 (file)
 #ifndef LayoutState_h
 #define LayoutState_h
 
+#include "ColumnInfo.h"
 #include "LayoutTypes.h"
 #include <wtf/HashMap.h>
 #include <wtf/Noncopyable.h>
 
 namespace WebCore {
 
-class ColumnInfo;
 class RenderArena;
 class RenderBlock;
 class RenderBox;
@@ -69,7 +69,7 @@ public:
     void operator delete(void*, size_t);
 
     void clearPaginationInformation();
-    bool isPaginatingColumns() const { return m_columnInfo; }
+    bool isPaginatingColumns() const { return m_columnInfo && m_columnInfo->paginationUnit() == ColumnInfo::Column; }
     bool isPaginated() const { return m_isPaginated; }
     
     // The page logical offset is the object's offset from the top of the page in the page progression
index 2bced0f11eb45167b1018bec697a7db87c5b6106..d9cadadb8765cdce0ee45dbcf5786e71c5400dfd 100755 (executable)
@@ -1261,6 +1261,8 @@ void RenderBlock::layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeigh
         
         if (!hasSpecifiedPageLogicalHeight && !pageLogicalHeight)
             colInfo->clearForcedBreaks();
+
+        colInfo->setPaginationUnit(paginationUnit());
     }
 
     RenderView* renderView = view();
@@ -6390,6 +6392,11 @@ static bool inNormalFlow(RenderBox* child)
     return true;
 }
 
+ColumnInfo::PaginationUnit RenderBlock::paginationUnit() const
+{
+    return ColumnInfo::Column;
+}
+
 LayoutUnit RenderBlock::applyBeforeBreak(RenderBox* child, LayoutUnit logicalOffset)
 {
     // FIXME: Add page break checking here when we support printing.
index 1db5deed8c93b71ebb571829083bf59f9aa0dc1c..2d47374d3c120f979a6a6c2cece84bb98a519b5e 100644 (file)
@@ -23,6 +23,7 @@
 #ifndef RenderBlock_h
 #define RenderBlock_h
 
+#include "ColumnInfo.h"
 #include "GapRects.h"
 #include "PODIntervalTree.h"
 #include "RenderBox.h"
@@ -35,7 +36,6 @@
 namespace WebCore {
 
 class BidiContext;
-class ColumnInfo;
 class InlineIterator;
 class LayoutStateMaintainer;
 class LazyLineBreakIterator;
@@ -905,6 +905,8 @@ protected:
     LayoutUnit nextPageLogicalTop(LayoutUnit logicalOffset, PageBoundaryRule = ExcludePageBoundary) const;
     bool hasNextPage(LayoutUnit logicalOffset, PageBoundaryRule = ExcludePageBoundary) const;
 
+    virtual ColumnInfo::PaginationUnit paginationUnit() const;
+
     LayoutUnit applyBeforeBreak(RenderBox* child, LayoutUnit logicalOffset); // If the child has a before break, then return a new yPos that shifts to the top of the next page/column.
     LayoutUnit applyAfterBreak(RenderBox* child, LayoutUnit logicalOffset, MarginInfo&); // If the child has an after break, then return a new offset that shifts to the top of the next page/column.
 
index e6190ff1542c44d6fb5c91a0f1d859b610529b50..df291076393b62b4f90cae7dcedfff05ff3d5f30 100644 (file)
@@ -199,6 +199,17 @@ void RenderView::calcColumnWidth()
     setDesiredColumnCountAndWidth(1, columnWidth);
 }
 
+ColumnInfo::PaginationUnit RenderView::paginationUnit() const
+{
+    if (m_frameView) {
+        if (Frame* frame = m_frameView->frame()) {
+            if (Page* page = frame->page())
+                return (frame == page->mainFrame() && page->pagination().behavesLikeColumns) ? ColumnInfo::Column : ColumnInfo::Page;
+        }
+    }
+    return ColumnInfo::Page;
+}
+
 void RenderView::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
 {
     // If we ever require layout but receive a paint anyway, something has gone horribly wrong.
index 1eb91ec17cfbd1e34d6adf7a55fe9fd12ec4bded..5307c3f513c6a7f05b0db4a5534cf3615ec1efb2 100644 (file)
@@ -198,6 +198,7 @@ protected:
 
 private:
     virtual void calcColumnWidth() OVERRIDE;
+    virtual ColumnInfo::PaginationUnit paginationUnit() const OVERRIDE;
 
     bool shouldRepaint(const IntRect& r) const;
 
index 70de98beeeb3471c1e905b34b8627a749f1b9660..9e3f1563bcd5eadf4f002a95da0be8651e039742 100644 (file)
@@ -1,3 +1,15 @@
+2012-02-01  Dan Bernstein  <mitz@apple.com>
+
+        WebKit/mac part of <rdar://problem/10442663> Paginated display does not respect page-break-{before,after}
+        https://bugs.webkit.org/show_bug.cgi?id=77505
+
+        Reviewed by Darin Adler.
+
+        * WebView/WebView.mm:
+        (-[WebView _setPaginationBehavesLikeColumns:]): Added this setter.
+        (-[WebView _paginationBehavesLikeColumns]): Added this getter.
+        * WebView/WebViewPrivate.h:
+
 2012-01-25  Eric Seidel  <eric@webkit.org>
 
         HTMLIsIndexElement should not expose HTMLInputElement properties
index d4b20dc45f3c447ba4b8c5c50d582ce8e6fdbe83..e2bf898e6900a1aac864ea83b308393702f5602c 100644 (file)
@@ -2791,6 +2791,25 @@ static PassOwnPtr<Vector<String> > toStringVector(NSArray* patterns)
     return WebPaginationModeUnpaginated;
 }
 
+- (void)_setPaginationBehavesLikeColumns:(BOOL)behavesLikeColumns
+{
+    Page* page = core(self);
+    if (!page)
+        return;
+
+    Page::Pagination pagination = page->pagination();
+    pagination.behavesLikeColumns = behavesLikeColumns;
+}
+
+- (BOOL)_paginationBehavesLikeColumns
+{
+    Page* page = core(self);
+    if (!page)
+        return NO;
+
+    return page->pagination().behavesLikeColumns;
+}
+
 - (void)_setPageLength:(CGFloat)pageLength
 {
     Page* page = core(self);
index 2bf005dca5eddec76bc3fc12e1a65fe977620247..cd92f31e5789a40ba2e5fb74d5e436706f329be8 100644 (file)
@@ -557,6 +557,12 @@ Could be worth adding to the API.
 
 - (void)_setPaginationMode:(WebPaginationMode)paginationMode;
 - (WebPaginationMode)_paginationMode;
+
+// Whether the column-break-{before,after} properties are respected instead of the
+// page-break-{before,after} properties.
+- (void)_setPaginationBehavesLikeColumns:(BOOL)behavesLikeColumns;
+- (BOOL)_paginationBehavesLikeColumns;
+
 // Set to 0 to have the page length equal the view length.
 - (void)_setPageLength:(CGFloat)pageLength;
 - (CGFloat)_pageLength;
index 9334442eef9bc0946ccf6488a6af9542c51d5b2f..d4bca9c855287ce08e446abbeb4f517cd413ff04 100644 (file)
@@ -1,3 +1,37 @@
+2012-02-01  Dan Bernstein  <mitz@apple.com>
+
+        WebKit2 part of <rdar://problem/10442663> Paginated display does not respect page-break-{before,after}
+        https://bugs.webkit.org/show_bug.cgi?id=77505
+
+        Reviewed by Darin Adler.
+
+        * Shared/WebPageCreationParameters.cpp:
+        (WebKit::WebPageCreationParameters::encode): Encode paginationBehavesLikeColumns.
+        (WebKit::WebPageCreationParameters::decode): Decode paginationBehavesLikeColumns.
+        * Shared/WebPageCreationParameters.h:
+        (WebPageCreationParameters): Added paginationBehavesLikeColumns boolean.
+        * UIProcess/API/C/WKPage.cpp:
+        (WKPageSetPaginationBehavesLikeColumns): Added this setter.
+        (WKPageGetPaginationBehavesLikeColumns): Added this getter.
+        * UIProcess/API/C/WKPagePrivate.h:
+        * UIProcess/API/mac/WKBrowsingContextController.mm:
+        (-[WKBrowsingContextController setPaginationBehavesLikeColumns:]): Added this Objective-C
+        wrapper around WKPageSetPaginationBehavesLikeColumns.
+        (-[WKBrowsingContextController paginationBehavesLikeColumns]): Added this Objective-C wrapper
+        around WKPageGetPaginationBehavesLikeColumns.
+        * UIProcess/API/mac/WKBrowsingContextControllerPrivate.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::WebPageProxy): Added call to setPaginationBehavesLikeColumns() with
+        the value from the creation parameters.
+        (WebKit::WebPageProxy::setPaginationBehavesLikeColumns): Added this setter.
+        (WebKit::WebPageProxy::creationParameters): Populate paginationBehavesLikeColumns.
+        * UIProcess/WebPageProxy.h:
+        (WebKit::WebPageProxy::paginationBehavesLikeColumns): Added this getter.
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::setPaginationBehavesLikeColumns): Added this setter.
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in: Added SetPaginationBehavesLikeColumns message.
+
 2012-02-01  Anders Carlsson  <andersca@apple.com>
 
         REGRESSION (r104727): Strange graphics corruption opening a new tab in Safari
index d051791eb33a934f32951c9496c5b484d09b8956..08bedb61ff49bb58d5df97e904c83f0f38562cf8 100644 (file)
@@ -47,6 +47,7 @@ void WebPageCreationParameters::encode(CoreIPC::ArgumentEncoder* encoder) const
     encoder->encode(useFixedLayout);
     encoder->encode(fixedLayoutSize);
     encoder->encodeEnum(paginationMode);
+    encoder->encode(paginationBehavesLikeColumns);
     encoder->encode(pageLength);
     encoder->encode(gapBetweenPages);
     encoder->encode(userAgent);
@@ -96,6 +97,8 @@ bool WebPageCreationParameters::decode(CoreIPC::ArgumentDecoder* decoder, WebPag
         return false;
     if (!decoder->decodeEnum(parameters.paginationMode))
         return false;
+    if (!decoder->decode(parameters.paginationBehavesLikeColumns))
+        return false;
     if (!decoder->decode(parameters.pageLength))
         return false;
     if (!decoder->decode(parameters.gapBetweenPages))
index 867c40820da87fcef046623e5f474220e7fbfd4c..7e4f63a4c0da06a5928f05a47458174217d5611a 100644 (file)
@@ -64,6 +64,7 @@ struct WebPageCreationParameters {
     WebCore::IntSize fixedLayoutSize;
 
     WebCore::Page::Pagination::Mode paginationMode;
+    bool paginationBehavesLikeColumns;
     double pageLength;
     double gapBetweenPages;
 
index 8768a8dfade5ee25fc4b0afe8681abdfc857098f..3010016c31aec78a7dc4023a104a0c38c6452d5b 100644 (file)
@@ -379,6 +379,16 @@ WKPaginationMode WKPageGetPaginationMode(WKPageRef pageRef)
     return kWKPaginationModeUnpaginated;
 }
 
+void WKPageSetPaginationBehavesLikeColumns(WKPageRef pageRef, bool behavesLikeColumns)
+{
+    toImpl(pageRef)->setPaginationBehavesLikeColumns(behavesLikeColumns);
+}
+
+bool WKPageGetPaginationBehavesLikeColumns(WKPageRef pageRef)
+{
+    return toImpl(pageRef)->paginationBehavesLikeColumns();
+}
+
 void WKPageSetPageLength(WKPageRef pageRef, double pageLength)
 {
     toImpl(pageRef)->setPageLength(pageLength);
index 6572e865ece5006c2b9072ef76bab0c362c162e8..097aabfe1fe9158f0ed987084a282238cffd3cf2 100644 (file)
@@ -61,6 +61,8 @@ typedef uint32_t WKPaginationMode;
 
 WK_EXPORT void WKPageSetPaginationMode(WKPageRef page, WKPaginationMode paginationMode);
 WK_EXPORT WKPaginationMode WKPageGetPaginationMode(WKPageRef page);
+WK_EXPORT void WKPageSetPaginationBehavesLikeColumns(WKPageRef page, bool behavesLikeColumns);
+WK_EXPORT bool WKPageGetPaginationBehavesLikeColumns(WKPageRef page);
 WK_EXPORT void WKPageSetPageLength(WKPageRef page, double pagesPerView);
 WK_EXPORT double WKPageGetPageLength(WKPageRef page);
 WK_EXPORT void WKPageSetGapBetweenPages(WKPageRef page, double gap);
index 955b930450b3c33cd26897eee67e8c2405be73d4..2c4341b5dc36ad50fe99ed6e059790bc8d48d07e 100644 (file)
@@ -243,6 +243,16 @@ static inline NSURL *autoreleased(WKURLRef url)
     return WKPaginationModeUnpaginated;
 }
 
+- (void)setPaginationBehavesLikeColumns:(BOOL)behavesLikeColumns
+{
+    WKPageSetPaginationBehavesLikeColumns(self._pageRef, behavesLikeColumns);
+}
+
+- (BOOL)paginationBehavesLikeColumns
+{
+    return WKPageGetPaginationBehavesLikeColumns(self._pageRef);
+}
+
 - (void)setPageLength:(CGFloat)pageLength
 {
     WKPageSetPageLength(self._pageRef, pageLength);
index 3585642d39321884875d1671020f36b63dd500b5..c362c55c28f0aa6a3d8e05beeb29442f5c573561 100644 (file)
@@ -35,6 +35,9 @@ typedef NSUInteger WKBrowsingContextPaginationMode;
 @interface WKBrowsingContextController (Private)
 
 @property WKBrowsingContextPaginationMode paginationMode;
+// Whether the column-break-{before,after} properties are respected instead of the
+// page-break-{before,after} properties.
+@property BOOL paginationBehavesLikeColumns;
 // Set to 0 to have the page length equal the view length.
 @property CGFloat pageLength;
 @property CGFloat gapBetweenPages;
index be8c2d0397a0d77d3ba4bdc2cf08c91074e1f099..b945ef0b53d34090be90e739c007d722ed5a5e39 100644 (file)
@@ -166,6 +166,7 @@ WebPageProxy::WebPageProxy(PageClient* pageClient, PassRefPtr<WebProcessProxy> p
     , m_areMemoryCacheClientCallsEnabled(true)
     , m_useFixedLayout(false)
     , m_paginationMode(Page::Pagination::Unpaginated)
+    , m_paginationBehavesLikeColumns(false)
     , m_pageLength(0)
     , m_gapBetweenPages(0)
     , m_isValid(true)
@@ -1313,6 +1314,18 @@ void WebPageProxy::setPaginationMode(WebCore::Page::Pagination::Mode mode)
     process()->send(Messages::WebPage::SetPaginationMode(mode), m_pageID);
 }
 
+void WebPageProxy::setPaginationBehavesLikeColumns(bool behavesLikeColumns)
+{
+    if (behavesLikeColumns == m_paginationBehavesLikeColumns)
+        return;
+
+    m_paginationBehavesLikeColumns = behavesLikeColumns;
+
+    if (!isValid())
+        return;
+    process()->send(Messages::WebPage::SetPaginationBehavesLikeColumns(behavesLikeColumns), m_pageID);
+}
+
 void WebPageProxy::setPageLength(double pageLength)
 {
     if (pageLength == m_pageLength)
@@ -3270,6 +3283,7 @@ WebPageCreationParameters WebPageProxy::creationParameters() const
     parameters.useFixedLayout = m_useFixedLayout;
     parameters.fixedLayoutSize = m_fixedLayoutSize;
     parameters.paginationMode = m_paginationMode;
+    parameters.paginationBehavesLikeColumns = m_paginationBehavesLikeColumns;
     parameters.pageLength = m_pageLength;
     parameters.gapBetweenPages = m_gapBetweenPages;
     parameters.userAgent = userAgent();
index 13c8cf1078593260f7c5f30facd67563bdf947ef..caa5df4a245bd9d06dc3cb4821eb3297e047a10e 100644 (file)
@@ -441,6 +441,8 @@ public:
 
     void setPaginationMode(WebCore::Page::Pagination::Mode);
     WebCore::Page::Pagination::Mode paginationMode() const { return m_paginationMode; }
+    void setPaginationBehavesLikeColumns(bool);
+    bool paginationBehavesLikeColumns() const { return m_paginationBehavesLikeColumns; }
     void setPageLength(double);
     double pageLength() const { return m_pageLength; }
     void setGapBetweenPages(double);
@@ -947,6 +949,7 @@ private:
     WebCore::IntSize m_fixedLayoutSize;
 
     WebCore::Page::Pagination::Mode m_paginationMode;
+    bool m_paginationBehavesLikeColumns;
     double m_pageLength;
     double m_gapBetweenPages;
 
index 227c4c7f5bc619b763ea6815c7cea2af1aeac7b3..3b9a487e4ab79f6bdf705f6689bcb24ae3909bec 100644 (file)
@@ -261,6 +261,7 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
     setDrawsTransparentBackground(parameters.drawsTransparentBackground);
 
     setPaginationMode(parameters.paginationMode);
+    setPaginationBehavesLikeColumns(parameters.paginationBehavesLikeColumns);
     setPageLength(parameters.pageLength);
     setGapBetweenPages(parameters.gapBetweenPages);
 
@@ -1023,6 +1024,13 @@ void WebPage::setPaginationMode(uint32_t mode)
     m_page->setPagination(pagination);
 }
 
+void WebPage::setPaginationBehavesLikeColumns(bool behavesLikeColumns)
+{
+    Page::Pagination pagination = m_page->pagination();
+    pagination.behavesLikeColumns = behavesLikeColumns;
+    m_page->setPagination(pagination);
+}
+
 void WebPage::setPageLength(double pageLength)
 {
     Page::Pagination pagination = m_page->pagination();
index 0512be89d08e72611c64027a6df5e93c1d935636..09eef272a94ab68cc39693db9a0ba509cd3ef5b8 100644 (file)
@@ -279,6 +279,7 @@ public:
     void setFixedLayoutSize(const WebCore::IntSize&);
 
     void setPaginationMode(uint32_t /* WebCore::Page::Pagination::Mode */);
+    void setPaginationBehavesLikeColumns(bool);
     void setPageLength(double);
     void setGapBetweenPages(double);
 
index 708e16f57728ec6292459f45266f6d986d5d28fb..415460137f85686f6e5a2d780b619b72e5de0dc1 100644 (file)
@@ -126,6 +126,7 @@ messages -> WebPage {
     SetFixedLayoutSize(WebCore::IntSize size)
 
     SetPaginationMode(uint32_t mode);
+    SetPaginationBehavesLikeColumns(bool behavesLikeColumns);
     SetPageLength(double pageLength);
     SetGapBetweenPages(double gap);