Граф коммитов

1276 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez a214514a58 Bug 1624080 - Simplify the implementation of HasAuthorSpecifiedRules. r=heycam
This patch computes the author-specified properties during the CSS cascade, and
removes the complex rule-tree-based implementation that tries to do the cascade
again.

This changes behavior in two ways, one of them which is not observable to
content, I believe:

 * revert now re-enables the native styling. This was brought up in
   https://github.com/w3c/csswg-drafts/issues/4777 and I think it is a bug-fix.

   This is observable to content, and I'm adding a test for it.

 * We don't look at inherited styles from our ancestors when `inherit` is
   specified in a non-author stylesheet. This was introduced for bug 452969 but
   we don't seem to inherit background anymore for file controls or such. It
   seems back then file controls used to have a text-field.

   I audited forms.css and ua.css and we don't explicitly inherit
   padding / border / background-color into any nested form control.

We keep the distinction between border/background and padding, because the later
has some callers. I think we should try to align with Chromium in the long run
and remove the padding bit.

We need to give an appearance to the range-thumb and such so that we can assert
that we don't call HasAuthorSpecifiedRules on non-themed stuff. I used a new
internal value for that.

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

--HG--
extra : moz-landing-system : lando
2020-03-26 16:48:01 +00:00
Razvan Maries 7155f2665a Backed out changeset ac0d06c0ca93 (bug 1624080) for assertion failures. CLOSED TREE 2020-03-26 16:52:18 +02:00
Emilio Cobos Álvarez c556351cd0 Bug 1624080 - Simplify the implementation of HasAuthorSpecifiedRules. r=heycam
This patch computes the author-specified properties during the CSS cascade, and
removes the complex rule-tree-based implementation that tries to do the cascade
again.

This changes behavior in two ways, one of them which is not observable to
content, I believe:

 * revert now re-enables the native styling. This was brought up in
   https://github.com/w3c/csswg-drafts/issues/4777 and I think it is a bug-fix.

   This is observable to content, and I'm adding a test for it.

 * We don't look at inherited styles from our ancestors when `inherit` is
   specified in a non-author stylesheet. This was introduced for bug 452969 but
   we don't seem to inherit background anymore for file controls or such. It
   seems back then file controls used to have a text-field.

   I audited forms.css and ua.css and we don't explicitly inherit
   padding / border / background-color into any nested form control.

We keep the distinction between border/background and padding, because the later
has some callers. I think we should try to align with Chromium in the long run
and remove the padding bit.

We need to give an appearance to the range-thumb and such so that we can assert
that we don't call HasAuthorSpecifiedRules on non-themed stuff. I used a new
internal value for that.

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

--HG--
extra : moz-landing-system : lando
2020-03-26 13:23:42 +00:00
Emilio Cobos Álvarez 9b76d28bff Bug 1622058 - Cleanup CSS error reporting a bit. r=nordzilla
Differential Revision: https://phabricator.services.mozilla.com/D66642

--HG--
extra : moz-landing-system : lando
2020-03-16 20:50:21 +00:00
Erik Nordin 17dbae2125 Bug 1613511 - Disallow @import rules for all Constructable StyleSheets functions r=emilio
- Add enum AllowImportRules to CSS parsing.
- `replaceSync()` will skip over @import rules and continue parsing.
- `replace()` will skip over @import rules and continue parsing.
- `insertRule()` will throw a syntax error on @import rules.
- Modify WPT test cases to reflect these changes.

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

--HG--
extra : moz-landing-system : lando
2020-03-12 18:11:09 +00:00
Emilio Cobos Álvarez 3d29b274ae Bug 1620359 - Don't clear the "uses viewport units" bit when a font that doesn't cause a style change loads. r=jfkthame
This is probably an old-ish bug made more frequent by the font loading
optimizations.

PostRebuildAllStyleData is a bit of a misnomer, but was always calling
ClearCachedData() on the style set, even if we weren't guaranteed to restyle
every element.

This means both wasted work and correctness issues (as the "uses <rare-feature>"
bits are cleared during this call, on the assumption that we'll then visit all
elements and that'd recompute it properly).

For now, unify a bit the different code paths and only clear these bits if we're
guaranteed to restyle all elements.

I should rename this to something better in a follow-up, and ideally also
decouple the ClearCachedData() calls a bit...

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

--HG--
extra : moz-landing-system : lando
2020-03-06 20:11:51 +00:00
Hiroyuki Ikezoe f0b17ecc30 Bug 1510120 - Block running background-color animation on the compositor if there is any current-color keyframe. r=boris,flod
Differential Revision: https://phabricator.services.mozilla.com/D63629

--HG--
extra : moz-landing-system : lando
2020-03-03 21:48:01 +00:00
Emilio Cobos Álvarez 279cb1fda5 Bug 1618601 - Add non-const accessors to StyleRect. r=hiro
Just minor convenience. Though I don't love the code duplication, oh well.

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

--HG--
extra : moz-landing-system : lando
2020-02-27 20:58:00 +00:00
Emilio Cobos Álvarez 5e65211744 Bug 1617472 - Use enums for text-align / text-align-last. r=jfkthame
This also fixes some backwards logic in nsBlockFrame::ReflowDirtyLines, and adds
some static assertions to nsGenericHTMLElement that almost cause a very subtle
bug.

Depends on D63792

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

--HG--
extra : moz-landing-system : lando
2020-02-24 13:32:57 +00:00
Emilio Cobos Álvarez 71cc1a2c62 Bug 1617425 - Use cbindgen for SVG lengths. r=jwatt
Depends on D63777

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

--HG--
extra : moz-landing-system : lando
2020-02-23 15:43:03 +00:00
Emilio Cobos Álvarez fff63130d9 Bug 1617421 - Use cbindgen for cursors. r=jwatt
Pretty straight-forward.

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

--HG--
extra : moz-landing-system : lando
2020-02-23 13:07:30 +00:00
Emilio Cobos Álvarez 1c8cc0fccb Bug 1616691 - Fix C++ side of <length-percentage> values. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D63398

--HG--
extra : moz-landing-system : lando
2020-02-21 00:46:50 +00:00
Tim Nguyen c15714cbeb 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 22:04:35 +00:00
Arthur Iakab 8fc81437b1 Backed out changeset 0721d0777474 (bug 1615489) for multiple build bustages.
DONTBUILD
CLOSED TREE
2020-02-15 21:50:33 +02:00
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