mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Add background-origin
This commit is contained in:
parent
3874946ac6
commit
649d3cb6b4
2 changed files with 7 additions and 3 deletions
|
@ -309,6 +309,7 @@ impl<'a> BuilderForBoxFragment<'a> {
|
|||
// * Its top-left is the top-left of the top-left-most tile that intersects with `clip_rect`
|
||||
|
||||
use style::computed_values::background_clip::single_value::T as Clip;
|
||||
use style::computed_values::background_origin::single_value::T as Origin;
|
||||
|
||||
fn get_cyclic<T>(values: &[T], index: usize) -> &T {
|
||||
&values[index % values.len()]
|
||||
|
@ -321,8 +322,11 @@ impl<'a> BuilderForBoxFragment<'a> {
|
|||
Clip::PaddingBox => self.padding_rect(),
|
||||
Clip::BorderBox => &self.border_rect,
|
||||
};
|
||||
// FIXME: background-origin
|
||||
let positioning_area = self.padding_rect();
|
||||
let positioning_area = match get_cyclic(&b.background_origin.0, index) {
|
||||
Origin::ContentBox => self.content_rect(),
|
||||
Origin::PaddingBox => self.padding_rect(),
|
||||
Origin::BorderBox => &self.border_rect,
|
||||
};
|
||||
|
||||
// FIXME: https://drafts.csswg.org/css-images-4/#the-image-resolution
|
||||
let dppx = 1.0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue