Changeset 38338 in webkit


Ignore:
Timestamp:
Nov 12, 2008 12:22:28 PM (15 years ago)
Author:
Simon Fraser
Message:

2008-11-12 Simon Fraser <Simon Fraser>

Reviewed by Dave Hyatt

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

Fix repainting when the transform on a positioned element changes.
In computeAbsoluteRepaintRect(), add the offsets due to relative positioning,
and being in a positioned container after applying the transform to the local
rect.

Tests: fast/repaint/transform-absolute-in-positioned-container.html

fast/repaint/transform-relative-position.html

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

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r38337 r38338  
     12008-11-12  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Reviewed by Dave Hyatt
     4       
     5        https://bugs.webkit.org/show_bug.cgi?id=17840
     6       
     7        Tests for repainting when the transform of a positioned element changes.
     8
     9        * fast/repaint/transform-absolute-in-positioned-container.html: Added.
     10        * fast/repaint/transform-relative-position.html: Added.
     11        * platform/mac/fast/repaint/transform-absolute-in-positioned-container-expected.checksum: Added.
     12        * platform/mac/fast/repaint/transform-absolute-in-positioned-container-expected.png: Added.
     13        * platform/mac/fast/repaint/transform-absolute-in-positioned-container-expected.txt: Added.
     14        * platform/mac/fast/repaint/transform-relative-position-expected.checksum: Added.
     15        * platform/mac/fast/repaint/transform-relative-position-expected.png: Added.
     16        * platform/mac/fast/repaint/transform-relative-position-expected.txt: Added.
     17
    1182008-11-12  Justin Garcia  <justin.garcia@apple.com>
    219
  • trunk/WebCore/ChangeLog

    r38337 r38338  
     12008-11-12  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Reviewed by Dave Hyatt
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=17840
     6
     7        Fix repainting when the transform on a positioned element changes.
     8        In computeAbsoluteRepaintRect(), add the offsets due to relative positioning,
     9        and being in a positioned container after applying the transform to the local
     10        rect.
     11
     12        Tests: fast/repaint/transform-absolute-in-positioned-container.html
     13               fast/repaint/transform-relative-position.html
     14
     15        * rendering/RenderBox.cpp:
     16        (WebCore::RenderBox::computeAbsoluteRepaintRect):
     17
    1182008-11-12  Justin Garcia  <justin.garcia@apple.com>
    219 
  • trunk/WebCore/rendering/RenderBox.cpp

    r38186 r38338  
    11841184    topLeft.move(m_x, m_y);
    11851185
    1186     // Apply the relative position offset when invalidating a rectangle.  The layer
    1187     // is translated, but the render box isn't, so we need to do this to get the
    1188     // right dirty rect.  Since this is called from RenderObject::setStyle, the relative position
    1189     // flag on the RenderObject has been cleared, so use the one on the style().
    1190     if (style()->position() == RelativePosition && m_layer)
    1191         topLeft += m_layer->relativePositionOffset();
    1192 
    11931186    if (style()->position() == FixedPosition)
    11941187        fixed = true;
     
    12061199        }
    12071200
    1208         if (style()->position() == AbsolutePosition)
    1209             topLeft += offsetForPositionedInContainer(o);
    1210        
    12111201        // We are now in our parent container's coordinate space.  Apply our transform to obtain a bounding box
    12121202        // in the parent's coordinate space that encloses us.
     
    12171207            topLeft.move(m_x, m_y);
    12181208        }
     1209
     1210        if (style()->position() == AbsolutePosition)
     1211            topLeft += offsetForPositionedInContainer(o);
     1212
     1213        // Apply the relative position offset when invalidating a rectangle.  The layer
     1214        // is translated, but the render box isn't, so we need to do this to get the
     1215        // right dirty rect.  Since this is called from RenderObject::setStyle, the relative position
     1216        // flag on the RenderObject has been cleared, so use the one on the style().
     1217        if (style()->position() == RelativePosition && m_layer)
     1218            topLeft += m_layer->relativePositionOffset();
    12191219
    12201220        // FIXME: We ignore the lightweight clipping rect that controls use, since if |o| is in mid-layout,
Note: See TracChangeset for help on using the changeset viewer.