summaryrefslogtreecommitdiffstats
path: root/servo/components/style/properties/longhands/list.mako.rs
blob: 0975b3753b411fde6942b6bfe4ff95ea5d23fca0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */

<%namespace name="helpers" file="/helpers.mako.rs" />

<% data.new_style_struct("List", inherited=True) %>

${helpers.single_keyword(
    "list-style-position",
    "outside inside",
    engines="gecko servo-2013 servo-2020",
    servo_2020_pref="layout.2020.unimplemented",
    gecko_enum_prefix="StyleListStylePosition",
    animation_value_type="discrete",
    spec="https://drafts.csswg.org/css-lists/#propdef-list-style-position",
    servo_restyle_damage="rebuild_and_reflow",
)}

// TODO(pcwalton): Implement the full set of counter styles per CSS-COUNTER-STYLES [1] 6.1:
//
//     decimal-leading-zero, armenian, upper-armenian, lower-armenian, georgian, lower-roman,
//     upper-roman
//
// [1]: http://dev.w3.org/csswg/css-counter-styles/
% if engine in ["servo-2013", "servo-2020"]:
    ${helpers.single_keyword(
        "list-style-type",
        "disc none circle square disclosure-open disclosure-closed",
        extra_servo_2013_values="""
            decimal lower-alpha upper-alpha 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
        """,
        engines="servo-2013 servo-2020",
        animation_value_type="discrete",
        spec="https://drafts.csswg.org/css-lists/#propdef-list-style-type",
        servo_restyle_damage="rebuild_and_reflow",
    )}
% endif
% if engine == "gecko":
    ${helpers.predefined_type(
        "list-style-type",
        "ListStyleType",
        "computed::ListStyleType::disc()",
        engines="gecko",
        initial_specified_value="specified::ListStyleType::disc()",
        animation_value_type="discrete",
        boxed=True,
        spec="https://drafts.csswg.org/css-lists/#propdef-list-style-type",
        servo_restyle_damage="rebuild_and_reflow",
    )}
% endif

${helpers.predefined_type(
    "list-style-image",
    "Image",
    engines="gecko servo-2013 servo-2020",
    initial_value="computed::Image::None",
    initial_specified_value="specified::Image::None",
    animation_value_type="discrete",
    spec="https://drafts.csswg.org/css-lists/#propdef-list-style-image",
    servo_restyle_damage="rebuild_and_reflow",
)}

${helpers.predefined_type(
    "quotes",
    "Quotes",
    "computed::Quotes::get_initial_value()",
    engines="gecko servo-2013",
    animation_value_type="discrete",
    spec="https://drafts.csswg.org/css-content/#propdef-quotes",
    servo_restyle_damage="rebuild_and_reflow",
)}

${helpers.predefined_type(
    "-moz-image-region",
    "ClipRectOrAuto",
    "computed::ClipRectOrAuto::auto()",
    engines="gecko",
    gecko_ffi_name="mImageRegion",
    animation_value_type="ComputedValue",
    boxed=True,
    spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-image-region)",
)}