Auto merge of #18304 - upsuper:counter-style-clone, r=heycam

Rewrite CounterStyleOrNone::from_gecko_value to use fewer binding functions

This is the Servo side change of [bug 1393189](https://bugzilla.mozilla.org/show_bug.cgi?id=1393189).

<!-- 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/18304)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-08-29 23:18:06 -05:00 committed by GitHub
commit 88e7906191
6 changed files with 1442 additions and 1329 deletions

View file

@ -654,6 +654,10 @@ cfg_if! {
pub static nsGkAtoms_disablehistory: *mut nsIAtom; pub static nsGkAtoms_disablehistory: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms17disablefullscreenE"] #[link_name = "_ZN9nsGkAtoms17disablefullscreenE"]
pub static nsGkAtoms_disablefullscreen: *mut nsIAtom; pub static nsGkAtoms_disablefullscreen: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms17disclosure_closedE"]
pub static nsGkAtoms_disclosure_closed: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms15disclosure_openE"]
pub static nsGkAtoms_disclosure_open: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms7displayE"] #[link_name = "_ZN9nsGkAtoms7displayE"]
pub static nsGkAtoms_display: *mut nsIAtom; pub static nsGkAtoms_display: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms11displayModeE"] #[link_name = "_ZN9nsGkAtoms11displayModeE"]
@ -842,6 +846,8 @@ cfg_if! {
pub static nsGkAtoms_equalsize: *mut nsIAtom; pub static nsGkAtoms_equalsize: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms5errorE"] #[link_name = "_ZN9nsGkAtoms5errorE"]
pub static nsGkAtoms_error: *mut nsIAtom; pub static nsGkAtoms_error: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms16ethiopic_numericE"]
pub static nsGkAtoms_ethiopic_numeric: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms4evenE"] #[link_name = "_ZN9nsGkAtoms4evenE"]
pub static nsGkAtoms_even: *mut nsIAtom; pub static nsGkAtoms_even: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms5eventE"] #[link_name = "_ZN9nsGkAtoms5eventE"]
@ -1004,6 +1010,8 @@ cfg_if! {
pub static nsGkAtoms_header: *mut nsIAtom; pub static nsGkAtoms_header: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms7headersE"] #[link_name = "_ZN9nsGkAtoms7headersE"]
pub static nsGkAtoms_headers: *mut nsIAtom; pub static nsGkAtoms_headers: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms6hebrewE"]
pub static nsGkAtoms_hebrew: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms6heightE"] #[link_name = "_ZN9nsGkAtoms6heightE"]
pub static nsGkAtoms_height: *mut nsIAtom; pub static nsGkAtoms_height: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms6hgroupE"] #[link_name = "_ZN9nsGkAtoms6hgroupE"]
@ -1132,6 +1140,10 @@ cfg_if! {
pub static nsGkAtoms_itemscope: *mut nsIAtom; pub static nsGkAtoms_itemscope: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms8itemtypeE"] #[link_name = "_ZN9nsGkAtoms8itemtypeE"]
pub static nsGkAtoms_itemtype: *mut nsIAtom; pub static nsGkAtoms_itemtype: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms15japanese_formalE"]
pub static nsGkAtoms_japanese_formal: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms17japanese_informalE"]
pub static nsGkAtoms_japanese_informal: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms3kbdE"] #[link_name = "_ZN9nsGkAtoms3kbdE"]
pub static nsGkAtoms_kbd: *mut nsIAtom; pub static nsGkAtoms_kbd: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms17keepcurrentinviewE"] #[link_name = "_ZN9nsGkAtoms17keepcurrentinviewE"]
@ -1160,6 +1172,12 @@ cfg_if! {
pub static nsGkAtoms_keyup: *mut nsIAtom; pub static nsGkAtoms_keyup: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms4kindE"] #[link_name = "_ZN9nsGkAtoms4kindE"]
pub static nsGkAtoms_kind: *mut nsIAtom; pub static nsGkAtoms_kind: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms20korean_hangul_formalE"]
pub static nsGkAtoms_korean_hangul_formal: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms19korean_hanja_formalE"]
pub static nsGkAtoms_korean_hanja_formal: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms21korean_hanja_informalE"]
pub static nsGkAtoms_korean_hanja_informal: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms5labelE"] #[link_name = "_ZN9nsGkAtoms5labelE"]
pub static nsGkAtoms_label: *mut nsIAtom; pub static nsGkAtoms_label: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms6labelsE"] #[link_name = "_ZN9nsGkAtoms6labelsE"]
@ -2420,6 +2438,10 @@ cfg_if! {
pub static nsGkAtoms_showresizer: *mut nsIAtom; pub static nsGkAtoms_showresizer: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms6simpleE"] #[link_name = "_ZN9nsGkAtoms6simpleE"]
pub static nsGkAtoms_simple: *mut nsIAtom; pub static nsGkAtoms_simple: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms19simp_chinese_formalE"]
pub static nsGkAtoms_simp_chinese_formal: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms21simp_chinese_informalE"]
pub static nsGkAtoms_simp_chinese_informal: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms6singleE"] #[link_name = "_ZN9nsGkAtoms6singleE"]
pub static nsGkAtoms_single: *mut nsIAtom; pub static nsGkAtoms_single: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms4sizeE"] #[link_name = "_ZN9nsGkAtoms4sizeE"]
@ -2648,6 +2670,10 @@ cfg_if! {
pub static nsGkAtoms_tr: *mut nsIAtom; pub static nsGkAtoms_tr: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms5trackE"] #[link_name = "_ZN9nsGkAtoms5trackE"]
pub static nsGkAtoms_track: *mut nsIAtom; pub static nsGkAtoms_track: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms19trad_chinese_formalE"]
pub static nsGkAtoms_trad_chinese_formal: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms21trad_chinese_informalE"]
pub static nsGkAtoms_trad_chinese_informal: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms8trailingE"] #[link_name = "_ZN9nsGkAtoms8trailingE"]
pub static nsGkAtoms_trailing: *mut nsIAtom; pub static nsGkAtoms_trailing: *mut nsIAtom;
#[link_name = "_ZN9nsGkAtoms9transformE"] #[link_name = "_ZN9nsGkAtoms9transformE"]
@ -5781,6 +5807,10 @@ cfg_if! {
pub static nsGkAtoms_disablehistory: *mut nsIAtom; pub static nsGkAtoms_disablehistory: *mut nsIAtom;
#[link_name = "?disablefullscreen@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?disablefullscreen@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_disablefullscreen: *mut nsIAtom; pub static nsGkAtoms_disablefullscreen: *mut nsIAtom;
#[link_name = "?disclosure_closed@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_disclosure_closed: *mut nsIAtom;
#[link_name = "?disclosure_open@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_disclosure_open: *mut nsIAtom;
#[link_name = "?display@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?display@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_display: *mut nsIAtom; pub static nsGkAtoms_display: *mut nsIAtom;
#[link_name = "?displayMode@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?displayMode@nsGkAtoms@@2PEAVnsIAtom@@EA"]
@ -5969,6 +5999,8 @@ cfg_if! {
pub static nsGkAtoms_equalsize: *mut nsIAtom; pub static nsGkAtoms_equalsize: *mut nsIAtom;
#[link_name = "?error@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?error@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_error: *mut nsIAtom; pub static nsGkAtoms_error: *mut nsIAtom;
#[link_name = "?ethiopic_numeric@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_ethiopic_numeric: *mut nsIAtom;
#[link_name = "?even@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?even@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_even: *mut nsIAtom; pub static nsGkAtoms_even: *mut nsIAtom;
#[link_name = "?event@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?event@nsGkAtoms@@2PEAVnsIAtom@@EA"]
@ -6131,6 +6163,8 @@ cfg_if! {
pub static nsGkAtoms_header: *mut nsIAtom; pub static nsGkAtoms_header: *mut nsIAtom;
#[link_name = "?headers@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?headers@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_headers: *mut nsIAtom; pub static nsGkAtoms_headers: *mut nsIAtom;
#[link_name = "?hebrew@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_hebrew: *mut nsIAtom;
#[link_name = "?height@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?height@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_height: *mut nsIAtom; pub static nsGkAtoms_height: *mut nsIAtom;
#[link_name = "?hgroup@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?hgroup@nsGkAtoms@@2PEAVnsIAtom@@EA"]
@ -6259,6 +6293,10 @@ cfg_if! {
pub static nsGkAtoms_itemscope: *mut nsIAtom; pub static nsGkAtoms_itemscope: *mut nsIAtom;
#[link_name = "?itemtype@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?itemtype@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_itemtype: *mut nsIAtom; pub static nsGkAtoms_itemtype: *mut nsIAtom;
#[link_name = "?japanese_formal@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_japanese_formal: *mut nsIAtom;
#[link_name = "?japanese_informal@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_japanese_informal: *mut nsIAtom;
#[link_name = "?kbd@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?kbd@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_kbd: *mut nsIAtom; pub static nsGkAtoms_kbd: *mut nsIAtom;
#[link_name = "?keepcurrentinview@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?keepcurrentinview@nsGkAtoms@@2PEAVnsIAtom@@EA"]
@ -6287,6 +6325,12 @@ cfg_if! {
pub static nsGkAtoms_keyup: *mut nsIAtom; pub static nsGkAtoms_keyup: *mut nsIAtom;
#[link_name = "?kind@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?kind@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_kind: *mut nsIAtom; pub static nsGkAtoms_kind: *mut nsIAtom;
#[link_name = "?korean_hangul_formal@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_korean_hangul_formal: *mut nsIAtom;
#[link_name = "?korean_hanja_formal@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_korean_hanja_formal: *mut nsIAtom;
#[link_name = "?korean_hanja_informal@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_korean_hanja_informal: *mut nsIAtom;
#[link_name = "?label@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?label@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_label: *mut nsIAtom; pub static nsGkAtoms_label: *mut nsIAtom;
#[link_name = "?labels@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?labels@nsGkAtoms@@2PEAVnsIAtom@@EA"]
@ -7547,6 +7591,10 @@ cfg_if! {
pub static nsGkAtoms_showresizer: *mut nsIAtom; pub static nsGkAtoms_showresizer: *mut nsIAtom;
#[link_name = "?simple@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?simple@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_simple: *mut nsIAtom; pub static nsGkAtoms_simple: *mut nsIAtom;
#[link_name = "?simp_chinese_formal@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_simp_chinese_formal: *mut nsIAtom;
#[link_name = "?simp_chinese_informal@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_simp_chinese_informal: *mut nsIAtom;
#[link_name = "?single@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?single@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_single: *mut nsIAtom; pub static nsGkAtoms_single: *mut nsIAtom;
#[link_name = "?size@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?size@nsGkAtoms@@2PEAVnsIAtom@@EA"]
@ -7775,6 +7823,10 @@ cfg_if! {
pub static nsGkAtoms_tr: *mut nsIAtom; pub static nsGkAtoms_tr: *mut nsIAtom;
#[link_name = "?track@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?track@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_track: *mut nsIAtom; pub static nsGkAtoms_track: *mut nsIAtom;
#[link_name = "?trad_chinese_formal@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_trad_chinese_formal: *mut nsIAtom;
#[link_name = "?trad_chinese_informal@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_trad_chinese_informal: *mut nsIAtom;
#[link_name = "?trailing@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?trailing@nsGkAtoms@@2PEAVnsIAtom@@EA"]
pub static nsGkAtoms_trailing: *mut nsIAtom; pub static nsGkAtoms_trailing: *mut nsIAtom;
#[link_name = "?transform@nsGkAtoms@@2PEAVnsIAtom@@EA"] #[link_name = "?transform@nsGkAtoms@@2PEAVnsIAtom@@EA"]
@ -10908,6 +10960,10 @@ cfg_if! {
pub static nsGkAtoms_disablehistory: *mut nsIAtom; pub static nsGkAtoms_disablehistory: *mut nsIAtom;
#[link_name = "\x01?disablefullscreen@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?disablefullscreen@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_disablefullscreen: *mut nsIAtom; pub static nsGkAtoms_disablefullscreen: *mut nsIAtom;
#[link_name = "\x01?disclosure_closed@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_disclosure_closed: *mut nsIAtom;
#[link_name = "\x01?disclosure_open@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_disclosure_open: *mut nsIAtom;
#[link_name = "\x01?display@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?display@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_display: *mut nsIAtom; pub static nsGkAtoms_display: *mut nsIAtom;
#[link_name = "\x01?displayMode@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?displayMode@nsGkAtoms@@2PAVnsIAtom@@A"]
@ -11096,6 +11152,8 @@ cfg_if! {
pub static nsGkAtoms_equalsize: *mut nsIAtom; pub static nsGkAtoms_equalsize: *mut nsIAtom;
#[link_name = "\x01?error@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?error@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_error: *mut nsIAtom; pub static nsGkAtoms_error: *mut nsIAtom;
#[link_name = "\x01?ethiopic_numeric@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_ethiopic_numeric: *mut nsIAtom;
#[link_name = "\x01?even@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?even@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_even: *mut nsIAtom; pub static nsGkAtoms_even: *mut nsIAtom;
#[link_name = "\x01?event@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?event@nsGkAtoms@@2PAVnsIAtom@@A"]
@ -11258,6 +11316,8 @@ cfg_if! {
pub static nsGkAtoms_header: *mut nsIAtom; pub static nsGkAtoms_header: *mut nsIAtom;
#[link_name = "\x01?headers@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?headers@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_headers: *mut nsIAtom; pub static nsGkAtoms_headers: *mut nsIAtom;
#[link_name = "\x01?hebrew@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_hebrew: *mut nsIAtom;
#[link_name = "\x01?height@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?height@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_height: *mut nsIAtom; pub static nsGkAtoms_height: *mut nsIAtom;
#[link_name = "\x01?hgroup@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?hgroup@nsGkAtoms@@2PAVnsIAtom@@A"]
@ -11386,6 +11446,10 @@ cfg_if! {
pub static nsGkAtoms_itemscope: *mut nsIAtom; pub static nsGkAtoms_itemscope: *mut nsIAtom;
#[link_name = "\x01?itemtype@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?itemtype@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_itemtype: *mut nsIAtom; pub static nsGkAtoms_itemtype: *mut nsIAtom;
#[link_name = "\x01?japanese_formal@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_japanese_formal: *mut nsIAtom;
#[link_name = "\x01?japanese_informal@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_japanese_informal: *mut nsIAtom;
#[link_name = "\x01?kbd@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?kbd@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_kbd: *mut nsIAtom; pub static nsGkAtoms_kbd: *mut nsIAtom;
#[link_name = "\x01?keepcurrentinview@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?keepcurrentinview@nsGkAtoms@@2PAVnsIAtom@@A"]
@ -11414,6 +11478,12 @@ cfg_if! {
pub static nsGkAtoms_keyup: *mut nsIAtom; pub static nsGkAtoms_keyup: *mut nsIAtom;
#[link_name = "\x01?kind@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?kind@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_kind: *mut nsIAtom; pub static nsGkAtoms_kind: *mut nsIAtom;
#[link_name = "\x01?korean_hangul_formal@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_korean_hangul_formal: *mut nsIAtom;
#[link_name = "\x01?korean_hanja_formal@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_korean_hanja_formal: *mut nsIAtom;
#[link_name = "\x01?korean_hanja_informal@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_korean_hanja_informal: *mut nsIAtom;
#[link_name = "\x01?label@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?label@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_label: *mut nsIAtom; pub static nsGkAtoms_label: *mut nsIAtom;
#[link_name = "\x01?labels@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?labels@nsGkAtoms@@2PAVnsIAtom@@A"]
@ -12674,6 +12744,10 @@ cfg_if! {
pub static nsGkAtoms_showresizer: *mut nsIAtom; pub static nsGkAtoms_showresizer: *mut nsIAtom;
#[link_name = "\x01?simple@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?simple@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_simple: *mut nsIAtom; pub static nsGkAtoms_simple: *mut nsIAtom;
#[link_name = "\x01?simp_chinese_formal@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_simp_chinese_formal: *mut nsIAtom;
#[link_name = "\x01?simp_chinese_informal@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_simp_chinese_informal: *mut nsIAtom;
#[link_name = "\x01?single@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?single@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_single: *mut nsIAtom; pub static nsGkAtoms_single: *mut nsIAtom;
#[link_name = "\x01?size@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?size@nsGkAtoms@@2PAVnsIAtom@@A"]
@ -12902,6 +12976,10 @@ cfg_if! {
pub static nsGkAtoms_tr: *mut nsIAtom; pub static nsGkAtoms_tr: *mut nsIAtom;
#[link_name = "\x01?track@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?track@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_track: *mut nsIAtom; pub static nsGkAtoms_track: *mut nsIAtom;
#[link_name = "\x01?trad_chinese_formal@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_trad_chinese_formal: *mut nsIAtom;
#[link_name = "\x01?trad_chinese_informal@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_trad_chinese_informal: *mut nsIAtom;
#[link_name = "\x01?trailing@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?trailing@nsGkAtoms@@2PAVnsIAtom@@A"]
pub static nsGkAtoms_trailing: *mut nsIAtom; pub static nsGkAtoms_trailing: *mut nsIAtom;
#[link_name = "\x01?transform@nsGkAtoms@@2PAVnsIAtom@@A"] #[link_name = "\x01?transform@nsGkAtoms@@2PAVnsIAtom@@A"]
@ -16038,6 +16116,10 @@ macro_rules! atom {
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_disablehistory as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_disablehistory as *mut _) } };
("disablefullscreen") => ("disablefullscreen") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_disablefullscreen as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_disablefullscreen as *mut _) } };
("disclosure-closed") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_disclosure_closed as *mut _) } };
("disclosure-open") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_disclosure_open as *mut _) } };
("display") => ("display") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_display as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_display as *mut _) } };
("display-mode") => ("display-mode") =>
@ -16226,6 +16308,8 @@ macro_rules! atom {
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_equalsize as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_equalsize as *mut _) } };
("error") => ("error") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_error as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_error as *mut _) } };
("ethiopic-numeric") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_ethiopic_numeric as *mut _) } };
("even") => ("even") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_even as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_even as *mut _) } };
("event") => ("event") =>
@ -16388,6 +16472,8 @@ macro_rules! atom {
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_header as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_header as *mut _) } };
("headers") => ("headers") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_headers as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_headers as *mut _) } };
("hebrew") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_hebrew as *mut _) } };
("height") => ("height") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_height as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_height as *mut _) } };
("hgroup") => ("hgroup") =>
@ -16516,6 +16602,10 @@ macro_rules! atom {
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_itemscope as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_itemscope as *mut _) } };
("itemtype") => ("itemtype") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_itemtype as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_itemtype as *mut _) } };
("japanese-formal") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_japanese_formal as *mut _) } };
("japanese-informal") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_japanese_informal as *mut _) } };
("kbd") => ("kbd") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_kbd as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_kbd as *mut _) } };
("keepcurrentinview") => ("keepcurrentinview") =>
@ -16544,6 +16634,12 @@ macro_rules! atom {
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_keyup as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_keyup as *mut _) } };
("kind") => ("kind") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_kind as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_kind as *mut _) } };
("korean-hangul-formal") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_korean_hangul_formal as *mut _) } };
("korean-hanja-formal") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_korean_hanja_formal as *mut _) } };
("korean-hanja-informal") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_korean_hanja_informal as *mut _) } };
("label") => ("label") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_label as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_label as *mut _) } };
("labels") => ("labels") =>
@ -17804,6 +17900,10 @@ macro_rules! atom {
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_showresizer as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_showresizer as *mut _) } };
("simple") => ("simple") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_simple as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_simple as *mut _) } };
("simp-chinese-formal") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_simp_chinese_formal as *mut _) } };
("simp-chinese-informal") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_simp_chinese_informal as *mut _) } };
("single") => ("single") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_single as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_single as *mut _) } };
("size") => ("size") =>
@ -18032,6 +18132,10 @@ macro_rules! atom {
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_tr as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_tr as *mut _) } };
("track") => ("track") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_track as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_track as *mut _) } };
("trad-chinese-formal") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_trad_chinese_formal as *mut _) } };
("trad-chinese-informal") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_trad_chinese_informal as *mut _) } };
("trailing") => ("trailing") =>
{ unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_trailing as *mut _) } }; { unsafe { $crate::string_cache::atom_macro::atom_from_static($crate::string_cache::atom_macro::nsGkAtoms_trailing as *mut _) } };
("transform") => ("transform") =>

View file

@ -14,6 +14,7 @@ use gecko_bindings::structs::mozilla::css::ErrorReporter;
use gecko_bindings::structs::mozilla::css::ImageValue; use gecko_bindings::structs::mozilla::css::ImageValue;
use gecko_bindings::structs::mozilla::css::URLValue; use gecko_bindings::structs::mozilla::css::URLValue;
use gecko_bindings::structs::mozilla::css::URLValueData; use gecko_bindings::structs::mozilla::css::URLValueData;
use gecko_bindings::structs::mozilla::AnonymousCounterStyle;
use gecko_bindings::structs::mozilla::MallocSizeOf; use gecko_bindings::structs::mozilla::MallocSizeOf;
use gecko_bindings::structs::mozilla::OriginFlags; use gecko_bindings::structs::mozilla::OriginFlags;
use gecko_bindings::structs::mozilla::Side; use gecko_bindings::structs::mozilla::Side;
@ -971,29 +972,12 @@ extern "C" {
src: *const CounterStylePtr); src: *const CounterStylePtr);
} }
extern "C" { extern "C" {
pub fn Gecko_CounterStyle_IsNone(ptr: *const CounterStylePtr) -> bool; pub fn Gecko_CounterStyle_GetName(ptr: *const CounterStylePtr)
-> *mut nsIAtom;
} }
extern "C" { extern "C" {
pub fn Gecko_CounterStyle_IsName(ptr: *const CounterStylePtr) -> bool; pub fn Gecko_CounterStyle_GetAnonymous(ptr: *const CounterStylePtr)
} -> *const AnonymousCounterStyle;
extern "C" {
pub fn Gecko_CounterStyle_GetName(ptr: *const CounterStylePtr,
result: *mut nsAString);
}
extern "C" {
pub fn Gecko_CounterStyle_GetSymbols(ptr: *const CounterStylePtr)
-> *const nsTArray<nsStringRepr>;
}
extern "C" {
pub fn Gecko_CounterStyle_GetSystem(ptr: *const CounterStylePtr) -> u8;
}
extern "C" {
pub fn Gecko_CounterStyle_IsSingleString(ptr: *const CounterStylePtr)
-> bool;
}
extern "C" {
pub fn Gecko_CounterStyle_GetSingleString(ptr: *const CounterStylePtr,
result: *mut nsAString);
} }
extern "C" { extern "C" {
pub fn Gecko_SetNullImageValue(image: *mut nsStyleImage); pub fn Gecko_SetNullImageValue(image: *mut nsStyleImage);

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -6,8 +6,9 @@
//! Different kind of helpers to interact with Gecko values. //! Different kind of helpers to interact with Gecko values.
use Atom;
use app_units::Au; use app_units::Au;
use counter_style::Symbol; use counter_style::{Symbol, Symbols};
use cssparser::RGBA; use cssparser::RGBA;
use gecko_bindings::structs::{CounterStylePtr, nsStyleCoord}; use gecko_bindings::structs::{CounterStylePtr, nsStyleCoord};
use gecko_bindings::structs::{StyleGridTrackBreadth, StyleShapeRadius}; use gecko_bindings::structs::{StyleGridTrackBreadth, StyleShapeRadius};
@ -476,33 +477,35 @@ impl CounterStyleOrNone {
} }
} }
/// Convert Gecko CounterStylePtr to CounterStyleOrNone. /// Convert Gecko CounterStylePtr to CounterStyleOrNone or String.
pub fn from_gecko_value(gecko_value: &CounterStylePtr) -> Self { pub fn from_gecko_value(gecko_value: &CounterStylePtr) -> Either<Self, String> {
use counter_style::{Symbol, Symbols}; use gecko_bindings::bindings;
use gecko_bindings::bindings::Gecko_CounterStyle_GetName;
use gecko_bindings::bindings::Gecko_CounterStyle_GetSymbols;
use gecko_bindings::bindings::Gecko_CounterStyle_GetSystem;
use gecko_bindings::bindings::Gecko_CounterStyle_IsName;
use gecko_bindings::bindings::Gecko_CounterStyle_IsNone;
use values::CustomIdent; use values::CustomIdent;
use values::generics::SymbolsType; use values::generics::SymbolsType;
if unsafe { Gecko_CounterStyle_IsNone(gecko_value) } { let name = unsafe { bindings::Gecko_CounterStyle_GetName(gecko_value) };
CounterStyleOrNone::None if !name.is_null() {
} else if unsafe { Gecko_CounterStyle_IsName(gecko_value) } { let name = Atom::from(name);
ns_auto_string!(name); if name == atom!("none") {
unsafe { Gecko_CounterStyle_GetName(gecko_value, &mut *name) }; Either::First(CounterStyleOrNone::None)
CounterStyleOrNone::Name(CustomIdent((&*name).into()))
} else { } else {
let system = unsafe { Gecko_CounterStyle_GetSystem(gecko_value) }; Either::First(CounterStyleOrNone::Name(CustomIdent(name)))
let symbol_type = SymbolsType::from_gecko_keyword(system as u32); }
let symbols = unsafe { } else {
let ref gecko_symbols = *Gecko_CounterStyle_GetSymbols(gecko_value); let anonymous = unsafe {
gecko_symbols.iter().map(|gecko_symbol| { bindings::Gecko_CounterStyle_GetAnonymous(gecko_value).as_ref()
}.unwrap();
let symbols = &anonymous.mSymbols;
if anonymous.mSingleString {
debug_assert_eq!(symbols.len(), 1);
Either::Second(symbols[0].to_string())
} else {
let symbol_type = SymbolsType::from_gecko_keyword(anonymous.mSystem as u32);
let symbols = symbols.iter().map(|gecko_symbol| {
Symbol::String(gecko_symbol.to_string()) Symbol::String(gecko_symbol.to_string())
}).collect() }).collect();
}; Either::First(CounterStyleOrNone::Symbols(symbol_type, Symbols(symbols)))
CounterStyleOrNone::Symbols(symbol_type, Symbols(symbols)) }
} }
} }
} }

View file

@ -4159,19 +4159,14 @@ fn static_assert() {
} }
pub fn clone_list_style_type(&self) -> longhands::list_style_type::computed_value::T { pub fn clone_list_style_type(&self) -> longhands::list_style_type::computed_value::T {
use gecko_bindings::bindings::Gecko_CounterStyle_IsSingleString;
use gecko_bindings::bindings::Gecko_CounterStyle_GetSingleString;
use self::longhands::list_style_type::computed_value::T; use self::longhands::list_style_type::computed_value::T;
use values::Either;
use values::generics::CounterStyleOrNone; use values::generics::CounterStyleOrNone;
if unsafe { Gecko_CounterStyle_IsSingleString(&self.gecko.mCounterStyle) } { let result = CounterStyleOrNone::from_gecko_value(&self.gecko.mCounterStyle);
ns_auto_string!(single_string); match result {
unsafe { Either::First(counter_style) => T::CounterStyle(counter_style),
Gecko_CounterStyle_GetSingleString(&self.gecko.mCounterStyle, &mut *single_string) Either::Second(string) => T::String(string),
};
T::String(single_string.to_string())
} else {
T::CounterStyle(CounterStyleOrNone::from_gecko_value(&self.gecko.mCounterStyle))
} }
} }
@ -5617,6 +5612,7 @@ clip-path
use gecko::conversions::string_from_chars_pointer; use gecko::conversions::string_from_chars_pointer;
use gecko_bindings::structs::nsStyleContentType::*; use gecko_bindings::structs::nsStyleContentType::*;
use properties::longhands::content::computed_value::{T, ContentItem}; use properties::longhands::content::computed_value::{T, ContentItem};
use values::Either;
use values::generics::CounterStyleOrNone; use values::generics::CounterStyleOrNone;
use values::specified::url::SpecifiedUrl; use values::specified::url::SpecifiedUrl;
use values::specified::Attr; use values::specified::Attr;
@ -5664,6 +5660,11 @@ clip-path
let ident = gecko_function.mIdent.to_string(); let ident = gecko_function.mIdent.to_string();
let style = let style =
CounterStyleOrNone::from_gecko_value(&gecko_function.mCounterStyle); CounterStyleOrNone::from_gecko_value(&gecko_function.mCounterStyle);
let style = match style {
Either::First(counter_style) => counter_style,
Either::Second(_) =>
unreachable!("counter function shouldn't have single string type"),
};
if gecko_content.mType == eStyleContentType_Counter { if gecko_content.mType == eStyleContentType_Counter {
ContentItem::Counter(ident, style) ContentItem::Counter(ident, style)
} else { } else {