Commit graph

7885 commits

Author SHA1 Message Date
Anthony Ramine
5a4f8cf93f Update SpiderMonkey 2020-03-06 11:13:28 +01:00
bors-servo
813be91926
Auto merge of #25863 - servo:synup, r=jdm
Remove syn 0.15 from our crate graph
2020-03-05 10:03:48 -05:00
Anthony Ramine
9996e48500 Remove syn 0.15 from our crate graph (fixes #24421)
This required bumps of:

* gleam
* image
* rust-webvr
* webrender
* webxr
2020-03-05 13:01:13 +01:00
Fernando Jiménez Moreno
dc9a33f3a9 Generate ::before and ::after content from url() for layout2020 2020-02-28 15:00:07 +01:00
Fernando Jiménez Moreno
5b2d6c81b2 Generate ::before and ::after content from attr() for layout 2020 2020-02-25 10:47:48 +01:00
Fernando Jiménez Moreno
bc66948f7c Generate ::before and ::after string content for layout 2020 2020-02-25 10:47:48 +01:00
bors-servo
9c6897c967
Auto merge of #25818 - mrobinson:transforms, r=SimonSapin
Add initial support for transforms to layout_2020

---
<!-- 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
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2020-02-24 12:45:43 -05:00
Martin Robinson
80b29380f1 Add layout_2020 support for transformations 2020-02-21 17:07:09 +01:00
Josh Matthews
3fd3c23e17 Update ipc-channel and crossbeam-channel. 2020-02-20 11:15:13 -05:00
Martin Robinson
d03560b0f1 Add layout_2020 support for filters and mix-blend-mode 2020-02-19 10:26:13 +01:00
bors-servo
13ff7ce621
Auto merge of #25763 - mrobinson:stacking-contexts-v1, r=SimonSapin
Add initial support for stacking contexts to layout_2020

These changes add initial support for stacking contexts, enabling some parts of z-index to work properly.

---
<!-- 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
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2020-02-17 07:32:41 -05:00
Martin Robinson
4a2787b974 Add initial stacking context paint order support to layout_2020
This adds very rudimentary support for paint order in stacking context.
In particular z-index is now handled properly, apart from issues with
hoisted fragments.
2020-02-17 10:05:19 +01:00
Simon Sapin
708d3737df Upgrade to rustc 1.43.0-nightly (5d04ce67f 2020-02-13) 2020-02-14 12:27:14 +01:00
Simon Sapin
db4f27f361 Use the matches! macro from the standard library 2020-02-12 10:08:31 +01:00
Emilio Cobos Álvarez
d5b49f14da
style: Fix LengthPercentage on big-endian machines.
Always store the pointer in little-endian order so that the tag trick works.

Differential Revision: https://phabricator.services.mozilla.com/D61386
2020-02-12 02:43:24 +01:00
Emilio Cobos Álvarez
071ce6f345
style: Rustfmt recent changes. 2020-02-12 02:43:23 +01:00
Emilio Cobos Álvarez
f03026b869
layout: Resolve word_spacing ahead of time.
It's not possible anymore, in the presence of min() / max(), to split a
<length-percentage> value into a <length> and a <percentage> component.

Tweak word_spacing to do what Gecko does (resolving it in advance).
2020-02-12 02:43:23 +01:00
Emilio Cobos Álvarez
e227715aee
style: Miscellaneous Servo build fixes. 2020-02-12 02:43:23 +01:00
Emilio Cobos Álvarez
8c6fe09dce
style: Fix Servo build. 2020-02-12 02:43:22 +01:00
Emilio Cobos Álvarez
1a22fa7b1d
style: Make rust generate better code for some of the functions introduced here.
See https://github.com/rust-lang/rust/issues/68867.

Differential Revision: https://phabricator.services.mozilla.com/D61760
2020-02-12 02:43:22 +01:00
Emilio Cobos Álvarez
3e14422788
style: Add some calc infrastructure to deal with simplification / sorting / etc.
For now, we still bail out at the stage of getting the calc node into a
CalcLengthPercentage if we couldn't simplify the min() / max() / clamps()
involved.

After this plan is to use just CalcNode everywhere instead of
specified::CalcLengthPercentage, and then modify the computed
CalcLengthPercentage, which would look slightly different as we know all the sum
terms for those are a struct like { Length, Percentage, bool has_percentage } or
such, so all the simplification code for that becomes much simpler, ideally.

Or we could turn CalcNode generic otherwise, if it's too much code... We'll see.

Differential Revision: https://phabricator.services.mozilla.com/D61739
2020-02-12 02:43:21 +01:00
Emilio Cobos Álvarez
71b414f9dc
style: Make rust generate better code for derive(Animate) and derive(ComputeSquaredDistance).
See https://github.com/rust-lang/rust/issues/68867.

This technically changes the semantics of #[animate(fallback)] and such when
combined with #[animate(error)]. But no such combination exists and the new
semantics are perfectly reasonable as well, IMHO.

Differential Revision: https://phabricator.services.mozilla.com/D61761
2020-02-12 02:43:21 +01:00
Emilio Cobos Álvarez
6876fed6e0
style: Fix two issues with themed widgets in high contrast mode.
There were two issues with the existing code that we use to determine whether a
widget is styled or not.

First, it was using `color == Color::transparent()` instead of
`color.is_transparent()` to check for transparent backgrounds. That is not sound
as `Color::transparent()` is the literal value `rgba(0, 0, 0, 0)`, not the
`transparent` keyword, so the equality check would fail.

The other issue is that this function was early-returning false if that check
was returning false. It is a bug for this function to early-return false, as it
makes the result of the function dependent of the order of the declarations.

Differential Revision: https://phabricator.services.mozilla.com/D62060
2020-02-12 02:43:21 +01:00
Tim Nguyen
5ed8fe8ee2
style: Add AngleOrPercentage to style system.
Differential Revision: https://phabricator.services.mozilla.com/D62158
2020-02-12 02:43:21 +01:00
Emilio Cobos Álvarez
97382a2c41
style: Remove nsStyleImageRequest.
This removes nsStyleImageRequest by moving the load state to LoadData instead
(where other lazy state like the resolved URL and load id lives).

That way we can use cbindgen for more stuff (there's no blocker for using it for
all images now), and we can undo the image tracking shenanigans that I had to do
in bug 1605803 in nsImageFrame.

This removes the mDocGroup member because well, there's no real upside of that
now that quantum DOM is not a thing.

It also removes the static clones of the image requests, and the need for each
computed value instance to have its own request. These were needed because we
needed the image loader for the particular document to observe the image
changes. But we were also tracking the request -> loader for other purposes.
Instead, Now all the images get loaded with GlobalImageObserver as a listener,
which looks in the image map and forwards the notification to all the interested
loaders instead dynamically.

The style value is only responsible to load the image, and no longer tracks /
locks it. Instead, the loader does so, via the image tracker.

Differential Revision: https://phabricator.services.mozilla.com/D58519
2020-02-12 02:43:20 +01:00
Thomas Dolezal
07027fc923
style: style: convert ns style position defines to enum class.
Differential Revision: https://phabricator.services.mozilla.com/D61958
2020-02-12 02:43:20 +01:00
Emilio Cobos Álvarez
48eff19ff3
style: Don't use a binary tree representation for calc() sums / products.
Keep a flat list of sum members. Simpify product and division ASAP.

I want to preserve the tree for a bit longer to implement min / max / clamp.
This doesn't do anything for it that we weren't doing already, but it helps to
eventually keep this specified representation and the equivalent computed
representation for <length-percentage> values.

Enable the tests for the comparison functions too, to prevent regressions.

Differential Revision: https://phabricator.services.mozilla.com/D61514
2020-02-12 02:43:20 +01:00
Emilio Cobos Álvarez
b038924d44
style: Try to collect some more crash information so that we can diagnose this better.
Differential Revision: https://phabricator.services.mozilla.com/D59704
2020-02-12 02:43:19 +01:00
Jonathan Kew
df01cec675
style: Move the from-font value from text-underline-offset to text-underline-position, as per recent spec changes, and fix interaction between position and offset.
Differential Revision: https://phabricator.services.mozilla.com/D59778
2020-02-12 02:43:19 +01:00
Jonathan Kew
2910ca6197
style: Support percentage values for the CSS text-decoration-thickness and text-underline-offset properties.
Differential Revision: https://phabricator.services.mozilla.com/D59777
2020-02-12 02:43:19 +01:00
Tim Nguyen
127755551d
style: Remove nsGroupBoxFrame (display: -moz-groupbox).
Differential Revision: https://phabricator.services.mozilla.com/D61422
2020-02-12 02:43:19 +01:00
Thomas Dolezal
561de2f748
style: Converting empty-cells defines into enum class.
Differential Revision: https://phabricator.services.mozilla.com/D61398
2020-02-12 02:43:18 +01:00
Thomas Dolezal
625170ddd4
style: Replace transform style defines to an enum class.
Differential Revision: https://phabricator.services.mozilla.com/D61388
2020-02-12 02:43:18 +01:00
Emilio Cobos Álvarez
16fd7cad0c
style: Add a style flag for the root element style.
This is needed to make the root element not a containing block in presence of
filters or what not.

Differential Revision: https://phabricator.services.mozilla.com/D61167
2020-02-12 02:43:18 +01:00
Jonathan Kew
f426b644ca
style: Don't apply text-combine-upright in sideways-* writing modes.
Differential Revision: https://phabricator.services.mozilla.com/D61326
2020-02-12 02:43:18 +01:00
Thomas Dolezal
6682f725cf
style: Replacing table-layout defines with an enum.
Differential Revision: https://phabricator.services.mozilla.com/D61260
2020-02-12 02:43:17 +01:00
Emilio Cobos Álvarez
2bdcd766bb
style: Use cbindgen for css-align types.
This provides stronger typing and removes a bunch of subtle constants matching.

Differential Revision: https://phabricator.services.mozilla.com/D61058
2020-02-12 02:43:17 +01:00
Thomas Dolezal
41ae92e045
style: Convert image-rendering #defines to an enum class.
MANUAL PUSH: Contributor didn't use Phabricator and I don't want patch to rot
2020-02-12 02:43:17 +01:00
Martin McNickle
143184d807
style: Convert scroll-behavior #defines to an enum class.
Differential Revision: https://phabricator.services.mozilla.com/D61164
2020-02-12 02:43:17 +01:00
Martin McNickle
c447395c66
style: Convert mask-type #defines to an enum class.
Differential Revision: https://phabricator.services.mozilla.com/D60987
2020-02-12 02:43:16 +01:00
Emilio Cobos Álvarez
13d12d0d5f
style: Tweak background-color and color handling in ignored-colors mode.
We're resetting `color` to the default color when there's a declaration that
applies in order to make stuff like this:

<div style="color: transparent">
  <div style="color: red">
    Red
  </div>
</div>

To not show transparent. But the behavior we want is more like "override with
default color iff there's no other declaration that would set the color from an
user or UA sheet".

This implements that behavior, plus avoids it if we're not inheriting
from transparent, so that stuff like this preserves the behavior from before bug
844349:

<a href="foo">
  <span style="color: red">Should be the red color</span>
</a>

Differential Revision: https://phabricator.services.mozilla.com/D60391
2020-02-12 02:43:16 +01:00
Sakura Mochizuki
017d6f0416
style: Convert dominant-baseline #defines to an enum class.
Differential Revision: https://phabricator.services.mozilla.com/D61046
2020-02-12 02:43:16 +01:00
Boris Chiou
9aed1de6a5
style: Make the empty svg path valid.
Per SVG2 spec, the EBNF allows the path data string to be empty.
An empty path data string disables rendering of the path.
Therefore, we should make path('') a valid path string.

The related spec issue: https://github.com/w3c/fxtf-drafts/issues/392.
Now we serialize `path("")` as `path("")` for offset-path and clip-path.

Differential Revision: https://phabricator.services.mozilla.com/D60771
2020-02-12 02:43:15 +01:00
Emilio Cobos Álvarez
3991ab9999
style: Make direction use an enum class.
Differential Revision: https://phabricator.services.mozilla.com/D60857
2020-02-12 02:43:15 +01:00
Martin McNickle
55f76be5e2
style: Convert stroke-linejoin #defines to an enum class.
Differential Revision: https://phabricator.services.mozilla.com/D60865
2020-02-12 02:43:15 +01:00
Emilio Cobos Álvarez
16e5331950
style: Simplify calc expressions earlier.
This simplifies a bit the code, and guarantees that all calc()s have percentages
and lengths.

I also wanted to remove unclamped_length() / specified_percentage() (for the
same reason as the above patch), but they're needed for animations for now. When
I implement min() / max() for <length-percentage> they'll be fixed.

Differential Revision: https://phabricator.services.mozilla.com/D60194
2020-02-12 02:43:15 +01:00
Emilio Cobos Álvarez
5237d4fac8
style: Forbid accessing the length and percentage parts of a LengthPercentage separately.
This is just not a thing you can do if you have min() / max() / etc, as the min
/ max value may depend on the percentage basis.

Differential Revision: https://phabricator.services.mozilla.com/D60168
2020-02-12 02:43:14 +01:00
Emilio Cobos Álvarez
e7e6e62ed3
style: Remove font-size calc() hack to propagate keyword information.
It does not make any sense with min() / max() / clamp. So just forget the
keyword info when calc() is used. This also removes a bit of complex / hacky
code.

Differential Revision: https://phabricator.services.mozilla.com/D60663
2020-02-12 02:43:14 +01:00
Boris Chiou
83daa7484d
style: Use Serde for OffsetRotate and PositionOrAuto.
Differential Revision: https://phabricator.services.mozilla.com/D60088
2020-02-12 02:43:14 +01:00
Boris Chiou
2b3ef3ff37
style: Use Serde for SVGOffsetPath.
Differential Revision: https://phabricator.services.mozilla.com/D60087
2020-02-12 02:43:14 +01:00