Unify background placement code

Merges the implementations for background-image placement
from gradients and images. Add missing parts and fix bugs.

Now supported are the CSS properties:

* background-attachment (except for local value)
* background-clip
* background-origin
* background-position-x/y
* background-repeat
* background-size

It should be noted that backgrounds are not clipped to
rounded border corners.
This commit is contained in:
Pyfisch 2017-12-27 22:15:58 +01:00
parent d96fb89c31
commit 3b3d4a9853
9 changed files with 306 additions and 344 deletions

View file

@ -729,6 +729,7 @@ pub struct GradientDisplayItem {
///
/// Without tiles, the tile will be the same size as the background.
pub tile: Size2D<Au>,
pub tile_spacing: Size2D<Au>,
}
/// Paints a radial gradient.
@ -763,6 +764,7 @@ pub struct RadialGradientDisplayItem {
///
/// Without tiles, the tile will be the same size as the background.
pub tile: Size2D<Au>,
pub tile_spacing: Size2D<Au>,
}
/// A normal border, supporting CSS border styles.