background.mako.rs (4292B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ 4 5 <%namespace name="helpers" file="/helpers.mako.rs" /> 6 7 ${helpers.predefined_type( 8 "background-color", 9 "Color", 10 "computed::Color::TRANSPARENT_BLACK", 11 engines="gecko servo", 12 initial_specified_value="SpecifiedValue::transparent()", 13 spec="https://drafts.csswg.org/css-backgrounds/#background-color", 14 ignored_when_colors_disabled=True, 15 allow_quirks="Yes", 16 flags="CAN_ANIMATE_ON_COMPOSITOR", 17 servo_restyle_damage="repaint", 18 affects="paint", 19 )} 20 21 ${helpers.predefined_type( 22 "background-image", 23 "Image", 24 engines="gecko servo", 25 initial_value="computed::Image::None", 26 initial_specified_value="specified::Image::None", 27 spec="https://drafts.csswg.org/css-backgrounds/#the-background-image", 28 vector="True", 29 animation_type="discrete", 30 ignored_when_colors_disabled="True", 31 servo_restyle_damage="repaint", 32 affects="paint", 33 )} 34 35 % for (axis, direction, initial) in [("x", "Horizontal", "left"), ("y", "Vertical", "top")]: 36 ${helpers.predefined_type( 37 "background-position-" + axis, 38 "position::" + direction + "Position", 39 "computed::LengthPercentage::zero_percent()", 40 engines="gecko servo", 41 initial_specified_value="SpecifiedValue::initial_specified_value()", 42 spec="https://drafts.csswg.org/css-backgrounds-4/#propdef-background-position-" + axis, 43 vector=True, 44 vector_animation_type="repeatable_list", 45 servo_restyle_damage="repaint", 46 affects="paint", 47 )} 48 % endfor 49 50 ${helpers.predefined_type( 51 "background-repeat", 52 "BackgroundRepeat", 53 "computed::BackgroundRepeat::repeat()", 54 engines="gecko servo", 55 initial_specified_value="specified::BackgroundRepeat::repeat()", 56 animation_type="discrete", 57 vector=True, 58 spec="https://drafts.csswg.org/css-backgrounds/#the-background-repeat", 59 servo_restyle_damage="repaint", 60 affects="paint", 61 )} 62 63 ${helpers.single_keyword( 64 "background-attachment", 65 "scroll fixed" + (" local" if engine == "gecko" else ""), 66 engines="gecko servo", 67 vector=True, 68 gecko_enum_prefix="StyleImageLayerAttachment", 69 spec="https://drafts.csswg.org/css-backgrounds/#the-background-attachment", 70 animation_type="discrete", 71 servo_restyle_damage="repaint", 72 affects="paint", 73 )} 74 75 ${helpers.single_keyword( 76 "background-clip", 77 "border-box padding-box content-box", 78 engines="gecko servo", 79 extra_gecko_values="text", 80 vector=True, extra_prefixes="webkit", 81 gecko_enum_prefix="StyleGeometryBox", 82 gecko_inexhaustive=True, 83 spec="https://drafts.csswg.org/css-backgrounds/#the-background-clip", 84 animation_type="discrete", 85 servo_restyle_damage="repaint", 86 affects="paint", 87 )} 88 89 ${helpers.single_keyword( 90 "background-origin", 91 "padding-box border-box content-box", 92 engines="gecko servo", 93 vector=True, extra_prefixes="webkit", 94 gecko_enum_prefix="StyleGeometryBox", 95 gecko_inexhaustive=True, 96 spec="https://drafts.csswg.org/css-backgrounds/#the-background-origin", 97 animation_type="discrete", 98 servo_restyle_damage="repaint", 99 affects="paint", 100 )} 101 102 ${helpers.predefined_type( 103 "background-size", 104 "BackgroundSize", 105 engines="gecko servo", 106 initial_value="computed::BackgroundSize::auto()", 107 initial_specified_value="specified::BackgroundSize::auto()", 108 spec="https://drafts.csswg.org/css-backgrounds/#the-background-size", 109 vector=True, 110 vector_animation_type="repeatable_list", 111 extra_prefixes="webkit", 112 servo_restyle_damage="repaint", 113 affects="paint", 114 )} 115 116 // https://drafts.fxtf.org/compositing/#background-blend-mode 117 ${helpers.single_keyword( 118 "background-blend-mode", 119 """normal multiply screen overlay darken lighten color-dodge 120 color-burn hard-light soft-light difference exclusion hue 121 saturation color luminosity""", 122 gecko_enum_prefix="StyleBlend", 123 vector=True, 124 engines="gecko", 125 animation_type="discrete", 126 gecko_inexhaustive=True, 127 spec="https://drafts.fxtf.org/compositing/#background-blend-mode", 128 affects="paint", 129 )}