aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/values/specified/svg.rs
Commit message (Collapse)AuthorAgeFilesLines
* Move Stylo to its own repo (#31350)Delan Azabani2024-02-271-391/+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: Reject empty svg path string for basic shape path functionBoris Chiou2023-11-241-1/+1
| | | | | | | | | | 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: Use write_char in place of write_str when serializing ↵Jonathan Kew2023-11-061-1/+1
| | | | | | | | | | | | 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: Part 1: Add SVG d property in CSSBoris Chiou2023-05-241-0/+55
| | | | | | | | | Add d property for style system. d property only supports path() for now and it has the functional notation without fill rule. https://github.com/w3c/svgwg/issues/320#issuecomment-414462645 Differential Revision: https://phabricator.services.mozilla.com/D81237
* style: Switch all callsites of try() to try_parse() in the style crate.Emilio Cobos Álvarez2020-06-181-4/+5
| | | | | | | | | Fully automated via: $ rg -l '\.try\(' | xargs sed -i 's/\.try(/.try_parse(/g' $ cd servo/components/style && cargo +nightly fmt Differential Revision: https://phabricator.services.mozilla.com/D80099
* style: Use cbindgen for SVG lengths.Emilio Cobos Álvarez2020-04-161-3/+3
| | | | | | Depends on D63777 Differential Revision: https://phabricator.services.mozilla.com/D63778
* Don't use transmute to create PaintOrder valuesAnthony Ramine2020-04-041-2/+7
| | | | | | I checked that rustc optimises the code just as well as with the transmute. https://rust.godbolt.org/z/w6UJN4
* style: Avoid manual paint-order glue code.Emilio Cobos Álvarez2019-09-121-4/+5
| | | | Differential Revision: https://phabricator.services.mozilla.com/D42913
* style: Use `static_prefs::pref!`.Nicholas Nethercote2019-08-151-2/+1
| | | | | | | | | | It's much nicer. One nice thing about this is that the new code is subject to the existing threadedness checking, which identified that several of these should be atomic because they're accessed off the main thread. Differential Revision: https://phabricator.services.mozilla.com/D40792
* style: Use cbindgen for fill and stroke.Emilio Cobos Álvarez2019-07-081-4/+1
| | | | Differential Revision: https://phabricator.services.mozilla.com/D36807
* style: Use more compact and ffi-friendly types for some svg props.Emilio Cobos Álvarez2019-07-081-2/+2
| | | | | | No functional change yet. Differential Revision: https://phabricator.services.mozilla.com/D36805
* style: Change `StaticPrefs` from a class to a namespace.Nicholas Nethercote2019-07-081-1/+1
| | | | | | | | | | This doesn't change the way C++ code uses static prefs. But it does slightly change how Rust code uses static prefs, specifically the name generated by bindgen is slightly different. The commit also improves some comments. Differential Revision: https://phabricator.services.mozilla.com/D35764
* style: paint-order parsing has off-by-one error.violet2019-07-081-1/+1
| | | | | | A couple of firefox only WPT failure caused by this off-by-one bug. Differential Revision: https://phabricator.services.mozilla.com/D35630
* style: Reformat recent style system changes.Emilio Cobos Álvarez2019-05-291-5/+1
|
* style: Share computed and specified value representation of ↵Emilio Cobos Álvarez2019-05-291-9/+72
| | | | | | -moz-context-properties. Differential Revision: https://phabricator.services.mozilla.com/D30545
* style: Reformat recent changes.Emilio Cobos Álvarez2019-04-121-2/+18
|
* style: Derive ToResolvedValue.Emilio Cobos Álvarez2019-04-121-2/+2
| | | | Differential Revision: https://phabricator.services.mozilla.com/D26783
* style: Add derived ToShmem implementations.Cameron McCormack2019-04-121-2/+6
| | | | Differential Revision: https://phabricator.services.mozilla.com/D17197
* style: Reformat recent changes.Emilio Cobos Álvarez2019-03-131-11/+6
|
* style: Cleanup and fix interpolation of SVG lengths.Emilio Cobos Álvarez2019-03-131-25/+46
| | | | | | | | | | | Instead of storing them as LengthPercentage | Number, always store as LengthPercentage, and use the unitless length quirk to parse numbers instead. Further cleanups to use the rust representation can happen as a followup, which will also get rid of the boolean argument (since we can poke at the rust length itself). That's why I didn't bother to convert it to an enum class yet. Differential Revision: https://phabricator.services.mozilla.com/D21804
* style: Rustfmt recent changes.Emilio Cobos Álvarez2019-02-231-1/+1
|
* style: Improve #[derive(Parse)].Emilio Cobos Álvarez2019-02-231-70/+8
| | | | | | | | | | | | | I want to do this so that I can get rid of Either<>. The reasons for getting rid of either are multiple: * It doesn't generate as nice C++ code using cbindgen. * It isn't that nice to use either from Rust. * cbindgen has bugs with zero-sized types. I started using this for ColorOrAuto and a few others, for now. Differential Revision: https://phabricator.services.mozilla.com/D19844
* style: Rename LengthOrPercentage to LengthPercentage.Emilio Cobos Álvarez2019-01-081-16/+16
| | | | | | | | | | | | It does not represent `<length> | <percentage>`, but `<length-percentage>`, so `LengthOrPercentage` is not the right name. This patch is totally autogenerated using: rg 'LengthOrPercentage' servo | cut -d : -f 1 | sort | uniq > files for file in $(cat files); do sed -i "s#LengthOrPercentage#LengthPercentage#g" $file; done Differential Revision: https://phabricator.services.mozilla.com/D15812
* Update MPL license to https (part 4)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* style: Manually extinguish multi-line use statements.Emilio Cobos Álvarez2018-11-101-3/+2
|
* style: Revert try -> r#try change.Emilio Cobos Álvarez2018-11-101-7/+7
| | | | | Since we're in an inconsistent state because mako files weren't updated, and it's really really ugly.
* `cargo fix --edition --features gecko`Simon Sapin2018-11-101-1/+1
|
* `cargo fix --edition`Simon Sapin2018-11-101-14/+16
|
* Reorder importsPyfisch2018-11-061-3/+3
|
* Format style component.chansuke2018-09-091-4/+2
|
* style: Change nscolor to StyleComplexColor.Dan Glastonbury2018-07-161-3/+3
| | | | | | Bug: 1467622 Reviewed-by: xidorn MozReview-Commit-ID: 1bbQzOoOuBe
* style: Add a ValueInfo trait for exposing types needed by devtools.Xidorn Quan2018-04-291-2/+4
| | | | | | | | | | | | Most of types just derive it using proc_macro directly. Some of value types need manual impl. In my current plan, this new trait will be used in bug 1434130 to expose values as well. Bug: 1455576 Reviewed-by: emilio MozReview-Commit-ID: LI7fy45VkRw
* Run rustfmt on selectors, servo_arc, and style.Bobby Holley2018-04-101-18/+25
| | | | | | | | | | This was generated with: ./mach cargo fmt --package selectors && ./mach cargo fmt --package servo_arc && ./mach cargo fmt --package style Using rustfmt 0.4.1-nightly (a4462d1 2018-03-26)
* Auto merge of #20482 - brainlessdeveloper:list-style-image-computed, r=emiliobors-servo2018-04-031-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement a URL-generic type for ListStyleImage <!-- Please describe your changes on the following line: --> This should fix the following two "expected to fail" tests described in https://github.com/servo/servo/issues/18015: - getComputedStyle(elem) for url() listStyleImage uses the resolved URL and elem.style uses the original URL - getComputedStyle(elem) for url() listStyle uses the resolved URL and elem.style uses the original URL I updated the test failure expectations by removing the corresponding `.ini` file. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #18015 (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20482) <!-- Reviewable:end -->
| * Implement a URL-generic type for list-style-imageFausto Núñez Alberro2018-04-031-1/+2
| | | | | | | | | | | | | | | | | | | | This should fix the following two "expected to fail" tests: - getComputedStyle(elem) for url() listStyleImage uses the resolved URL and elem.style uses the original URL - getComputedStyle(elem) for url() listStyle uses the resolved URL and elem.style uses the original URL
* | Convert StylePrefs to StaticPrefs.Nicholas Nethercote2018-04-031-1/+1
|/
* style: Cleanup indentation in a couple places.Emilio Cobos Álvarez2018-03-041-13/+21
|
* style: Don't guard the context opacity keywords with the svg in opentype pref.Emilio Cobos Álvarez2018-03-041-10/+10
| | | | | This is effectively the stylo version of the second patch for bug 1365926, and should fix bug 1442867.
* Change ToCss to take a CssWriter<W>Anthony Ramine2018-01-231-3/+7
| | | | | | This more concrete wrapper type can write a prefix the very first time something is written to it. This allows removing plenty of useless monomorphisations caused by the former W/SequenceWriter<W> pair of types.
* Make MozContextProperties a different typeIgor Gutorov2018-01-131-2/+3
|
* style: Move -moz-context-properties outside of makoIgor Gutorov2018-01-121-0/+16
|
* style: Move paint-order outside of makoCYBAI2018-01-101-1/+137
|
* Fix commonmark Markdown warnings in docs, part 1Matt Brubeck2017-10-171-2/+2
| | | | | | | | Fixes warnings from rust-lang/rust#44229 when `--enable-commonmark` is passed to rustdoc. This is mostly a global find-and-replace for bare URIs on lines by themselves in doc comments.
* Update to cssparser 0.22 (source location in error types)Simon Sapin2017-10-101-4/+4
|
* style: Remove HasViewportPercentage.Emilio Cobos Álvarez2017-08-291-1/+0
| | | | It's not needed since #18268
* Add SVGLengthOrPercentageOrNumber for stroke-*.Mantaroh Yoshinaga2017-08-181-11/+22
| | | | | | | | | | | We need to use enum instead of Either since we can't interpolate stroke-* between unitless length and unit length(e.g. '5' -> '10px'). This coomit make following: * Introduce SVGLengthOrPercentageOrNumber on computed and specified values. * Make SVGLengthOrPercentageOrNumber animatable. * Make stroke-dasharray not-accumulate.
* Introduce ComputedUrlFausto Núñez Alberro2017-08-091-3/+3
| | | | | | | | Add web platform tests for computed URL styles Mark url with no original or resolved unreachable Update the WPT manifest for new url tests
* Bug 1374233 - Part 9: Add NonNegativeLengthOrPercentageOrNumber for ↵Boris Chiou2017-08-041-10/+18
| | | | | | | | | stroke-{width|dasharry}. Also add SVGWidth which use NonNegativeSVGLengthOrPercentage as the LengthType for stroke-width. MozReview-Commit-ID: 8gD0fVe2eAe
* Add context-{fill,stroke}-opacity support to {fill,stroke}-opacity.Xidorn Quan2017-08-021-1/+20
|
* Make stroke-dasharray accept context-value.Xidorn Quan2017-08-021-1/+19
|