Changeset 186911 in webkit


Ignore:
Timestamp:
Jul 16, 2015 2:54:06 PM (9 years ago)
Author:
Simon Fraser
Message:

Fix disappearing position:fixed elements in fixed layout mode
https://bugs.webkit.org/show_bug.cgi?id=147019

Reviewed by Tim Horton.
Source/WebCore:

Test: compositing/fixed-with-fixed-layout.html

When in fixed layout mode, and being scaled down, viewportConstrainedVisibleContentRect() is
the wrong thing to use to determine if position:fixed elements are clipped out. In this case,
use the simpler document bounds (before scaling).

In the long term, there needs to be an equivalent of viewportConstrainedVisibleContentRect()
that gives an appropriate rect that can be used here.

  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::requiresCompositingForPosition):

LayoutTests:

Test with four fixed elements in fixed layout mode.

  • compositing/fixed-with-fixed-layout-expected.txt: Added.
  • compositing/fixed-with-fixed-layout.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r186906 r186911  
     12015-07-16  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Fix disappearing position:fixed elements in fixed layout mode
     4        https://bugs.webkit.org/show_bug.cgi?id=147019
     5
     6        Reviewed by Tim Horton.
     7       
     8        Test with four fixed elements in fixed layout mode.
     9
     10        * compositing/fixed-with-fixed-layout-expected.txt: Added.
     11        * compositing/fixed-with-fixed-layout.html: Added.
     12
    1132015-07-16  Filip Pizlo  <fpizlo@apple.com>
    214
  • trunk/Source/WebCore/ChangeLog

    r186910 r186911  
     12015-07-16  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Fix disappearing position:fixed elements in fixed layout mode
     4        https://bugs.webkit.org/show_bug.cgi?id=147019
     5
     6        Reviewed by Tim Horton.
     7
     8        Test: compositing/fixed-with-fixed-layout.html
     9       
     10        When in fixed layout mode, and being scaled down, viewportConstrainedVisibleContentRect() is
     11        the wrong thing to use to determine if position:fixed elements are clipped out. In this case,
     12        use the simpler document bounds (before scaling).
     13       
     14        In the long term,  there needs to be an equivalent of viewportConstrainedVisibleContentRect()
     15        that gives an appropriate rect that can be used here.
     16
     17        * rendering/RenderLayerCompositor.cpp:
     18        (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
     19
    1202015-07-16  Benjamin Poulain  <bpoulain@apple.com>
    221
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r186155 r186911  
    27402740
    27412741    // Fixed position elements that are invisible in the current view don't get their own layer.
    2742     LayoutRect viewBounds = m_renderView.frameView().viewportConstrainedVisibleContentRect();
     2742    // FIXME: We shouldn't have to check useFixedLayout() here; one of the viewport rects needs to give the correct answer.
     2743    LayoutRect viewBounds;
     2744    if (m_renderView.frameView().useFixedLayout())
     2745        viewBounds = m_renderView.unscaledDocumentRect();
     2746    else
     2747        viewBounds = m_renderView.frameView().viewportConstrainedVisibleContentRect();
    27432748    LayoutRect layerBounds = layer.calculateLayerBounds(&layer, LayoutSize(), RenderLayer::UseLocalClipRectIfPossible | RenderLayer::IncludeLayerFilterOutsets | RenderLayer::UseFragmentBoxesExcludingCompositing
    27442749        | RenderLayer::ExcludeHiddenDescendants | RenderLayer::DontConstrainForMask | RenderLayer::IncludeCompositedDescendants);
Note: See TracChangeset for help on using the changeset viewer.