aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-04-30 20:26:54 -0500
committerGitHub <noreply@github.com>2017-04-30 20:26:54 -0500
commitc71d97ae5e47d71b2d503ce6446a7bf527a005bd (patch)
tree83354bec3ca22f418b86c03df2e927fa80a69b7c
parent38bbacda7016843c8eefb150bc058845a192e3bf (diff)
parent8f5cb99b92bfdb835a8785ed3544ff2f9c9eedd7 (diff)
downloadservo-c71d97ae5e47d71b2d503ce6446a7bf527a005bd.tar.gz
servo-c71d97ae5e47d71b2d503ce6446a7bf527a005bd.zip
Auto merge of #16665 - longsonr:1347409, r=heycam,emilio
Servo changes for bug 1347409 bug 1347409 is introducing a fallback type for SVG paint servers so that we can distinguish between url(something) and url(something) none and serialise those cases correctly. When we get a url(something) color we need to set the mFallbackType to eStyleSVGFallbackType_Color. This change has already been reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1347409 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because they are covered by tests that will land in gecko as part of the rest of the patch there. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16665) <!-- Reviewable:end -->
-rw-r--r--components/style/gecko_bindings/structs_debug.rs15
-rw-r--r--components/style/gecko_bindings/structs_release.rs15
-rw-r--r--components/style/properties/gecko.mako.rs2
3 files changed, 30 insertions, 2 deletions
diff --git a/components/style/gecko_bindings/structs_debug.rs b/components/style/gecko_bindings/structs_debug.rs
index 55af2852e31..24bea2dd6be 100644
--- a/components/style/gecko_bindings/structs_debug.rs
+++ b/components/style/gecko_bindings/structs_debug.rs
@@ -26200,7 +26200,7 @@ pub mod root {
"Alignment of field: " , stringify ! ( nsStyleColumn ) ,
"::" , stringify ! ( mTwipsPerPixel ) ));
}
- #[repr(u32)]
+ #[repr(u8)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum nsStyleSVGPaintType {
eStyleSVGPaintType_None = 1,
@@ -26209,11 +26209,19 @@ pub mod root {
eStyleSVGPaintType_ContextFill = 4,
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)]
#[derive(Debug)]
pub struct nsStyleSVGPaint {
pub mPaint: root::nsStyleSVGPaint__bindgen_ty_1,
pub mType: root::nsStyleSVGPaintType,
+ pub mFallbackType: root::nsStyleSVGFallbackType,
pub mFallbackColor: root::nscolor,
}
#[repr(C)]
@@ -26267,6 +26275,11 @@ pub mod root {
"Alignment of field: " , stringify ! ( nsStyleSVGPaint ) ,
"::" , 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 {
& ( * ( 0 as * const nsStyleSVGPaint ) ) . mFallbackColor
as * const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( nsStyleSVGPaint ) ,
diff --git a/components/style/gecko_bindings/structs_release.rs b/components/style/gecko_bindings/structs_release.rs
index fecff4e1c10..ffd6c8f2139 100644
--- a/components/style/gecko_bindings/structs_release.rs
+++ b/components/style/gecko_bindings/structs_release.rs
@@ -25541,7 +25541,7 @@ pub mod root {
"Alignment of field: " , stringify ! ( nsStyleColumn ) ,
"::" , stringify ! ( mTwipsPerPixel ) ));
}
- #[repr(u32)]
+ #[repr(u8)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum nsStyleSVGPaintType {
eStyleSVGPaintType_None = 1,
@@ -25550,11 +25550,19 @@ pub mod root {
eStyleSVGPaintType_ContextFill = 4,
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)]
#[derive(Debug)]
pub struct nsStyleSVGPaint {
pub mPaint: root::nsStyleSVGPaint__bindgen_ty_1,
pub mType: root::nsStyleSVGPaintType,
+ pub mFallbackType: root::nsStyleSVGFallbackType,
pub mFallbackColor: root::nscolor,
}
#[repr(C)]
@@ -25608,6 +25616,11 @@ pub mod root {
"Alignment of field: " , stringify ! ( nsStyleSVGPaint ) ,
"::" , 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 {
& ( * ( 0 as * const nsStyleSVGPaint ) ) . mFallbackColor
as * const _ as usize } , 12usize , concat ! (
"Alignment of field: " , stringify ! ( nsStyleSVGPaint ) ,
diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs
index 85a1e21bb85..273dff61344 100644
--- a/components/style/properties/gecko.mako.rs
+++ b/components/style/properties/gecko.mako.rs
@@ -395,6 +395,7 @@ fn color_to_nscolor_zero_currentcolor(color: Color) -> structs::nscolor {
pub fn set_${ident}(&mut self, mut v: longhands::${ident}::computed_value::T) {
use values::computed::SVGPaintKind;
use self::structs::nsStyleSVGPaintType;
+ use self::structs::nsStyleSVGFallbackType;
let ref mut paint = ${get_gecko_property(gecko_ffi_name)};
unsafe {
@@ -423,6 +424,7 @@ fn color_to_nscolor_zero_currentcolor(color: Color) -> structs::nscolor {
}
if let Some(fallback) = fallback {
+ paint.mFallbackType = nsStyleSVGFallbackType::eStyleSVGFallbackType_Color;
paint.mFallbackColor = color_to_nscolor_zero_currentcolor(fallback);
}
}