Changeset 148203 in webkit


Ignore:
Timestamp:
Apr 11, 2013 7:51:08 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Parent box with background-size auto and gradient image does not get properly repainted when child box is resized.
https://bugs.webkit.org/show_bug.cgi?id=114424

Source/WebCore:

Patch by Zalan Bujtas <Alan Bujtas> on 2013-04-11
Reviewed by Antti Koivisto.

Initiate full repaint on fill layer, when the image is generated and the background
property defines auto size.
http://www.w3.org/TR/css3-background/#background-size
'If the image has neither an intrinsic width nor an intrinsic height, its size is determined as for 'contain'.'

Extended fast/repaint/background-shorthand-with-gradient-and-height-changes.html
to cover this case too.

  • rendering/RenderObject.cpp:

(WebCore::mustRepaintFillLayers):

LayoutTests:

Patch by Zalan Bujtas <Alan Bujtas> on 2013-04-11
Reviewed by Antti Koivisto.

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

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r148196 r148203  
     12013-04-11  Zalan Bujtas  <zalan@apple.com>
     2
     3        Parent box with background-size auto and gradient image does not get properly repainted when child box is resized.
     4        https://bugs.webkit.org/show_bug.cgi?id=114424
     5
     6        Reviewed by Antti Koivisto.
     7
     8        * fast/repaint/background-shorthand-with-gradient-and-height-changes-expected.txt:
     9        * fast/repaint/background-shorthand-with-gradient-and-height-changes.html:
     10
    1112013-04-11  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
    212
  • trunk/LayoutTests/fast/repaint/background-shorthand-with-gradient-and-height-changes-expected.txt

    r147303 r148203  
    44
    55
    6 PASS repaintRects.indexOf('500') is not -1
     6PASS repaintRects.indexOf('28 84') is not -1
     7PASS repaintRects.indexOf('8 84') is not -1
    78PASS successfullyParsed is true
    89
  • trunk/LayoutTests/fast/repaint/background-shorthand-with-gradient-and-height-changes.html

    r147303 r148203  
    55
    66<style>
    7 #outer {
    8     padding-top: 200px;
     7#wrapper {
     8    width: 40px;
     9}
     10
     11#outer-background-shorthand {
     12    width: 20px;
     13    padding-top: 20px;
     14    float:right;
    915        background:-webkit-gradient(
    1016            linear,
     
    1521}
    1622
    17 #inner {
    18     height: 100px;
     23#outer-background-size-auto {
     24    width: 20px;
     25    padding-top: 20px;
     26        background-size: auto;
     27        background-image: -webkit-gradient(
     28            linear,
     29            left top,
     30            left bottom,
     31            color-stop(0%, rgba(255,255,0,0)), color-stop(100%, rgba(0,0,0,1))
     32        );
     33}
     34
     35.inner {
     36    height: 10px;
    1937}
    2038</style>
     
    2543function start() {
    2644    window.setTimeout(function() {
    27         document.getElementById('inner').style.height = 300 + 'px';
     45        document.getElementsByClassName('inner')[0].style.height = 200 + 'px';
     46        document.getElementsByClassName('inner')[1].style.height = 200 + 'px';
     47       
    2848        window.setTimeout(logRepaints, 200);
    2949    }, 0);
     
    4262    repaintRects = window.internals.repaintRectsAsText(document);
    4363    window.internals.stopTrackingRepaints(document);
    44     shouldNotBe("repaintRects.indexOf('500')", "-1");
     64    shouldNotBe("repaintRects.indexOf('28 84')", "-1");
     65    shouldNotBe("repaintRects.indexOf('8 84')", "-1");
    4566    finishJSTest();
    4667}
     
    4970
    5071<body onload='start();'>
    51 <div id='outer'>
    52     <div id='inner'>
     72<div id='wrapper'>
     73    <div id='outer-background-shorthand'>
     74        <div class='inner'>
     75        </div>
     76    </div>
     77    <div id='outer-background-size-auto'>
     78        <div class='inner'>
     79        </div>
    5380    </div>
    5481</div>
  • trunk/Source/WebCore/ChangeLog

    r148202 r148203  
     12013-04-11  Zalan Bujtas  <zalan@apple.com>
     2
     3        Parent box with background-size auto and gradient image does not get properly repainted when child box is resized.
     4        https://bugs.webkit.org/show_bug.cgi?id=114424
     5
     6        Reviewed by Antti Koivisto.
     7       
     8        Initiate full repaint on fill layer, when the image is generated and the background
     9        property defines auto size.
     10        http://www.w3.org/TR/css3-background/#background-size
     11        'If the image has neither an intrinsic width nor an intrinsic height, its size is determined as for 'contain'.'
     12
     13        Extended fast/repaint/background-shorthand-with-gradient-and-height-changes.html
     14        to cover this case too.
     15
     16        * rendering/RenderObject.cpp:
     17        (WebCore::mustRepaintFillLayers):
     18
    1192013-04-11  ChangSeok Oh  <changseok.oh@collabora.com>
    220
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r147871 r148203  
    836836   
    837837    if (sizeType == SizeLength) {
    838         if (layer->sizeLength().width().isPercent() || layer->sizeLength().height().isPercent())
     838        LengthSize size = layer->sizeLength();
     839        if (size.width().isPercent() || size.height().isPercent())
     840            return true;
     841        // If the image has neither an intrinsic width nor an intrinsic height, its size is determined as for 'contain'.
     842        if ((size.width().isAuto() || size.height().isAuto()) && img->isGeneratedImage())
    839843            return true;
    840844    } else if (img->usesImageContainerSize())
Note: See TracChangeset for help on using the changeset viewer.