Commit graph

1608 commits

Author SHA1 Message Date
Oriol Brufau
ab2ba273e3 Simplify our setup for font metric queries from style
This is a backport of https://phabricator.services.mozilla.com/D157589,
by Emilio Cobos Álvarez, plus some additions so that Servo compiles,
and some parts from https://phabricator.services.mozilla.com/D144455.

Should have no change in behavior.
2023-05-11 21:02:15 +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
Oriol Brufau
f19df142f8 Don't go through app-units-ratio to convert absolute lengths
This is a backport of https://phabricator.services.mozilla.com/D143942,
by Emilio Cobos Álvarez.

This doesn't change behavior on its own, but the current code introduces
some minor floating point error which we can avoid, and which would
cause failures with the patch for #29696.
2023-05-06 02:02:07 +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
s-maurice
83daac57fd add custom debug formatting for display
Signed-off-by: s-maurice <51819025+s-maurice@users.noreply.github.com>
2022-03-23 12:20:05 +01:00
Josh Matthews
01681e79c4 Update nightly rustc. 2021-11-01 08:46:18 -04:00
Bryce Wilson
f305c82494
Fix compiler warnings 2021-08-14 21:35:15 -07:00
Emilio Cobos Álvarez
fd51cddf96 Keep not parsing conic gradient, update WPT expectations. 2021-02-27 05:58:37 +01: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
Emilio Cobos Álvarez
c4ad61faa5 style: Don't allow to parse image-set(none).
`none` is not technically part of the `<image>` syntax. Tests in following
patches.

Depends on D100698

Differential Revision: https://phabricator.services.mozilla.com/D100699
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
Markus Stange
e6aaafdda5 style: Remove -moz-mac-fullscreen-button value.
Depends on D105379

Differential Revision: https://phabricator.services.mozilla.com/D105380
2021-02-26 16:44:05 +01:00
Pierre TALLOTTE
48db30f6e2 style: Hide non-standard values of caption-side.
Differential Revision: https://phabricator.services.mozilla.com/D104321
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
75d6be45f2 style: Make Linux tab bar use the darker of the highlight / highlighttext colors.
Some GTK themes use very soft colors for selection backgrounds, using
darker colors for the text. This makes the tab and focus outlines in the
tab bar not have sufficient contrast with usual backgrounds.

I needed to do this for bug 1690778, but it seems worth doing it on the
front-end as well.

Differential Revision: https://phabricator.services.mozilla.com/D104547
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
3a64fa2006 style: Normalize NaN in some other font-related lengths etc.
Depends on D104563

Differential Revision: https://phabricator.services.mozilla.com/D104565
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
db03b2cf8e style: Normalize NaN to zero as a result of calc().
Differential Revision: https://phabricator.services.mozilla.com/D104563
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
5fe702fa2b style: Move caption-side outside of mako.
Make it an enum class, etc.

Differential Revision: https://phabricator.services.mozilla.com/D103978
2021-02-26 16:44:05 +01:00
Mats Palmgren
84cabf2416 style: Support Grid/Flex/Table/Column layout for the rendered legend of a fieldset.
Differential Revision: https://phabricator.services.mozilla.com/D101555
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
4d8f55a7cb style: Add a more sensible scrollbar size API to nsITheme, and use it to replace ScrollbarNonDisappearing.
There's no reason we should need an scrollbar box to query the size of a
scrollbar. I plan to use this in the following patch to make the size of a
resizer not vary depending on whether the container has scrollbars or not,
which is what ultimately causes the reftest failure.

Differential Revision: https://phabricator.services.mozilla.com/D103302
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
65a06d5003 style: Support full <image> syntax in list-style-image as per spec.
This allows supporting image-set(), etc, and simplifies the bullet frame
code significantly, too thanks to two changes:

  * Instead of manually managing the image request, use the CSS image
    loader, with the `REQUEST_REQUIRES_REFLOW` flag, to handle image
    loads correctly. This didn't exist when this code was initially
    implemented, but we can nicely use it now.

  * Instead of re-implementing another WebRender command-builder thing,
    we can just reuse the nsImageRenderer code.

Differential Revision: https://phabricator.services.mozilla.com/D100774
2021-02-26 16:44:05 +01:00
Tim Nguyen
55e9d8c214 style: Remove layout.css.conic-gradient.enabled preference.
Differential Revision: https://phabricator.services.mozilla.com/D98126
2021-02-26 16:44:05 +01:00
Sunita Sen
9f20a24e4c style: Add support for touch-action:pinch-zoom - Add pinch-zoom support to touchAction.
Differential Revision: https://phabricator.services.mozilla.com/D97815
2021-02-26 16:44:05 +01:00
Sunita Sen
85b45cd615 style: Add support for touch-action:pinch-zoom - Rewrite to_css and parse for touchAction
Differential Revision: https://phabricator.services.mozilla.com/D97650
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
9f40b9ba38 style: Avoid some allocations in selector serialization.
The allocations in display_to_css_identifier show up in the profiles of
bug 1675628.

Differential Revision: https://phabricator.services.mozilla.com/D97856
2021-02-26 16:44:05 +01:00
Tim Nguyen
4ea378a6ae style: Remove support for XUL grid display values.
Differential Revision: https://phabricator.services.mozilla.com/D53297
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
42abdb99c4 style: Fix font loading invalidation to account for metrics coming from the parent style.
We were only looking at the given frame's style, which is not
sufficient for this case.

Differential Revision: https://phabricator.services.mozilla.com/D96237
2021-02-26 16:44:05 +01:00
Markus Stange
e2545ee95d style: Use the -moz-default-appearance values "scrollbar-horizontal" and "scrollbar-vertical" on macOS and remove the now-unused value "scrollbar".
Other platforms were already converted to scrollbar-horizontal and scrollbar-vertical in bug 1205643.

Differential Revision: https://phabricator.services.mozilla.com/D94674
2021-02-26 16:44:05 +01:00
Markus Stange
d246b9e4c3 style: Remove "scrollbar-small" -moz-default-appearance value and replace its single use with scrollbar-width: thin.
Differential Revision: https://phabricator.services.mozilla.com/D94673
2021-02-26 16:44:05 +01:00
Cameron McCormack
a497b033dc style: Use separate Scrollbar and ThemedScrollbar ColorIDs.
Otherwise on Windows, we have a ColorID::Scrollbar but not any of the other scrollbar part
colors, and the Windows-provided value for Scrollbar doesn't work well
with the default values for the other scrollbar parts that come from the
non-native theme.

Differential Revision: https://phabricator.services.mozilla.com/D93728
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
Cameron McCormack
a1fa0c610f style: Use LookAndFeelCache to pass Gtk theme-derived scrollbar colors to content processes.
Differential Revision: https://phabricator.services.mozilla.com/D93467
2021-02-26 16:44:05 +01:00
Boris Chiou
61685ca9b3 style: Serialize a 0/0 ratio as 0/0 in all value stages.
Based on the update of github.com/w3c/csswg-drafts/issues/5084,
a 0/0 ratio will serialize as 0/0 in all value stages.

Differential Revision: https://phabricator.services.mozilla.com/D93182
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
379fb984f1 style: When resetting background color for high contrast, preserve alpha channel appropriately.
But discard it when backplating behind text, so that text is readable.

This should be uncontroversial... Dealing with widgets is a bit harder
so TBD.

Differential Revision: https://phabricator.services.mozilla.com/D91779
2021-02-26 16:44:05 +01:00
Frederic Wang
1a5f48ba43 style: Implement CSS parsing for the math-depth property.
Differential Revision: https://phabricator.services.mozilla.com/D91500
2021-02-26 16:44:05 +01:00
Frederic Wang
4dfcf583cf style: Rename -moz-math-script-level to math-depth.
This renames the internal -moz-math-script-level property in order to
prepare for full math-depth support. Currently, the property is guarded
under a disabled-by-default flag, so there should be no observable
behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D91285
2021-02-26 16:44:05 +01:00
Frederic Wang
ca03f4df6d style: Implement the math-style property.
This patch renames the internal -moz-math-display to math-style and
exposes it under the layout.css.math-style.enabled preference. The
initial value becomes "normal" but that does not affect the default
MathML behavior since the UA style sheet sets the math-style property
explicitly on <math> tags. WPT tests are updated to use the syntax
approved by the CSSWG.

Intent to prototype: https://groups.google.com/forum/#!msg/mozilla.dev.platform/1hQQ7ISudGo/_yLEckEeBQAJ

Differential Revision: https://phabricator.services.mozilla.com/D90731
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
768db078ef style: Make appearance: button behave like auto.
As per https://github.com/w3c/csswg-drafts/issues/5174.

Differential Revision: https://phabricator.services.mozilla.com/D89119
2021-02-26 16:44:05 +01:00
Emilio Cobos Álvarez
2167a0c099 style: Remove layout.css.comparison-functions.enabled.
Shipped since FF75 (bug 1519519).

Differential Revision: https://phabricator.services.mozilla.com/D86693
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
Jeremy Ir
9bfcb3d741 style: Rename overflow:-moz-hidden-unscrollable to overflow:clip.
Differential Revision: https://phabricator.services.mozilla.com/D73716
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
Mats Palmgren
5382a99adb style: [css-grid] Make empty and all-whitespace strings in 'grid-template-areas' invalid.
Differential Revision: https://phabricator.services.mozilla.com/D84398
2021-02-26 16:44:05 +01:00
Cameron McCormack
a2b016157e style: Hide range and number-input appearance values from content.
Forgot to follow up on these two remaining non-standard values that may have
been being used to reset a <meter> or <input type=number> back to its
original appearance, but which telemetry showed no usage of.

Differential Revision: https://phabricator.services.mozilla.com/D83598
2021-02-26 16:44:05 +01:00
Cameron McCormack
da503c4b48 style: Re-order Appearance values.
Differential Revision: https://phabricator.services.mozilla.com/D83437
2021-02-26 16:44:05 +01:00