Changeset 163157 in webkit


Ignore:
Timestamp:
Jan 30, 2014 9:42:25 PM (10 years ago)
Author:
Simon Fraser
Message:

Some fixed position elements disappear in WK2 on iOS
https://bugs.webkit.org/show_bug.cgi?id=127977

Reviewed by Tim Horton.

Use the appropriate rectangle to ensure that on iOS we don't
consider a fixed element outside the viewport when zoomed in,
and therefore never make a compositing layer for it.

Also remove the iOS-specific code in RenderLayerCompositor::requiresCompositingForPosition(),
since it's OK to use the common code. Doing so requires that we
set the "acceleratedCompositingForFixedPositionEnabled" setting to true
for iOS, so do so.

  • page/Settings.cpp:
  • page/Settings.in:
  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::requiresCompositingForPosition):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r163156 r163157  
     12014-01-30  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Some fixed position elements disappear in WK2 on iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=127977
     5
     6        Reviewed by Tim Horton.
     7
     8        Use the appropriate rectangle to ensure that on iOS we don't
     9        consider a fixed element outside the viewport when zoomed in,
     10        and therefore never make a compositing layer for it.
     11
     12        Also remove the iOS-specific code in RenderLayerCompositor::requiresCompositingForPosition(),
     13        since it's OK to use the common code. Doing so requires that we
     14        set the "acceleratedCompositingForFixedPositionEnabled" setting to true
     15        for iOS, so do so.
     16
     17        * page/Settings.cpp:
     18        * page/Settings.in:
     19        * rendering/RenderLayerCompositor.cpp:
     20        (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
     21
    1222014-01-30  Zalan Bujtas  <zalan@apple.com>
    223
  • trunk/Source/WebCore/page/Settings.cpp

    r163079 r163157  
    125125#if PLATFORM(IOS)
    126126static const bool defaultFixedPositionCreatesStackingContext = true;
     127static const bool defaultAcceleratedCompositingForFixedPositionEnabled = true;
    127128static const bool defaultMediaPlaybackAllowsInline = false;
    128129static const bool defaultMediaPlaybackRequiresUserGesture = true;
     
    130131#else
    131132static const bool defaultFixedPositionCreatesStackingContext = false;
     133static const bool defaultAcceleratedCompositingForFixedPositionEnabled = false;
    132134static const bool defaultMediaPlaybackAllowsInline = true;
    133135static const bool defaultMediaPlaybackRequiresUserGesture = false;
  • trunk/Source/WebCore/page/Settings.in

    r162507 r163157  
    9696xssAuditorEnabled initial=false
    9797unsafePluginPastingEnabled initial=true
    98 acceleratedCompositingForFixedPositionEnabled initial=false
     98acceleratedCompositingForFixedPositionEnabled initial=defaultAcceleratedCompositingForFixedPositionEnabled
    9999acceleratedCompositingForOverflowScrollEnabled initial=false
    100100
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r163079 r163157  
    24962496bool RenderLayerCompositor::requiresCompositingForPosition(RenderLayerModelObject& renderer, const RenderLayer& layer, RenderLayer::ViewportConstrainedNotCompositedReason* viewportConstrainedNotCompositedReason) const
    24972497{
    2498 #if PLATFORM(IOS)
    2499     if (renderer.isStickyPositioned())
    2500         return true;
    2501 
    2502     // position:fixed elements that create their own stacking context (e.g. have an explicit z-index,
    2503     // opacity, transform) can get their own composited layer. A stacking context is required otherwise
    2504     // z-index and clipping will be broken.
    2505     if (!(renderer.isOutOfFlowPositioned() && renderer.style().position() == FixedPosition))
    2506         return false;
    2507 
    2508     if (!m_renderView.hasCustomFixedPosition(renderer, RenderView::CheckContainingBlock)) {
    2509         m_reevaluateCompositingAfterLayout = true;
    2510         return false;
    2511     }
    2512 #else
    25132498    // position:fixed elements that create their own stacking context (e.g. have an explicit z-index,
    25142499    // opacity, transform) can get their own composited layer. A stacking context is required otherwise
     
    25332518    if (isSticky)
    25342519        return hasCoordinatedScrolling() && isViewportConstrainedFixedOrStickyLayer(layer);
    2535 #endif
    25362520
    25372521    auto container = renderer.container();
     
    25642548
    25652549    // Fixed position elements that are invisible in the current view don't get their own layer.
    2566     LayoutRect viewBounds = m_renderView.frameView().viewportConstrainedVisibleContentRect();
     2550    LayoutRect viewBounds = m_renderView.frameView().viewportConstrainedExtentRect();
    25672551    LayoutRect layerBounds = layer.calculateLayerBounds(&layer, 0, RenderLayer::UseLocalClipRectIfPossible | RenderLayer::IncludeLayerFilterOutsets | RenderLayer::UseFragmentBoxes
    25682552        | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask | RenderLayer::IncludeCompositedDescendants);
Note: See TracChangeset for help on using the changeset viewer.