mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Auto merge of #11018 - bholley:list_style_type, r=mbrubeck
Geckolib: Implement list-style-type Corresponding Gecko patch: https://bugzilla.mozilla.org/show_bug.cgi?id=1269933 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11018) <!-- Reviewable:end -->
This commit is contained in:
commit
b29ae6383a
4 changed files with 28 additions and 7 deletions
|
@ -13,13 +13,17 @@ ${helpers.single_keyword("list-style-position", "outside inside")}
|
||||||
// decimal-leading-zero, armenian, upper-armenian, lower-armenian, georgian, lower-roman,
|
// decimal-leading-zero, armenian, upper-armenian, lower-armenian, georgian, lower-roman,
|
||||||
// upper-roman
|
// upper-roman
|
||||||
//
|
//
|
||||||
|
// TODO(bholley): Missing quite a few gecko properties here as well.
|
||||||
|
//
|
||||||
// [1]: http://dev.w3.org/csswg/css-counter-styles/
|
// [1]: http://dev.w3.org/csswg/css-counter-styles/
|
||||||
${helpers.single_keyword("list-style-type", """
|
${helpers.single_keyword("list-style-type", """
|
||||||
disc none circle square decimal arabic-indic bengali cambodian cjk-decimal devanagari
|
disc none circle square decimal lower-alpha upper-alpha disclosure-open disclosure-closed
|
||||||
gujarati gurmukhi kannada khmer lao malayalam mongolian myanmar oriya persian telugu thai
|
""", extra_servo_values="""arabic-indic bengali cambodian cjk-decimal devanagari
|
||||||
tibetan lower-alpha upper-alpha cjk-earthly-branch cjk-heavenly-stem lower-greek hiragana
|
gujarati gurmukhi kannada khmer lao malayalam mongolian
|
||||||
hiragana-iroha katakana katakana-iroha disclosure-open disclosure-closed
|
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">
|
<%helpers:longhand name="list-style-image">
|
||||||
use cssparser::{ToCss, Token};
|
use cssparser::{ToCss, Token};
|
||||||
|
|
|
@ -69,6 +69,9 @@ extern "C" {
|
||||||
pub fn Gecko_SetNodeData(node: *mut RawGeckoNode,
|
pub fn Gecko_SetNodeData(node: *mut RawGeckoNode,
|
||||||
data: *mut ServoNodeData);
|
data: *mut ServoNodeData);
|
||||||
pub fn Servo_DropNodeData(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,
|
pub fn Servo_StylesheetFromUTF8Bytes(bytes: *const u8, length: u32,
|
||||||
parsing_mode: SheetParsingMode)
|
parsing_mode: SheetParsingMode)
|
||||||
-> *mut RawServoStyleSheet;
|
-> *mut RawServoStyleSheet;
|
||||||
|
|
|
@ -4716,7 +4716,6 @@ fn bindgen_test_layout_nsStyleQuoteValues() {
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
pub struct nsStyleList {
|
pub struct nsStyleList {
|
||||||
pub mListStylePosition: u8,
|
pub mListStylePosition: u8,
|
||||||
pub mListStyleType: nsString,
|
|
||||||
pub mCounterStyle: RefPtr<CounterStyle>,
|
pub mCounterStyle: RefPtr<CounterStyle>,
|
||||||
pub mListStyleImage: RefPtr<imgRequestProxy>,
|
pub mListStyleImage: RefPtr<imgRequestProxy>,
|
||||||
pub mQuotes: RefPtr<nsStyleQuoteValues>,
|
pub mQuotes: RefPtr<nsStyleQuoteValues>,
|
||||||
|
@ -4724,7 +4723,7 @@ pub struct nsStyleList {
|
||||||
}
|
}
|
||||||
#[test]
|
#[test]
|
||||||
fn bindgen_test_layout_nsStyleList() {
|
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);
|
assert_eq!(::std::mem::align_of::<nsStyleList>() , 8usize);
|
||||||
}
|
}
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
|
|
|
@ -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_CopyConstruct_${style_struct.gecko_ffi_name};
|
||||||
use bindings::Gecko_Destroy_${style_struct.gecko_ffi_name};
|
use bindings::Gecko_Destroy_${style_struct.gecko_ffi_name};
|
||||||
% endfor
|
% endfor
|
||||||
|
use bindings::{Gecko_CopyListStyleTypeFrom, Gecko_SetListStyleType};
|
||||||
use gecko_style_structs;
|
use gecko_style_structs;
|
||||||
use glue::ArcHelpers;
|
use glue::ArcHelpers;
|
||||||
use heapsize::HeapSizeOf;
|
use heapsize::HeapSizeOf;
|
||||||
|
@ -153,6 +154,8 @@ def set_gecko_property(ffi_name, expr):
|
||||||
if is_border_style_masked(ffi_name):
|
if is_border_style_masked(ffi_name):
|
||||||
return "self.gecko.%s &= !(gecko_style_structs::BORDER_STYLE_MASK as u8);" % 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)
|
"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)
|
return "self.gecko.%s = %s;" % (ffi_name, expr)
|
||||||
%>
|
%>
|
||||||
|
|
||||||
|
@ -588,6 +591,18 @@ fn static_assert() {
|
||||||
|
|
||||||
</%self:impl_trait>
|
</%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"
|
<%self:impl_trait style_struct_name="Text"
|
||||||
skip_longhands="text-decoration-color"
|
skip_longhands="text-decoration-color"
|
||||||
skip_additionals="*">
|
skip_additionals="*">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue