aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/values/specified
Commit message (Collapse)AuthorAgeFilesLines
* Move Stylo to its own repo (#31350)Delan Azabani2024-02-2738-19749/+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: Remove dependency on servo_config (was #31409) (#31411)Delan Azabani2024-02-231-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * Initial style_config crate * Remove servo_config from style * Remove servo_config from tests/unit/style * Plumb servo prefs into stylo * Clean up dependencies * Fix formatting * Add unit tests * Add comment about avoiding clone * Fix bug where getters acquire unnecessary write lock * Remove stray dbg!() * Plumb default prefs into Stylo as well * Add comments about logging and mapping new pref types
* Revert remaining Stylo changes (#31408)Delan Azabani2024-02-222-10/+4
| | | | | * Revert remaining changes from Stylo split-into-commits branch * Do the minimum amount of formatting to appease mach test-tidy
* style: Remove dependency on servo_url (#31358)Martin Robinson2024-02-161-3/+1
| | | | | In order for stylo to be a separate crate, it needs to depend on less things from Servo. This change makes it so that stylo no longer depends on servo_url.
* style: Add a `static_prefs` implementation (#31351)Martin Robinson2024-02-145-66/+10
| | | | This will eventually be part of the stylo crate and reduces the diff between our verson of style and upstream's.
* style: Container units should prevent us from sharing style by rule nodeEmilio Cobos Álvarez2023-11-241-0/+3
| | | | | | | | | | | | At least when the containers are different. For now check that by doing a somewhat simplified test (checking sibling-ness). The new flag can be useful to optimize container query restyles on resizes too, in the future. Differential Revision: https://phabricator.services.mozilla.com/D179268
* style: Clean up Context::for_non_inherited_propertyEmilio Cobos Álvarez2023-11-241-8/+6
| | | | | | | We don't ever check the particular property, so it can just be a boolean. Differential Revision: https://phabricator.services.mozilla.com/D180680
* style: Fix rebase conflict with bug 1837664Emilio Cobos Álvarez2023-11-241-1/+1
|
* style: Do not snap -webkit-text-stroke-width to dev pixelsEmilio Cobos Álvarez2023-11-242-46/+95
| | | | | | | 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: Improve border shorthand serializationEmilio Cobos Álvarez2023-11-241-1/+31
| | | | | | | | | | | | Fix some bugs caught by css/cssom/shorthand-values. In particular: * Make the shorthand order match the spec. * Omit values when we can. Fix a subtest that wasn't correct. Shorthands can be serialized as long as !important matches in all components. Differential Revision: https://phabricator.services.mozilla.com/D180466
* Further changes required by ServoOriol Brufau2023-11-241-7/+4
|
* style: Add method to parse CSS filters without context for workersAndrew Osmond2023-11-242-0/+93
| | | | | | | | This patch adds the ability to parse most CSS filters without a context. OffscreenCanvas can use this on worker threads to provide support for filter operations. Differential Revision: https://phabricator.services.mozilla.com/D179994
* style: Serialize NaN and infinity numbersCanadaHonk2023-11-242-20/+22
| | | | | | | | | | | | | | | | | Added NaN/inf serialization of <number> and changed calc() code to not remove NaN/infinity in code using it. This change is unfortunately imperfect as some things using <number> still refuse to serialize NaN/infinity for some reason (scale()?), but this bug/patch is just for <number> so leaving that out of scope for this. Also added new WPT test file for number NaN/inf serialization based on existing serialization tests (all pass already!). 5 other WPT subtests now newly pass. Differential Revision: https://phabricator.services.mozilla.com/D178587
* 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-11/+27
| | | | | | | | | | | | 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: Update the syntax of offset-positionBoris Chiou2023-11-242-2/+8
| | | | | | | | | | | | | | | 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-241-12/+19
| | | | | | | | 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-249-70/+98
| | | | | | | | $ find servo -name '*.rs' | xargs rustup run nightly rustfmt Depends on D179380 Differential Revision: https://phabricator.services.mozilla.com/D179381
* style: Simplify some appearance codeEmilio Cobos Álvarez2023-11-241-10/+0
| | | | | | | | | | | | I was looking into simplifying our scrollbar styles: * StyleAppearance::Resizer is not used in content, and some of the values were only for <xul:window> which are not supported anymore. * Statusbarpanel and Resizerpanel aren't used. Statusbar is only used once on macOS so we only need to keep it there. Differential Revision: https://phabricator.services.mozilla.com/D178374
* style: [css-properties-values-api] Parsing and serialization for @property ↵Zach Hoffman2023-11-242-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: Reject empty svg path string for basic shape path functionBoris Chiou2023-11-244-29/+59
| | | | | | | | | | Per CSS shape spec, the empty path string is invalid. However, for SVG d property, the EBNF allows the path data string in the d property to be empty. We just disable the rendering of the path. Note: only offset-path and clip-path are affected. Differential Revision: https://phabricator.services.mozilla.com/D178123
* style: Implement parsing for `baseline-source`David Shin2023-11-242-5/+44
| | | | Differential Revision: https://phabricator.services.mozilla.com/D173884
* style: [css-nesting] Update cssparser againEmilio Cobos Álvarez2023-11-241-6/+1
| | | | | | | | | | | | | | | This changes the cssparser setup to: * Avoid having to do copies of the ParsingContext all over the place, which is useful because I plan to stash more nesting state in there. * Use the new RuleBodyParser which allows parsing qualified rules, declarations, and so on. Though we still don't use this anywhere. The next step is to join NestedRuleParser and PropertyDeclarationParser, so that we can parse declarations in a lot of the nested rules as well. Differential Revision: https://phabricator.services.mozilla.com/D178053
* style: Remove some magic from the bindingsEmilio Cobos Álvarez2023-11-241-3/+3
| | | | | | | | | | | | | | | | | | | This simplifies a tiny bit our bindings in some places, and complicates it in others, but over all I think it's better. It requires a bit more manual code in the rust side to drop and cast the relevant pointers (which was done implicitly before), but it's a lot less magic than it used to be, and that's all autogenerated so consumers don't need to care about it. The set up is still not ideal. I don't like that we rely on destructors running in both sides of the FFI boundary, but that's for another day. This is the last usage of RawOffsetArc, so remove that. We now support proper Arc<> in structs (GridTemplateAreas uses it), so I don't think we'll need it any time soon. Differential Revision: https://phabricator.services.mozilla.com/D177905
* style: Container units should prevent us from using the rule cacheEmilio Cobos Álvarez2023-11-241-0/+3
| | | | | | | | | | | | Much like with font-relative units, when they're used for a non-inherited property we need to avoid using the rule cache. This is because two elements matching the same rules won't get guaranteed-equal non-inherited style structs. Depends on D177732 Differential Revision: https://phabricator.services.mozilla.com/D177733
* style: Clean up length handlingEmilio Cobos Álvarez2023-11-241-164/+160
| | | | | | | 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: Add an API to parse an absolute length without any other contextEmilio Cobos Álvarez2023-11-241-1/+9
| | | | | | This should allow making these work on canvas. Differential Revision: https://phabricator.services.mozilla.com/D177074
* style: display: inline list-item is also a line participantEmilio Cobos Álvarez2023-11-241-1/+3
| | | | | | | | | | | | | So the line break suppression flags should be propagated through it. Otherwise ruby invariants might break, leading to a nullptr crash in this case. On debug builds the assertion was this one: https://searchfox.org/mozilla-central/rev/e6cb503ac22402421186e7488d4250cc1c5fecab/layout/generic/nsRubyBaseContainerFrame.cpp#631 Differential Revision: https://phabricator.services.mozilla.com/D177093
* style: Hardening color checksTiaan Louw2023-11-241-6/+5
| | | | | | | Avoid trying to resolve a currentcolor when a foreground color is not available. Differential Revision: https://phabricator.services.mozilla.com/D177368
* style: Remove HasBoxFFIEmilio Cobos Álvarez2023-11-211-11/+0
| | | | | | | | | | HasBoxFFI and HasArcFFI aren't great, see bug 1831242 as for examples of why. HasArcFFI requires a bit more care, but HasBoxFFI doesn't give us much benefit. Instead use the same type in the FFI boundary. Differential Revision: https://phabricator.services.mozilla.com/D177252
* style: Support self keyword for scroll()Boris Chiou2023-11-211-1/+3
| | | | | | | | `self` keyword specifies to use the element’s own principal box as the scroll container. If the principal box is not a scroll container, then the scroll progress timeline is inactive. Differential Revision: https://phabricator.services.mozilla.com/D175707
* style: Update the syntax of scroll() to accept <scroller> and <axis> in any ↵Boris Chiou2023-11-211-7/+21
| | | | | | | | | order The order of <scroller> and <axis> doesn't matter in the parser. However, we serialize <scroller> first, if it is not the initial value. Differential Revision: https://phabricator.services.mozilla.com/D173906
* style: Rework -x-text-zoom to allow disabling text zoom and min-font-size ↵Emilio Cobos Álvarez2023-11-212-13/+17
| | | | | | | | | | | | | | 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 negate node to use in place of mul_by in sum nodesTiaan Louw2023-11-211-1/+1
| | | | | | | | | 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-48/+97
| | | | | | | | | | | | | | | | 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
* Further changes required by ServoOriol Brufau2023-11-211-0/+1
|
* style: Move animation-related values from box.rs/ui.rs to animation.rsBoris Chiou2023-11-214-357/+373
| | | | | | | | | | | | 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: Enable all math functions on chrome codeEmilio Cobos Álvarez2023-11-218-12/+15
| | | | | | | | | They should be stable. Not sure this is worth writing a test for since the idea is that this code goes away eventually. Differential Revision: https://phabricator.services.mozilla.com/D176680
* style: Remove a bunch of now completely dead XUL layout codeEmilio Cobos Álvarez2023-11-211-25/+0
| | | | | | | | | And some related tests. A bunch of -moz-box* properties are web exposed, so I'll file a follow-up for hiding them. Differential Revision: https://phabricator.services.mozilla.com/D173819
* style: Minor clean ups on top of the previous patchEmilio Cobos Álvarez2023-11-211-140/+41
| | | | | | | Remove now dead Mul implementations. Use Self rather than the whole type to shrink a bit the code. Differential Revision: https://phabricator.services.mozilla.com/D173143
* style: Refactor mul_by fn into map fnTiaan Louw2023-11-212-26/+89
| | | | | | | 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: Color interpolation takes none keyword into accountTiaan Louw2023-11-211-8/+6
| | | | | | | | | Now that the none keyword is available, we can take it into account when interpolating colors following the rules from the spec here: https://drafts.csswg.org/css-color-4/#interpolation-missing Differential Revision: https://phabricator.services.mozilla.com/D172666
* style: Allow 'none' keyword in color componentsTiaan Louw2023-11-211-30/+88
| | | | | | | | | | | | Make use of the new changes in the cssparser that allows 'none' keywords in color components where allowed. We store the none values as 0.0 (as per the spec) and mark the components with the flags. This way we don't have to check anything on the components before doing calculations. As this is the last part intended to be released for the new [color-4] changes, I've also enabled the changes on nightly. Differential Revision: https://phabricator.services.mozilla.com/D170208
* style: Support rendering content: <gradient> imagesEmilio Cobos Álvarez2023-11-212-19/+15
| | | | | | We implemented support for list-style-image anyways. Differential Revision: https://phabricator.services.mozilla.com/D172343
* style: Simplify/remove a couple other length operationsEmilio Cobos Álvarez2023-11-211-34/+5
| | | | Differential Revision: https://phabricator.services.mozilla.com/D172430
* style: Fix a couple minor issues with the previous patchEmilio Cobos Álvarez2023-11-211-19/+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-32/+98
| | | | | | | | | | 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: Infinity angles should degenerate compute to 0CanadaHonk2023-11-211-1/+8
| | | | | | | | Also adjusted WPT tests to always expect deg like similar past changes. WPT tests: https://github.com/web-platform-tests/wpt/blob/master/css/css-values/calc-infinity-nan-computed.html#L57-L71 Differential Revision: https://phabricator.services.mozilla.com/D172401
* style: Rustfmt recent changes to calc.rsEmilio Cobos Álvarez2023-11-211-12/+14
| | | | Differential Revision: https://phabricator.services.mozilla.com/D172339