Changeset 179871 in webkit


Ignore:
Timestamp:
Feb 10, 2015 9:05:05 AM (9 years ago)
Author:
Anton Obzhirov
Message:

Render: properly update body's background image
https://bugs.webkit.org/show_bug.cgi?id=140183

When HTML and BODY renderers are both composited the
skipBodyBackground condition should also take into account
if the HTML's layer can draw its contents.

Patch by Julien Isorce <j.isorce@samsung.com> on 2015-02-10
Reviewed by Darin Adler.

Source/WebCore:

Test: animations/animation-background-image.html

  • rendering/RenderBox.cpp:

(WebCore::skipBodyBackground): Do not skip
if document's layer cannot draw its content.
Previously both body and html did not paint the background
when they are both composited.

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::contentChanged): Also redisplay
the content.

LayoutTests:

  • compositing/backgrounds/background-image-with-negative-zindex-expected.html: Added.
  • compositing/backgrounds/background-image-with-negative-zindex.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r179869 r179871  
     12015-02-10  Julien Isorce  <j.isorce@samsung.com>
     2
     3        Render: properly update body's background image
     4        https://bugs.webkit.org/show_bug.cgi?id=140183
     5
     6        When HTML and BODY renderers are both composited the
     7        skipBodyBackground condition should also take into account
     8        if the HTML's layer can draw its contents.
     9
     10        Reviewed by Darin Adler.
     11
     12        * compositing/backgrounds/background-image-with-negative-zindex-expected.html: Added.
     13        * compositing/backgrounds/background-image-with-negative-zindex.html: Added.
     14
    1152015-02-10  Eric Carlson  <eric.carlson@apple.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r179869 r179871  
     12015-02-10  Julien Isorce  <j.isorce@samsung.com>
     2
     3        Render: properly update body's background image
     4        https://bugs.webkit.org/show_bug.cgi?id=140183
     5
     6        When HTML and BODY renderers are both composited the
     7        skipBodyBackground condition should also take into account
     8        if the HTML's layer can draw its contents.
     9
     10        Reviewed by Darin Adler.
     11
     12        Test: animations/animation-background-image.html
     13
     14        * rendering/RenderBox.cpp:
     15        (WebCore::skipBodyBackground): Do not skip
     16        if document's layer cannot draw its content.
     17        Previously both body and html did not paint the background
     18        when they are both composited.
     19
     20        * rendering/RenderLayerBacking.cpp:
     21        (WebCore::RenderLayerBacking::contentChanged): Also redisplay
     22        the content.
     23
    1242015-02-10  Eric Carlson  <eric.carlson@apple.com>
    225
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r179172 r179871  
    5353#include "RenderIterator.h"
    5454#include "RenderLayer.h"
     55#include "RenderLayerBacking.h"
    5556#include "RenderLayerCompositor.h"
    5657#include "RenderNamedFlowFragment.h"
     
    108109    // or if the <body>'s parent is not the document element's renderer (e.g. inside SVG foreignObject).
    109110    auto documentElementRenderer = bodyElementRenderer->document().documentElement()->renderer();
    110     return documentElementRenderer
    111         && !documentElementRenderer->hasBackground()
    112         && (documentElementRenderer == bodyElementRenderer->parent());
     111
     112    if (!documentElementRenderer)
     113        return false;
     114
     115    if (documentElementRenderer->hasBackground())
     116        return false;
     117
     118    if (documentElementRenderer != bodyElementRenderer->parent())
     119        return false;
     120
     121    if (bodyElementRenderer->isComposited() && documentElementRenderer->isComposited())
     122        return downcast<RenderLayerModelObject>(documentElementRenderer)->layer()->backing()->graphicsLayer()->drawsContent();
     123
     124    return true;
    113125}
    114126
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r179604 r179871  
    19181918
    19191919    if ((changeType == BackgroundImageChanged) && canCreateTiledImage(renderer().style()))
    1920         updateGeometry();
     1920        updateAfterLayout(NeedsFullRepaint | IsUpdateRoot);
    19211921
    19221922    if ((changeType == MaskImageChanged) && m_maskLayer) {
Note: See TracChangeset for help on using the changeset viewer.