Changeset 162480 in webkit


Ignore:
Timestamp:
Jan 21, 2014, 3:54:34 PM (12 years ago)
Author:
Simon Fraser
Message:

Remove #if PLATFORM(IOS) in various places around customFixedPositionLayoutRect() code
https://bugs.webkit.org/show_bug.cgi?id=127373

Reviewed by Beth Dakin.

Instead of PLATFORM(IOS) #idefs at every call site for viewportConstrainedVisibleContentRect(),
move the #ifdef inside viewportConstrainedVisibleContentRect().

The one call site that needs special handling is RenderLayerBacking::updateCompositedBounds(),
which needs to avoid clipping fixed layers to the custom fixed position rect, but instead to
visibleContentRect() (which is really the document bounds on iOS). This ensures that the
fixed layers aren't clipped when zooming out.

  • page/FrameView.cpp:

(WebCore::FrameView::viewportConstrainedVisibleContentRect):

  • rendering/RenderBoxModelObject.cpp:

(WebCore::RenderBoxModelObject::stickyPositionOffset):

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::updateCompositedBounds):

  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::requiresCompositingForPosition):
(WebCore::RenderLayerCompositor::computeFixedViewportConstraints):
(WebCore::RenderLayerCompositor::computeStickyViewportConstraints):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r162477 r162480  
     12014-01-21  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Remove #if PLATFORM(IOS) in various places around customFixedPositionLayoutRect() code
     4        https://bugs.webkit.org/show_bug.cgi?id=127373
     5
     6        Reviewed by Beth Dakin.
     7
     8        Instead of PLATFORM(IOS) #idefs at every call site for viewportConstrainedVisibleContentRect(),
     9        move the #ifdef inside viewportConstrainedVisibleContentRect().
     10       
     11        The one call site that needs special handling is RenderLayerBacking::updateCompositedBounds(),
     12        which needs to avoid clipping fixed layers to the custom fixed position rect, but instead to
     13        visibleContentRect() (which is really the document bounds on iOS). This ensures that the
     14        fixed layers aren't clipped when zooming out.
     15
     16        * page/FrameView.cpp:
     17        (WebCore::FrameView::viewportConstrainedVisibleContentRect):
     18        * rendering/RenderBoxModelObject.cpp:
     19        (WebCore::RenderBoxModelObject::stickyPositionOffset):
     20        * rendering/RenderLayerBacking.cpp:
     21        (WebCore::RenderLayerBacking::updateCompositedBounds):
     22        * rendering/RenderLayerCompositor.cpp:
     23        (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
     24        (WebCore::RenderLayerCompositor::computeFixedViewportConstraints):
     25        (WebCore::RenderLayerCompositor::computeStickyViewportConstraints):
     26
    1272014-01-21  Andy Estes  <aestes@apple.com>
    228
  • trunk/Source/WebCore/page/FrameView.cpp

    r162264 r162480  
    16191619LayoutRect FrameView::viewportConstrainedVisibleContentRect() const
    16201620{
     1621#if PLATFORM(IOS)
     1622    if (useCustomFixedPositionLayoutRect())
     1623        return customFixedPositionLayoutRect();
     1624#endif
    16211625    LayoutRect viewportRect = visibleContentRect();
    16221626    viewportRect.setLocation(toPoint(scrollOffsetForFixedPosition()));
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r162238 r162480  
    433433        constrainingRect.setLocation(scrollOffset);
    434434    } else {
    435 #if PLATFORM(IOS)
    436         LayoutRect viewportRect = view().frameView().customFixedPositionLayoutRect();
    437 #else
    438435        LayoutRect viewportRect = view().frameView().viewportConstrainedVisibleContentRect();
    439 #endif
    440436        float scale = view().frameView().frame().frameScaleFactor();
    441437        viewportRect.scale(1 / scale);
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r162230 r162480  
    490490
    491491        LayoutRect clippingBounds;
    492         if (renderer().style().position() == FixedPosition && renderer().container() == &view)
     492        if (renderer().style().position() == FixedPosition && renderer().container() == &view) {
     493#if PLATFORM(IOS)
     494            clippingBounds = view.frameView().visibleContentRect();
     495#else
    493496            clippingBounds = view.frameView().viewportConstrainedVisibleContentRect();
    494         else
     497#endif
     498        } else
    495499            clippingBounds = view.unscaledDocumentRect();
    496500
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r162443 r162480  
    25582558
    25592559    // Fixed position elements that are invisible in the current view don't get their own layer.
    2560 #if PLATFORM(IOS)
    2561     LayoutRect viewBounds = m_renderView.frameView().customFixedPositionLayoutRect();
    2562 #else
    25632560    LayoutRect viewBounds = m_renderView.frameView().viewportConstrainedVisibleContentRect();
    2564 #endif
    25652561    LayoutRect layerBounds = layer.calculateLayerBounds(&layer, 0, RenderLayer::UseLocalClipRectIfPossible | RenderLayer::IncludeLayerFilterOutsets | RenderLayer::UseFragmentBoxes
    25662562        | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask | RenderLayer::IncludeCompositedDescendants);
     
    33863382    ASSERT(layer.isComposited());
    33873383
    3388 #if PLATFORM(IOS)
    3389     LayoutRect viewportRect = m_renderView.frameView().customFixedPositionLayoutRect();
    3390 #else
     3384    GraphicsLayer* graphicsLayer = layer.backing()->graphicsLayer();
    33913385    LayoutRect viewportRect = m_renderView.frameView().viewportConstrainedVisibleContentRect();
    3392 #endif
    33933386
    33943387    FixedPositionViewportConstraints constraints;
    3395 
    3396     GraphicsLayer* graphicsLayer = layer.backing()->graphicsLayer();
    3397 
    33983388    constraints.setLayerPositionAtLastLayout(graphicsLayer->position());
    33993389    constraints.setViewportRectAtLastLayout(viewportRect);
     
    34323422#endif
    34333423
    3434 #if PLATFORM(IOS)
    3435     LayoutRect viewportRect = m_renderView.frameView().customFixedPositionLayoutRect();
    3436 #else
    34373424    LayoutRect viewportRect = m_renderView.frameView().viewportConstrainedVisibleContentRect();
    3438 #endif
    3439 
    34403425    RenderBoxModelObject& renderer = toRenderBoxModelObject(layer.renderer());
    34413426
Note: See TracChangeset for help on using the changeset viewer.