Changeset 18491 in webkit


Ignore:
Timestamp:
Dec 31, 2006 6:25:57 AM (17 years ago)
Author:
ddkilzer
Message:

LayoutTests:

Reviewed by Hyatt. Tweaked by Mitz.

  • fast/overflow/clip-rects-fixed-ancestor-expected.checksum: Added.
  • fast/overflow/clip-rects-fixed-ancestor-expected.png: Added.
  • fast/overflow/clip-rects-fixed-ancestor-expected.txt: Added.
  • fast/overflow/clip-rects-fixed-ancestor.html: Added.

WebCore:

Reviewed by Hyatt.

Added a 'fixed' flag to ClipRects, indicating that the cached rects are in
viewport coordinates. The flag is set (and scrolling is compensated for) for
fixed objects and their descendants.

  • rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects): (WebCore::RenderLayer::calculateRects):
  • rendering/RenderLayer.h: (WebCore::ClipRects::ClipRects): (WebCore::ClipRects::fixed):
Location:
trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r18490 r18491  
     12006-12-31  Chris McLay  <chris@eeoh.com.au>
     2
     3        Reviewed by Hyatt. Tweaked by Mitz.
     4
     5        - test for http://bugs.webkit.org/show_bug.cgi?id=9659
     6          Quirksmode: Fixed / Overflow > Positioned objects get hidden when scrolling
     7
     8        * fast/overflow/clip-rects-fixed-ancestor-expected.checksum: Added.
     9        * fast/overflow/clip-rects-fixed-ancestor-expected.png: Added.
     10        * fast/overflow/clip-rects-fixed-ancestor-expected.txt: Added.
     11        * fast/overflow/clip-rects-fixed-ancestor.html: Added.
     12
    1132006-12-31  Mitz Pettel  <mitz@webkit.org>
    214
  • trunk/WebCore/ChangeLog

    r18490 r18491  
     12006-12-31  Mitz Pettel  <mitz@webkit.org>
     2
     3        Reviewed by Hyatt.
     4
     5        - fix http://bugs.webkit.org/show_bug.cgi?id=9659
     6          Quirksmode: Fixed / Overflow > Positioned objects get hidden when scrolling
     7
     8        Added a 'fixed' flag to ClipRects, indicating that the cached rects are in
     9        viewport coordinates. The flag is set (and scrolling is compensated for) for
     10        fixed objects and their descendants.
     11
     12        * rendering/RenderLayer.cpp:
     13        (WebCore::RenderLayer::calculateClipRects):
     14        (WebCore::RenderLayer::calculateRects):
     15        * rendering/RenderLayer.h:
     16        (WebCore::ClipRects::ClipRects):
     17        (WebCore::ClipRects::fixed):
     18
    1192006-12-31  Mitz Pettel  <mitz@webkit.org>
    220
  • trunk/WebCore/rendering/RenderLayer.cpp

    r18327 r18491  
    16161616    IntRect overflowClipRect(parent()->clipRects()->overflowClipRect());
    16171617    IntRect fixedClipRect(parent()->clipRects()->fixedClipRect());
     1618    bool fixed = parent()->clipRects()->fixed();
    16181619
    16191620    // A fixed object is essentially the root of its containing block hierarchy, so when
     
    16221623        posClipRect = fixedClipRect;
    16231624        overflowClipRect = fixedClipRect;
     1625        fixed = true;
    16241626    }
    16251627    else if (m_object->style()->position() == RelativePosition)
     
    16341636        int y = 0;
    16351637        convertToLayerCoords(rootLayer, x, y);
     1638        if (fixed) {
     1639            x -= renderer()->view()->frameView()->contentsX();
     1640            y -= renderer()->view()->frameView()->contentsY();
     1641        }
    16361642       
    16371643        if (m_object->hasOverflowClip()) {
     
    16511657    // If our clip rects match our parent's clip, then we can just share its data structure and
    16521658    // ref count.
    1653     if (posClipRect == parent()->clipRects()->posClipRect() &&
     1659    if (fixed == parent()->clipRects()->fixed() &&
     1660        posClipRect == parent()->clipRects()->posClipRect() &&
    16541661        overflowClipRect == parent()->clipRects()->overflowClipRect() &&
    16551662        fixedClipRect == parent()->clipRects()->fixedClipRect())
    16561663        m_clipRects = parent()->clipRects();
    16571664    else
    1658         m_clipRects = new (m_object->renderArena()) ClipRects(overflowClipRect, fixedClipRect, posClipRect);
     1665        m_clipRects = new (m_object->renderArena()) ClipRects(overflowClipRect, fixedClipRect, posClipRect, fixed);
    16591666    m_clipRects->ref();
    16601667}
     
    16651672    if (parent()) {
    16661673        parent()->calculateClipRects(rootLayer);
     1674
    16671675        backgroundRect = m_object->style()->position() == FixedPosition ? parent()->clipRects()->fixedClipRect() :
    16681676                         (m_object->isPositioned() ? parent()->clipRects()->posClipRect() :
    16691677                                                     parent()->clipRects()->overflowClipRect());
     1678        if (parent()->clipRects()->fixed())
     1679            backgroundRect.move(renderer()->view()->frameView()->contentsX(), renderer()->view()->frameView()->contentsY());
     1680
    16701681        backgroundRect.intersect(paintDirtyRect);
    16711682    } else
  • trunk/WebCore/rendering/RenderLayer.h

    r17770 r18491  
    7171        , m_posClipRect(r)
    7272        , m_refCnt(0)
     73        , m_fixed(false)
    7374    {
    7475    }
    7576
    76     ClipRects(const IntRect& o, const IntRect& f, const IntRect& p)
    77         : m_overflowClipRect(o)
    78         , m_fixedClipRect(f)
    79         , m_posClipRect(p)
     77    ClipRects(const IntRect& overflowRect, const IntRect& fixedRect, const IntRect& posRect, bool fixed)
     78        : m_overflowClipRect(overflowRect)
     79        , m_fixedClipRect(fixedRect)
     80        , m_posClipRect(posRect)
    8081        , m_refCnt(0)
     82        , m_fixed(fixed)
    8183    {
    8284    }
     
    8587    const IntRect& fixedClipRect() { return m_fixedClipRect; }
    8688    const IntRect& posClipRect() { return m_posClipRect; }
     89    bool fixed() const { return m_fixed; }
    8790
    8891    void ref() { m_refCnt++; }
     
    105108    IntRect m_fixedClipRect;
    106109    IntRect m_posClipRect;
    107     unsigned m_refCnt;
     110    unsigned m_refCnt : 31;
     111    bool m_fixed : 1;
    108112};
    109113
Note: See TracChangeset for help on using the changeset viewer.