Changeset 182197 in webkit


Ignore:
Timestamp:
Mar 31, 2015 12:32:12 PM (9 years ago)
Author:
commit-queue@webkit.org
Message:

border-image with 'fill' keyword does not fill the middle area unless the border width is greater than zero.
https://bugs.webkit.org/show_bug.cgi?id=142650.

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2015-03-31
Reviewed by Simon Fraser.

Source/WebCore:

The decoration of a RenderBox, a RenderTable or an InlineFlowBox should be
drawn if its RenderStyle has a non-zero width border or the border-image
has the keyword fill.

Tests: fast/borders/border-image-fill-inline-no-border.html

fast/borders/border-image-fill-no-border.html

  • rendering/InlineFlowBox.cpp:

(WebCore::InlineFlowBox::paintBoxDecorations):

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::paintBoxDecorations):

  • rendering/RenderBoxModelObject.cpp:

(WebCore::RenderBoxModelObject::hasBoxDecorationStyle):

  • rendering/RenderTable.cpp:

(WebCore::RenderTable::paintBoxDecorations):

  • rendering/style/BorderData.h:

(WebCore::BorderData::hasFill):

  • rendering/style/RenderStyle.h:

LayoutTests:

Add tests to ensure the middle area of a RenderBox is going to be drawn
even if the border width is not greater than zero.

  • fast/borders/border-image-fill-inline-no-border-expected.html: Added.
  • fast/borders/border-image-fill-inline-no-border.html: Added.
  • fast/borders/border-image-fill-no-border-expected.html: Added.
  • fast/borders/border-image-fill-no-border.html: Added.
  • fast/borders/resources/button-border-cropped.svg: Added.
  • fast/borders/resources/button-border.svg: Added.
  • fast/borders/resources/svg-100x100-intrinsic.svg: Added.
Location:
trunk
Files:
7 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r182195 r182197  
     12015-03-31  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        border-image with 'fill' keyword does not fill the middle area unless the border width is greater than zero.
     4        https://bugs.webkit.org/show_bug.cgi?id=142650.
     5
     6        Reviewed by Simon Fraser.
     7
     8        Add tests to ensure the middle area of a RenderBox is going to be drawn
     9        even if the border width is not greater than zero.
     10       
     11        * fast/borders/border-image-fill-inline-no-border-expected.html: Added.
     12        * fast/borders/border-image-fill-inline-no-border.html: Added.
     13        * fast/borders/border-image-fill-no-border-expected.html: Added.
     14        * fast/borders/border-image-fill-no-border.html: Added.
     15        * fast/borders/resources/button-border-cropped.svg: Added.
     16        * fast/borders/resources/button-border.svg: Added.
     17        * fast/borders/resources/svg-100x100-intrinsic.svg: Added.
     18
    1192015-03-31  David Hyatt  <hyatt@apple.com>
    220
  • trunk/Source/WebCore/ChangeLog

    r182196 r182197  
     12015-03-31  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        border-image with 'fill' keyword does not fill the middle area unless the border width is greater than zero.
     4        https://bugs.webkit.org/show_bug.cgi?id=142650.
     5
     6        Reviewed by Simon Fraser.
     7
     8        The decoration of a RenderBox, a RenderTable or an InlineFlowBox should be
     9        drawn if its RenderStyle has a non-zero width border or the border-image
     10        has the keyword fill.
     11
     12        Tests: fast/borders/border-image-fill-inline-no-border.html
     13               fast/borders/border-image-fill-no-border.html
     14
     15        * rendering/InlineFlowBox.cpp:
     16        (WebCore::InlineFlowBox::paintBoxDecorations):
     17        * rendering/RenderBox.cpp:
     18        (WebCore::RenderBox::paintBoxDecorations):
     19        * rendering/RenderBoxModelObject.cpp:
     20        (WebCore::RenderBoxModelObject::hasBoxDecorationStyle):
     21        * rendering/RenderTable.cpp:
     22        (WebCore::RenderTable::paintBoxDecorations):
     23        * rendering/style/BorderData.h:
     24        (WebCore::BorderData::hasFill):
     25        * rendering/style/RenderStyle.h:
     26
    1272015-03-31  Alex Christensen  <achristensen@webkit.org>
    228
  • trunk/Source/WebCore/rendering/InlineFlowBox.cpp

    r182111 r182197  
    13481348    // :first-line cannot be used to put borders on a line. Always paint borders with our
    13491349    // non-first-line style.
    1350     if (!parent() || !renderer().style().hasBorder())
     1350    if (!parent() || !renderer().style().hasBorderDecoration())
    13511351        return;
    13521352    const NinePieceImage& borderImage = renderer().style().borderImage();
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r182195 r182197  
    13071307
    13081308    // The theme will tell us whether or not we should also paint the CSS border.
    1309     if (bleedAvoidance != BackgroundBleedBackgroundOverBorder && (!style().hasAppearance() || (!themePainted && theme().paintBorderOnly(*this, paintInfo, paintRect))) && style().hasBorder())
     1309    if (bleedAvoidance != BackgroundBleedBackgroundOverBorder && (!style().hasAppearance() || (!themePainted && theme().paintBorderOnly(*this, paintInfo, paintRect))) && style().hasBorderDecoration())
    13101310        paintBorder(paintInfo, paintRect, style(), bleedAvoidance);
    13111311
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r182127 r182197  
    206206bool RenderBoxModelObject::hasBoxDecorationStyle() const
    207207{
    208     return hasBackground() || style().hasBorder() || style().hasAppearance() || style().boxShadow();
     208    return hasBackground() || style().hasBorderDecoration() || style().hasAppearance() || style().boxShadow();
    209209}
    210210
  • trunk/Source/WebCore/rendering/RenderTable.cpp

    r181398 r182197  
    736736    paintBoxShadow(paintInfo, rect, style(), Inset);
    737737
    738     if (style().hasBorder() && !collapseBorders())
     738    if (style().hasBorderDecoration() && !collapseBorders())
    739739        paintBorder(paintInfo, rect, style());
    740740}
  • trunk/Source/WebCore/rendering/style/BorderData.h

    r163262 r182197  
    4646        bool haveImage = m_image.hasImage();
    4747        return m_left.nonZero(!haveImage) || m_right.nonZero(!haveImage) || m_top.nonZero(!haveImage) || m_bottom.nonZero(!haveImage);
     48    }
     49
     50    bool hasFill() const
     51    {
     52        return m_image.hasImage() && m_image.fill();
    4853    }
    4954
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r182147 r182197  
    529529    bool hasMargin() const { return surround->margin.nonZero(); }
    530530    bool hasBorder() const { return surround->border.hasBorder(); }
     531    bool hasBorderFill() const { return surround->border.hasFill(); }
     532    bool hasBorderDecoration() const { return hasBorder() || hasBorderFill(); }
    531533    bool hasPadding() const { return surround->padding.nonZero(); }
    532534    bool hasOffset() const { return surround->offset.nonZero(); }
Note: See TracChangeset for help on using the changeset viewer.