mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Set fallback type to eStyleSVGFallbackType_Color when a colour is encountered
This commit is contained in:
parent
caa66a880a
commit
8f5cb99b92
3 changed files with 30 additions and 2 deletions
|
@ -26200,7 +26200,7 @@ pub mod root {
|
||||||
"Alignment of field: " , stringify ! ( nsStyleColumn ) ,
|
"Alignment of field: " , stringify ! ( nsStyleColumn ) ,
|
||||||
"::" , stringify ! ( mTwipsPerPixel ) ));
|
"::" , stringify ! ( mTwipsPerPixel ) ));
|
||||||
}
|
}
|
||||||
#[repr(u32)]
|
#[repr(u8)]
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||||
pub enum nsStyleSVGPaintType {
|
pub enum nsStyleSVGPaintType {
|
||||||
eStyleSVGPaintType_None = 1,
|
eStyleSVGPaintType_None = 1,
|
||||||
|
@ -26209,11 +26209,19 @@ pub mod root {
|
||||||
eStyleSVGPaintType_ContextFill = 4,
|
eStyleSVGPaintType_ContextFill = 4,
|
||||||
eStyleSVGPaintType_ContextStroke = 5,
|
eStyleSVGPaintType_ContextStroke = 5,
|
||||||
}
|
}
|
||||||
|
#[repr(u8)]
|
||||||
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||||
|
pub enum nsStyleSVGFallbackType {
|
||||||
|
eStyleSVGFallbackType_NotSet = 0,
|
||||||
|
eStyleSVGFallbackType_None = 1,
|
||||||
|
eStyleSVGFallbackType_Color = 2,
|
||||||
|
}
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct nsStyleSVGPaint {
|
pub struct nsStyleSVGPaint {
|
||||||
pub mPaint: root::nsStyleSVGPaint__bindgen_ty_1,
|
pub mPaint: root::nsStyleSVGPaint__bindgen_ty_1,
|
||||||
pub mType: root::nsStyleSVGPaintType,
|
pub mType: root::nsStyleSVGPaintType,
|
||||||
|
pub mFallbackType: root::nsStyleSVGFallbackType,
|
||||||
pub mFallbackColor: root::nscolor,
|
pub mFallbackColor: root::nscolor,
|
||||||
}
|
}
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
|
@ -26266,6 +26274,11 @@ pub mod root {
|
||||||
const _ as usize } , 8usize , concat ! (
|
const _ as usize } , 8usize , concat ! (
|
||||||
"Alignment of field: " , stringify ! ( nsStyleSVGPaint ) ,
|
"Alignment of field: " , stringify ! ( nsStyleSVGPaint ) ,
|
||||||
"::" , stringify ! ( mType ) ));
|
"::" , stringify ! ( mType ) ));
|
||||||
|
assert_eq! (unsafe {
|
||||||
|
& ( * ( 0 as * const nsStyleSVGPaint ) ) . mFallbackType
|
||||||
|
as * const _ as usize } , 9usize , concat ! (
|
||||||
|
"Alignment of field: " , stringify ! ( nsStyleSVGPaint ) ,
|
||||||
|
"::" , stringify ! ( mFallbackType ) ));
|
||||||
assert_eq! (unsafe {
|
assert_eq! (unsafe {
|
||||||
& ( * ( 0 as * const nsStyleSVGPaint ) ) . mFallbackColor
|
& ( * ( 0 as * const nsStyleSVGPaint ) ) . mFallbackColor
|
||||||
as * const _ as usize } , 12usize , concat ! (
|
as * const _ as usize } , 12usize , concat ! (
|
||||||
|
|
|
@ -25541,7 +25541,7 @@ pub mod root {
|
||||||
"Alignment of field: " , stringify ! ( nsStyleColumn ) ,
|
"Alignment of field: " , stringify ! ( nsStyleColumn ) ,
|
||||||
"::" , stringify ! ( mTwipsPerPixel ) ));
|
"::" , stringify ! ( mTwipsPerPixel ) ));
|
||||||
}
|
}
|
||||||
#[repr(u32)]
|
#[repr(u8)]
|
||||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||||
pub enum nsStyleSVGPaintType {
|
pub enum nsStyleSVGPaintType {
|
||||||
eStyleSVGPaintType_None = 1,
|
eStyleSVGPaintType_None = 1,
|
||||||
|
@ -25550,11 +25550,19 @@ pub mod root {
|
||||||
eStyleSVGPaintType_ContextFill = 4,
|
eStyleSVGPaintType_ContextFill = 4,
|
||||||
eStyleSVGPaintType_ContextStroke = 5,
|
eStyleSVGPaintType_ContextStroke = 5,
|
||||||
}
|
}
|
||||||
|
#[repr(u8)]
|
||||||
|
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||||
|
pub enum nsStyleSVGFallbackType {
|
||||||
|
eStyleSVGFallbackType_NotSet = 0,
|
||||||
|
eStyleSVGFallbackType_None = 1,
|
||||||
|
eStyleSVGFallbackType_Color = 2,
|
||||||
|
}
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct nsStyleSVGPaint {
|
pub struct nsStyleSVGPaint {
|
||||||
pub mPaint: root::nsStyleSVGPaint__bindgen_ty_1,
|
pub mPaint: root::nsStyleSVGPaint__bindgen_ty_1,
|
||||||
pub mType: root::nsStyleSVGPaintType,
|
pub mType: root::nsStyleSVGPaintType,
|
||||||
|
pub mFallbackType: root::nsStyleSVGFallbackType,
|
||||||
pub mFallbackColor: root::nscolor,
|
pub mFallbackColor: root::nscolor,
|
||||||
}
|
}
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
|
@ -25607,6 +25615,11 @@ pub mod root {
|
||||||
const _ as usize } , 8usize , concat ! (
|
const _ as usize } , 8usize , concat ! (
|
||||||
"Alignment of field: " , stringify ! ( nsStyleSVGPaint ) ,
|
"Alignment of field: " , stringify ! ( nsStyleSVGPaint ) ,
|
||||||
"::" , stringify ! ( mType ) ));
|
"::" , stringify ! ( mType ) ));
|
||||||
|
assert_eq! (unsafe {
|
||||||
|
& ( * ( 0 as * const nsStyleSVGPaint ) ) . mFallbackType
|
||||||
|
as * const _ as usize } , 9usize , concat ! (
|
||||||
|
"Alignment of field: " , stringify ! ( nsStyleSVGPaint ) ,
|
||||||
|
"::" , stringify ! ( mFallbackType ) ));
|
||||||
assert_eq! (unsafe {
|
assert_eq! (unsafe {
|
||||||
& ( * ( 0 as * const nsStyleSVGPaint ) ) . mFallbackColor
|
& ( * ( 0 as * const nsStyleSVGPaint ) ) . mFallbackColor
|
||||||
as * const _ as usize } , 12usize , concat ! (
|
as * const _ as usize } , 12usize , concat ! (
|
||||||
|
|
|
@ -415,6 +415,7 @@ fn color_to_nscolor_zero_currentcolor(color: Color) -> structs::nscolor {
|
||||||
pub fn set_${ident}(&mut self, mut v: longhands::${ident}::computed_value::T) {
|
pub fn set_${ident}(&mut self, mut v: longhands::${ident}::computed_value::T) {
|
||||||
use values::computed::SVGPaintKind;
|
use values::computed::SVGPaintKind;
|
||||||
use self::structs::nsStyleSVGPaintType;
|
use self::structs::nsStyleSVGPaintType;
|
||||||
|
use self::structs::nsStyleSVGFallbackType;
|
||||||
|
|
||||||
let ref mut paint = ${get_gecko_property(gecko_ffi_name)};
|
let ref mut paint = ${get_gecko_property(gecko_ffi_name)};
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -443,6 +444,7 @@ fn color_to_nscolor_zero_currentcolor(color: Color) -> structs::nscolor {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(fallback) = fallback {
|
if let Some(fallback) = fallback {
|
||||||
|
paint.mFallbackType = nsStyleSVGFallbackType::eStyleSVGFallbackType_Color;
|
||||||
paint.mFallbackColor = color_to_nscolor_zero_currentcolor(fallback);
|
paint.mFallbackColor = color_to_nscolor_zero_currentcolor(fallback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue