mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Implement gecko glue for border-image-repeat
This commit is contained in:
parent
dc55e80752
commit
cbd43f7acc
2 changed files with 25 additions and 3 deletions
|
@ -640,7 +640,7 @@ fn static_assert() {
|
||||||
["border-{0}-radius".format(x.ident.replace("_", "-"))
|
["border-{0}-radius".format(x.ident.replace("_", "-"))
|
||||||
for x in CORNERS]) %>
|
for x in CORNERS]) %>
|
||||||
<%self:impl_trait style_struct_name="Border"
|
<%self:impl_trait style_struct_name="Border"
|
||||||
skip_longhands="${skip_border_longhands} border-image-source border-image-outset"
|
skip_longhands="${skip_border_longhands} border-image-source border-image-outset border-image-repeat"
|
||||||
skip_additionals="*">
|
skip_additionals="*">
|
||||||
|
|
||||||
% for side in SIDES:
|
% for side in SIDES:
|
||||||
|
@ -703,6 +703,28 @@ fn static_assert() {
|
||||||
.copy_from(&other.gecko.mBorderImageOutset.data_at(${side.index}));
|
.copy_from(&other.gecko.mBorderImageOutset.data_at(${side.index}));
|
||||||
% endfor
|
% endfor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn set_border_image_repeat(&mut self, v: longhands::border_image_repeat::computed_value::T) {
|
||||||
|
use properties::longhands::border_image_repeat::computed_value::RepeatKeyword;
|
||||||
|
use gecko_bindings::structs::{NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH, NS_STYLE_BORDER_IMAGE_REPEAT_REPEAT};
|
||||||
|
use gecko_bindings::structs::{NS_STYLE_BORDER_IMAGE_REPEAT_ROUND, NS_STYLE_BORDER_IMAGE_REPEAT_SPACE};
|
||||||
|
|
||||||
|
% for i, side in enumerate(["H", "V"]):
|
||||||
|
let k = match v.${i} {
|
||||||
|
RepeatKeyword::Stretch => NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH,
|
||||||
|
RepeatKeyword::Repeat => NS_STYLE_BORDER_IMAGE_REPEAT_REPEAT,
|
||||||
|
RepeatKeyword::Round => NS_STYLE_BORDER_IMAGE_REPEAT_ROUND,
|
||||||
|
RepeatKeyword::Space => NS_STYLE_BORDER_IMAGE_REPEAT_SPACE,
|
||||||
|
};
|
||||||
|
|
||||||
|
self.gecko.mBorderImageRepeat${side} = k as u8;
|
||||||
|
% endfor
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn copy_border_image_repeat_from(&mut self, other: &Self) {
|
||||||
|
self.gecko.mBorderImageRepeatH = other.gecko.mBorderImageRepeatH;
|
||||||
|
self.gecko.mBorderImageRepeatV = other.gecko.mBorderImageRepeatV;
|
||||||
|
}
|
||||||
</%self:impl_trait>
|
</%self:impl_trait>
|
||||||
|
|
||||||
<% skip_margin_longhands = " ".join(["margin-%s" % x.ident for x in SIDES]) %>
|
<% skip_margin_longhands = " ".join(["margin-%s" % x.ident for x in SIDES]) %>
|
||||||
|
|
|
@ -309,7 +309,7 @@ ${helpers.single_keyword("-moz-float-edge", "content-box margin-box",
|
||||||
</%helpers:longhand>
|
</%helpers:longhand>
|
||||||
|
|
||||||
// https://drafts.csswg.org/css-backgrounds-3/#border-image-repeat
|
// https://drafts.csswg.org/css-backgrounds-3/#border-image-repeat
|
||||||
<%helpers:longhand name="border-image-repeat" products="none" animatable="False">
|
<%helpers:longhand name="border-image-repeat" products="gecko" animatable="False">
|
||||||
use cssparser::ToCss;
|
use cssparser::ToCss;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use values::LocalToCss;
|
use values::LocalToCss;
|
||||||
|
@ -318,7 +318,7 @@ ${helpers.single_keyword("-moz-float-edge", "content-box margin-box",
|
||||||
impl NoViewportPercentage for SpecifiedValue {}
|
impl NoViewportPercentage for SpecifiedValue {}
|
||||||
|
|
||||||
pub mod computed_value {
|
pub mod computed_value {
|
||||||
use super::RepeatKeyword;
|
pub use super::RepeatKeyword;
|
||||||
use values::computed;
|
use values::computed;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue