aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/values/specified/svg_path.rs
Commit message (Collapse)AuthorAgeFilesLines
* Move Stylo to its own repo (#31350)Delan Azabani2024-02-271-1030/+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: Rustfmt servo/. r=zrhoffmanEmilio Cobos Álvarez2023-11-241-3/+1
| | | | | | | | $ 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-2/+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-241-20/+48
| | | | | | | | | | 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: Re-define CoordPair structBoris Chiou2023-11-211-6/+10
| | | | | | Redefine/Rename the fields in CoordPair to align the data members of gfx::Point. Differential Revision: https://phabricator.services.mozilla.com/D5903
* style: Clean up list interpolation codeEmilio Cobos Álvarez2023-11-061-22/+10
| | | | | | | 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: Run rustfmt on servo/components/style and servo/ports/geckolibTing-Yu Lin2023-06-091-9/+9
| | | | | | | | | | | | 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
* Further changes required by ServoOriol Brufau2023-05-241-0/+1
|
* style: Part 7: Notify style system when SMIL animation changes d attributeBoris Chiou2023-05-241-0/+115
| | | | | | | 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
* style: Reformat recent changes.Emilio Cobos Álvarez2020-04-161-3/+12
|
* style: Ensure that derived types are right for optimized-away implementations.Emilio Cobos Álvarez2020-04-161-2/+9
| | | | | | | | | | | | | | | | | | | | | | We have this optimization where, for non-generic structs, we generate just a clone / move as the ToComputedValue / ToResolvedValue implementation. This moves the optimization a bit further down, and refines it so that we still generate all the relevant where clauses that make it sound, that is, that all the ToComputedValue implementations of the fields return the same type. Otherwise this wouldn't be sound and the type would need to become generic. We add an escape hatch (no_field_bound) for fields that need to be cloned but which don't implement the trait. This is right now only for the RefPtr<> in the shared font-family list, and a piece of code in PaintWorklet which looks kinda fishy, and probably should be fixed (but we don't ship it in Firefox and there's a pre-existing FIXME for servo, so I punted on it for now). The other thing this patch does is adding a bunch of ToComputedValue / ToResolvedValue implementations that are trivial and were missing. Differential Revision: https://phabricator.services.mozilla.com/D67913
* style: Make the empty svg path valid.Boris Chiou2020-02-121-5/+0
| | | | | | | | | | | Per SVG2 spec, the EBNF allows the path data string to be empty. An empty path data string disables rendering of the path. Therefore, we should make path('') a valid path string. The related spec issue: https://github.com/w3c/fxtf-drafts/issues/392. Now we serialize `path("")` as `path("")` for offset-path and clip-path. Differential Revision: https://phabricator.services.mozilla.com/D60771
* style: Use Serde for SVGOffsetPath.Boris Chiou2020-02-121-1/+11
| | | | Differential Revision: https://phabricator.services.mozilla.com/D60087
* style: Add new layer messages for passing motion path info.Boris Chiou2019-11-041-4/+7
| | | | | | | | | | This also includes the implementation of SetAnimatable, FromAnimatable, and merge the final matrix with motion path. Besides, we always use PathBuilderSkia for calculating the gfx::Path for web-renderer. Differential Revision: https://phabricator.services.mozilla.com/D50011
* style: Expand and simplify a macro that's not very useful.Emilio Cobos Álvarez2019-08-151-25/+15
| | | | | | | | | | | Skip whitespace upfront rather than on each individual branch. The only difference in behavior is that we would've consumed some extra whitespace in the error case, but I don't think that matters at all. We were consuming some extra whitespace as well after the close path command for example, which wasn't parsing anything. Differential Revision: https://phabricator.services.mozilla.com/D40539
* style: Deindent a bit SVG path parsing code.Emilio Cobos Álvarez2019-08-151-32/+28
| | | | | | None cannot be returned, since we just called peek() and it returned something. Differential Revision: https://phabricator.services.mozilla.com/D40538
* style: Rustfmt + build fix.Emilio Cobos Álvarez2019-05-101-3/+4
|
* style: Add bindings for ArcSlice and ThinArc, and use them to reduce copies ↵Emilio Cobos Álvarez2019-05-101-19/+20
| | | | | | | | | | | of SVG path data. As I said over bug 1549593, the eventual goal is to use ArcSlice in all inherited properties. But this seemed like a good first candidate that doesn't require me to move around a lot more code, since we were already using cbindgen for the path commands. Differential Revision: https://phabricator.services.mozilla.com/D30134
* style: Derive ToResolvedValue.Emilio Cobos Álvarez2019-04-121-0/+1
| | | | Differential Revision: https://phabricator.services.mozilla.com/D26783
* style: Add derived ToShmem implementations.Cameron McCormack2019-04-121-2/+12
| | | | Differential Revision: https://phabricator.services.mozilla.com/D17197
* style: Derive more.Bobby Holley2019-01-291-9/+1
| | | | Differential Revision: https://phabricator.services.mozilla.com/D17029
* Update MPL license to https (part 4)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* `cargo fix --edition`Simon Sapin2018-11-101-4/+4
|
* Reorder importsPyfisch2018-11-061-2/+2
|
* Format remaining filesPyfisch2018-11-061-1/+0
|
* style: Flip boolean half way for path interpolation.Boris Chiou2018-09-221-3/+29
| | | | | | | According to the new svg 2 spec update (#543), we flip the flag half way for path interpolation. Differential Revision: https://phabricator.services.mozilla.com/D6192
* style: Teach ComputeSquaredDistance derive about #[animation(constant)].Emilio Cobos Álvarez2018-09-151-7/+0
| | | | Differential Revision: https://phabricator.services.mozilla.com/D5337
* Format style component.chansuke2018-09-091-63/+220
|
* style: Use the standalone struct and enum for the flags in SVG path.Boris Chiou2018-09-091-109/+101
| | | | | | | | | | We define the standalone types for using derive macro easily and overriding the behaviors of this traits. This could avoid defining the general behavior of booleans. Depends on D4788 Differential Revision: https://phabricator.services.mozilla.com/D4813
* style: Make offset-path: path() animatable.Boris Chiou2018-09-091-3/+60
| | | | | | | | | | | | | | | | | Here, we change the animation type of offset-path as ComputedValue, so we could do animation on it. Also enable the wpt for offset-path interpolation. In test_transition_per_property.html, we add some basic tests ifor offset-path. ToAnimatedZero for PathCommand will be dropped later. Because the animations of arcs with mismatched flags are fallen back to discrete animations, the result of getComputedValue is not normalized in this case. This makes some wpt failed even though the progress is 100%. Depends on D4786 Differential Revision: https://phabricator.services.mozilla.com/D4787
* style: Make SVGPathData and clip-path: path() animatable.Boris Chiou2018-09-091-2/+144
| | | | | | | | | | | | | Implement Animate trait for SVGPathData. The basic idea is: we normalize |this| and |other| svg paths, and then do interpolation on the normalized svg paths. The normalization is to convert relative coordinates into absolute coordinates, so we could do real number interpolation on each path command directly. In this patch, we also make |clip-path:path()| animatable. Differential Revision: https://phabricator.services.mozilla.com/D4786
* style: Parse byte slice in PathParser.Boris Chiou2018-09-031-48/+46
| | | | | | | We only care about ascii char for svg path, so we could parse the string as byte slice. Differential Revision: https://phabricator.services.mozilla.com/D4168
* style: Move SVGPathData and its parser into svg_path.rs.Boris Chiou2018-09-031-0/+517
SVGPathData will be used by clip-path and offset-path (and/or more on the properties which support <basic-shape>). Therefore, let's move SVGPathData out of motion.rs. Differential Revision: https://phabricator.services.mozilla.com/D3631