Commit graph

25243 commits

Author SHA1 Message Date
Oriol Brufau
a7ca8022d3 style: [css-pseudo] Use 'white-space: pre' by default in ::marker
Differential Revision: https://phabricator.services.mozilla.com/D107359
2023-05-16 23:40:23 +02:00
Oriol Brufau
d8993eef7e Further changes required by Servo 2023-05-16 23:40:17 +02:00
Oriol Brufau
743f213c25 style: Move moz-control-character-visibility out of mako, and remove support for gecko_pref_controlled_initial_value
No behavior change, just cleanup. Actually seem this technically _adds_ some code even
though it's a cleanup, but that's mostly because of the wrapping of the
derive list.  The resulting code is simpler (more in-line with our usual
things, so I think it's an improvement).

Differential Revision: https://phabricator.services.mozilla.com/D111551
2023-05-16 23:17:16 +02:00
Oriol Brufau
fac547276f style: Remove various image-orientation related prefs
These shipped in 77.

Differential Revision: https://phabricator.services.mozilla.com/D111550
2023-05-16 23:16:24 +02:00
Oriol Brufau
693c2f0d27 style: Remove -moz-proton-infobars media query support
Differential Revision: https://phabricator.services.mozilla.com/D110963
2023-05-16 23:15:26 +02:00
Oriol Brufau
b40f4b6fec style: Clean up text-justify, and make distribute a parse-time alias
Since it's simpler, as discussed in the CSSWG issue.

Differential Revision: https://phabricator.services.mozilla.com/D111346
2023-05-16 23:14:19 +02:00
Oriol Brufau
bbc03a2577 style: Enable Proton Urlbar
Differential Revision: https://phabricator.services.mozilla.com/D110998
2023-05-16 23:13:14 +02:00
Oriol Brufau
7bb15f19f1 style: Remove dead prefers-color-scheme: no preference code
It was removed in bug 1643656.

Differential Revision: https://phabricator.services.mozilla.com/D111461
2023-05-16 23:12:19 +02:00
Oriol Brufau
3da3d76a08 style: Clean up NPAPI plugin fallback behavior
Similifies use of EventStates and ObjectType/FallbackType enums since most states they represented are no longer valid with the removal of NPAPI plugins.  The state machine for (unsupported) plugin elements is now much simpler but still distinguishes between HTML fallbacks, fallbacks leading to a "BROKEN" state (e.g. failing to load the image the element refers to), and fallbacks that would simply lead the element to occupy an empty region.  The last type of fallback is behind a pref "layout.use-plugin-fallback" and is disabled by default.

Simplifying the state machine allows us to clean up nsObjectLoadingContent.  We also update many of the enums which refered to plugins, which would otherwise get confusing.

Differential Revision: https://phabricator.services.mozilla.com/D107158
2023-05-16 23:03:45 +02:00
Oriol Brufau
f44a6909df style: Reduce boilerplate needed to add system-metric media features
There's no reason we can't just query LookAndFeel and we need to use
sSystemMetrics. In the past, LookAndFeel queries were not cached, but
this is no longer the case, so perf wise should be pretty equivalent.

Note that we don't need the NS_SUCCEEDED checks because the default
value from GetInt if the platform doesn't support it is 0 anyways.

Differential Revision: https://phabricator.services.mozilla.com/D110805
2023-05-16 23:02:50 +02:00
Oriol Brufau
3d9eabcccb style: Convert proton pref checks from @supports rules to media features
This means that dynamic changes will be handled correctly, we can use
StaticPrefs, etc.

Differential Revision: https://phabricator.services.mozilla.com/D110816
2023-05-16 23:01:29 +02:00
Oriol Brufau
7c26fb82b1 style: add an appearance type that forces a dropshadow on menus on Windows, and uses SetWindowRgn to clip the popup to the border radius
Differential Revision: https://phabricator.services.mozilla.com/D109833
2023-05-16 23:00:33 +02:00
Oriol Brufau
8a16ba74ec Further changes required by Servo 2023-05-16 22:58:48 +02:00
Oriol Brufau
4b973885a3 style: Add the size-adjust descriptor to the style system
Differential Revision: https://phabricator.services.mozilla.com/D110022
2023-05-16 22:58:04 +02:00
Oriol Brufau
3024516019 Further changes required by Servo 2023-05-16 22:43:09 +02:00
Oriol Brufau
4d2ccaf445 style: Use a single system font definition rather than two
Follow the pattern we use for system colors.

Differential Revision: https://phabricator.services.mozilla.com/D108822
2023-05-16 13:16:53 +02:00
Oriol Brufau
7da6d525ac Further changes required by Servo 2023-05-16 13:04:55 +02:00
Oriol Brufau
1cd257d54f style: Add ascent-, descent- and line-gap-override descriptors to the style system
Differential Revision: https://phabricator.services.mozilla.com/D109287
2023-05-16 13:04:36 +02:00
Oriol Brufau
5ef832b778 style: Convert the font-stretch descriptor to use NonNegativePercentage
Depends on D109285

Differential Revision: https://phabricator.services.mozilla.com/D109286
2023-05-16 13:04:14 +02:00
Oriol Brufau
4d4fb4b414 style: Create a NonNegativePercentage type in values:specified
Differential Revision: https://phabricator.services.mozilla.com/D109285
2023-05-16 13:03:52 +02:00
Oriol Brufau
3b2eef3d7d style: Part 2 - Add page-size attribute to nsStyleStruct and property parsing
This parsing is hidden behind the pref layout.css.page-size.enabled.

It isn't ideal that we parse this as a property, but we can't treat it as a
descriptor because of compatibility issues with other browsers. There are also
outstanding spec issues related to how descriptors like page-size are cascaded,
and whether the !important specifier is valid or not.

Differential Revision: https://phabricator.services.mozilla.com/D103958
2023-05-16 13:02:53 +02:00
Oriol Brufau
cdce0d3b34 style: Part 1 - Ignore any properties which aren't valid for a style rule when generating CSS2Properties and testing propertie
To know the valid rules for each property, we need to put this information
into the Servo prop list and add an appropriate getter to Longhand/Shorthand.

Differential Revision: https://phabricator.services.mozilla.com/D105825
2023-05-16 13:02:34 +02:00
Oriol Brufau
cbf2a91ec8 style: Remove unused -moz-default-appearance values -moz-mac-vibrancy-light/dark, and the system colors of the same name
Starting with macOS 10.14, the generic light/dark vibrancy is deprecated, and semantic vibrancy names are preferred.
If we ever need more vibrancy, we can add new values with semantic names.

Depends on D107910

Differential Revision: https://phabricator.services.mozilla.com/D108152
2023-05-16 13:02:17 +02:00
Oriol Brufau
261dcf1f6d Further changes required by Servo 2023-05-16 13:01:58 +02:00
Oriol Brufau
b0a1eaebaa style: Respect system colors in the color and background-color properties
The reason why this doesn't work is because these styles come from
datetimebox.css, which is really an author style.

We could special-case these elements, but the approach that the CSSWG resolved
on for the new forced-colors spec is to respect system colors specified by
authors, see:

https://drafts.csswg.org/css-color-adjust-1/#forced-colors-properties

So this moves us towards that, and fixes the issue nicely.

Differential Revision: https://phabricator.services.mozilla.com/D108321
2023-05-16 13:01:35 +02:00
Oriol Brufau
ed19da405f style: Invalidate a bit more aggressively when a pseudo-element matches, in order to also invalidate the cached pseudo-styles on the parent
This should probably be fine. If it becomes a perf issue somehow we can
implement the RESTYLE_PSEUDOS hint or what not.

Differential Revision: https://phabricator.services.mozilla.com/D108338
2023-05-16 13:01:18 +02:00
Oriol Brufau
1be19485bb style: Make -moz-accent-color reflect the windows accent color
And remove the windows-specific versions of this color.

Also fix the hard-coded defaults by the colors I get in the default windows
theme.

Differential Revision: https://phabricator.services.mozilla.com/D108325
2023-05-16 13:00:51 +02:00
Oriol Brufau
60e206143c Further changes required by Servo 2023-05-16 13:00:18 +02:00
Oriol Brufau
060d74ba3b style: Share CascadeData instances across ShadowRoots
This should be both a memory and speed win for pages using a lot of
Shadow DOM.

In order to make the cache properly work we need to start keying media query
results on the actual StyleSheetContents, as that's what we share on Gecko, but
that should all be fine.

Differential Revision: https://phabricator.services.mozilla.com/D107266
2023-05-16 13:00:08 +02:00
Oriol Brufau
11153c63fa style: Make the cascade data cache generic
We're going to use it both for UA sheets and for author styles in Shadow
DOM.

Differential Revision: https://phabricator.services.mozilla.com/D107265
2023-05-16 12:59:46 +02:00
Oriol Brufau
b38517757f style: Remove layout.css.ruby.position-alternate.enabled pref
Differential Revision: https://phabricator.services.mozilla.com/D114044
2023-05-16 12:59:19 +02:00
Oriol Brufau
17ae374c65 style: part 1 - Support parsing ruby-position: alternate
Differential Revision: https://phabricator.services.mozilla.com/D107382
2023-05-16 12:56:06 +02:00
Oriol Brufau
b222bd3162 style: Paper over a crash in non-nightly
Differential Revision: https://phabricator.services.mozilla.com/D107400
2023-05-16 12:55:42 +02:00
Oriol Brufau
108c50c6df Further changes required by Servo 2023-05-16 12:54:55 +02:00
Oriol Brufau
4cee8cf937 style: Support image-set in the content property
Differential Revision: https://phabricator.services.mozilla.com/D107397
2023-05-16 12:54:05 +02:00
Oriol Brufau
5c3be71f25 style: Have collect_completion_keywords return url and image-set for CursorImage
Differential Revision: https://phabricator.services.mozilla.com/D107381
2023-05-16 12:53:17 +02:00
Oriol Brufau
2bafbb46f5 style: Address spec changes re. color-mix
It was clarified that the percentages are weights, and two weights are
now allowed. Missing percentages are computed as 100% - the other or
50%. Other than that, commas are required etc, which is good since
that's how I implemented it originally.

Differential Revision: https://phabricator.services.mozilla.com/D107295
2023-05-16 12:51:27 +02:00
Oriol Brufau
685d269e31 style: Support image-set() on the cursor property
Differential Revision: https://phabricator.services.mozilla.com/D106745
2023-05-16 12:50:55 +02:00
Oriol Brufau
e1f254854d Further changes required by Servo 2023-05-16 12:50:25 +02:00
Oriol Brufau
980d10fc17 style: Implement basic color-mix() functionality, behind a pref, but exposed to chrome code
This is straight-forward and builds on the color animation code. This
implements only the <percentage> syntax, not the whole <color-adjuster>
syntax, which seems fairly more complex.

Of course, this only uses sRGB because that's all the colors we support,
but it should be feasible to extend to lab() / lch() colors once we
support those.

I believe this subset of syntax is useful and worth implementing, so
people can play with it and say if it's useful.

Differential Revision: https://phabricator.services.mozilla.com/D106698
2023-05-16 12:50:01 +02:00
Oriol Brufau
252b50931d Further changes required by Servo 2023-05-16 12:49:39 +02:00
Oriol Brufau
291b3ee573 style: Move extremum lengths to the individual Size / MaxSize types
This will prevent growing them when introducing fit-content(<length>).

This can _almost_ be derived, if it wasn't because of the quirky stuff.
I think the macro is probably good enough for now but let me know if you
disagree.

Differential Revision: https://phabricator.services.mozilla.com/D106713
2023-05-16 12:48:55 +02:00
Oriol Brufau
320f12aa07 style: Simplify StyleColor representation
There's no need for CurrentColor / Numeric variants when we can
represent them with the complex form.

Differential Revision: https://phabricator.services.mozilla.com/D106690
2023-05-16 12:48:27 +02:00
Oriol Brufau
efea71ff9b style: Cherry-pick various servo changes
All formatting and not-part-of-the-gecko-build changes.

Differential Revision: https://phabricator.services.mozilla.com/D106634
2023-05-16 08:14:58 +02:00
bors-servo
c5d31c3ab6
Auto merge of #29743 - Loirooriol:disable-style-fmt, r=mrobinson
Disable formatting for components/style/

Gecko doesn't enforce proper formatting, so disabling it will make it easier to backport changes from there.

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because there is no change in behavior

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2023-05-15 20:33:39 +02:00
Oriol Brufau
e6ace3acae Disable formatting for components/style/
Gecko doesn't enforce proper formatting, so disabling it will make it
easier to backport changes from there.
2023-05-15 17:45:25 +02:00
bors-servo
8dfd613aa1
Auto merge of #29727 - mrobinson:more-layout-dom-cleanup, r=jdm
More cleanup of the layout DOM wrappers

This PR includes two commits which continue to clean up the layout DOM wrappers.
 - in the first the unused `DangerousThreadSafeLayoutNode` trait is removed
 - in the second DOM-related code is combined into one source file in Layout 2020 and some traits are combined and removed.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #29688
- [x] These changes fix #29722
- [x] These changes do not require tests because they do not change behavior.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2023-05-13 16:32:55 +02:00
Martin Robinson
72b5fcd0b6 Combine DOM-related concepts in Layout 2020 into dom.rs 2023-05-13 11:52:59 +02:00
bors-servo
84982ff1ff
Auto merge of #29730 - stshine:flexbox-align-content, r=Loirooriol
layout_2020: Implement align-content in flexbox

Align all flex lines per `align-content`.

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [X] There are tests for these changes OR

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2023-05-12 17:31:46 +02:00
Martin Robinson
ab4bd2a133 Remove DangerousThreadSafeLayoutNode
Remove this trait and replace it by two non-public functions on
ServoThreadSafeLayoutNode. This requires making the iterator not
generic, which simplifies things a little bit as well.
2023-05-12 08:18:31 +02:00