mirror of
https://github.com/servo/servo.git
synced 2025-09-02 11:08:22 +01:00
Use generics for the filter property
This introduces an additional shadow type for drop-shadow().
This commit is contained in:
parent
e41b7d06b4
commit
6f4061d4ad
21 changed files with 822 additions and 496 deletions
|
@ -41,7 +41,10 @@ macro_rules! no_viewport_percentage {
|
|||
|
||||
no_viewport_percentage!(bool, f32);
|
||||
|
||||
impl<T: HasViewportPercentage> HasViewportPercentage for Box<T> {
|
||||
impl<T> HasViewportPercentage for Box<T>
|
||||
where
|
||||
T: ?Sized + HasViewportPercentage
|
||||
{
|
||||
#[inline]
|
||||
fn has_viewport_percentage(&self) -> bool {
|
||||
(**self).has_viewport_percentage()
|
||||
|
@ -69,6 +72,13 @@ impl<T: HasViewportPercentage> HasViewportPercentage for Vec<T> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<T: HasViewportPercentage> HasViewportPercentage for [T] {
|
||||
#[inline]
|
||||
fn has_viewport_percentage(&self) -> bool {
|
||||
self.iter().any(T::has_viewport_percentage)
|
||||
}
|
||||
}
|
||||
|
||||
/// A set of viewport descriptors:
|
||||
///
|
||||
/// https://drafts.csswg.org/css-device-adapt/#viewport-desc
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue