Changeset 103955 in webkit


Ignore:
Timestamp:
Jan 3, 2012 12:08:14 PM (12 years ago)
Author:
jchaffraix@webkit.org
Message:

RenderLayer::backgroundClipRect should not check parent()
https://bugs.webkit.org/show_bug.cgi?id=73731

Reviewed by Simon Fraser.

Clean-up only, no expected change in behavior.

  • rendering/RenderLayer.cpp:

(WebCore::backgroundClipRectForPosition): Changed RenderObject::isPositioned() to
a check for AbsolutePosition for consistency but also as this is equivalent due to:

  • the previous check for FixedPosition.
  • RenderView, which is positioned, will never goes to this code as it has no parent().

(WebCore::RenderLayer::backgroundClipRect): Removed the parent() check. While at
it, also moved the inline initialization of |backgroundClipRect| to its own function
and removed a |view| check as the associated ASSERT seems to never have been reached.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r103954 r103955  
     12012-01-03  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        RenderLayer::backgroundClipRect should not check parent()
     4        https://bugs.webkit.org/show_bug.cgi?id=73731
     5
     6        Reviewed by Simon Fraser.
     7
     8        Clean-up only, no expected change in behavior.
     9
     10        * rendering/RenderLayer.cpp:
     11        (WebCore::backgroundClipRectForPosition): Changed RenderObject::isPositioned() to
     12        a check for AbsolutePosition for consistency but also as this is equivalent due to:
     13        - the previous check for FixedPosition.
     14        - RenderView, which is positioned, will never goes to this code as it has no parent().
     15
     16        (WebCore::RenderLayer::backgroundClipRect): Removed the parent() check. While at
     17        it, also moved the inline initialization of |backgroundClipRect| to its own function
     18        and removed a |view| check as the associated ASSERT seems to never have been reached.
     19
    1202012-01-03  Alexey Proskuryakov  <ap@apple.com>
    221
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r103800 r103955  
    36983698}
    36993699
     3700static inline ClipRect backgroundClipRectForPosition(const ClipRects& parentRects, EPosition position)
     3701{
     3702    if (position == FixedPosition)
     3703        return parentRects.fixedClipRect();
     3704
     3705    if (position == AbsolutePosition)
     3706        return parentRects.posClipRect();
     3707
     3708    return parentRects.overflowClipRect();
     3709}
     3710
    37003711ClipRect RenderLayer::backgroundClipRect(const RenderLayer* rootLayer, RenderRegion* region, bool temporaryClipRects, OverlayScrollbarSizeRelevancy relevancy) const
    37013712{
    3702     ClipRect backgroundRect;
    3703     if (parent()) {
    3704         ClipRects parentRects;
    3705         parentClipRects(rootLayer, region, parentRects, temporaryClipRects, relevancy);
    3706         backgroundRect = renderer()->style()->position() == FixedPosition ? parentRects.fixedClipRect() :
    3707                          (renderer()->isPositioned() ? parentRects.posClipRect() :
    3708                                                        parentRects.overflowClipRect());
    3709         RenderView* view = renderer()->view();
    3710         ASSERT(view);
    3711         if (view && parentRects.fixed() && rootLayer->renderer() == view)
    3712             backgroundRect.move(view->frameView()->scrollXForFixedPosition(), view->frameView()->scrollYForFixedPosition());
    3713     }
    3714     return backgroundRect;
     3713    ASSERT(parent());
     3714    ClipRects parentRects;
     3715    parentClipRects(rootLayer, region, parentRects, temporaryClipRects, relevancy);
     3716    ClipRect backgroundClipRect = backgroundClipRectForPosition(parentRects, renderer()->style()->position());
     3717    RenderView* view = renderer()->view();
     3718    ASSERT(view);
     3719    if (parentRects.fixed() && rootLayer->renderer() == view)
     3720        backgroundClipRect.move(view->frameView()->scrollXForFixedPosition(), view->frameView()->scrollYForFixedPosition());
     3721    return backgroundClipRect;
    37153722}
    37163723
Note: See TracChangeset for help on using the changeset viewer.