Commit graph

253 commits

Author SHA1 Message Date
Jeremy Chen
adcd86deb2 stylo: Do not skip parent display-based style fixups for NAC that is not a NAC root
Stylo is currently skipping parent display-based style fixups for all NAC,
whereas we probably only want to do this for NAC roots.

In this patch, we ensure that we skip it for NAC roots, and pseudo-elements,
but not other NAC.
2017-08-31 10:28:02 +08:00
Emilio Cobos Álvarez
dcbe196ed5
style: Remove NODE_NEEDS_DIRTY_ON_VIEWPORT_SIZE_CHANGE.
Recascading is enough.
2017-08-28 14:40:48 +02:00
Bobby Holley
994074fca6 Clean up bit clearing. 2017-08-26 10:22:03 -07:00
Josh Matthews
1297c0ff51 Devirtualize CSS error reporting. 2017-08-24 10:41:06 -07:00
Bobby Holley
d4aa8e3cef Track the restyle root and use it to do less work during the traversal.
MozReview-Commit-ID: A8O3JOpsv4E
2017-08-22 19:34:46 -07:00
bors-servo
8ca9542de6 Auto merge of #18134 - servo:we-are-leaving-babylon, r=emilio
Introduce values::animated::Animate

<!-- 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/18134)
<!-- Reviewable:end -->
2017-08-22 07:22:10 -05:00
Emilio Cobos Álvarez
fcd6e79659
style: Inline a bunch of trivial stuff we're paying calls for in Geckolib. 2017-08-22 12:48:14 +02:00
Anthony Ramine
aea0cd7ec7 Introduce values::animated::Animate
This replaces the Animatable trait and merges its three former methods into a single one.
2017-08-22 09:41:01 +02:00
Emilio Cobos Álvarez
0f37b209cb
stylo: Remove a lot of the restyle damage related complexity.
The only reason why we had the `existing_style_for_style_damage` bit is to apply
some optimizations that we don't have anymore.

I still want to reintroduce a few of them, at least for the non-eager
pseudo-element case... But I think I won't need this at all.

This allows us to remove a fair amount of Gecko code too.
2017-08-20 13:59:46 +02:00
Simon Sapin
35282042bc geckolib: Fix some warnings (treated as error) new in Rust Nigthly 2017-08-17 15:59:33 +02:00
Ting-Yu Lin
ede8a23986 style: Move functions related to anonymous element to GeckoElement (Bug 1390773)
MozReview-Commit-ID: 6LqAPM86MQC
2017-08-17 10:50:34 +08:00
Ting-Yu Lin
0e82ca1d3a style: Skip matching :nth-child if element is the root of anonymous subtree
This implement the logic in Gecko's nsNthIndexCache::GetNthIndex().

MozReview-Commit-ID: 8lzK9iIbfzo
2017-08-16 14:25:01 +08:00
Bobby Holley
8a3761972d Bonus fix: Be more robust about clearing descendants bits under display:none subtrees.
MozReview-Commit-ID: 9KQVOpdEjwF
2017-08-15 14:25:50 -07:00
Hiroyuki Ikezoe
f6b8fb177c Check interpolatable to tell whether transition is created or not. 2017-08-15 13:03:18 +09:00
Bobby Holley
d8cba2959f Rearrange dirty noting to operate on the element rather than the parent.
This will allow us to scope restyle roots more tightly.

MozReview-Commit-ID: 2t2lp5sKBHH
2017-08-11 17:00:38 -07:00
Bobby Holley
24a52b7990 Do all descendant bit propagation from Gecko over FFI.
Deduplicating code is nice, and it will help us when we make the bit
propagation more complicated in upcoming patches.

MozReview-Commit-ID: KIQnNJVayrM
2017-08-11 17:00:37 -07:00
Xidorn Quan
d0179902bb Use namespace id instead of atom in synthesize_presentational_hints_for_legacy_attributes.
Using namespace id fixes this issue because in Gecko, the pref of MathML
(as well as SVG) works in the way that we choose a different namespace
id (the disabled id) for the elements. Those ids are mapped to the same
namespace atom as normal ids, which means if we use the atom, we would
treat the elements like normal mathml elements.
2017-08-10 16:38:28 +10:00
Emilio Cobos Álvarez
a7e45bba63
stylo: Fix skip_root_and_item_display_fixup.
The check isn't doing what the comment is saying.

XBL subtrees for video controls all have the
NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE flag, but not all of them are NAC
themselves, so we may incorrectly miss blockification.

Bug: 1366163
Reviewed-by: heycam
MozReview-Commit-ID: Oq3W258Lz2
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-08-08 11:57:47 +02:00
Manish Goregaokar
3947e2f698 Update stylo code to work on nightly 2017-08-03 14:26:55 -07:00
bors-servo
e07beacd4d Auto merge of #17944 - hiikezoe:display-property-animation, r=emilio
Display property animation for SMIL

<!-- Please describe your changes on the following line: -->
https://bugzilla.mozilla.org/show_bug.cgi?id=1385089

---
<!-- 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

<!-- 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/17944)
<!-- Reviewable:end -->
2017-08-02 16:27:58 -05:00
Manish Goregaokar
0e3f7d782b stylo: Disable text-zoom for <svg:text> 2017-08-02 10:25:55 -07:00
Hiroyuki Ikezoe
0841db70ee Set restyle subtree restyle hint if the element animates display style from 'none' to other.
When display style is changed from 'none' to other in animation-only restyle
we need to resolve descendant elements' style that were in the display:none
subtree.

Three possible ways to resolve the descendant elements' style;

1) Traversing unstyled elements in animation-only restyle
   We can't simply traverse unstyled elements in the animation-only restyle
   since when we decided to traverse the unstyled elements we don't know yet
   the elements will be initially styled or are in display:none subtree. It
   will result that the new elements are styled in animation-only restyle,
   it's undesirable.

2) Creating a SequentialTask and resolve the descendants' style with
   ServoStyleSet::StyleNewSubtree()
   We can't resolve the descendants' styles with ServoStyleSet::StyleNewSubtree()
   in SequentialTask since at the moment we are still in servo traversal (i.e.
   sInServoTraversal is true). That means AutoSetInServoTraversal fails
   in PrepareAndTraverseSubtree().

3) Creating a SequentialTask and set restyle subtree hint and defer descendants'
   restyle in a subsequent normal traversal
   Note that, when we process throttled animations flush, we don't process
   normal traversal so the descendants will not be traversed until normal
   restyle happens but it will not be a big problem since it's really rare
   that user clicks display animation element just at the right moment when
   display property changes from none to other.  Also, if it will be really
   a problem, we should process *only* transform animations on the compositor,
   it's ideally right thing to do. Display property never runs on the
   compositor.

This patch takes the third approach.
2017-08-02 18:35:01 +09:00
Hiroyuki Ikezoe
ffc01687e4 Move the logic for Servo_NoteExplicitHints into wrapper.rs.
In a subsequent patch in this series, we will call it from servo side.
2017-08-02 18:34:56 +09:00
Ehsan Akhgari
aeb2b8b098 stylo: Read mName as a raw nsIAtom* from NodeInfoInner. 2017-07-24 10:40:58 -04:00
Emilio Cobos Álvarez
4e0492c5d1
style: Move the RELEVANT_LINK_VISITED flag to servo.
And kill one GetParentAllowServo call while at it, and some other dumbness...

Bug: 1383307
Reviewed-by: Manishearth
2017-07-23 05:22:18 +02:00
Hiroyuki Ikezoe
48851135e8 Call may_have_animations() for parent element in the case where the target is pseudo element.
In case of pseudo elements ElementHasAnimations is set on the parent element.

updating-animation-on-pseudo-element.html fails without this patch, succeeds
with this patch.
2017-07-20 12:52:12 +09:00
Michael Partheil
b07ebbae6b Replace all uses of the style::stylearc alias with servo_arc.
The alias is left there temporarilly and will be removed completely in a later commit where
also components/style/gecko/generated/structs_{debug|release}.rs are re-generated (they still
use the old alias).
2017-07-19 09:29:05 +02:00
Manish Goregaokar
8eafe6a3b7 Fix tidy 2017-07-17 19:43:57 -07:00
Manish Goregaokar
89930e7565 stylo: Switch Gecko over to ServoStyleContext 2017-07-17 18:03:23 -07:00
Manish Goregaokar
74519cc1a7 stylo: Make Servo Arc types use ptr to T instead of ptr to ArcInner<T> 2017-07-17 18:03:09 -07:00
Emilio Cobos Álvarez
c606ec13e2
Bug 1377993: Make node slots less memory hungry in common cases. 2017-07-17 22:48:11 +02:00
Emilio Cobos Álvarez
bf9369b29d
script: Move the layout_wrapper outside of script.
This allows us to have ensure_data() and clear_data() functions on the TElement
trait, instead of hacking around it adding methods in random traits.

This also allows us to do some further cleanup, which I'd rather do in a
followup.
2017-07-15 16:41:12 +02:00
bors-servo
8fa2a262dc Auto merge of #17658 - emilio:nesting-level, r=bholley
selectors: Avoid looking at MatchingMode if the selector isn't the topmost.

Also, switch the hover quirk to the same mechanism.

Bug: 1379696
Reviewed-By: bholley
MozReview-Commit-ID: KrmNqNyASf6

<!-- 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/17658)
<!-- Reviewable:end -->
2017-07-10 19:16:35 -07:00
Emilio Cobos Álvarez
1f2b79bc30
selectors: Avoid looking at MatchingMode if the selector isn't the topmost.
Also, switch the hover quirk to the same mechanism.

Bug: 1379696
Reviewed-By: bholley
MozReview-Commit-ID: KrmNqNyASf6
2017-07-11 03:52:07 +02:00
Josh Matthews
a08371e8eb stylo: Create error reporters linked to documents (bug 1352669) 2017-07-10 20:46:08 -04:00
Gecko Backout
32269fa7cc Backed out changeset fec394734f83 (bug 17624) for build bustage a=backout CLOSED TREE
Backs out https://github.com/servo/servo/pull/17624
2017-07-06 21:58:15 +00:00
Josh Matthews
dc2a500f4b stylo: Create error reporters linked to documents (bug 1352669) 2017-07-06 14:05:52 -04:00
Fernando Jiménez Moreno
fc8d0eeae0 stylo: Implement ServoStyleRule::SelectorMatchesElement 2017-07-04 13:13:48 +02:00
Hiroyuki Ikezoe
4331112846 reduce 2017-07-03 15:11:42 +09:00
bors-servo
a24600d626 Auto merge of #17577 - mbrubeck:inactive, r=emilio
Bug 1348489 - stylo: Implement :-moz-window-inactive.

https://bugzilla.mozilla.org/show_bug.cgi?id=1348489

<!-- 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/17577)
<!-- Reviewable:end -->
2017-06-30 10:13:01 -07:00
Matt Brubeck
17f4d0c5d9 Bug 1348489 - stylo: Implement :-moz-window-inactive. 2017-06-30 09:31:01 -07:00
bors-servo
a04725fa1c Auto merge of #17569 - upsuper:fullscreen, r=emilio
Support :-moz-full-screen pseudo-class

This fixes [bug 1374901](https://bugzilla.mozilla.org/show_bug.cgi?id=1374901).

<!-- 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/17569)
<!-- Reviewable:end -->
2017-06-30 08:08:00 -07:00
Xidorn Quan
3ea38020f7 Support :-moz-full-screen pseudo-class 2017-06-29 15:44:30 -07:00
Gecko Backout
fb4e454df4 Backed out changeset 90036d4d378e (bug 17564) because gecko-side patch caused bustage on Windows. r=backout on a CLOSED TREE
Backs out https://github.com/servo/servo/pull/17564
2017-06-29 20:28:35 +00:00
Matt Brubeck
9cef18f6b5 Bug 1348489 - stylo: Implement :-moz-window-inactive. 2017-06-29 11:21:16 -07:00
Emilio Cobos Álvarez
02b61ed1a1
style: Refactor XBL rule matching to add another API to iterate the Stylists.
This will allow us to query the relevant stylists for invalidation.

Bug: 1375969
Reviewed-By: TYLin
MozReview-Commit-ID: EIIzbr2pEqN
2017-06-28 16:02:08 -07:00
Cameron McCormack
25dde5120c style: Use placement new/delete StyleChildrenIterator FFI functions.
MozReview-Commit-ID: L0bhymGJqRx
2017-06-28 11:59:13 -07:00
Cameron McCormack
07ede8cb2a style: Use faster check to determine whether a StyleChildrenIterator is needed.
MozReview-Commit-ID: KNmdtnlEmfc
2017-06-28 11:58:50 -07:00
Cameron McCormack
0b2b30f301 style: Remove unused TElement::children_and_traversal_children_might_differ.
MozReview-Commit-ID: GUmuxpdvAa8
2017-06-28 11:58:50 -07:00
Cameron McCormack
84c61fa15e style: Look to base XBL bindings for content too. r=bholley
MozReview-Commit-ID: DFep2S6jnWf
2017-06-28 11:58:50 -07:00