зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1330190 - Part 5: Get style context without all of animation data for base styles. r=birtles
Test case, 1330190-2.html, is another variant of 1325193-1.html. It's for animation on a pseudo element, causes timeout without part 3 patch. MozReview-Commit-ID: KX6FE8mkZY2 --HG-- extra : rebase_source : f5efbae0cc30036a511659eab9b29b5091df7539
This commit is contained in:
Родитель
abd87081bf
Коммит
fdd11f4f75
|
@ -363,7 +363,8 @@ KeyframeEffectReadOnly::GetUnderlyingStyle(
|
||||||
// If we are composing with composite operation that is not 'replace'
|
// If we are composing with composite operation that is not 'replace'
|
||||||
// and we have not composed style for the property yet, we have to get
|
// and we have not composed style for the property yet, we have to get
|
||||||
// the base style for the property.
|
// the base style for the property.
|
||||||
RefPtr<nsStyleContext> styleContext = GetTargetStyleContext();
|
RefPtr<nsStyleContext> styleContext =
|
||||||
|
GetTargetStyleContextWithoutAnimation();
|
||||||
result = EffectCompositor::GetBaseStyle(aProperty,
|
result = EffectCompositor::GetBaseStyle(aProperty,
|
||||||
styleContext,
|
styleContext,
|
||||||
*mTarget->mElement,
|
*mTarget->mElement,
|
||||||
|
@ -443,7 +444,7 @@ KeyframeEffectReadOnly::EnsureBaseStylesForCompositor(
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!styleContext) {
|
if (!styleContext) {
|
||||||
styleContext = GetTargetStyleContext();
|
styleContext = GetTargetStyleContextWithoutAnimation();
|
||||||
}
|
}
|
||||||
MOZ_RELEASE_ASSERT(styleContext);
|
MOZ_RELEASE_ASSERT(styleContext);
|
||||||
|
|
||||||
|
@ -900,8 +901,9 @@ KeyframeEffectReadOnly::RequestRestyle(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<KeyframeEffectReadOnly::AnimationStyle aAnimationStyle>
|
||||||
already_AddRefed<nsStyleContext>
|
already_AddRefed<nsStyleContext>
|
||||||
KeyframeEffectReadOnly::GetTargetStyleContext()
|
KeyframeEffectReadOnly::DoGetTargetStyleContext()
|
||||||
{
|
{
|
||||||
nsIPresShell* shell = GetPresShell();
|
nsIPresShell* shell = GetPresShell();
|
||||||
if (!shell) {
|
if (!shell) {
|
||||||
|
@ -914,8 +916,27 @@ KeyframeEffectReadOnly::GetTargetStyleContext()
|
||||||
nsIAtom* pseudo = mTarget->mPseudoType < CSSPseudoElementType::Count
|
nsIAtom* pseudo = mTarget->mPseudoType < CSSPseudoElementType::Count
|
||||||
? nsCSSPseudoElements::GetPseudoAtom(mTarget->mPseudoType)
|
? nsCSSPseudoElements::GetPseudoAtom(mTarget->mPseudoType)
|
||||||
: nullptr;
|
: nullptr;
|
||||||
return nsComputedDOMStyle::GetStyleContextForElement(mTarget->mElement,
|
|
||||||
pseudo, shell);
|
if (aAnimationStyle == AnimationStyle::Include) {
|
||||||
|
return nsComputedDOMStyle::GetStyleContextForElement(mTarget->mElement,
|
||||||
|
pseudo,
|
||||||
|
shell);
|
||||||
|
}
|
||||||
|
|
||||||
|
return nsComputedDOMStyle::GetStyleContextForElementWithoutAnimation(
|
||||||
|
mTarget->mElement, pseudo, shell);
|
||||||
|
}
|
||||||
|
|
||||||
|
already_AddRefed<nsStyleContext>
|
||||||
|
KeyframeEffectReadOnly::GetTargetStyleContext()
|
||||||
|
{
|
||||||
|
return DoGetTargetStyleContext<AnimationStyle::Include>();
|
||||||
|
}
|
||||||
|
|
||||||
|
already_AddRefed<nsStyleContext>
|
||||||
|
KeyframeEffectReadOnly::GetTargetStyleContextWithoutAnimation()
|
||||||
|
{
|
||||||
|
return DoGetTargetStyleContext<AnimationStyle::Skip>();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|
|
@ -409,8 +409,19 @@ protected:
|
||||||
// context. That's because calling GetStyleContextForElement when we are in
|
// context. That's because calling GetStyleContextForElement when we are in
|
||||||
// the process of building a style context may trigger various forms of
|
// the process of building a style context may trigger various forms of
|
||||||
// infinite recursion.
|
// infinite recursion.
|
||||||
|
already_AddRefed<nsStyleContext> GetTargetStyleContext();
|
||||||
|
|
||||||
|
// Similar to the above but ignoring animation rules. We use this to get base
|
||||||
|
// styles (which don't include animation rules).
|
||||||
already_AddRefed<nsStyleContext>
|
already_AddRefed<nsStyleContext>
|
||||||
GetTargetStyleContext();
|
GetTargetStyleContextWithoutAnimation();
|
||||||
|
|
||||||
|
enum AnimationStyle {
|
||||||
|
Skip,
|
||||||
|
Include
|
||||||
|
};
|
||||||
|
template<AnimationStyle aAnimationStyle>
|
||||||
|
already_AddRefed<nsStyleContext> DoGetTargetStyleContext();
|
||||||
|
|
||||||
// A wrapper for marking cascade update according to the current
|
// A wrapper for marking cascade update according to the current
|
||||||
// target and its effectSet.
|
// target and its effectSet.
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html class="reftest-wait">
|
||||||
|
<span id=a />
|
||||||
|
<script>
|
||||||
|
addEventListener("DOMContentLoaded", function(){
|
||||||
|
a.animate([{"left": "38%"}], 100);
|
||||||
|
a.appendChild(document.createElement("div"));
|
||||||
|
document.documentElement.classList.remove("reftest-wait");
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</html>
|
|
@ -0,0 +1,35 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html class="reftest-wait">
|
||||||
|
<head>
|
||||||
|
<style>
|
||||||
|
@keyframes anim {
|
||||||
|
}
|
||||||
|
|
||||||
|
#o_0:before {
|
||||||
|
animation: anim 10s;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<script>
|
||||||
|
function boom(){
|
||||||
|
function getPseudoElement() {
|
||||||
|
var anim = document.getAnimations()[0];
|
||||||
|
anim.cancel();
|
||||||
|
return anim.effect.target;
|
||||||
|
}
|
||||||
|
|
||||||
|
var target = getPseudoElement();
|
||||||
|
target.animate([{"perspective": "262ex"}, {}], {duration: 1070, iterationStart: 68, iterationComposite: "accumulate"});
|
||||||
|
target.animate([{"color": "white", "flex": "inherit"}, {"color": "red", "flex": "66% "}], 3439);
|
||||||
|
target.animate([{"font": "icon"}], 1849);
|
||||||
|
setTimeout(function() {
|
||||||
|
document.documentElement.classList.remove("reftest-wait");
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
document.addEventListener("DOMContentLoaded", boom);
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id=o_0></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -17,5 +17,7 @@ skip-if(stylo) pref(dom.animations-api.core.enabled,true) load 1322291-1.html #
|
||||||
skip-if(stylo) pref(dom.animations-api.core.enabled,true) load 1322291-2.html # bug 1311257
|
skip-if(stylo) pref(dom.animations-api.core.enabled,true) load 1322291-2.html # bug 1311257
|
||||||
asserts-if(stylo,0-5) pref(dom.animations-api.core.enabled,true) load 1323114-1.html # bug 1324690
|
asserts-if(stylo,0-5) pref(dom.animations-api.core.enabled,true) load 1323114-1.html # bug 1324690
|
||||||
asserts-if(stylo,0-5) pref(dom.animations-api.core.enabled,true) load 1323114-2.html # bug 1324690
|
asserts-if(stylo,0-5) pref(dom.animations-api.core.enabled,true) load 1323114-2.html # bug 1324690
|
||||||
skip-if(stylo) pref(dom.animations-api.core.enabled,true) load 1330513-1.html # bug 1311257
|
|
||||||
skip-if(stylo) pref(dom.animations-api.core.enabled,true) load 1325193-1.html # bug 1311257
|
skip-if(stylo) pref(dom.animations-api.core.enabled,true) load 1325193-1.html # bug 1311257
|
||||||
|
skip-if(stylo) pref(dom.animations-api.core.enabled,true) load 1330190-1.html # bug 1311257
|
||||||
|
skip-if(stylo) pref(dom.animations-api.core.enabled,true) load 1330190-2.html # bug 1311257
|
||||||
|
skip-if(stylo) pref(dom.animations-api.core.enabled,true) load 1330513-1.html # bug 1311257
|
||||||
|
|
Загрузка…
Ссылка в новой задаче