mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
stylo: Support URL clip-paths
MozReview-Commit-ID: 4QKKzJ1DVYP
This commit is contained in:
parent
2942e3b2ea
commit
c1d7941791
2 changed files with 9 additions and 29 deletions
|
@ -704,6 +704,10 @@ extern "C" {
|
||||||
pub fn Gecko_NewBasicShape(type_: StyleBasicShapeType)
|
pub fn Gecko_NewBasicShape(type_: StyleBasicShapeType)
|
||||||
-> *mut StyleBasicShape;
|
-> *mut StyleBasicShape;
|
||||||
}
|
}
|
||||||
|
extern "C" {
|
||||||
|
pub fn Gecko_StyleClipPath_SetURLValue(clip: *mut StyleClipPath,
|
||||||
|
uri: ServoBundledURI);
|
||||||
|
}
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn Gecko_ResetFilters(effects: *mut nsStyleEffects, new_len: usize);
|
pub fn Gecko_ResetFilters(effects: *mut nsStyleEffects, new_len: usize);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2624,7 +2624,11 @@ clip-path
|
||||||
clip_path.mType = StyleShapeSourceType::None;
|
clip_path.mType = StyleShapeSourceType::None;
|
||||||
|
|
||||||
match v {
|
match v {
|
||||||
ShapeSource::Url(..) => warn!("stylo: clip-path: url() not yet implemented"),
|
ShapeSource::Url(ref url) => {
|
||||||
|
unsafe {
|
||||||
|
bindings::Gecko_StyleClipPath_SetURLValue(clip_path, url.for_ffi());
|
||||||
|
}
|
||||||
|
}
|
||||||
ShapeSource::None => {} // don't change the type
|
ShapeSource::None => {} // don't change the type
|
||||||
ShapeSource::Box(reference) => {
|
ShapeSource::Box(reference) => {
|
||||||
clip_path.mReferenceBox = reference.into();
|
clip_path.mReferenceBox = reference.into();
|
||||||
|
@ -2714,34 +2718,6 @@ clip-path
|
||||||
Gecko_CopyClipPathValueFrom(&mut self.gecko.mClipPath, &other.gecko.mClipPath);
|
Gecko_CopyClipPathValueFrom(&mut self.gecko.mClipPath, &other.gecko.mClipPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn clone_clip_path(&self) -> longhands::clip_path::computed_value::T {
|
|
||||||
use gecko_bindings::structs::StyleShapeSourceType;
|
|
||||||
use gecko_bindings::structs::StyleGeometryBox;
|
|
||||||
use values::computed::basic_shape::*;
|
|
||||||
let ref clip_path = self.gecko.mClipPath;
|
|
||||||
|
|
||||||
match clip_path.mType {
|
|
||||||
StyleShapeSourceType::None => ShapeSource::None,
|
|
||||||
StyleShapeSourceType::Box => {
|
|
||||||
ShapeSource::Box(clip_path.mReferenceBox.into())
|
|
||||||
}
|
|
||||||
StyleShapeSourceType::URL => {
|
|
||||||
warn!("stylo: clip-path: url() not implemented yet");
|
|
||||||
Default::default()
|
|
||||||
}
|
|
||||||
StyleShapeSourceType::Shape => {
|
|
||||||
let reference = if let StyleGeometryBox::NoBox = clip_path.mReferenceBox {
|
|
||||||
None
|
|
||||||
} else {
|
|
||||||
Some(clip_path.mReferenceBox.into())
|
|
||||||
};
|
|
||||||
let union = clip_path.__bindgen_anon_1;
|
|
||||||
let shape = unsafe { &**union.mBasicShape.as_ref() };
|
|
||||||
ShapeSource::Shape(shape.into(), reference)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</%self:impl_trait>
|
</%self:impl_trait>
|
||||||
|
|
||||||
<%self:impl_trait style_struct_name="Color"
|
<%self:impl_trait style_struct_name="Color"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue