Changeset 57633 in webkit


Ignore:
Timestamp:
Apr 14, 2010 9:48:05 PM (14 years ago)
Author:
Simon Fraser
Message:

2010-04-14 Simon Fraser <Simon Fraser>

Reviewed by Dan Bernstein.

Repaint of fixed, transformed element is broken
https://bugs.webkit.org/show_bug.cgi?id=37637

RenderBox::computeRectForRepaint() failed to set the 'fixed' flag correctly
for elements that had both fixed position and a transform. If the element has
a transform, 'fixed' should only remain true if the element itself is fixed
position.

Also cache style()->position() in a local variable for performance.

Test: fast/repaint/fixed-tranformed.html

  • rendering/RenderBox.cpp: (WebCore::RenderBox::computeRectForRepaint):
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r57631 r57633  
     12010-04-14  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        Repaint of fixed, transformed element is broken
     6        https://bugs.webkit.org/show_bug.cgi?id=37637
     7
     8        Testcase for repainting a fixed-position elemnt with a transform in a
     9        scrolled page.
     10       
     11        * fast/repaint/fixed-tranformed.html: Added.
     12        * platform/mac/fast/repaint/fixed-tranformed-expected.checksum: Added.
     13        * platform/mac/fast/repaint/fixed-tranformed-expected.png: Added.
     14        * platform/mac/fast/repaint/fixed-tranformed-expected.txt: Added.
     15
    1162010-04-14  Luiz Agostini  <luiz.agostini@openbossa.org>
    217
  • trunk/WebCore/ChangeLog

    r57631 r57633  
     12010-04-14  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Reviewed by Dan Bernstein.
     4
     5        Repaint of fixed, transformed element is broken
     6        https://bugs.webkit.org/show_bug.cgi?id=37637
     7
     8        RenderBox::computeRectForRepaint() failed to set the 'fixed' flag correctly
     9        for elements that had both fixed position and a transform. If the element has
     10        a transform, 'fixed' should only remain true if the element itself is fixed
     11        position.
     12       
     13        Also cache style()->position() in a local variable for performance.
     14       
     15        Test: fast/repaint/fixed-tranformed.html
     16
     17        * rendering/RenderBox.cpp:
     18        (WebCore::RenderBox::computeRectForRepaint):
     19
    1202010-04-14  Luiz Agostini  <luiz.agostini@openbossa.org>
    221
  • trunk/WebCore/rendering/RenderBox.cpp

    r57149 r57633  
    11851185    topLeft.move(x(), y());
    11861186
    1187     if (style()->position() == FixedPosition)
    1188         fixed = true;
    1189 
    1190     if (o->isBlockFlow() && style()->position() != AbsolutePosition && style()->position() != FixedPosition) {
     1187    EPosition position = style()->position();
     1188
     1189    if (o->isBlockFlow() && position != AbsolutePosition && position != FixedPosition) {
    11911190        RenderBlock* cb = toRenderBlock(o);
    11921191        if (cb->hasColumns()) {
     
    12011200    // in the parent's coordinate space that encloses us.
    12021201    if (layer() && layer()->transform()) {
    1203         fixed = false;
     1202        fixed = position == FixedPosition;
    12041203        rect = layer()->transform()->mapRect(rect);
    12051204        // FIXME: this clobbers topLeft adjustment done for multicol above
    12061205        topLeft = rect.location();
    12071206        topLeft.move(x(), y());
    1208     }
    1209 
    1210     if (style()->position() == AbsolutePosition && o->isRelPositioned() && o->isRenderInline())
     1207    } else if (position == FixedPosition)
     1208        fixed = true;
     1209
     1210    if (position == AbsolutePosition && o->isRelPositioned() && o->isRenderInline())
    12111211        topLeft += toRenderInline(o)->relativePositionedInlineOffset(this);
    1212     else if (style()->position() == RelativePosition && layer()) {
     1212    else if (position == RelativePosition && layer()) {
    12131213        // Apply the relative position offset when invalidating a rectangle.  The layer
    12141214        // is translated, but the render box isn't, so we need to do this to get the
Note: See TracChangeset for help on using the changeset viewer.