Commit Graph

1262 Commits

Author SHA1 Message Date
Tim Nguyen
cc1ec3b906 Bug 1615489 - Refactor GenericGradient for conic-gradient support. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D62923

--HG--
extra : moz-landing-system : lando
2020-02-15 19:07:54 +00:00
shindli
ef9b6edae2 Backed out changeset 07fc980b7ed8 (bug 1615489) for causing linux build bustages 2020-02-15 15:41:45 +02:00
Tim Nguyen
dc4ed94109 Bug 1615489 - Refactor GenericGradient for conic-gradient support. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D62923

--HG--
extra : moz-landing-system : lando
2020-02-15 13:16:36 +00:00
Martin McNickle
30c6161dca Bug 1615380 - Part 2 - Use the cbindgen output for GridAutoFlow directly in gecko. r=emilio
Depends on D62787

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

--HG--
extra : moz-landing-system : lando
2020-02-14 15:48:10 +00:00
Emilio Cobos Álvarez
bfcb8d06e9 Bug 1614510 - Split clip-path and shape-outside values. r=boris
We don't actually share _that_ much code across them. This makes callers clearer
and code less confusing, IMHO.

This also has the benefit of not autocompleting path from devtools for
shape-outside.

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

--HG--
extra : moz-landing-system : lando
2020-02-11 23:34:53 +00:00
Emilio Cobos Álvarez
628f21dc90 Bug 1614510 - Use cbindgen for shape-outside and clip-path. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D62372

--HG--
extra : moz-landing-system : lando
2020-02-11 22:03:53 +00:00
Emilio Cobos Álvarez
006e5cca66 Bug 1614198 - Use cbindgen instead of nsStyleImage. r=aosmond
The trickier part is that we represent -moz-image-rect as a Rect() type instead
of image with non-null clip-rect. So we need to add a bit of code to
distinguish "image request types" from other types of images.

But it's not too annoying, and we need to do the same for fancier images like
image-set and such whenever we implement it, so seems nice to get rid of
most explicit usages of nsStyleImage::GetType().

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

--HG--
extra : moz-landing-system : lando
2020-02-11 20:56:20 +00: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
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
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
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
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
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
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
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
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
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
Emilio Cobos Álvarez
a25126cd0d Bug 1611181 - Make direction use an enum class. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D60857

--HG--
extra : moz-landing-system : lando
2020-01-24 11:46:14 +00:00
Emilio Cobos Álvarez
fd83f48756 Bug 1609737 - Simplify calc expressions earlier. r=boris
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

--HG--
extra : moz-landing-system : lando
2020-01-23 09:18:39 +00:00
Emilio Cobos Álvarez
caa966f9de Bug 1609737 - Forbid accessing the length and percentage parts of a LengthPercentage separately. r=boris
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

--HG--
extra : moz-landing-system : lando
2020-01-23 09:18:39 +00:00
Cosmin Sabou
39c82e1497 Backed out 2 changesets (bug 1609737) for causing build bustages on nsCSSRenderingGradients after backing out Bug 1609711. CLOSED TREE
Backed out changeset d12980bbc425 (bug 1609737)
Backed out changeset 51f3f1a1efb8 (bug 1609737)
2020-01-23 07:39:48 +02:00
Emilio Cobos Álvarez
9b78285fd3 Bug 1609737 - Simplify calc expressions earlier. r=boris
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

--HG--
extra : moz-landing-system : lando
2020-01-23 00:36:34 +00:00
Emilio Cobos Álvarez
b06718c3dc Bug 1609737 - Forbid accessing the length and percentage parts of a LengthPercentage separately. r=boris
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

--HG--
extra : moz-landing-system : lando
2020-01-23 00:36:27 +00:00
Boris Chiou
98e40ec294 Bug 1592822 - Replace StyleVecU8 with ipc::ByteBuf. r=emilio
We generate ByteBuf by rust bindgen, so we can drop StyleVecU8.
One potential follow-up is that we can merge this together with WrVecU8.

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

--HG--
rename : ipc/glue/ByteBuf.h => ipc/glue/ByteBufUtils.h
extra : moz-landing-system : lando
2020-01-22 20:18:40 +00:00
Boris Chiou
ffa1ebad7b Bug 1592822 - Use Serde for OffsetRotate and PositionOrAuto. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D60088

--HG--
extra : moz-landing-system : lando
2020-01-22 20:18:38 +00:00
Boris Chiou
14387265a7 Bug 1592822 - Use Serde for SVGOffsetPath. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D60087

--HG--
extra : moz-landing-system : lando
2020-01-22 20:18:35 +00:00
Boris Chiou
38cc52c091 Bug 1592822 - Use Serde for Transform. r=emilio
Though this may make us use more space when serializing
StyleTransform, but we don't have to do extra conversion on the compostior
side, and this makes us easier to maintain the Rust type.

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

--HG--
extra : moz-landing-system : lando
2020-01-22 20:20:38 +00:00
Boris Chiou
7b90a66fcb Bug 1592822 - Use Serde for rotate, scale, and translate properties. r=emilio
The only drawback is: we resolve LengthPercentage value before passing
translate property through IPC, so its percentage part is redundant.
However, this makes us easier to maintain the Rust type.

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

--HG--
extra : moz-landing-system : lando
2020-01-22 20:18:31 +00:00
Bogdan Tara
958c34b738 Backed out 6 changesets (bug 1592822) for bustages complaining about layout/painting/nsDisplayList.cpp CLOSED TREE
Backed out changeset 90d0f2ebd310 (bug 1592822)
Backed out changeset 9890bad86a0e (bug 1592822)
Backed out changeset 43870cc90433 (bug 1592822)
Backed out changeset d80e0e3f5b87 (bug 1592822)
Backed out changeset 99be49183325 (bug 1592822)
Backed out changeset 9ce641556acc (bug 1592822)

--HG--
extra : histedit_source : fa4e4b2c899510f1d39ee3baa0374e2ce16d2815
2020-01-22 21:17:39 +02:00
Boris Chiou
4f3076794c Bug 1592822 - Replace StyleVecU8 with ipc::ByteBuf. r=emilio
We generate ByteBuf by rust bindgen, so we can drop StyleVecU8.
One potential follow-up is that we can merge this together with WrVecU8.

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

--HG--
rename : ipc/glue/ByteBuf.h => ipc/glue/ByteBufUtils.h
extra : moz-landing-system : lando
2020-01-22 18:42:54 +00:00
Boris Chiou
e10013895e Bug 1592822 - Use Serde for OffsetRotate and PositionOrAuto. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D60088

--HG--
extra : moz-landing-system : lando
2020-01-22 18:40:19 +00:00
Boris Chiou
40f3cb3d65 Bug 1592822 - Use Serde for SVGOffsetPath. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D60087

--HG--
extra : moz-landing-system : lando
2020-01-22 18:40:11 +00:00
Boris Chiou
9735c2e972 Bug 1592822 - Use Serde for Transform. r=emilio
Though this may make us use more space when serializing
StyleTransform, but we don't have to do extra conversion on the compostior
side, and this makes us easier to maintain the Rust type.

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

--HG--
extra : moz-landing-system : lando
2020-01-22 18:40:09 +00:00
Boris Chiou
73f0ae66a9 Bug 1592822 - Use Serde for rotate, scale, and translate properties. r=emilio
The only drawback is: we resolve LengthPercentage value before passing
translate property through IPC, so its percentage part is redundant.
However, this makes us easier to maintain the Rust type.

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

--HG--
extra : moz-landing-system : lando
2020-01-22 18:40:07 +00:00
nordzilla
5465ed1ec0 Bug 1607268 - Implement replaceSync() Functionality r=emilio,bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D58881

--HG--
extra : moz-landing-system : lando
2020-01-14 22:34:40 +00:00
Makoto Kato
c2e7d5dc85 Bug 1503656 - Part 2. Use Device for parameter instead of CssEnvironment. r=emilio
CssEnvironment alwasy is in Device, so use Device as parameter instead of CssEnvironment.

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

--HG--
extra : moz-landing-system : lando
2020-01-08 11:56:25 +00:00
Makoto Kato
7574b8612d Bug 1503656 - Part 1. Always use CssEnvironment from media query's device. r=emilio
Although CssEnvironment is in Device of media query implementation, some code
creates CssEnvironment instance without Device. So I would like always to use it from Device of media query.

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

--HG--
extra : moz-landing-system : lando
2020-01-08 11:55:28 +00:00
Emilio Cobos Álvarez
ba0cc69e47 Bug 1607049 - Pack LengthPercentage better. r=jwatt
So that it takes one pointer instead of two, and doesn't make nsStylePosition's
size blow up.

This is not as ugly as I was fearing, thankfully, though it requires a bit of
boilerplate. I think it's acceptable.

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

--HG--
extra : moz-landing-system : lando
2020-01-13 13:23:22 +00:00
Emilio Cobos Álvarez
d10341c0bc Bug 1607049 - Split LengthPercentage again. r=boris
This is needed to support min() / max() / clamp(), etc, as those need to be a
tree of values and thus need heap storage.

This unfortunately grows LengthPercentage to be two pointers, which is bad as
it blows up the size of nsStylePosition enough to trigger the size assertions.

This patch comments out the assertion for now, the follow-up patches will
uncomment them.

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

--HG--
extra : moz-landing-system : lando
2020-01-13 13:21:58 +00:00
Emilio Cobos Álvarez
86a70df5d7 Bug 1607006 - Remove utf-16 versions of nsCSSProps::LookupProperty* and ServoCSSParser::ComputeColor. r=bzbarsky
Now that we have UTF8String in the WebIDL, we can remove quite a few of the
conversions. Do that, and lift the remaining string conversions up as needed.

Also deindent Servo_ComputeColor while touching it.

Most of the remaining copies are because either bug 1606994, or because they're
WebIDL attributes that we still need to serialize back as UTF-16 (bug 1606995).

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

--HG--
extra : moz-landing-system : lando
2020-01-08 01:21:30 +00:00
Emilio Cobos Álvarez
8e79d673bb Bug 1607080 - Avoid a silly UTF16 -> UTF8 round-trip in DOMMatrix. r=smaug,boris
Depends on D58710

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

--HG--
extra : moz-landing-system : lando
2020-01-07 09:46:53 +00:00
Emilio Cobos Álvarez
795502e5b8 Bug 1607080 - More minor serialization improvements. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D58710

--HG--
extra : moz-landing-system : lando
2020-01-07 09:47:20 +00:00
Emilio Cobos Álvarez
6d777c8bf9 Bug 1607069 - Simplify some serialization code in glue.rs. r=jwatt
cbindgen understands references, there's no need to use raw pointers here and
then unwrapping or unsafely dereferencing them.

Also remove one unused function while at it.

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

--HG--
extra : moz-landing-system : lando
2020-01-05 14:42:23 +00:00