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: http://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 2534d3e..3a9d499 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 35bb373..887893f 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 fd2e9bf..94b130d 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 6b860b9..951be3f 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 2bced0f..d9cadad 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 1db5dee..2d47374 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 e6190ff..df29107 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 1eb91ec..5307c3f 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 70de98b..9e3f156 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 d4b20dc..e2bf898 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 2bf005d..cd92f31 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 9334442..d4bca9c 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 d051791..08bedb6 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 867c408..7e4f63a 100644 (file)
@@ -64,6 +64,7 @@ struct WebPageCreationParameters {
     WebCore::IntSize fixedLayoutSize;
 
     WebCore::Page::Pagination::Mode paginationMode;
+    bool paginationBehavesLikeColumns;
     double pageLength;
     double gapBetweenPages;
 
index 8768a8d..3010016 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 6572e86..097aabf 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 955b930..2c4341b 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 3585642..c362c55 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 be8c2d0..b945ef0 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 13c8cf1..caa5df4 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 227c4c7..3b9a487 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 0512be8..09eef27 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 708e16f..4154601 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);