Commit Graph

13083 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
d7841a5f17 Bug 1614208 - Remove some include dependencies in nsStyleConsts.h. r=jfkthame,jgilbert
We include it everywhere because it's included from gfxTypes.h.

This should avoid including all the generated bindings _everywhere_.

Differential Revision: https://phabricator.services.mozilla.com/D62174

--HG--
extra : moz-landing-system : lando
2020-02-11 01:23:37 +00:00
Emilio Cobos Álvarez
52d630ef26 Bug 1614198 - Remove trait bound and comment that snuck from a previous patch accidentally in a CLOSED TREE
MANUAL PUSH: Fixing accidental Lando-relanding of previous version of the patch.
2020-02-10 21:17:59 +01:00
Emilio Cobos Álvarez
d6aacafdfd Bug 1614198 - Merge ImageLayer and Image. r=heycam
ImageLayer is almost the only usage of Image, so keeping them in the same enum
makes the resulting C++ struct smaller, and makes it map more cleanly to
nsStyleImage.

Differential Revision: https://phabricator.services.mozilla.com/D62161

--HG--
extra : moz-landing-system : lando
2020-02-10 20:02:31 +00:00
Mihai Alexandru Michis
a53731fa59 Backed out changeset a3695dec8b66 (bug 1614198) for causing bustages in ImageLayer
CLOSED TREE
2020-02-10 21:48:26 +02:00
Emilio Cobos Álvarez
0ca6f95831 Bug 1614198 - Merge ImageLayer and Image. r=heycam
ImageLayer is almost the only usage of Image, so keeping them in the same enum
makes the resulting C++ struct smaller, and makes it map more cleanly to
nsStyleImage.

Differential Revision: https://phabricator.services.mozilla.com/D62161

--HG--
extra : moz-landing-system : lando
2020-02-10 19:25:40 +00:00
Emilio Cobos Álvarez
ec32f37af9 Bug 1614394 - Cherry-pick some more formatting changes.
Differential Revision: https://phabricator.services.mozilla.com/D62317

--HG--
extra : moz-landing-system : lando
2020-02-10 18:18:27 +00:00
Emilio Cobos Álvarez
888338d969 Bug 1614394 - Cherry-pick a selectors version bump.
Differential Revision: https://phabricator.services.mozilla.com/D62309

--HG--
extra : moz-landing-system : lando
2020-02-10 17:32:37 +00:00
Emilio Cobos Álvarez
89edad17e0 Bug 1614394 - Remove now unused dependency from the style system.
Differential Revision: https://phabricator.services.mozilla.com/D62308

--HG--
extra : moz-landing-system : lando
2020-02-10 17:32:35 +00:00
Emilio Cobos Álvarez
93611990a4 Bug 1614394 - Rustfmt recent changes.
Differential Revision: https://phabricator.services.mozilla.com/D62307

--HG--
extra : moz-landing-system : lando
2020-02-10 17:32:27 +00:00
Emilio Cobos Álvarez
f811ee2f3b Bug 1614394 - Fix Servo build.
Differential Revision: https://phabricator.services.mozilla.com/D62306

--HG--
extra : moz-landing-system : lando
2020-02-10 17:32:25 +00:00
Emilio Cobos Álvarez
217f3f86df Bug 1614394 - Cherry-pick some servo-2020 changes to the style system.
Differential Revision: https://phabricator.services.mozilla.com/D62305

--HG--
extra : moz-landing-system : lando
2020-02-10 17:32:18 +00:00
Patrick Shaughnessy
00d66a376a Bug 1614394 - Cherry-pick Servo changes for :defined support.
Differential Revision: https://phabricator.services.mozilla.com/D62304

--HG--
extra : moz-landing-system : lando
2020-02-10 17:32:15 +00:00
Emilio Cobos Álvarez
9ec744b313 Bug 1614394 - Implement num_traits::Zero for CSSPixelLength.
Differential Revision: https://phabricator.services.mozilla.com/D62303

--HG--
extra : moz-landing-system : lando
2020-02-10 17:32:13 +00:00
Simon Sapin
583c7b9d38 Bug 1614394 - Move OpaqueNode to style_traits.
Differential Revision: https://phabricator.services.mozilla.com/D62302

--HG--
extra : moz-landing-system : lando
2020-02-10 17:32:11 +00:00
Emilio Cobos Álvarez
741ec04a23 Bug 1614394 - Cherry-pick some servo-only changes to malloc_size_of.
Differential Revision: https://phabricator.services.mozilla.com/D62301

--HG--
extra : moz-landing-system : lando
2020-02-10 17:32:09 +00:00
Simon Sapin
dd3ef574ef Bug 1614394 - Parse -moz-image-rect() and -moz-element() only in Gecko.
Differential Revision: https://phabricator.services.mozilla.com/D62300

--HG--
extra : moz-landing-system : lando
2020-02-10 17:32:07 +00:00
Emilio Cobos Álvarez
44abf87d9d Bug 1612301 - Fix LengthPercentage on big-endian machines. r=jfkthame
Always store the pointer in little-endian order so that the tag trick works.

Differential Revision: https://phabricator.services.mozilla.com/D61386

--HG--
extra : moz-landing-system : lando
2020-02-10 17:12:44 +00:00
Emilio Cobos Álvarez
4103cf7f51 Bug 1613491 - Make rust generate better code for some of the functions introduced here. r=heycam
See https://github.com/rust-lang/rust/issues/68867.

Differential Revision: https://phabricator.services.mozilla.com/D61760

--HG--
extra : moz-landing-system : lando
2020-02-10 14:09:38 +00:00
Emilio Cobos Álvarez
7e238a47ba Bug 1613491 - Add some calc infrastructure to deal with simplification / sorting / etc. r=heycam
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

--HG--
extra : moz-landing-system : lando
2020-02-10 14:09:27 +00:00
Emilio Cobos Álvarez
f98a6411b1 Bug 1613517 - Make rust generate better code for derive(Animate) and derive(ComputeSquaredDistance). r=heycam
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

--HG--
extra : moz-landing-system : lando
2020-02-10 13:51:49 +00:00
Emilio Cobos Álvarez
451b254453 Bug 1612291 - Fix two issues with themed widgets in high contrast mode. r=heycam
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

--HG--
extra : moz-landing-system : lando
2020-02-10 00:37:36 +00:00
Tim Nguyen
3459492b2f Bug 1614160 - Add AngleOrPercentage to style system. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D62158

--HG--
extra : moz-landing-system : lando
2020-02-09 15:11:43 +00:00
Emilio Cobos Álvarez
374cabd6e7 Bug 1606628 - Remove nsStyleImageRequest. r=tnikkel,heycam
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

--HG--
extra : moz-landing-system : lando
2020-02-07 20:36:34 +00:00
Thomas Dolezal
062c15357a Bug 1611733 - Bug 1611633 - convert ns style position defines to enum class. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61958

--HG--
extra : moz-landing-system : lando
2020-02-07 12:35:30 +00:00
Emilio Cobos Álvarez
af73640f4e Bug 1613010 - Don't use a binary tree representation for calc() sums / products. r=heycam
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

--HG--
extra : moz-landing-system : lando
2020-02-07 00:40:55 +00:00
Mihai Alexandru Michis
823e8c21f1 Backed out changeset c9f4dd3ed78b (bug 1606628) for causing failures in ImageLoader.cpp
CLOSED TREE
2020-02-06 23:19:55 +02:00
Emilio Cobos Álvarez
77c6b3e983 Bug 1606628 - Remove nsStyleImageRequest. r=tnikkel,heycam
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

--HG--
extra : moz-landing-system : lando
2020-02-06 20:32:59 +00:00
Emilio Cobos Álvarez
836a705c56 Bug 1607553 - Try to collect some more crash information so that we can diagnose this better. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D59704

--HG--
extra : moz-landing-system : lando
2020-01-22 00:06:35 +00:00
Jonathan Kew
4a153d86a2 Bug 1607308 - 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. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D59778

--HG--
extra : moz-landing-system : lando
2020-02-03 14:38:28 +00:00
Jonathan Kew
aa8ee28de1 Bug 1607534 - Support percentage values for the CSS text-decoration-thickness and text-underline-offset properties. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D59777

--HG--
extra : moz-landing-system : lando
2020-02-03 14:21:32 +00:00
Ciure Andrei
141db422c6 Backed out 2 changesets (bug 1607308, bug 1607534) for causing text-decoration-underline-position-vertical-ja.html to permafail CLOSED TREE
Backed out changeset e55052ed4064 (bug 1607308)
Backed out changeset 280bd106d48a (bug 1607534)
2020-02-03 16:17:02 +02:00
Emilio Cobos Álvarez
ca641d574f Bug 1612114 - Invalidate shadow root style data on insertion if needed. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D61293

--HG--
extra : moz-landing-system : lando
2020-02-03 12:40:36 +00:00
Jonathan Kew
8b019300fc Bug 1607308 - 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. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D59778

--HG--
extra : moz-landing-system : lando
2020-02-03 11:12:16 +00:00
Jonathan Kew
1ee6b76d7d Bug 1607534 - Support percentage values for the CSS text-decoration-thickness and text-underline-offset properties. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D59777

--HG--
extra : moz-landing-system : lando
2020-02-03 11:11:52 +00:00
Tim Nguyen
3b6875eeb1 Bug 1610404 - Remove nsGroupBoxFrame (display: -moz-groupbox). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61422

--HG--
extra : moz-landing-system : lando
2020-02-03 09:55:51 +00:00
Thomas Dolezal
bfd4477a13 Bug 1612146 - Converting empty-cells defines into enum class. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61398

--HG--
extra : moz-landing-system : lando
2020-02-01 21:43:31 +00:00
Thomas Dolezal
2770364f87 Bug 1612148 - Replace transform style defines to an enum class. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61388

--HG--
extra : moz-landing-system : lando
2020-02-01 20:23:26 +00:00
Narcis Beleuzu
585bab844e Backed out 2 changesets (bug 1612148) for reftest failures. CLOSED TREE
Backed out changeset e1432ef26779 (bug 1612148)
Backed out changeset 0c1831f15450 (bug 1612148)
2020-02-01 19:23:06 +02:00
Emilio Cobos Álvarez
c84fe1b982 Bug 1612148 - followup: Remove unused include.
MANUAL PUSH: Patch from contributor was missing this, causing bustage.

CLOSED TREE

--HG--
extra : amend_source : ebf9505656921c452d3b2abac2f5a88f1b99db15
2020-02-01 17:08:09 +01:00
Thomas Dolezal
523017b0f6 Bug 1612148 - Replace transform style defines to an enum class. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61388

--HG--
extra : moz-landing-system : lando
2020-02-01 15:50:04 +00:00
Emilio Cobos Álvarez
1fdf0e61d3 Bug 1611912 - Add a style flag for the root element style. r=heycam
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

--HG--
extra : moz-landing-system : lando
2020-01-31 14:51:06 +00:00
Jonathan Kew
fe46c531b3 Bug 1612399 - Don't apply text-combine-upright in sideways-* writing modes. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61326

--HG--
extra : moz-landing-system : lando
2020-01-31 10:11:19 +00:00
Thomas Dolezal
28e6a65cfb Bug 1612143 - Replacing table-layout defines with an enum r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61260

--HG--
extra : moz-landing-system : lando
2020-01-31 01:23:23 +00:00
Emilio Cobos Álvarez
4812f9408a Bug 1611583 - Use cbindgen for css-align types. r=dholbert
This provides stronger typing and removes a bunch of subtle constants matching.

Differential Revision: https://phabricator.services.mozilla.com/D61058

--HG--
extra : moz-landing-system : lando
2020-01-31 00:56:49 +00:00
Thomas Dolezal
a63c10f0de Bug 1611041 - Convert image-rendering #defines to an enum class. r=emilio
MANUAL PUSH: Contributor didn't use Phabricator and I don't want patch to rot
2020-01-30 04:50:24 +01:00
Martin McNickle
9f727fc9c5 Bug 1611829 - Convert scroll-behavior #defines to an enum class. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D61164

--HG--
extra : moz-landing-system : lando
2020-01-28 09:12:29 +00:00
Martin McNickle
0c665c265e Bug 1611043 - Convert mask-type #defines to an enum class. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D60987

--HG--
extra : moz-landing-system : lando
2020-01-27 14:59:41 +00:00
Emilio Cobos Álvarez
f97d7df528 Bug 1610085 - Tweak background-color and color handling in ignored-colors mode. r=jwatt
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

--HG--
extra : moz-landing-system : lando
2020-01-26 22:57:21 +00:00
Csoregi Natalia
3a270b7de3 Backed out changeset 239f7622187e (bug 1610085) for background color failures on test_dont_use_document_colors.html. CLOSED TREE 2020-01-26 23:14:39 +02:00
Emilio Cobos Álvarez
6bfbf10f25 Bug 1611711 - Remove kCursorKTable. r=jwatt
(And while at it, format the end of the other keyword tables so that
cleanup_ktables.py works).

It seems `Window.setCursor` is only used once in our code, maybe
we should remove it...

Differential Revision: https://phabricator.services.mozilla.com/D61090

--HG--
extra : moz-landing-system : lando
2020-01-26 20:17:41 +00:00