style: Merge ImageLayer and Image.

ImageLayer is almost the only usage of Image, so keeping them in the same enum
makes the resulting C++ struct smaller, and makes it map more cleanly to
nsStyleImage.

Differential Revision: https://phabricator.services.mozilla.com/D62161
This commit is contained in:
Emilio Cobos Álvarez 2020-02-10 20:02:31 +00:00
parent c0d67f796c
commit 149cb5f5f1
12 changed files with 62 additions and 112 deletions

View file

@ -684,7 +684,7 @@ fn notify_paint_worklet<E>(context: &StyleContext<E>, data: &ElementData)
where
E: TElement,
{
use crate::values::generics::image::{GenericImageLayer, Image};
use crate::values::generics::image::Image;
use style_traits::ToCss;
// We speculatively evaluate any paint worklets during styling.
@ -694,7 +694,7 @@ where
if let Some(ref values) = data.styles.primary {
for image in &values.get_background().background_image.0 {
let (name, arguments) = match *image {
GenericImageLayer::Image(Image::PaintWorklet(ref worklet)) => {
Image::PaintWorklet(ref worklet) => {
(&worklet.name, &worklet.arguments)
},
_ => continue,