Changeset 149949 in webkit


Ignore:
Timestamp:
May 11, 2013 9:54:04 PM (11 years ago)
Author:
Simon Fraser
Message:

REGRESSION: Fixed background on ColterReed.com scrolls
https://bugs.webkit.org/show_bug.cgi?id=115951

Source/WebCore:

Reviewed by Beth Dakin.

The logic for painting the fixed root background into its own layer was
broken when the document element's layer was composited. This could be caused
by a negative z-index child of the body, or by an explicit compositing-causing
style on the <html>.

There were two issues. First, when painting the layer for the fixed root
background, we would simply short-circuit the fixed background paint in
RenderLayer::paintLayer(), when checking for a composited layer. We have
to continue to paint through the composited <html> layer to get the root
background in this case.

Secondly, RenderLayerBacking::paintIntoLayer() would only set the PaintLayerPaintingSkipRootBackground
flag if this RenderLayerBacking had a m_backgroundLayer. However, when the <html> is
composited, we need to skip painting the root layer for both the RenderView's backing,
and for the <html>'s backing. Checking whether there is *any* layer that paints
the fixed root background (i.e. checking compositor()->fixedRootBackgroundLayer())
is a simple way to fix this test.

Tests: platform/mac-wk2/tiled-drawing/fixed-background/fixed-background-composited-html.html

platform/mac-wk2/tiled-drawing/fixed-background/fixed-background-negative-z-index-fixed.html

  • rendering/RenderLayer.cpp:

(WebCore::paintForFixedRootBackground):
(WebCore::RenderLayer::paintLayer):

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::paintIntoLayer):

LayoutTests:

Reviewed by Beth Dakin.

Tests with a fixed background and two different ways of making the <html> composited.

  • platform/mac-wk2/tiled-drawing/fixed-background/fixed-background-composited-html-expected.html: Added.
  • platform/mac-wk2/tiled-drawing/fixed-background/fixed-background-composited-html.html: Added.
  • platform/mac-wk2/tiled-drawing/fixed-background/fixed-background-negative-z-index-fixed-expected.html: Added.
  • platform/mac-wk2/tiled-drawing/fixed-background/fixed-background-negative-z-index-fixed.html: Added.
Location:
trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r149939 r149949  
     12013-05-10  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION: Fixed background on ColterReed.com scrolls
     4        https://bugs.webkit.org/show_bug.cgi?id=115951
     5
     6        Reviewed by Beth Dakin.
     7       
     8        Tests with a fixed background and two different ways of making the <html> composited.
     9
     10        * platform/mac-wk2/tiled-drawing/fixed-background/fixed-background-composited-html-expected.html: Added.
     11        * platform/mac-wk2/tiled-drawing/fixed-background/fixed-background-composited-html.html: Added.
     12        * platform/mac-wk2/tiled-drawing/fixed-background/fixed-background-negative-z-index-fixed-expected.html: Added.
     13        * platform/mac-wk2/tiled-drawing/fixed-background/fixed-background-negative-z-index-fixed.html: Added.
     14
    1152013-05-11  Xan Lopez  <xlopez@igalia.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r149948 r149949  
     12013-05-10  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION: Fixed background on ColterReed.com scrolls
     4        https://bugs.webkit.org/show_bug.cgi?id=115951
     5
     6        Reviewed by Beth Dakin.
     7       
     8        The logic for painting the fixed root background into its own layer was
     9        broken when the document element's layer was composited. This could be caused
     10        by a negative z-index child of the body, or by an explicit compositing-causing
     11        style on the <html>.
     12       
     13        There were two issues. First, when painting the layer for the fixed root
     14        background, we would simply short-circuit the fixed background paint in
     15        RenderLayer::paintLayer(), when checking for a composited layer. We have
     16        to continue to paint through the composited <html> layer to get the root
     17        background in this case.
     18       
     19        Secondly, RenderLayerBacking::paintIntoLayer() would only set the PaintLayerPaintingSkipRootBackground
     20        flag if this RenderLayerBacking had a m_backgroundLayer. However, when the <html> is
     21        composited, we need to skip painting the root layer for both the RenderView's backing,
     22        and for the <html>'s backing. Checking whether there is *any* layer that paints
     23        the fixed root background (i.e. checking compositor()->fixedRootBackgroundLayer())
     24        is a simple way to fix this test.
     25
     26        Tests: platform/mac-wk2/tiled-drawing/fixed-background/fixed-background-composited-html.html
     27               platform/mac-wk2/tiled-drawing/fixed-background/fixed-background-negative-z-index-fixed.html
     28
     29        * rendering/RenderLayer.cpp:
     30        (WebCore::paintForFixedRootBackground):
     31        (WebCore::RenderLayer::paintLayer):
     32        * rendering/RenderLayerBacking.cpp:
     33        (WebCore::RenderLayerBacking::paintIntoLayer):
     34
    1352013-05-11  Simon Fraser  <simon.fraser@apple.com>
    236
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r149915 r149949  
    35863586}
    35873587
     3588static bool paintForFixedRootBackground(const RenderLayer* layer, RenderLayer::PaintLayerFlags paintFlags)
     3589{
     3590    return layer->renderer()->isRoot() && (paintFlags & RenderLayer::PaintLayerPaintingRootBackgroundOnly);
     3591}
     3592
    35883593void RenderLayer::paintLayer(GraphicsContext* context, const LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags)
    35893594{
     
    35963601        else if (!backing()->paintsIntoWindow()
    35973602            && !backing()->paintsIntoCompositedAncestor()
    3598             && !shouldDoSoftwarePaint(this, paintFlags & PaintLayerPaintingReflection)) {
     3603            && !shouldDoSoftwarePaint(this, paintFlags & PaintLayerPaintingReflection)
     3604            && !paintForFixedRootBackground(this, paintFlags)) {
    35993605            // If this RenderLayer should paint into its backing, that will be done via RenderLayerBacking::paintIntoLayer().
    36003606            return;
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r149694 r149949  
    19601960    if (graphicsLayer == m_backgroundLayer)
    19611961        paintFlags |= (RenderLayer::PaintLayerPaintingRootBackgroundOnly | RenderLayer::PaintLayerPaintingCompositingForegroundPhase); // Need PaintLayerPaintingCompositingForegroundPhase to walk child layers.
    1962     else if (m_backgroundLayer)
     1962    else if (compositor()->fixedRootBackgroundLayer())
    19631963        paintFlags |= RenderLayer::PaintLayerPaintingSkipRootBackground;
    19641964   
Note: See TracChangeset for help on using the changeset viewer.