aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/values/computed
Commit message (Collapse)AuthorAgeFilesLines
* Move Stylo to its own repo (#31350)Delan Azabani2024-02-2734-6427/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove packages that were moved to external repo * Add workspace dependencies pointing to 2023-06-14 branch * Fix servo-tidy.toml errors * Update commit to include #31346 * Update commit to include servo/stylo#2 * Move css-properties.json lookup to target/doc/stylo * Remove dependency on vendored mako in favour of pypi dependency This also removes etc/ci/generate_workflow.py, which has been unused since at least 9e71bd6a7010d6e5723831696ae0ebe26b47682f. * Add temporary code to debug Windows test failures * Fix failures on Windows due to custom target dir * Update commit to include servo/stylo#3 * Fix license in tests/unit/style/build.rs * Document how to build with local Stylo in Cargo.toml
* style: Add a `static_prefs` implementation (#31351)Martin Robinson2024-02-141-4/+1
| | | | This will eventually be part of the stylo crate and reduces the diff between our verson of style and upstream's.
* style: Clean up Context::for_non_inherited_propertyEmilio Cobos Álvarez2023-11-241-11/+10
| | | | | | | We don't ever check the particular property, so it can just be a boolean. Differential Revision: https://phabricator.services.mozilla.com/D180680
* style: Do not snap -webkit-text-stroke-width to dev pixelsEmilio Cobos Álvarez2023-11-242-1/+4
| | | | | | | Introduce LineWidth (which doesn't snap) and let BorderSideWidth wrap it and actually do the snapping. Differential Revision: https://phabricator.services.mozilla.com/D180688
* style: Avoid selecting zero-resolution images in image-setEmilio Cobos Álvarez2023-11-241-7/+11
| | | | | | | Fairly straight-forward. This fixes the two tests mentioned in comment 0 which aren't still in the repo. Differential Revision: https://phabricator.services.mozilla.com/D180414
* style: Forbid negative CSS resolutions at parse timeEmilio Cobos Álvarez2023-11-241-1/+1
| | | | | | | | | | Apply some clang-tidy suggestions while I was going through the ServoStyleConstsInlines while at it. Remove one 0x test because it's tested on the same test and causes a harness error. Differential Revision: https://phabricator.services.mozilla.com/D180331
* style: Add at <position> into ray() in style systemBoris Chiou2023-11-241-3/+8
| | | | | | | | | | | | We reuse PositionOrAuto here, and let "auto" represent the situation when the author omits "at <position>" because it has a special meaning. https://drafts.fxtf.org/motion-1/#valdef-ray-at-position Note: No need to update css/motion/parsing/offset-path-parsing-valid.html because Blink added some to the upstream repo already. Differential Revision: https://phabricator.services.mozilla.com/D179860
* style: Make content-visibility: auto forces contain-intrinsic-size to gain ↵Jihye Hong2023-11-241-0/+14
| | | | | | | | | | an auto value When the content having `content-visibility: auto` and the specific value for `contain-intrinsic-size` is slightly out of the viewport, its computed value keeps changing. This patch makes `content-visibilty: auto` forces `contain-intrinsic-size` to gain an auto value to solve this issue. Differential Revision: https://phabricator.services.mozilla.com/D174583
* style: Update the syntax of offset-positionBoris Chiou2023-11-242-3/+6
| | | | | | | | | | | | | | | Now it supports "normal" keyword. Also, offset-position doesn't create stacking context and it doesn't have offset transform, so we can simplify CompareMotionValues() a little bit. Note: We don't have to add test in [1] because Blink added one to WPT upstream repo already. [1] css/motion/parsing/offset-position-parsing-valid.html Note: the usage of offset-position is in other bugs. Differential Revision: https://phabricator.services.mozilla.com/D179623
* style: Simplify border snappingEmilio Cobos Álvarez2023-11-242-11/+11
| | | | | | | | Make the computed value of border-like properties app units (which is effectively what happens in Gecko already), and clamp at computed value time. Differential Revision: https://phabricator.services.mozilla.com/D179481
* style: Rustfmt servo/. r=zrhoffmanEmilio Cobos Álvarez2023-11-244-25/+24
| | | | | | | | $ find servo -name '*.rs' | xargs rustup run nightly rustfmt Depends on D179380 Differential Revision: https://phabricator.services.mozilla.com/D179381
* style: [css-properties-values-api] Parsing and serialization for @property ↵Zach Hoffman2023-11-241-1/+1
| | | | | | | | | | | syntax descriptor Based off of @emilio's syntax parser at <https://github.com/emilio/css-typed-om-syntax>. Co-authored-by: Emilio Cobos Álvarez <emilio@crisal.io> Differential Revision: https://phabricator.services.mozilla.com/D178268
* style: Implement parsing for `baseline-source`David Shin2023-11-242-5/+5
| | | | Differential Revision: https://phabricator.services.mozilla.com/D173884
* style: Clean up length handlingEmilio Cobos Álvarez2023-11-241-18/+18
| | | | | | | No behavior change, but using Self is shorter and while I'm touching this code might as well clean it up a little bit. Differential Revision: https://phabricator.services.mozilla.com/D177732
* style: Hardening color checksTiaan Louw2023-11-241-4/+35
| | | | | | | Avoid trying to resolve a currentcolor when a foreground color is not available. Differential Revision: https://phabricator.services.mozilla.com/D177368
* style: Rework -x-text-zoom to allow disabling text zoom and min-font-size ↵Emilio Cobos Álvarez2023-11-212-6/+3
| | | | | | | | | | | | | | separately And use it instead of explicit document checks. This centralizes where we check for it. IsChromeDoc is relatively cheap, but this bug wants to also check for PDF.js which is a bit more expensive. No behavior change. Differential Revision: https://phabricator.services.mozilla.com/D176940
* style: Add animation-timeline: view() in style systemBoris Chiou2023-11-211-1/+4
| | | | | | | | | | | | | | | | Support view() notation for animation-timeline: `<view()> = view( [ <axis> || <'view-timeline-inset'> ]? )` We move AnimationTimeline and its related types into the generics folder, and define two new structs for scroll() and view(). Note: 1. The syntax of scroll() doesn't match the current version of the spec. I will update it in Bug 1814444. 2. We will handle the creation/usage of the Anonymous View Progress Timelines in the next patch. Differential Revision: https://phabricator.services.mozilla.com/D173904
* style: Move animation-related values from box.rs/ui.rs to animation.rsBoris Chiou2023-11-214-70/+84
| | | | | | | | | | | | Although we store animation and transition style values in StyleUIReset and define their properties in longhands/ui.mako.rs, but we may move them in the future if this style struct becomes too large. So let's move the definition of their values to an independent module, animation, so we don't have to worry about this again. This patch doesn't change any other things. Only move code. Differential Revision: https://phabricator.services.mozilla.com/D173903
* style: Serialize NaN and infinity percentages correctlyCanadaHonk2023-11-211-2/+2
| | | | | | | | | NaN and infinity percentages are now serialized as expected. Also added some new WPT tests as percentages were previously untested and added some spec comments to previous NaN/inf serialization code. Differential Revision: https://phabricator.services.mozilla.com/D176726
* style: Refactor mul_by fn into map fnTiaan Louw2023-11-211-5/+9
| | | | | | | Refactor the mul_by function on leafs into a more generic map function that can be used for more operations like abs, signum and mul. Differential Revision: https://phabricator.services.mozilla.com/D172936
* style: Use auto as the initial value for view-timeline-insetBoris Chiou2023-11-211-13/+0
| | | | | | | Per the proposal in https://github.com/w3c/csswg-drafts/issues/7747, we change view-timeline-inset to have an initial value of auto. Differential Revision: https://phabricator.services.mozilla.com/D173487
* style: Fix a couple minor issues with the previous patchEmilio Cobos Álvarez2023-11-211-1/+1
| | | | | | | Having unused imports and undocumented functions trigger warnings that don't build in automation. Differential Revision: https://phabricator.services.mozilla.com/D172429
* style: Serialize NaN and infinity lengthsCanadaHonk2023-11-211-0/+6
| | | | | | | | | | Lengths using NaN and infinity are now serialized properly with some improvements to computed values as well. Also added a few minor new relevant WPT tests. 35 WPT tests newly pass :tada: Differential Revision: https://phabricator.services.mozilla.com/D172183
* style: Add resolution support to calc()Emilio Cobos Álvarez2023-11-212-3/+3
| | | | Differential Revision: https://phabricator.services.mozilla.com/D172338
* style: Make image-set without valid images render nothingEmilio Cobos Álvarez2023-11-211-4/+2
| | | | Differential Revision: https://phabricator.services.mozilla.com/D172341
* style: Convert RGBA to AbsoluteColor for computed/animated/resolved CSS colorsTiaan Louw2023-11-211-32/+18
| | | | | | | | | | | | | | Computed color values will not be in the correct format, closer to the one specified by the author. This also means that colors accross the code are stored now as AbsoluteColor or StyleAbsoluteColor. This allows color space/gamut information to be available for use. Some animation related test failures had to be changed, because colors now has greater precision. Animated a color now causes a lot more animation updates, which was not initially expected. See the bug for discussion. Differential Revision: https://phabricator.services.mozilla.com/D171021
* style: Add forced-color-adjust propertyFred Chasen2023-11-062-2/+2
| | | | | | | | Adds the forced-color-adjust property and ForcedColorAdjust keywords. Updates tweak_when_ignoring_colors to check for `none` value of that property when determining if a color adjustment in needed. Adds a check for `none` when styling selections to make sure they can be styled in forced color modes. Differential Revision: https://phabricator.services.mozilla.com/D169000
* Further changes required by ServoOriol Brufau2023-11-061-5/+13
|
* style: Expose line-height resolution to style, and use it from ToResolvedValueEmilio Cobos Álvarez2023-11-061-5/+5
| | | | | | | | | For ToResolvedValue implementation purposes we wouldn't need to split out the vertical / font / line-height arguments and we could just pass around the ComputedStyle, but the lh unit would need that distinction, (because computing lh on font properties should use the parent style). Differential Revision: https://phabricator.services.mozilla.com/D168705
* style: Resolve <number> to <length> in ToResolvedValue for line-heightJonathan Kew2023-11-061-0/+20
| | | | | | | | | | This makes the serialization of the 'font' shorthand on computed style return the line-height as an absolute length rather than a number (font-size multiplier), which is consistent with what the line-height longhand already returns, and with other browsers. (See also https://github.com/w3c/csswg-drafts/issues/8385.) Differential Revision: https://phabricator.services.mozilla.com/D168542
* style: Fixes for font-language-override parsing and testsJonathan Kew2023-11-061-21/+16
| | | | Differential Revision: https://phabricator.services.mozilla.com/D168555
* style: Use write_char in place of write_str when serializing ↵Jonathan Kew2023-11-064-4/+4
| | | | | | | | | | | | single-character literals Generated by running find servo/components/style -name "*.rs" -exec perl -p -i -e "s/write_str\(\"(.)\"\)/write_char('\1')/g" {} \; (and then added `use std::fmt::Write;` in a couple of places to fix build errors that arose). Differential Revision: https://phabricator.services.mozilla.com/D168217
* style: Implement the font-synthesis-{weight,style,small-caps} longhand ↵Jonathan Kew2023-11-061-2/+2
| | | | | | properties, and make font-synthesis into a shorthand Differential Revision: https://phabricator.services.mozilla.com/D167480
* Further changes required by ServoOriol Brufau2023-11-061-0/+1
|
* style: Create a pref to list icon font families that should be used even ↵Jonathan Kew2023-11-061-11/+48
| | | | | | | | | | | | | | when use_document_fonts=0, overriding the browser's font prefs Some widely-used icon fonts use ligature rules to replace icon names such as "volume_up" or "down_arrow" with icon glyphs. If the site is designed to use such a font, but the user disables document fonts and we use our default Latin font instead, the underlying text will be rendered instead of the intended icon. To enable such fonts to continue to work, we provide a list of known ligature-icon fonts and allow them to be used even when the document-fonts setting is disabled. Differential Revision: https://phabricator.services.mozilla.com/D167923
* style: Support view-timeline-inset in style systemBoris Chiou2023-11-062-2/+18
| | | | | | | Support view-timeline-inset: `[ [ auto | <length-percentage> ]{1,2} ]#`. And its initial value is 0. Differential Revision: https://phabricator.services.mozilla.com/D166243
* style: Avoid infinite output progress after applying the easing functionBoris Chiou2023-11-061-3/+15
| | | | | | | | | | | The output progress of easing functions could be inf or -inf, per spec, https://drafts.csswg.org/css-easing-2/#output-progress-value. But we should avoid using infinity to calculate interpolation or use the infinite progress in Web Animations API, per the spec issue comments: https://github.com/w3c/csswg-drafts/issues/8344#issuecomment-1399033481 Differential Revision: https://phabricator.services.mozilla.com/D167342
* style: Add lab(), lch(), oklab(), oklch() to specified colorsTiaan Louw2023-11-061-3/+3
| | | | | | | | | | | Use new changes from cssparser and use the new lab/lch/oklab/oklch color formats. Introduced a new color type AbsoluteColor. It represents any kind of color that has absolute numerical values. It is also tied to a color space and therefore can be trivially converted to another color space. Differential Revision: https://phabricator.services.mozilla.com/D163579
* style: De-dup items with the same tag in the computed value of ↵Jonathan Kew2023-11-061-5/+62
| | | | | | font-feature-settings and font-variation-settings Differential Revision: https://phabricator.services.mozilla.com/D167012
* style: Use the same computed time representation between Servo and GeckoEmilio Cobos Álvarez2023-11-061-1/+2
| | | | | | Same as above. Differential Revision: https://phabricator.services.mozilla.com/D167126
* style: Share computed animation-iteration-count representation between Servo ↵Emilio Cobos Álvarez2023-11-061-11/+50
| | | | | | | | | and Gecko This removes the special AnimationIterationCount -> f32 conversion from gecko.mako.rs which will be useful to simplify coordinated properties. Differential Revision: https://phabricator.services.mozilla.com/D167123
* style: Style changes to support the 'page-orientation' propertyJonathan Watt2023-11-042-1/+2
| | | | Differential Revision: https://phabricator.services.mozilla.com/D161800
* style: Animate the 'normal' value of font-style as 'oblique 0deg'Jonathan Kew2023-11-041-2/+11
| | | | | | | | | | | | | This matches what the spec[1] says for font-style: > Animation type: by computed value type; normal animates as oblique 0deg A bunch of WPT tests for font-style animation are landing in https://github.com/web-platform-tests/wpt/pull/37570. Current Gecko passes 66/129 of the testcases there; with this patch applied it passes all the tests. [1] https://drafts.csswg.org/css-fonts-4/#font-style-prop Differential Revision: https://phabricator.services.mozilla.com/D166128
* style: Use used, rather than computed font-size for font-metric dependent unitsEmilio Cobos Álvarez2023-11-043-10/+23
| | | | Differential Revision: https://phabricator.services.mozilla.com/D165737
* style: Use root element font size for rem calculation in Container queriesZiran Sun2023-11-041-1/+1
| | | | Differential Revision: https://phabricator.services.mozilla.com/D162853
* style: Remove unused std::ops::Rem implementationsConnor Pearson2023-11-041-10/+1
| | | | Differential Revision: https://phabricator.services.mozilla.com/D161844
* style: Implement CSS round() functionConnor Pearson2023-11-033-4/+59
| | | | | | Co-Authored-By: Emilio Cobos Álvarez <emilio@crisal.io> Differential Revision: https://phabricator.services.mozilla.com/D156742
* style: Rename page::PageOrientation to page::PageSizeOrientationJonathan Watt2023-11-032-5/+5
| | | | | | | | | | The @page rule may contain both 'page-orientation' and 'size' properties. The 'size' property can contain an orientation component which was being represented as 'PageOrientation' prior to this patch. This patch changes that to 'PageSizeOrientation' so that 'PageOrientation' can be used for 'page-orientation' in a subsequent patch. Differential Revision: https://phabricator.services.mozilla.com/D160790
* style: Remove system font support for various font longhandsEmilio Cobos Álvarez2023-11-031-21/+1
| | | | | | | | | | | | We don't use them[1], and these are generally not properties that authors would be able to set via the font shorthand anyways. Let's simplify the code. This fixes the font-variant bug and also unblocks further clean-ups of these properties in the future. [1]: https://searchfox.org/mozilla-central/rev/59f0bf3c13dd455d9f5415b89178de701ea6b850/widget/LookAndFeelTypes.ipdlh#12-18 Differential Revision: https://phabricator.services.mozilla.com/D160352
* style: Container Relative Units: Set flag for `USES_VIEWPORT_UNITS` only ↵David Shin2023-11-032-8/+2
| | | | | | when viewport fallback is actually used Differential Revision: https://phabricator.services.mozilla.com/D159866