Commit graph

1536 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
b5c2fd645c Bug 1789123 - Make anonymous box wrapping inside XUL boxes be similar to modern flex boxes. r=dholbert
I haven't spotted any UI regression from this, and this should generally
make the XUL -> modern flex transition easier, and simplify some
of the relevant code.

This does fix a few layout issues with emulated flexbox.

For the most part, this shouldn't change behavior without that. This
changes behavior if you have mixed inline/non-inline content in the same
XUL box (before they'd get a single item, now you'd get the flexbox /
grid behavior of one item per inline run), and multiple inline-elements
(which would become their own flex items). But I pushed a patch with
some asserts and they didn't fire on our browser mochitests, so I think
we're good.

The UA rule refactoring (removing the inherit from xul anon blocks)
shouldn't matter in practice, since we only have one item (so
box-ordinal is irrelevant) and they have overflow: visible (so
text-overflow and overflow-clip-box shouldn't have an effect).

Differential Revision: https://phabricator.services.mozilla.com/D156375
2022-09-08 11:51:15 +00:00
Emilio Cobos Álvarez
3b00b2f6db Bug 1786147 - Fix typo to avoid devtools property-db failures.
MANUAL PUSH: Orange fix CLOSED TREE
2022-08-31 15:43:26 +02:00
Emilio Cobos Álvarez
83c7733c7c Bug 1786147 - Move line-clamp out of mako and do some adjacent clean-up. r=boris
No behavior change, but simplifies the following patch.

Differential Revision: https://phabricator.services.mozilla.com/D155180
2022-08-31 12:39:19 +00:00
Frederic Wang
e65e52a1da Bug 1187682 - Use ScriptPercentScaleDown and ScriptScriptPercentScaleDown constants. r=emilio
The math-depth implementation is refined to take into account the
ScriptPercentScaleDown and ScriptScriptPercentScaleDown constants (if the
parent's first valid font has a MATH table) in order to calculate the
scale factor between math-deth 0 and 1, and between 0 and 2 respectively.

Behavior is unchanged if the legacy scriptsizemultiplier attribute is
specified or if no MATH table is available.

The preference layout.css.math-depth.enabled remains disabled in nightly
until the remaining bit (support for font-size: math) is implemented in
bug 1667090.

Differential Revision: https://phabricator.services.mozilla.com/D91604
2022-08-30 10:16:33 +00:00
AW255
4d7b018d55 Bug 1573830 - 0% values are not skipped when parsing CSS transform. r=emilio
Adds trait ZeroNoPercent to check for values that are 0 (such as 0px) but not 0%

Updated test css/css-transforms/animation/translate-interpolation.html and removed unnecessary formatting changes

Differential Revision: https://phabricator.services.mozilla.com/D154930
2022-08-26 11:11:30 +00:00
Emilio Cobos Álvarez
6d0f2b63a9 Bug 1682444 - Add basic support for nan / infinity in calc(). r=boris
Fix some tests to:

 * Not assume `double` precision.
 * Account for recent working group resolution with regards to NaN: https://github.com/w3c/csswg-drafts/issues/7067#issuecomment-1111211295

Not sure I caught all, but normalizing to 0 was already our existing
behavior. This feature needs more work before it can be enabled more
generally, so make it nightly-only, for now.

Also, it's unclear per spec what the serialization for infinity*1s or so
should be. Right now we serialize to <very-big-number>s, which seems
reasonable, but some tests (but not others!) expect different behavior.

I left those untouched for now.

Differential Revision: https://phabricator.services.mozilla.com/D154883
2022-08-18 08:54:30 +00:00
Emilio Cobos Álvarez
9cb731ca93 Bug 1774589 - Implement atan2(), and enable calc() trigonometric functions by default on nightly. r=boris
We now have test coverage, so let's do this.

The remaining failures are just about infinity/nan, which is a
completely different feature.

Differential Revision: https://phabricator.services.mozilla.com/D154831
2022-08-18 08:49:30 +00:00
Marian-Vasile Laza
77fe747849 Backed out 5 changesets (bug 1682444, bug 1774589) for causing wpt failures on acos-asin-atan-atan2-serialize.html. CLOSED TREE
Backed out changeset 1d850765046a (bug 1774589)
Backed out changeset 08ec785b9923 (bug 1682444)
Backed out changeset bf0c0ff13cc1 (bug 1682444)
Backed out changeset bcf5fcb47b4a (bug 1774589)
Backed out changeset 03b2061c924b (bug 1774589)
2022-08-18 04:28:11 +03:00
Emilio Cobos Álvarez
5e73feeb12 Bug 1682444 - Add basic support for nan / infinity in calc(). r=boris
Fix some tests to:

 * Not assume `double` precision.
 * Account for recent working group resolution with regards to NaN: https://github.com/w3c/csswg-drafts/issues/7067#issuecomment-1111211295

Not sure I caught all, but normalizing to 0 was already our existing
behavior. This feature needs more work before it can be enabled more
generally, so make it nightly-only, for now.

Also, it's unclear per spec what the serialization for infinity*1s or so
should be. Right now we serialize to <very-big-number>s, which seems
reasonable, but some tests (but not others!) expect different behavior.

I left those untouched for now.

Differential Revision: https://phabricator.services.mozilla.com/D154883
2022-08-17 21:12:08 +00:00
Emilio Cobos Álvarez
3372ba4c5d Bug 1774589 - Implement atan2(), and enable calc() trigonometric functions by default on nightly. r=boris
We now have test coverage, so let's do this.

The remaining failures are just about infinity/nan, which is a
completely different feature.

Differential Revision: https://phabricator.services.mozilla.com/D154831
2022-08-17 20:56:38 +00:00
Emilio Cobos Álvarez
9f8d56e747 Bug 1783940 - Remove -moz-* display values enabled-in-content prefs. r=dholbert
We have unshipped these since forever, no point in keeping the pref
around. Move the relevant tests to chrome ref/mochitests.

Differential Revision: https://phabricator.services.mozilla.com/D154152
2022-08-10 15:43:51 +00:00
Sandor Molnar
2fd0743a13 Backed out changeset 28c712b01ff9 (bug 1783940) for causing mochitest plain failures in layout/generic/test/test_dynamic_reflow_root_disallowal.html 2022-08-10 02:26:47 +03:00
Emilio Cobos Álvarez
8efdb3cc26 Bug 1783940 - Remove -moz-* display values enabled-in-content prefs. r=dholbert
We have unshipped these since forever, no point in keeping the pref
around. Move the relevant tests to chrome ref/mochitests.

Differential Revision: https://phabricator.services.mozilla.com/D154152
2022-08-09 21:59:45 +00:00
Emilio Cobos Álvarez
cf26510de6 Bug 1782858 - Make color-scheme affect Windows' non-native menus. r=desktop-theme-reviewers,dao
This matches what Linux and macOS do, and that allows the fix for bug 1782623
to work on Windows for unstyled selects.

This also simplifies the CSS (though it adds a new system color which is a bit
more annoying). I filed https://github.com/w3c/csswg-drafts/issues/7561 to
propose adding a more generic way to do this in the future (not just for
Firefox).

Differential Revision: https://phabricator.services.mozilla.com/D153549
2022-08-03 20:33:09 +00:00
Ziran Sun
65711751b2 Bug 1778296 - make contain-intrinsic-size *animatable*. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D151231
2022-07-11 08:37:44 +00:00
David Shin
d1e16d47d7 Bug 1766041: Part 5: C++ ComputedTimingFunction uses Rust's timing function calculation. r=emilio
This was made economical by having Rust's computed `easing::TimingFunction` use
a fully resolved function for `linear(...)` easing, as per draft resolution from
https://github.com/w3c/csswg-drafts/issues/7415

Differential Revision: https://phabricator.services.mozilla.com/D151295
2022-07-09 17:33:59 +00:00
David Shin
5da2d56d12 Bug 1766041: Part 4: Port bezier edge cases handling from C++ to Rust. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D150569
2022-07-09 17:33:58 +00:00
David Shin
5c56dc3a60 Bug 1766041: Part 2: Update rust's step function basd on C++ ComputedTimingFunction. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D150566
2022-07-09 17:33:57 +00:00
David Shin
40f1452af5 Bug 1766041: Part 1: Move Rust animation to ComputedTimingFunction. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D150565
2022-07-09 17:33:57 +00:00
Csoregi Natalia
33193d6158 Backed out 5 changesets (bug 1766041) for gtest failures on APZCBasicTester. CLOSED TREE
Backed out changeset 3b0cd4ee7d1e (bug 1766041)
Backed out changeset 5de0ed4fd59b (bug 1766041)
Backed out changeset cc7ffb683e8a (bug 1766041)
Backed out changeset ce5a895e7a06 (bug 1766041)
Backed out changeset 315578c436ca (bug 1766041)
2022-07-08 03:12:42 +03:00
David Shin
00ee70f348 Bug 1766041: Part 5: C++ ComputedTimingFunction uses Rust's timing function calculation. r=emilio
This was made economical by having Rust's computed `easing::TimingFunction` use
a fully resolved function for `linear(...)` easing, as per draft resolution from
https://github.com/w3c/csswg-drafts/issues/7415

Differential Revision: https://phabricator.services.mozilla.com/D151295
2022-07-07 22:52:59 +00:00
David Shin
9dfbcf5b60 Bug 1766041: Part 4: Port bezier edge cases handling from C++ to Rust. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D150569
2022-07-07 22:52:59 +00:00
David Shin
0c20ef85f5 Bug 1766041: Part 2: Update rust's step function basd on C++ ComputedTimingFunction. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D150566
2022-07-07 22:52:58 +00:00
David Shin
6a09761348 Bug 1766041: Part 1: Move Rust animation to ComputedTimingFunction. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D150565
2022-07-07 22:52:57 +00:00
Emilio Cobos Álvarez
2c2f20586e Bug 1778396 - Add color-mix to DevTools autocomplete. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D151180
2022-07-07 10:29:59 +00:00
Ziran Sun
435c380565 Bug 1778062 - Add support for parsing the contain-intrinsic-size property from the CSS-sizing specification. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D151001
2022-07-06 11:47:51 +00:00
David Shin
bdcfb83f13 Bug 1775351: Part 2: linear(...) easing: Simplify piecewise linear implementation given parsing simplification. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D150163
2022-06-28 11:31:34 +00:00
David Shin
9b9505a23c Bug 1775351: Part 1: linear(...) easing: Parsing should split a linear stop value into two for entries with both linear-stop-length set. r=emilio
This brings the behaviour inline with `linear-gradient(...)`

Differential Revision: https://phabricator.services.mozilla.com/D149926
2022-06-28 11:31:34 +00:00
Cristian Tuns
a13498c4a2 Backed out 2 changesets (bug 1775351) for causing build bustages CLOSED TREE
Backed out changeset 4afc18c58426 (bug 1775351)
Backed out changeset e900fb167e26 (bug 1775351)
2022-06-24 13:38:21 -04:00
David Shin
3329d8a011 Bug 1775351: Part 2: linear(...) easing: Simplify piecewise linear implementation given parsing simplification. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D150163
2022-06-24 17:02:40 +00:00
David Shin
53969dc502 Bug 1775351: Part 1: linear(...) easing: Parsing should split a linear stop value into two for entries with both linear-stop-length set. r=emilio
This brings the behaviour inline with `linear-gradient(...)`

Differential Revision: https://phabricator.services.mozilla.com/D149926
2022-06-24 17:02:39 +00:00
Emilio Cobos Álvarez
c14065f628 Bug 1776162 - Improve LookAndFeel color caching. r=mstange
To be honest, I'm a bit baffled that bug 1773795 caused a performance
regression, but I think it's because the standins codepath is not really
cached, so system colors that are "spoofed" always go through the
massive switch, which could potentially be expensive.

To fix, this, rejigger a bit the caches so that we key on both
color-scheme and use-standins. Also, while at it, make the set of colors
we spoof a single bitflag check, rather than relying on the compiler to
do something potentially smart with it.

I had to shuffle the order of colors around so that the expression to
initialize the bitfield is constexpr (doesn't go over 1 << 64), but
other than that this patch should be relatively straight-forward.

Differential Revision: https://phabricator.services.mozilla.com/D150100
2022-06-23 22:38:02 +00:00
David Shin
aca7c3d4df Bug 1773493 - Use Rust's ComputedTimingFunction for IPDL. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D149663
2022-06-23 17:07:13 +00:00
Emilio Cobos Álvarez
cbb5b58f4d Bug 1772555 - Use style interpolation code for gradients. r=nical
This ensures they're clamped on Animated -> sRGB conversion, and in the
future we'll have to implement different color spaces so we'll need to
use it anyways.

Differential Revision: https://phabricator.services.mozilla.com/D149792
2022-06-22 23:02:34 +00:00
Iulian Moraru
0ebda972c1 Backed out changeset 003cad9bbcc6 (bug 1772555) for causing reftest failures on bugs/1315113-1.html. 2022-06-22 22:00:53 +03:00
Emilio Cobos Álvarez
827fe3a33e Bug 1772555 - Use style interpolation code for gradients. r=nical
This ensures they're clamped on Animated -> sRGB conversion, and in the
future we'll have to implement different color spaces so we'll need to
use it anyways.

Differential Revision: https://phabricator.services.mozilla.com/D149792
2022-06-22 17:00:56 +00:00
Martin Robinson
f85b73bf84 Bug 1463600 - Implement CSS 'contain: style' r=emilio
Add an implementation of CSS `contain: style`. This introduces two new
data structures, the ContainStyleScope and ContainStyleScopeManager.

ContainStyleScope manages one `contain: style` "world" which has its own
counter and quote lists. The contents of these lists depend on their
parent scopes, but are not affected by their children.
ContainStyleScopeManager manages a tree of scopes starting at a root
scope which is outside of any `contain: style` element.

Scopes are stored in a hash table that is keyed off of the nsIContent
which establishes the `contain: style` scope. When modifying quote or
content lists, the ContainStyleScopeManager is responsible for finding
the appropriate `contain: style` scope to modify.

Perhaps the most complex part of this is that counters and quotes have
read access to the state of counters and quotes that are in ancestor
`contain: style` scopes. In the case of counters, USE nodes that are at
the beginning of counter lists might have a counter scope that starts in
an ancestor `contain: style` scope. When nsCounterNode::SetScope() is
called, the code may look upward in the `contain: style` scope tree to
find the start of the counter scope. In the case of quotes, the first
node in the quote list must look for the state of quotes in ancestor
`contain: style` scopes.

Differential Revision: https://phabricator.services.mozilla.com/D149508
2022-06-22 16:16:59 +00:00
Bogdan Szekely
b56ae513c7 Backed out changeset 86e9449aba35 (bug 1463600) for causing xpcshell failures on test_css-properties-db.js 2022-06-22 15:35:33 +03:00
Martin Robinson
83640bbee6 Bug 1463600 - Implement CSS 'contain: style' r=emilio
Add an implementation of CSS `contain: style`. This introduces two new
data structures, the ContainStyleScope and ContainStyleScopeManager.

ContainStyleScope manages one `contain: style` "world" which has its own
counter and quote lists. The contents of these lists depend on their
parent scopes, but are not affected by their children.
ContainStyleScopeManager manages a tree of scopes starting at a root
scope which is outside of any `contain: style` element.

Scopes are stored in a hash table that is keyed off of the nsIContent
which establishes the `contain: style` scope. When modifying quote or
content lists, the ContainStyleScopeManager is responsible for finding
the appropriate `contain: style` scope to modify.

Perhaps the most complex part of this is that counters and quotes have
read access to the state of counters and quotes that are in ancestor
`contain: style` scopes. In the case of counters, USE nodes that are at
the beginning of counter lists might have a counter scope that starts in
an ancestor `contain: style` scope. When nsCounterNode::SetScope() is
called, the code may look upward in the `contain: style` scope tree to
find the start of the counter scope. In the case of quotes, the first
node in the quote list must look for the state of quotes in ancestor
`contain: style` scopes.

Differential Revision: https://phabricator.services.mozilla.com/D149508
2022-06-22 10:42:34 +00:00
Emilio Cobos Álvarez
4c5f20179e Bug 1775247 - Implement AccentColor/AccentColorText and remove -moz-prefixed version of the color. r=mstange
As per https://github.com/w3c/csswg-drafts/issues/7347.

Mostly renaming, doesn't change behavior other than exposing the new
color keywords (tested in wpt).

Differential Revision: https://phabricator.services.mozilla.com/D149876
2022-06-22 09:45:06 +00:00
David Shin
8c02818079 Bug 1771980 - Refactor function parsing branches for specified::easing::TimingFunction. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D149756
2022-06-20 17:45:03 +00:00
Emilio Cobos Álvarez
5a2d3c5d54 Bug 1774946 - Check for allowed colors recursively in forced-colors mode. r=jwatt
Differential Revision: https://phabricator.services.mozilla.com/D149733
2022-06-20 14:07:12 +00:00
Mike Hommey
a211cd2aea Bug 1774501 - Update stylo to itertools:0.10, itoa:1.0 and toml:0.5. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D149454
2022-06-16 20:44:03 +00:00
Emilio Cobos Álvarez
d43049661f Bug 1773484 - Make viewport-relative units zoomable via "zoom text only". r=boris
They're not font relative, so it we probably want them to be zoomed.

Differential Revision: https://phabricator.services.mozilla.com/D148796
2022-06-14 08:38:11 +00:00
Boris Chiou
2b8751f919 Bug 1754897 - Part 4: Hook named scroll timelines to animation-timeline. r=emilio
Basically, animation-timeline could be
1. auto
2. none
3. <timeline-name>

We extend the <timeline-name> to cover both @scroll-timeline rule and
scroll-timeline-name property. We check @scroll-timeline rule first. If
it doesn't exist, we check scroll-timeline-name of the element itself,
the previous silbings, and their ancestors.

Differential Revision: https://phabricator.services.mozilla.com/D146358
2022-06-13 20:26:45 +00:00
Boris Chiou
e9d0888406 Bug 1754897 - Part 2: Support scroll-timeline-axis longhand in style system. r=emilio
Implement "scroll-timeline-axis: block | inline | vertical | horizontal".

Differential Revision: https://phabricator.services.mozilla.com/D146019
2022-06-13 20:26:45 +00:00
Boris Chiou
cd0ef479a6 Bug 1754897 - Part 1: Support scroll-timeline-name longhand in style system. r=emilio
Implement "scroll-timeline-name: none | <custom-ident>".

Differential Revision: https://phabricator.services.mozilla.com/D146018
2022-06-13 20:26:44 +00:00
Emilio Cobos Álvarez
9fc2aa47fc Bug 1773558 - Move fixed-point font types to Rust. r=layout-reviewers,jfkthame
Now that cbindgen and rust support const generics, it seems more simple.

This centralizes all the relevant font constants etc in rust and avoids
conversions when going from rust to C++ and vice versa.

Differential Revision: https://phabricator.services.mozilla.com/D148847
2022-06-13 00:59:23 +00:00
Noemi Erli
841e350bc4 Backed out changeset 7585591a9bad (bug 1773558) for causing failures in system-fonts.html 2022-06-12 19:02:33 +03:00
Emilio Cobos Álvarez
e441089ca0 Bug 1773558 - Move fixed-point font types to Rust. r=layout-reviewers,jfkthame
Now that cbindgen and rust support const generics, it seems more simple.

This centralizes all the relevant font constants etc in rust and avoids
conversions when going from rust to C++ and vice versa.

Differential Revision: https://phabricator.services.mozilla.com/D148847
2022-06-12 10:48:58 +00:00