Commit graph

6718 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
35a1a30f6b
style: Remove invalid assertion.
We can look at stale styles while trying to figure out if we need any
invalidation, and that's ok.

Bug: 1449243
MozReview-Commit-ID: 4mBIFNm9qJv
2018-06-12 12:15:04 -07:00
Yusuf Sermet
ea5417b29c
style: Make contain:paint trigger clipping independent of the overflow property.
Bug: 1465250
Reviewed-by: mattwoodrow
MozReview-Commit-ID: 2QbfZD1jnWX
2018-06-12 12:15:03 -07:00
Matt Brubeck
f6404f0ec2 Update dependencies to use new_debug_unrechable
Because reem/rust-debug-unreachable#6 makes `debug_unreachable` enable debug checks even in release builds since Rust 1.0.
2018-06-06 08:54:51 -07:00
Emilio Cobos Álvarez
8777c4ee63
style: followup: set the rule type in the custom properties code, since we use it.
Though I think it may be slightly fishy if used in, e.g., a @keyframes block.

For our purposes right now it doesn't make a difference, I think.

Bug: 1466008
MozReview-Commit-ID: A7VCTOqaIuB
2018-06-02 12:08:58 +02:00
Emilio Cobos Álvarez
600f19540e
style: Make PropertyId::parse less of a footgun.
Bug: 1466095
Reviewed-by: xidorn
MozReview-Commit-ID: 2BmtSDPmHj9
2018-06-02 12:08:40 +02:00
Emilio Cobos Álvarez
5db1387f39
style: Make will-change honor prefs properly, and clean it up while at it.
Bug: 1466008
Reviewed-by: xidorn
MozReview-Commit-ID: JyzwaRgf5Ct
2018-06-02 12:08:25 +02:00
Nazım Can Altınova
93472bcdea
style: Merge ServoDeclarationBlock and DeclarationBlock.
Bug: 1464496
Reviewed-by: emilio
MozReview-Commit-ID: By9fV70Oq0K
2018-06-02 12:08:06 +02:00
Dan Glastonbury
4108b1b278
style: Change nscolor to StyleComplexColor in SVG properties.
Change mStopColor, mFloodColor, and mLightingColor in nsStyleSVGReset.

Bug: 1457353
Reviewed-by: xidorn
MozReview-Commit-ID: KMRMtHk1jNK
2018-06-02 12:07:42 +02:00
Morgan Rae Reschenberg
0bfd1dc5c0
style: Add contain:size and contain:content parsing functionality.
Bug: 1463589
Reviewed-by: emilio
MozReview-Commit-ID: 4fOqln3oOpC
2018-06-02 12:07:28 +02:00
Emilio Cobos Álvarez
5507d53611
style: Make element-backed pseudos inherit from NAC subtree roots and other NAC inherit from their parents.
Currently, NAC always inherits from the closest non-NAC ancestor element,
regardless of whether it is for an element-backed pseudo or not.

This patch changes the inheritance so that for element-backed pseudos, we
inherit from the closest native anonymous root's parent, and for other NAC we
inherit from the parent.

This prevents the following two issues and allows us to remove the
NODE_IS_NATIVE_ANONYMOUS flag:

 * Avoiding inheriting from the non-NAC ancestor in XBL bindings bound to NAC.

   - This is no longer a problem since we apply the rule only if we're a
     pseudo-element, and all pseudo-elements are in native anonymous subtrees.

   - This also allows to remove the hack that propagates the
     NODE_IS_NATIVE_ANONYMOUS flag from the ::cue pseudo-element from
     BindToTree.

 * Inheriting from the wrong thing if we're a nested NAC subtree.

   - We no longer look past our NAC subtree, with the exception of
     ::-moz-number-text's pseudo-elements, for which we do want to propagate
     ::placeholder to.

A few rules from forms.css have been modified because they're useless or needed
to propagate stuff to the anonymous form control in input[type="number"] which
previously inherited from the input itself.

Bug: 1460382
Reviewed-by: heycam
MozReview-Commit-ID: IDKYt3EJtSH
2018-06-02 12:07:07 +02:00
Emilio Cobos Álvarez
92e2adf45f
style: Cleanup transform animation.
Reviewed-by: hiro
But: 1465066
MozReview-Commit-ID: D9rq8CZIgf5
2018-06-02 12:06:22 +02:00
Emilio Cobos Álvarez
d5e19a146e
style: Some trivial cleanup.
Bug: 1464865
Reviewed-by: xidorn
MozReview-Commit-ID: 8ClaBR9ooGb
2018-06-02 12:06:05 +02:00
Emilio Cobos Álvarez
142c9eca4b
style: Don't let @namespace rules that aren't going to be inserted affect the namespace map.
Bug: 1464865
Reviewed-by: xidorn
MozReview-Commit-ID: 9bjlEBExqsr
2018-06-02 12:05:47 +02:00
Emilio Cobos Álvarez
e77a28d543
style: trivial TopLevelRuleParser construction cleanup.
MozReview-Commit-ID: 5CdOdQPZzyb
2018-06-02 12:05:41 +02:00
Hiroyuki Ikezoe
378fcc2b6a
style: Implement the smarter interporation for transform.
Corresponding to this spec change;
32812668df

The expected value in test_transitions_per_property.html can be calculated;

  'start' + ('end' - 'start') * 0.25

Bug: 1464647
Reviewed-by: birtles, emilio
MozReview-Commit-ID: NI9gOUuPnG
2018-06-02 12:05:11 +02:00
Yusuf Sermet
f0fbcf204e
style: Create a stacking context for contain:paint.
Bug: 1463599
Reviewed-by: mattwoodrow
MozReview-Commit-ID: Ln72MOlHXwi
2018-06-02 12:04:48 +02:00
Emilio Cobos Álvarez
f4cff20649
style: Appease tidy. 2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
38cbada278
style: Optimize QuerySelector in shadow trees.
Pretty much the same setup we have for document.

We have the awkwardness of having to check containing shadow manually for
ShadowRoot because it's not available in TNode (and making it available added a
bit more complexity that wasn't worth it IMO).

Bug: 1464428
Reviewed-by: xidorn
MozReview-Commit-ID: CqOh0sLHf6o
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
82e97b8ec5
style: The fix: scale and translate appropriately.
Loops are hard. This hasn't been the funniest Saturday evening.

Bug: 1459403
Reviewed-by: hiro
MozReview-Commit-ID: I8rfuIRIsrY
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
b199ca864a
style: Move skew and rotation application to their own scope for clarity.
The skew resetting of temp I think fixes a bug in presence of skew in every
direction, but again haven't double-checked.

Bug: 1459403
Reviewed-by: hiro
MozReview-Commit-ID: Bn93CoaG8Bu
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
66b8bd2829
style: Cleanup multiply().
We assign all the members, the result matrix doesn't really need to be any clone
of a.

Bug: 1459403
Reviewed-by: hiro
MozReview-Commit-ID: 3NkhvyfqQL
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
4c51624bcf
style: Add a FIXME comment which I think reveals a bug but I haven't confirmed it.
Bug: 1459403
Reviewed-by: hiro
MozReview-Commit-ID: DgCfqA5TNzP
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
875c4ff621
style: Cleanup and add references to decompose_3d_matrix.
Same, no functional change, but I basically rewrote this two times so...

Bug: 1459403
Reviewed-by: hiro
MozReview-Commit-ID: FXOnJDPyPu5
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
6ddb04a483
style: Cleanup and add references to Quaternion::animate.
No functional change, but I did this while searching for the bug.

Bug: 1459403
Reviewed-by: hiro
MozReview-Commit-ID: KsJxFoYaOq1
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
99d4e7b65c
style: Trivial cleanup.
Bug: 1459403
Reviewed-by: hiro
MozReview-Commit-ID: K7zVYGiYAn6
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
92b856b70a
style: Reuse computed rotate animation.
I have the feeling this fixes a bug, but...

Bug: 1464615
Reviewed-by: hiro
MozReview-Commit-ID: Aj478qCbMV9
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
2e500d70ef
style: Match rotate ops.
Per bug 1322189 we really should. I've copied the setup we have already for
translate / scale, but we should really clean this up a bit more I'd think.

In any case, probably skew should be matched as well...

Bug: 1464615
Reviewed-by: hiro
MozReview-Commit-ID: Jky5k8HVfuH
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
01f805af9f
style: Make the general setup for computed style bits nicer.
This patch:

 * Makes StyleStructID an enum class, and moves it to the mozilla namespaces.

 * Introduces StyleStructConstants with some constants scattered through the
   codebase.

 * Makes the computed style bits an enum class, and splits mPseudoType and mBits
   into their own members, since we were using a uint64_t when we have only a
   couple flags and CSSPseudoElementType is a byte. We statically assert that
   the number of style structs is less or equal to 32.

 * Makes mPseudoTag, mPseudoType and mBits const, since we don't want them to be
   mutated from C++, and we still need a few more refactorings (mostly getting
   rid of FinishStyle) to avoid mutating ComputedStyle instead.

Bug: 1464060
Reviewed-by: xidorn
MozReview-Commit-ID: 7qsTtASGcYB
2018-05-28 16:02:31 +02:00
Emilio Cobos Álvarez
6b19318cc8
style: Remove a bunch of unused style bits.
Bug: 1464060
MozReview-Commit-ID: FLACqfSHfSO
2018-05-28 15:39:28 +02:00
Emilio Cobos Álvarez
2c1ec89943
style: Cleanup single transform functions that can't really error.
Also call them "resolve" since it's the general term for computing something
more specific than what you have.

Though I don't feel strongly about that, feel free to push back.

Bug: 1464595
Reviewed-by: hiro
MozReview-Commit-ID: KtqjzlppZLp
2018-05-28 15:39:13 +02:00
Emilio Cobos Álvarez
8ad595666f
style: Use a static atom instead of a dynamic one.
MozReview-Commit-ID: CUTwfsCrovQ
2018-05-28 15:39:06 +02:00
Emilio Cobos Álvarez
a360dbf98d
style: Remove dead and unsafe code.
MozReview-Commit-ID: 9seuLNCJAqz
2018-05-28 15:38:56 +02:00
Xidorn Quan
8f367be650
style: Don't generate catch-all branch if a image layer keyword value is exhaustive.
Bug: 1463978
Reviewed-by: emilio
MozReview-Commit-ID: H8T9Low6kqY
2018-05-28 15:38:40 +02:00
Xidorn Quan
6306cc7e2d
style: Ensure modified_reset is set when {mutate,take}_reset_struct is called.
Bug: 1463603
Reviewed-by: heycam
MozReview-Commit-ID: 8mqVb7kl0ok
2018-05-28 15:38:22 +02:00
Emilio Cobos Álvarez
5fc6b47d74
followup: Add a comment regarding why a type is generic.
Bug: 1462829
Rubber-stamped-by: xidorn
MozReview-Commit-ID: 5DE8W2n1NP
2018-05-28 15:38:04 +02:00
Olli Pettay
f82bf81f8e
style: Make mBindingParent strong.
Bug: 1463116
Reviewed-by: bz
2018-05-28 15:37:47 +02:00
Emilio Cobos Álvarez
32c6d5b7c6
style: Refactor vector types.
This fixes clamping of mask-size and moves it out of mako while at it.

Bug: 1462829
Reviewed-by: hiro,xidorn
MozReview-Commit-ID: 9hiTe63odna
2018-05-28 15:37:28 +02:00
Xidorn Quan
3016a7f552
style: Add scrollbar-{face,track}-color properties.
Bug: 1460456
Reviewed-by: heycam
MozReview-Commit-ID: ImNfHHfzRdM
2018-05-28 15:37:12 +02:00
Xidorn Quan
1b236bf620
style: Rename CaretColor to ColorOrAuto for reusing.
Bug: 1460456
Reviewed-by: heycam
MozReview-Commit-ID: LD6PlNI60GC
2018-05-28 15:36:55 +02:00
Emilio Cobos Álvarez
b6a17426a0
style: Fix font-stretch animation.
This is a regression from #20506 which Gecko tests caught while trying to import
this.
2018-05-21 11:57:03 +02:00
Emilio Cobos Álvarez
fade636ebe
style: Fix Gecko build after #20506. 2018-05-20 20:12:30 +02:00
Mats Palmgren
34722c3de9
style: Inlinify display:list-item to display:inline for now, until we support 'display:inline list-item' properly.
Bug: 1461039
Reviewed-by: xidorn
2018-05-20 18:59:14 +02:00
Xidorn Quan
514aba51ad
style: Use RefPtr::new instead of RefPtr::from_ptr_ref + clone.
Bug: 1461858
Reviewed-by: emilio
2018-05-20 18:58:44 +02:00
Xidorn Quan
ecb2ec63de
style: Rename from_url_value_data to from_url_value and reuse URLValue passed in for ComputedUrl.
Bug: 1461858
Reviewed-by: emilio
MozReview-Commit-ID: LJGm3lUS9mD
2018-05-20 18:58:31 +02:00
Xidorn Quan
5b0903e604
style: Have from_image_request reuse ImageValue from image request directly.
And also remove ComputedImageUrl::from_url_value_data.

Bug: 1461858
Reviewed-by: emilio
MozReview-Commit-ID: 5zifQlU7tOz
2018-05-20 18:58:13 +02:00
Xidorn Quan
45a37503af
style: Make from_image_request infallible.
All callsites already assert, so moving the assertion into the method
should be fine. It is not expected to handle a null image value anyway.

Bug: 1461858
Reviewed-by: emilio
MozReview-Commit-ID: J8CA8m22eSv
2018-05-20 18:57:55 +02:00
Xidorn Quan
dc2aadd43a
style: Make creating CssUrl infallible.
There were a check in CssUrl::parse_from_string for extra data, which
was removed as part of servo/servo#16241, so it never fails now.

CssUrl::from_url_value_data doesn't seem to need Result from the very
beginning. It is unclear why it was made that way.

Bug: 1461858
Reviewed-by: emilio
MozReview-Commit-ID: LXzKlZ6wPYW
2018-05-20 18:57:35 +02:00
bors-servo
77dcc678fe
Auto merge of #20506 - jonleighton:font-fallback, r=emilio,mbrubeck
Font fallback

This implements more complete support for font fallback, see #17267.

r? @glennw @mbrubeck

<!-- 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/20506)
<!-- Reviewable:end -->
2018-05-19 09:53:29 -04:00
bors-servo
b536774fbf
Auto merge of #20786 - emilio:gecko-sync, r=emilio
style: Sync changes from mozilla-central.

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/20786)
<!-- Reviewable:end -->
2018-05-19 07:48:36 -04:00
Emilio Cobos Álvarez
2a5007926d
Fix Servo build. 2018-05-19 10:15:17 +02:00