Changeset 120835 in webkit


Ignore:
Timestamp:
Jun 20, 2012 10:49:18 AM (12 years ago)
Author:
alexis.menard@openbossa.org
Message:

[CSS3 Backgrounds and Borders] Implement box-decoration-break rendering.
https://bugs.webkit.org/show_bug.cgi?id=88228

Reviewed by Eric Seidel.

Source/WebCore:

Implement the new CSS property box-decoration-break. It modifies
where we decide whether the borders needs to be sliced or not by
checking if the box-decoration-break is set to clone. If it's the case
then we need to explicitely redraw all edges.

Test: fast/box-decoration-break/box-decoration-break-rendering.html

  • rendering/InlineFlowBox.cpp:

(WebCore::InlineFlowBox::determineSpacingForFlowBoxes):
(WebCore::InlineFlowBox::paintFillLayer):

LayoutTests:

Add new tests to cover the feature.

  • fast/box-decoration-break/box-decoration-break-rendering-expected.html: Added.
  • fast/box-decoration-break/box-decoration-break-rendering.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r120817 r120835  
     12012-06-20  Alexis Menard  <alexis.menard@openbossa.org>
     2
     3        [CSS3 Backgrounds and Borders] Implement box-decoration-break rendering.
     4        https://bugs.webkit.org/show_bug.cgi?id=88228
     5
     6        Reviewed by Eric Seidel.
     7
     8        Add new tests to cover the feature.
     9
     10        * fast/box-decoration-break/box-decoration-break-rendering-expected.html: Added.
     11        * fast/box-decoration-break/box-decoration-break-rendering.html: Added.
     12
    1132012-06-20  Hans Wennborg  <hans@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r120832 r120835  
     12012-06-20  Alexis Menard  <alexis.menard@openbossa.org>
     2
     3        [CSS3 Backgrounds and Borders] Implement box-decoration-break rendering.
     4        https://bugs.webkit.org/show_bug.cgi?id=88228
     5
     6        Reviewed by Eric Seidel.
     7
     8        Implement the new CSS property box-decoration-break. It modifies
     9        where we decide whether the borders needs to be sliced or not by
     10        checking if the box-decoration-break is set to clone. If it's the case
     11        then we need to explicitely redraw all edges.
     12
     13        Test: fast/box-decoration-break/box-decoration-break-rendering.html
     14
     15        * rendering/InlineFlowBox.cpp:
     16        (WebCore::InlineFlowBox::determineSpacingForFlowBoxes):
     17        (WebCore::InlineFlowBox::paintFillLayer):
     18
    1192012-06-20  Julien Chaffraix  <jchaffraix@webkit.org>
    220
  • trunk/Source/WebCore/rendering/InlineFlowBox.cpp

    r120824 r120835  
    317317        RenderLineBoxList* lineBoxList = rendererLineBoxes();
    318318        if (!lineBoxList->firstLineBox()->isConstructed() && !renderer()->isInlineElementContinuation()) {
     319#if ENABLE(CSS_BOX_DECORATION_BREAK)
     320            if (renderer()->style()->boxDecorationBreak() == DCLONE)
     321                includeLeftEdge = includeRightEdge = true;
     322            else
     323#endif
    319324            if (ltr && lineBoxList->firstLineBox() == this)
    320325                includeLeftEdge = true;
     
    331336            // (2) The logicallyLastRun is not a descendant of this renderer.
    332337            // (3) The logicallyLastRun is a descendant of this renderer, but it is the last child of this renderer and it does not wrap to the next line.
    333            
     338#if ENABLE(CSS_BOX_DECORATION_BREAK)
     339            // (4) The decoration break is set to clone therefore there will be borders on every sides.
     340            if (renderer()->style()->boxDecorationBreak() == DCLONE)
     341                includeLeftEdge = includeRightEdge = true;
     342            else
     343#endif
    334344            if (ltr) {
    335345                if (!nextLineBox()
     
    11031113    if ((!hasFillImage && !renderer()->style()->hasBorderRadius()) || (!prevLineBox() && !nextLineBox()) || !parent())
    11041114        boxModelObject()->paintFillLayerExtended(paintInfo, c, fillLayer, rect, BackgroundBleedNone, this, rect.size(), op);
     1115#if ENABLE(CSS_BOX_DECORATION_BREAK)
     1116    else if (renderer()->style()->boxDecorationBreak() == DCLONE) {
     1117        GraphicsContextStateSaver stateSaver(*paintInfo.context);
     1118        paintInfo.context->clip(LayoutRect(rect.x(), rect.y(), width(), height()));
     1119        boxModelObject()->paintFillLayerExtended(paintInfo, c, fillLayer, rect, BackgroundBleedNone, this, rect.size(), op);
     1120    }
     1121#endif
    11051122    else {
    11061123        // We have a fill image that spans multiple lines.
Note: See TracChangeset for help on using the changeset viewer.