Commit graph

505 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
fa840e1666 style: Implement transform: perspective(none)
Differential Revision: https://phabricator.services.mozilla.com/D123350
2023-05-24 18:32:43 +02:00
Nicolas Silva
ce45f68d9c style: Update euclid in stylo
Differential Revision: https://phabricator.services.mozilla.com/D85762
2023-05-24 18:32:43 +02:00
Matt Woodrow
79893116e7 style: Return an infinite perspective in TransformOperation::Perspective::to_animated_zero
Differential Revision: https://phabricator.services.mozilla.com/D122919
2023-05-24 18:32:42 +02:00
Emily McDonough
c2a50c92fa style: Remove the paper size variant of GenericPageSize and add an implied default to the paper size and orientation variant
Differential Revision: https://phabricator.services.mozilla.com/D119915
2023-05-24 18:32:38 +02:00
Jonathan Kew
695ff236c8 style: Update font-size-adjust keywords to match CSSWG resolution in csswg-drafts/#6288
Differential Revision: https://phabricator.services.mozilla.com/D118198
2023-05-24 18:32:37 +02:00
Matt Woodrow
f81ffda69d style: Clamp perspective() values to a minimum of 1px
Differential Revision: https://phabricator.services.mozilla.com/D118250
2023-05-24 18:32:36 +02:00
Emily McDonough
c9d4f812e5 style: Use a computed type for page-size which converts paper sizes to a Size2D
Differential Revision: https://phabricator.services.mozilla.com/D115842
2023-05-24 18:32:36 +02:00
Emilio Cobos Álvarez
837e41c8eb style: Remove -moz-outline-radius
It does nothing since 88 and we unshipped it in 89.

Differential Revision: https://phabricator.services.mozilla.com/D117532
2023-05-24 18:32:35 +02:00
Jonathan Kew
16168fe4e7 style: Implement CSS support for the optional adjustment-basis metric keywords for the font-size-adjust property (enabled on Nightly only for now)
Differential Revision: https://phabricator.services.mozilla.com/D115596
2023-05-24 18:32:34 +02:00
Mats Palmgren
d7e00ba03d style: Add some style quirks for legacy ::markers created from list-style-type/list-style-image
Specifically:
For "bullets", i.e. 'list-style-type:disc|circle|square|
disclosure-closed|disclosure-open', we use a built-in font
(-moz-bullet-font, which has glyphs for those symbols + space) to
retain mostly backwards compatible rendering for those.  Authors may
override that with an explicit 'font-family' ::marker style though.
We also use this font for 'list-style-image' in case it would
fallback to one of the above when the image fails to load (so that
we get the same width space).

When the -moz-bullet-font is used we also set 'font-synthesis' to
avoid synthesizing italic/bold for this font. Authors may override
this with an explicit ::marker declaration.

We also set 'letter-spacing' and 'word-spacing' to the initial value
for bullets for web-compat reasons.  Again, authors may override
this with an explicit ::marker declaration. (This breaks backwards-
compat slightly but makes us compatible with Chrome.  We used to
ignore these for list-style-type:<string> too.)

Differential Revision: https://phabricator.services.mozilla.com/D111693
2023-05-24 18:32:34 +02:00
Jonathan Kew
f0a178b56a style: Un-prefix -moz-tab-size (keeping the prefixed version as an alias for now)
This results in lots of new WPT test passes.

There were also a couple of WPT tests that turned out to be broken;
tab-size-inline-001 and -002 had errors in their reference files such
that they'd never pass anywhere. So those are fixed here.

Depends on D117331

Differential Revision: https://phabricator.services.mozilla.com/D117332
2023-05-24 18:32:33 +02:00
Oriol Brufau
9273921fd3 Further changes required by Servo 2023-05-24 18:32:32 +02:00
Boris Chiou
d103785c4b style: Part 2: Support fit-content() in style
Support fit-content for preferred size, min size, and max size. This
patch only implement the style system. For layout part, we will do that
in the following patches.

Differential Revision: https://phabricator.services.mozilla.com/D107161
2023-05-24 18:32:32 +02:00
Oriol Brufau
ab445a02b0 style: Implement accent-color in nsNativeBasicTheme
This is a new addition for CSS UI Level 4:

  https://drafts.csswg.org/css-ui-4/#widget-accent

I want to provide feedback on some spec issues, and thought it was a
kinda neat thing to prototype (it also makes testing contrast and such
with random GTK themes easier).

For now enable for Nightly only.

Differential Revision: https://phabricator.services.mozilla.com/D112312
2023-05-19 19:06:08 +02:00
Oriol Brufau
773ddf31fe style: Support the type() function in image-set
Differential Revision: https://phabricator.services.mozilla.com/D109201
2023-05-17 02:12:40 +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
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
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
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
6785c57c78 Add support for the 'cap' font-relative unit
This is a backport of https://phabricator.services.mozilla.com/D133101,
by Jonathan Kew.

Note that Servo isn't using font metrics yet, so the unit still won't
really work.
2023-05-10 03:02:30 +02:00
Martin Robinson
423cc34cb0 Bump euclid to 0.22
- Also updates raqote to latest with an upgrade of font-kit to 0.11
  applied on as a patch
- Update lyon_geom to the latest version

Major change:

- All matrices are now stored in row major order. This means that
  parameters to rotation functions no longer should be negated.
- `post_...()` functions are now named `then()`. `pre_transform()` is removed,
  so `then()` is used and the order of operations changed.
2023-01-26 08:59:21 +01:00
Bryce Wilson
f305c82494
Fix compiler warnings 2021-08-14 21:35:15 -07:00
Emilio Cobos Álvarez
31e8e418ea Miscellaneous build / tidy fixes. 2021-02-26 17:53:55 +01:00
Emilio Cobos Álvarez
5158f65810
Revert euclid update. 2021-02-26 17:15:33 +01:00
Emilio Cobos Álvarez
80dae5bc59 Rustfmt. 2021-02-26 16:44:05 +01:00
Boris Chiou
0ef2410ea0 style: Implement Animate trait and ComputeSquaredDistance trait for <ratio>.
I also update the wpt becasue it seems the original one lets <ratio>
support the addition. However, the spec says "Addition of <ratio>s is not
possible".

Differential Revision: https://phabricator.services.mozilla.com/D106219
2021-02-26 16:44:05 +01:00
Boris Chiou
52d39fc1bc style: Move Ratio into independent files.
Based on https://drafts.csswg.org/css-values/#ratios, <ratio> should be
a general types in css values, and now the media query and the position use
this type, so let's move it into the independent files.

Differential Revision: https://phabricator.services.mozilla.com/D106218
2021-02-26 16:44:05 +01:00
Emily McDonough
96c08d78cf style: Add page-size parsing to Servo
Differential Revision: https://phabricator.services.mozilla.com/D102360
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
7ddd46aba4 style: Implement source selection for image-set.
This is based on the logic in ResponsiveImageSelector::SelectImage (just
simplified because there's no viewport-dependent widths here).

Differential Revision: https://phabricator.services.mozilla.com/D100698
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
4f28a8cd31 style: Implement parsing and serialization for most of image-set().
This implements the basic image-set notation without the format()
function (for simplicity).

There's a remaining serialization issue (we should probably skip 1x
resolutions), but that's fine for now, I'll address this in a follow-up
when the feature is testable.

The intention is to do the image selection at computed value time
(keeping a selected index or such), but same, follow-up.

This also fixes an issue where the cors-mode for -moz-image-rect and
cross-fade() was getting ignored when parsing.

Differential Revision: https://phabricator.services.mozilla.com/D100640
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
a4f82712ae style: Always serialize ratio with both components.
Differential Revision: https://phabricator.services.mozilla.com/D93639
2021-02-26 16:44:05 +01:00
Nicolas Silva
1f36216b59 style: Update euclid in stylo.
Differential Revision: https://phabricator.services.mozilla.com/D85762
2021-02-26 16:44:05 +01:00
Zeke Medley
8f89ebffec style: Add parsing for cross-fade from CSS Image Values and Replaced Content Module Level 4.
This is the first of what will likely be a couple patches for
cross-fade's implementation. Bug 546052 tracks it's complete
implementation.

Differential Revision: https://phabricator.services.mozilla.com/D81889
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
75b38efefd style: Have the destructor of CalcNode be never inline.
You tell me which other things need it... Copy-constructor? operator==?
and such?

Differential Revision: https://phabricator.services.mozilla.com/D73385
2021-02-26 16:44:05 +01:00
Simon Sapin
479a42a980 Reformat with rustfmt 1.4.36-nightly (7de6968 2021-02-07) 2021-02-25 20:31:42 +01:00
Simon Sapin
a0d9f97c8e Fix warnings introduced in newer Rust Nightly
This does not (yet) upgrade ./rust-toolchain

The warnings:

* dead_code "field is never read"
* redundant_semicolons "unnecessary trailing semicolon"
* non_fmt_panic "panic message is not a string literal, this is no longer accepted in Rust 2021"
* unstable_name_collisions "a method with this name may be added to the standard library in the future"
* legacy_derive_helpers "derive helper attribute is used before it is introduced" https://github.com/rust-lang/rust/issues/79202
2021-02-25 15:36:03 +01:00
Simon Sapin
b91e293819 Add layout support for list markers 2020-07-24 09:31:24 +02:00
Simon Sapin
4a4199c1d6 Don’t parse unspported values of content 2020-07-24 09:31:24 +02:00
Martin Robinson
cf4510011f animations: Don't convert linear easing to a bezier
This conversion can lead to floating point errors and extra work when
computing animations. Avoiding it allows animation-iteration-count-009.html
to pass.
2020-06-24 17:19:25 +02:00
bors-servo
53263595f1
Auto merge of #26968 - servo:layout-2020-lazy-content-sizes, r=SimonSapin
Compute content sizes lazily in layout 2020
2020-06-19 13:50:29 -04:00
Emilio Cobos Álvarez
8f215a8444
style: Port the style crate to rust 2018.
Differential Revision: https://phabricator.services.mozilla.com/D80101
2020-06-18 23:51:15 +02:00
Emilio Cobos Álvarez
685e749cfc
style: Switch all callsites of try() to try_parse() in the style crate.
Fully automated via:

  $ rg -l '\.try\(' | xargs sed -i 's/\.try(/.try_parse(/g'
  $ cd servo/components/style && cargo +nightly fmt

Differential Revision: https://phabricator.services.mozilla.com/D80099
2020-06-18 23:51:14 +02:00
Anthony Ramine
235df94f2e Compute content sizes lazily in layout 2020 2020-06-18 14:11:02 +02:00
Emilio Cobos Álvarez
332aec212c style: Miscellaneous servo build fixes. 2020-06-04 01:50:36 +02:00
Boris Chiou
eff8f0fca0 style: Update aspect-ratio syntax for HTML IMG mapped ratio.
Differential Revision: https://phabricator.services.mozilla.com/D76942
2020-06-04 01:50:36 +02:00
Emilio Cobos Álvarez
a9c88729a8 style: Remove two useless mem::replace calls.
Differential Revision: https://phabricator.services.mozilla.com/D76884
2020-06-04 01:50:36 +02:00
Emilio Cobos Álvarez
224550f818 style: Derive parse for ShapeRadius.
Depends on D76331

Differential Revision: https://phabricator.services.mozilla.com/D76332
2020-06-04 01:50:36 +02:00
Boris Chiou
35546aea54 style: Use style::One for Integer to avoid implementing Mul.
Differential Revision: https://phabricator.services.mozilla.com/D76207
2020-06-04 01:50:36 +02:00