Changeset 139146 in webkit


Ignore:
Timestamp:
Jan 8, 2013 6:57:50 PM (11 years ago)
Author:
Alexandru Chiculita
Message:

Assert in RenderGeometryMap::mapToContainer
https://bugs.webkit.org/show_bug.cgi?id=106068

Reviewed by Simon Fraser.

Source/WebCore:

The assert was due to a pending layout, so the values used to compute the layer bounding boxes were incorrect.
That was because of the Document::setVisualUpdatesAllowed mechanism, which triggers a compositor update
and a repaint, but before this patch didn't check whether a layout was pending or not.

Added a check in Document::setVisualUpdatesAllowed for pending layouts and bailed when such case happened.
A layout will come anyway and trigger the correct updates. Couldn't not force an inline layout at that time
as this function is sometimes called really soon, when the WebKit parts are not fully created yet and updates were
calling back into some client callbacks that were not ready.

Also added an assert in RenderLayerCompositor::updateCompositingLayers to check for other cases that might
try to update the layers with a layout pending. That one led to finding an issue in the RenderMarquee, which
was updating on a timer callback. It might happen that a layout is pending while this timer fires and it
tries to update the scroll position of the layers while a layout is still due.

There was already a protection to bail if a layout is pending in RenderMarquee::timerFired, so I've just broadened the scope
to the whole RenderView to catch all the layout requests.

Tests: compositing/geometry/assert-layout-not-done.html

compositing/geometry/assert-marquee-timer.html

  • dom/Document.cpp:

(WebCore::Document::setVisualUpdatesAllowed):

  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::updateCompositingLayers):

  • rendering/RenderMarquee.cpp:

(WebCore::RenderMarquee::timerFired):

LayoutTests:

  • compositing/geometry/assert-layout-not-done-expected.txt: Added.
  • compositing/geometry/assert-layout-not-done.html: Added. Testing for the case when compositor is triggered before the first layout.
  • compositing/geometry/assert-marquee-timer-expected.txt: Added.
  • compositing/geometry/assert-marquee-timer.html: Added. Tested for the case when the marquee might trigger compositor updates, while a layout is still pending.
Location:
trunk
Files:
4 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r139142 r139146  
     12013-01-08  Alexandru Chiculita  <achicu@adobe.com>
     2
     3        Assert in RenderGeometryMap::mapToContainer
     4        https://bugs.webkit.org/show_bug.cgi?id=106068
     5
     6        Reviewed by Simon Fraser.
     7
     8        * compositing/geometry/assert-layout-not-done-expected.txt: Added.
     9        * compositing/geometry/assert-layout-not-done.html: Added. Testing for the case when compositor is triggered before the first layout.
     10        * compositing/geometry/assert-marquee-timer-expected.txt: Added.
     11        * compositing/geometry/assert-marquee-timer.html: Added. Tested for the case when the marquee might trigger compositor updates, while a layout is still pending.
     12
    1132013-01-08  Brandon Jones  <bajones@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r139144 r139146  
     12013-01-08  Alexandru Chiculita  <achicu@adobe.com>
     2
     3        Assert in RenderGeometryMap::mapToContainer
     4        https://bugs.webkit.org/show_bug.cgi?id=106068
     5
     6        Reviewed by Simon Fraser.
     7
     8        The assert was due to a pending layout, so the values used to compute the layer bounding boxes were incorrect.
     9        That was because of the Document::setVisualUpdatesAllowed mechanism, which triggers a compositor update
     10        and a repaint, but before this patch didn't check whether a layout was pending or not.
     11
     12        Added a check in Document::setVisualUpdatesAllowed for pending layouts and bailed when such case happened.
     13        A layout will come anyway and trigger the correct updates. Couldn't not force an inline layout at that time
     14        as this function is sometimes called really soon, when the WebKit parts are not fully created yet and updates were
     15        calling back into some client callbacks that were not ready.
     16
     17        Also added an assert in RenderLayerCompositor::updateCompositingLayers to check for other cases that might
     18        try to update the layers with a layout pending. That one led to finding an issue in the RenderMarquee, which
     19        was updating on a timer callback. It might happen that a layout is pending while this timer fires and it
     20        tries to update the scroll position of the layers while a layout is still due.
     21
     22        There was already a protection to bail if a layout is pending in RenderMarquee::timerFired, so I've just broadened the scope
     23        to the whole RenderView to catch all the layout requests.
     24
     25        Tests: compositing/geometry/assert-layout-not-done.html
     26               compositing/geometry/assert-marquee-timer.html
     27
     28        * dom/Document.cpp:
     29        (WebCore::Document::setVisualUpdatesAllowed):
     30        * rendering/RenderLayerCompositor.cpp:
     31        (WebCore::RenderLayerCompositor::updateCompositingLayers):
     32        * rendering/RenderMarquee.cpp:
     33        (WebCore::RenderMarquee::timerFired):
     34
    1352013-01-08  Justin Novosad  <junov@google.com>
    236
  • trunk/Source/WebCore/dom/Document.cpp

    r139132 r139146  
    12611261        return;
    12621262
     1263    FrameView* frameView = view();
     1264    bool needsLayout = frameView && renderer() && (frameView->layoutPending() || renderer()->needsLayout());
     1265    if (needsLayout) {
     1266        // There might be a layout pending, so make sure we don't update the screen with bogus data.
     1267        // The layout will actually update the compositing layers and repaint if needed.
     1268        return;
     1269    }
     1270
    12631271#if USE(ACCELERATED_COMPOSITING)
    12641272    if (view())
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r139053 r139146  
    409409        return;
    410410
     411    ASSERT(!m_renderView->needsLayout());
     412
    411413    AnimationUpdateBlock animationUpdateBlock(m_renderView->frameView()->frame()->animation());
    412414
  • trunk/Source/WebCore/rendering/RenderMarquee.cpp

    r133779 r139146  
    5151#include "HTMLNames.h"
    5252#include "RenderLayer.h"
     53#include "RenderView.h"
    5354
    5455using namespace std;
     
    255256void RenderMarquee::timerFired(Timer<RenderMarquee>*)
    256257{
    257     if (m_layer->renderer()->needsLayout())
     258    if (m_layer->renderer()->view()->needsLayout())
    258259        return;
    259260   
Note: See TracChangeset for help on using the changeset viewer.