aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/values/specified/effects.rs
Commit message (Collapse)AuthorAgeFilesLines
* Move Stylo to its own repo (#31350)Delan Azabani2024-02-271-450/+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
* Further changes required by ServoOriol Brufau2023-11-241-7/+4
|
* style: Add method to parse CSS filters without context for workersAndrew Osmond2023-11-241-0/+91
| | | | | | | | 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
* Implement support for the `drop-shadow` filter (#30439)Ennui Langeweile2023-10-041-1/+1
| | | | | | | | | | | | | | | | | | * Implement support for `drop-shadow` * Clean up remnant from early attempts * Fix misleading comments on GenericSimpleShadow If Servo-specific `style` changes will need to be upstreamed anyway, I might as well fix a thing that had thrown me off! * Revert "Fix misleading comments on GenericSimpleShadow" This reverts commit cdc810b826ac082041adc212c24649ee3b86ca0a. * Clean up an import * Update test expectations * Fix missing expectation on Layout 2013
* style: Fix some manual occurrences of try().Emilio Cobos Álvarez2020-06-181-10/+9
| | | | | | Depends on D80099 Differential Revision: https://phabricator.services.mozilla.com/D80100
* style: Switch all callsites of try() to try_parse() in the style crate.Emilio Cobos Álvarez2020-06-181-16/+18
| | | | | | | | | 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: rustfmt recent changes.Emilio Cobos Álvarez2019-07-081-5/+17
|
* style: Add computed value ZeroToOneNumber.violet2019-07-081-57/+70
| | | | | | | Correctly handle clamping to 1 behavior of grayscale(), invert(), opacity() and sepia(). Differential Revision: https://phabricator.services.mozilla.com/D35509
* style: Rustfmt recent changes.Emilio Cobos Álvarez2019-06-041-1/+2
|
* style: Use cbindgen for filters.Emilio Cobos Álvarez2019-06-041-4/+6
| | | | | | Had to implement some OwnedSlice bits that the canvas code used. Differential Revision: https://phabricator.services.mozilla.com/D31799
* style: Accept empty argument for some filters.violet2019-05-291-10/+41
| | | | | | | | | | | | | | | Filters blur(), invert(), etc. can omit argument. Computed/specified style serialization is a little tricky w.r.t the shortest serialization principle. Ideally we should serialize `invert(1)` to `invert()`, but that will be a breaking change, so we always serialize them with an argument. Note, Blink/WetKit treat specified (but not computed) style serialization differently when the specified one is originally without argument. Our current behavior is the same as pre-Chromium Edge. Differential Revision: https://phabricator.services.mozilla.com/D31720
* style: Add derived ToShmem implementations.Cameron McCormack2019-04-121-1/+1
| | | | Differential Revision: https://phabricator.services.mozilla.com/D17197
* style: Add a Zero trait that doesn't require Add, and use it in place of ↵Emilio Cobos Álvarez2019-03-131-0/+1
| | | | | | | | | num_traits and IsZeroLength. Use it to be consistent in InsetRect serialization and storage between Servo and Gecko. Differential Revision: https://phabricator.services.mozilla.com/D21493
* 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-9/+9
| | | | | 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-2/+2
|
* `cargo fix --edition`Simon Sapin2018-11-101-23/+25
|
* Reorder importsPyfisch2018-11-061-5/+5
|
* Format style component.chansuke2018-09-091-7/+11
|
* style: Change nscolor to StyleComplexColor in nsCSSShadowItem.Dan Glastonbury2018-07-011-12/+17
| | | | | | Bug: 1467621 Reviewed-by: xidorn MozReview-Commit-ID: moE2CI7fT8
* Fix Servo build.Emilio Cobos Álvarez2018-05-191-1/+2
|
* style: Distinguish between specified and computed URLs.Emilio Cobos Álvarez2018-05-191-3/+2
| | | | | | | | This is needed to serialize computed URLs correctly from getComputedStyle. Bug: 1461288 Reviewed-by: xidorn MozReview-Commit-ID: 9wakhqNrszb
* style: Add a ValueInfo trait for exposing types needed by devtools.Xidorn Quan2018-04-291-1/+1
| | | | | | | | | | | | 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-17/+27
| | | | | | | | | | 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)
* style: Allow parsing unitless zero angles in hue-rotate().Emilio Cobos Álvarez2017-12-021-1/+5
| | | | Per https://github.com/w3c/fxtf-drafts/issues/228
* 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`.
* Update to cssparser 0.22 (source location in error types)Simon Sapin2017-10-101-6/+13
|
* Auto merge of #18517 - BorisChiou:stylo/filter/clamp, r=emiliobors-servo2017-09-181-4/+44
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | style: Clamp some filter functions to one if the values over 100% For grayscale, invert, opacity, and sepia, "values of amount over 100% are allowed but UAs must clamp the values to 1" [1]-[4], so we clamp its value in the parser. [1] https://drafts.fxtf.org/filter-effects/#funcdef-filter-grayscale [2] https://drafts.fxtf.org/filter-effects/#funcdef-filter-invert [3] https://drafts.fxtf.org/filter-effects/#funcdef-filter-opacity [4] https://drafts.fxtf.org/filter-effects/#funcdef-filter-sepia --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix [Bug 1399799](https://bugzilla.mozilla.org/show_bug.cgi?id=1399799). - [X] There are tests for these changes <!-- 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/18517) <!-- Reviewable:end -->
| * Clamp some filter functions to one if the values over 100%.Boris Chiou2017-09-181-4/+44
| | | | | | | | | | | | | | | | | | | | | | For grayscale, invert, opacity, and sepia, "values of amount over 100% are allowed but UAs must clamp the values to 1" [1]-[4], so we clamp its value in the parser. [1] https://drafts.fxtf.org/filter-effects/#funcdef-filter-grayscale [2] https://drafts.fxtf.org/filter-effects/#funcdef-filter-invert [3] https://drafts.fxtf.org/filter-effects/#funcdef-filter-opacity [4] https://drafts.fxtf.org/filter-effects/#funcdef-filter-sepia
* | 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.
* Report more specific error for invalid filter properties (bug 1386900).Josh Matthews2017-09-061-4/+10
|
* style: Remove HasViewportPercentage.Emilio Cobos Álvarez2017-08-291-1/+1
| | | | It's not needed since #18268
* Use Option<RGBA> for color in shadowXidorn Quan2017-08-191-9/+9
|
* Bug 1374233 - Part 13: Use NonNegative{*} types for components of Shadow and ↵Boris Chiou2017-08-041-14/+15
| | | | | | Filter. MozReview-Commit-ID: Im4KGy1n9IJ
* Update cssparser to 0.18Simon Sapin2017-07-241-1/+1
| | | | https://github.com/servo/rust-cssparser/pull/171
* style: Respect calc for percentages.Emilio Cobos Álvarez2017-07-141-47/+31
|
* Make text-shadow and box-shadow use SimpleShadowAnthony Ramine2017-06-281-1/+85
|
* Use the Separator trait for the filter propertyAnthony Ramine2017-06-271-22/+1
|
* Use generics for SimpleShadowAnthony Ramine2017-06-241-15/+2
|
* Unconditionally compile SimpleShadow even in ServoAnthony Ramine2017-06-231-37/+9
|
* Rename DropShadow to SimpleShadowAnthony Ramine2017-06-231-11/+11
|
* Simplify machinery to serialise optional parts of CSS valuesAnthony Ramine2017-06-211-27/+1
| | | | | We simply implement ToCss for Option<T>, printing nothing if the value is None, and we then use SequenceWriter to skip writing of separators around empty parts.
* Use generics for the filter propertyAnthony Ramine2017-06-201-0/+244
This introduces an additional shadow type for drop-shadow().