mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +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;
|
||||
|
|
|
@ -81,7 +81,7 @@ ${helpers.single_keyword(
|
|||
${helpers.single_keyword(
|
||||
"background-origin",
|
||||
"padding-box border-box content-box",
|
||||
engines="gecko servo-2013",
|
||||
engines="gecko servo-2013 servo-2020",
|
||||
vector=True, extra_prefixes="webkit",
|
||||
gecko_enum_prefix="StyleGeometryBox",
|
||||
gecko_inexhaustive=True,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue