⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 98776 in webkit


Ignore:
Timestamp:
Oct 28, 2011, 4:18:08 PM (15 years ago)
Author:
Simon Fraser
Message:

If visibility changes while an accelerated animation is running, element jumps around
https://bugs.webkit.org/show_bug.cgi?id=29984

Source/WebCore:

Reviewed by Chris Marrin.

Compositing now affects whether RenderLayers for visibility:hidden elements
are included in z-order lists. So we have to dirty those lists when we enter
compopsiting mode.

Test: compositing/visibility/animation-visibility.html

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::updateVisibilityStatus): Removed trailing whitespace.
(WebCore::RenderLayer::dirtyZOrderLists): Call dirtyZOrderListsInternal(), which doesn't have
to ping the compositor.
(WebCore::RenderLayer::dirtyZOrderListsInternal):
(WebCore::RenderLayer::dirtyZOrderListsIncludingDescendants): Recursively dirty z-order
lists.

  • rendering/RenderLayer.h:
  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::enableCompositingMode): When going into compositing mode,
dirty all z-order lists.

LayoutTests:

Reviewed by Chris Marrin.

Add testcase for visibility changing in the middle of an accelerated animation.

  • animations/resources/animation-test-helpers.js: Add some constants for readability.

(checkExpectedValue): Add support for testing 'visibility'.

  • compositing/visibility/animation-visibility-expected.png: Added.
  • compositing/visibility/animation-visibility-expected.txt: Added.
  • compositing/visibility/animation-visibility.html: Added.
Location:
trunk
Files:
3 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r98775 r98776  
     12011-10-28  Simon Fraser  <simon.fraser@apple.com>
     2
     3        If visibility changes while an accelerated animation is running, element jumps around
     4        https://bugs.webkit.org/show_bug.cgi?id=29984
     5
     6        Reviewed by Chris Marrin.
     7       
     8        Add testcase for visibility changing in the middle of an accelerated animation.
     9
     10        * animations/resources/animation-test-helpers.js: Add some constants for readability.
     11        (checkExpectedValue): Add support for testing 'visibility'.
     12        * compositing/visibility/animation-visibility-expected.png: Added.
     13        * compositing/visibility/animation-visibility-expected.txt: Added.
     14        * compositing/visibility/animation-visibility.html: Added.
     15
    1162011-10-28  Tim Horton  <timothy_horton@apple.com>
    217
  • trunk/LayoutTests/animations/resources/animation-test-helpers.js

    r84872 r98776  
    3333
    3434*/
     35
     36const doPixelTest = true;
     37const dontDoPixelTest = false;
    3538
    3639function isCloseEnough(actual, desired, tolerance)
     
    141144        else
    142145            pass = isCloseEnough(computedValue, expectedValue, tolerance);
     146    } else if (property == "visibility") {
     147        var element;
     148        if (iframeId)
     149            element = document.getElementById(iframeId).contentDocument.getElementById(elementId);
     150        else
     151            element = document.getElementById(elementId);
     152
     153        computedValue = window.getComputedStyle(element).visibility;
     154        if (compareElements) {
     155            computedValue2 = window.getComputedStyle(document.getElementById(elementId2)).visibility;
     156            pass = computedValue == computedValue2;
     157        }
     158        else
     159            pass = computedValue == expectedValue;
    143160    } else {
    144161        var element;
  • trunk/Source/WebCore/ChangeLog

    r98775 r98776  
     12011-10-28  Simon Fraser  <simon.fraser@apple.com>
     2
     3        If visibility changes while an accelerated animation is running, element jumps around
     4        https://bugs.webkit.org/show_bug.cgi?id=29984
     5
     6        Reviewed by Chris Marrin.
     7       
     8        Compositing now affects whether RenderLayers for visibility:hidden elements
     9        are included in z-order lists. So we have to dirty those lists when we enter
     10        compopsiting mode.
     11
     12        Test: compositing/visibility/animation-visibility.html
     13
     14        * rendering/RenderLayer.cpp:
     15        (WebCore::RenderLayer::updateVisibilityStatus): Removed trailing whitespace.
     16        (WebCore::RenderLayer::dirtyZOrderLists): Call dirtyZOrderListsInternal(), which doesn't have
     17        to ping the compositor.
     18        (WebCore::RenderLayer::dirtyZOrderListsInternal):
     19        (WebCore::RenderLayer::dirtyZOrderListsIncludingDescendants): Recursively dirty z-order
     20        lists.
     21        * rendering/RenderLayer.h:
     22        * rendering/RenderLayerCompositor.cpp:
     23        (WebCore::RenderLayerCompositor::enableCompositingMode): When going into compositing mode,
     24        dirty all z-order lists.
     25
    1262011-10-28  Tim Horton  <timothy_horton@apple.com>
    227
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r98752 r98776  
    618618        m_hasVisibleDescendant = false;
    619619        for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) {
    620             child->updateVisibilityStatus();       
     620            child->updateVisibilityStatus();
    621621            if (child->m_hasVisibleContent || child->m_hasVisibleDescendant) {
    622622                m_hasVisibleDescendant = true;
     
    39713971void RenderLayer::dirtyZOrderLists()
    39723972{
     3973    dirtyZOrderListsInternal();
     3974   
     3975#if USE(ACCELERATED_COMPOSITING)
     3976    if (!renderer()->documentBeingDestroyed())
     3977        compositor()->setCompositingLayersNeedRebuild();
     3978#endif
     3979}
     3980
     3981void RenderLayer::dirtyZOrderListsInternal()
     3982{
    39733983    if (m_posZOrderList)
    39743984        m_posZOrderList->clear();
     
    39763986        m_negZOrderList->clear();
    39773987    m_zOrderListsDirty = true;
    3978 
    3979 #if USE(ACCELERATED_COMPOSITING)
    3980     if (!renderer()->documentBeingDestroyed())
    3981         compositor()->setCompositingLayersNeedRebuild();
    3982 #endif
     3988}
     3989
     3990void RenderLayer::dirtyZOrderListsIncludingDescendants()
     3991{
     3992    dirtyZOrderListsInternal();
     3993
     3994    for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
     3995        child->dirtyZOrderListsIncludingDescendants();
    39833996}
    39843997
  • trunk/Source/WebCore/rendering/RenderLayer.h

    r98735 r98776  
    377377
    378378    void dirtyZOrderLists();
     379    void dirtyZOrderListsIncludingDescendants();
    379380    void dirtyStackingContextZOrderLists();
    380381    void updateZOrderLists();
     
    541542    void setFirstChild(RenderLayer* first) { m_first = first; }
    542543    void setLastChild(RenderLayer* last) { m_last = last; }
     544   
     545    void dirtyZOrderListsInternal();
    543546
    544547    LayoutPoint renderBoxLocation() const { return renderer()->isBox() ? toRenderBox(renderer())->location() : LayoutPoint(); }
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r98627 r98776  
    125125        if (m_compositing) {
    126126            ensureRootLayer();
     127            // Compositing affects whether visibility:hidden layers are included in z-order lists, so we have to dirty the lists here.
     128            rootRenderLayer()->dirtyZOrderListsIncludingDescendants();
    127129            notifyIFramesOfCompositingChange();
    128130        } else
     
    11241126    }
    11251127}
    1126 
    11271128
    11281129void RenderLayerCompositor::repaintCompositedLayersAbsoluteRect(const LayoutRect& absRect)
Note: See TracChangeset for help on using the changeset viewer.