Commit graph

1693 commits

Author SHA1 Message Date
Oriol Brufau
8eb5fa21fd Further changes required by Servo 2023-05-26 15:23:25 +02:00
Emilio Cobos Álvarez
693806b853 style: Implement image-rendering: smooth and image-rendering: pixelated
Also, more directly go from StyleImageRendering to wr::ImageRendering.

 * image-rendering: smooth the non-deprecated version of
   OptimizeQuality, which maps to SamplingFilter::LINEAR /
   wr::ImageRendering::Auto (which uses gl::LINEAR).

 * image-rendering: pixelated maps to wr::ImageRendering::Pixelated /
   SamplingFilter::POINT which is the same crisp-edges does.

Note that this uncovers that we were mapping image-rendering:
crisp-edges to wr::ImageRendering::Pixelated.

I'm going to preserve behavior on this patch but we should consider
switching that to map to wr::ImageRendering::CrispEdges on a
follow-up (filed bug 1728831 for this).

Differential Revision: https://phabricator.services.mozilla.com/D124378
2023-05-26 15:23:25 +02:00
Oriol Brufau
212733900e Further changes required by Servo 2023-05-26 15:23:25 +02:00
Emilio Cobos Álvarez
036056d2a9 style: Move image-rendering out of mako
It's easier to touch in the future that way, even though the derive list is
massive.

Differential Revision: https://phabricator.services.mozilla.com/D124377
2023-05-26 15:23:24 +02:00
Emilio Cobos Álvarez
5f5ea8603d style: Fix selecteditem color on macOS
This is an oversight. I made selecteditem be -moz-html-cellhighlight,
but that's for inactive cells.

Use the inactive cell color everywhere (though android doesn't
differentiate). This matches other browsers and what was reviewed on
this bug.

MANUAL PUSH: The semi-transparent text-selection-disabled color caused
one test failure CLOSED TREE.
2023-05-26 15:23:24 +02:00
Emilio Cobos Álvarez
e47f35aa50 style: Implement SelectedItem and SelectedItemText system colors
Since Highlight / HighlightText are now equivalent to the text selection
ones, remove those too.

Differential Revision: https://phabricator.services.mozilla.com/D123964
2023-05-26 15:23:24 +02:00
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
Emilio Cobos Álvarez
db1ada85dc style: Workaround GCC-calling-into-LLVM ABI issue by making GenericFontFamily larger
This enum being a bit larger doesn't cause many common data structures
to grow, so this should be fine.

Differential Revision: https://phabricator.services.mozilla.com/D123146
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
Oriol Brufau
6ea5fdc40e Further changes required by Servo 2023-05-24 18:32:42 +02:00
Mats Palmgren
0cb64672f4 style: [css-fonts] Implement 'font-synthesis: small-caps'
Differential Revision: https://phabricator.services.mozilla.com/D114313
2023-05-24 18:32:42 +02:00
Oriol Brufau
fd3d12e214 Further changes required by Servo 2023-05-24 18:32:41 +02:00
Barret Rennie
c241182d09 style: Support color-mix() in non-sRGB color spaces
Out of gamut colours are currently clipped into sRGB.

Differential Revision: https://phabricator.services.mozilla.com/D120561
2023-05-24 18:32:41 +02:00
Oriol Brufau
d564f200aa Further changes required by Servo 2023-05-24 18:32:41 +02:00
Emilio Cobos Álvarez
5530f7e90c style: Support break-inside: avoid-{page,column}
break-before/after: page|column seem harder because you need to deal
with nested breaks, I think, but this should be straight-forward.

Differential Revision: https://phabricator.services.mozilla.com/D121206
2023-05-24 18:32:41 +02:00
Emilio Cobos Álvarez
cf44eb3e77 style: Don't alias -apple-system to system-ui for now, to keep /css/css-fonts/animations/system-fonts.html happy
We probably want to do this when they do something different, but for
now behavior should be the same and it causes some subtests to fail
because `getComputedStyle(..).fontFamily` for system fonts seems to
return -apple-system, but `.style.fontFamily = "-apple-system"` returns
`system-ui`.

MANUAL PUSH: Orange fix on a CLOSED TREE
2023-05-24 18:32:41 +02:00
Morgan Reschenberg
9b070745c9 style: Add MozNativevisitedhyperlinktext color, use it to style visited links
Differential Revision: https://phabricator.services.mozilla.com/D120657
2023-05-24 18:32:40 +02:00
Emilio Cobos Álvarez
028f2f95d2 style: Initial support for the color-scheme CSS property
Add initial support for the color-scheme CSS property, allowing pages to
choose between light and dark system colors per-element, and such.

Things that are left to do so that this can be enabled by default:

 * Dark system colors on Windows / Android / Standins.
 * Dark Canvas/CanvasText/Link visited colors (which right now are set
   via PreferenceSheet).
 * Dark form controls in nsNativeBasicTheme.
 * Processing the color-scheme meta tag to fill-in
   Document::mColorSchemeBits.

But this seems like enough progress to be landable on its own.

Differential Revision: https://phabricator.services.mozilla.com/D120843
2023-05-24 18:32:40 +02:00
Oriol Brufau
fd41056ca5 Further changes required by Servo 2023-05-24 18:32:39 +02:00
Emilio Cobos Álvarez
d86e449e8c style: Add system-ui boilerplate
Alias -apple-system to it, and put it behind a pref for now. This is
pretty boring (read: uncontroversial hopefully) code. The follow-up work
is modifying StaticPresData to look up the fonts using system APIs,
probably. Maybe a bit more work if on macOS they can't be named.

Differential Revision: https://phabricator.services.mozilla.com/D119984
2023-05-24 18:32:39 +02:00
Oriol Brufau
9cf7df1f31 Further changes required by Servo 2023-05-24 18:32:39 +02:00
Emilio Cobos Álvarez
7d1823563e style: Remove layout.css.image-set.enabled
We shipped this in 88.

Differential Revision: https://phabricator.services.mozilla.com/D120899
2023-05-24 18:32:39 +02:00
Emilio Cobos Álvarez
eca66dba72 style: Factor PreferenceSheet colors to its own struct
This will come handy in the next patch.

Depends on D120678

Differential Revision: https://phabricator.services.mozilla.com/D120679
2023-05-24 18:32:39 +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
Sonia Singla
45d6e64d51 style: Remove layout.css.clip-path-path.enabled
Differential Revision: https://phabricator.services.mozilla.com/D120235
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
Emilio Cobos Álvarez
25edb3c21b style: More fine-grained viewport units invalidation
This should speed up window resize significantly.

Differential Revision: https://phabricator.services.mozilla.com/D118878
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
Oriol Brufau
2c5aa34bb0 Further changes required by Servo 2023-05-24 18:32:36 +02:00
Mats Palmgren
d92f66246e style: [css-content] Implement 'content: none' for elements
Differential Revision: https://phabricator.services.mozilla.com/D114130
2023-05-24 18:32:36 +02:00
Mats Palmgren
183ec78be5 style: Implement 'content: none' for ::marker
Differential Revision: https://phabricator.services.mozilla.com/D111707
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
Oriol Brufau
4f0e0c888c Further changes required by Servo 2023-05-24 18:32:36 +02:00
Emilio Cobos Álvarez
67f9b97735 style: Unify font-family storage
This changes font-family storage to reuse the rust types, removing a
bunch of code while at it. This allows us to, for example, use a single
static font family for -moz-bullet and clone it, rather than creating a
lot of expensive copies.

Differential Revision: https://phabricator.services.mozilla.com/D118011
2023-05-24 18:32:35 +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
Emilio Cobos Álvarez
ed806afe52 style: Expose text selection foreground / background colors to chrome code
Differential Revision: https://phabricator.services.mozilla.com/D117417
2023-05-24 18:32:35 +02:00
Oriol Brufau
2bf074e434 Further changes required by Servo 2023-05-24 18:32:35 +02:00
Emilio Cobos Álvarez
9eb244fc0c style: Add an internal -moz-system-color() function to expose both light and dark system colors
Differential Revision: https://phabricator.services.mozilla.com/D117416
2023-05-24 18:32:35 +02:00
Oriol Brufau
0ebad03ab5 Further changes required by Servo 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
4353d31cb0 Further changes required by Servo 2023-05-24 18:32:33 +02:00
Boris Chiou
11cadd8c42 style: Part 7: Notify style system when SMIL animation changes d attribute
So we update d property in the style system as well. This makes sure we
have the correct computed style and the correct rendering result.

Differential Revision: https://phabricator.services.mozilla.com/D115570
2023-05-24 18:32:33 +02:00
Boris Chiou
fa6ab91acd style: Part 1: Add SVG d property in CSS
Add d property for style system. d property only supports path() for now
and it has the functional notation without fill rule.

https://github.com/w3c/svgwg/issues/320#issuecomment-414462645

Differential Revision: https://phabricator.services.mozilla.com/D81237
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
Emilio Cobos Álvarez
908c952ab0 style: Don't simplify percentages that resolve to lengths in min/max/clamp
Those can't be ordered at specified / computed value time, since the
percentage basis could be negative.

Needs tests of course, running through try atm.

Differential Revision: https://phabricator.services.mozilla.com/D115591
2023-05-24 18:32:31 +02:00
Emilio Cobos Álvarez
dd28d22cee style: Use titlebar colors when using CSD rather than -moz-menubartext
As the titlebar may be different when active / inactive, and have
other colors than a menubar.

Differential Revision: https://phabricator.services.mozilla.com/D114875
2023-05-24 18:32:30 +02:00