Changeset 121443 in webkit


Ignore:
Timestamp:
Jun 28, 2012 11:08:46 AM (12 years ago)
Author:
Simon Fraser
Message:

Change FrameView::scrollContentsFastPath to use m_fixedObjects
https://bugs.webkit.org/show_bug.cgi?id=90045

Reviewed by James Robinson.

FrameView now has a hash set of fixed-position objects, so use
that instead of RenderBlock::positionedObjects(); we'll avoid traversing
through absolutely positioned objects, and this will work better for sticky
positioning in future.

No behavior change, so no new tests.

  • page/FrameView.cpp:

(WebCore::FrameView::scrollContentsFastPath):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r121442 r121443  
     12012-06-28  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Change FrameView::scrollContentsFastPath to use m_fixedObjects
     4        https://bugs.webkit.org/show_bug.cgi?id=90045
     5
     6        Reviewed by James Robinson.
     7       
     8        FrameView now has a hash set of fixed-position objects, so use
     9        that instead of RenderBlock::positionedObjects(); we'll avoid traversing
     10        through absolutely positioned objects, and this will work better for sticky
     11        positioning in future.
     12
     13        No behavior change, so no new tests.
     14
     15        * page/FrameView.cpp:
     16        (WebCore::FrameView::scrollContentsFastPath):
     17
    1182012-06-28  Tony Chang  <tony@chromium.org>
    219
  • trunk/Source/WebCore/page/FrameView.cpp

    r121348 r121443  
    14411441bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
    14421442{
    1443     RenderBlock::PositionedObjectsListHashSet* positionedObjects = 0;
    1444     if (RenderView* root = rootRenderer(this))
    1445         positionedObjects = root->positionedObjects();
    1446 
    1447     if (!positionedObjects || positionedObjects->isEmpty()) {
     1443    if (!m_fixedObjects || m_fixedObjects->isEmpty()) {
    14481444        hostWindow()->scroll(scrollDelta, rectToScroll, clipRect);
    14491445        return true;
     
    14541450    // Get the rects of the fixed objects visible in the rectToScroll
    14551451    Region regionToUpdate;
    1456     RenderBlock::PositionedObjectsListHashSet::const_iterator end = positionedObjects->end();
    1457     for (RenderBlock::PositionedObjectsListHashSet::const_iterator it = positionedObjects->begin(); it != end; ++it) {
    1458         RenderBox* renderBox = *it;
    1459         if (renderBox->style()->position() != FixedPosition)
     1452    FixedObjectSet::const_iterator end = m_fixedObjects->end();
     1453    for (FixedObjectSet::const_iterator it = m_fixedObjects->begin(); it != end; ++it) {
     1454        RenderObject* renderer = *it;
     1455        if (renderer->style()->position() != FixedPosition)
    14601456            continue;
    14611457#if USE(ACCELERATED_COMPOSITING)
    1462         if (renderBox->isComposited())
     1458        if (renderer->isComposited())
    14631459            continue;
    14641460#endif
     1461   
     1462        // Fixed items should always have layers.
     1463        ASSERT(renderer->hasLayer());
     1464        RenderLayer* layer = toRenderBoxModelObject(renderer)->layer();
     1465       
    14651466#if ENABLE(CSS_FILTERS)
    1466         if (renderBox->layer() && renderBox->layer()->parent()) {
    1467             RenderBoxModelObject* renderer = renderBox->layer()->parent()->renderer();
     1467        if (layer->parent()) {
     1468            RenderBoxModelObject* renderer = layer->parent()->renderer();
    14681469            if (renderer->style()->hasFilterOutsets()) {
    14691470                // If the fixed layer has a blur/drop-shadow filter applied on its parent, we cannot
     
    14731474        }
    14741475#endif
    1475         IntRect updateRect = pixelSnappedIntRect(renderBox->layer()->repaintRectIncludingNonCompositingDescendants());
     1476        IntRect updateRect = pixelSnappedIntRect(layer->repaintRectIncludingNonCompositingDescendants());
    14761477        updateRect = contentsToRootView(updateRect);
    14771478        if (!isCompositedContentLayer && clipsRepaints())
Note: See TracChangeset for help on using the changeset viewer.