haikuwebkit/LayoutTests/transitions/repeated-firing-background-...

50 lines
1.2 KiB
HTML
Raw Permalink Normal View History

<html>
<head>
<style>
div {
-webkit-transition: background-color .15s linear;
}
div.trans {
background-color: hsla(0, 50%, 50%, 1);
}
</style>
<script>
function checkRunning()
{
if (!window.testRunner) {
2010-09-23 Simon Fraser <simon.fraser@apple.com> Reviewed by Dan Bernstein. Accelerated transitions do not suspend/resume properly. https://bugs.webkit.org/show_bug.cgi?id=43792 Fix suspending of accelerated transitions. GraphicsLayer changes unify the handling of transitions and animations in GraphicsLayer. Both are now identified by name, so the code now refers to "animationName" rather than "keyframesName". Transitions use a dummy name which is not a valid keyframe identifier. Tests: animations/suspend-transform-animation.html transitions/suspend-transform-transition.html * page/animation/ImplicitAnimation.h: * page/animation/ImplicitAnimation.cpp: (WebCore::ImplicitAnimation::pauseAnimation): Call down to the RenderLayerBacking to tell it that an accelerated transition was paused. * platform/graphics/GraphicsLayer.h: * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::animationNameForTransition): Create a name for the transition of the given property. (WebCore::GraphicsLayer::addAnimation): Generalize "keyframe" to "animation" in the parameter names. (WebCore::GraphicsLayer::pauseAnimation): ditto (WebCore::GraphicsLayer::removeAnimation): ditto * platform/graphics/mac/GraphicsLayerCA.h: Parameter renaming, and some method renames for clarity. (WebCore::GraphicsLayerCA::animationIsRunning): (WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation): struct rename for clarity. * platform/graphics/mac/GraphicsLayerCA.mm: (WebCore::animationIdentifier): the animationName already has the property baked in. (WebCore::GraphicsLayerCA::moveOrCopyLayerAnimation): just deals with one animation now. (WebCore::GraphicsLayerCA::moveOrCopyAnimationsForProperty): we have to trawl through m_runningAnimations to get the identifiers for the animations that need to be copied. (WebCore::GraphicsLayerCA::addAnimation): rename parameters. (WebCore::GraphicsLayerCA::pauseAnimation): re-ordered methods here. member var renames. (WebCore::GraphicsLayerCA::removeAnimation): ditto. (WebCore::GraphicsLayerCA::updateLayerAnimations): no need to iterate over m_transitionPropertiesToRemove, and no more divergence between transitions and animations. (WebCore::GraphicsLayerCA::setCAAnimationOnLayer): renames for clarity. (WebCore::GraphicsLayerCA::removeCAAnimationFromLayer): ditto (WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer): ditto (WebCore::GraphicsLayerCA::createAnimationFromKeyframes): renames (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): renames (WebCore::GraphicsLayerCA::suspendAnimations): whitespace. * rendering/RenderLayerBacking.h: Group the transition and animation methods together. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::animationPaused): Re-ordered methods for clarity. (WebCore::RenderLayerBacking::animationFinished): ditto (WebCore::RenderLayerBacking::startTransition): Use animationNameForTransition() to generate the animation identifier. (WebCore::RenderLayerBacking::transitionPaused): Call pauseAnimation, using animationNameForTransition() to generate the animation identifier. (WebCore::RenderLayerBacking::transitionFinished): Call removeAnimation, using animationNameForTransition() to generate the animation identifier. (WebCore::RenderLayerBacking::notifyAnimationStarted): Moved. (WebCore::RenderLayerBacking::notifySyncRequired): Moved. Canonical link: https://commits.webkit.org/58932@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@68233 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-09-24 04:17:03 +00:00
document.getElementById('result').innerHTML = "This test must be run in DRT."
return;
}
Kill suspendAnimation(), resumeAnimation() and numberOfActiveAnimations() from DRT/WTR; use Internals https://bugs.webkit.org/show_bug.cgi?id=108741 Patch by Benjamin Poulain <bpoulain@apple.com> on 2013-02-04 Reviewed by Tony Chang. .: * Source/autotools/symbols.filter: Source/WebCore: Move suspendAnimations and resumeAnimations to group all the animation related code together. Add support for numberOfActiveAnimations, similarily to the feature previously defined in TestRunner. * testing/Internals.cpp: (WebCore::Internals::numberOfActiveAnimations): (WebCore): (WebCore::Internals::suspendAnimations): (WebCore::Internals::resumeAnimations): * testing/Internals.h: (Internals): * testing/Internals.idl: Source/WebKit/efl: * WebCoreSupport/DumpRenderTreeSupportEfl.cpp: * WebCoreSupport/DumpRenderTreeSupportEfl.h: Source/WebKit/gtk: * WebCoreSupport/DumpRenderTreeSupportGtk.cpp: * WebCoreSupport/DumpRenderTreeSupportGtk.h: (DumpRenderTreeSupportGtk): Source/WebKit/mac: * WebView/WebFrame.mm: * WebView/WebFramePrivate.h: Source/WebKit/qt: * WebCoreSupport/DumpRenderTreeSupportQt.cpp: * WebCoreSupport/DumpRenderTreeSupportQt.h: Source/WebKit/win: * WebKit.vcproj/WebKitExports.def.in: Source/WebKit2: Suspending and resuming application has been useless for a one. Someone just "forgot" WebKit2. * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp: * WebProcess/InjectedBundle/API/c/WKBundleFramePrivate.h: * WebProcess/WebPage/WebFrame.cpp: * WebProcess/WebPage/WebFrame.h: (WebFrame): Tools: Remove all support for suspendAnimation(), resumeAnimation() and numberOfActiveAnimations(). * DumpRenderTree/TestRunner.cpp: (TestRunner::staticFunctions): * DumpRenderTree/TestRunner.h: (TestRunner): * DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp: * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp: (WebTestRunner::TestRunner::TestRunner): * DumpRenderTree/chromium/TestRunner/src/TestRunner.h: (TestRunner): * DumpRenderTree/efl/TestRunnerEfl.cpp: * DumpRenderTree/gtk/TestRunnerGtk.cpp: * DumpRenderTree/mac/TestRunnerMac.mm: * DumpRenderTree/qt/TestRunnerQt.cpp: * DumpRenderTree/qt/TestRunnerQt.h: (TestRunner): * DumpRenderTree/win/TestRunnerWin.cpp: * DumpRenderTree/wx/TestRunnerWx.cpp: * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/TestRunner.cpp: * WebKitTestRunner/InjectedBundle/TestRunner.h: (TestRunner): LayoutTests: Update the tests to use WebCore Internals instead of the TestRunner. * animations/animation-controller-drt-api.html: * transitions/hang-with-bad-transition-list.html: * transitions/remove-transition-style.html: * transitions/repeated-firing-background-color.html: * transitions/zero-duration-with-non-zero-delay-end.html: Canonical link: https://commits.webkit.org/127108@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@141849 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-02-05 04:21:13 +00:00
var current = internals.numberOfActiveAnimations();
if (current == 0)
document.getElementById('result').innerHTML = "Number of active transitions is (0) as expected";
else
document.getElementById('result').innerHTML = "Number of active transitions is (" + current + ") but was expecting (0)";
testRunner.notifyDone();
}
2010-01-11 Ojan Vafai <ojan@chromium.org> Reviewed by Simon Fraser. Deflake transitions and animations tests. https://bugs.webkit.org/show_bug.cgi?id=30029 The transition-end-event tests all had arbitrary timeouts. Give a consistent timeout to all of them. Give a generous 1 second of buffer to avoid any possibility of flakiness. If all the transitionEnd events fire before then, the test still completes without waiting for the timeout. * animations/change-keyframes.html: Increase the wiggle room. It's infrequently flaky now, but it is still a tad bit flaky without this extra wiggle room. * transitions/repeated-firing-background-color.html: Remove a gratuitous setTimeout. * transitions/transition-end-event-all-properties.html: * transitions/transition-end-event-attributes.html: * transitions/transition-end-event-container.html: * transitions/transition-end-event-helpers.js: (runTransitionTest.startTest): (runTransitionTest): * transitions/transition-end-event-left.html: * transitions/transition-end-event-multiple-01.html: * transitions/transition-end-event-multiple-02.html: * transitions/transition-end-event-multiple-03.html: * transitions/transition-end-event-multiple-04.html: * transitions/transition-end-event-nested.html: * transitions/transition-end-event-set-none.html: * transitions/transition-end-event-transform.html: * transitions/transition-end-event-window.html: * transitions/zero-duration-with-non-zero-delay-end.html: Canonical link: https://commits.webkit.org/44505@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@53097 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-01-11 21:54:24 +00:00
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
</script>
</head>
<body>
<div id="foo">This should not be continually firing transitions</span>
<script type="text/javascript" charset="utf-8">
2010-01-11 Ojan Vafai <ojan@chromium.org> Reviewed by Simon Fraser. Deflake transitions and animations tests. https://bugs.webkit.org/show_bug.cgi?id=30029 The transition-end-event tests all had arbitrary timeouts. Give a consistent timeout to all of them. Give a generous 1 second of buffer to avoid any possibility of flakiness. If all the transitionEnd events fire before then, the test still completes without waiting for the timeout. * animations/change-keyframes.html: Increase the wiggle room. It's infrequently flaky now, but it is still a tad bit flaky without this extra wiggle room. * transitions/repeated-firing-background-color.html: Remove a gratuitous setTimeout. * transitions/transition-end-event-all-properties.html: * transitions/transition-end-event-attributes.html: * transitions/transition-end-event-container.html: * transitions/transition-end-event-helpers.js: (runTransitionTest.startTest): (runTransitionTest): * transitions/transition-end-event-left.html: * transitions/transition-end-event-multiple-01.html: * transitions/transition-end-event-multiple-02.html: * transitions/transition-end-event-multiple-03.html: * transitions/transition-end-event-multiple-04.html: * transitions/transition-end-event-nested.html: * transitions/transition-end-event-set-none.html: * transitions/transition-end-event-transform.html: * transitions/transition-end-event-window.html: * transitions/zero-duration-with-non-zero-delay-end.html: Canonical link: https://commits.webkit.org/44505@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@53097 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2010-01-11 21:54:24 +00:00
document.getElementById('foo').addEventListener('webkitTransitionEnd', function() {
checkRunning()
});
Create render tree lazily https://bugs.webkit.org/show_bug.cgi?id=120685 Source/WebCore: Reviewed by Andreas Kling. We currently recompute style and construct renderer for each DOM node immediately after they are added to the tree. This is often inefficient as the style may change immediately afterwards and the work needs to be redone. With this patch we always compute style and construct render tree lazily, either on style recalc timer or synchronously when they are needed. It also removes the 'attached' bit. If document has render tree then all nodes are conceptually "attached" even if this happens lazily. The patch slightly changes behavior of implicit CSS transitions. A synchronous style change during parsing may not trigger the animation anymore as laziness means we don't see anything changing. This matches Firefox and Chrome in our test cases. * WebCore.exp.in: * bindings/js/JSNodeCustom.cpp: (WebCore::JSNode::insertBefore): (WebCore::JSNode::replaceChild): (WebCore::JSNode::appendChild): All attaching is now lazy, remove AttachLazily. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): SVG renderers with !isValid() have empty display property value for some reason. Keep the behavior. * dom/ContainerNode.cpp: (WebCore::ContainerNode::insertBefore): (WebCore::ContainerNode::parserInsertBefore): (WebCore::ContainerNode::replaceChild): (WebCore::ContainerNode::appendChild): (WebCore::ContainerNode::parserAppendChild): (WebCore::ContainerNode::updateTreeAfterInsertion): * dom/ContainerNode.h: * dom/Document.cpp: (WebCore::Document::~Document): (WebCore::Document::updateStyleIfNeeded): (WebCore::Document::createRenderTree): (WebCore::Document::destroyRenderTree): Remove attach bit maintenance. (WebCore::Document::webkitDidExitFullScreenForElement): Do lazy render tree reconstruction after returning from full screen. That is the only reliable way to get the render tree back to decent shape. * dom/Element.cpp: (WebCore::Element::isFocusable): Remove pointless !renderer()->needsLayout() assert. (WebCore::Element::addShadowRoot): (WebCore::Element::childShouldCreateRenderer): (WebCore::Element::resetComputedStyle): Take care to reset computed style in all descendants. attachRenderTree no longer does this. * dom/Element.h: * dom/Node.cpp: (WebCore::Node::insertBefore): (WebCore::Node::replaceChild): (WebCore::Node::appendChild): (WebCore::Node::setNeedsStyleRecalc): Propagate ReconstructRenderTree. (WebCore::Node::attached): Emulate the behavior of old attached bit for now so existing code calling this mostly stays working. * dom/Node.h: Add new ReconstructRenderTree value for StyleChangeType. * dom/Range.cpp: (WebCore::Range::isPointInRange): (WebCore::Range::comparePoint): (WebCore::Range::compareNode): (WebCore::Range::intersectsNode): * editing/AppendNodeCommand.cpp: (WebCore::AppendNodeCommand::doApply): * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::canRebalance): * editing/InsertNodeBeforeCommand.cpp: (WebCore::InsertNodeBeforeCommand::doApply): * html/HTMLDetailsElement.cpp: (WebCore::HTMLDetailsElement::didAddUserAgentShadowRoot): * html/HTMLDocument.cpp: (WebCore::HTMLDocument::activeElement): * html/HTMLElement.cpp: (WebCore::HTMLElement::setInnerText): TextControlInnerTextElement always preserves newline even if it doesn't have style yet. (WebCore::HTMLElement::supportsFocus): * html/HTMLEmbedElement.cpp: (WebCore::HTMLEmbedElement::parseAttribute): * html/HTMLFormControlElement.cpp: (WebCore::shouldAutofocus): Don't autofocus until we have renderer. * html/HTMLFormControlElementWithState.cpp: (WebCore::HTMLFormControlElementWithState::shouldSaveAndRestoreFormControlState): * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::didNotifySubtreeInsertions): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::updateType): Lazy render tree construction. (WebCore::HTMLInputElement::parseAttribute): (WebCore::HTMLInputElement::defaultEventHandler): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::parseAttribute): * html/HTMLObjectElement.cpp: (WebCore::HTMLObjectElement::parseAttribute): * html/HTMLSummaryElement.cpp: (WebCore::HTMLSummaryElement::didAddUserAgentShadowRoot): * html/parser/HTMLConstructionSite.cpp: (WebCore::executeTask): Don't attach renderer after construction. * html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::callTheAdoptionAgency): * html/shadow/ContentDistributor.cpp: (WebCore::ContentDistributor::invalidateDistribution): * html/shadow/InsertionPoint.cpp: (WebCore::InsertionPoint::willAttachRenderers): (WebCore::InsertionPoint::willDetachRenderers): * html/shadow/MediaControlElements.cpp: (WebCore::MediaControlTextTrackContainerElement::updateDisplay): * html/shadow/MediaControls.cpp: (WebCore::MediaControls::createTextTrackDisplay): * html/shadow/MediaControlsApple.cpp: (WebCore::MediaControlsApple::createControls): * html/track/TextTrackCue.cpp: (WebCore::TextTrackCue::getDisplayTree): * loader/PlaceholderDocument.cpp: (WebCore::PlaceholderDocument::createRenderTree): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::preload): * style/StyleResolveTree.cpp: (WebCore::Style::attachTextRenderer): (WebCore::Style::detachTextRenderer): Remove attached bit maintenance. (WebCore::Style::attachChildren): (WebCore::Style::attachShadowRoot): (WebCore::Style::attachRenderTree): (WebCore::Style::detachShadowRoot): (WebCore::Style::detachRenderTree): (WebCore::Style::resolveLocal): * svg/SVGTests.cpp: (WebCore::SVGTests::handleAttributeChange): Make lazy. * testing/Internals.cpp: (WebCore::Internals::attached): (WebCore::Internals::elementRenderTreeAsText): (WebCore::Internals::markerAt): (WebCore::Internals::nodesFromRect): LayoutTests: Reviewed by Andreas Kling. Most of these are non-visible render tree dump changes (they become simpler). * editing/selection/click-on-head-margin-expected.txt: * fast/css-generated-content/before-content-continuation-chain-expected.txt: * fast/css/transition-color-unspecified.html: * fast/dom/adopt-node-crash-2-expected.txt: * fast/dom/modify-node-and-while-in-the-callback-too-crash-expected.txt: * fast/forms/radio/radio_checked_dynamic-expected.txt: * fast/frames/lots-of-iframes-expected.txt: * fast/frames/sandboxed-iframe-autofocus-denied-expected.txt: * fast/table/table-row-style-not-updated-with-after-content-expected.txt: * fullscreen/full-screen-render-inline-expected.txt: * fullscreen/parent-flow-inline-with-block-child-expected.txt: * platform/mac/editing/inserting/break-blockquote-after-delete-expected.txt: * platform/mac/fast/css-generated-content/table-row-group-to-inline-expected.txt: * platform/mac/fast/dynamic/011-expected.txt: * platform/mac/fast/forms/formmove3-expected.txt: * platform/mac/fast/forms/preserveFormDuringResidualStyle-expected.txt: * platform/mac/fast/invalid/001-expected.txt: * platform/mac/fast/invalid/003-expected.txt: * platform/mac/fast/invalid/004-expected.txt: * platform/mac/fast/invalid/007-expected.txt: * platform/mac/fast/invalid/019-expected.txt: * platform/mac/fast/multicol/span/span-as-immediate-child-generated-content-expected.txt: * platform/mac/fast/multicol/span/span-as-immediate-columns-child-dynamic-expected.txt: * platform/mac/fast/multicol/span/span-as-nested-columns-child-dynamic-expected.txt: * platform/mac/fast/ruby/ruby-base-merge-block-children-crash-expected.txt: * platform/mac/tables/mozilla/bugs/bug113235-1-expected.txt: * platform/mac/tables/mozilla/bugs/bug647-expected.txt: * platform/mac/tables/mozilla/other/wa_table_tr_align-expected.txt: * plugins/plugin-remove-readystatechange-expected.txt: * svg/custom/system-language-crash-expected.txt: * transitions/equivalent-background-image-no-transition.html: * transitions/repeated-firing-background-color.html: * transitions/transition-duration-cleared-in-transitionend-crash.html: Adopt a few transition test cases to new behavior. Canonical link: https://commits.webkit.org/144033@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160908 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-12-20 14:44:23 +00:00
setTimeout(function() { document.getElementById("foo").className="trans" }, 0);
</script>
<div id="result">
</div>
</body>
</html>