@@ -57,10 +57,10 @@ use style::logical_geometry::{LogicalMargin, LogicalPoint, LogicalRect};
5757use style:: properties:: { style_structs, ComputedValues } ;
5858use style:: servo:: restyle_damage:: ServoRestyleDamage ;
5959use style:: values:: computed:: effects:: SimpleShadow ;
60- use style:: values:: computed:: image:: Image as ComputedImage ;
60+ use style:: values:: computed:: image:: { Image , ImageLayer } ;
6161use style:: values:: computed:: { Gradient , LengthOrAuto } ;
6262use style:: values:: generics:: background:: BackgroundSize ;
63- use style:: values:: generics:: image:: { GradientKind , Image , PaintWorklet } ;
63+ use style:: values:: generics:: image:: { GradientKind , PaintWorklet } ;
6464use style:: values:: specified:: ui:: CursorKind ;
6565use style:: values:: { Either , RGBA } ;
6666use style_traits:: ToCss ;
@@ -726,9 +726,13 @@ impl Fragment {
726726 // http://www.w3.org/TR/CSS21/colors.html#background
727727 let background = style. get_background ( ) ;
728728 for ( i, background_image) in background. background_image . 0 . iter ( ) . enumerate ( ) . rev ( ) {
729+ let background_image = match * background_image {
730+ ImageLayer :: None => continue ,
731+ ImageLayer :: Image ( ref image) => image,
732+ } ;
733+
729734 match * background_image {
730- Either :: First ( _) => { } ,
731- Either :: Second ( Image :: Gradient ( ref gradient) ) => {
735+ Image :: Gradient ( ref gradient) => {
732736 self . build_display_list_for_background_gradient (
733737 state,
734738 display_list_section,
@@ -738,7 +742,7 @@ impl Fragment {
738742 i,
739743 ) ;
740744 } ,
741- Either :: Second ( Image :: Url ( ref image_url) ) => {
745+ Image :: Url ( ref image_url) => {
742746 if let Some ( url) = image_url. url ( ) {
743747 let webrender_image = state. layout_context . get_webrender_image_for_url (
744748 self . node ,
@@ -757,7 +761,7 @@ impl Fragment {
757761 }
758762 }
759763 } ,
760- Either :: Second ( Image :: PaintWorklet ( ref paint_worklet) ) => {
764+ Image :: PaintWorklet ( ref paint_worklet) => {
761765 let bounding_box = self . border_box - style. logical_border_width ( ) ;
762766 let bounding_box_size = bounding_box. size . to_physical ( style. writing_mode ) ;
763767 let background_size =
@@ -790,10 +794,10 @@ impl Fragment {
790794 ) ;
791795 }
792796 } ,
793- Either :: Second ( Image :: Rect ( _) ) => {
797+ Image :: Rect ( _) => {
794798 // TODO: Implement `-moz-image-rect`
795799 } ,
796- Either :: Second ( Image :: Element ( _) ) => {
800+ Image :: Element ( _) => {
797801 // TODO: Implement `-moz-element`
798802 } ,
799803 }
@@ -978,7 +982,7 @@ impl Fragment {
978982 } ;
979983 DisplayItem :: Gradient ( CommonDisplayItem :: with_data ( base, item, stops) )
980984 } ,
981- GradientKind :: Radial ( shape, center, _angle ) => {
985+ GradientKind :: Radial ( shape, center) => {
982986 let ( gradient, stops) = gradient:: radial (
983987 style,
984988 placement. tile_size ,
@@ -1115,7 +1119,7 @@ impl Fragment {
11151119 let border_radius = border:: radii ( bounds, border_style_struct) ;
11161120 let border_widths = border. to_physical ( style. writing_mode ) ;
11171121
1118- if let Either :: Second ( ref image) = border_style_struct. border_image_source {
1122+ if let ImageLayer :: Image ( ref image) = border_style_struct. border_image_source {
11191123 if self
11201124 . build_display_list_for_border_image (
11211125 state,
@@ -1173,7 +1177,7 @@ impl Fragment {
11731177 style : & ComputedValues ,
11741178 base : BaseDisplayItem ,
11751179 bounds : Rect < Au > ,
1176- image : & ComputedImage ,
1180+ image : & Image ,
11771181 border_width : SideOffsets2D < Au > ,
11781182 ) -> Option < ( ) > {
11791183 let border_style_struct = style. get_border ( ) ;
@@ -1227,7 +1231,7 @@ impl Fragment {
12271231 stops = linear_stops;
12281232 NinePatchBorderSource :: Gradient ( wr_gradient)
12291233 } ,
1230- GradientKind :: Radial ( shape, center, _angle ) => {
1234+ GradientKind :: Radial ( shape, center) => {
12311235 let ( wr_gradient, radial_stops) = gradient:: radial (
12321236 style,
12331237 border_image_area,
0 commit comments