Tiaan Louw
3d0cf4dbf9
style: Add simple parsing and matching support for :has
...
Parsing is behind a config value `layout.css.has-selectors.enabled`. This
change does not support p:has(> a) combinators, but will handle them
gracefully, just not matching on them.
Differential Revision: https://phabricator.services.mozilla.com/D149515
2023-10-02 14:37:19 +00:00
Emilio Cobos Álvarez
dcdf9f33d5
style: Fix grid shorthand parsing to not incorrectly ignore the last token in one case
...
Differential Revision: https://phabricator.services.mozilla.com/D149666
2023-10-02 14:37:19 +00:00
Mike Hommey
fb95cb7993
style: Update stylo to itertools:0.10, itoa:1.0 and toml:0.5
...
Differential Revision: https://phabricator.services.mozilla.com/D149454
2023-10-02 14:37:19 +00:00
Jonathan Kew
becb855b3a
style: Only accept the CSS2 font-variant values (normal/small-caps) in the font shorthand; CSS Fonts 3/4 font-variant additions are not allowed
...
Differential Revision: https://phabricator.services.mozilla.com/D149440
2023-10-02 14:37:19 +00:00
Emilio Cobos Álvarez
6a5f012d3b
style: Fix dynamic viewport size
...
Differential Revision: https://phabricator.services.mozilla.com/D149275
2023-10-02 14:37:19 +00:00
Emilio Cobos Álvarez
5de65d9f2c
style: Make viewport-relative units zoomable via "zoom text only"
...
They're not font relative, so it we probably want them to be zoomed.
Differential Revision: https://phabricator.services.mozilla.com/D148796
2023-10-02 14:37:19 +00:00
Boris Chiou
82d7f2154d
style: Hook named scroll timelines to animation-timeline
...
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
2023-10-02 14:37:19 +00:00
Boris Chiou
13acff77d1
style: Support scroll-timeline shorthand in style system
...
Implement
"scroll-timeline: <'scroll-timeline-axis'> || <'scroll-timeline-name'>".
Differential Revision: https://phabricator.services.mozilla.com/D146020
2023-10-02 14:37:19 +00:00
Boris Chiou
0c709f714b
style: Support scroll-timeline-axis longhand in style system
...
Implement "scroll-timeline-axis: block | inline | vertical | horizontal".
Differential Revision: https://phabricator.services.mozilla.com/D146019
2023-10-02 14:37:19 +00:00
Boris Chiou
8d8594ef86
style: Support scroll-timeline-name longhand in style system
...
Implement "scroll-timeline-name: none | <custom-ident>".
Differential Revision: https://phabricator.services.mozilla.com/D146018
2023-10-02 14:37:19 +00:00
Oriol Brufau
105050d46d
Further changes required by Servo
2023-10-02 14:37:19 +00:00
Emilio Cobos Álvarez
dcafbde256
style: Move fixed-point font types to Rust
...
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
2023-10-02 14:37:19 +00:00
Mike Hommey
48749641d3
style: Update derive_more to 0.99.17
...
Limit its features to those we actually use, which turns out is none for
webrender_api.
Differential Revision: https://phabricator.services.mozilla.com/D148734
2023-10-02 14:37:19 +00:00
Oriol Brufau
04a817c0d2
Further changes required by Servo
2023-10-02 14:37:19 +00:00
Emilio Cobos Álvarez
c283b32991
style: Add a low-priority selector list for pseudo-classes that have global rules
...
This avoids trying to match those global rules for most elements that
can't match them anyways.
Differential Revision: https://phabricator.services.mozilla.com/D147640
2023-10-02 14:37:19 +00:00
Tiaan Louw
1162204bad
style: Rename :-moz-modal-dialog to :modal
...
Differential Revision: https://phabricator.services.mozilla.com/D148751
2023-10-02 14:37:19 +00:00
Emilio Cobos Álvarez
7f81cd4f7c
style: While at it use some better names for some bits
...
Differential Revision: https://phabricator.services.mozilla.com/D148538
2023-10-02 14:37:19 +00:00
Oriol Brufau
6c3f92cb85
Further changes required by Servo
2023-10-02 14:37:19 +00:00
Emilio Cobos Álvarez
1ce75ff7dd
style: Unify Gecko and Servo EventState/ElementState bits
...
Add a dom/base/rust crate called just "dom" where we can share these.
Most of the changes are automatic:
s/mozilla::EventStates/mozilla::dom::ElementState/
s/EventStates/ElementState/
s/NS_EVENT_STATE_/ElementState::/
s/NS_DOCUMENT_STATE_/DocumentState::/
And so on. This requires a new cbindgen version to avoid ugly casts for
large shifts.
Differential Revision: https://phabricator.services.mozilla.com/D148537
2023-10-02 14:37:19 +00:00
David Shin
949fd0e172
style: Add parsing for linear easing function and gate it behind pref
...
Differential Revision: https://phabricator.services.mozilla.com/D146839
2023-10-02 14:37:19 +00:00
David Shin
b31be826c4
style: Hook up linear easing calculation for servo and expose it to C++
...
Differential Revision: https://phabricator.services.mozilla.com/D146838
2023-10-02 14:37:19 +00:00
David Shin
6326a384a8
style: Rust side plumbing work for linear easing function
...
Add LinearFunction to TimingFunction. Because the linear function is a
variable list of linear stops, the enum is no longer Copyable.
Differential Revision: https://phabricator.services.mozilla.com/D146837
2023-10-02 14:37:19 +00:00
Samson
aa41fbd8f6
Media query resolution ( #30406 )
...
* Add resolution and device-pixel-ratio media query
* Update expectations
2023-09-22 16:18:00 +00:00
dependabot[bot]
9c310b6d4e
build(deps): bump parking_lot from 0.11.2 to 0.12.0 ( #30199 )
...
* build(deps): bump parking_lot from 0.11.2 to 0.12.0
Bumps [parking_lot](https://github.com/Amanieu/parking_lot ) from 0.11.2 to 0.12.0.
- [Changelog](https://github.com/Amanieu/parking_lot/blob/master/CHANGELOG.md )
- [Commits](https://github.com/Amanieu/parking_lot/compare/0.11.2...0.12.0 )
---
updated-dependencies:
- dependency-name: parking_lot
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
* Upgrade parking-log in style and layout_thread* as well
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2023-08-25 12:19:13 +00:00
Samson
c0bee7cb86
Format toml files ( #30112 )
...
* Add taplo fmt config for toml fmt
* fmt toml files
* Add even-better-toml to extensions recommendations
2023-08-17 15:07:43 +00:00
Emilio Cobos Álvarez
9b16626a8f
style: Add an input-region-margin to widgets, and implement it on Linux
...
Recompute the input region when resizing the widget and so on, and use
it to check for rollups.
Depends on D148211
Differential Revision: https://phabricator.services.mozilla.com/D148222
2023-08-16 17:46:41 +02:00
Oriol Brufau
274d273f50
Further changes required by Servo
2023-08-16 17:46:41 +02:00
Emilio Cobos Álvarez
b6e8088e8e
style: Use ColorMix for interpolated colors in the computed style rather than ComplexColorRatios
...
This among other things preserves the right color-space when
interpolating currentColor.
Differential Revision: https://phabricator.services.mozilla.com/D147512
2023-08-16 17:46:41 +02:00
Emilio Cobos Álvarez
0ac6aaa357
style: Remove -moz-scrollbar-thumb-proportional
...
It unconditionally matches on all platforms, so it's not returning any useful information.
Depends on D147689
Differential Revision: https://phabricator.services.mozilla.com/D147690
2023-08-16 17:46:41 +02:00
Mike Hommey
56551bec58
style: Update style to uluru 3.0
...
Differential Revision: https://phabricator.services.mozilla.com/D147477
2023-08-16 17:46:41 +02:00
Mike Hommey
036b067d65
style: Update style to arrayvec 0.7
...
Differential Revision: https://phabricator.services.mozilla.com/D147476
2023-08-16 17:46:41 +02:00
Mike Hommey
7bc667f6b4
style: Fix warnings about whitelist/blocklist functions being deprecated in bindgen 0.59
...
Differential Revision: https://phabricator.services.mozilla.com/D147695
2023-08-16 17:46:41 +02:00
Emilio Cobos Álvarez
c0ecfde11c
style: Remove some dead vibrancy code
...
Drive-by cleanup.
Differential Revision: https://phabricator.services.mozilla.com/D147698
2023-08-16 17:46:41 +02:00
Emilio Cobos Álvarez
6ae56890b3
style: Improve Percentage -> LengthPercentage conversion
...
This doesn't change behavior because we only use them for images that
have no clamping.
Depends on D147008
Differential Revision: https://phabricator.services.mozilla.com/D147511
2023-08-16 17:46:41 +02:00
Emilio Cobos Álvarez
079fce37d2
style: Do hue interpolations in degrees rather than radians. r=barret
...
This gives us a bit more precision.
Differential Revision: https://phabricator.services.mozilla.com/D147007
2023-08-16 17:46:41 +02:00
Emilio Cobos Álvarez
bc1845a8f8
style: Fix hue adjustment to match the spec
...
The value to sum is tau, not pi. This was caught by some tests, see
https://drafts.csswg.org/css-color/#shorter
Differential Revision: https://phabricator.services.mozilla.com/D147006
2023-08-16 17:46:41 +02:00
Emilio Cobos Álvarez
1e5079ca00
style: Fix color-mix() percentage normalization
...
Differential Revision: https://phabricator.services.mozilla.com/D147005
2023-08-16 17:46:41 +02:00
Emilio Cobos Álvarez
6fc4355dc2
style: Implement more color-mix() color-spaces
...
We had code to convert between these and the latest draft supports them so...
Differential Revision: https://phabricator.services.mozilla.com/D147004
2023-08-16 17:46:41 +02:00
Emilio Cobos Álvarez
95e9898db4
style: Make the color interpolation code more generic
...
It's really piece-wise premultiplied interpolation, with a special-case
for hue, so centralize the implementation.
Differential Revision: https://phabricator.services.mozilla.com/D147003
2023-08-16 17:46:41 +02:00
Oriol Brufau
0fc3267d2e
Further changes required by Servo
2023-08-16 17:46:41 +02:00
Emilio Cobos Álvarez
f4ede10441
style: Update color-mix() syntax to match the current spec
...
Test expectation updates for this in the latest patch of the bug.
Differential Revision: https://phabricator.services.mozilla.com/D147002
2023-08-16 17:46:41 +02:00
Hiroyuki Ikezoe
3723a7b18d
style: Parse scroll-snap-stop style and propagate it to APZ side
...
Depends on D146147
Differential Revision: https://phabricator.services.mozilla.com/D145850
2023-08-16 17:46:41 +02:00
Emilio Cobos Álvarez
d1aeb3921b
style: Cache computed styles objects display: none subtrees
...
This reuses our existing undisplayed style generation, but in a
per-document rather than per-nsComputedDOMStyle object, which means that
we can avoid re-resolving styles of elements in display: none subtrees
much more often.
This brings the test-case in the bug to par with other browsers or
better, and is much simpler than the initial approach I tried back in
the day.
Differential Revision: https://phabricator.services.mozilla.com/D147547
2023-08-16 17:46:41 +02:00
Emilio Cobos Álvarez
39ac4840ee
style: Make modal dialog code more generic, and make it apply to fullscreen too behind a pref
...
For now, don't turn it on by default yet, because I want to wait for
more discussion in https://github.com/w3c/csswg-drafts/issues/6965 and
so on. But I think the code is simple enough to land this.
Differential Revision: https://phabricator.services.mozilla.com/D147295
2023-08-16 17:46:41 +02:00
Oriol Brufau
1cb9396455
style: Change order of container shorthand
...
Since the initial value of container-type is an open issue [1],
I'm leaving that as-is for now.
[1] https://github.com/w3c/csswg-drafts/issues/7202
Differential Revision: https://phabricator.services.mozilla.com/D147338
2023-08-16 17:46:41 +02:00
Emilio Cobos Álvarez
d51bd1ee46
style: Implement overflow-clip-margin: <length>
...
Differential Revision: https://phabricator.services.mozilla.com/D146432
2023-08-16 17:46:41 +02:00
Emilio Cobos Álvarez
8c3553226b
style: Ensure options in listbox selects are not stacking contexts by default
...
We could have a different property or something but this seems
reasonable as well probably.
Differential Revision: https://phabricator.services.mozilla.com/D146994
2023-08-16 17:46:41 +02:00
Oriol Brufau
9605ed7c74
Further changes required by Servo
2023-08-16 17:46:41 +02:00
Emilio Cobos Álvarez
bbf10a43b8
style: More container queries plumbing
...
Provide container information in computed::Context and use it to resolve
the container queries.
This still fails a lot of tests because we are not ensuring that layout
is up-to-date when we style the container descendants, but that's
expected.
Differential Revision: https://phabricator.services.mozilla.com/D146478
2023-08-16 17:46:41 +02:00
Emilio Cobos Álvarez
5c2fac087f
style: Clean up unused -moz-window-shadow values
...
After bug 1768278 and bug 1767815 there's no more uses of the cliprounded value
in the tree (also it causes artifacts on HiDPI screens so we probably don't
want new usages).
The "sheet" value is unused, and the other values other than "default" and
"none" are only derived from "default", so they don't need to be exposed in the
style system.
Differential Revision: https://phabricator.services.mozilla.com/D145821
2023-08-16 17:46:41 +02:00