Boris Chiou
28db6788b1
Bug 1343753 - Add Servo_Property_IsDiscreteAnimatable.
...
MozReview-Commit-ID: 5pMw7Wynv2q
2017-04-12 18:32:50 +08:00
Boris Chiou
2867bbcacc
Bug 1343753 - Add Servo_Animationvalues_IsInterpolable.
...
MozReview-Commit-ID: gaj9lJ7NYV
2017-04-12 18:32:41 +08:00
Boris Chiou
4a1b812ee4
Bug 1343753 - Add Servo_AnimationValue_Uncompute.
...
MozReview-Commit-ID: KJnVbXmXlug
2017-04-12 16:50:23 +08:00
J. Ryan Stinnett
1a31b87c22
Pass ParserContext down to lengths
...
To make it possible to check the rule type when parsing lengths, we need to pass
the `ParserContext` down through many layers to the place where length units are
parsed.
This change leaves it unused, so it's only to prepare for the next change.
MozReview-Commit-ID: 70YwtcCxnWw
2017-04-12 16:40:48 +08:00
J. Ryan Stinnett
1ae1d370f2
Check context to test keyframe rule_type
...
Now that the `context` contains the `rule_type`, we can remove the `in_keyframe`
arg and check the `rule_type` to achieve the same thing.
MozReview-Commit-ID: oXrFBPuKMz
2017-04-12 16:40:37 +08:00
J. Ryan Stinnett
4574cd8ea6
Pull rule_type into ParserContext
...
Absorb `rule_type` into the `ParserContext` so that it's easier to pass down to
deeper levels of the parser.
MozReview-Commit-ID: DjBNytLxGKX
2017-04-12 16:40:17 +08:00
Bobby Holley
dc5dbd5542
Store style system options in the global style data and shared style context.
...
I wanted to add an environmental variable to disable the style sharing
cache for gecko, but the current pattern involves lazy_static!, which
involves an atomic operation on lookup, which is a bit hot to do each
time we try to share styles. This makes that work happen once per
process.
2017-04-12 14:34:42 +08:00
Jonathan Turner
c9a091a3f5
Fix delayed keys on Windows, issue #12937
2017-04-12 15:10:06 +12:00
Cameron McCormack
50e4bb5d0c
stylo: Assert that we have computed style in Servo_ResolveStyle when lazy computation is forbidden.
2017-04-12 09:57:40 +08:00
bors-servo
a0a60ba61d
Auto merge of #16328 - bradwerth:computedStyles, r=heycam
...
Stylo: Add FFI interfaces for exposing style sources.
https://bugzilla.mozilla.org/show_bug.cgi?id=1346256
https://reviewboard.mozilla.org/r/119044/
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg " height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16328 )
<!-- Reviewable:end -->
2017-04-10 04:04:54 -05:00
Brad Werth
bfc7e84767
Stylo: Add FFI interfaces for exposing style sources.
...
MozReview-Commit-ID: BlAb8sQ5WYl
2017-04-10 16:40:46 +08:00
Manish Goregaokar
25667d0321
stylo: Use gecko's font metrics
2017-04-10 14:29:51 +08:00
bors-servo
80f6160580
Auto merge of #16315 - jryans:at-page-stylo, r=xidorn
...
Stylo: @page support
Reviewed by upsuper in https://bugzilla.mozilla.org/show_bug.cgi?id=1345206 .
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg " height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16315 )
<!-- Reviewable:end -->
2017-04-09 21:47:59 -05:00
Manish Goregaokar
e402c72d0e
stylo: Store font metrics provider in thread local style context
2017-04-09 19:15:35 +08:00
J. Ryan Stinnett
a9ecebbe32
Servo glue for @page rule
...
Expose new glue functions and types on the Servo side for working with @page
rules from Gecko.
MozReview-Commit-ID: 5g13YldTr9
2017-04-09 17:49:44 +08:00
J. Ryan Stinnett
981571f4f8
Ignore non-margin properties in @page rule
...
Extend Servo's @page parsing to match Gecko's CSS 2.2 behavior, where only
margin properties are allowed in an @page rule. Other properties are ignored.
MozReview-Commit-ID: IPYUlnkLYSb
2017-04-09 17:49:41 +08:00
bors-servo
fd2b092839
Auto merge of #16312 - bholley:breadth_first_sequential, r=emilio
...
Make the sequential traversal breadth-first
Reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1354806
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg " height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16312 )
<!-- Reviewable:end -->
2017-04-09 01:55:09 -05:00
Bobby Holley
3f52052cf9
Do the sequential traversal breadth-first.
...
While we're at it, we also eliminate the 'unknown' dom depth for the
bloom filter. Computing depth has negligible cost relative to the
amount of work we do setting up the bloom filter at a given depth.
Doing it once per traversal should be totally fine.
I originally separated the elimination of unknown dom depth from the
traversal changes, but I got bloom filter crashes on the intermediate
patch, presumably because I didn't properly fix the sequential traversal
for this case. Given that the final state is green, I just decided to
squash and move on.
2017-04-09 14:52:49 +08:00
Cameron McCormack
3f71c80e2f
style: Handle TraversalRestyleBehavior::ForReconstruct in the Servo restyle.
2017-04-08 23:09:00 +08:00
Cameron McCormack
2bbeb21551
style: Move TraversalFlags into SharedStyleContext.
2017-04-08 23:07:35 +08:00
Xidorn Quan
da901bd2dc
Update cssparser in Cargo.toml.
2017-04-07 16:07:37 +10:00
Xidorn Quan
2820b7ac53
Move dummy url data to be a static member of URLExtraData.
2017-04-07 10:33:09 +10:00
Hiroyuki Ikezoe
c6ab7a31f0
Use underlying value for missing keyframes.
...
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.
2017-04-06 10:30:41 +09:00
Hiroyuki Ikezoe
6fe0a0e22e
Move stuff of KeyframeEffectReadOnly::ComposeStyleRule in Rust.
...
After this, we will implement additive or accumulative calculation
in this Rust function.
2017-04-06 10:30:40 +09:00
Hiroyuki Ikezoe
97aacb242e
Add an FFI function that returns an AnimationValue for a given nsCSSPropertyID from computed values.
...
When we compose style for a given nsCSSPropertyID in the case where
we have no specified values in target keyframe, we use this AnimationValue
for composition as if it's specified.
2017-04-06 10:30:28 +09:00
Hiroyuki Ikezoe
fb6aceba31
Add a function that returns a base computed values (i.e. computed values without any animations rules).
...
This base value will be used for additive, accumulative animations
and also SMIL.
2017-04-06 10:08:52 +09:00
Xidorn Quan
3d483a986d
Move DUMMY_URL_DATA to glue and use static to avoid shutdown leak.
2017-04-03 22:02:57 +10:00
Xidorn Quan
806d73e696
Stop passing in url as string for parsing.
2017-04-03 22:02:56 +10:00
Xidorn Quan
2628ebe612
Use final url for updating stylesheet from @import rule.
2017-04-03 21:57:17 +10:00
Xidorn Quan
37585309e9
Use a UrlExtraData type alias to unify url handling logic.
2017-04-03 21:57:16 +10:00
Xidorn Quan
a097a293b5
Pass CSS loader to Servo for insertRule.
2017-04-03 21:18:09 +10:00
Xidorn Quan
975043d0ce
Pass borrowed child stylesheet to Gecko for loading rather than the import rule.
2017-04-03 21:17:58 +10:00
Xidorn Quan
0a97a0df0c
Create URLExtraData for holding base uri, referrer, and principal.
2017-04-03 14:30:33 +10:00
bors-servo
955d3a8b87
Auto merge of #16201 - Manishearth:text-emph-pos, r=emilio
...
stylo: Handle text-emphasis-position pres attrs
Somehow slipped through the cracks.
try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=e1d349e847b528be3d61ad2ebf374a791800cfbb
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg " height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16201 )
<!-- Reviewable:end -->
2017-03-31 06:01:06 -05:00
Boris Chiou
dde0f32724
Bug 1352067 - Initialize StyleAnimationValue with zeros.
...
AnimationValue::mGecko and AnimationValue::mServo are mutually
exclusive, so we have to make sure mGecko.IsNull() returns reasonable
value, or we will got assertions. Hence, we should initialize it during
constructing StyleAnimationValue from Servo side.
2017-03-31 17:58:08 +08:00
Manish Goregaokar
59115431fb
stylo: Handle text-emphasis-position pres attrs
2017-03-31 02:43:22 -07:00
Cameron McCormack
df3cbb8104
geckolib: fix debug message about skipping traversal with an unstyled parent
2017-03-30 17:31:40 +08:00
Xidorn Quan
0a57dbc110
Provide @font-face rules for stylo backend.
2017-03-30 11:41:13 +11:00
Xidorn Quan
0d96c7997f
Support CSSOM access to @font-face rules.
2017-03-30 11:41:10 +11:00
Simon Sapin
4f2b9a33fe
Replace ParsedDeclaration::expand with non-generic method
...
... to reduce its code size impact.
https://bugzilla.mozilla.org/show_bug.cgi?id=1351737
2017-03-29 20:28:25 +02:00
bors-servo
8adf191973
Auto merge of #16159 - bholley:note_dirty_descendants, r=heycam
...
Centralize note_dirty_descendants implementation, and fully propagate dirty_descendants in resolve_style.
The current code can leave the tree in an inconsistent state, with the dirty
descendants bit not fully propagated.
Reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1350441
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg " height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16159 )
<!-- Reviewable:end -->
2017-03-29 06:52:07 -05:00
Cameron McCormack
13c49606a4
stylo: Add argument to Servo_ResolveStyle to allow stale styles to be returned.
2017-03-28 15:32:35 +08:00
Bobby Holley
7c58483aff
Centralize note_dirty_descendants implementation, and fully propagate dirty_descendants in resolve_style.
...
The current code can leave the tree in an inconsistent state, with the dirty
descendants bit not fully propagated.
MozReview-Commit-ID: ALI6etmlrDa
2017-03-27 20:43:24 -07:00
bors-servo
b6bc49225e
Auto merge of #16144 - emilio:number-calc, r=heycam
...
style: Make numbers keep track of whether they were specified as calc().
Fixes #15960
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg " height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16144 )
<!-- Reviewable:end -->
2017-03-27 06:13:39 -07:00
Emilio Cobos Álvarez
9e2977d49e
style: Fix Geckolib build.
2017-03-27 12:42:32 +02:00
Hiroyuki Ikezoe
e4fe416c9d
Process animation-only traversal.
...
All traversal processes are like this:
1. Traverse only elements that have this restyle hint (animation-only traversal)
RESTYLE_CSS_ANIMATIONS is stripped off from restyle hints of the elements
2. Traverse all dirty elements (normal traversal)
3. Create a SequentialTask if we have updated CSS Animations properties in
the normal traversal
4. Traverse elements that need to have updated animation style as a result of 3
(second animation-only traversal)
2017-03-27 06:19:51 +09:00
Hiroyuki Ikezoe
be332fe5a4
Add flag that represents the traversal is only for animation-only restyle.
...
We will set the flag when the root node of the traversal has
has-animation-only-dirty-descendants flag or has animation restyle hints.
Also we will use this flag to detect whether we need to trigger CSS transitions
or not.
2017-03-27 06:19:51 +09:00
Hiroyuki Ikezoe
499d1c4117
Introduce TraversalFlags to represents target elements of the traversal we are about to do.
2017-03-27 06:19:51 +09:00
Hiroyuki Ikezoe
749189bad5
Set has-animating-descendants bit to ancestors of element which has animations for eRestyle_CSSAnimations.
...
So we can traverse down dom tree to find element which needs animation-only
restyle to track this bit.
2017-03-27 06:19:51 +09:00
bors-servo
c99289a928
Auto merge of #16073 - glennw:update-wr-glfns, r=mrobinson
...
Update WR (gl trait, scroll roots)
<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg " height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16073 )
<!-- Reviewable:end -->
2017-03-23 03:43:49 -07:00