Changeset 126343 in webkit


Ignore:
Timestamp:
Aug 22, 2012 1:20:14 PM (12 years ago)
Author:
Beth Dakin
Message:

https://bugs.webkit.org/show_bug.cgi?id=94401
Add support for making a web site become paginated using overflow:
paged-x | paged-y
-and corresponding-
<rdar://problem/11831783>

Reviewed by Dave Hyatt.

.:

  • Source/autotools/symbols.filter:

Source/WebCore:

This patch adds two new possible values for overflow-y. They are -
webkit-paged-x and -webkit-paged-y. When you set these as overflow-y
values on the html or body element, they make the RenderView
paginated, much like the API on Page.

-webkit-paged-x and -webkit-paged-y are only valid values for
overflow-y, NOT overflow-x. overflow-x defaults to a value of auto
(for now) unless it has been set to something else.

  • css/CSSParser.cpp:

(WebCore::isValidKeywordPropertyAndValue):
(WebCore::CSSParser::parseValue):

Two new CSS value keywords.

  • css/CSSValueKeywords.in:

EOverflow has two new values for pagination.

  • rendering/style/RenderStyleConstants.h:
  • css/CSSPrimitiveValueMappings.h:

(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator EOverflow):

A bunch of existing code from StyleResolver::styleForDocument() is
moved into a helper function so that it can be called from two
places.

  • css/StyleResolver.cpp:

(WebCore::StyleResolver::collectMatchingRulesForList):

Even though this pagination is very similar to Page::pagination(), it
is different in one critical way. Page::pagination() will apply to
all FrameViews, even those in the page cache. For this reason,
FrameView needs to keep its own Pagination value that just applies to
this FrameView.

  • page/FrameView.cpp:
  • page/FrameView.h:

(WebCore):
(FrameView):

Map RenderStyle values to a Pagination::Mode.
(WebCore::paginationModeForRenderStyle):
(WebCore):

Account for paged-x and paged-y here.
(WebCore::FrameView::applyOverflowToViewport):

As is explained in the header, FrameView::pagination() will return
m_pagination if it has been set. Otherwise, it will return
Page::pagination() since currently there are no callers that need to
distinguish between the two.
(WebCore::FrameView::pagination):
(WebCore::FrameView::setPagination):

Generally this means that everywhere in WebCore should ask FrameView
for the pagination(), not Page. These call sites all look to
FrameView now.
(WebCore::FrameView::paintContents):

  • rendering/RenderView.cpp:

(WebCore::RenderView::requiresColumns):
(WebCore::RenderView::calcColumnWidth):
(WebCore::RenderView::paginationUnit):
(WebCore::RenderView::viewLogicalHeight):

Since we need to define Pagination in Page.h AND FrameView.h, it is
now in its own header, Pagination.h. And therefore it is no longer
WebCore::Page::Pagination, but rather it is just WebCore::Pagination.

  • page/Page.h:

(Page):

  • rendering/Pagination.h: Added.

(WebCore):
(WebCore::Pagination::Pagination):
(Pagination):
(WebCore::Pagination::operator==):
(WebCore::Pagination::operator!=):

  • WebCore.exp.in:
  • WebCore.xcodeproj/project.pbxproj:
  • GNUmakefile.list.am:
  • Target.pri:
  • WebCore.exp.in:
  • WebCore.gypi:

Certain ColumnInfo values are set based on the RenderStyle. So if
those RenderStyle values change, the ColumnInfo needs to be updated.

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::updateColumnInfoFromStyle):
(WebCore):

  • rendering/RenderBlock.h:

(RenderBlock):

Factor in paged-x and paged-y when determining if a RenderBlock
requires columns.
(WebCore::RenderBlock::requiresColumns):

RenderStyle::specifiesColumns() is an odd and probably broken
function. At the very least, it should be re-named, if not removed
entirely. It does not accurately assess if columns have been
specified. I had to add this code here because specifiesColumns()
returns false for paged-x and true for paged-y. We were hitting a
number of crashes with paged-y because of this, so I chose for the
time being to limit this check to non-root layers.

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::shouldBeNormalFlowOnly):

It's just Pagination now, not Page::Pagination.

  • testing/InternalSettings.cpp:

(WebCore::InternalSettings::reset):
(WebCore::InternalSettings::setPagination):

Source/WebKit/mac:

WebCore::Page::Pagination is now just WebCore::Pagination.

  • WebView/WebView.mm:

(-[WebView _setPaginationMode:]):
(-[WebView _paginationMode]):
(-[WebView _setPaginationBehavesLikeColumns:]):
(-[WebView _setPageLength:]):
(-[WebView _setGapBetweenPages:]):

Source/WebKit2:

WebCore::Page::Pagination is now just WebCore::Pagination.

  • Shared/WebPageCreationParameters.h:

(WebPageCreationParameters):

  • UIProcess/API/C/WKPage.cpp:

(WKPageSetPaginationMode):
(WKPageGetPaginationMode):

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::setPaginationMode):

  • UIProcess/WebPageProxy.h:

(WebPageProxy):
(WebKit::WebPageProxy::paginationMode):

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::setPaginationMode):
(WebKit::WebPage::setPaginationBehavesLikeColumns):
(WebKit::WebPage::setPageLength):
(WebKit::WebPage::setGapBetweenPages):

  • WebProcess/WebPage/WebPage.h:

(WebPage):

LayoutTests:

Test the parsing of the two new values.

  • fast/css/overflow-property-expected.txt:
  • fast/css/overflow-property.html:

New tests.

  • fast/overflow/paged-x-div.html: Added.
  • fast/overflow/paged-x-on-root.html: Added.
  • fast/overflow/paged-y-div.html: Added.
  • fast/overflow/paged-y-on-root.html: Added.
  • platform/mac/fast/overflow/paged-x-div-expected.png: Added.
  • platform/mac/fast/overflow/paged-x-div-expected.txt: Added.
  • platform/mac/fast/overflow/paged-x-on-root-expected.png: Added.
  • platform/mac/fast/overflow/paged-x-on-root-expected.txt: Added.
  • platform/mac/fast/overflow/paged-y-div-expected.png: Added.
  • platform/mac/fast/overflow/paged-y-div-expected.txt: Added.
  • platform/mac/fast/overflow/paged-y-on-root-expected.png: Added.
  • platform/mac/fast/overflow/paged-y-on-root-expected.txt: Added.
Location:
trunk
Files:
13 added
35 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r126306 r126343  
     12012-08-22  Beth Dakin  <bdakin@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=94401
     4        Add support for making a web site become paginated using overflow:
     5        paged-x | paged-y
     6        -and corresponding-
     7        <rdar://problem/11831783>
     8
     9        Reviewed by Dave Hyatt.
     10
     11        * Source/autotools/symbols.filter:
     12
    1132012-08-22  Gustavo Noronha Silva  <gns@gnome.org>
    214
  • trunk/LayoutTests/ChangeLog

    r126337 r126343  
     12012-08-22  Beth Dakin  <bdakin@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=94401
     4        Add support for making a web site become paginated using overflow:
     5        paged-x | paged-y
     6        -and corresponding-
     7        <rdar://problem/11831783>
     8
     9        Reviewed by Dave Hyatt.
     10
     11        Test the parsing of the two new values.
     12        * fast/css/overflow-property-expected.txt:
     13        * fast/css/overflow-property.html:
     14
     15        New tests.
     16        * fast/overflow/paged-x-div.html: Added.
     17        * fast/overflow/paged-x-on-root.html: Added.
     18        * fast/overflow/paged-y-div.html: Added.
     19        * fast/overflow/paged-y-on-root.html: Added.
     20        * platform/mac/fast/overflow/paged-x-div-expected.png: Added.
     21        * platform/mac/fast/overflow/paged-x-div-expected.txt: Added.
     22        * platform/mac/fast/overflow/paged-x-on-root-expected.png: Added.
     23        * platform/mac/fast/overflow/paged-x-on-root-expected.txt: Added.
     24        * platform/mac/fast/overflow/paged-y-div-expected.png: Added.
     25        * platform/mac/fast/overflow/paged-y-div-expected.txt: Added.
     26        * platform/mac/fast/overflow/paged-y-on-root-expected.png: Added.
     27        * platform/mac/fast/overflow/paged-y-on-root-expected.txt: Added.
     28
    1292012-08-22  Mark Lam  <mark.lam@apple.com>
    230
  • trunk/LayoutTests/fast/css/overflow-property-expected.txt

    r35892 r126343  
    2727PASS test7.style.overflowX is ""
    2828PASS test7.style.overflowY is ""
     29PASS test8.style.overflowX is ""
     30PASS test8.style.overflowY is "-webkit-paged-x"
     31PASS test9.style.overflowX is "auto"
     32PASS test9.style.overflowY is "-webkit-paged-y"
     33PASS test10.style.overflowX is "visible"
     34PASS test10.style.overflowY is "-webkit-paged-y"
    2935PASS successfullyParsed is true
    3036
  • trunk/LayoutTests/fast/css/overflow-property.html

    r98407 r126343  
    1818<div id="test6" style="overflow: invalid"></div>
    1919<div id="test7"></div>
     20<div id="test8" style="overflow-y: -webkit-paged-x;"></div>
     21<div id="test9" style="overflow: -webkit-paged-y;"></div>
     22<div id="test10" style="overflow-x: visible; overflow-y: -webkit-paged-y;"></div>
    2023
    2124</div>
     
    3033    var test6 = document.getElementById("test6");
    3134    var test7 = document.getElementById("test6");
     35    var test8 = document.getElementById("test8");
     36    var test9 = document.getElementById("test9");
     37    var test10 = document.getElementById("test10");
    3238
    3339    shouldBeEqualToString("test0.style.overflow", "auto");
     
    5763    shouldBeEqualToString("test7.style.overflowX", "");
    5864    shouldBeEqualToString("test7.style.overflowY", "");
     65    shouldBeEqualToString("test8.style.overflowX", "");
     66    shouldBeEqualToString("test8.style.overflowY", "-webkit-paged-x");
     67    shouldBeEqualToString("test9.style.overflowX", "auto");
     68    shouldBeEqualToString("test9.style.overflowY", "-webkit-paged-y");
     69    shouldBeEqualToString("test10.style.overflowX", "visible");
     70    shouldBeEqualToString("test10.style.overflowY", "-webkit-paged-y");
    5971
    6072    // clean up after ourselves
  • trunk/Source/WebCore/ChangeLog

    r126342 r126343  
     12012-08-22  Beth Dakin  <bdakin@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=94401
     4        Add support for making a web site become paginated using overflow:
     5        paged-x | paged-y
     6        -and corresponding-
     7        <rdar://problem/11831783>
     8
     9        Reviewed by Dave Hyatt.
     10
     11        This patch adds two new possible values for overflow-y. They are -
     12        webkit-paged-x and -webkit-paged-y. When you set these as overflow-y
     13        values on the html or body element, they make the RenderView
     14        paginated, much like the API on Page.
     15
     16        -webkit-paged-x and -webkit-paged-y are only valid values for
     17        overflow-y, NOT overflow-x. overflow-x defaults to a value of auto
     18        (for now) unless it has been set to something else.
     19        * css/CSSParser.cpp:
     20        (WebCore::isValidKeywordPropertyAndValue):
     21        (WebCore::CSSParser::parseValue):
     22
     23        Two new CSS value keywords.
     24        * css/CSSValueKeywords.in:
     25
     26        EOverflow has two new values for pagination.
     27        * rendering/style/RenderStyleConstants.h:
     28        * css/CSSPrimitiveValueMappings.h:
     29        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
     30        (WebCore::CSSPrimitiveValue::operator EOverflow):
     31
     32        A bunch of existing code from StyleResolver::styleForDocument() is
     33        moved into a helper function so that it can be called from two
     34        places.
     35        * css/StyleResolver.cpp:
     36        (WebCore::StyleResolver::collectMatchingRulesForList):
     37
     38        Even though this pagination is very similar to Page::pagination(), it
     39        is different in one critical way. Page::pagination() will apply to
     40        all FrameViews, even those in the page cache. For this reason,
     41        FrameView needs to keep its own Pagination value that just applies to
     42        this FrameView.
     43        * page/FrameView.cpp:
     44        * page/FrameView.h:
     45        (WebCore):
     46        (FrameView):
     47
     48        Map RenderStyle values to a Pagination::Mode.
     49        (WebCore::paginationModeForRenderStyle):
     50        (WebCore):
     51
     52        Account for paged-x and paged-y here.
     53        (WebCore::FrameView::applyOverflowToViewport):
     54
     55        As is explained in the header, FrameView::pagination() will return
     56        m_pagination if it has been set. Otherwise, it will return
     57        Page::pagination() since currently there are no callers that need to
     58        distinguish between the two.
     59        (WebCore::FrameView::pagination):
     60        (WebCore::FrameView::setPagination):
     61
     62        Generally this means that everywhere in WebCore should ask FrameView
     63        for the pagination(), not Page. These call sites all look to
     64        FrameView now.
     65        (WebCore::FrameView::paintContents):
     66        * rendering/RenderView.cpp:
     67        (WebCore::RenderView::requiresColumns):
     68        (WebCore::RenderView::calcColumnWidth):
     69        (WebCore::RenderView::paginationUnit):
     70        (WebCore::RenderView::viewLogicalHeight):
     71
     72        Since we need to define Pagination in Page.h AND FrameView.h, it is
     73        now in its own header, Pagination.h. And therefore it is no longer
     74        WebCore::Page::Pagination, but rather it is just WebCore::Pagination.
     75        * page/Page.h:
     76        (Page):
     77        * rendering/Pagination.h: Added.
     78        (WebCore):
     79        (WebCore::Pagination::Pagination):
     80        (Pagination):
     81        (WebCore::Pagination::operator==):
     82        (WebCore::Pagination::operator!=):
     83        * WebCore.exp.in:
     84        * WebCore.xcodeproj/project.pbxproj:
     85        * GNUmakefile.list.am:
     86        * Target.pri:
     87        * WebCore.exp.in:
     88        * WebCore.gypi:
     89
     90        Certain ColumnInfo values are set based on the RenderStyle. So if
     91        those RenderStyle values change, the ColumnInfo needs to be updated.
     92        * rendering/RenderBlock.cpp:
     93        (WebCore::RenderBlock::updateColumnInfoFromStyle):
     94        (WebCore):
     95        * rendering/RenderBlock.h:
     96        (RenderBlock):
     97
     98        Factor in paged-x and paged-y when determining if a RenderBlock
     99        requires columns.
     100        (WebCore::RenderBlock::requiresColumns):
     101
     102        RenderStyle::specifiesColumns() is an odd and probably broken
     103        function. At the very least, it should be re-named, if not removed
     104        entirely. It does not accurately assess if columns have been
     105        specified. I had to add this code here because specifiesColumns()
     106        returns false for paged-x and true for paged-y. We were hitting a
     107        number of crashes with paged-y because of this, so I chose for the
     108        time being to limit this check to non-root layers.
     109        * rendering/RenderLayer.cpp:
     110        (WebCore::RenderLayer::shouldBeNormalFlowOnly):
     111
     112        It's just Pagination now, not Page::Pagination.
     113        * testing/InternalSettings.cpp:
     114        (WebCore::InternalSettings::reset):
     115        (WebCore::InternalSettings::setPagination):
     116
    11172012-08-22  Dean Jackson  <dino@apple.com>
    2118
  • trunk/Source/WebCore/GNUmakefile.list.am

    r126333 r126343  
    41094109        Source/WebCore/rendering/LayoutRepainter.cpp \
    41104110        Source/WebCore/rendering/OverlapTestRequestClient.h \
     4111        Source/WebCore/rendering/Pagination.h \
    41114112        Source/WebCore/rendering/PaintInfo.h \
    41124113        Source/WebCore/rendering/PaintPhase.h \
  • trunk/Source/WebCore/Target.pri

    r126304 r126343  
    22862286    rendering/mathml/RenderMathMLSubSup.h \
    22872287    rendering/mathml/RenderMathMLUnderOver.h \
     2288    rendering/Pagination.h \
    22882289    rendering/PaintInfo.h \
    22892290    rendering/PaintPhase.h \
  • trunk/Source/WebCore/WebCore.exp.in

    r126017 r126343  
    663663__ZN7WebCore4Page12setGroupNameERKN3WTF6StringE
    664664__ZN7WebCore4Page13rangeOfStringERKN3WTF6StringEPNS_5RangeEj
    665 __ZN7WebCore4Page13setPaginationERKNS0_10PaginationE
     665__ZN7WebCore4Page13setPaginationERKNS_10PaginationE
    666666__ZN7WebCore4Page14setMediaVolumeEf
    667667__ZN7WebCore4Page15addSchedulePairEN3WTF10PassRefPtrINS_12SchedulePairEEE
  • trunk/Source/WebCore/WebCore.gypi

    r126333 r126343  
    553553            'rendering/LayoutRepainter.h',
    554554            'rendering/OverlapTestRequestClient.h',
     555            'rendering/Pagination.h',
    555556            'rendering/PaintInfo.h',
    556557            'rendering/PaintPhase.h',
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r126304 r126343  
    32463246                9363B62D0F8E8FE000803810 /* HistoryPropertyList.h in Headers */ = {isa = PBXBuildFile; fileRef = 9363B62B0F8E8FE000803810 /* HistoryPropertyList.h */; settings = {ATTRIBUTES = (Private, ); }; };
    32473247                9370918D1416D86B00477333 /* textAreaResizeCorner@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9370918C1416D86B00477333 /* textAreaResizeCorner@2x.png */; };
     3248                9377ABA015DEFEEF0031FD04 /* Pagination.h in Headers */ = {isa = PBXBuildFile; fileRef = 9377AB9F15DEFEEF0031FD04 /* Pagination.h */; settings = {ATTRIBUTES = (Private, ); }; };
    32483249                93799EF80BF2743600D0F230 /* RenderWordBreak.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93799EF60BF2743600D0F230 /* RenderWordBreak.cpp */; };
    32493250                93799EF90BF2743600D0F230 /* RenderWordBreak.h in Headers */ = {isa = PBXBuildFile; fileRef = 93799EF70BF2743600D0F230 /* RenderWordBreak.h */; };
     
    1039510396                936DD03A09CEAC270056AE8C /* Range.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Range.idl; sourceTree = "<group>"; };
    1039610397                9370918C1416D86B00477333 /* textAreaResizeCorner@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "textAreaResizeCorner@2x.png"; sourceTree = "<group>"; };
     10398                9377AB9F15DEFEEF0031FD04 /* Pagination.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Pagination.h; sourceTree = "<group>"; };
    1039710399                93799EF60BF2743600D0F230 /* RenderWordBreak.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderWordBreak.cpp; sourceTree = "<group>"; };
    1039810400                93799EF70BF2743600D0F230 /* RenderWordBreak.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderWordBreak.h; sourceTree = "<group>"; };
     
    2126921271                                BACF290013B2A0D500781F90 /* LayoutTypes.h */,
    2127021272                                3774ABA30FA21EB400AD7DE9 /* OverlapTestRequestClient.h */,
     21273                                9377AB9F15DEFEEF0031FD04 /* Pagination.h */,
    2127121274                                0885067D11DA045B00182B98 /* PaintInfo.h */,
    2127221275                                0885067E11DA045B00182B98 /* PaintPhase.h */,
     
    2543525438                                977E2E0F12F0FC9C00C13379 /* XSSAuditor.h in Headers */,
    2543625439                                FD537353137B651800008DCE /* ZeroPole.h in Headers */,
     25440                                9377ABA015DEFEEF0031FD04 /* Pagination.h in Headers */,
    2543725441                        );
    2543825442                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/Source/WebCore/css/CSSParser.cpp

    r126201 r126343  
    597597            return true;
    598598        break;
    599     case CSSPropertyOverflowX:
    600     case CSSPropertyOverflowY: // visible | hidden | scroll | auto | marquee | overlay | inherit
     599    case CSSPropertyOverflowX: // visible | hidden | scroll | auto | marquee | overlay | inherit
    601600        if (valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueScroll || valueID == CSSValueAuto || valueID == CSSValueOverlay || valueID == CSSValueWebkitMarquee)
     601            return true;
     602        break;
     603    case CSSPropertyOverflowY: // visible | hidden | scroll | auto | marquee | overlay | inherit | -webkit-paged-x | -webkit-paged-y
     604        if (valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueScroll || valueID == CSSValueAuto || valueID == CSSValueOverlay || valueID == CSSValueWebkitMarquee || valueID == CSSValueWebkitPagedX || valueID == CSSValueWebkitPagedY)
    602605            return true;
    603606        break;
     
    17591762    case CSSPropertyOverflow: {
    17601763        ShorthandScope scope(this, propId);
    1761         if (num != 1 || !parseValue(CSSPropertyOverflowX, important))
    1762             return false;
    1763         CSSValue* value = m_parsedProperties->last().value();
    1764         addProperty(CSSPropertyOverflowY, value, important);
     1764        if (num != 1 || !parseValue(CSSPropertyOverflowY, important))
     1765            return false;
     1766
     1767        RefPtr<CSSValue> overflowXValue;
     1768
     1769        // FIXME: -webkit-paged-x or -webkit-paged-y only apply to overflow-y. If this value has been
     1770        // set using the shorthand, then for now overflow-x will default to auto, but once we implement
     1771        // pagination controls, it should default to hidden. If the overflow-y value is anything but
     1772        // paged-x or paged-y, then overflow-x and overflow-y should have the same value.
     1773        if (id == CSSValueWebkitPagedX || id == CSSValueWebkitPagedY)
     1774            overflowXValue = cssValuePool().createIdentifierValue(CSSValueAuto);
     1775        else
     1776            overflowXValue = m_parsedProperties->last().value();
     1777        addProperty(CSSPropertyOverflowX, overflowXValue.release(), important);
    17651778        return true;
    17661779    }
  • trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h

    r126072 r126343  
    19611961            m_value.ident = CSSValueOverlay;
    19621962            break;
     1963        case OPAGEDX:
     1964            m_value.ident = CSSValueWebkitPagedX;
     1965            break;
     1966        case OPAGEDY:
     1967            m_value.ident = CSSValueWebkitPagedY;
     1968            break;
    19631969    }
    19641970}
     
    19791985        case CSSValueOverlay:
    19801986            return OOVERLAY;
     1987        case CSSValueWebkitPagedX:
     1988            return OPAGEDX;
     1989        case CSSValueWebkitPagedY:
     1990            return OPAGEDY;
    19811991    }
    19821992
  • trunk/Source/WebCore/css/CSSValueKeywords.in

    r126105 r126343  
    965965#endif
    966966
     967// overflow
     968-webkit-paged-x
     969-webkit-paged-y
     970
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r126054 r126343  
    9797#include "RenderStyleConstants.h"
    9898#include "RenderTheme.h"
     99#include "RenderView.h"
    99100#include "RotateTransformOperation.h"
    100101#include "SVGDocumentExtensions.h"
     
    16011602}
    16021603
     1604static void setStylesForPaginationMode(Pagination::Mode paginationMode, RenderStyle* style)
     1605{
     1606    if (paginationMode == Pagination::Unpaginated)
     1607        return;
     1608       
     1609    switch (paginationMode) {
     1610    case Pagination::LeftToRightPaginated:
     1611        style->setColumnAxis(HorizontalColumnAxis);
     1612        if (style->isHorizontalWritingMode())
     1613            style->setColumnProgression(style->isLeftToRightDirection() ? NormalColumnProgression : ReverseColumnProgression);
     1614        else
     1615            style->setColumnProgression(style->isFlippedBlocksWritingMode() ? ReverseColumnProgression : NormalColumnProgression);
     1616        break;
     1617    case Pagination::RightToLeftPaginated:
     1618        style->setColumnAxis(HorizontalColumnAxis);
     1619        if (style->isHorizontalWritingMode())
     1620            style->setColumnProgression(style->isLeftToRightDirection() ? ReverseColumnProgression : NormalColumnProgression);
     1621        else
     1622            style->setColumnProgression(style->isFlippedBlocksWritingMode() ? NormalColumnProgression : ReverseColumnProgression);
     1623        break;
     1624    case Pagination::TopToBottomPaginated:
     1625        style->setColumnAxis(VerticalColumnAxis);
     1626        if (style->isHorizontalWritingMode())
     1627            style->setColumnProgression(style->isFlippedBlocksWritingMode() ? ReverseColumnProgression : NormalColumnProgression);
     1628        else
     1629            style->setColumnProgression(style->isLeftToRightDirection() ? NormalColumnProgression : ReverseColumnProgression);
     1630        break;
     1631    case Pagination::BottomToTopPaginated:
     1632        style->setColumnAxis(VerticalColumnAxis);
     1633        if (style->isHorizontalWritingMode())
     1634            style->setColumnProgression(style->isFlippedBlocksWritingMode() ? NormalColumnProgression : ReverseColumnProgression);
     1635        else
     1636            style->setColumnProgression(style->isLeftToRightDirection() ? ReverseColumnProgression : NormalColumnProgression);
     1637        break;
     1638    case Pagination::Unpaginated:
     1639        ASSERT_NOT_REACHED();
     1640        break;
     1641    }
     1642}
     1643
    16031644PassRefPtr<RenderStyle> StyleResolver::styleForDocument(Document* document, CSSFontSelector* fontSelector)
    16041645{
     
    16461687
    16471688    if (frame) {
    1648         if (Page* page = frame->page()) {
    1649             const Page::Pagination& pagination = page->pagination();
    1650             if (pagination.mode != Page::Pagination::Unpaginated) {
    1651                 switch (pagination.mode) {
    1652                 case Page::Pagination::LeftToRightPaginated:
    1653                     documentStyle->setColumnAxis(HorizontalColumnAxis);
    1654                     if (documentStyle->isHorizontalWritingMode())
    1655                         documentStyle->setColumnProgression(documentStyle->isLeftToRightDirection() ? NormalColumnProgression : ReverseColumnProgression);
    1656                     else
    1657                         documentStyle->setColumnProgression(documentStyle->isFlippedBlocksWritingMode() ? ReverseColumnProgression : NormalColumnProgression);
    1658                     break;
    1659                 case Page::Pagination::RightToLeftPaginated:
    1660                     documentStyle->setColumnAxis(HorizontalColumnAxis);
    1661                     if (documentStyle->isHorizontalWritingMode())
    1662                         documentStyle->setColumnProgression(documentStyle->isLeftToRightDirection() ? ReverseColumnProgression : NormalColumnProgression);
    1663                     else
    1664                         documentStyle->setColumnProgression(documentStyle->isFlippedBlocksWritingMode() ? NormalColumnProgression : ReverseColumnProgression);
    1665                     break;
    1666                 case Page::Pagination::TopToBottomPaginated:
    1667                     documentStyle->setColumnAxis(VerticalColumnAxis);
    1668                     if (documentStyle->isHorizontalWritingMode())
    1669                         documentStyle->setColumnProgression(documentStyle->isFlippedBlocksWritingMode() ? ReverseColumnProgression : NormalColumnProgression);
    1670                     else
    1671                         documentStyle->setColumnProgression(documentStyle->isLeftToRightDirection() ? NormalColumnProgression : ReverseColumnProgression);
    1672                     break;
    1673                 case Page::Pagination::BottomToTopPaginated:
    1674                     documentStyle->setColumnAxis(VerticalColumnAxis);
    1675                     if (documentStyle->isHorizontalWritingMode())
    1676                         documentStyle->setColumnProgression(documentStyle->isFlippedBlocksWritingMode() ? NormalColumnProgression : ReverseColumnProgression);
    1677                     else
    1678                         documentStyle->setColumnProgression(documentStyle->isLeftToRightDirection() ? ReverseColumnProgression : NormalColumnProgression);
    1679                     break;
    1680                 case Page::Pagination::Unpaginated:
    1681                     ASSERT_NOT_REACHED();
    1682                     break;
     1689        if (FrameView* frameView = frame->view()) {
     1690            const Pagination& pagination = frameView->pagination();
     1691            if (pagination.mode != Pagination::Unpaginated) {
     1692                setStylesForPaginationMode(pagination.mode, documentStyle.get());
     1693                documentStyle->setColumnGap(pagination.gap);
     1694                if (RenderView* view = document->renderView()) {
     1695                    if (view->hasColumns())
     1696                        view->updateColumnInfoFromStyle(documentStyle.get());
    16831697                }
    1684 
    1685                 documentStyle->setColumnGap(pagination.gap);
    16861698            }
    16871699        }
     
    22072219    else if (style->overflowY() == OMARQUEE && style->overflowX() != OMARQUEE)
    22082220        style->setOverflowX(OMARQUEE);
    2209     else if (style->overflowX() == OVISIBLE && style->overflowY() != OVISIBLE)
     2221    else if (style->overflowX() == OVISIBLE && style->overflowY() != OVISIBLE) {
     2222        // FIXME: Once we implement pagination controls, overflow-x should default to hidden
     2223        // if overflow-y is set to -webkit-paged-x or -webkit-page-y. For now, we'll let it
     2224        // default to auto so we can at least scroll through the pages.
    22102225        style->setOverflowX(OAUTO);
    2211     else if (style->overflowY() == OVISIBLE && style->overflowX() != OVISIBLE)
     2226    } else if (style->overflowY() == OVISIBLE && style->overflowX() != OVISIBLE)
    22122227        style->setOverflowY(OAUTO);
     2228
     2229    // Call setStylesForPaginationMode() if a pagination mode is set for any non-root elements. If these
     2230    // styles are specified on a root element, then they will be incorporated in
     2231    // StyleResolver::styleForDocument().
     2232    if ((style->overflowY() == OPAGEDX || style->overflowY() == OPAGEDY) && !(e->hasTagName(htmlTag) || e->hasTagName(bodyTag)))
     2233        setStylesForPaginationMode(WebCore::paginationModeForRenderStyle(style), style);
    22132234
    22142235    // Table rows, sections and the table itself will support overflow:hidden and will ignore scroll/auto.
  • trunk/Source/WebCore/page/FrameView.cpp

    r126058 r126343  
    137137}
    138138
     139Pagination::Mode paginationModeForRenderStyle(RenderStyle* style)
     140{
     141    EOverflow overflow = style->overflowY();
     142    if (overflow != OPAGEDX && overflow != OPAGEDY)
     143        return Pagination::Unpaginated;
     144
     145    bool isHorizontalWritingMode = style->isHorizontalWritingMode();
     146    TextDirection textDirection = style->direction();
     147    WritingMode writingMode = style->writingMode();
     148
     149    // paged-x always corresponds to LeftToRightPaginated or RightToLeftPaginated. If the WritingMode
     150    // is horizontal, then we use TextDirection to choose between those options. If the WritingMode
     151    // is vertical, then the direction of the verticality dictates the choice.
     152    if (overflow == OPAGEDX) {
     153        if ((isHorizontalWritingMode && textDirection == LTR) || writingMode == LeftToRightWritingMode)
     154            return Pagination::LeftToRightPaginated;
     155        return Pagination::RightToLeftPaginated;
     156    }
     157
     158    // paged-y always corresponds to TopToBottomPaginated or BottomToTopPaginated. If the WritingMode
     159    // is horizontal, then the direction of the horizontality dictates the choice. If the WritingMode
     160    // is vertical, then we use TextDirection to choose between those options.
     161    if (writingMode == TopToBottomWritingMode || (!isHorizontalWritingMode && textDirection == RTL))
     162        return Pagination::TopToBottomPaginated;
     163    return Pagination::BottomToTopPaginated;
     164}
     165
    139166FrameView::FrameView(Frame* frame)
    140167    : m_frame(frame)
     
    583610            ;
    584611    }
     612
     613    Pagination pagination;
    585614   
    586615     switch (overflowY) {
     
    597626            vMode = ScrollbarAuto;
    598627            break;
     628        case OPAGEDX:
     629            pagination.mode = WebCore::paginationModeForRenderStyle(o->style());
     630            break;
     631        case OPAGEDY:
     632            pagination.mode = WebCore::paginationModeForRenderStyle(o->style());
     633            break;
    599634        default:
    600635            // Don't set it at all.
    601636            ;
    602637    }
     638
     639    setPagination(pagination);
    603640
    604641    m_viewportRenderer = o;
     
    25562593}
    25572594
     2595const Pagination& FrameView::pagination() const
     2596{
     2597    if (m_pagination != Pagination())
     2598        return m_pagination;
     2599
     2600    if (Page* page = m_frame->page()) {
     2601        if (page->mainFrame() == m_frame)
     2602            return page->pagination();
     2603    }
     2604
     2605    return m_pagination;
     2606}
     2607
     2608void FrameView::setPagination(const Pagination& pagination)
     2609{
     2610    if (m_pagination == pagination)
     2611        return;
     2612
     2613    m_pagination = pagination;
     2614
     2615    if (m_frame)
     2616        m_frame->document()->styleResolverChanged(DeferRecalcStyle);
     2617}
     2618
    25582619IntRect FrameView::windowClipRect(bool clipToContents) const
    25592620{
     
    30523113#endif
    30533114
    3054     Page* page = m_frame->page();
    3055     if (page->mainFrame() == m_frame && page->pagination().mode != Page::Pagination::Unpaginated)
     3115    if (pagination().mode != Pagination::Unpaginated)
    30563116        p->fillRect(rect, baseBackgroundColor(), ColorSpaceDeviceRGB);
    30573117
  • trunk/Source/WebCore/page/FrameView.h

    r126058 r126343  
    3030#include "Frame.h"
    3131#include "LayoutTypes.h"
     32#include "Pagination.h"
    3233#include "PaintPhase.h"
    3334#include "ScrollView.h"
     
    5253class RenderObject;
    5354class RenderScrollbarPart;
     55
     56Pagination::Mode paginationModeForRenderStyle(RenderStyle*);
    5457
    5558typedef unsigned long long DOMTimeStamp;
     
    348351    void setScrollingPerformanceLoggingEnabled(bool);
    349352
     353    // Page and FrameView both store a Pagination value. Page::pagination() is set only by API,
     354    // and FrameView::pagination() is set only by CSS. Page::pagination() will affect all
     355    // FrameViews in the page cache, but FrameView::pagination() only affects the current
     356    // FrameView. FrameView::pagination() will return m_pagination if it has been set. Otherwise,
     357    // it will return Page::pagination() since currently there are no callers that need to
     358    // distinguish between the two.
     359    const Pagination& pagination() const;
     360    void setPagination(const Pagination&);
     361
    350362protected:
    351363    virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
     
    484496    bool m_verticalOverflow;   
    485497    RenderObject* m_viewportRenderer;
     498
     499    Pagination m_pagination;
    486500
    487501    bool m_wasScrolledByUser;
  • trunk/Source/WebCore/page/Page.h

    r123942 r126343  
    2626#include "LayoutTypes.h"
    2727#include "PageVisibilityState.h"
     28#include "Pagination.h"
    2829#include "PlatformScreen.h"
    2930#include "PlatformString.h"
     
    247248        void setDeviceScaleFactor(float);
    248249
    249         struct Pagination {
    250             enum Mode { Unpaginated, LeftToRightPaginated, RightToLeftPaginated, TopToBottomPaginated, BottomToTopPaginated };
    251 
    252             Pagination()
    253                 : mode(Unpaginated)
    254                 , behavesLikeColumns(false)
    255                 , pageLength(0)
    256                 , gap(0)
    257             {
    258             };
    259 
    260             bool operator==(const Pagination& other) const
    261             {
    262                 return mode == other.mode && behavesLikeColumns == other.behavesLikeColumns && pageLength == other.pageLength && gap == other.gap;
    263             }
    264 
    265             Mode mode;
    266             bool behavesLikeColumns;
    267             unsigned pageLength;
    268             unsigned gap;
    269         };
    270 
     250        // Page and FrameView both store a Pagination value. Page::pagination() is set only by API,
     251        // and FrameView::pagination() is set only by CSS. Page::pagination() will affect all
     252        // FrameViews in the page cache, but FrameView::pagination() only affects the current
     253        // FrameView.
    271254        const Pagination& pagination() const { return m_pagination; }
    272255        void setPagination(const Pagination&);
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r126335 r126343  
    51155115bool RenderBlock::requiresColumns(int desiredColumnCount) const
    51165116{
     5117    // If overflow-y is set to paged-x or paged-y on the body or html element, we'll handle the paginating
     5118    // in the RenderView instead.
     5119    bool isPaginated = (style()->overflowY() == OPAGEDX || style()->overflowY() == OPAGEDY) && !(isRoot() || isBody());
     5120
    51175121    return firstChild()
    5118         && (desiredColumnCount != 1 || !style()->hasAutoColumnWidth() || !style()->hasInlineColumnAxis())
     5122        && (desiredColumnCount != 1 || !style()->hasAutoColumnWidth() || !style()->hasInlineColumnAxis() || isPaginated)
    51195123        && !firstChild()->isAnonymousColumnsBlock()
    51205124        && !firstChild()->isAnonymousColumnSpanBlock();
     
    51455149        info->setProgressionIsReversed(style()->columnProgression() == ReverseColumnProgression);
    51465150    }
     5151}
     5152
     5153void RenderBlock::updateColumnInfoFromStyle(RenderStyle* style)
     5154{
     5155    if (!hasColumns())
     5156        return;
     5157
     5158    ColumnInfo* info = gColumnInfoMap->get(this);
     5159
     5160    bool needsLayout = false;
     5161    ColumnInfo::Axis oldAxis = info->progressionAxis();
     5162    ColumnInfo::Axis newAxis = style->hasInlineColumnAxis() ? ColumnInfo::InlineAxis : ColumnInfo::BlockAxis;
     5163    if (oldAxis != newAxis) {
     5164        info->setProgressionAxis(newAxis);
     5165        needsLayout = true;
     5166    }
     5167
     5168    bool oldProgressionIsReversed = info->progressionIsReversed();
     5169    bool newProgressionIsReversed = style->columnProgression() == ReverseColumnProgression;
     5170    if (oldProgressionIsReversed != newProgressionIsReversed) {
     5171        info->setProgressionIsReversed(newProgressionIsReversed);
     5172        needsLayout = true;
     5173    }
     5174
     5175    if (needsLayout)
     5176        setNeedsLayoutAndPrefWidthsRecalc();
    51475177}
    51485178
  • trunk/Source/WebCore/rendering/RenderBlock.h

    r126335 r126343  
    267267    ColumnInfo* columnInfo() const;
    268268    int columnGap() const;
     269
     270    void updateColumnInfoFromStyle(RenderStyle*);
    269271   
    270272    // These two functions take the ColumnInfo* to avoid repeated lookups of the info in the global HashMap.
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r126110 r126343  
    47784778                || renderer()->isEmbeddedObject()
    47794779                || renderer()->isRenderIFrame()
    4780                 || renderer()->style()->specifiesColumns())
     4780                || (renderer()->style()->specifiesColumns() && !isRootLayer()))
    47814781            && !renderer()->isOutOfFlowPositioned()
    47824782            && !renderer()->isRelPositioned()
  • trunk/Source/WebCore/rendering/RenderView.cpp

    r126304 r126343  
    218218bool RenderView::requiresColumns(int desiredColumnCount) const
    219219{
    220     if (m_frameView) {
    221         if (Frame* frame = m_frameView->frame()) {
    222             if (Page* page = frame->page())
    223                 return frame == page->mainFrame() && page->pagination().mode != Page::Pagination::Unpaginated;
    224         }
    225     }
     220    if (m_frameView)
     221        return m_frameView->pagination().mode != Pagination::Unpaginated;
     222
    226223    return RenderBlock::requiresColumns(desiredColumnCount);
    227224}
     
    231228    int columnWidth = contentLogicalWidth();
    232229    if (m_frameView && style()->hasInlineColumnAxis()) {
    233         if (Frame* frame = m_frameView->frame()) {
    234             if (Page* page = frame->page()) {
    235                 if (int pageLength = page->pagination().pageLength)
    236                     columnWidth = pageLength;
    237             }
    238         }
     230        if (int pageLength = m_frameView->pagination().pageLength)
     231            columnWidth = pageLength;
    239232    }
    240233    setDesiredColumnCountAndWidth(1, columnWidth);
     
    243236ColumnInfo::PaginationUnit RenderView::paginationUnit() const
    244237{
    245     if (m_frameView) {
    246         if (Frame* frame = m_frameView->frame()) {
    247             if (Page* page = frame->page())
    248                 return (frame == page->mainFrame() && page->pagination().behavesLikeColumns) ? ColumnInfo::Column : ColumnInfo::Page;
    249         }
    250     }
     238    if (m_frameView)
     239        return m_frameView->pagination().behavesLikeColumns ? ColumnInfo::Column : ColumnInfo::Page;
     240
    251241    return ColumnInfo::Page;
    252242}
     
    800790
    801791    if (hasColumns() && !style()->hasInlineColumnAxis()) {
    802         if (Frame* frame = m_frameView->frame()) {
    803             if (Page* page = frame->page()) {
    804                 if (frame == page->mainFrame()) {
    805                     if (int pageLength = page->pagination().pageLength)
    806                         height = pageLength;
    807                 }
    808             }
    809         }
     792        if (int pageLength = m_frameView->pagination().pageLength)
     793            height = pageLength;
    810794    }
    811795
  • trunk/Source/WebCore/rendering/style/RenderStyleConstants.h

    r126054 r126343  
    115115
    116116enum EOverflow {
    117     OVISIBLE, OHIDDEN, OSCROLL, OAUTO, OOVERLAY, OMARQUEE
     117    OVISIBLE, OHIDDEN, OSCROLL, OAUTO, OOVERLAY, OMARQUEE, OPAGEDX, OPAGEDY
    118118};
    119119
  • trunk/Source/WebCore/testing/InternalSettings.cpp

    r125695 r126343  
    161161    TextRun::setAllowsRoundingHacks(false);
    162162    setUserPreferredLanguages(Vector<String>());
    163     page()->setPagination(Page::Pagination());
     163    page()->setPagination(Pagination());
    164164    page()->setPageScaleFactor(1, IntPoint(0, 0));
    165165#if ENABLE(PAGE_POPUP)
     
    566566    }
    567567
    568     Page::Pagination pagination;
     568    Pagination pagination;
    569569    if (mode == "Unpaginated")
    570         pagination.mode = Page::Pagination::Unpaginated;
     570        pagination.mode = Pagination::Unpaginated;
    571571    else if (mode == "LeftToRightPaginated")
    572         pagination.mode = Page::Pagination::LeftToRightPaginated;
     572        pagination.mode = Pagination::LeftToRightPaginated;
    573573    else if (mode == "RightToLeftPaginated")
    574         pagination.mode = Page::Pagination::RightToLeftPaginated;
     574        pagination.mode = Pagination::RightToLeftPaginated;
    575575    else if (mode == "TopToBottomPaginated")
    576         pagination.mode = Page::Pagination::TopToBottomPaginated;
     576        pagination.mode = Pagination::TopToBottomPaginated;
    577577    else if (mode == "BottomToTopPaginated")
    578         pagination.mode = Page::Pagination::BottomToTopPaginated;
     578        pagination.mode = Pagination::BottomToTopPaginated;
    579579    else {
    580580        ec = SYNTAX_ERR;
  • trunk/Source/WebKit/mac/ChangeLog

    r125716 r126343  
     12012-08-22  Beth Dakin  <bdakin@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=94401
     4        Add support for making a web site become paginated using overflow:
     5        paged-x | paged-y
     6        -and corresponding-
     7        <rdar://problem/11831783>
     8
     9        Reviewed by Dave Hyatt.
     10
     11        WebCore::Page::Pagination is now just WebCore::Pagination.
     12        * WebView/WebView.mm:
     13        (-[WebView _setPaginationMode:]):
     14        (-[WebView _paginationMode]):
     15        (-[WebView _setPaginationBehavesLikeColumns:]):
     16        (-[WebView _setPageLength:]):
     17        (-[WebView _setGapBetweenPages:]):
     18
    1192012-08-15  Bruno de Oliveira Abinader  <bruno.abinader@basyskom.com>
    220
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r125235 r126343  
    28072807        return;
    28082808
    2809     Page::Pagination pagination = page->pagination();
     2809    Pagination pagination = page->pagination();
    28102810    switch (paginationMode) {
    28112811    case WebPaginationModeUnpaginated:
    2812         pagination.mode = Page::Pagination::Unpaginated;
     2812        pagination.mode = Pagination::Unpaginated;
    28132813        break;
    28142814    case WebPaginationModeLeftToRight:
    2815         pagination.mode = Page::Pagination::LeftToRightPaginated;
     2815        pagination.mode = Pagination::LeftToRightPaginated;
    28162816        break;
    28172817    case WebPaginationModeRightToLeft:
    2818         pagination.mode = Page::Pagination::RightToLeftPaginated;
     2818        pagination.mode = Pagination::RightToLeftPaginated;
    28192819        break;
    28202820    case WebPaginationModeTopToBottom:
    2821         pagination.mode = Page::Pagination::TopToBottomPaginated;
     2821        pagination.mode = Pagination::TopToBottomPaginated;
    28222822        break;
    28232823    case WebPaginationModeBottomToTop:
    2824         pagination.mode = Page::Pagination::BottomToTopPaginated;
     2824        pagination.mode = Pagination::BottomToTopPaginated;
    28252825        break;
    28262826    default:
     
    28382838
    28392839    switch (page->pagination().mode) {
    2840     case Page::Pagination::Unpaginated:
     2840    case Pagination::Unpaginated:
    28412841        return WebPaginationModeUnpaginated;
    2842     case Page::Pagination::LeftToRightPaginated:
     2842    case Pagination::LeftToRightPaginated:
    28432843        return WebPaginationModeLeftToRight;
    2844     case Page::Pagination::RightToLeftPaginated:
     2844    case Pagination::RightToLeftPaginated:
    28452845        return WebPaginationModeRightToLeft;
    2846     case Page::Pagination::TopToBottomPaginated:
     2846    case Pagination::TopToBottomPaginated:
    28472847        return WebPaginationModeTopToBottom;
    2848     case Page::Pagination::BottomToTopPaginated:
     2848    case Pagination::BottomToTopPaginated:
    28492849        return WebPaginationModeBottomToTop;
    28502850    }
     
    28602860        return;
    28612861
    2862     Page::Pagination pagination = page->pagination();
     2862    Pagination pagination = page->pagination();
    28632863    pagination.behavesLikeColumns = behavesLikeColumns;
    28642864}
     
    28792879        return;
    28802880
    2881     Page::Pagination pagination = page->pagination();
     2881    Pagination pagination = page->pagination();
    28822882    pagination.pageLength = pageLength;
    28832883
     
    29002900        return;
    29012901
    2902     Page::Pagination pagination = page->pagination();
     2902    Pagination pagination = page->pagination();
    29032903    pagination.gap = pageGap;
    29042904    page->setPagination(pagination);
  • trunk/Source/WebKit2/ChangeLog

    r126318 r126343  
     12012-08-22  Beth Dakin  <bdakin@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=94401
     4        Add support for making a web site become paginated using overflow:
     5        paged-x | paged-y
     6        -and corresponding-
     7        <rdar://problem/11831783>
     8
     9        Reviewed by Dave Hyatt.
     10
     11        WebCore::Page::Pagination is now just WebCore::Pagination.
     12        * Shared/WebPageCreationParameters.h:
     13        (WebPageCreationParameters):
     14        * UIProcess/API/C/WKPage.cpp:
     15        (WKPageSetPaginationMode):
     16        (WKPageGetPaginationMode):
     17        * UIProcess/WebPageProxy.cpp:
     18        (WebKit::WebPageProxy::WebPageProxy):
     19        (WebKit::WebPageProxy::setPaginationMode):
     20        * UIProcess/WebPageProxy.h:
     21        (WebPageProxy):
     22        (WebKit::WebPageProxy::paginationMode):
     23        * WebProcess/WebPage/WebPage.cpp:
     24        (WebKit::WebPage::setPaginationMode):
     25        (WebKit::WebPage::setPaginationBehavesLikeColumns):
     26        (WebKit::WebPage::setPageLength):
     27        (WebKit::WebPage::setGapBetweenPages):
     28        * WebProcess/WebPage/WebPage.h:
     29        (WebPage):
     30
    1312012-08-22  Jer Noble  <jer.noble@apple.com>
    232
  • trunk/Source/WebKit2/Shared/WebPageCreationParameters.h

    r120021 r126343  
    6868    WebCore::IntSize fixedLayoutSize;
    6969
    70     WebCore::Page::Pagination::Mode paginationMode;
     70    WebCore::Pagination::Mode paginationMode;
    7171    bool paginationBehavesLikeColumns;
    7272    double pageLength;
  • trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp

    r126311 r126343  
    353353void WKPageSetPaginationMode(WKPageRef pageRef, WKPaginationMode paginationMode)
    354354{
    355     Page::Pagination::Mode mode;
     355    Pagination::Mode mode;
    356356    switch (paginationMode) {
    357357    case kWKPaginationModeUnpaginated:
    358         mode = Page::Pagination::Unpaginated;
     358        mode = Pagination::Unpaginated;
    359359        break;
    360360    case kWKPaginationModeLeftToRight:
    361         mode = Page::Pagination::LeftToRightPaginated;
     361        mode = Pagination::LeftToRightPaginated;
    362362        break;
    363363    case kWKPaginationModeRightToLeft:
    364         mode = Page::Pagination::RightToLeftPaginated;
     364        mode = Pagination::RightToLeftPaginated;
    365365        break;
    366366    case kWKPaginationModeTopToBottom:
    367         mode = Page::Pagination::TopToBottomPaginated;
     367        mode = Pagination::TopToBottomPaginated;
    368368        break;
    369369    case kWKPaginationModeBottomToTop:
    370         mode = Page::Pagination::BottomToTopPaginated;
     370        mode = Pagination::BottomToTopPaginated;
    371371        break;
    372372    default:
     
    379379{
    380380    switch (toImpl(pageRef)->paginationMode()) {
    381     case Page::Pagination::Unpaginated:
     381    case Pagination::Unpaginated:
    382382        return kWKPaginationModeUnpaginated;
    383     case Page::Pagination::LeftToRightPaginated:
     383    case Pagination::LeftToRightPaginated:
    384384        return kWKPaginationModeLeftToRight;
    385     case Page::Pagination::RightToLeftPaginated:
     385    case Pagination::RightToLeftPaginated:
    386386        return kWKPaginationModeRightToLeft;
    387     case Page::Pagination::TopToBottomPaginated:
     387    case Pagination::TopToBottomPaginated:
    388388        return kWKPaginationModeTopToBottom;
    389     case Page::Pagination::BottomToTopPaginated:
     389    case Pagination::BottomToTopPaginated:
    390390        return kWKPaginationModeBottomToTop;
    391391    }
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r126311 r126343  
    184184    , m_areMemoryCacheClientCallsEnabled(true)
    185185    , m_useFixedLayout(false)
    186     , m_paginationMode(Page::Pagination::Unpaginated)
     186    , m_paginationMode(Pagination::Unpaginated)
    187187    , m_paginationBehavesLikeColumns(false)
    188188    , m_pageLength(0)
     
    15031503}
    15041504
    1505 void WebPageProxy::setPaginationMode(WebCore::Page::Pagination::Mode mode)
     1505void WebPageProxy::setPaginationMode(WebCore::Pagination::Mode mode)
    15061506{
    15071507    if (mode == m_paginationMode)
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r126311 r126343  
    489489    bool isPinnedToRightSide() const { return m_mainFrameIsPinnedToRightSide; }
    490490
    491     void setPaginationMode(WebCore::Page::Pagination::Mode);
    492     WebCore::Page::Pagination::Mode paginationMode() const { return m_paginationMode; }
     491    void setPaginationMode(WebCore::Pagination::Mode);
     492    WebCore::Pagination::Mode paginationMode() const { return m_paginationMode; }
    493493    void setPaginationBehavesLikeColumns(bool);
    494494    bool paginationBehavesLikeColumns() const { return m_paginationBehavesLikeColumns; }
     
    10961096    WebCore::IntSize m_fixedLayoutSize;
    10971097
    1098     WebCore::Page::Pagination::Mode m_paginationMode;
     1098    WebCore::Pagination::Mode m_paginationMode;
    10991099    bool m_paginationBehavesLikeColumns;
    11001100    double m_pageLength;
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r126291 r126343  
    11271127void WebPage::setPaginationMode(uint32_t mode)
    11281128{
    1129     Page::Pagination pagination = m_page->pagination();
    1130     pagination.mode = static_cast<Page::Pagination::Mode>(mode);
     1129    Pagination pagination = m_page->pagination();
     1130    pagination.mode = static_cast<Pagination::Mode>(mode);
    11311131    m_page->setPagination(pagination);
    11321132}
     
    11341134void WebPage::setPaginationBehavesLikeColumns(bool behavesLikeColumns)
    11351135{
    1136     Page::Pagination pagination = m_page->pagination();
     1136    Pagination pagination = m_page->pagination();
    11371137    pagination.behavesLikeColumns = behavesLikeColumns;
    11381138    m_page->setPagination(pagination);
     
    11411141void WebPage::setPageLength(double pageLength)
    11421142{
    1143     Page::Pagination pagination = m_page->pagination();
     1143    Pagination pagination = m_page->pagination();
    11441144    pagination.pageLength = pageLength;
    11451145    m_page->setPagination(pagination);
     
    11481148void WebPage::setGapBetweenPages(double gap)
    11491149{
    1150     Page::Pagination pagination = m_page->pagination();
     1150    Pagination pagination = m_page->pagination();
    11511151    pagination.gap = gap;
    11521152    m_page->setPagination(pagination);
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h

    r125670 r126343  
    310310    void setFixedLayoutSize(const WebCore::IntSize&);
    311311
    312     void setPaginationMode(uint32_t /* WebCore::Page::Pagination::Mode */);
     312    void setPaginationMode(uint32_t /* WebCore::Pagination::Mode */);
    313313    void setPaginationBehavesLikeColumns(bool);
    314314    void setPageLength(double);
  • trunk/Source/WebKit2/win/WebKit2.def

    r125759 r126343  
    222222        ?setMockScrollbarsEnabled@Settings@WebCore@@SAX_N@Z
    223223        ?setPageScaleFactor@Page@WebCore@@QAEXMABVIntPoint@2@@Z
    224         ?setPagination@Page@WebCore@@QAEXABUPagination@12@@Z
     224        ?setPagination@Page@WebCore@@QAEXABUPagination@2@@Z
    225225        ?setPictographFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
    226226        ?setResourcesDataSizeLimitsFromInternals@InspectorController@WebCore@@QAEXHH@Z
  • trunk/Source/WebKit2/win/WebKit2CFLite.def

    r124032 r126343  
    216216        ?setMockScrollbarsEnabled@Settings@WebCore@@SAX_N@Z
    217217        ?setPageScaleFactor@Page@WebCore@@QAEXMABVIntPoint@2@@Z
    218         ?setPagination@Page@WebCore@@QAEXABUPagination@12@@Z
     218        ?setPagination@Page@WebCore@@QAEXABUPagination@2@@Z
    219219        ?setPictographFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
    220220        ?setResourcesDataSizeLimitsFromInternals@InspectorController@WebCore@@QAEXHH@Z
  • trunk/Source/autotools/symbols.filter

    r125826 r126343  
    2828_ZN3WTF7CStringaSERKS0_;
    2929_ZN24DumpRenderTreeSupportGtk*;
    30 _ZN7WebCore4Page13setPaginationERKNS0_10PaginationE;
     30_ZN7WebCore4Page13setPaginationERKNS_10PaginationE;
    3131_ZN7WebCore4Page18setPageScaleFactorEfRKNS_8IntPointE;
    3232_ZN7WebCore4Page20setDeviceScaleFactorEf;
Note: See TracChangeset for help on using the changeset viewer.