We have to make sure the scroll animations is still responsive at
boundaries even if it's playstate is finished.
This patch includes the update of UpdateFinishedState() to match the
spec, and make sure we still tick scroll animations at finished play state.
Getting a finished state might be strange for scroll animations, and this
might be a spec issue. However, for consistency with JS-generated animations,
we'd like to align the behaviors with other browsers, and make sure we are
still match the definition of finished state in the spec.
Besides, we have to use EndTime() on the compositor so
animation-iteration-count works properly.
Tests are in the last patch.
Differential Revision: https://phabricator.services.mozilla.com/D149940
`sTiming` is a hack and I believe animation-delay,
animation-iteration-count, animation-direction, and animation-fill-mode
should be meaningful for scroll-linked animations. (I will add the
tentative wpt in Bug 1775327.)
So we need to introduce a normalized timing when resolving the specified
timing.
Also, this patch makes the bug of printing scroll animations detectable.
No behavior is changed and I'd like to remove the magic values and do
normalization in Bug 1775327.
Note: Based on https://github.com/w3c/csswg-drafts/issues/4862 and
web-animations-2, we will introudce CSSNumberish for duration, current
time, and delay. That is, we will accept percentage for
animation-duration, animation-delay. However, Gecko doesn't support
CSSNumberish for those values, so we'd like to normalize these time values
in Bug 1775327. This patch is the 1st step: split the normalized
timing from the specified timing, and use it when resolving the
timing, for progress-based timeline.
Differential Revision: https://phabricator.services.mozilla.com/D149683
This lifts a bunch of string conversions higher up the stack, but allows
us to make the servo code use utf-8 unconditionally, and seemed faster
in my benchmarking (see comment 0).
It should also make a bunch of attribute setters faster too (like
setting .cssText), now that we use UTF8String for them (we couldn't
because we couldn't specify different string types for the getter and
setters).
Differential Revision: https://phabricator.services.mozilla.com/D99590
Callers should pass in UTF-8, since that's what the JS engine ends up with in the end anyway.
The various URL changes are because NS_NewURI converts incoming nsAString to
UTF-8 anyway. So we might as well do that up-front and then use the UTF-8
string for both the NS_NewURI call and the error-reporting if it fails.
Differential Revision: https://phabricator.services.mozilla.com/D65543
--HG--
extra : moz-landing-system : lando
Bug 1517241 renamed nsIDocument to mozilla::dom::Document but unfortunately in
the process it messed up the ordering of includes which, according to the coding
style[1], should be alphabetically sorted.
Also, in TimingParams.cpp it didn't add the dom::* prefix so when the unified
build chunking changes, if the "using namespace mozilla::dom" declaration
disappears from the chunk, it will fail to build.
[1] https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#CC_practices
Depends on D15902
Differential Revision: https://phabricator.services.mozilla.com/D15903
--HG--
extra : moz-landing-system : lando
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.
Overall it's not a very interesting patch I think.
nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.
I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.
While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
First, we generate StyleComputedTimingFunction by cbindgen from Rust, and use
it in nsTimingFunction, so we could copy it directly without handling
the different memory layout. However, we have to rewrite the
nsTimingFunction and mozilla::ComputedTimingFunction for this.
Second, the rust-bindgen seems cannot generate the correct generic members
from complex C++ templates, especially for the nested template struct,
(https://github.com/rust-lang-nursery/rust-bindgen/issues/1429)
So we have to hide StyleTimingFunction to avoid the compilation errors.
Depends on D9312
Differential Revision: https://phabricator.services.mozilla.com/D9313
--HG--
extra : moz-landing-system : lando
Factoring out this method makes the code a little easier to read, particularly
when in the next patch in this series we add
a TimingParams::MergeOptionalEffectTiming method.
MozReview-Commit-ID: 5AU6IfN2grZ
--HG--
extra : rebase_source : f90614c7dd03413b4ce05d62d3ac73f0ba0e7dc3
We have ServoCSSParser class, and I think it's better to move those
Servo FFI into this class to avoid including ServoBindings.h everywhere.
MozReview-Commit-ID: 6orXtddp9ZU
--HG--
extra : rebase_source : 6da4158c4fec606aaee49fddee3192f94d6c85a3
This patch does the following in addition to a simple move:
* change the type of the pointers from RefPtr to nsCOMPtr
* move it from mozilla::css namespace to mozilla
MozReview-Commit-ID: 72MYq6kWm4s
--HG--
extra : rebase_source : 400fe0d7cc422f22592c302cfd4e457830b77e3e
We use Servo css-parser to parse keyframe property-value pairs, so we
should also use it to parse easing for Web Animations.
MozReview-Commit-ID: FsfHQaNT2xO
--HG--
extra : rebase_source : 8eb6489f257839f2c0de943b63cc1c04b44ff7a5
In order to avoid creating a temporary nsTimingFunction in some cases and
calling Init(), add some useful constructors to reduce the redundant code.
MozReview-Commit-ID: I8zmWeKl9aw
--HG--
extra : rebase_source : 50a9adc90c26c16fd1dcd7b70c519794b8d406fd
We use Servo css-parser to parse keyframe property-value pairs, so we
should also use it to parse easing for Web Animations.
MozReview-Commit-ID: FsfHQaNT2xO
--HG--
extra : rebase_source : f0426f90e4698363b0ce0271943b31418458301d
In order to avoid creating a temporary nsTimingFunction in some cases and
calling Init(), add some useful constructors to reduce the redundant code.
MozReview-Commit-ID: I8zmWeKl9aw
--HG--
extra : rebase_source : ef3b73e9e8798b2953f7db6ea5bb43ee12403649
Use eCSSUnit_Function to store the frames timing function. Also, add one more
css keyword: frames.
The following changes are included in this:
1. Parser changes.
2. Serialization.
3. Computation in nsRuleNode.
4. Invalid and other values in property_database.js
MozReview-Commit-ID: 887QcXHQ2pU
--HG--
extra : rebase_source : ca0135380ea432cb69c4f36cf502d404e04999e5
Once we tweak moz.build in the next patch, the grouping in the unified build
will change and expose these missing includes so we fix them here, first.
MozReview-Commit-ID: GebEEociwTo
--HG--
extra : rebase_source : 18158fdf8a3c1a1dcf446118371cad1a15fd4daf