Changeset 147303 in webkit


Ignore:
Timestamp:
Mar 31, 2013 10:54:13 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Gradient background does not get repainted when child box is expanded.
https://bugs.webkit.org/show_bug.cgi?id=113644

Source/WebCore:

Patch by Zalan Bujtas <Alan Bujtas> on 2013-03-31
Reviewed by Antti Koivisto.

The initial value for background-size is SizeNone and remains, unless it is
set explicitly. However, when the background shorthand is used,
the size property defaults to SizeLength. The repaint
logic in mustRepaintFillLayers expects to have this value set correctly.

Test: fast/repaint/background-shorthand-with-gradient-and-height-changes.html

  • rendering/RenderObject.cpp:

(WebCore::mustRepaintFillLayers): code cleanup. no functionality change.

  • rendering/style/FillLayer.cpp:

(WebCore::FillLayer::FillLayer):

  • rendering/style/FillLayer.h: use SizeNone as initial value.

(WebCore::FillLayer::initialFillSizeType):
(WebCore::FillLayer::initialFillSize):

LayoutTests:

Patch by Zalan Bujtas <Alan Bujtas> on 2013-03-31
Reviewed by Antti Koivisto.

  • fast/repaint/background-shorthand-with-gradient-and-height-changes-expected.txt: Added.
  • fast/repaint/background-shorthand-with-gradient-and-height-changes.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r147302 r147303  
     12013-03-31  Zalan Bujtas  <zalan@apple.com>
     2
     3        Gradient background does not get repainted when child box is expanded.
     4        https://bugs.webkit.org/show_bug.cgi?id=113644
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * fast/repaint/background-shorthand-with-gradient-and-height-changes-expected.txt: Added.
     9        * fast/repaint/background-shorthand-with-gradient-and-height-changes.html: Added.
     10
    1112013-03-31  Shinya Kawanaka  <shinyak@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r147295 r147303  
     12013-03-31  Zalan Bujtas  <zalan@apple.com>
     2
     3        Gradient background does not get repainted when child box is expanded.
     4        https://bugs.webkit.org/show_bug.cgi?id=113644
     5
     6        Reviewed by Antti Koivisto.
     7       
     8        The initial value for background-size is SizeNone and remains, unless it is
     9        set explicitly. However, when the background shorthand is used,
     10        the size property defaults to SizeLength. The repaint
     11        logic in mustRepaintFillLayers expects to have this value set correctly.
     12
     13        Test: fast/repaint/background-shorthand-with-gradient-and-height-changes.html
     14
     15        * rendering/RenderObject.cpp:
     16        (WebCore::mustRepaintFillLayers): code cleanup. no functionality change.
     17        * rendering/style/FillLayer.cpp:
     18        (WebCore::FillLayer::FillLayer):
     19        * rendering/style/FillLayer.h:    use SizeNone as initial value.
     20        (WebCore::FillLayer::initialFillSizeType):
     21        (WebCore::FillLayer::initialFillSize):
     22
    1232013-03-31  Hayato Ito  <hayato@chromium.org>
    224
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r147110 r147303  
    830830        return true;
    831831
    832     if (layer->size().type == SizeLength) {
    833         if (layer->size().size.width().isPercent() || layer->size().size.height().isPercent())
     832    EFillSizeType sizeType = layer->sizeType();
     833
     834    if (sizeType == Contain || sizeType == Cover)
     835        return true;
     836   
     837    if (sizeType == SizeLength) {
     838        if (layer->sizeLength().width().isPercent() || layer->sizeLength().height().isPercent())
    834839            return true;
    835     } else if (layer->size().type == Contain || layer->size().type == Cover || img->usesImageContainerSize())
     840    } else if (img->usesImageContainerSize())
    836841        return true;
    837842
  • trunk/Source/WebCore/rendering/style/FillLayer.cpp

    r142168 r147303  
    5353    , m_repeatY(FillLayer::initialFillRepeatY(type))
    5454    , m_composite(FillLayer::initialFillComposite(type))
    55     , m_sizeType(SizeNone)
     55    , m_sizeType(FillLayer::initialFillSizeType(type))
    5656    , m_blendMode(FillLayer::initialFillBlendMode(type))
    5757    , m_imageSet(false)
  • trunk/Source/WebCore/rendering/style/FillLayer.h

    r142168 r147303  
    179179    static CompositeOperator initialFillComposite(EFillLayerType) { return CompositeSourceOver; }
    180180    static BlendMode initialFillBlendMode(EFillLayerType) { return BlendModeNormal; }
    181     static EFillSizeType initialFillSizeType(EFillLayerType) { return SizeLength; }
     181    static EFillSizeType initialFillSizeType(EFillLayerType) { return SizeNone; }
    182182    static LengthSize initialFillSizeLength(EFillLayerType) { return LengthSize(); }
    183     static FillSize initialFillSize(EFillLayerType) { return FillSize(); }
     183    static FillSize initialFillSize(EFillLayerType type) { return FillSize(initialFillSizeType(type), initialFillSizeLength(type)); }
    184184    static Length initialFillXPosition(EFillLayerType) { return Length(0.0, Percent); }
    185185    static Length initialFillYPosition(EFillLayerType) { return Length(0.0, Percent); }
Note: See TracChangeset for help on using the changeset viewer.