aboutsummaryrefslogtreecommitdiffstats
path: root/components/style
Commit message (Collapse)AuthorAgeFilesLines
...
* Further changes required by ServoOriol Brufau2023-06-091-1/+1
|
* style: Style system and plumbing for mix-blend-mode: plus-lighterEmilio Cobos Álvarez2023-06-092-1/+2
| | | | Differential Revision: https://phabricator.services.mozilla.com/D137951
* style: Use the mozbuild crate in servoMike Hommey2023-06-092-12/+5
| | | | Differential Revision: https://phabricator.services.mozilla.com/D136562
* style: Remove MOZ_DISTMike Hommey2023-06-091-3/+3
| | | | | | | | As mentioned in bug 1747354, the location of the dist directory is relied to be $topobjdir/dist, so just use that consistently rather than getting it from a separate variable for rust build scripts. Differential Revision: https://phabricator.services.mozilla.com/D136556
* Further changes required by ServoOriol Brufau2023-06-091-0/+10
|
* style: Add style_traits::ToCss for AtomIdentEmily McDonough2023-06-096-20/+20
| | | | Differential Revision: https://phabricator.services.mozilla.com/D136290
* Further changes required by ServoOriol Brufau2023-06-092-5/+7
|
* style: Implement basic @page-rule selector parsingEmily McDonough2023-06-094-20/+167
| | | | | | This does not support any of the pseudo page types. Differential Revision: https://phabricator.services.mozilla.com/D131532
* style: Choose tabpanel background based on content preferred color-schemeEmilio Cobos Álvarez2023-06-091-4/+28
| | | | | | | | | | | | If the theme is dark but user prefers light pages, the background of the tabpanel should arguably be light, since it can be seen across some navigations. Expose a -moz-content-prefers-color-scheme media query to chrome pages so that our UI can correctly query it (and remove the unused -moz-proton atom while at it). Differential Revision: https://phabricator.services.mozilla.com/D136437
* style: Apply line-height to ::markerEmilio Cobos Álvarez2023-06-091-0/+1
| | | | Differential Revision: https://phabricator.services.mozilla.com/D136313
* Further changes required by ServoOriol Brufau2023-06-091-0/+7
|
* style: Avoid generating InterpolateMatrix operations if there are no size ↵Emilio Cobos Álvarez2023-06-092-65/+83
| | | | | | | | | | | | | | | | | | | | | dependencies The issue here is that we end up with a transition between mismatched transform lists that ends up generating an InterpolateMatrix {} operation. So far so good, but we end up interpolating that a lot of times and generating an unboundedly-deep operation list. This implementas an optimization that flattens them to a single matrix when possible (when there's no dependencies on the containing box). This is similar to: https://chromium.googlesource.com/chromium/src.git/+/2b89cc4df436e672ef9cf940d1c0dc73fef82a4a We fix the to_pixel_length() behavior for LenghtPercentage to be correct (and update callers to preserve behavior). Differential Revision: https://phabricator.services.mozilla.com/D134784
* style: Remove touch-action prefEmilio Cobos Álvarez2023-06-091-1/+0
| | | | | | It's been enabled by default since ~forever. Differential Revision: https://phabricator.services.mozilla.com/D134935
* style: Rename StyleMathMLMathVariant -> StyleMathVariantEmilio Cobos Álvarez2023-06-091-1/+1
| | | | MANUAL PUSH: Trivial rename.
* style: Replace MathML font constants with enumNeia Finch2023-06-091-1/+1
| | | | Differential Revision: https://phabricator.services.mozilla.com/D134802
* style: Make color-adjust an alias of print-color-adjust as per specEmilio Cobos Álvarez2023-06-096-10/+20
| | | | Differential Revision: https://phabricator.services.mozilla.com/D134779
* style: Shrink maps if needed after stylist rebuildsEmilio Cobos Álvarez2023-06-096-17/+122
| | | | | | | | Hashbrown grows a lot sometimes making us waste a lot of memory. Shrink some of these maps after CascadeData rebuild / stylesheet collection invalidation. Differential Revision: https://phabricator.services.mozilla.com/D134716
* style: Remove ThinBoxedSliceEmilio Cobos Álvarez2023-06-093-5/+5
| | | | | | | | | | | | | | | | | | | The only remaining consumers are ::-moz-tree pseudo-elements (we used to use ThinBoxedSlice for other data structures in the past). Those are not particularly performance sensitive so I think just double-boxing is fine. In the future, if we wanted to avoid the double indirection, we could probably use the "thin" crate (https://docs.rs/thin) or similar, which stores the length of the slice along with the allocation, making the pointer thin in all configurations, much like "ThinArc" does: https://searchfox.org/mozilla-central/rev/1ce2eea39442190a71a1f8f650d098f286bf4a01/servo/components/servo_arc/lib.rs#891 In practice though, I don't think it's particularly worth it for this specific case. Differential Revision: https://phabricator.services.mozilla.com/D134672
* style: Use ThreadPool::scope_fifo in styleEmilio Cobos Álvarez2023-06-091-18/+16
| | | | | | | | It does the same, but it saves an indentation level: https://searchfox.org/mozilla-central/rev/a11b63915bd7810a03635d733123448ab5bfcad3/third_party/rust/rayon-core/src/thread_pool/mod.rs#217 Differential Revision: https://phabricator.services.mozilla.com/D134321
* style: Remove hwba since it's not a thing (hwb function supports alpha)Emilio Cobos Álvarez2023-06-091-1/+1
| | | | | | Partially backs out the previous patch. Differential Revision: https://phabricator.services.mozilla.com/D134256
* style: Add hwb/a to devtools autocomplete listsEmilio Cobos Álvarez2023-06-091-1/+1
| | | | | | The changes to the devtools directory were written automatically via ./mach devtools-css-db Differential Revision: https://phabricator.services.mozilla.com/D134197
* style: Remove servo/components/{hashglobe,fallible} in favor of try_reserveEmilio Cobos Álvarez2023-06-0918-137/+157
| | | | Differential Revision: https://phabricator.services.mozilla.com/D134194
* Further changes required by ServoOriol Brufau2023-06-091-2/+11
|
* style: Deal with layers and at-rulesEmilio Cobos Álvarez2023-06-092-67/+124
| | | | Differential Revision: https://phabricator.services.mozilla.com/D134010
* style: Add CSS support for the hyphenate-character propertyJonathan Kew2023-06-095-0/+36
| | | | Differential Revision: https://phabricator.services.mozilla.com/D133889
* style: Don't draw window decorations when painting headerbar on waylandEmilio Cobos Álvarez2023-06-091-2/+1
| | | | | | | This is a better fix for the double decorations than clipping them using CSS. Differential Revision: https://phabricator.services.mozilla.com/D133871
* style: Update CSSOM for layer rules to the specEmilio Cobos Álvarez2023-06-099-141/+155
| | | | | | | | | | | | Pretty mechanical. Tests are in https://wpt.live/css/css-cascade/layer-rules-cssom.html which (with a fix for @import tests which I'll submit separately) we pass. Sync for that is bug 1743936. Differential Revision: https://phabricator.services.mozilla.com/D133387
* style: Fix style attribute important and revert-layer behaviorEmilio Cobos Álvarez2023-06-095-31/+67
| | | | | | | | | | | | | By modeling it as a separate layer that behaves somewhat specially. See https://github.com/w3c/csswg-drafts/issues/6872. The remaining revert-layer tests that we fail are because either we don't implement a feature (like @property) or because it's used in keyframes (where revert is a bit unspecified and we have existing issues with it). Differential Revision: https://phabricator.services.mozilla.com/D133373
* Further changes required by ServoOriol Brufau2023-06-092-1/+11
|
* style: Add support for the revert-layer keywordEmilio Cobos Álvarez2023-06-0917-253/+356
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch looks bigger than it is, but it's mostly because of plumbing. To implement revert-layer we need not only the cascade origin of the declaration, but the whole cascade level, plus also the layer order. In order to do this, encapsulate these two things inside a 32-bit `CascadePriority` struct and plumb it through the rule tree and so on. This allows us to remove the packing and unpacking of CascadeLevel, though I kept the ShadowCascadeOrder limit for now in case we need to reintroduce it. Fix `!important` behavior of layers while at it (implementing it in `CascadeLevel::cmp`, spec quote included since it was tricky to find) since some revert-layer tests were depending on it. The style attribute test is failing now, but follow-up commit fixes it, see spec issue. In terms of the actual keyword implementation, it's sort of straight-forward: We implement revert and revert-layer in a shared way, by storing the cascade priority that reverted it. Differential Revision: https://phabricator.services.mozilla.com/D133372
* style: Add support for the 'ic' font-relative unitJonathan Kew2023-06-094-2/+30
| | | | | | | | | | | This is a "simplified" implementation of 'ic', similar to what Safari Preview currently supports: it only considers the advance of U+6C34 if found in the first available font, and otherwise falls back to the default of 1em. (The spec allows for this "in cases where it is impossible or impractical to determine the ideographic advance measure".) Differential Revision: https://phabricator.services.mozilla.com/D132818
* style: Part 10: Make source and scroll-offsets accept only default valueBoris Chiou2023-06-091-2/+10
| | | | | | | | | | | | | Based on our previous patches, we only support default behavior for source and scroll-offsets: 1. source:auto 2. scroll-offsets: none 3. scroll-offsets: auto, auto, ... So update the parser for them. We expect to remove whole @scroll-timeline in Bug 1733260, so now only do a tiny update in parser. Differential Revision: https://phabricator.services.mozilla.com/D132417
* style: Part 8: Hook scroll-timeline rule into Cascade data and use it for ↵Boris Chiou2023-06-093-14/+33
| | | | | | | | | | | | | | | | | | | | CSS animations We hook the rule into cascade data, and so we can look it up by timeline name. Now we only use StyleScrollDirection from @scroll-timeline rule. `source` and `scroll-offsets` are skipped now and use the default values instead because I'm pretty sure the syntax will be changed in Bug 1733260, and `scroll-offsets` may be obsolete because the spec proposal intents to make it be always 0% ~ 100%. Also, add some reftests for the default `source` and `scroll-offsets`, and different `orientation`s. Besides, we disable at-scroll-timeline-start-end.html in Gecko because we don't support start/end descriptors, and there are too many intermittents in it. Differential Revision: https://phabricator.services.mozilla.com/D126452
* style: Part 1: Add ScrollTimeline classBoris Chiou2023-06-091-3/+7
| | | | | | Define a simple version of ScrollTimeline. Differential Revision: https://phabricator.services.mozilla.com/D129099
* style: Implement parsing of the page propertyEmily McDonough2023-06-096-6/+56
| | | | Differential Revision: https://phabricator.services.mozilla.com/D131531
* style: Use titlebar radius on Linux and make titlebar set-up work for ↵Emilio Cobos Álvarez2023-06-091-1/+2
| | | | | | | | | | | | | lightweight themes To do this, we always draw the native titlebar behind the toolbox, and then make the toolbox adapt to it by using the titlebar radius. This makes us preserve the shadow properly. On Wayland we'd double-draw the shadow (see bug 1509931 comment 4) so this fixes it by trimming it as well using border-radius. Differential Revision: https://phabricator.services.mozilla.com/D128681
* style: Remove unnecessary button-focus appearance value on LinuxEmilio Cobos Álvarez2023-06-091-3/+0
| | | | | | | This always draws transparent. Only real thing it does is forcing 0px padding. Differential Revision: https://phabricator.services.mozilla.com/D132563
* Further changes required by ServoOriol Brufau2023-06-092-12/+9
|
* style: Honor GTK button layoutEmilio Cobos Álvarez2023-06-092-31/+67
| | | | | | | | | | | This is based off work by smurfd. But this patch doesn't support buttons both at the left and right, which simplifies a lot the implementation. Also, clean-up the existing env variables while at it. Co-authored-by: Nicklas Boman <smurfd@gmail.com> Differential Revision: https://phabricator.services.mozilla.com/D132073
* style: Add a Show Password button to <input type=password> controlsEmilio Cobos Álvarez2023-06-093-0/+9
| | | | | | | It's controlled by the pref: layout.forms.input-type-show-password-button.enabled Differential Revision: https://phabricator.services.mozilla.com/D130407
* style: Keep system fonts when prioritizing user fontsEmilio Cobos Álvarez2023-06-091-0/+4
| | | | | | | | | | | | | | This was a subtle behavior change in bug 1739464. The early-return here: https://hg.mozilla.org/mozilla-central/rev/2fb74c67b0c5#l11.40 Meant we also bailed out from user font prioritization for system fonts. It's unclear whether that's really the best behavior but since the intention of the regressing patch was not to change behavior, preserving the old behavior seems better. Differential Revision: https://phabricator.services.mozilla.com/D131899
* style: Correctly report animation status of pseudo-elements that are not ↵Emilio Cobos Álvarez2023-06-092-10/+10
| | | | | | | | | | | | | | | | | | stored in the parent element We allow animating pseudo-elements like ::-moz-progress-bar (and we treat them like regular elements). Ideally we should store animations for these in the parent element as well, so they survive reframes and such. But treating them as regular elements right now means that we do animate them, but we never update animations for them correctly because wrapper.rs assumed them to be non-animatable. Since it seems reasonable to keep allowing the animations to happen, let's just correct the update code and add a test. Differential Revision: https://phabricator.services.mozilla.com/D131794
* style: Removed remaining (non-negated) -moz-proton media querieslamoure62023-06-091-2/+1
| | | | Differential Revision: https://phabricator.services.mozilla.com/D125328
* style: Simplify language-dependent font fallback codeEmilio Cobos Álvarez2023-06-093-54/+56
| | | | | | | | | | | | | | | .fallback is always the default font for the lang group unless we're a system font (in which case it's "none"). The only reason we need that is because we need to react to language changes (which affect the initial font). Simplify the model a bit doing the language lookup in gfxTextRun (this should avoid allocating a few nsStyleFont structs too. Depends on D130732 Differential Revision: https://phabricator.services.mozilla.com/D131312
* Further changes required by ServoOriol Brufau2023-06-091-0/+1
|
* style: Use first generic rather than only generic to determine fallback font ↵Emilio Cobos Álvarez2023-06-092-7/+15
| | | | | | | | | | | | | | | family This seems like more sensible behavior. We have another use of only_generic(), but that affects font sizing and other browsers agree with us there: <div style="font-family: monospace">Should be 13px</div> <div style="font-family: something, monospace">Should be 16px</div> So not touching that one. Differential Revision: https://phabricator.services.mozilla.com/D130732
* style: Top layer elements that are display:contents should be display: blockEmilio Cobos Álvarez2023-06-091-1/+7
| | | | | | | | As per https://fullscreen.spec.whatwg.org/#new-stacking-layer: If its specified display property is contents, it computes to block. Differential Revision: https://phabricator.services.mozilla.com/D131585
* style: Support scrollbar-gutter in the style systemTing-Yu Lin2023-06-096-3/+84
| | | | | | | | | | | | This patch adds `scrollbar-gutter` property in CSS Overflow level 3 [1] to the style system. `devtools/shared/css/generated/properties-db.js` is generated by `./mach devtools-css-db`. [1] https://drafts.csswg.org/css-overflow-3/#scrollbar-gutter-property Differential Revision: https://phabricator.services.mozilla.com/D131460
* style: Run rustfmt on servo/components/style and servo/ports/geckolibTing-Yu Lin2023-06-0950-341/+487
| | | | | | | | | | | | This patch is generated by running `cargo +nightly fmt` under `servo/components/style/` and `servo/ports/geckolib` against mozilla-central https://hg.mozilla.org/mozilla-central/rev/b193f2e7a6a5d1f042c957ea4acd5c89bf210512 My nightly version is: 1.58.0-nightly (c9c4b5d72 2021-11-17) Manually remove the redundant braces in author_styles.rs to fix a warning. Differential Revision: https://phabricator.services.mozilla.com/D131556
* style: Make custom properties that are IACVT guaranteed-invalidEmilio Cobos Álvarez2023-06-091-20/+5
| | | | | | | | | | | | | | | This effectively backs out bug 1623396. See: https://github.com/w3c/csswg-drafts/pull/6006 https://drafts.csswg.org/css-variables/#guaranteed-invalid-value And related discussion. Matches Chrome stable as per https://groups.google.com/a/chromium.org/g/blink-dev/c/0xrbzYe_vxU/m/7bsL76n9CgAJ Depends on D116459 Differential Revision: https://phabricator.services.mozilla.com/D116460