mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Update Stylo to 2023-09-01 (#31609)
* Update Stylo to 2023-09-01 * Fixup for https://phabricator.services.mozilla.com/D184929 * Fixup for https://phabricator.services.mozilla.com/D184526 * Fixup for https://phabricator.services.mozilla.com/D184525 * Fixup for https://phabricator.services.mozilla.com/D185154 * Fixup for https://phabricator.services.mozilla.com/D184685 * Fixup for https://phabricator.services.mozilla.com/D185916 * Fixup for https://phabricator.services.mozilla.com/D185492 * Fixup for https://phabricator.services.mozilla.com/D186626 * Update test expectations
This commit is contained in:
parent
94c1f2c992
commit
c07484fcb6
67 changed files with 235 additions and 491 deletions
|
@ -984,7 +984,7 @@ impl Fragment {
|
|||
ref direction,
|
||||
ref color_interpolation_method,
|
||||
ref items,
|
||||
ref repeating,
|
||||
ref flags,
|
||||
compat_mode: _,
|
||||
} => {
|
||||
let (gradient, stops) = gradient::linear(
|
||||
|
@ -993,7 +993,7 @@ impl Fragment {
|
|||
items,
|
||||
*direction,
|
||||
color_interpolation_method,
|
||||
*repeating,
|
||||
*flags,
|
||||
);
|
||||
let item = webrender_api::GradientDisplayItem {
|
||||
gradient,
|
||||
|
@ -1009,7 +1009,7 @@ impl Fragment {
|
|||
ref position,
|
||||
ref color_interpolation_method,
|
||||
ref items,
|
||||
ref repeating,
|
||||
ref flags,
|
||||
compat_mode: _,
|
||||
} => {
|
||||
let (gradient, stops) = gradient::radial(
|
||||
|
@ -1019,7 +1019,7 @@ impl Fragment {
|
|||
shape,
|
||||
position,
|
||||
color_interpolation_method,
|
||||
*repeating,
|
||||
*flags,
|
||||
);
|
||||
let item = webrender_api::RadialGradientDisplayItem {
|
||||
gradient,
|
||||
|
@ -1252,7 +1252,7 @@ impl Fragment {
|
|||
ref direction,
|
||||
ref color_interpolation_method,
|
||||
ref items,
|
||||
ref repeating,
|
||||
ref flags,
|
||||
compat_mode: _,
|
||||
} => {
|
||||
let (wr_gradient, linear_stops) = gradient::linear(
|
||||
|
@ -1261,7 +1261,7 @@ impl Fragment {
|
|||
items,
|
||||
*direction,
|
||||
color_interpolation_method,
|
||||
*repeating,
|
||||
*flags,
|
||||
);
|
||||
stops = linear_stops;
|
||||
NinePatchBorderSource::Gradient(wr_gradient)
|
||||
|
@ -1271,7 +1271,7 @@ impl Fragment {
|
|||
ref position,
|
||||
ref color_interpolation_method,
|
||||
ref items,
|
||||
ref repeating,
|
||||
ref flags,
|
||||
compat_mode: _,
|
||||
} => {
|
||||
let (wr_gradient, radial_stops) = gradient::radial(
|
||||
|
@ -1281,7 +1281,7 @@ impl Fragment {
|
|||
shape,
|
||||
position,
|
||||
color_interpolation_method,
|
||||
*repeating,
|
||||
*flags,
|
||||
);
|
||||
stops = radial_stops;
|
||||
NinePatchBorderSource::RadialGradient(wr_gradient)
|
||||
|
|
|
@ -8,7 +8,9 @@ use style::color::mix::ColorInterpolationMethod;
|
|||
use style::properties::ComputedValues;
|
||||
use style::values::computed::image::{EndingShape, LineDirection};
|
||||
use style::values::computed::{Angle, Color, LengthPercentage, Percentage, Position};
|
||||
use style::values::generics::image::{Circle, ColorStop, Ellipse, GradientItem, ShapeExtent};
|
||||
use style::values::generics::image::{
|
||||
Circle, ColorStop, Ellipse, GradientFlags, GradientItem, ShapeExtent,
|
||||
};
|
||||
use webrender_api::{ExtendMode, Gradient, GradientBuilder, GradientStop, RadialGradient};
|
||||
|
||||
use crate::display_list::ToLayout;
|
||||
|
@ -242,10 +244,11 @@ pub fn linear(
|
|||
stops: &[GradientItem<Color, LengthPercentage>],
|
||||
direction: LineDirection,
|
||||
_color_interpolation_method: &ColorInterpolationMethod,
|
||||
repeating: bool,
|
||||
flags: GradientFlags,
|
||||
) -> (Gradient, Vec<GradientStop>) {
|
||||
use style::values::specified::position::HorizontalPositionKeyword::*;
|
||||
use style::values::specified::position::VerticalPositionKeyword::*;
|
||||
let repeating = flags.contains(GradientFlags::REPEATING);
|
||||
let angle = match direction {
|
||||
LineDirection::Angle(angle) => angle.radians(),
|
||||
LineDirection::Horizontal(x) => match x {
|
||||
|
@ -310,8 +313,9 @@ pub fn radial(
|
|||
shape: &EndingShape,
|
||||
center: &Position,
|
||||
_color_interpolation_method: &ColorInterpolationMethod,
|
||||
repeating: bool,
|
||||
flags: GradientFlags,
|
||||
) -> (RadialGradient, Vec<GradientStop>) {
|
||||
let repeating = flags.contains(GradientFlags::REPEATING);
|
||||
let center = Point2D::new(
|
||||
center.horizontal.to_used_value(size.width),
|
||||
center.vertical.to_used_value(size.height),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue