14537 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
641fa20731 Bug 1825825 - Simplify NAC setup. r=smaug
Make all UA widgets also NAC.

Keep the UA widget flag but break at anonymous subtree boundaries, so
that only nodes inside the UA widget directly (and not NAC from those)
get the flag.

This is important because two callers depend on this difference:

 * The style system, since we still want to match content rules from
   stylesheets in the UA widget. We also match user rules, which is a
   bit sketchy, but that was the previous behavior, will file a
   follow-up for that.

 * The reflector code, since we want the scope for UA widgets to not
   include the NAC nodes inside that UA widget. nsINode::IsInUAWidget
   got it wrong.

After this patch, ChromeOnlyAccess is equivalent to
IsInNativeAnonymousSubtree, so we should probably unify the naming.
That's left for a follow-up patch because I don't have a strong
preference.

Differential Revision: https://phabricator.services.mozilla.com/D174310
2023-04-05 09:19:15 +00:00
Emilio Cobos Álvarez
54c93e0a91 No bug - Fix some spec links. DONTBUILD
Trivial, comment-only

Differential Revision: https://phabricator.services.mozilla.com/D174474
2023-04-03 13:45:57 +00:00
Mike Hommey
93784bacca Bug 1825478 - Update bindgen to 0.64. r=emilio,necko-reviewers,supply-chain-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D174054
2023-03-30 21:05:14 +00:00
Emilio Cobos Álvarez
2d0e69f4a1 Bug 1824957 - Remove a bunch of now completely dead XUL layout code. r=layout-reviewers,desktop-theme-reviewers,devtools-reviewers,dao,TYLin
And some related tests.

A bunch of -moz-box* properties are web exposed, so I'll file a
follow-up for hiding them.

Differential Revision: https://phabricator.services.mozilla.com/D173819
2023-03-29 21:23:55 +00:00
CanadaHonk
e276d6225d Bug 1166581 - Implement scripting media feature r=emilio
Implemented the scripting media feature.

Not locked behind a pref as it does not do anything new or particularly
give new data which could be used for fingerprinting (see <noscript>,
etc).

Also added new WPT tests (none previously). Not supported in any other
browsers yet.

Test page: https://goose.icu/media-scripting

Differential Revision: https://phabricator.services.mozilla.com/D172995
2023-03-28 08:01:49 +00:00
CanadaHonk
bb6c288d83 Bug 1820412 - CSS comp funcs should handle NaN contagiously r=emilio
If NaN is given as any input to CSS comp funcs (min/max/clamp), it
should return NaN. Does not cover simplification (see Bug 1820412).

Adjusted WPT test expectations, 18 newly pass. 🎉

Differential Revision: https://phabricator.services.mozilla.com/D171659
2023-03-28 07:24:46 +00:00
Boris Chiou
32323a3e4b Bug 1824426 - Remove layout.css.d-property.enabled. r=devtools-reviewers,longsonr
This feature was shipped in Fx97, and it seems we don't need this pref
anymore.

Differential Revision: https://phabricator.services.mozilla.com/D173591
2023-03-27 20:49:41 +00:00
Emilio Cobos Álvarez
c661ccc586 Bug 1822432 - Restyle pseudo-elements as well on part attribute changes. r=jwatt
Refactor a bit the code to unify how we deal with this conditional
restyling (we had similar code for
MustCascadeChildrenIfInheritResetStyle).

Differential Revision: https://phabricator.services.mozilla.com/D172890
2023-03-27 18:17:56 +00:00
Emilio Cobos Álvarez
ee5f6df022 Bug 1823214 - Minor clean ups on top of the previous patch. r=tlouw
Remove now dead Mul implementations. Use Self rather than the whole type
to shrink a bit the code.

Differential Revision: https://phabricator.services.mozilla.com/D173143
2023-03-27 08:57:35 +00:00
Tiaan Louw
28d119ff9e Bug 1823214 - Refactor mul_by fn into map fn. r=emilio
Refactor the mul_by function on leafs into a more generic map function
that can be used for more operations like abs, signum and mul.

Differential Revision: https://phabricator.services.mozilla.com/D172936
2023-03-27 08:05:47 +00:00
Boris Chiou
be7a7167d0 Bug 1824246 - Use auto as the initial value for view-timeline-inset. r=emilio
Per the proposal in https://github.com/w3c/csswg-drafts/issues/7747,
we change view-timeline-inset to have an initial value of auto.

Differential Revision: https://phabricator.services.mozilla.com/D173487
2023-03-24 19:16:42 +00:00
Cathie Chen
0d88e41955 Bug 1822521 - Update UA stylesheet for popover. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D172700
2023-03-22 17:51:09 +00:00
Emilio Cobos Álvarez
270562464f Bug 1823545 - Reuse declaration block with SVG presentation attributes. r=smaug
Ideally we'd only update the attributes that actually changed. That's a
bit more work I can try to look into, but this and bug 1823686 should
improve things here.

Differential Revision: https://phabricator.services.mozilla.com/D173162
2023-03-22 18:12:20 +00:00
Emilio Cobos Álvarez
cb2a32d8af Bug 1823455 - Merge ScrollFrameHelper and nsHTMLScrollFrame. r=layout-reviewers,TYLin
Now that we've removed nsXULScrollFrame, ScrollFrameHelper can be
subsumed under nsHTMLScrollFrame.

I want to do this before making scrollbars non-XUL.

Renaming to mozilla::ScrollFrame is left for a follow-up bug.

Differential Revision: https://phabricator.services.mozilla.com/D173063
2023-03-22 13:06:40 +00:00
Emilio Cobos Álvarez
c062dcce43 Bug 1823642 - Optimize [id=foo] as #foo in querySelector/All. r=zrhoffman
This page seems to rely on this optimization being present. Optimizing
it is straight-forward. Why do they do that instead of using the #foo
syntax? Who knows.

Differential Revision: https://phabricator.services.mozilla.com/D173148
2023-03-21 21:40:12 +00:00
Zach Hoffman
96361c5339 Bug 1823602 - Check that the lowercase attribute is different before trying to track it r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D173112
2023-03-21 10:23:54 +00:00
Marian-Vasile Laza
f078cd0274 Backed out changeset 18595f6364ea (bug 1822521) for wpt failures on popover-focus-child-dialog.html. CLOSED TREE 2023-03-20 21:17:55 +02:00
Cathie Chen
1529996e68 Bug 1822521 - Update UA stylesheet for popover. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D172700
2023-03-20 17:01:11 +00:00
Tiaan Louw
03828b4c67 Bug 1822041 - Color interpolation takes none keyword into account r=emilio,layout-reviewers
Now that the none keyword is available, we can take it into account when
interpolating colors following the rules from the spec here:

https://drafts.csswg.org/css-color-4/#interpolation-missing

Differential Revision: https://phabricator.services.mozilla.com/D172666
2023-03-19 10:09:53 +00:00
Marian-Vasile Laza
a8ccc1f226 Backed out changeset 6dc913a054e9 (bug 1822521) for bc failures on browser_parsable_css.js. CLOSED TREE 2023-03-18 16:06:04 +02:00
Cathie Chen
c289513d2f Bug 1822521 - Update UA stylesheet for popover. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D172700
2023-03-18 12:56:18 +00:00
Tiaan Louw
1da980f4b4 Bug 1813481 - Allow 'none' keyword in color components r=emilio,supply-chain-reviewers,devtools-reviewers
Make use of the new changes in the cssparser that allows 'none' keywords
in color components where allowed.  We store the none values as 0.0 (as
per the spec) and mark the components with the flags. This way we don't
have to check anything on the components before doing calculations.

As this is the last part intended to be released for the new [color-4]
changes, I've also enabled the changes on nightly.

Differential Revision: https://phabricator.services.mozilla.com/D170208
2023-03-16 11:50:55 +00:00
Marian-Vasile Laza
b1bb1b3c9b Backed out changeset 160ac6b5f726 (bug 1813481) for assertion failure on nsCSSRenderingGradients.cpp. 2023-03-16 01:50:39 +02:00
Tiaan Louw
a7a28cf7a6 Bug 1813481 - Allow 'none' keyword in color components r=emilio,supply-chain-reviewers,devtools-reviewers
Make use of the new changes in the cssparser that allows 'none' keywords
in color components where allowed.  We store the none values as 0.0 (as
per the spec) and mark the components with the flags. This way we don't
have to check anything on the components before doing calculations.

As this is the last part intended to be released for the new [color-4]
changes, I've also enabled the changes on nightly.

Differential Revision: https://phabricator.services.mozilla.com/D170208
2023-03-15 21:10:43 +00:00
Butkovits Atila
45514b96bb Backed out changeset deabee2364d4 (bug 1813481) for causing assertion failures at gfxUtils.cpp. CLOSED TREE 2023-03-15 19:21:19 +02:00
David Shin
f144ecaef2 Bug 1820835: :has relative selector matching, with no caching/filtering. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D172019
2023-03-15 16:39:33 +00:00
Tiaan Louw
29eaf0b759 Bug 1813481 - Allow 'none' keyword in color components r=emilio,supply-chain-reviewers,devtools-reviewers
Make use of the new changes in the cssparser that allows 'none' keywords
in color components where allowed.  We store the none values as 0.0 (as
per the spec) and mark the components with the flags. This way we don't
have to check anything on the components before doing calculations.

As this is the last part intended to be released for the new [color-4]
changes, I've also enabled the changes on nightly.

Differential Revision: https://phabricator.services.mozilla.com/D170208
2023-03-15 16:25:00 +00:00
Emilio Cobos Álvarez
cfd61f226f Bug 1427715 - Add (unused for now) parsing for support conditions in @import. r=CanadaHonk
You can use this as:

  input.try_parse(SupportsCondition::parse_for_import).ok()

Or so.

Differential Revision: https://phabricator.services.mozilla.com/D172668
2023-03-15 12:41:26 +00:00
Cristina Horotan
d17ba6a363 Backed out changeset 00e23971f01b (bug 1813481) for causing xpcshell failures at test_css-properties-db.js CLOSED TREE 2023-03-15 11:19:59 +02:00
Tiaan Louw
56e7e7777d Bug 1813481 - Allow 'none' keyword in color components r=emilio,supply-chain-reviewers
Make use of the new changes in the cssparser that allows 'none' keywords
in color components where allowed.  We store the none values as 0.0 (as
per the spec) and mark the components with the flags. This way we don't
have to check anything on the components before doing calculations.

As this is the last part intended to be released for the new [color-4]
changes, I've also enabled the changes on nightly.

Differential Revision: https://phabricator.services.mozilla.com/D170208
2023-03-15 08:15:54 +00:00
Zach Hoffman
4f5c70443d Bug 1818151 - Record attribute dependencies within the selector list of :nth-child(... of <selector list>) r=emilio
There are separate filters for IDs, classes, attribute local names, and
element state.

Also, we invalidate siblings of elements matched against the selector
list of :nth-child(... of <selector list>) by marking matched elements
with NODE_HAS_SLOW_SELECTOR_NTH_OF.

The only remaining invalidation case invalidation case is
`:nth-child(An+B of :has())` (bug 1818155), which should not block
shipping `layout.css.nth-child-of.enabled`, because :has(...) is still
being implemented (bug 418039).

Depends on D172352

Differential Revision: https://phabricator.services.mozilla.com/D171936
2023-03-15 06:56:21 +00:00
Zach Hoffman
2e75c9c9f6 Bug 1480746 - Apply selector flags to the shadow root r=emilio
Because restyle events cannot be posted for non-element nodes like the
shadow root, a child's siblings are restyled directly if its parent has
NODE_HAS_SLOW_SELECTOR or NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS but that
parent is the shadow root.

Drive-by, but braces were also added to some single-line "if" statements
in RestyleManager.

Differential Revision: https://phabricator.services.mozilla.com/D172352
2023-03-14 21:23:05 +00:00
Emilio Cobos Álvarez
8d249fa588 Bug 1684958 - Support rendering content: <gradient> images. r=dholbert,devtools-reviewers
We implemented support for list-style-image anyways.

Differential Revision: https://phabricator.services.mozilla.com/D172343
2023-03-14 12:11:34 +00:00
CanadaHonk
3bbca01da2 Bug 1736914 - Implement prefers-reduced-transparency media query r=geckoview-reviewers,emilio,jonalmeida,ohall
Implemented the prefers-reduced-transparency media query for all
platforms.

Windows and Mac have specific settings which are used, others (Android
and Linux/GTK) have it enabled if prefers-reduced-motion is also enabled
as there is no dedicated setting to check.

Locked behind new pref `layout.css.prefers-reduced-transparency.enabled`,
off by default always for now.

Also added new WPT tests (none previously).

Demo video: https://goose.icu/firefox_prt.mp4
Test page: https://goose.icu/prefers-reduced-transparency

Differential Revision: https://phabricator.services.mozilla.com/D172424
2023-03-13 21:30:17 +00:00
Emilio Cobos Álvarez
bbb3605eb1 Bug 1821514 - Simplify/remove a couple other length operations. r=CanadaHonk
Differential Revision: https://phabricator.services.mozilla.com/D172430
2023-03-13 17:49:58 +00:00
Emilio Cobos Álvarez
bd6c2daf15 Bug 1821514 - Fix a couple minor issues with the previous patch. r=CanadaHonk
Having unused imports and undocumented functions trigger warnings that
don't build in automation.

Differential Revision: https://phabricator.services.mozilla.com/D172429
2023-03-13 17:49:57 +00:00
CanadaHonk
dd00a0c918 Bug 1821514 - Serialize NaN and infinity lengths r=emilio
Lengths using NaN and infinity are now serialized properly with some
improvements to computed values as well.

Also added a few minor new relevant WPT tests.
35 WPT tests newly pass 🎉

Differential Revision: https://phabricator.services.mozilla.com/D172183
2023-03-13 17:49:57 +00:00
CanadaHonk
a19c27e1da Bug 1821532 - Infinity angles should degenerate compute to 0 r=layout-reviewers,emilio
Also adjusted WPT tests to always expect deg like similar past changes.

WPT tests: https://github.com/web-platform-tests/wpt/blob/master/css/css-values/calc-infinity-nan-computed.html#L57-L71

Differential Revision: https://phabricator.services.mozilla.com/D172401
2023-03-13 11:38:45 +00:00
Emilio Cobos Álvarez
c89c761da3 Bug 1821782 - Rustfmt recent changes to calc.rs. r=CanadaHonk
Differential Revision: https://phabricator.services.mozilla.com/D172339
2023-03-13 11:33:23 +00:00
Emilio Cobos Álvarez
7cd2a63e0c Bug 1821782 - Add resolution support to calc(). r=CanadaHonk
Differential Revision: https://phabricator.services.mozilla.com/D172338
2023-03-13 11:33:22 +00:00
Emilio Cobos Álvarez
fdabf61900 Bug 1820661 - Make image-set without valid images render nothing. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D172341
2023-03-13 11:22:06 +00:00
Boris Chiou
82fb47220f Bug 1489392 - Part 1: Re-define CoordPair struct. r=emilio
Redefine/Rename the fields in CoordPair to align the data members of gfx::Point.

Differential Revision: https://phabricator.services.mozilla.com/D5903
2023-03-10 19:19:28 +00:00
Ziran Sun
e1b24f642b Bug 1820544 - Add popover attribute and part of basic popover functionality. r=emilio
Starts to add part of the basic functionality for popover. Including
[1] :open & :closed CSS pseudo class
[2] showPopover(), hidePopover() and togglePopover() interfaces. Much of the
functionality is still to-do.
[3] PopoverData interface

Differential Revision: https://phabricator.services.mozilla.com/D171719
2023-03-10 10:52:20 +00:00
CanadaHonk
2e77b5dde1 Bug 1820875 - Parse and serialize NaN and infinity times correctly r=emilio
Times like NaN and infinity are now parsed and serialized correctly.

Rewrote time to use `calc_clamping_mode` instead of `was_calc` to
stop some parse-time clamping which broke these values.

Adjusted WPT test expectations, 19 newly pass 🎉

Also added a new WPT test to cover a missing edge case:
`calc(1<unit> * NaN)` -> `calc(NaN * 1<canonical_unit>)`

The very similar angle tests do this already for angle's units.

Differential Revision: https://phabricator.services.mozilla.com/D171911
2023-03-08 15:04:13 +00:00
Boris Chiou
4fa8c3ce41 Bug 1814786 - Part 6: Create timeline objects when mutating scroll-timeline property. r=emilio
And so we can lookup the timeline from TimelineCollection.

Differential Revision: https://phabricator.services.mozilla.com/D169273
2023-03-07 23:57:55 +00:00
Emilio Cobos Álvarez
01a41fb486 Bug 1820280 - Be consistent for which URIs we expose chrome rules. r=dshin
Differential Revision: https://phabricator.services.mozilla.com/D171640
2023-03-07 20:22:23 +00:00
David Shin
5cf1d55ffc Bug 1774588 - Parsing for relative selectors in :has(). r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D171358
2023-03-07 18:04:27 +00:00
Tiaan Louw
c8476cb106 Bug 1817641 - Convert RGBA to AbsoluteColor for computed/animated/resolved CSS colors r=emilio
Computed color values will not be in the correct format, closer to the
one specified by the author.  This also means that colors accross the
code are stored now as AbsoluteColor or StyleAbsoluteColor.  This allows
color space/gamut information to be available for use.

Some animation related test failures had to be changed, because colors
now has greater precision.  Animated a color now causes a lot more
animation updates, which was not initially expected.  See the bug for
discussion.

Differential Revision: https://phabricator.services.mozilla.com/D171021
2023-03-07 11:28:15 +00:00
CanadaHonk
659a4a38c8 Bug 1820407 - Serialize NaN and infinity angles as per spec r=emilio
`NaN`, `infinity`, and `-infinity` angles should be specially serialized.

Also fixed a few relevant WPT tests which did not follow spec.
(see https://github.com/web-platform-tests/wpt/pull/38825)

Adjusted WPT test expectations, 40 newly pass 🎉

Differential Revision: https://phabricator.services.mozilla.com/D171658
2023-03-07 00:02:55 +00:00
Boris Chiou
3fb6611d01 Bug 1820071 - Make <ray-size> optional and default to 'closest-side'. r=emilio
Per the spec update, the new syntax is:
  `ray() = ray( <angle> && <ray-size>? && contain? )`
And for `<ray-size>`:
  "If no <ray-size> is specified it defaults to closest-side."

So `<ray-size>` is optional and we omit it if it's default value, for
serialization.

By the way, offset=* properties are supported only in Gecko, so we don't
need a servo function to check the preference.

Differential Revision: https://phabricator.services.mozilla.com/D171625
2023-03-07 00:02:52 +00:00