Bug 1379516 - Mark animation timerline marker for stylo. r?birtles
MozReview-Commit-ID: GkPSXEk4xua
--- a/dom/animation/test/chrome.ini
+++ b/dom/animation/test/chrome.ini
@@ -10,12 +10,12 @@ support-files =
# over HTTP
[chrome/test_animation_observers_async.html]
[chrome/test_animation_observers_sync.html]
[chrome/test_animation_performance_warning.html]
[chrome/test_animation_properties.html]
[chrome/test_cssanimation_missing_keyframes.html]
[chrome/test_generated_content_getAnimations.html]
[chrome/test_restyles.html]
-skip-if = os == 'android' || stylo # bug 1335986
+skip-if = os == 'android' # bug 1335986
[chrome/test_running_on_compositor.html]
[chrome/test_simulate_compute_values_failure.html]
skip-if = !debug
--- a/layout/base/ServoRestyleManager.cpp
+++ b/layout/base/ServoRestyleManager.cpp
@@ -182,32 +182,34 @@ ServoRestyleManager::PostRestyleEvent(El
void
ServoRestyleManager::PostRestyleEventForCSSRuleChanges()
{
mRestyleForCSSRuleChanges = true;
mPresContext->PresShell()->EnsureStyleFlush();
}
-/* static */ void
+void
ServoRestyleManager::PostRestyleEventForAnimations(
Element* aElement,
CSSPseudoElementType aPseudoType,
nsRestyleHint aRestyleHint)
{
Element* elementToRestyle =
EffectCompositor::GetElementToRestyle(aElement, aPseudoType);
if (!elementToRestyle) {
// FIXME: Bug 1371107: When reframing happens,
// EffectCompositor::mElementsToRestyle still has unbinded old pseudo
// element. We should drop it.
return;
}
+ AutoRestyleTimelineMarker marker(mPresContext->GetDocShell(),
+ true /* animation-only */);
Servo_NoteExplicitHints(elementToRestyle, aRestyleHint, nsChangeHint(0));
}
void
ServoRestyleManager::RebuildAllStyleData(nsChangeHint aExtraHint,
nsRestyleHint aRestyleHint)
{
// NOTE(emilio): GeckoRestlyeManager does a sync style flush, which seems not
--- a/layout/base/ServoRestyleManager.h
+++ b/layout/base/ServoRestyleManager.h
@@ -180,19 +180,19 @@ public:
* Posts restyle hints for animations.
* This is only called for the second traversal for CSS animations during
* updating CSS animations in a SequentialTask.
* This function does neither register a refresh observer nor flag that a
* style flush is needed since this function is supposed to be called during
* restyling process and this restyle event will be processed in the second
* traversal of the same restyling process.
*/
- static void PostRestyleEventForAnimations(dom::Element* aElement,
- CSSPseudoElementType aPseudoType,
- nsRestyleHint aRestyleHint);
+ void PostRestyleEventForAnimations(dom::Element* aElement,
+ CSSPseudoElementType aPseudoType,
+ nsRestyleHint aRestyleHint);
protected:
~ServoRestyleManager() override
{
MOZ_ASSERT(!mReentrantChanges);
}
private:
/**
--- a/layout/style/ServoStyleSet.cpp
+++ b/layout/style/ServoStyleSet.cpp
@@ -328,19 +328,22 @@ ServoStyleSet::PreTraverse(Element* aRoo
}
bool
ServoStyleSet::PrepareAndTraverseSubtree(
RawGeckoElementBorrowed aRoot,
ServoTraversalFlags aFlags)
{
MOZ_ASSERT(MayTraverseFrom(const_cast<Element*>(aRoot)));
- bool forThrottledAnimationFlush = !!(aFlags & ServoTraversalFlags::AnimationOnly);
- AutoRestyleTimelineMarker marker(mPresContext->GetDocShell(), forThrottledAnimationFlush);
+ // For markers for animations, we have already set the markers in
+ // ServoRestyleManager::PostRestyleEventForAnimations so that we don't need
+ // to care about animation restyles here.
+ AutoRestyleTimelineMarker marker(mPresContext->GetDocShell(),
+ false /* animation-only */);
MOZ_ASSERT(!StylistNeedsUpdate());
AutoSetInServoTraversal guard(this);
const SnapshotTable& snapshots = Snapshots();
bool isInitial = !aRoot->HasServoData();
bool forReconstruct = !!(aFlags & ServoTraversalFlags::AggressivelyForgetful);
@@ -348,17 +351,17 @@ ServoStyleSet::PrepareAndTraverseSubtree
Servo_TraverseSubtree(aRoot, mRawSet.get(), &snapshots, aFlags);
MOZ_ASSERT(!(isInitial || forReconstruct) || !postTraversalRequired);
// We don't need to trigger a second traversal if this restyle only for
// flushing throttled animations. That's because the first traversal only
// performs the animation-only restyle, skipping the normal restyle, and so
// will not generate any SequentialTask that could update animation state
// requiring a subsequent traversal.
- if (forThrottledAnimationFlush) {
+ if (aFlags & ServoTraversalFlags::AnimationOnly) {
return postTraversalRequired;
}
auto root = const_cast<Element*>(aRoot);
// If there are still animation restyles needed, trigger a second traversal to
// update CSS animations or transitions' styles.
//
--- a/layout/style/test/mochitest.ini
+++ b/layout/style/test/mochitest.ini
@@ -262,17 +262,16 @@ fail-if = stylo # bug 1382078
[test_pseudoelement_parsing.html]
[test_redundant_font_download.html]
support-files = redundant_font_download.sjs
[test_reframe_pseudo_element.html]
[test_rem_unit.html]
[test_restyle_table_wrapper.html]
[test_restyles_in_smil_animation.html]
skip-if = toolkit == 'android' # bug 1328522
-fail-if = stylo # bug 1387935
[test_root_node_display.html]
[test_rule_insertion.html]
[test_rule_serialization.html]
[test_rules_out_of_sheets.html]
[test_selectors.html]
skip-if = toolkit == 'android' #bug 775227
[test_selectors_on_anonymous_content.html]
fail-if = stylo # bug 1382102