diff options
-rw-r--r-- | components/style/properties/longhand/list.mako.rs | 14 | ||||
-rw-r--r-- | ports/geckolib/bindings.rs | 3 | ||||
-rw-r--r-- | ports/geckolib/gecko_style_structs.rs | 3 | ||||
-rw-r--r-- | ports/geckolib/properties.mako.rs | 15 |
4 files changed, 28 insertions, 7 deletions
diff --git a/components/style/properties/longhand/list.mako.rs b/components/style/properties/longhand/list.mako.rs index 98edb3ab23b..309e248c2dd 100644 --- a/components/style/properties/longhand/list.mako.rs +++ b/components/style/properties/longhand/list.mako.rs @@ -13,13 +13,17 @@ ${helpers.single_keyword("list-style-position", "outside inside")} // decimal-leading-zero, armenian, upper-armenian, lower-armenian, georgian, lower-roman, // upper-roman // +// TODO(bholley): Missing quite a few gecko properties here as well. +// // [1]: http://dev.w3.org/csswg/css-counter-styles/ ${helpers.single_keyword("list-style-type", """ - disc none circle square decimal arabic-indic bengali cambodian cjk-decimal devanagari - gujarati gurmukhi kannada khmer lao malayalam mongolian myanmar oriya persian telugu thai - tibetan lower-alpha upper-alpha cjk-earthly-branch cjk-heavenly-stem lower-greek hiragana - hiragana-iroha katakana katakana-iroha disclosure-open disclosure-closed -""")} + disc none circle square decimal lower-alpha upper-alpha disclosure-open disclosure-closed +""", extra_servo_values="""arabic-indic bengali cambodian cjk-decimal devanagari + gujarati gurmukhi kannada khmer lao malayalam mongolian + myanmar oriya persian telugu thai tibetan cjk-earthly-branch + cjk-heavenly-stem lower-greek hiragana hiragana-iroha katakana + katakana-iroha""", + gecko_constant_prefix="NS_STYLE_LIST_STYLE")} <%helpers:longhand name="list-style-image"> use cssparser::{ToCss, Token}; diff --git a/ports/geckolib/bindings.rs b/ports/geckolib/bindings.rs index 62fe80deab1..618c049bafc 100644 --- a/ports/geckolib/bindings.rs +++ b/ports/geckolib/bindings.rs @@ -69,6 +69,9 @@ extern "C" { pub fn Gecko_SetNodeData(node: *mut RawGeckoNode, data: *mut ServoNodeData); pub fn Servo_DropNodeData(data: *mut ServoNodeData); + pub fn Gecko_SetListStyleType(style_struct: *mut nsStyleList, type_: u32); + pub fn Gecko_CopyListStyleTypeFrom(dst: *mut nsStyleList, + src: *const nsStyleList); pub fn Servo_StylesheetFromUTF8Bytes(bytes: *const u8, length: u32, parsing_mode: SheetParsingMode) -> *mut RawServoStyleSheet; diff --git a/ports/geckolib/gecko_style_structs.rs b/ports/geckolib/gecko_style_structs.rs index c469ade7284..852470e7678 100644 --- a/ports/geckolib/gecko_style_structs.rs +++ b/ports/geckolib/gecko_style_structs.rs @@ -4716,7 +4716,6 @@ fn bindgen_test_layout_nsStyleQuoteValues() { #[repr(C)] pub struct nsStyleList { pub mListStylePosition: u8, - pub mListStyleType: nsString, pub mCounterStyle: RefPtr<CounterStyle>, pub mListStyleImage: RefPtr<imgRequestProxy>, pub mQuotes: RefPtr<nsStyleQuoteValues>, @@ -4724,7 +4723,7 @@ pub struct nsStyleList { } #[test] fn bindgen_test_layout_nsStyleList() { - assert_eq!(::std::mem::size_of::<nsStyleList>() , 64usize); + assert_eq!(::std::mem::size_of::<nsStyleList>() , 48usize); assert_eq!(::std::mem::align_of::<nsStyleList>() , 8usize); } #[repr(C)] diff --git a/ports/geckolib/properties.mako.rs b/ports/geckolib/properties.mako.rs index 56e9800ca58..24c111b114b 100644 --- a/ports/geckolib/properties.mako.rs +++ b/ports/geckolib/properties.mako.rs @@ -16,6 +16,7 @@ use bindings::Gecko_Construct_${style_struct.gecko_ffi_name}; use bindings::Gecko_CopyConstruct_${style_struct.gecko_ffi_name}; use bindings::Gecko_Destroy_${style_struct.gecko_ffi_name}; % endfor +use bindings::{Gecko_CopyListStyleTypeFrom, Gecko_SetListStyleType}; use gecko_style_structs; use glue::ArcHelpers; use heapsize::HeapSizeOf; @@ -153,6 +154,8 @@ def set_gecko_property(ffi_name, expr): if is_border_style_masked(ffi_name): return "self.gecko.%s &= !(gecko_style_structs::BORDER_STYLE_MASK as u8);" % ffi_name + \ "self.gecko.%s |= %s as u8;" % (ffi_name, expr) + elif ffi_name == "__LIST_STYLE_TYPE__": + return "unsafe { Gecko_SetListStyleType(&mut self.gecko, %s as u32); }" % expr return "self.gecko.%s = %s;" % (ffi_name, expr) %> @@ -588,6 +591,18 @@ fn static_assert() { </%self:impl_trait> +<%self:impl_trait style_struct_name="List" skip_longhands="list-style-type" skip_additionals="*"> + + <% impl_keyword_setter("list_style_type", "__LIST_STYLE_TYPE__", + data.longhands_by_name["list-style-type"].keyword) %> + fn copy_list_style_type_from(&mut self, other: &Self) { + unsafe { + Gecko_CopyListStyleTypeFrom(&mut self.gecko, &other.gecko); + } + } + +</%self:impl_trait> + <%self:impl_trait style_struct_name="Text" skip_longhands="text-decoration-color" skip_additionals="*"> |