Commit graph

1362 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
001653080d
style: Update bindings. 2018-02-05 11:54:02 +01:00
Emilio Cobos Álvarez
1804f135ec
style: Optimize @keyframes rule insertions.
Bug: 1435214
Reviewed-by: xidorn,hiro
MozReview-Commit-ID: AHwhZynLBv
2018-02-05 11:54:01 +01:00
bors-servo
dcd13b857c
Auto merge of #19918 - emilio:font-stuff-is-a-mess, r=nox
style: Refactor font-feature-settings and font-variation-settings.

This fixes all known issues with serialization and parsing of these two
properties, and in particular calc handling and such:

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

Also does a fair amount of cleanup and all that, which was needed, this code
was a mess.

There are further cleanups that can be done, like renaming the
font-variation-settings animation stuff.

<!-- 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/19918)
<!-- Reviewable:end -->
2018-02-01 06:45:20 -06:00
Emilio Cobos Álvarez
3b34d734e6
style: Refactor font-feature-settings and font-variation-settings.
This fixes all known issues with serialization and parsing of these two
properties, and in particular calc handling and such:

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

Also does a fair amount of cleanup and all that, which was needed.
2018-02-01 12:54:45 +01:00
Anthony Ramine
09e304adb3 Rename FillRule variants to follow the same rules as other enums 2018-02-01 12:43:29 +01:00
Anthony Ramine
3fba02a0d6 Fix naming of ExtremumLength variants 2018-02-01 10:04:27 +01:00
Emilio Cobos Álvarez
09398d42af
style: Move a bunch of font stuff living under generics to the proper module.
FontSettingsTagInt and such shouldn't be in the generic module, I know...

But that will change in a bit.
2018-02-01 02:35:33 +01:00
Emilio Cobos Álvarez
1380f1a14f
style: Remove the stupid space serialization on font-settings. 2018-02-01 02:35:32 +01:00
Brian Birtles
a8c133d07e Update bindings 2018-01-31 21:10:10 +00:00
Emilio Cobos Álvarez
4d84200c8b
style: Update bindings. 2018-01-31 11:28:06 +01:00
Emilio Cobos Álvarez
0466e0b2bc
style: Make GeckoElement::has_class more specialized.
Bug: 1431421
Reviewed-by: xidorn
MozReview-Commit-ID: 7LiSEamTCkX
2018-01-31 11:26:13 +01:00
Emilio Cobos Álvarez
61e60a87e5
selectors: Never match ::slotted on <slot>s.
This fixes the test from https://github.com/w3c/web-platform-tests/pull/9212 in
Gecko.
2018-01-27 17:57:17 +01:00
Emilio Cobos Álvarez
2d395a48aa
style: Update bindings.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2018-01-27 03:18:32 +01:00
Emilio Cobos Álvarez
657d8b8e31
style: Look at the snapshots when invalidating due to stylesheet changes.
Otherwise removal of stylesheets may get out of sync with other DOM changes, and
we may fail to invalidate the style of the affected elements.

Bug: 1432850
Reviewed-by: bz
MozReview-Commit-ID: DrMTgLzQcnk
2018-01-27 02:34:27 +01:00
bors-servo
6b2e5283c9 Auto merge of #19838 - servo:rm-sequence-writer-as-it-was, r=emilio
Make ToCss' SequenceWriter not monomorphise like a maniac anymore

<!-- 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/19838)
<!-- Reviewable:end -->
2018-01-23 12:03:41 -06:00
Emilio Cobos Álvarez
cd04664fb9
style: Use CascadeFlags for what they're for.
Now that we have an Element around on cascade, we can stop using the cascade
flags mechanism to pass various element-related state, like "is this element the
root", or "should it use the item-based display fixup".

That fixes handwaviness in the handling of those flags from style reparenting,
and code duplication to handle tricky stuff like :visited.

There are a number of other changes that are worth noticing:

 * skip_root_and_item_based_display_fixup is renamed to skip_item_display_fixup:

   TElement::is_root() already implies being the document element, which by
   definition is not native anonymous and not a pseudo-element.

   Thus, you never get fixed-up if your NAC or a pseudo, which is what the code
   tried to avoid, so the only fixup with a point is the item one, which is
   necessary.

 * The pseudo-element probing code was refactored to return early a
   Option::<CascadeInputs>::None, which is nicer than what it was doing.

 * The visited_links_enabled check has moved to selector-matching time. The rest
   of the checks aren't based on whether the element is a link, or are properly
   guarded by parent_style.visited_style().is_some() or visited_rules.is_some().

   Thus you can transitively infer that no element will end up with a :visited
   style, not even from style reparenting.

Anyway, the underlying reason why I want the element in StyleAdjuster is because
we're going to implement an adjustment in there depending on the tag of the
element (converting display: contents to display: none depending on the tag), so
computing that information eagerly, including a hash lookup, wouldn't be nice.
2018-01-23 13:18:54 +01:00
Anthony Ramine
cd8f96cc9e Change ToCss to take a CssWriter<W>
This more concrete wrapper type can write a prefix the very first time something
is written to it. This allows removing plenty of useless monomorphisations caused
by the former W/SequenceWriter<W> pair of types.
2018-01-23 10:41:42 +01:00
Bobby Holley
5526947500 Avoid the generic writer parameter for PropertyDeclaration serialization.
MozReview-Commit-ID: JR3IcL1NRHO
2018-01-22 14:58:05 -08:00
Emilio Cobos Álvarez
1183b47e69
style: Update bindings. 2018-01-22 16:12:36 +01:00
Emilio Cobos Álvarez
3d5bd40766
style: Update bindings. 2018-01-22 13:40:43 +01:00
Emilio Cobos Álvarez
d14c979fb2
Revert "style: Remove new function added to the build from bindings.rs"
This reverts commit 8c0e455d9e.
2018-01-20 02:10:59 +01:00
Emilio Cobos Álvarez
e74fad6259
style: Handle correctly document state invalidation inside negation. 2018-01-20 02:10:57 +01:00
Emilio Cobos Álvarez
8e25c9e674
style: Track the visited-handling-mode on the MatchingContext.
Instead of on the stack.

This fixes bugs where we're not passing the value around correctly, like from
::-moz-any.

This is a fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1431539.
2018-01-19 13:22:37 +01:00
Emilio Cobos Álvarez
e4f08ee2bb
selectors: Add a MatchingContext::nest function, make nesting_level private. 2018-01-19 12:40:17 +01:00
Emilio Cobos Álvarez
8c0e455d9e
style: Remove new function added to the build from bindings.rs
Since it was removed from gecko, and this confuses a lot to
ports/geckolib/tests/build.rs.
2018-01-18 03:33:42 +01:00
Emilio Cobos Álvarez
3cd4f5780f
style: Update bindings. 2018-01-17 18:03:17 +01:00
Emilio Cobos Álvarez
75af7c0b41
style: Make Gecko's media query evaluation work with a document, not a pres context.
Returning a zero-sized viewport in the case there's no shell / pres context.

For now, no other change yet. After this we can start tweaking the ShadowRoot
Stylist setup, and even try to return computed styles without a document \o/.

Bug: 1430608
MozReview-Commit-ID: 3cT2PKQISri
2018-01-17 14:36:04 +01:00
Emilio Cobos Álvarez
e55bb3e76d
style: Always inline GeckoElement::has_class.
It's easier, and probably faster, than trying to inline the function call to
Gecko.

This symbol is in libxul.so as of right now.
2018-01-16 22:14:11 +01:00
Emilio Cobos Álvarez
1e72a12265
style: Pull out the branch from snapshot_helpers::has_class.
I've verified that current libxul, at least for Linux, doesn't manage to pull
the branch out.
2018-01-16 21:38:31 +01:00
Emilio Cobos Álvarez
1c1f9c94fd
style: update bindings. 2018-01-16 15:49:50 +01:00
Jessica Jong
2e532b8e00 style: Update shadow dom preference. 2018-01-16 17:52:50 +08:00
Bobby Holley
f858ce91e8 Avoid entraining various Debug impls in release builds.
MozReview-Commit-ID: Lp9i9EI5qdU
2018-01-13 09:51:46 -08:00
bors-servo
6ca651c0c8 Auto merge of #19751 - servo:selectors, r=bholley
Clean up the selectors crate for a new crates.io release

<!-- 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/19751)
<!-- Reviewable:end -->
2018-01-12 16:55:12 -06:00
Bobby Holley
ac74cf7a60 Add machinery to assert single-threadedness from geckolib.
MozReview-Commit-ID: 9LBNm2h5Ct3
2018-01-12 10:19:06 -08:00
Simon Sapin
c14b766ff5 Rename SelectorMethods to Visit, after its one method. 2018-01-12 15:26:56 +01:00
bors-servo
50e4171958 Auto merge of #19747 - emilio:doc-state-invalidator, r=upsuper
style: Add a document state invalidator.

Don't use it yet (since I was working from a Servo tree). Will hook it up and improve in the Gecko bug.

Right now it takes a `StyleRuleCascadeData`, which means that if all the origins in the document have state selectors we could do just one walk over the tree and not multiple, that will be improved.

Other than that, this is completely untested of course, but I prefer to land it, given I don't think it's complex, and work on the Gecko integration separately. The reason for this is that I also plan to fix the `<slot>` bugs, which will change `StyleRuleCascadeData` and such, and I want the two bugs to conflict as little as possible.

<!-- 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/19747)
<!-- Reviewable:end -->
2018-01-12 05:09:04 -06:00
Emilio Cobos Álvarez
335ca47361
style: Use Default for ExtraStyleData instead of Option. 2018-01-12 12:08:47 +01:00
Emilio Cobos Álvarez
5b7d9eb94a
style: Add a document state invalidator. 2018-01-12 12:08:42 +01:00
Emilio Cobos Álvarez
cb1a951477
style: Allow storing a DocumentState for invalidation. 2018-01-12 12:08:39 +01:00
Emilio Cobos Álvarez
1e27f2883b
selectors: Allow defining an implementation-dependent field in the matching context. 2018-01-12 12:08:38 +01:00
Bobby Holley
fd41646699 Adjust size of gecko ComputedValues struct for removal of separate lazy pseudo cache. 2018-01-11 10:15:35 -08:00
Emilio Cobos Álvarez
b6a2bff032
style: Move :-moz-locale-dir matching to rust. 2018-01-11 14:47:29 +01:00
Edgar Chen
4c778b34e6 style: Remove :unsolved pseudo-class
This is the servo part changes of https://bugzilla.mozilla.org/show_bug.cgi?id=1417829.
2018-01-10 17:20:06 +08:00
Emilio Cobos Álvarez
bfc91c5e12
style: Update bindings. 2018-01-09 14:26:06 +01:00
Emilio Cobos Álvarez
d88696023f
style: Parse ::slotted() if the webcomponents pref is on.
Bug: 1425834
Reviewed-by: heycam
MozReview-Commit-ID: IOFneIgu7Rm
2018-01-09 14:26:05 +01:00
Emilio Cobos Álvarez
b26f3280d2
style: Add invalidation support for ::slotted().
Bug: 1424607
Reviewed-by: heycam
MozReview-Commit-ID: 8pIVUx27o7x
2018-01-09 14:26:02 +01:00
Emilio Cobos Álvarez
040379208e
style: Implement GeckoElement::assigned_slot.
This allows to selector-match ::slotted, though we still don't parse it.

Bug: 1425755
Reviewed-by: heycam
MozReview-Commit-ID: ItELHkf2PMl
2018-01-08 19:01:41 +01:00
Emilio Cobos Álvarez
f3ea248188
style: Remove TNode::set_can_be_fragmented and TNode::can_be_fragmented.
Replace them instead by a computed value flag, the same way as the
IS_IN_DISPLAY_NONE_SUBTREE flag works.
2018-01-04 14:45:54 +01:00
bors-servo
f71fb8bddc Auto merge of #19654 - emilio:geckolib-nightly, r=jdm
style: Allow building stylo with rust nightly.

See individual commits for details.

<!-- 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/19654)
<!-- Reviewable:end -->
2018-01-03 12:01:42 -06:00
Emilio Cobos Álvarez
51e2942c25
style: Make GetFlattenedTreeParent more straight-forward.
Now that accessing nsIContent slots is not a blob of virtual function calls, we
should be able to unify logic here, and speed up the not-so-rare case for
chrome, while keeping the usual case fast.

Bug: 1427511
Reviewed-by: smaug
MozReview-Commit-ID: 87iY5Cbhx4T
2018-01-02 16:25:59 +01:00