Changeset 96675 in webkit


Ignore:
Timestamp:
Oct 4, 2011 9:45:48 PM (13 years ago)
Author:
hyatt@apple.com
Message:

https://bugs.webkit.org/show_bug.cgi?id=69398

Source/WebCore:

[CSS3 Regions] Support the region-overflow property properly.

(1) Change -webkit-break to break, since the -webkit-region-overflow property already has the
-webkit- extension.

(2) Fix clipping so that it works when overflow is set or when region break is set.

(3) Refactor all the pagination spots to check if a next page is available using the new hasNextPage
function. This prevents us from paginating if we hit the last region and further breaks are no longer
allowed.

Reviewed by Dan Bernstein.

Added new tests in fast/regions.

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseValue):

  • css/CSSPrimitiveValueMappings.h:

(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator RegionOverflow):

  • css/CSSValueKeywords.in:
  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::collapseMargins):
(WebCore::RenderBlock::estimateLogicalTopPosition):
(WebCore::RenderBlock::hasNextPage):
(WebCore::RenderBlock::nextPageLogicalTop):
(WebCore::RenderBlock::applyBeforeBreak):
(WebCore::RenderBlock::applyAfterBreak):
(WebCore::RenderBlock::pageLogicalHeightForOffset):
(WebCore::RenderBlock::pageRemainingLogicalHeightForOffset):
(WebCore::RenderBlock::adjustForUnsplittableChild):
(WebCore::RenderBlock::pushToNextPageWithMinimumLogicalHeight):
(WebCore::RenderBlock::adjustLinePositionForPagination):

  • rendering/RenderBlock.h:
  • rendering/RenderFlowThread.cpp:

(WebCore::RenderFlowThread::layout):
(WebCore::RenderFlowThread::repaintRectangleInRegions):
(WebCore::RenderFlowThread::regionRemainingLogicalHeightForLine):

  • rendering/RenderFlowThread.h:
  • rendering/RenderRegion.cpp:

(WebCore::RenderRegion::regionOverflowRect):

LayoutTests:

[CSS3 Regions] Support the region-overflow property properly.

Reviewed by Dan Bernstein.

  • fast/regions/region-overflow-auto-overflow-hidden.html: Added.
  • fast/regions/region-overflow-auto-overflow-visible.html: Added.
  • fast/regions/region-overflow-break.html: Added.
  • fast/regions/script-tests/webkit-region-overflow-parsing.js:
  • fast/regions/webkit-region-overflow-parsing-expected.txt:
  • platform/mac/fast/regions/percentage-margins-mixed-ltr-dominant-regions-expected.png:
  • platform/mac/fast/regions/percentage-margins-mixed-ltr-dominant-regions-expected.txt:
  • platform/mac/fast/regions/percentage-margins-mixed-rtl-dominant-regions-expected.png:
  • platform/mac/fast/regions/percentage-margins-mixed-rtl-dominant-regions-expected.txt:
  • platform/mac/fast/regions/percentage-margins-rtl-variable-width-regions-expected.png:
  • platform/mac/fast/regions/percentage-margins-rtl-variable-width-regions-expected.txt:
  • platform/mac/fast/regions/percentage-margins-variable-width-regions-expected.png:
  • platform/mac/fast/regions/percentage-margins-variable-width-regions-expected.txt:
  • platform/mac/fast/regions/region-overflow-auto-overflow-hidden-expected.png: Added.
  • platform/mac/fast/regions/region-overflow-auto-overflow-hidden-expected.txt: Added.
  • platform/mac/fast/regions/region-overflow-auto-overflow-visible-expected.png: Added.
  • platform/mac/fast/regions/region-overflow-auto-overflow-visible-expected.txt: Added.
  • platform/mac/fast/regions/region-overflow-break-expected.png: Added.
  • platform/mac/fast/regions/region-overflow-break-expected.txt: Added.
  • platform/mac/fast/regions/text-region-split-small-pagination-expected.txt:
  • platform/mac/fast/regions/webkit-flow-floats-inside-regions-bounds-expected.png:
  • platform/mac/fast/regions/webkit-flow-floats-inside-regions-bounds-expected.txt:
  • platform/mac/fast/regions/webkit-flow-inlines-dynamic-expected.png:
  • platform/mac/fast/regions/webkit-flow-inlines-dynamic-expected.txt:
Location:
trunk
Files:
9 added
25 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r96672 r96675  
     12011-10-04  David Hyatt  <hyatt@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=69398
     4
     5        [CSS3 Regions] Support the region-overflow property properly.
     6
     7        Reviewed by Dan Bernstein.
     8
     9        * fast/regions/region-overflow-auto-overflow-hidden.html: Added.
     10        * fast/regions/region-overflow-auto-overflow-visible.html: Added.
     11        * fast/regions/region-overflow-break.html: Added.
     12        * fast/regions/script-tests/webkit-region-overflow-parsing.js:
     13        * fast/regions/webkit-region-overflow-parsing-expected.txt:
     14        * platform/mac/fast/regions/percentage-margins-mixed-ltr-dominant-regions-expected.png:
     15        * platform/mac/fast/regions/percentage-margins-mixed-ltr-dominant-regions-expected.txt:
     16        * platform/mac/fast/regions/percentage-margins-mixed-rtl-dominant-regions-expected.png:
     17        * platform/mac/fast/regions/percentage-margins-mixed-rtl-dominant-regions-expected.txt:
     18        * platform/mac/fast/regions/percentage-margins-rtl-variable-width-regions-expected.png:
     19        * platform/mac/fast/regions/percentage-margins-rtl-variable-width-regions-expected.txt:
     20        * platform/mac/fast/regions/percentage-margins-variable-width-regions-expected.png:
     21        * platform/mac/fast/regions/percentage-margins-variable-width-regions-expected.txt:
     22        * platform/mac/fast/regions/region-overflow-auto-overflow-hidden-expected.png: Added.
     23        * platform/mac/fast/regions/region-overflow-auto-overflow-hidden-expected.txt: Added.
     24        * platform/mac/fast/regions/region-overflow-auto-overflow-visible-expected.png: Added.
     25        * platform/mac/fast/regions/region-overflow-auto-overflow-visible-expected.txt: Added.
     26        * platform/mac/fast/regions/region-overflow-break-expected.png: Added.
     27        * platform/mac/fast/regions/region-overflow-break-expected.txt: Added.
     28        * platform/mac/fast/regions/text-region-split-small-pagination-expected.txt:
     29        * platform/mac/fast/regions/webkit-flow-floats-inside-regions-bounds-expected.png:
     30        * platform/mac/fast/regions/webkit-flow-floats-inside-regions-bounds-expected.txt:
     31        * platform/mac/fast/regions/webkit-flow-inlines-dynamic-expected.png:
     32        * platform/mac/fast/regions/webkit-flow-inlines-dynamic-expected.txt:
     33
    1342011-10-04  Sadrul Habib Chowdhury  <sadrul@chromium.org>
    235
  • trunk/LayoutTests/fast/regions/script-tests/webkit-region-overflow-parsing.js

    r91286 r96675  
    2222shouldBeEqualToString('testCSSText("' + webkitRegionOverflowProperty + ': initial")', "initial");
    2323shouldBeEqualToString('testCSSText("' + webkitRegionOverflowProperty + ': inherit")', "inherit");
    24 shouldBeEqualToString('testCSSText("' + webkitRegionOverflowProperty + ': -webkit-break")', "-webkit-break");
     24shouldBeEqualToString('testCSSText("' + webkitRegionOverflowProperty + ': break")', "break");
    2525shouldBeEqualToString('testCSSText("' + webkitRegionOverflowProperty + ': 0")', "");
    2626shouldBeEqualToString('testCSSText("' + webkitRegionOverflowProperty + ': -1")', "");
     
    3131shouldBeEqualToString('testComputedStyle("initial")', "auto");
    3232shouldBeEqualToString('testComputedStyle("inherit")', "auto");
    33 shouldBeEqualToString('testComputedStyle("-webkit-break")', "-webkit-break");
     33shouldBeEqualToString('testComputedStyle("break")', "break");
    3434shouldBeEqualToString('testComputedStyle("0")', "auto");
    3535shouldBeEqualToString('testComputedStyle("-1")', "auto");
  • trunk/LayoutTests/fast/regions/webkit-region-overflow-parsing-expected.txt

    r91286 r96675  
    77PASS testCSSText("-webkit-region-overflow: initial") is "initial"
    88PASS testCSSText("-webkit-region-overflow: inherit") is "inherit"
    9 PASS testCSSText("-webkit-region-overflow: -webkit-break") is "-webkit-break"
     9PASS testCSSText("-webkit-region-overflow: break") is "break"
    1010PASS testCSSText("-webkit-region-overflow: 0") is ""
    1111PASS testCSSText("-webkit-region-overflow: -1") is ""
     
    1515PASS testComputedStyle("initial") is "auto"
    1616PASS testComputedStyle("inherit") is "auto"
    17 PASS testComputedStyle("-webkit-break") is "-webkit-break"
     17PASS testComputedStyle("break") is "break"
    1818PASS testComputedStyle("0") is "auto"
    1919PASS testComputedStyle("-1") is "auto"
  • trunk/LayoutTests/platform/mac/fast/regions/percentage-margins-mixed-ltr-dominant-regions-expected.txt

    r96423 r96675  
    1212    layer at (0,0) size 300x400
    1313      RenderFlowThread at (0,0) size 300x400
    14         RenderBlock {DIV} at (0,0) size 300x595
    15           RenderBlock {DIV} at (34,5) size 232x585 [border: (1px solid #0000FF)]
    16             RenderBlock {DIV} at (11,11) size 210x563 [border: (1px solid #008000)]
     14        RenderBlock {DIV} at (0,0) size 300x599
     15          RenderBlock {DIV} at (34,5) size 232x589 [border: (1px solid #0000FF)]
     16            RenderBlock {DIV} at (11,11) size 210x567 [border: (1px solid #008000)]
    1717              RenderBlock {P} at (1,17) size 208x157
    1818                RenderText {#text} at (-10,0) size 218x157
     
    2626                  text run at (100,139) width 4 RTL: "."
    2727                  text run at (104,139) width 104: "out of the region"
    28               RenderBlock {P} at (1,190) size 208x248
    29                 RenderText {#text} at (0,0) size 226x248
     28              RenderBlock {P} at (1,190) size 208x236
     29                RenderText {#text} at (0,0) size 226x236
    3030                  text run at (0,0) width 208: "This line of text should not get"
    3131                  text run at (0,18) width 208: "out of the region. This line of"
     
    3838                  text run at (-18,146) width 64: "of text"
    3939                  text run at (4,164) width 42: "should"
    40                   text run at (-18,194) width 64: "not get"
    41                   text run at (-18,212) width 64: "out of the"
    42                   text run at (2,230) width 4 RTL: "."
    43                   text run at (6,230) width 40: "region"
    44               RenderBlock {P} at (1,438) size 208x108
     40                  text run at (-18,182) width 64: "not get"
     41                  text run at (-18,200) width 64: "out of the"
     42                  text run at (2,218) width 4 RTL: "."
     43                  text run at (6,218) width 40: "region"
     44              RenderBlock {P} at (1,442) size 208x108
    4545                RenderText {#text} at (-18,0) size 64x108
    4646                  text run at (-18,0) width 64: "This line"
  • trunk/LayoutTests/platform/mac/fast/regions/percentage-margins-mixed-rtl-dominant-regions-expected.txt

    r96423 r96675  
    1212    layer at (0,0) size 300x400
    1313      RenderFlowThread at (0,0) size 300x400
    14         RenderBlock {DIV} at (0,0) size 300x595
    15           RenderBlock {DIV} at (34,5) size 232x585 [border: (1px solid #0000FF)]
    16             RenderBlock {DIV} at (11,11) size 210x563 [border: (1px solid #008000)]
     14        RenderBlock {DIV} at (0,0) size 300x599
     15          RenderBlock {DIV} at (34,5) size 232x589 [border: (1px solid #0000FF)]
     16            RenderBlock {DIV} at (11,11) size 210x567 [border: (1px solid #008000)]
    1717              RenderBlock {P} at (1,17) size 208x157
    1818                RenderText {#text} at (90,0) size 218x157
     
    2525                  text run at (0,121) width 208: "This line of text should not get"
    2626                  text run at (0,139) width 108: "out of the region."
    27               RenderBlock {P} at (1,190) size 208x248
    28                 RenderText {#text} at (0,0) size 226x248
     27              RenderBlock {P} at (1,190) size 208x236
     28                RenderText {#text} at (0,0) size 226x236
    2929                  text run at (0,0) width 208: "This line of text should not get"
    3030                  text run at (0,18) width 208: "out of the region. This line of"
     
    3737                  text run at (162,146) width 64: "of text"
    3838                  text run at (162,164) width 42: "should"
    39                   text run at (162,194) width 64: "not get"
    40                   text run at (162,212) width 64: "out of the"
    41                   text run at (162,230) width 44: "region."
    42               RenderBlock {P} at (1,438) size 208x108
     39                  text run at (162,182) width 64: "not get"
     40                  text run at (162,200) width 64: "out of the"
     41                  text run at (162,218) width 44: "region."
     42              RenderBlock {P} at (1,442) size 208x108
    4343                RenderText {#text} at (162,0) size 64x108
    4444                  text run at (162,0) width 64: "This line"
  • trunk/LayoutTests/platform/mac/fast/regions/percentage-margins-rtl-variable-width-regions-expected.txt

    r96423 r96675  
    1212    layer at (0,0) size 300x400
    1313      RenderFlowThread at (0,0) size 300x400
    14         RenderBlock {DIV} at (0,0) size 300x595
    15           RenderBlock {DIV} at (34,5) size 232x585 [border: (1px solid #0000FF)]
    16             RenderBlock {DIV} at (11,11) size 210x563 [border: (1px solid #008000)]
     14        RenderBlock {DIV} at (0,0) size 300x599
     15          RenderBlock {DIV} at (34,5) size 232x589 [border: (1px solid #0000FF)]
     16            RenderBlock {DIV} at (11,11) size 210x567 [border: (1px solid #008000)]
    1717              RenderBlock {P} at (1,17) size 208x157
    1818                RenderText {#text} at (90,0) size 218x157
     
    2626                  text run at (100,139) width 4 RTL: "."
    2727                  text run at (104,139) width 104: "out of the region"
    28               RenderBlock {P} at (1,190) size 208x248
    29                 RenderText {#text} at (0,0) size 226x248
     28              RenderBlock {P} at (1,190) size 208x236
     29                RenderText {#text} at (0,0) size 226x236
    3030                  text run at (0,0) width 208: "This line of text should not get"
    3131                  text run at (0,18) width 208: "out of the region. This line of"
     
    3838                  text run at (162,146) width 64: "of text"
    3939                  text run at (184,164) width 42: "should"
    40                   text run at (162,194) width 64: "not get"
    41                   text run at (162,212) width 64: "out of the"
    42                   text run at (182,230) width 4 RTL: "."
    43                   text run at (186,230) width 40: "region"
    44               RenderBlock {P} at (1,438) size 208x108
     40                  text run at (162,182) width 64: "not get"
     41                  text run at (162,200) width 64: "out of the"
     42                  text run at (182,218) width 4 RTL: "."
     43                  text run at (186,218) width 40: "region"
     44              RenderBlock {P} at (1,442) size 208x108
    4545                RenderText {#text} at (162,0) size 64x108
    4646                  text run at (162,0) width 64: "This line"
  • trunk/LayoutTests/platform/mac/fast/regions/percentage-margins-variable-width-regions-expected.txt

    r96408 r96675  
    1212    layer at (0,0) size 300x400
    1313      RenderFlowThread at (0,0) size 300x400
    14         RenderBlock {DIV} at (0,0) size 300x595
    15           RenderBlock {DIV} at (34,5) size 232x585 [border: (1px solid #0000FF)]
    16             RenderBlock {DIV} at (11,11) size 210x563 [border: (1px solid #008000)]
     14        RenderBlock {DIV} at (0,0) size 300x599
     15          RenderBlock {DIV} at (34,5) size 232x589 [border: (1px solid #0000FF)]
     16            RenderBlock {DIV} at (11,11) size 210x567 [border: (1px solid #008000)]
    1717              RenderBlock {P} at (1,17) size 208x157
    1818                RenderText {#text} at (-10,0) size 218x157
     
    2525                  text run at (0,121) width 208: "This line of text should not get"
    2626                  text run at (0,139) width 108: "out of the region."
    27               RenderBlock {P} at (1,190) size 208x248
    28                 RenderText {#text} at (0,0) size 226x248
     27              RenderBlock {P} at (1,190) size 208x236
     28                RenderText {#text} at (0,0) size 226x236
    2929                  text run at (0,0) width 208: "This line of text should not get"
    3030                  text run at (0,18) width 208: "out of the region. This line of"
     
    3737                  text run at (-18,146) width 64: "of text"
    3838                  text run at (-18,164) width 42: "should"
    39                   text run at (-18,194) width 64: "not get"
    40                   text run at (-18,212) width 64: "out of the"
    41                   text run at (-18,230) width 44: "region."
    42               RenderBlock {P} at (1,438) size 208x108
     39                  text run at (-18,182) width 64: "not get"
     40                  text run at (-18,200) width 64: "out of the"
     41                  text run at (-18,218) width 44: "region."
     42              RenderBlock {P} at (1,442) size 208x108
    4343                RenderText {#text} at (-18,0) size 64x108
    4444                  text run at (-18,0) width 64: "This line"
  • trunk/LayoutTests/platform/mac/fast/regions/text-region-split-small-pagination-expected.txt

    r95670 r96675  
    1212    layer at (0,0) size 200x180
    1313      RenderFlowThread at (0,0) size 200x180
    14         RenderBlock {DIV} at (0,30) size 200x150
     14        RenderBlock {DIV} at (0,30) size 200x118
    1515          RenderBlock {P} at (0,0) size 200x118
    1616            RenderInline {B} at (0,0) size 111x18
  • trunk/LayoutTests/platform/mac/fast/regions/webkit-flow-floats-inside-regions-bounds-expected.txt

    r95750 r96675  
    1212    layer at (0,0) size 300x400
    1313      RenderFlowThread at (0,0) size 300x400
    14         RenderBlock {DIV} at (0,0) size 300x469
    15           RenderBlock {DIV} at (5,5) size 290x459 [border: (1px solid #0000FF)]
    16             RenderBlock {DIV} at (11,11) size 268x437 [border: (1px solid #008000)]
     14        RenderBlock {DIV} at (0,0) size 300x455
     15          RenderBlock {DIV} at (5,5) size 290x445 [border: (1px solid #0000FF)]
     16            RenderBlock {DIV} at (11,11) size 268x423 [border: (1px solid #008000)]
    1717              RenderBlock {P} at (1,17) size 266x36
    1818                RenderText {#text} at (0,0) size 166x36
     
    3939                  text run at (0,92) width 86: "get out of the"
    4040                  text run at (0,110) width 44: "region."
    41               RenderBlock {P} at (1,334) size 266x86
    42                 RenderText {#text} at (0,0) size 86x86
     41              RenderBlock {P} at (1,334) size 266x72
     42                RenderText {#text} at (0,0) size 86x72
    4343                  text run at (0,0) width 86: "This line of"
    4444                  text run at (0,18) width 86: "text should"
    45                   text run at (0,50) width 86: "not get out of"
    46                   text run at (0,68) width 67: "the region."
     45                  text run at (0,36) width 86: "not get out of"
     46                  text run at (0,54) width 67: "the region."
    4747  Regions for flow 'flow1'
    4848    RenderRegion {DIV} #region1 with index 0
  • trunk/LayoutTests/platform/mac/fast/regions/webkit-flow-inlines-dynamic-expected.txt

    r95756 r96675  
    1212    layer at (0,0) size 300x400
    1313      RenderFlowThread at (0,0) size 300x400
    14         RenderBlock {DIV} at (0,0) size 300x471
    15           RenderBlock {DIV} at (5,5) size 290x461 [border: (1px solid #0000FF)]
    16             RenderBlock {DIV} at (11,11) size 268x439 [border: (1px solid #008000)]
     14        RenderBlock {DIV} at (0,0) size 300x459
     15          RenderBlock {DIV} at (5,5) size 290x449 [border: (1px solid #0000FF)]
     16            RenderBlock {DIV} at (11,11) size 268x427 [border: (1px solid #008000)]
    1717              RenderInline {SPAN} at (0,0) size 266x101
    1818                RenderText {#text} at (1,1) size 166x36
     
    4040              RenderBR {BR} at (45,300) size 0x18
    4141              RenderBR {BR} at (1,318) size 0x18
    42               RenderText {#text} at (1,336) size 86x84
     42              RenderText {#text} at (1,336) size 86x72
    4343                text run at (1,336) width 86: "This line of"
    4444                text run at (1,354) width 86: "text should"
    45                 text run at (1,384) width 86: "not get out of"
    46                 text run at (1,402) width 67: "the region."
    47               RenderBR {BR} at (68,402) size 0x18
    48               RenderBR {BR} at (1,420) size 0x18
     45                text run at (1,372) width 86: "not get out of"
     46                text run at (1,390) width 67: "the region."
     47              RenderBR {BR} at (68,390) size 0x18
     48              RenderBR {BR} at (1,408) size 0x18
    4949  Regions for flow 'flow1'
    5050    RenderRegion {DIV} #region1 with index 0
  • trunk/Source/WebCore/ChangeLog

    r96674 r96675  
     12011-10-04  David Hyatt  <hyatt@apple.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=69398
     4
     5        [CSS3 Regions] Support the region-overflow property properly.
     6       
     7        (1) Change -webkit-break to break, since the -webkit-region-overflow property already has the
     8        -webkit- extension.
     9       
     10        (2) Fix clipping so that it works when overflow is set or when region break is set.
     11       
     12        (3) Refactor all the pagination spots to check if a next page is available using the new hasNextPage
     13        function. This prevents us from paginating if we hit the last region and further breaks are no longer
     14        allowed.
     15       
     16        Reviewed by Dan Bernstein.
     17
     18        Added new tests in fast/regions.
     19
     20        * css/CSSParser.cpp:
     21        (WebCore::CSSParser::parseValue):
     22        * css/CSSPrimitiveValueMappings.h:
     23        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
     24        (WebCore::CSSPrimitiveValue::operator RegionOverflow):
     25        * css/CSSValueKeywords.in:
     26        * rendering/RenderBlock.cpp:
     27        (WebCore::RenderBlock::collapseMargins):
     28        (WebCore::RenderBlock::estimateLogicalTopPosition):
     29        (WebCore::RenderBlock::hasNextPage):
     30        (WebCore::RenderBlock::nextPageLogicalTop):
     31        (WebCore::RenderBlock::applyBeforeBreak):
     32        (WebCore::RenderBlock::applyAfterBreak):
     33        (WebCore::RenderBlock::pageLogicalHeightForOffset):
     34        (WebCore::RenderBlock::pageRemainingLogicalHeightForOffset):
     35        (WebCore::RenderBlock::adjustForUnsplittableChild):
     36        (WebCore::RenderBlock::pushToNextPageWithMinimumLogicalHeight):
     37        (WebCore::RenderBlock::adjustLinePositionForPagination):
     38        * rendering/RenderBlock.h:
     39        * rendering/RenderFlowThread.cpp:
     40        (WebCore::RenderFlowThread::layout):
     41        (WebCore::RenderFlowThread::repaintRectangleInRegions):
     42        (WebCore::RenderFlowThread::regionRemainingLogicalHeightForLine):
     43        * rendering/RenderFlowThread.h:
     44        * rendering/RenderRegion.cpp:
     45        (WebCore::RenderRegion::regionOverflowRect):
     46
    1472011-10-04  Mark Hahnenberg  <mhahnenberg@apple.com>
    248
  • trunk/Source/WebCore/css/CSSParser.cpp

    r96449 r96675  
    16431643        break;
    16441644    case CSSPropertyWebkitRegionOverflow:
    1645         if (id == CSSValueAuto || id == CSSValueWebkitBreak)
     1645        if (id == CSSValueAuto || id == CSSValueBreak)
    16461646            validPrimitive = true;
    16471647        break;
  • trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h

    r95911 r96675  
    15981598        break;
    15991599    case BreakRegionOverflow:
    1600         m_value.ident = CSSValueWebkitBreak;
     1600        m_value.ident = CSSValueBreak;
    16011601        break;
    16021602    }
     
    16081608    case CSSValueAuto:
    16091609        return AutoRegionOverflow;
    1610     case CSSValueWebkitBreak:
     1610    case CSSValueBreak:
    16111611        return BreakRegionOverflow;
    16121612    default:
  • trunk/Source/WebCore/css/CSSValueKeywords.in

    r95859 r96675  
    843843// -webkit-region-overflow
    844844// auto
    845 -webkit-break
     845break
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r96620 r96675  
    17041704    // collapsed into the page edge.
    17051705    LayoutState* layoutState = view()->layoutState();
    1706     if (layoutState->isPaginated() && layoutState->pageLogicalHeight() && logicalTop > beforeCollapseLogicalTop) {
     1706    if (layoutState->isPaginated() && layoutState->pageLogicalHeight() && logicalTop > beforeCollapseLogicalTop
     1707        && hasNextPage(beforeCollapseLogicalTop)) {
    17071708        LayoutUnit oldLogicalTop = logicalTop;
    1708         logicalTop = min(logicalTop, nextPageLogicalTopExcludingBoundaryPoint(beforeCollapseLogicalTop));
     1709        logicalTop = min(logicalTop, nextPageLogicalTop(beforeCollapseLogicalTop));
    17091710        setLogicalHeight(logicalHeight() + (logicalTop - oldLogicalTop));
    17101711    }
     
    17741775    // page.
    17751776    LayoutState* layoutState = view()->layoutState();
    1776     if (layoutState->isPaginated() && layoutState->pageLogicalHeight() && logicalTopEstimate > logicalHeight())
    1777         logicalTopEstimate = min(logicalTopEstimate, nextPageLogicalTopExcludingBoundaryPoint(logicalHeight()));
     1777    if (layoutState->isPaginated() && layoutState->pageLogicalHeight() && logicalTopEstimate > logicalHeight()
     1778        && hasNextPage(logicalHeight()))
     1779        logicalTopEstimate = min(logicalTopEstimate, nextPageLogicalTop(logicalHeight()));
    17781780
    17791781    logicalTopEstimate += getClearDelta(child, logicalTopEstimate);
     
    61306132}
    61316133
    6132 LayoutUnit RenderBlock::nextPageLogicalTopExcludingBoundaryPoint(LayoutUnit logicalOffset) const
     6134bool RenderBlock::hasNextPage(LayoutUnit logicalOffset, PageBoundaryRule pageBoundaryRule) const
     6135{
     6136    ASSERT(view()->layoutState() && view()->layoutState()->isPaginated());
     6137
     6138    if (!inRenderFlowThread())
     6139        return true; // Printing and multi-column both make new pages to accommodate content.
     6140
     6141    // See if we're in the last region.
     6142    LayoutUnit pageOffset = offsetFromLogicalTopOfFirstPage() + logicalOffset;
     6143    RenderRegion* region = enclosingRenderFlowThread()->renderRegionForLine(pageOffset, false);
     6144    if (!region)
     6145        return false;
     6146    if (region->isLastRegion())
     6147        return region->style()->regionOverflow() == BreakRegionOverflow
     6148            || (pageBoundaryRule == IncludePageBoundary && pageOffset == region->offsetFromLogicalTopOfFirstPage());
     6149    return true;
     6150}
     6151
     6152LayoutUnit RenderBlock::nextPageLogicalTop(LayoutUnit logicalOffset, PageBoundaryRule pageBoundaryRule) const
    61336153{
    61346154    LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset);
     
    61386158    // The logicalOffset is in our coordinate space.  We can add in our pushed offset.
    61396159    LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset);
    6140     return logicalOffset + (remainingLogicalHeight ? remainingLogicalHeight : pageLogicalHeight);
    6141 }
    6142 
    6143 LayoutUnit RenderBlock::nextPageLogicalTopIncludingBoundaryPoint(LayoutUnit logicalOffset) const
    6144 {
    6145     LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset);
    6146     if (!pageLogicalHeight)
    6147         return logicalOffset;
    6148    
    6149     // The logicalOffset is in our coordinate space.  We can add in our pushed offset.
    6150     LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset);
     6160    if (pageBoundaryRule == ExcludePageBoundary)
     6161        return logicalOffset + (remainingLogicalHeight ? remainingLogicalHeight : pageLogicalHeight);
    61516162    return logicalOffset + remainingLogicalHeight;
    61526163}
     
    61746185    bool checkBeforeAlways = (checkColumnBreaks && child->style()->columnBreakBefore() == PBALWAYS) || (checkPageBreaks && child->style()->pageBreakBefore() == PBALWAYS)
    61756186                             || (checkRegionBreaks && child->style()->regionBreakBefore() == PBALWAYS);
    6176     if (checkBeforeAlways && inNormalFlow(child)) {
     6187    if (checkBeforeAlways && inNormalFlow(child) && hasNextPage(logicalOffset, IncludePageBoundary)) {
    61776188        if (checkColumnBreaks)
    61786189            view()->layoutState()->addForcedColumnBreak(logicalOffset);
    6179         return nextPageLogicalTopIncludingBoundaryPoint(logicalOffset);
     6190        return nextPageLogicalTop(logicalOffset, IncludePageBoundary);
    61806191    }
    61816192    return logicalOffset;
     
    61906201    bool checkAfterAlways = (checkColumnBreaks && child->style()->columnBreakAfter() == PBALWAYS) || (checkPageBreaks && child->style()->pageBreakAfter() == PBALWAYS)
    61916202                            || (checkRegionBreaks && child->style()->regionBreakAfter() == PBALWAYS);
    6192     if (checkAfterAlways && inNormalFlow(child)) {
     6203    if (checkAfterAlways && inNormalFlow(child) && hasNextPage(logicalOffset, IncludePageBoundary)) {
    61936204        marginInfo.setMarginAfterQuirk(true); // Cause margins to be discarded for any following content.
    61946205        if (checkColumnBreaks)
    61956206            view()->layoutState()->addForcedColumnBreak(logicalOffset);
    6196         return nextPageLogicalTopIncludingBoundaryPoint(logicalOffset);
     6207        return nextPageLogicalTop(logicalOffset, IncludePageBoundary);
    61976208    }
    61986209    return logicalOffset;
     
    62046215    if (!inRenderFlowThread())
    62056216        return renderView->layoutState()->m_pageLogicalHeight;
    6206     return enclosingRenderFlowThread()->regionLogicalHeightForLine(offsetFromLogicalTopOfFirstPage() + offset);
    6207 }
    6208 
    6209 LayoutUnit RenderBlock::pageRemainingLogicalHeightForOffset(LayoutUnit offset, bool includeBoundaryPoint) const
     6217    return enclosingRenderFlowThread()->regionLogicalHeightForLine(offset + offsetFromLogicalTopOfFirstPage());
     6218}
     6219
     6220LayoutUnit RenderBlock::pageRemainingLogicalHeightForOffset(LayoutUnit offset, PageBoundaryRule pageBoundaryRule) const
    62106221{
    62116222    RenderView* renderView = view();
     
    62156226        LayoutUnit pageLogicalHeight = renderView->layoutState()->m_pageLogicalHeight;
    62166227        LayoutUnit remainingHeight = pageLogicalHeight - layoutMod(offset, pageLogicalHeight);
    6217         if (includeBoundaryPoint) {
     6228        if (pageBoundaryRule == IncludePageBoundary) {
    62186229            // If includeBoundaryPoint is true the line exactly on the top edge of a
    62196230            // column will act as being part of the previous column.
     
    62236234    }
    62246235   
    6225     return enclosingRenderFlowThread()->regionRemainingLogicalHeightForLine(offset, includeBoundaryPoint);
     6236    return enclosingRenderFlowThread()->regionRemainingLogicalHeightForLine(offset, pageBoundaryRule);
    62266237}
    62276238
     
    62386249    LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset);
    62396250    bool hasUniformPageLogicalHeight = !inRenderFlowThread() || enclosingRenderFlowThread()->regionsHaveUniformLogicalHeight();
    6240     if (!pageLogicalHeight || (hasUniformPageLogicalHeight && childLogicalHeight > pageLogicalHeight))
     6251    if (!pageLogicalHeight || (hasUniformPageLogicalHeight && childLogicalHeight > pageLogicalHeight)
     6252        || !hasNextPage(logicalOffset))
    62416253        return logicalOffset;
    6242     LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset);
     6254    LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset, ExcludePageBoundary);
    62436255    if (remainingLogicalHeight < childLogicalHeight) {
    62446256        if (!hasUniformPageLogicalHeight && !pushToNextPageWithMinimumLogicalHeight(remainingLogicalHeight, logicalOffset, childLogicalHeight))
     
    62516263bool RenderBlock::pushToNextPageWithMinimumLogicalHeight(LayoutUnit& adjustment, LayoutUnit logicalOffset, LayoutUnit minimumLogicalHeight) const
    62526264{
    6253     bool checkedRegion = false;
     6265    bool checkRegion = false;
    62546266    for (LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset + adjustment); pageLogicalHeight;
    6255          pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset + adjustment)) {
    6256          if (minimumLogicalHeight <= pageLogicalHeight)
     6267        pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset + adjustment)) {
     6268        if (minimumLogicalHeight <= pageLogicalHeight)
    62576269            return true;
    6258          adjustment += pageLogicalHeight;
    6259          checkedRegion = true;
    6260     }
    6261     return !checkedRegion;
     6270        if (!hasNextPage(logicalOffset + adjustment))
     6271            return false;
     6272        adjustment += pageLogicalHeight;
     6273        checkRegion = true;
     6274    }
     6275    return !checkRegion;
    62626276}
    62636277
     
    62946308    LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(logicalOffset);
    62956309    bool hasUniformPageLogicalHeight = !inRenderFlowThread() || enclosingRenderFlowThread()->regionsHaveUniformLogicalHeight();
    6296     if (!pageLogicalHeight || (hasUniformPageLogicalHeight && lineHeight > pageLogicalHeight))
     6310    if (!pageLogicalHeight || (hasUniformPageLogicalHeight && lineHeight > pageLogicalHeight)
     6311        || !hasNextPage(logicalOffset))
    62976312        return;
    6298     const bool includeBoundaryPoint = false;
    6299     LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset, includeBoundaryPoint);
     6313    LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset, ExcludePageBoundary);
    63006314    if (remainingLogicalHeight < lineHeight) {
    63016315        // If we have a non-uniform page height, then we have to shift further possibly.
  • trunk/Source/WebCore/rendering/RenderBlock.h

    r96620 r96675  
    866866    static void repaintDirtyFloats(Vector<FloatWithRect>& floats);
    867867
     868protected:
    868869    // Pagination routines.
    869870   
    870871    // Returns the logicalOffset at the top of the next page. If the offset passed in is already at the top of the current page,
    871     // then nextPageLogicalTopExcludingBoundaryPoint will still move to the top of the next page. nextPageLogicalTopIncludingBoundaryPoint
    872     // will not.
     872    // then nextPageLogicalTop with ExcludePageBoundary will still move to the top of the next page. nextPageLogicalTop with
     873    // IncludePageBoundary set will not.
    873874    //
    874     // For a page height of 800px, the first function will return 800 if the value passed in is 0. The second function will simply return 0.
    875     LayoutUnit nextPageLogicalTopExcludingBoundaryPoint(LayoutUnit logicalOffset) const;
    876     LayoutUnit nextPageLogicalTopIncludingBoundaryPoint(LayoutUnit logicalOffset) const;
     875    // For a page height of 800px, the first rule will return 800 if the value passed in is 0. The second rule will simply return 0.
     876    enum PageBoundaryRule { ExcludePageBoundary, IncludePageBoundary };
     877    LayoutUnit nextPageLogicalTop(LayoutUnit logicalOffset, PageBoundaryRule = ExcludePageBoundary) const;
     878    bool hasNextPage(LayoutUnit logicalOffset, PageBoundaryRule = ExcludePageBoundary) const;
    877879
    878880    int applyBeforeBreak(RenderBox* child, int logicalOffset); // If the child has a before break, then return a new yPos that shifts to the top of the next page/column.
     
    881883    LayoutUnit offsetFromLogicalTopOfFirstPage() const;
    882884    LayoutUnit pageLogicalHeightForOffset(LayoutUnit offset) const;
    883     LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit offset, bool includeBoundaryPoint = true) const;
     885    LayoutUnit pageRemainingLogicalHeightForOffset(LayoutUnit offset, PageBoundaryRule = IncludePageBoundary) const;
    884886    bool pushToNextPageWithMinimumLogicalHeight(LayoutUnit& adjustment, LayoutUnit logicalOffset, LayoutUnit minimumLogicalHeight) const;
    885887
     
    895897    RenderRegion* regionAtBlockOffset(LayoutUnit) const;
    896898    bool logicalWidthChangedInRegions() const;
    897    
     899
     900private:
    898901    struct FloatingObjectHashFunctions {
    899902        static unsigned hash(FloatingObject* key) { return DefaultHash<RenderBox*>::Hash::hash(key->m_renderer); }
  • trunk/Source/WebCore/rendering/RenderFlowThread.cpp

    r96643 r96675  
    353353                LayoutRect regionRect;
    354354                if (isHorizontalWritingMode()) {
    355                     regionRect = IntRect(style()->direction() == LTR ? 0 : logicalWidth() - region->contentWidth(), logicalHeight, region->contentWidth(), region->contentHeight());
     355                    regionRect = LayoutRect(style()->direction() == LTR ? 0 : logicalWidth() - region->contentWidth(), logicalHeight, region->contentWidth(), region->contentHeight());
    356356                    logicalHeight += regionRect.height();
    357357                } else {
    358                     regionRect = IntRect(logicalHeight, style()->direction() == LTR ? 0 : logicalWidth() - region->contentHeight(), region->contentWidth(), region->contentHeight());
     358                    regionRect = LayoutRect(logicalHeight, style()->direction() == LTR ? 0 : logicalWidth() - region->contentHeight(), region->contentWidth(), region->contentHeight());
    359359                    logicalHeight += regionRect.width();
    360360                }
     
    511511        flipForWritingMode(flippedRegionOverflowRect);
    512512
    513         IntRect clippedRect(flippedRegionOverflowRect);
     513        LayoutRect clippedRect(flippedRegionOverflowRect);
    514514        clippedRect.intersect(repaintRect);
    515515        if (clippedRect.isEmpty())
     
    575575}
    576576
    577 LayoutUnit RenderFlowThread::regionRemainingLogicalHeightForLine(LayoutUnit position, bool includeBoundaryPoint) const
     577LayoutUnit RenderFlowThread::regionRemainingLogicalHeightForLine(LayoutUnit position, PageBoundaryRule pageBoundaryRule) const
    578578{
    579579    RenderRegion* region = renderRegionForLine(position);
     
    583583    LayoutUnit regionLogicalBottom = isHorizontalWritingMode() ? region->regionRect().maxY() : region->regionRect().maxX();
    584584    LayoutUnit remainingHeight = regionLogicalBottom - position;
    585     if (includeBoundaryPoint) {
    586         // If includeBoundaryPoint is true the line exactly on the top edge of a
     585    if (pageBoundaryRule == IncludePageBoundary) {
     586        // If IncludePageBoundary is set, the line exactly on the top edge of a
    587587        // region will act as being part of the previous region.
    588588        LayoutUnit regionHeight = isHorizontalWritingMode() ? region->regionRect().height() : region->regionRect().width();
  • trunk/Source/WebCore/rendering/RenderFlowThread.h

    r96643 r96675  
    100100    LayoutUnit regionLogicalWidthForLine(LayoutUnit position) const;
    101101    LayoutUnit regionLogicalHeightForLine(LayoutUnit position) const;
    102     LayoutUnit regionRemainingLogicalHeightForLine(LayoutUnit position, bool includeBoundaryPoint = true) const;
     102    LayoutUnit regionRemainingLogicalHeightForLine(LayoutUnit position, PageBoundaryRule = IncludePageBoundary) const;
    103103    RenderRegion* renderRegionForLine(LayoutUnit position, bool extendLastRegion = false) const;
    104104
  • trunk/Source/WebCore/rendering/RenderRegion.cpp

    r96643 r96675  
    5656LayoutRect RenderRegion::regionOverflowRect() const
    5757{
    58     if (hasOverflowClip() || !isValid() || !m_flowThread)
     58    // FIXME: Would like to just use hasOverflowClip() but we aren't a block yet. When RenderRegion is eliminated and
     59    // folded into RenderBlock, switch to hasOverflowClip().
     60    bool clipX = style()->overflowX() != OVISIBLE;
     61    bool clipY = style()->overflowY() != OVISIBLE;
     62    if ((clipX && clipY) || !isValid() || !m_flowThread)
    5963        return regionRect();
    6064
     
    6569    if (m_flowThread->isHorizontalWritingMode()) {
    6670        LayoutUnit minY = isFirstRegion() ? flowThreadOverflow.y() : regionRect().y();
    67         LayoutUnit maxY = isLastRegion() ? flowThreadOverflow.maxY() : regionRect().maxY();
    68         clipRect = LayoutRect(flowThreadOverflow.x(), minY, flowThreadOverflow.width(), maxY - minY);
     71        LayoutUnit maxY = style()->regionOverflow() == AutoRegionOverflow && isLastRegion() ? flowThreadOverflow.maxY() : regionRect().maxY();
     72        clipRect = LayoutRect(clipX ? regionRect().x() : flowThreadOverflow.x(), minY,
     73                              clipX ? regionRect().width() : flowThreadOverflow.width(), maxY - minY);
    6974    } else {
    7075        LayoutUnit minX = isFirstRegion() ? flowThreadOverflow.x() : regionRect().x();
    71         LayoutUnit maxX = isLastRegion() ? flowThreadOverflow.maxX() : regionRect().maxX();
    72         clipRect = LayoutRect(minX, flowThreadOverflow.y(), maxX - minX, flowThreadOverflow.height());
     76        LayoutUnit maxX = style()->regionOverflow() == AutoRegionOverflow && isLastRegion() ? flowThreadOverflow.maxX() : regionRect().maxX();
     77        clipRect = LayoutRect(minX, clipY ? regionRect().y() : flowThreadOverflow.y(),
     78                              maxX - minX, clipY ? regionRect().height() : flowThreadOverflow.height());
    7379    }
    7480
Note: See TracChangeset for help on using the changeset viewer.