Commit Graph

14583 Commits

Author SHA1 Message Date
Boris Chiou
3e70138099 Bug 1814444 - Part 2: Support self keyword for scroll(). r=emilio
`self` keyword specifies to use the element’s own principal box as the
scroll container. If the principal box is not a scroll container, then the
scroll progress timeline is inactive.

Differential Revision: https://phabricator.services.mozilla.com/D175707
2023-05-04 21:35:14 +00:00
Boris Chiou
9c425acafe Bug 1814444 - Part 1: Update the syntax of scroll() to accept <scroller> and <axis> in any order. r=emilio
The order of <scroller> and <axis> doesn't matter in the parser.
However, we serialize <scroller> first, if it is not the initial value.

Differential Revision: https://phabricator.services.mozilla.com/D173906
2023-05-04 21:35:14 +00:00
Emilio Cobos Álvarez
665c208b48 Bug 1830746 - Rework -x-text-zoom to allow disabling text zoom and min-font-size separately. r=jfkthame,layout-reviewers
And use it instead of explicit document checks. This centralizes where
we check for it.

IsChromeDoc is relatively cheap, but this bug wants to also check for
PDF.js which is a bit more expensive.

No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D176940
2023-05-03 15:02:40 +00:00
Tiaan Louw
2f2f3fd797 Bug 1819893 - Add negate node to use in place of mul_by in sum nodes r=emilio
Sum nodes would use mul_by to negate nodes to do subtraction, but some
nodes are not distributive.  This patch adds a negate node, so that the
operations inside these negate nodes can be resolved first and then the
"subtraction" can be applied.

Differential Revision: https://phabricator.services.mozilla.com/D172941
2023-05-03 14:04:28 +00:00
Boris Chiou
97804f78e4 Bug 1808410 - Part 2: Add animation-timeline: view() in style system. r=emilio
Support view() notation for animation-timeline:
  `<view()> = view( [ <axis> || <'view-timeline-inset'> ]? )`

We move AnimationTimeline and its related types into the generics folder,
and define two new structs for scroll() and view().

Note:
1. The syntax of scroll() doesn't match the current version of the spec.
   I will update it in Bug 1814444.
2. We will handle the creation/usage of the Anonymous View Progress Timelines
   in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D173904
2023-05-02 22:47:28 +00:00
Boris Chiou
2e30d8e41a Bug 1808410 - Part 1: Move animation-related values from box.rs/ui.rs to animation.rs. r=emilio
Although we store animation and transition style values in StyleUIReset and
define their properties in longhands/ui.mako.rs, but we may move them in
the future if this style struct becomes too large. So let's move the
definition of their values to an independent module, animation, so we
don't have to worry about this again.

This patch doesn't change any other things. Only move code.

Differential Revision: https://phabricator.services.mozilla.com/D173903
2023-05-02 22:47:28 +00:00
CanadaHonk
1829e4631d Bug 1830656 - Refactor ImportLayer into enum r=emilio
Refactored ImportLayer into an enum instead of a struct and using
Option everywhere.

Differential Revision: https://phabricator.services.mozilla.com/D176793
2023-05-01 21:56:33 +00:00
Sandor Molnar
f902ec02ed Backed out changeset 155b9abe4a7e (bug 1830656) for causing dt and wpt failures in layer-rules-cssom.html / browser_rules_layer.js CLOSED TREE 2023-05-01 22:40:04 +03:00
Cosmin Sabou
543905e105 Backed out 3 changesets (bug 1809568) for causing build bustages on nsBlockFrame.cpp. CLOSED TREE
Backed out changeset eaa7fe280317 (bug 1809568)
Backed out changeset ab0f2bcb2d9b (bug 1809568)
Backed out changeset a481bf06452b (bug 1809568)
2023-05-01 21:42:14 +03:00
David Shin
16b1b29afc Bug 1809568 - Part 1: Implement parsing for baseline-source. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D173884
2023-05-01 17:04:26 +00:00
CanadaHonk
eb9199d00d Bug 1830656 - Refactor ImportLayer into enum r=emilio
Refactored ImportLayer into an enum instead of a struct and using
Option everywhere.

Differential Revision: https://phabricator.services.mozilla.com/D176793
2023-05-01 16:58:00 +00:00
CanadaHonk
df62a3d803 Bug 1823295 - Serialize NaN and infinity percentages correctly r=emilio
NaN and infinity percentages are now serialized as expected.

Also added some new WPT tests as percentages were previously untested
and added some spec comments to previous NaN/inf serialization code.

Differential Revision: https://phabricator.services.mozilla.com/D176726
2023-05-01 14:50:32 +00:00
Natalia Csoregi
a4769113a6 Backed out changeset 8b600348f317 (bug 1830656) for causing failures on browser_rules_conditional_import.js. CLOSED TREE 2023-05-01 18:43:20 +03:00
Iulian Moraru
c9ffb3ffa8 Backed out 3 changesets (bug 1809568) for causing build bustages on nsLineLayout.cpp. CLOSED TREE
Backed out changeset 573dc0bd9554 (bug 1809568)
Backed out changeset b8401947aea0 (bug 1809568)
Backed out changeset 7ecabe895121 (bug 1809568)
2023-05-01 17:59:21 +03:00
CanadaHonk
e50ec05b89 Bug 1830656 - Refactor ImportLayer into enum r=emilio
Refactored ImportLayer into an enum instead of a struct and using
Option everywhere.

Differential Revision: https://phabricator.services.mozilla.com/D176793
2023-05-01 14:06:02 +00:00
David Shin
c7ff30bfe7 Bug 1809568 - Part 1: Implement parsing for baseline-source. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D173884
2023-05-01 13:44:43 +00:00
Emilio Cobos Álvarez
8d2220d803 Bug 1830369 - [css-nesting] Update cssparser to allow parsing qualified rules along with declarations. r=tlouw,supply-chain-reviewers
No implementation just yet (the default QualifiedRuleParser
implementation just rejects stuff), but this is plumbing that I'd rather
get reviewed separately.

Differential Revision: https://phabricator.services.mozilla.com/D176686
2023-04-29 18:21:25 +00:00
Emilio Cobos Álvarez
9b2cb69ca0 Bug 1830134 - [css-nesting] Process nested rules at cascade data rebuild. r=firefox-style-system-reviewers,zrhoffman
More nesting plumbing. Still does nothing because we don't parse the
nested rules.

Should be trivial to prove this patch doesn't change any behavior so
far, but I want to land it on its own because it can have performance
implications.

This follows the pattern of what we do with other rules like layers and
container conditions, that is, keep the ancestor selectors in a stack,
and poke at the last one in order to replace the ancestor.

This changes the behavior of replace_parent_selector as with the newer
version of the spec, stuff like:

  div {
    .foo {
      stuff
    }
  }

Should work as `div .foo`. A test is added for this case.

Differential Revision: https://phabricator.services.mozilla.com/D176560
2023-04-28 00:02:45 +00:00
Emilio Cobos Álvarez
7a5c30a7a8 Bug 1830109 - [css-nesting] Add storage for nested rules. r=firefox-style-system-reviewers,zrhoffman
Allow to have a CssRules list inside a StyleRule.

This only introduces the storage and serialization code for them, but we
still don't parse it.

Differential Revision: https://phabricator.services.mozilla.com/D176550
2023-04-28 00:02:45 +00:00
CanadaHonk
f6611009c2 Bug 1829590 - Add CSSImportRule supportsText attribute r=emilio
Added the new CSSImportRule supportsText attribute to allow pages to
read supports conditions for CSS imports with JS.

Spec PR: https://github.com/w3c/csswg-drafts/pull/8712

Differential Revision: https://phabricator.services.mozilla.com/D176685
2023-04-27 22:46:41 +00:00
Emilio Cobos Álvarez
873d09c98e Bug 1830342 - Enable all math functions on chrome code. r=dholbert
They should be stable.

Not sure this is worth writing a test for since the idea is that this
code goes away eventually.

Differential Revision: https://phabricator.services.mozilla.com/D176680
2023-04-27 19:52:28 +00:00
Emilio Cobos Álvarez
3f56c738cc Bug 1830141 - Share code to parse @import layer + supports(). r=CanadaHonk
The duplication was slightly annoying me :)

Differential Revision: https://phabricator.services.mozilla.com/D176564
2023-04-26 19:18:43 +00:00
CanadaHonk
666251caf7 Bug 1827941 - Do not preload nonmatching @import supports() r=emilio
Added evaluating supports() conditions in the import preload scanner
and not emitting URLs if they do not match.

There is no use preloading imports for features we do not support,
as they will never be loaded since supports() conditions cannot change mid-page.

Also tweaked internals a bit (added a generic ResetState internal func) and
added a new gtest for import supports(), plus a WPT test print test.

Differential Revision: https://phabricator.services.mozilla.com/D175432
2023-04-25 07:22:29 +00:00
CanadaHonk
c3682adcc9 Bug 1829430 - Fix @import supports() parsing position r=emilio
Fixed @import supports() being parsed in the incorrect position as per spec.

Also added more WPT tests for layer and supports in one @import.

Differential Revision: https://phabricator.services.mozilla.com/D176193
2023-04-22 21:46:15 +00:00
Narcis Beleuzu
80eda37a2d Backed out changeset 59455d15fb58 (bug 1829430) for wpt failure on import-conditions.html . CLOSED TREE 2023-04-22 16:17:43 +03:00
CanadaHonk
e327a756ba Bug 1829430 - Fix @import supports() parsing position r=emilio
Fixed @import supports() being parsed in the incorrect position as per spec.

Also added more WPT tests for layer and supports in one @import.

Differential Revision: https://phabricator.services.mozilla.com/D176193
2023-04-22 12:30:30 +00:00
CanadaHonk
4b5e00b09f Bug 1829376 - Fix @import serialization order r=emilio
Fixed @import serialization being out of (spec) order.

Also added some more WPT tests.

Differential Revision: https://phabricator.services.mozilla.com/D176182
2023-04-21 21:09:39 +00:00
Emily McDonough
1b8e6e65ca Bug 1828534 - Separate page style getter in ServoStyleSet r=emilio
Servo_ComputedValues_GetForAnonymousBox currently takes an extra argument for
page-name values which is only used for page content.

As more CSS page3 support is added, the methods of specifying page content
will need to grow (notably for pseudo classes), and the implementation
currently has a mostly separate code path for page-content.

We can separate these out to simplify both the caller and the implementation.

Differential Revision: https://phabricator.services.mozilla.com/D175708
2023-04-21 18:54:30 +00:00
Emilio Cobos Álvarez
fa37578f52 Bug 1828413 - Use more non-native rendering of menus. r=stransky
This makes our menus closer to GTK4, and depends less on the native menu
rendering etc. Thunderbird already does this to some extent.

Leave the old code behind a pref for now (just in case). Also fix some
code in nsNativeTheme::GetContentState (fixes rendering of radio menu
items).

Differential Revision: https://phabricator.services.mozilla.com/D175664
2023-04-20 11:42:44 +00:00
Cristina Horotan
8b53b2373f Backed out changeset c099d64b17e6 (bug 1828413) for causing multiple Menu related failures. CLOSED TREE 2023-04-19 14:51:33 +03:00
Emilio Cobos Álvarez
a71dc7a55b Bug 1828413 - Use more non-native rendering of menus. r=stransky
This makes our menus closer to GTK4, and depends less on the native menu
rendering etc. Thunderbird already does this to some extent.

Leave the old code behind a pref for now (just in case). Also fix some
code in nsNativeTheme::GetContentState (fixes rendering of radio menu
items).

Differential Revision: https://phabricator.services.mozilla.com/D175664
2023-04-19 10:08:30 +00:00
Jonathan Kew
9c1b2512f5 Bug 1826629 - Implement CSS and rendering (but not copy/paste) support for the (non-standard) -webkit-text-security property. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D174951
2023-04-18 11:47:07 +00:00
Emilio Cobos Álvarez
26057c5cec Bug 1828316 - Avoid linear search to check for custom property presence. r=firefox-style-system-reviewers,zrhoffman
The test-case in the next patch from 10s to a couple hundred
milliseconds on my machine. No behavior change other than that.

Differential Revision: https://phabricator.services.mozilla.com/D175612
2023-04-18 11:09:31 +00:00
Mirko Brodesser
c47bb134d2 Bug 1825807: part 1) Replace popover's ':open' and ':closed' pseudo-classes with ':popover-open'. r=emilio
See https://github.com/whatwg/html/pull/9077.

Differential Revision: https://phabricator.services.mozilla.com/D175223
2023-04-17 12:18:03 +00:00
Emilio Cobos Álvarez
96d18c725e Bug 1828183 - Remove cascade layers pref. r=CanadaHonk
These have been enabled by default for quite a while.

Differential Revision: https://phabricator.services.mozilla.com/D175513
2023-04-14 19:05:28 +00:00
CanadaHonk
4d4ecbb77c Bug 1427715 - Implement supports() syntax for @import rules r=emilio
Implemented supports conditions using supports() in @import rules as per
CSS Cascading and Inheritance Level 4.

Locked behind new pref, layout.css.import-supports.enabled,
only enabled in nightlies in this patch.

Also added new WPT tests for @import supports() generally.

Spec: https://drafts.csswg.org/css-cascade-4/#conditional-import
WPT tests: https://wpt.fyi/results/css/css-cascade/import-conditions.html

Differential Revision: https://phabricator.services.mozilla.com/D172622
2023-04-13 09:02:30 +00:00
Noemi Erli
e75f4068fb Backed out 2 changesets (bug 1825807) for causing failures in /browser_parsable_css.js CLOSED TREE
Backed out changeset 454a01f16f5b (bug 1825807)
Backed out changeset a82344255795 (bug 1825807)
2023-04-13 12:24:41 +03:00
Mirko Brodesser
c888f7c357 Bug 1825807: part 1) Replace popover's ':open' and ':closed' pseudo-classes with ':popover-open'. r=emilio
See https://github.com/whatwg/html/pull/9077.

Differential Revision: https://phabricator.services.mozilla.com/D175223
2023-04-13 07:43:57 +00:00
Emilio Cobos Álvarez
3a961b3d9a Bug 1121792 - Allow to use ThinVec/nsTArray in the style crate. r=jfkthame,layout-reviewers
This allows to clean-up the previous patches by using a single ThinVec
(which stores length / capacity along with the allocation).

Differential Revision: https://phabricator.services.mozilla.com/D175029
2023-04-12 21:58:29 +00:00
Jonathan Kew
40a813f9c6 Bug 1121792 - Accept a comma-separated list of language codes in the :lang() pseudo. r=emilio
This is the other extension to the :lang() pseudo-class in  Selectors-4.
(Also supported in Safari.)

Depends on D174999

Differential Revision: https://phabricator.services.mozilla.com/D175000
2023-04-12 21:46:47 +00:00
Narcis Beleuzu
8d21434933 Backed out 6 changesets (bug 1121792) for mochitest failures in malloc_usable_size . CLOSED TREE
Backed out changeset 879211a561cc (bug 1121792)
Backed out changeset 195d689a6b12 (bug 1121792)
Backed out changeset 9726f4b6035a (bug 1121792)
Backed out changeset be24fa5c3e70 (bug 1121792)
Backed out changeset 2e4e3ae6cddd (bug 1121792)
Backed out changeset e535870263d8 (bug 1121792)
2023-04-12 22:26:19 +03:00
Emilio Cobos Álvarez
60a3fc507d Bug 1121792 - Allow to use ThinVec/nsTArray in the style crate. r=jfkthame,layout-reviewers
This allows to clean-up the previous patches by using a single ThinVec
(which stores length / capacity along with the allocation).

Differential Revision: https://phabricator.services.mozilla.com/D175029
2023-04-12 16:05:13 +00:00
Jonathan Kew
a3fca4a96b Bug 1121792 - Accept a comma-separated list of language codes in the :lang() pseudo. r=emilio
This is the other extension to the :lang() pseudo-class in  Selectors-4.
(Also supported in Safari.)

Depends on D174999

Differential Revision: https://phabricator.services.mozilla.com/D175000
2023-04-12 16:05:11 +00:00
CanadaHonk
2d520652e0 Bug 1794628 - Implement inverted-colors media feature r=geckoview-reviewers,morgan,emilio,m_kato,cmartin
Implemented the inverted-colors media feature from Media Queries Level 5
for all platforms.
Spec: https://drafts.csswg.org/mediaqueries-5/#inverted

Platform specific implementations:
- Windows: Checks system color filter setting, and if it is inverted
  (note: Windows does not live update due to having to read a reg key)
- Mac: Checks dedicated inverted accessibility system setting
- Android: Checks dedicated inverted system setting
- Linux: No GTK API exposes anything like it so always none

Locked behind new pref `layout.css.inverted-colors.enabled`,
always off by default for now.

Also added new WPT tests (none previously).

Other browsers:
- WebKit: shipped since Safari 9.1 (Jan 2017)
- Blink: no signal

Test page: https://goose.icu/inverted-colors

Differential Revision: https://phabricator.services.mozilla.com/D173201
2023-04-11 13:34:00 +00:00
Emilio Cobos Álvarez
48d4643670 Bug 1427715 - Allow CSSImportRule.styleSheet to be null. r=CanadaHonk,webidl,smaug
This doesn't match the CSSOM spec, but it seems fairly uncontroversial,
and our WebIDL already has the nullable annotation, see:

  https://github.com/w3c/csswg-drafts/issues/8608

This doesn't change behavior on its own, but it's needed for the other
patches in this bug.

Differential Revision: https://phabricator.services.mozilla.com/D172891
2023-04-11 11:32:45 +00:00
Zach Hoffman
4c155dc48d Bug 1808156 - Remove MatchingContext mutability FIXME that no longer applies r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D175028
2023-04-10 08:47:18 +00:00
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