aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/values/generics/rect.rs
Commit message (Collapse)AuthorAgeFilesLines
* Move Stylo to its own repo (#31350)Delan Azabani2024-02-271-126/+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: Use write_char in place of write_str when serializing ↵Jonathan Kew2023-11-061-3/+3
| | | | | | | | | | | | 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: Switch all callsites of try() to try_parse() in the style crate.Emilio Cobos Álvarez2020-06-181-3/+3
| | | | | | | | | 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: Make various border-image-* properties interpolable.Brian Birtles2019-10-091-0/+1
| | | | Differential Revision: https://phabricator.services.mozilla.com/D46724
* 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-0/+1
| | | | Differential Revision: https://phabricator.services.mozilla.com/D17197
* style: Use Rust lengths for margin / padding / inset.Emilio Cobos Álvarez2019-02-101-0/+1
| | | | | | | | | | | | | | | Also for the intersection observer root margin, since it was easier to fix it up and clean it up than not doing it. This is the first big step to get rid of nscoord. It duplicates a bit of logic in nsLayoutUtils since for now max/min-width/height are still represented with nsStyleCoord, but I think I prefer to land this incrementally. I didn't add helpers for the physical accessors of the style rect sides that nsStyleSides has (top/bottom/left/right) since I think we generally should encourage the logical versions, but let me know if you want me to do that. Differential Revision: https://phabricator.services.mozilla.com/D17739
* style: Clamp to non-negative value after doing interpolation for circle(), ↵Boris Chiou2019-01-071-0/+1
| | | | | | | | | | | | | | | ellipse(), and inset(). Replace LengthOrPercentage with NonNegativeLengthOrPercentage on ShapeRadius, Circle, Ellipse. And derive ToAnimatedValue for ShapeSource and its related types, so we clamp its interpolated results into non-negative values. (i.e. The radius of circle()/ellipse() and the border-radius of inset().) Note: We may get negative values when using a negative easing function, so the clamp is necessary to avoid the incorrect result or any undefined behavior. Differential Revision: https://phabricator.services.mozilla.com/D14654
* Update MPL license to https (part 4)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* style: Revert try -> r#try change.Emilio Cobos Álvarez2018-11-101-3/+3
| | | | | Since we're in an inconsistent state because mako files weren't updated, and it's really really ugly.
* `cargo fix --edition`Simon Sapin2018-11-101-4/+4
|
* Format style component.chansuke2018-09-091-2/+11
|
* style: Add a ValueInfo trait for exposing types needed by devtools.Xidorn Quan2018-04-291-2/+2
| | | | | | | | | | | | 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-13/+31
| | | | | | | | | | 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)
* Change ToCss to take a CssWriter<W>Anthony Ramine2018-01-231-4/+5
| | | | | | 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.
* Replace all uses of the `heapsize` crate with `malloc_size_of`.Nicholas Nethercote2017-10-181-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`. `malloc_size_of` is better -- it handles various cases that `heapsize` does not -- so this patch changes Servo to use `malloc_size_of`. This patch makes the following changes to the `malloc_size_of` crate. - Adds `MallocSizeOf` trait implementations for numerous types, some built-in (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`). - Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't support that operation. - For `HashSet`/`HashMap`, falls back to a computed estimate when `enclosing_size_of_op` isn't available. - Adds an extern "C" `malloc_size_of` function that does the actual heap measurement; this is based on the same functions from the `heapsize` crate. This patch makes the following changes elsewhere. - Converts all the uses of `heapsize` to instead use `malloc_size_of`. - Disables the "heapsize"/"heap_size" feature for the external crates that provide it. - Removes the `HeapSizeOf` implementation from `hashglobe`. - Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of` doesn't derive those types, unlike `heapsize`.
* style: Be a little less From-happy with rect.Emilio Cobos Álvarez2017-09-171-9/+5
|
* Measure PropertyDeclaration more thoroughly.Nicholas Nethercote2017-09-141-0/+1
| | | | | | | | | | | | | | | This patch replaces the handwritten MallocSizeOf implementation for PropertyDeclaration with a derived one, which gives much more thorough measurement. This requires (a) deriving MallocSizeOf for a *lot* of additional types (most of which already have `derive(HeapSizeOf)` in Servo builds), and (b) implementing MallocSizeOf for a few more types in the `malloc_size_of` crate. These changes would significantly improve the reporting coverage for gmail if it weren't for the fact that SpecifiedUrl isn't measured due to a lack of clarity about its fields; that can be fixed as a follow-up once bug 1397971 has landed.
* style: Remove HasViewportPercentage.Emilio Cobos Álvarez2017-08-291-1/+1
| | | | It's not needed since #18268
* Derive the most trivial Animate implsAnthony Ramine2017-08-221-16/+2
|
* Introduce values::animated::AnimateAnthony Ramine2017-08-221-14/+10
| | | | This replaces the Animatable trait and merges its three former methods into a single one.
* Derive ComputeSquaredDistanceAnthony Ramine2017-08-131-17/+1
|
* Introduce ComputeSquaredDistanceAnthony Ramine2017-08-131-0/+16
| | | | | This allows us to merge the former Animatable methods compute_distance and compute_squared_distance, reducing code size.
* Animate basic shapesAnthony Ramine2017-08-111-0/+19
|
* Thread ParseError return values through CSS parsing.Josh Matthews2017-06-091-6/+6
|
* Make Rect<T> a struct tupleAnthony Ramine2017-05-281-37/+24
| | | | | It makes no sense to have named fields in some cases, notably to reuse Rect<T> in BorderRadius<T>.
* Introduce style::values::generics::rect ▭Anthony Ramine2017-05-231-0/+110
This defines a single type Rect<T> which allows us to abstract over CSS values made of four sides top, right, bottom and left.