This FFI is used by Servo_AnimationValue_GetTransform(), which needs to
handle and return none transform properly.
MozReview-Commit-ID: 49cFXE2BIbm
--HG--
extra : rebase_source : 9def5e92dc6c0b60c2fb412228a50d7e2f5eb722
We need to traverse rule tree to get the important rules, so we will not
override them if they have animations running on compositor.
MozReview-Commit-ID: 67NO2nIcUfq
--HG--
extra : rebase_source : 24a4ea4ca10e00f409d94c81acacb3db72248b3f
This allows us to access metadata using `match` instead of comparison with
atoms, which makes it doable to get the pseudo-element flags in the future.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
MozReview-Commit-ID: KgGjFePmhyS
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
--HG--
extra : rebase_source : 57614aed13d2c088fe129ecf3fabf9869d5a6d50
This is mostly a mimic of what we do in
GeckoCSSAnimationBuilder::FillInMissingKeyframeValues().
In Gecko we iterate over the properties just once because we can take the
index for both the synthesized start and end keyframe and easily look them up
as needed. However, in this patch we synthesize the start and end keyframes
separately and iterate over the properties twice because that's easier than
getting two indices and then later calling another FFI to dereference each of
them, and neater than getting back two pointers
MozReview-Commit-ID: 1e0R9AKzgaG
--HG--
extra : rebase_source : a37c406480c2d0ce2b8c4d4ad804622cac2083fa
This patch implement several things:
1. Implement a new constructor for nsStyleImageRequest to receive an existing
ImageValue from the caller.
2. Implement Gecko_ImageValue_Create to allow stylo to create a gecko::ImageValue
object.
3. Implement Gecko_SetXXXXImageValue to allow stylo to pass a created ImageValue
back to gecko.
MozReview-Commit-ID: 1SbW5w8FSV2
--HG--
extra : source : 63777ecf4c7138a0ce5847753a41efcbfc8e2b20
extra : intermediate-source : dced488c119da7e3ae27c903c0dcc76593d8a06d
This patch implement several things:
1. Implement a new constructor for nsStyleImageRequest to receive an existing
ImageValue from the caller.
2. Implement Gecko_ImageValue_Create to allow stylo to create a gecko::ImageValue
object.
3. Implement Gecko_SetXXXXImageValue to allow stylo to pass a created ImageValue
back to gecko.
MozReview-Commit-ID: 1SbW5w8FSV2
--HG--
extra : rebase_source : f3ce46922ded8414dabb70ef0e58177f48c4bb14
extra : intermediate-source : c146e6dcac12ed597e785dbf4f3d9c1ad323023e
extra : source : 63777ecf4c7138a0ce5847753a41efcbfc8e2b20
I've chosen this approach mainly because there's no other good way to guarantee
the model is correct than holding the snapshots alive until a style refresh.
What I tried before this (storing them in a sort of "immutable element data") is
a pain, since we call into style from the frame constructor and other content
notifications, which makes keeping track of which snapshots should be cleared an
which shouldn't an insane task.
Ideally we'd have a single entry-point for style, but that's not the case right
now, and changing that requires pretty non-trivial changes to the frame
constructor.
MozReview-Commit-ID: FF1KWZv2iBM
--HG--
extra : rebase_source : b02d516ea164fc567110338411bf6ba251d53dab
Only counter() and counters() functions are affected so far, since
list-style-type hasn't been hooked with counter-style yet.
MozReview-Commit-ID: EAuT3KvPpNY
--HG--
extra : rebase_source : ed561f7f644d638af6d8bcb57182946f5ee1a7f2
We need an FFI, Gecko_StyleTransition_SetUnsupportedProperty, to set the
mProperty and mUnknownProperty of StyleTransition. In Servo, we put
non-animatable, custom, and unrecognized property together, so this FFI
should look up the nsCSSPropertyID of the input string, and then store the
value and the unknown property string (if any) back to StyleTransition.
MozReview-Commit-ID: 4iZNKXNSrzj
--HG--
extra : rebase_source : 088daa620133418afdc6b1c97b6e90ceb7cf3b75
1. add binding functions for -moz-border-*-colors support.
In Gecko, we use double pointers to nsBorderColors to store -moz-border-*-colors.
The computed values of -moz-border-*-colors are set by couple member functions.
To pass the computed value from Servo to Gecko, we need support for these member
functions as well. So, I'm adding some binding functions in this patch. The
actual use of these bindings to pass/store the computed values is separated
in the following patch, which should be a pure Servo change. See servo PR:
https://github.com/servo/servo/pull/16586.
2. update test expectations for -moz-border-*-colors support.
Note that with the support of -moz-border-*-colors, 165 mochitests and 17 reftests
could be fixed.
MozReview-Commit-ID: KDbp8C6Aoqd
--HG--
extra : rebase_source : 7d9675d9ece091ea6957dcae7d28c39066e69035
We add these FFIs for retrieving the existing transitions, so we can
reduce the false alarms of triggering transitions from Servo:
1. Gecko_ElementTransitions_Length
2. Gecko_ElementTransitions_PropertyAt
3. Gecko_ElementTransitions_EndValueAt
MozReview-Commit-ID: 9eLd8fxmNd9
--HG--
extra : rebase_source : 0ea23dd7f48dbdc1f31a83244ab1dfaf1b20a321
Add one FFI, Gecko_ElementHasCSSTransitions, to check if there is any
transition in CSSTransitionCollection. This will be used to check if we need
to update transition and if we should compute the after-change style.
MozReview-Commit-ID: 7xP4SdxNp7g
--HG--
extra : rebase_source : dbc4941151835c2f1c3596a6baaef77b2198890c
Rename UpdateTransitions as DoUpdateTransitions, and add a public
method, UpdateTransitions for stylo.
MozReview-Commit-ID: 7UiGzFsGZC4
--HG--
extra : rebase_source : a1e6a1efda9fc324ba50e5a17c122d6daf1b5b01
For image-orientation property, we use methods of nsStyleImageOrientation
struct to create/set its computed value. Adding these binding functions
could let us reuse these methods for transferring computed values from Servo
side to Gecko.
The actual changes for the calling these binding functions to do the glue things
for Stylo is in a separate following patch, which should be pure Servo changes.
MozReview-Commit-ID: 9MuICVgdxNw
--HG--
extra : rebase_source : e1fbcc3445b7a1d1deb18d204f4b8f60d7356b08
CLOSED TREE
Backed out changeset 1cce9249b4a2 (bug 1351200)
Backed out changeset 792fb55377f5 (bug 1351200)
Backed out changeset 767bee78574c (bug 1351200)
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
mBaseStyleValuesForServo is a nsRefPtrHashtable<nsUint32HashKey, RawServoAnimationValue>
In this patch, we use void* instead of exposing nsRefPtrHashtable in FFI
because we just use the hash table as an argument of a C++ function, it means
we don't touch the hash table in Rust at all.
MozReview-Commit-ID: 1wM6NeF2S0t
--HG--
extra : rebase_source : 17908ff84d061e189f21641bf660dc9720b964bc
Two functions added in this patch get progress value from ComputedTiming
or get the position in a given AnimationPropertySegment.
Without these FFIs, we need to expose Maybe<> and Nullable<> and handle
them in Rust.
MozReview-Commit-ID: IXYWlqEQyVR
--HG--
extra : rebase_source : 8cc4d03f718cc13abfcb9c9af700bae7082bbf31
This is necessary because if we pass in the import rule, we would need
to invoke Servo_ImportRule_GetSheet to get the child sheet. However,
Servo_ImportRule_GetSheet tries to lock the global rwlock with read
access, while Servo_CssRules_InsertRule has already locked the same
rwlock with write access for the CSSOM case.
Since the import rule itself is never needed in the code path, it is
easier to just pass in the child stylesheet.
MozReview-Commit-ID: 4njNyGniPIm
--HG--
extra : rebase_source : ad88929713fdc5a581addc044094fa8130125121
This also removes the TABLE_ATTRS_DIRTY optimization. Constructing nsMappedAttributes isn't really expensive and we do it all the time anyway.
MozReview-Commit-ID: 2krt1nFUzgl
--HG--
extra : rebase_source : 18d400aed6f427e5efc503b87b6ee2d9af74f3f5
Also implements :link, :visited, and :any-link more efficiently, and stops
matching :-moz-read-only in everything that is not read-write, which is kind of
dumb, and probably creates some artifacts.
MozReview-Commit-ID: 6BQqi7nAWdT
--HG--
extra : rebase_source : 39dc6b481b3a92942dc3732990d8b9040d8e6d84
The UpdateAnimationsTasks is a bitflags and each bit is generated from
Gecko's UpdateAnimationsTasks (enum class) values for matching values
between C++ and Rust. For this reason, the bitflags is annotated as
(feature = "gecko"), as a result update_animations() which uses this bitflags
also became gecko-only function.
MozReview-Commit-ID: AfQd0FJGkYd
--HG--
extra : rebase_source : 2a5fee40c57a7941defa447357915756af42bc11
If an element has any type of animations in match_elements(), we need to call
UpdateEffectProperties() to update KeyframeEffectReadOnly::mProperties.
MozReview-Commit-ID: 1CDhwoM2llE
--HG--
extra : rebase_source : f2c476d579019079702b01fec375f75b4594dee9
It's a bit unfortunate the use separate implementations of SpecifiedUrl for Servo
and Gecko, but they're different enough at this point that I don't think it really
makes sense to try to share everything. Splitting them out has some nice
simplifications as well.
I recognize that there's still some potential correctness issues for Servo using
the resolved URI in various places where the original URI may be the right thing,
but I've got too much on my plate to look into that for now.
MozReview-Commit-ID: BeDu93TQ4Ow
Before this patch, we store each computed values in a hashtable,
nsRefPtrHashtable<nsUint32HashKey, RawServoAnimationValue>, for all
KeyframeEffectReadOnly on an element, and convert the ServoAnimationValues of
the hashtable into an nsTArray<ServoAnimationValue*> and then convert
the ServoAnimationValues of the nsTArray into PropertyDeclarationBlock
in rust. This way was really inefficient.
In this patch, we store the computed values into AnimationValueMap and
convert all AnimationValue in the map into PropertyDeclarationBlock
after EffectCompositor::GetAnimationRule.
MozReview-Commit-ID: EJ2Kl65fVeF
--HG--
extra : rebase_source : e30a9d440dc9855e21b94501b07a3501d31bc345
We create the SequentialTask only if:
* We have no old computed values and we have animation name style in the new
computed values.
* Any animation properties is changed.
* display property is changed from 'none' and we have animation name style.
* display property is changed to 'none'.
In a subsequent patch we skip the SequentialTask if we have no running
animations and the display propery is changed to 'none'.
MozReview-Commit-ID: JRSZznufOS2
--HG--
extra : rebase_source : 566026c21c6357f77df55e3bd588835f5fd6c3d4
Later we update CSS animations if this function returns false.
MozReview-Commit-ID: 27FsYQ40gSv
--HG--
extra : rebase_source : a043282de6c8a50ed53a92de98ecf93eb042f188
This introduces a basic framework for servo's style system to be able
to query the style of presentation attributes which it can then insert
into the cascade. It uses that framework to implement the size and
color attributes on <font>.
There are a number of improvements that can be done on top of this:
- Implement all other properties
- Abstractify the ruledata parameter of the mappers using templates or virtual dispatch so that it can be a Servo decl block instead
- Implement aforementiond abstraction over Servo decl blocks (this obsoletes the code in the first item above, so it might just be better to skip that and directly do this)
- Replace uses of nsHTMLStyleSheet with an abstract base class containing common elements between Servo and Gecko
I'd prefer for these to be done in separate steps.
MozReview-Commit-ID: GO60qfeZOfl
--HG--
extra : rebase_source : 516d369a8627e413983361aaf85ccb7132b0a06c
This is a function which is called in Servo_StyleSet_FillKeyframesForName to
append a Gecko's Keyframe into nsTArray<Keyframe>.
Without this function we need to end up exposing ComputedTimingFunction class
and Maybe<> as FFI.
MozReview-Commit-ID: 2EpltR4rMVh
Implement the mapping between EffectCompositor::CascadeLevel in Gecko and
EffectCompositor_CascadeLevel in Servo, so we can pass it as a parameter into
Gecko_GetAnimationRule.
MozReview-Commit-ID: GRedooyGE8c
--HG--
extra : rebase_source : c18d54dabb093242c66d46be8ca03424a2c6ca78
1. Add one new FFI, Gecko_GetAnimationRule, which will try
to update the animation rule and retrieve a ServoAnimationRule
from EffectSet.
2. Add GetServoAnimationRule, which calls Animation::ComposeStyle and updates
mElementsToRestyle.
3. There is no eRestyle_{CSSAnimations|CSSTransitions}, so we use
eRestyle_Self and eRestyle_Subtree for stylo.
MozReview-Commit-ID: 9RpJurPSFMk
--HG--
extra : rebase_source : 6f1246b73a920aee86faeeaccc42b7f51ed2a6c8
The getter function may create an nsCSSValue with allocated stuff, and we don't
want to leak it.
MozReview-Commit-ID: DYkUD8CW88E
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
So that the new subclass of DeclarationBlock could just be
ServoDeclarationBlock.
MozReview-Commit-ID: 55KgfmWmmyU
--HG--
extra : source : 27c55355da341fce112b15d966eb9b2fa2c8834b
Compilers would complain about using user-defined type as return type
of extern "C" functions. A struct is considered a user-defined type if
there is any non-trivial constructor.
Having a type without non-trivial constructor for borrowed type would
be very inconvenient. Actually the currently borrowed type doesn't seem
to provide any additional safety / benefit over a plain pointer.
MozReview-Commit-ID: ncxmCEWCkv
--HG--
extra : rebase_source : 43a95bbcb05759f27837629daec6ce915a68b062
extra : source : 2a544c24bfb6a3412e59acbee89a5a393c31d5b6
This allows to copy the `content` property value from one nsStyleContent to
another, in order to implement content: inherit.
MozReview-Commit-ID: 75mQpGRKKba
Signed-off-by: Emilio Cobos Álvarez <ecoal95@gmail.com>