Closed
Bug 1338087
Opened 8 years ago
Closed 8 years ago
stylo: Stop storing StyleAnimationValue on main thread
Categories
(Core :: DOM: Animation, defect)
Core
DOM: Animation
Tracking
()
RESOLVED
FIXED
mozilla54
Tracking | Status | |
---|---|---|
firefox54 | --- | fixed |
People
(Reporter: boris, Assigned: boris)
References
Details
Attachments
(4 files, 2 obsolete files)
After landing Bug 1337313 and Bug 1335942, it's time to stop storing StyleAnimationValue for stylo animations, which means we should always use RawServoAnimationValue for animations.
However, ComputeDistance and Accumulation/Addition still need StyleAnimationValue. The former is used by spacing, which can be disabled for stylo, and the latter is not supported yet (Bug 1329878 will fix it!).
Note: This may cause some mochitests failed. (But we will know what is need to be fixed ASAP.)
Assignee | ||
Updated•8 years ago
|
Comment 1•8 years ago
|
||
Sorry, I haven't been following this closely but what are we doing for compositor animations? Don't we need StyleAnimationValue objects there still?
Comment 2•8 years ago
|
||
No at least for main thread side, once bug 1337313 landed. To run animations on the compositor, we still need to update cascading result. Apart from the cascading issue for the animations on the compositor we can run animations on the compositor now!
On the compositor we still use StyleAnimationValue for interpolation but it's generated from Animatable object on the compositor. Boris did the job!
Assignee | ||
Updated•8 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Updated•8 years ago
|
Summary: stylo: Stop storing StyleAnimationValue → stylo: Stop storing StyleAnimationValue in main thread
Assignee | ||
Updated•8 years ago
|
Summary: stylo: Stop storing StyleAnimationValue in main thread → stylo: Stop storing StyleAnimationValue on main thread
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Comment 6•8 years ago
|
||
Actually, I would like to precalculate the Context outside the loop, instead of in Servo_AnimationValues_Populate(), but I think hiro will do that in bug 1338927.
Assignee | ||
Comment 7•8 years ago
|
||
mozreview-review |
Comment on attachment 8836562 [details]
Bug 1338087 - Part 3: Append PropertyStyleAnimationValuePair from Servo side.
https://reviewboard.mozilla.org/r/111880/#review113188
::: servo/ports/geckolib/glue.rs:301
(Diff revision 1)
> let mut iter = guard.declarations
> .iter()
> .filter_map(|&(ref decl, imp)| {
> if imp == Importance::Normal {
> - AnimationValue::from_declaration(decl, &context, &init)
> + match AnimationValue::from_declaration(decl, &context, &init) {
> + Some(v) => Some((decl.id().to_nscsspropertyid(), v)),
I just noticed that we can use TransitionProperty to convert it into a nsCSSPropertyID. However, I need others' opinions.
Assignee | ||
Comment 8•8 years ago
|
||
mozreview-review |
Comment on attachment 8836561 [details]
Bug 1338087 - Part 2: Drop the computation of StyleAnimationValue on stylo.
https://reviewboard.mozilla.org/r/111878/#review113190
::: layout/style/StyleAnimationValue.cpp
(Diff revision 1)
> - // FIXME: Servo bindings don't yet represent const-ness so we just
> - // cast it away for now.
> - auto declarations = const_cast<RawServoDeclarationBlock*>(&aDeclarations);
> - RefPtr<ServoComputedValues> computedValues =
> - aStyleContext->PresContext()->StyleSet()->AsServo()->
> - RestyleWithAddedDeclaration(declarations, previousStyle).Consume();
Is it possible to use this in the future? if not, I can also remove ServoStyleSet::RestyleWithAddedDeclaration(...) and its FFI.
Comment 9•8 years ago
|
||
mozreview-review |
Comment on attachment 8836562 [details]
Bug 1338087 - Part 3: Append PropertyStyleAnimationValuePair from Servo side.
https://reviewboard.mozilla.org/r/111880/#review113192
Attachment #8836562 -
Flags: review?(manishearth) → review+
Comment 10•8 years ago
|
||
mozreview-review |
Comment on attachment 8836560 [details]
Bug 1338087 - Part 1: Don't apply paced spacing on stylo.
https://reviewboard.mozilla.org/r/111876/#review113194
::: dom/animation/KeyframeEffectReadOnly.cpp:902
(Diff revision 1)
> aStyleContext);
>
> - if (mEffectOptions.mSpacingMode == SpacingMode::paced) {
> + // FIXME: Bug 1332633: we have to implement ComputeDistance for
> + // RawServoAnimationValue.
> + if (mEffectOptions.mSpacingMode == SpacingMode::paced &&
> + aStyleContext->PresContext()->StyleSet()->IsGecko()) {
I am wondering we should unify this kind of check in a later bug. In other parts we are currently using mDocument->IsStyledByServo(). But that's OK for now.
Attachment #8836560 -
Flags: review?(hikezoe) → review+
Comment 11•8 years ago
|
||
mozreview-review |
Comment on attachment 8836561 [details]
Bug 1338087 - Part 2: Drop the computation of StyleAnimationValue on stylo.
https://reviewboard.mozilla.org/r/111878/#review113198
I think we can also drop the forward declaration of RawServoDeclarationBlock in StyleAnimationValue.h. Also ServoBindings.h? I am not really sure.
::: dom/animation/KeyframeUtils.cpp:638
(Diff revision 1)
> + CSSEnabledState::eForAllContent) {
> + if (nsCSSProps::kAnimTypeTable[*p] == eStyleAnimType_None) {
> + // Skip non-animatable component longhands.
> - continue;
> + continue;
> - }
> + }
> + PropertyStyleAnimationValuePair* valuePair = values.AppendElement();
> + valuePair->mProperty = *p;
> + }
> + } else {
> + PropertyStyleAnimationValuePair* valuePair = values.AppendElement();
> + valuePair->mProperty = pair.mProperty;
> + }
> +
I haven't checked the later patch yet, this looks correct to me.
::: layout/style/StyleAnimationValue.cpp
(Diff revision 1)
> - // FIXME: Servo bindings don't yet represent const-ness so we just
> - // cast it away for now.
> - auto declarations = const_cast<RawServoDeclarationBlock*>(&aDeclarations);
> - RefPtr<ServoComputedValues> computedValues =
> - aStyleContext->PresContext()->StyleSet()->AsServo()->
> - RestyleWithAddedDeclaration(declarations, previousStyle).Consume();
I don't think the function will be used in the future. Let's drop this here.
Attachment #8836561 -
Flags: review?(hikezoe) → review+
Comment 12•8 years ago
|
||
Boris, is there any problems without part 3? If there is no problem, I'd like you to land these patches without part 3 here, and drop Servo_AnimationValues_Populate in bug 1338927.
Flags: needinfo?(boris.chiou)
Assignee | ||
Comment 13•8 years ago
|
||
(In reply to Hiroyuki Ikezoe (:hiro) from comment #12)
> Boris, is there any problems without part 3? If there is no problem, I'd
> like you to land these patches without part 3 here, and drop
> Servo_AnimationValues_Populate in bug 1338927.
OK, I can drop part 3.
Flags: needinfo?(boris.chiou)
Comment hidden (mozreview-request) |
Assignee | ||
Updated•8 years ago
|
Attachment #8836562 -
Attachment is obsolete: true
Attachment #8836562 -
Flags: review?(hikezoe)
Comment hidden (mozreview-request) |
Assignee | ||
Updated•8 years ago
|
Attachment #8836571 -
Flags: review?(manishearth)
Comment hidden (mozreview-request) |
Comment 17•8 years ago
|
||
mozreview-review |
Comment on attachment 8836571 [details]
Bug 1338087 - [Servo] Drop Servo_RestyleWithAddedDeclaration.
https://reviewboard.mozilla.org/r/111972/#review113202
Attachment #8836571 -
Flags: review?(manishearth) → review+
Comment hidden (mozreview-request) |
Assignee | ||
Updated•8 years ago
|
Attachment #8836588 -
Flags: review?(cam)
Comment 19•8 years ago
|
||
mozreview-review |
Comment on attachment 8836588 [details]
Bug 1338087 - Part 3: Remove asserts-if on crashtest 1244595-1.html.
https://reviewboard.mozilla.org/r/111984/#review113212
Attachment #8836588 -
Flags: review?(cam) → review+
Assignee | ||
Comment 20•8 years ago
|
||
Comment hidden (mozreview-request) |
Assignee | ||
Updated•8 years ago
|
Attachment #8836571 -
Attachment is obsolete: true
Assignee | ||
Comment 22•8 years ago
|
||
wait for Bug 1338926 because servo vcs sync is broken.
Comment 23•8 years ago
|
||
Pushed by bchiou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/29f7ce98c99f
Part 1: Don't apply paced spacing on stylo. r=hiro
https://hg.mozilla.org/integration/autoland/rev/985981c12364
Part 2: Drop the computation of StyleAnimationValue on stylo. r=hiro
https://hg.mozilla.org/integration/autoland/rev/881d38183d2f
Part 3: Remove asserts-if on crashtest 1244595-1.html. r=heycam
Comment 24•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/29f7ce98c99f
https://hg.mozilla.org/mozilla-central/rev/985981c12364
https://hg.mozilla.org/mozilla-central/rev/881d38183d2f
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox54:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in
before you can comment on or make changes to this bug.
Description
•