aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/values/generics
Commit message (Collapse)AuthorAgeFilesLines
* Move Stylo to its own repo (#31350)Delan Azabani2024-02-2728-8064/+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
* Generalize LengthPercentageOrAuto impl to Generic Type (#30824)atbrakhi2023-12-061-5/+5
| | | | | * Generalize LengthPercentageOrAuto impl to Generic Type * review fix
* Add initial support for sticky positioning for non-legacy layout (#30686)Martin Robinson2023-11-291-0/+1
| | | | | | | | | | * Add initial support for sticky positioning for non-legacy layout Many tests still fail for a variety of reasons. One of the primary ones is that CSSOM currently does not return correct values for elements positioned by sticky nodes. This requires changes to WebRender to work properly. * Fix an assertion failure in the legacy layout sticky code
* style: Add at <position> into ray() in style systemBoris Chiou2023-11-242-19/+51
| | | | | | | | | | | | 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: Return Err() in to_animated_zero() for offset-pathBoris Chiou2023-11-241-3/+8
| | | | | | | | It's unnecessary to implement ToAnimatedZero for this property and so we return Err(()), just like other properties which also use basic shapes, e.g. clip-path, shape-outside. Differential Revision: https://phabricator.services.mozilla.com/D179859
* style: Update the syntax of offset-positionBoris Chiou2023-11-241-0/+49
| | | | | | | | | | | | | | | 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: Rustfmt servo/. r=zrhoffmanEmilio Cobos Álvarez2023-11-244-9/+31
| | | | | | | | $ 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-3/+2
| | | | | | | | | | | 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: Hardening color checksTiaan Louw2023-11-241-32/+5
| | | | | | | Avoid trying to resolve a currentcolor when a foreground color is not available. Differential Revision: https://phabricator.services.mozilla.com/D177368
* style: Add negate node to use in place of mul_by in sum nodesTiaan Louw2023-11-211-27/+162
| | | | | | | | | Sum nodes would use mul_by to negate nodes to do subtraction, but some nodes are not distributive. This patch adds a negate node, so that the operations inside these negate nodes can be resolved first and then the "subtraction" can be applied. Differential Revision: https://phabricator.services.mozilla.com/D172941
* style: Add animation-timeline: view() in style systemBoris Chiou2023-11-211-0/+81
| | | | | | | | | | | | | | | | 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-213-51/+60
| | | | | | | | | | | | 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: CSS comp funcs should handle NaN contagiouslyCanadaHonk2023-11-211-0/+16
| | | | | | | | | If NaN is given as any input to CSS comp funcs (min/max/clamp), it should return NaN. Does not cover simplification (see Bug 1820412). Adjusted WPT test expectations, 18 newly pass. :tada: Differential Revision: https://phabricator.services.mozilla.com/D171659
* style: Refactor mul_by fn into map fnTiaan Louw2023-11-211-7/+48
| | | | | | | 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-0/+9
| | | | | | | 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: Support rendering content: <gradient> imagesEmilio Cobos Álvarez2023-11-211-1/+1
| | | | | | We implemented support for list-style-image anyways. Differential Revision: https://phabricator.services.mozilla.com/D172343
* style: Rustfmt recent changes to calc.rsEmilio Cobos Álvarez2023-11-211-3/+5
| | | | Differential Revision: https://phabricator.services.mozilla.com/D172339
* style: Add resolution support to calc()Emilio Cobos Álvarez2023-11-211-0/+1
| | | | Differential Revision: https://phabricator.services.mozilla.com/D172338
* style: Make image-set without valid images render nothingEmilio Cobos Álvarez2023-11-211-1/+1
| | | | Differential Revision: https://phabricator.services.mozilla.com/D172341
* style: Convert RGBA to AbsoluteColor for computed/animated/resolved CSS colorsTiaan Louw2023-11-211-28/+21
| | | | | | | | | | | | | | 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: Make <ray-size> optional and default to 'closest-side'Boris Chiou2023-11-061-0/+9
| | | | | | | | | | | | | | | Per the spec update, the new syntax is: `ray() = ray( <angle> && <ray-size>? && contain? )` And for `<ray-size>`: "If no <ray-size> is specified it defaults to closest-side." So `<ray-size>` is optional and we omit it if it's default value, for serialization. By the way, offset=* properties are supported only in Gecko, so we don't need a servo function to check the preference. Differential Revision: https://phabricator.services.mozilla.com/D171625
* style: Implement CSS exponential functionsEm Zhan2023-11-061-2/+46
| | | | Differential Revision: https://phabricator.services.mozilla.com/D170842
* style: Part 3 - Color mixing is done with new color spacesTiaan Louw2023-11-061-12/+14
| | | | | | | The color mixing is npw using AbsoluteColor and it's conversion functions. The result is still being converted back to sRGB for now. Differential Revision: https://phabricator.services.mozilla.com/D169930
* style: Part 1 - Move color mixing code to color moduleTiaan Louw2023-11-061-163/+12
| | | | | | | No functional changes, just moving the code to the shared library in preperation for replacing it with the new AbsoluteColor. Differential Revision: https://phabricator.services.mozilla.com/D169928
* style: add subgrid to list of suggestions for grid-template-* propertiesChristian Sonne2023-11-061-0/+1
| | | | Differential Revision: https://phabricator.services.mozilla.com/D169862
* style: Move AbsoluteColor to common color moduleTiaan Louw2023-11-061-5/+5
| | | | Differential Revision: https://phabricator.services.mozilla.com/D169607
* style: Implement ipdl reads without needing default ctorsEmilio Cobos Álvarez2023-11-064-6/+0
| | | | Differential Revision: https://phabricator.services.mozilla.com/D149743
* style: Resolve <number> to <length> in ToResolvedValue for line-heightJonathan Kew2023-11-061-1/+0
| | | | | | | | | | 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: Use write_char in place of write_str when serializing ↵Jonathan Kew2023-11-069-37/+37
| | | | | | | | | | | | 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: Support view-timeline-inset in style systemBoris Chiou2023-11-061-0/+42
| | | | | | | Support view-timeline-inset: `[ [ auto | <length-percentage> ]{1,2} ]#`. And its initial value is 0. Differential Revision: https://phabricator.services.mozilla.com/D166243
* style: Clean up list interpolation codeEmilio Cobos Álvarez2023-11-061-28/+5
| | | | | | | Factor out duplicated / common code to its own module, add / fix spec links, and clean-up callers. Differential Revision: https://phabricator.services.mozilla.com/D167253
* style: De-dup items with the same tag in the computed value of ↵Jonathan Kew2023-11-061-10/+20
| | | | | | font-feature-settings and font-variation-settings Differential Revision: https://phabricator.services.mozilla.com/D167012
* style: Share computed animation-iteration-count representation between Servo ↵Emilio Cobos Álvarez2023-11-061-21/+0
| | | | | | | | | 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-041-0/+16
| | | | Differential Revision: https://phabricator.services.mozilla.com/D161800
* style: Implement CSS mod() and rem() functionsConnor Pearson2023-11-041-0/+129
| | | | Differential Revision: https://phabricator.services.mozilla.com/D163166
* style: Implement label[value] and start/end cropping with CSS rather than ↵Emilio Cobos Álvarez2023-11-041-0/+5
| | | | | | | | | | XUL layout This reduces the weird interactions that can appear on menus. This also progresses BiDi support, including for accesskeys. Differential Revision: https://phabricator.services.mozilla.com/D161498
* style: Check that we do not insert more than MAX_GRID_LINE subgrid line name ↵Emily McDonough2023-11-031-12/+23
| | | | | | | | lists while constructing the list This helps avoid OOM with very large repeats. Differential Revision: https://phabricator.services.mozilla.com/D161533
* style: Implement CSS round() functionConnor Pearson2023-11-031-5/+364
| | | | | | 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-031-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: Implement parsing of container relative lengthsDavid Shin2023-11-031-0/+6
| | | | | | | - For now, implementation always returns the fallback value, i.e. small viewport lengths. - Enabled via existing pref `layout.css.container-queries.enabled`. Differential Revision: https://phabricator.services.mozilla.com/D158054
* style: Run "cargo +nightly fmt" for style components in servoTing-Yu Lin2023-11-033-18/+74
| | | | | | | | | | | | | | | | | | The directories changed: * servo/components/selectors/ * servo/components/style/ * servo/components/style_derive/ * servo/ports/geckolib/ Per review request, disable rustfmt in `components_to_transform_3d_matrix()` to preserve the format for a call to `Transform3D::new`. My mozilla-central is at https://hg.mozilla.org/mozilla-central/rev/d1ae84015c22f2034435b47194fdced878072035 My nightly rust is 1.66.0-nightly (8b705839c 2022-09-26). Differential Revision: https://phabricator.services.mozilla.com/D158234
* style: Fix typo to avoid devtools property-db failuresEmilio Cobos Álvarez2023-11-031-1/+1
| | | | MANUAL PUSH: Orange fix CLOSED TREE
* style: Move line-clamp out of mako and do some adjacent clean-upEmilio Cobos Álvarez2023-11-031-2/+52
| | | | | | No behavior change, but simplifies the following patch. Differential Revision: https://phabricator.services.mozilla.com/D155180
* style: 0% values are not skipped when parsing CSS transformAW2552023-11-031-9/+9
| | | | | | | | Adds trait ZeroNoPercent to check for values that are 0 (such as 0px) but not 0% Updated test css/css-transforms/animation/translate-interpolation.html and removed unnecessary formatting changes Differential Revision: https://phabricator.services.mozilla.com/D154930
* style: Implement atan2(), and enable calc() trigonometric functions by ↵Emilio Cobos Álvarez2023-10-021-0/+8
| | | | | | | | | | | default on nightly We now have test coverage, so let's do this. The remaining failures are just about infinity/nan, which is a completely different feature. Differential Revision: https://phabricator.services.mozilla.com/D154831
* style: make contain-intrinsic-size *animatable*Ziran Sun2023-10-021-0/+2
| | | | Differential Revision: https://phabricator.services.mozilla.com/D151231
* style: C++ `ComputedTimingFunction` uses Rust's timing function calculationDavid Shin2023-10-021-32/+5
| | | | | | | | This was made economical by having Rust's computed `easing::TimingFunction` use a fully resolved function for `linear(...)` easing, as per draft resolution from https://github.com/w3c/csswg-drafts/issues/7415 Differential Revision: https://phabricator.services.mozilla.com/D151295
* style: Update rust's step function basd on C++ `ComputedTimingFunction`David Shin2023-10-021-0/+10
| | | | Differential Revision: https://phabricator.services.mozilla.com/D150566
* style: Add support for parsing the `contain-intrinsic-size` property from ↵Ziran Sun2023-10-021-0/+45
| | | | | | the CSS-sizing specification Differential Revision: https://phabricator.services.mozilla.com/D151001
* style: `linear(...)` easing: Parsing should split a linear stop value into ↵David Shin2023-10-021-5/+2
| | | | | | | | two for entries with both `linear-stop-length` set This brings the behaviour inline with `linear-gradient(...)` Differential Revision: https://phabricator.services.mozilla.com/D149926