Changeset 38678 in webkit


Ignore:
Timestamp:
Nov 21, 2008 2:49:22 PM (15 years ago)
Author:
Simon Fraser
Message:

2008-11-21 Simon Fraser <Simon Fraser>

Reviewed by Darin Adler

https://bugs.webkit.org/show_bug.cgi?id=22159

RenderBox::absoluteClippedOverflowRect() needs to inflate the rect by
maximalOutlineSize(), since a child might have an outline which projects
outside the parent overflowRect().

We also need to ensure that maximalOutlineSize() is updated early in styleDidChange,
so that it is valid for these repaints.

Test: fast/repaint/outline-child-repaint.html

  • WebCore.xcodeproj/project.pbxproj:
  • rendering/RenderBox.cpp: (WebCore::RenderBox::styleDidChange): (WebCore::RenderBox::absoluteClippedOverflowRect):
Location:
trunk
Files:
4 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r38674 r38678  
     12008-11-21  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Reviewed by Darin Adler
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=22159
     6
     7        Add testcase for repaint issue with outlines on child objects,
     8        and redo bases affected by this change.
     9       
     10        * fast/repaint/outline-child-repaint.html: Added.
     11        * platform/mac/fast/repaint/4776765-expected.checksum:
     12        * platform/mac/fast/repaint/4776765-expected.png:
     13        * platform/mac/fast/repaint/delete-into-nested-block-expected.checksum:
     14        * platform/mac/fast/repaint/delete-into-nested-block-expected.png:
     15        * platform/mac/fast/repaint/outline-child-repaint-expected.checksum: Added.
     16        * platform/mac/fast/repaint/outline-child-repaint-expected.png: Added.
     17        * platform/mac/fast/repaint/outline-child-repaint-expected.txt: Added.
     18        * platform/mac/fast/repaint/outline-repaint-glitch-expected.checksum:
     19        * platform/mac/fast/repaint/outline-repaint-glitch-expected.png:
     20
    1212008-11-21  Cameron Zwarich  <zwarich@apple.com>
    222
  • trunk/LayoutTests/platform/mac/fast/repaint/4776765-expected.checksum

    r38121 r38678  
    1 d9efb3d8dd6e94bc63ff3d1558dc4106
     1d2b4d51ab62ca124cd487bd38d055ddb
  • trunk/LayoutTests/platform/mac/fast/repaint/delete-into-nested-block-expected.checksum

    r38121 r38678  
    1 d21960cafb177828d4bef876dc950b50
     12da6492b8de74e7d8f79684accad6aa7
  • trunk/LayoutTests/platform/mac/fast/repaint/outline-repaint-glitch-expected.checksum

    r38121 r38678  
    1 481b9d6f64a47ba8776ea68ce4f7ccd8
     1fef1b08962a4f2edf1870cc77b8bdca4
  • trunk/WebCore/ChangeLog

    r38677 r38678  
     12008-11-21  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Reviewed by Darin Adler
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=22159
     6
     7        RenderBox::absoluteClippedOverflowRect() needs to inflate the rect by
     8        maximalOutlineSize(), since a child might have an outline which projects
     9        outside the parent overflowRect().
     10       
     11        We also need to ensure that maximalOutlineSize() is updated early in styleDidChange,
     12        so that it is valid for these repaints.
     13
     14        Test: fast/repaint/outline-child-repaint.html
     15
     16        * WebCore.xcodeproj/project.pbxproj:
     17        * rendering/RenderBox.cpp:
     18        (WebCore::RenderBox::styleDidChange):
     19        (WebCore::RenderBox::absoluteClippedOverflowRect):
     20
    1212008-11-21  Jan Michael Alonzo  <jmalonzo@webkit.org>
    222
  • trunk/WebCore/rendering/RenderBox.cpp

    r38353 r38678  
    108108void RenderBox::styleDidChange(RenderStyle::Diff diff, const RenderStyle* oldStyle)
    109109{
     110    // We need to ensure that view->maximalOutlineSize() is valid for any repaints that happen
     111    // during the style change (it's used by absoluteClippedOverflowRect()).
     112    if (style()->outlineWidth() > 0 && style()->outlineSize() > maximalOutlineSize(PaintPhaseOutline))
     113        static_cast<RenderView*>(document()->renderer())->setMaximalOutlineSize(style()->outlineSize());
     114
    110115    RenderObject::styleDidChange(diff, oldStyle);
    111116
     
    205210    if (isBody())
    206211        document()->setTextColor(style()->color());
    207 
    208     if (style()->outlineWidth() > 0 && style()->outlineSize() > maximalOutlineSize(PaintPhaseOutline))
    209         static_cast<RenderView*>(document()->renderer())->setMaximalOutlineSize(style()->outlineSize());
    210212}
    211213
     
    11641166    IntRect r = overflowRect(false);
    11651167
    1166     if (RenderView* v = view())
     1168    RenderView* v = view();
     1169    if (v)
    11671170        r.move(v->layoutDelta());
    11681171
     
    11721175            theme()->adjustRepaintRect(this, r);
    11731176
    1174         // FIXME: Technically the outline inflation could fit within the theme inflation.
    1175         if (!isInline() && continuation())
    1176             r.inflate(continuation()->style()->outlineSize());
    1177         else
    1178             r.inflate(style()->outlineSize());
     1177        // We have to use maximalOutlineSize() because a child might have an outline
     1178        // that projects outside of our overflowRect.
     1179        if (v) {
     1180            ASSERT(style()->outlineSize() <= v->maximalOutlineSize());
     1181            r.inflate(v->maximalOutlineSize());
     1182        }
    11791183    }
    11801184    computeAbsoluteRepaintRect(r);
Note: See TracChangeset for help on using the changeset viewer.