Commit 366a98a4 authored by Kevin Ellis's avatar Kevin Ellis Committed by Commit Bot

Flush styles when checking the play state of a CSSTransition.

Bug: 1006086
Change-Id: I7abf288db967ebb09a6a61be54fcbeaddab8febd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2091587
Commit-Queue: Kevin Ellis <kevers@chromium.org>
Reviewed-by: default avatarRobert Flack <flackr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748214}
parent 525e0c5d
......@@ -4,6 +4,8 @@
#include "third_party/blink/renderer/core/animation/css/css_transition.h"
#include "third_party/blink/renderer/core/dom/document.h"
namespace blink {
CSSTransition::CSSTransition(ExecutionContext* execution_context,
......@@ -17,4 +19,12 @@ AtomicString CSSTransition::transitionProperty() const {
return transition_property_.GetCSSPropertyName().ToAtomicString();
}
String CSSTransition::playState() const {
// TODO(1043778): Flush is likely not required once the CSSTransition is
// disassociated from its owning element.
if (GetDocument())
GetDocument()->UpdateStyleAndLayoutTree();
return Animation::playState();
}
} // namespace blink
......@@ -26,6 +26,17 @@ class CORE_EXPORT CSSTransition : public Animation {
return transition_property_.GetCSSProperty();
}
// Animation overrides.
// Various operations may affect the computed values of properties on
// elements. User agents may, as an optimization, defer recomputing these
// values until it becomes necessary; however, all operations included in the
// programming interfaces defined in the web-animations and css-transitions
// specifications, must produce a result consistent with having fully
// processed any such pending changes to computed values. Notably, setting
// display:none must update the play state.
// https://drafts.csswg.org/css-transitions-2/#requirements-on-pending-style-changes
String playState() const override;
private:
PropertyHandle transition_property_;
};
......
This is a testharness.js-based test.
PASS Animated style is cleared after canceling a running CSS transition
PASS After canceling a transition, it can still be re-used
PASS After canceling a finished transition, it can still be re-used
PASS After canceling a transition, updating transition properties doesn't make it live again
FAIL Setting display:none on an element cancels its transitions assert_equals: expected "idle" but got "running"
FAIL Setting display:none cancels transitions on a child element assert_equals: expected "idle" but got "running"
PASS Removing a property from transition-property cancels transitions on that property
PASS Setting zero combined duration
PASS Changing style to another interpolable value cancels the original transition
PASS An after-change style value can't be interpolated
PASS Reversing a running transition cancels the original transition
Harness: the test ran to completion.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment