Commit graph

141 commits

Author SHA1 Message Date
Simon Sapin
83c7824fda Simplify rust-selectors API for attribute selectors 2017-05-18 17:13:13 +02:00
Simon Sapin
2ca2c2d2be Fix [foo=bar i] selectors for Stylo 2017-05-18 17:13:12 +02:00
bors-servo
bafaae75f4 Auto merge of #16911 - emilio:bits, r=bzbarsky
Bug 1365471: Check bool flags before going through FFI in a variety of situations. r=bz

<!-- 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/16911)
<!-- Reviewable:end -->
2017-05-17 14:45:55 -05:00
bors-servo
c6c960a661 Auto merge of #16909 - emilio:simplify-cascade, r=bholley
style: Refactor the cascade function.

The `cascade_primary_or_pseudo` function was nice when we shared more code, but
right now I think it just makes it harder to understand what's going on.

<!-- 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/16909)
<!-- Reviewable:end -->
2017-05-17 11:19:56 -05:00
Emilio Cobos Álvarez
b420b80073
Bug 1365471: Check bool flags before going through FFI in a variety of situations. r=bz
MozReview-Commit-ID: E6mitc11tYa
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-17 18:06:30 +02:00
Emilio Cobos Álvarez
e8d1c5316d
style: Refactor the cascade function.
The `cascade_primary_or_pseudo` function was nice when we shared more code, but
right now I think it just makes it harder to understand what's going on.
2017-05-17 16:32:30 +02:00
Emilio Cobos Álvarez
522f8489d6
Bug 1364850: Move PseudoElement to be just another combinator in selectors. r=bholley
MozReview-Commit-ID: 8OoOIodkKJ5
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-17 10:58:24 +02:00
Boris Zbarsky
e03e9de6d0 Add :-moz-is-html support for stylo. 2017-05-16 14:33:44 -04:00
J. Ryan Stinnett
e385b81fc3 Create a MatchingContext to group related matching args
MozReview-Commit-ID: 7XZTn7HDXrm
2017-05-16 09:19:28 -05:00
Emilio Cobos Álvarez
5820e3ecac
Bug 1364412: Convert pseudo-elements to an enum. r=hiro,xidorn 2017-05-16 02:53:41 +02:00
Boris Zbarsky
c5cd84392f Implement :-moz-native-anonymous support in stylo.
Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1364591
2017-05-15 15:58:20 -04:00
bors-servo
94ac822132 Auto merge of #16819 - canaltinova:quirk-mode, r=bholley,emilio
stylo: Propagate quirks mode information from Gecko to Servo

r=bholley in bugzilla

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [Bug 1360488](https://bugzilla.mozilla.org/show_bug.cgi?id=1360488)

<!-- 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/16819)
<!-- Reviewable:end -->
2017-05-13 20:50:10 -05:00
Nazım Can Altınova
c54d255d07
stylo: Propagate quirks mode information from Gecko to Servo 2017-05-14 01:51:50 +03:00
bors-servo
52240c21d9 Auto merge of #16831 - heycam:autofill, r=emilio
style: Support :-moz-autofill and :-moz-autofill-preview in Gecko.

<!-- 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/16831)
<!-- Reviewable:end -->
2017-05-12 17:32:21 -05:00
bors-servo
875b07b4ec Auto merge of #16826 - hiikezoe:check-animation-flag, r=birtles
Check ElementHasAnimations flag in rust side.

We can bail out earlier before calling an FFI function.
This is a PR for https://bugzilla.mozilla.org/show_bug.cgi?id=1364264 .

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes do not require tests because it's for stylo

<!-- 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/16826)
<!-- Reviewable:end -->
2017-05-12 12:35:52 -05:00
Emilio Cobos Álvarez
2ffffcfdce
Bug 1364377: Fix inheritance of NAC, and selector-matching of pseudo-implementing NAC. r=bholley
MozReview-Commit-ID: DjSyaWHq1Xj
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-12 13:07:29 +02:00
Cameron McCormack
bc685fde68 style: Support :-moz-autofill and :-moz-autofill-preview in Gecko. 2017-05-12 17:36:37 +08:00
bors-servo
48fdda3f07 Auto merge of #16785 - aethanyc:fix-typo-and-simplify, r=mbrubeck
Fix typo and simplify for PresentationalHintsSynthesizer

<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes do not require tests because it only affects build.

<!-- 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/16785)
<!-- Reviewable:end -->
2017-05-12 02:41:25 -05:00
Hiroyuki Ikezoe
652c2153a4 Check ElementHasAnimations flag in rust side.
We can bail out earlier before calling an FFI function.
2017-05-12 12:07:26 +09:00
Bobby Holley
2ee99ddf10 Handle mBoolFlags living on nsWrapperCache. 2017-05-11 11:36:59 +02:00
Ting-Yu Lin
dd5f73750c Fix typo for PresentationalHintsSynthesizer 2017-05-10 11:28:26 -07:00
Emilio Cobos Álvarez
46bf5d61f0
Bug 1355343: Take all the snapshots into account. r=bholley
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
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-10 12:05:39 +02:00
Emilio Cobos Álvarez
7d45aad9b4
Bug 1355343: Move node restyle bits to Element, and add bits for snapshot handling. r=bholley
MozReview-Commit-ID: 6OrUKX5RcBq
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-05-10 12:05:38 +02:00
Emilio Cobos Álvarez
29c52cc61b
stylo: Fix nsCOMPtr release bindings. 2017-05-09 00:46:27 +02:00
Cameron McCormack
aa9bb07a93 style: Re-enable font metrics querying for ch and ex units in Stylo traversal. 2017-05-04 16:22:08 +08:00
Bobby Holley
d78ca4c4f9 Use StyleArc in the style system.
MozReview-Commit-ID: flF0fv9E9M
2017-05-02 17:35:44 -07:00
Hiroyuki Ikezoe
83a4935b60 Pass AnimationValueMap raw pointer instead of Arc to Gecko_GetAnimationRule() 2017-05-01 19:23:34 +09:00
bors-servo
d8bcc0db1a Auto merge of #16609 - nox:quirks, r=Manishearth,emilio
Implement unitless length quirk

The Gecko side doesn't propagate its quirks mode yet.

<!-- 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/16609)
<!-- Reviewable:end -->
2017-04-27 22:32:24 -05:00
Emilio Cobos Álvarez
be0139ff3c
Bug 1331047: Implement the new traversal semantics for stylo. r=bholley,hiro
MozReview-Commit-ID: 4BXx9JpGZKX
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-04-27 14:26:48 +02:00
Anthony Ramine
f68e2fded9 Propagate quirks mode all the way to ParserContext
The quirks mode is still not properly propagated in geckolib.
2017-04-27 10:41:55 +02:00
Brian Birtles
2c3c9d673d Get SMIL override styles from Gecko 2017-04-27 13:20:23 +09:00
Boris Chiou
02fc1789e8 Bug 1357357 - Make the parser of transition-property match the spec.
1. We add a new arm to TransitionProperty, TransitionProperty::Unsupported,
   which contains an Atom, so it's better to remove the Copy trait from
   TransitionProperty.
2. TransitionProperty::Unsupported(Atom) represents any non-animatable, custom,
   or unrecognized property, and we use Atom to store the ident string for
   serialization.
2017-04-26 21:35:05 +08:00
Simon Sapin
7fe57ecaea Rename StdoutErrorReporter to RustLogReporter. 2017-04-24 08:23:41 +02:00
Hiroyuki Ikezoe
1e94663b26 Fix parent element of pseudo element for updating animation 2017-04-24 11:39:08 +09:00
Bobby Holley
60f846b2ca Remove unused StyleRelations.
MozReview-Commit-ID: ed0NiuY9Ek
2017-04-23 12:41:21 -07:00
bors-servo
355d5f89da Auto merge of #16527 - BorisChiou:stylo/transition/shorthands, r=emilio
stylo: Bug 1353628 - Support shorthand properties for CSS Transition.

These patches add shorthand properties into TransitionProperty, so we can parse the shorthand properties properly and create transitions for them.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix Bug 1353628
- [X] There are tests for these changes

<!-- 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/16527)
<!-- Reviewable:end -->
2017-04-19 07:35:09 -05:00
Boris Chiou
a06ce4a6aa Bug 1353628 - Part 1: Add shorthand properties into TransitionProperty.
In order to make TransitionProperty::parse() also work on shorthands, we
should add shorthands into TransitionProperty, and add the arms in other
functions which match TransitionProperty.

MozReview-Commit-ID: KFd26KcQf3N
2017-04-19 17:42:24 +08:00
Bobby Holley
9524c5cb57 Introduce SelectorInner and use it for top-level matching.
MozReview-Commit-ID: DxG6USsPIkh
2017-04-18 20:07:53 -07:00
Boris Chiou
eb8db7b892 Bug 1341372 - Part 6: Trigger transitions.
1. We need to call get_after_change_style, which is the computed styles
   without transition rules, while process_animations.
2. If we have after-change style, we may replace the new computed values with
   after-change style, according to whether we really need to update
   transitions.
3. There are some cases we don't update transitions, so we need to early
   return. might_needs_transitions_update() will check it first and it
   will filter out most common cases.
4. needs_transitions_update() will check each property and existing running
   transitions to make sure we really don't need to update transitions.
   The logic of this function is similar with that of
   nsTransitionManager::DoUpdateTransitions().

MozReview-Commit-ID: 2ccdPjgrxKz
2017-04-17 17:08:54 +08:00
Boris Chiou
b1476f1f81 Bug 1341372 - Part 2: Support has_css_transitions.
Add one FFI 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: 6HpVAtrx6Rc
2017-04-17 17:06:31 +08:00
Boris Chiou
1c1e487491 Bug 1341372 - Part 1: Let animation-only restyle include css-transition.
Animation-only restyle should include both Animation and Transition
cascade levels.

MozReview-Commit-ID: 5l6gaJKbixM
2017-04-17 17:06:12 +08:00
Bobby Holley
297dc33a9f Store slow selector flags in a hashmap.
This reduces the flag setting overhead on a pessimal testcase from over a
second to ~20ms.
2017-04-13 21:52:47 +08:00
Manish Goregaokar
f506c6bcd1 stylo: Disable font metrics 2017-04-13 13:55:25 +08:00
Boris Chiou
9a3905f834 Bug 1343753 - Pass None before change style to Gecko_UpdateAnimations.
CSS Transition is not supported yet, so use None as the parameter.

MozReview-Commit-ID: Kv77lN92ny5
2017-04-12 18:32:51 +08:00
Manish Goregaokar
25667d0321 stylo: Use gecko's font metrics 2017-04-10 14:29:51 +08:00
Manish Goregaokar
2febe7ccde stylo: Use font metrics provider as a cache for font size results 2017-04-09 19:15:37 +08:00
Manish Goregaokar
e402c72d0e stylo: Store font metrics provider in thread local style context 2017-04-09 19:15:35 +08:00
Cameron McCormack
581cefccfe stylo: Don't leak the nsIAtom we get back from Gecko_GetXMLLangValue. 2017-04-05 17:39:40 +08:00
Manish Goregaokar
5d6bc8177e stylo: Add support for xml:lang
MozReview-Commit-ID: E0GpyPKES3k
2017-04-04 21:21:28 -07:00
Manish Goregaokar
8dea66e6f1
stylo: Add support for <math> default language
MozReview-Commit-ID: LhhSBzYjow5
2017-04-04 21:17:06 -07:00