Changeset 55067 in webkit


Ignore:
Timestamp:
Feb 21, 2010 8:12:46 PM (14 years ago)
Author:
yuzo@google.com
Message:

2010-02-07 Yuzo Fujishima <yuzo@google.com>

Reviewed by Eric Seidel.

When page-break-{after,before} is set to always, force page breaks even for overflow-specified elements.
RenderBlock::inRootBlockContext() was introduced by Changeset 5611. Although it is a reasonable criteria for choosing an optional page break location, it is not for a mandatory page break as specified by http://dev.w3.org/csswg/css3-page/#forced-pg-brk. The method is removed because it is not used anywhere else.
Note: this patch makes page break work for overflow-specified elements. For tables and floated elements, more work is needed.
https://bugs.webkit.org/show_bug.cgi?id=9526

  • printing/page-break-always-for-overflow-expected.txt: Added.
  • printing/page-break-always-for-overflow.html: Added.
  • printing/script-tests/page-break-always-for-overflow.js: Added.

2010-02-07 Yuzo Fujishima <yuzo@google.com>

Reviewed by Eric Seidel.

When page-break-{after,before} is set to always, force page breaks even for overflow-specified elements.
RenderBlock::inRootBlockContext() was introduced by Changeset 5611. Although it is a reasonable criteria for choosing an optional page break location, it is not for a mandatory page break as specified by http://dev.w3.org/csswg/css3-page/#forced-pg-brk. The method is removed because it is not used anywhere else.
Note: this patch makes page break work for overflow-specified elements. For tables and floated elements, more work is needed.
https://bugs.webkit.org/show_bug.cgi?id=9526

Test: printing/page-break-always-for-overflow.html

  • rendering/RenderBlock.cpp: (WebCore::RenderBlock::paintChildren):
  • rendering/RenderBlock.h:
Location:
trunk
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r55040 r55067  
     12010-02-07  Yuzo Fujishima  <yuzo@google.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        When page-break-{after,before} is set to always, force page breaks even for overflow-specified elements.
     6        RenderBlock::inRootBlockContext() was introduced by Changeset 5611. Although it is a reasonable criteria for choosing an optional page break location, it is not for a mandatory page break as specified by http://dev.w3.org/csswg/css3-page/#forced-pg-brk. The method is removed because it is not used anywhere else.
     7        Note: this patch makes page break work for overflow-specified elements. For tables and floated elements, more work is needed.
     8        https://bugs.webkit.org/show_bug.cgi?id=9526
     9
     10        * printing/page-break-always-for-overflow-expected.txt: Added.
     11        * printing/page-break-always-for-overflow.html: Added.
     12        * printing/script-tests/page-break-always-for-overflow.js: Added.
     13
    1142010-02-19  Eric Seidel  <eric@webkit.org>
    215
  • trunk/WebCore/ChangeLog

    r55066 r55067  
     12010-02-07  Yuzo Fujishima  <yuzo@google.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        When page-break-{after,before} is set to always, force page breaks even for overflow-specified elements.
     6        RenderBlock::inRootBlockContext() was introduced by Changeset 5611. Although it is a reasonable criteria for choosing an optional page break location, it is not for a mandatory page break as specified by http://dev.w3.org/csswg/css3-page/#forced-pg-brk. The method is removed because it is not used anywhere else.
     7        Note: this patch makes page break work for overflow-specified elements. For tables and floated elements, more work is needed.
     8        https://bugs.webkit.org/show_bug.cgi?id=9526
     9
     10        Test: printing/page-break-always-for-overflow.html
     11
     12        * rendering/RenderBlock.cpp:
     13        (WebCore::RenderBlock::paintChildren):
     14        * rendering/RenderBlock.h:
     15
    1162010-02-21  Julien Chaffraix  <jchaffraix@webkit.org>
    217
  • trunk/WebCore/rendering/RenderBlock.cpp

    r54982 r55067  
    16581658    for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {       
    16591659        // Check for page-break-before: always, and if it's set, break and bail.
    1660         if (isPrinting && !childrenInline() && child->style()->pageBreakBefore() == PBALWAYS &&
    1661             inRootBlockContext() && (ty + child->y()) > paintInfo.rect.y() &&
    1662             (ty + child->y()) < paintInfo.rect.bottom()) {
     1660        if (isPrinting && !childrenInline() && child->style()->pageBreakBefore() == PBALWAYS
     1661            && (ty + child->y()) > paintInfo.rect.y()
     1662            && (ty + child->y()) < paintInfo.rect.bottom()) {
    16631663            view()->setBestTruncatedAt(ty + child->y(), this, true);
    16641664            return;
     
    16671667        // Check for page-break-inside: avoid, and it it's set, break and bail.
    16681668        if (isPrinting && !childrenInline() && child->style()->pageBreakInside() == PBAVOID
    1669             && inRootBlockContext()
    16701669            && ty + child->y() > paintInfo.rect.y()
    16711670            && ty + child->y() < paintInfo.rect.bottom()
     
    16791678
    16801679        // Check for page-break-after: always, and if it's set, break and bail.
    1681         if (isPrinting && !childrenInline() && child->style()->pageBreakAfter() == PBALWAYS &&
    1682             inRootBlockContext() && (ty + child->y() + child->height()) > paintInfo.rect.y() &&
    1683             (ty + child->y() + child->height()) < paintInfo.rect.bottom()) {
     1680        if (isPrinting && !childrenInline() && child->style()->pageBreakAfter() == PBALWAYS
     1681            && (ty + child->y() + child->height()) > paintInfo.rect.y()
     1682            && (ty + child->y() + child->height()) < paintInfo.rect.bottom()) {
    16841683            view()->setBestTruncatedAt(ty + child->y() + child->height() + max(0, child->collapsedMarginBottom()), this, true);
    16851684            return;
     
    47114710}
    47124711
    4713 bool RenderBlock::inRootBlockContext() const
    4714 {
    4715     if (isTableCell() || isFloatingOrPositioned() || hasOverflowClip())
    4716         return false;
    4717    
    4718     if (isRoot() || isRenderView())
    4719         return true;
    4720    
    4721     return containingBlock()->inRootBlockContext();
    4722 }
    4723 
    47244712// Helper methods for obtaining the last line, computing line counts and heights for line counts
    47254713// (crawling into blocks).
  • trunk/WebCore/rendering/RenderBlock.h

    r54784 r55067  
    318318    // children.
    319319    virtual RenderBlock* firstLineBlock() const;
    320     bool inRootBlockContext() const;
    321320
    322321    virtual IntRect rectWithOutlineForRepaint(RenderBoxModelObject* repaintContainer, int outlineWidth);
Note: See TracChangeset for help on using the changeset viewer.