Changeset 172534 in webkit


Ignore:
Timestamp:
Aug 13, 2014 1:21:31 PM (10 years ago)
Author:
Simon Fraser
Message:

[WK1] A fixed-position <img> may not show on page load
https://bugs.webkit.org/show_bug.cgi?id=135893

Reviewed by Tim Horton.

Source/WebCore:

A position:fixed image could fail to display because we didn't make a
compositing layer for it under some circumstances. This can happen if
RenderLayerCompositor::requiresCompositingForPosition() runs before the
image is loaded, in which cause the layer is zero-sized, so does not get
composited.

When the image loads, there was no code path that ensured that compositing
would be re-evaluated (unlike size changes due to style updates). Fix by
having RenderLayer::contentChanged() also check for ImageChanged.

Test: compositing/fixed-image-loading.html

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::contentChanged):

LayoutTests:

Test with a position:fixed image. Note that the test has to force layout
early on to test the bug.

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

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r172524 r172534  
     12014-08-13  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [WK1] A fixed-position <img> may not show on page load
     4        https://bugs.webkit.org/show_bug.cgi?id=135893
     5
     6        Reviewed by Tim Horton.
     7       
     8        Test with a position:fixed image. Note that the test has to force layout
     9        early on to test the bug.
     10
     11        * compositing/fixed-image-loading-expected.txt: Added.
     12        * compositing/fixed-image-loading.html: Added.
     13
    1142014-08-13  Zoltan Horvath  <zoltan@webkit.org>
    215
  • trunk/Source/WebCore/ChangeLog

    r172529 r172534  
     12014-08-13  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [WK1] A fixed-position <img> may not show on page load
     4        https://bugs.webkit.org/show_bug.cgi?id=135893
     5
     6        Reviewed by Tim Horton.
     7       
     8        A position:fixed image could fail to display because we didn't make a
     9        compositing layer for it under some circumstances. This can happen if
     10        RenderLayerCompositor::requiresCompositingForPosition() runs before the
     11        image is loaded, in which cause the layer is zero-sized, so does not get
     12        composited.
     13       
     14        When the image loads, there was no code path that ensured that compositing
     15        would be re-evaluated (unlike size changes due to style updates). Fix by
     16        having RenderLayer::contentChanged() also check for ImageChanged.
     17
     18        Test: compositing/fixed-image-loading.html
     19
     20        * rendering/RenderLayer.cpp:
     21        (WebCore::RenderLayer::contentChanged):
     22
    1232014-08-13  Bem Jones-Bey  <bjonesbe@adobe.com>
    224
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r172182 r172534  
    299299void RenderLayer::contentChanged(ContentChangeType changeType)
    300300{
    301     // This can get called when video becomes accelerated, so the layers may change.
    302     if ((changeType == CanvasChanged || changeType == VideoChanged || changeType == FullScreenChanged) && compositor().updateLayerCompositingState(*this))
     301    if ((changeType == CanvasChanged || changeType == VideoChanged || changeType == FullScreenChanged || changeType == ImageChanged) && compositor().updateLayerCompositingState(*this))
    303302        compositor().setCompositingLayersNeedRebuild();
    304303
Note: See TracChangeset for help on using the changeset viewer.