tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

ui.mako.rs (13719B)


      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 <% from data import DEFAULT_RULES_EXCEPT_KEYFRAME %>
      7 
      8 // TODO spec says that UAs should not support this
      9 // we should probably remove from gecko (https://bugzilla.mozilla.org/show_bug.cgi?id=1328331)
     10 ${helpers.single_keyword(
     11    "ime-mode",
     12    "auto normal active disabled inactive",
     13    engines="gecko",
     14    gecko_enum_prefix="StyleImeMode",
     15    gecko_ffi_name="mIMEMode",
     16    animation_type="discrete",
     17    spec="https://drafts.csswg.org/css-ui/#input-method-editor",
     18    affects="",
     19 )}
     20 
     21 ${helpers.single_keyword(
     22    "scrollbar-width",
     23    "auto thin none",
     24    engines="gecko",
     25    gecko_enum_prefix="StyleScrollbarWidth",
     26    animation_type="discrete",
     27    spec="https://drafts.csswg.org/css-scrollbars-1/#scrollbar-width",
     28    affects="layout",
     29 )}
     30 
     31 ${helpers.predefined_type(
     32    "user-select",
     33    "UserSelect",
     34    "computed::UserSelect::Auto",
     35    engines="gecko",
     36    extra_prefixes="moz webkit",
     37    animation_type="discrete",
     38    spec="https://drafts.csswg.org/css-ui-4/#propdef-user-select",
     39    affects="",
     40 )}
     41 
     42 ${helpers.single_keyword(
     43    "-moz-window-dragging",
     44    "default drag no-drag",
     45    engines="gecko",
     46    gecko_ffi_name="mWindowDragging",
     47    gecko_enum_prefix="StyleWindowDragging",
     48    animation_type="discrete",
     49    enabled_in="chrome",
     50    spec="None (Nonstandard Firefox-only property)",
     51    affects="paint",
     52 )}
     53 
     54 // TODO(emilio): Maybe make shadow behavior on macOS match Linux / Windows, and remove this? But
     55 // that requires making -moz-window-input-region-margin work there...
     56 ${helpers.single_keyword(
     57    "-moz-window-shadow",
     58    "auto none",
     59    engines="gecko",
     60    gecko_ffi_name="mWindowShadow",
     61    gecko_enum_prefix="StyleWindowShadow",
     62    animation_type="discrete",
     63    enabled_in="chrome",
     64    spec="None (Nonstandard internal property)",
     65    affects="overflow",
     66 )}
     67 
     68 ${helpers.predefined_type(
     69    "-moz-window-opacity",
     70    "Opacity",
     71    "1.0",
     72    engines="gecko",
     73    gecko_ffi_name="mWindowOpacity",
     74    spec="None (Nonstandard internal property)",
     75    enabled_in="chrome",
     76    affects="paint",
     77 )}
     78 
     79 ${helpers.predefined_type(
     80    "-moz-window-transform",
     81    "Transform",
     82    "generics::transform::Transform::none()",
     83    engines="gecko",
     84    spec="None (Nonstandard internal property)",
     85    enabled_in="chrome",
     86    affects="overflow",
     87 )}
     88 
     89 ${helpers.predefined_type(
     90    "-moz-window-input-region-margin",
     91    "Length",
     92    "computed::Length::zero()",
     93    engines="gecko",
     94    spec="None (Nonstandard internal property)",
     95    enabled_in="chrome",
     96    affects="",
     97 )}
     98 
     99 // Hack to allow chrome to hide stuff only visually (without hiding it from a11y).
    100 ${helpers.predefined_type(
    101    "-moz-subtree-hidden-only-visually",
    102    "BoolInteger",
    103    "computed::BoolInteger::zero()",
    104    engines="gecko",
    105    animation_type="discrete",
    106    spec="None (Nonstandard internal property)",
    107    enabled_in="chrome",
    108    affects="paint",
    109 )}
    110 
    111 // TODO(emilio): Probably also should be hidden from content.
    112 ${helpers.predefined_type(
    113    "-moz-force-broken-image-icon",
    114    "BoolInteger",
    115    "computed::BoolInteger::zero()",
    116    engines="gecko",
    117    animation_type="discrete",
    118    spec="None (Nonstandard Firefox-only property)",
    119    affects="layout",
    120 )}
    121 
    122 <% transition_extra_prefixes = "moz:layout.css.prefixes.transitions webkit" %>
    123 
    124 ${helpers.predefined_type(
    125    "transition-duration",
    126    "Time",
    127    "computed::Time::zero()",
    128    engines="gecko servo",
    129    initial_specified_value="specified::Time::zero()",
    130    parse_method="parse_non_negative",
    131    vector=True,
    132    need_index=True,
    133    animation_type="none",
    134    extra_prefixes=transition_extra_prefixes,
    135    spec="https://drafts.csswg.org/css-transitions/#propdef-transition-duration",
    136    affects="",
    137 )}
    138 
    139 ${helpers.predefined_type(
    140    "transition-timing-function",
    141    "TimingFunction",
    142    "computed::TimingFunction::ease()",
    143    engines="gecko servo",
    144    initial_specified_value="specified::TimingFunction::ease()",
    145    vector=True,
    146    need_index=True,
    147    animation_type="none",
    148    extra_prefixes=transition_extra_prefixes,
    149    spec="https://drafts.csswg.org/css-transitions/#propdef-transition-timing-function",
    150    affects="",
    151 )}
    152 
    153 ${helpers.predefined_type(
    154    "transition-property",
    155    "TransitionProperty",
    156    "computed::TransitionProperty::all()",
    157    engines="gecko servo",
    158    initial_specified_value="specified::TransitionProperty::all()",
    159    vector=True,
    160    none_value="computed::TransitionProperty::none()",
    161    need_index=True,
    162    animation_type="none",
    163    extra_prefixes=transition_extra_prefixes,
    164    spec="https://drafts.csswg.org/css-transitions/#propdef-transition-property",
    165    affects="",
    166 )}
    167 
    168 ${helpers.predefined_type(
    169    "transition-delay",
    170    "Time",
    171    "computed::Time::zero()",
    172    engines="gecko servo",
    173    initial_specified_value="specified::Time::zero()",
    174    vector=True,
    175    need_index=True,
    176    animation_type="none",
    177    extra_prefixes=transition_extra_prefixes,
    178    spec="https://drafts.csswg.org/css-transitions/#propdef-transition-delay",
    179    affects="",
    180 )}
    181 
    182 ${helpers.predefined_type(
    183    "transition-behavior",
    184    "TransitionBehavior",
    185    "computed::TransitionBehavior::normal()",
    186    engines="gecko servo",
    187    initial_specified_value="specified::TransitionBehavior::normal()",
    188    vector=True,
    189    need_index=True,
    190    animation_type="none",
    191    spec="https://drafts.csswg.org/css-transitions-2/#transition-behavior-property",
    192    affects="",
    193 )}
    194 
    195 <% animation_extra_prefixes = "moz:layout.css.prefixes.animations webkit" %>
    196 
    197 ${helpers.predefined_type(
    198    "animation-name",
    199    "AnimationName",
    200    "computed::AnimationName::none()",
    201    engines="gecko servo",
    202    initial_specified_value="specified::AnimationName::none()",
    203    vector=True,
    204    need_index=True,
    205    animation_type="none",
    206    extra_prefixes=animation_extra_prefixes,
    207    rule_types_allowed=DEFAULT_RULES_EXCEPT_KEYFRAME,
    208    spec="https://drafts.csswg.org/css-animations/#propdef-animation-name",
    209    affects="",
    210 )}
    211 
    212 ${helpers.predefined_type(
    213    "animation-duration",
    214    "AnimationDuration",
    215    "computed::AnimationDuration::auto()",
    216    engines="gecko servo",
    217    initial_specified_value="specified::AnimationDuration::auto()",
    218    vector=True,
    219    need_index=True,
    220    animation_type="none",
    221    extra_prefixes=animation_extra_prefixes,
    222    spec="https://drafts.csswg.org/css-animations-2/#animation-duration",
    223    affects="",
    224 )}
    225 
    226 // animation-timing-function is the exception to the rule for allowed_in_keyframe_block:
    227 // https://drafts.csswg.org/css-animations/#keyframes
    228 ${helpers.predefined_type(
    229    "animation-timing-function",
    230    "TimingFunction",
    231    "computed::TimingFunction::ease()",
    232    engines="gecko servo",
    233    initial_specified_value="specified::TimingFunction::ease()",
    234    vector=True,
    235    need_index=True,
    236    animation_type="none",
    237    extra_prefixes=animation_extra_prefixes,
    238    spec="https://drafts.csswg.org/css-transitions/#propdef-animation-timing-function",
    239    affects="",
    240 )}
    241 
    242 ${helpers.predefined_type(
    243    "animation-iteration-count",
    244    "AnimationIterationCount",
    245    "computed::AnimationIterationCount::one()",
    246    engines="gecko servo",
    247    initial_specified_value="specified::AnimationIterationCount::one()",
    248    vector=True,
    249    need_index=True,
    250    animation_type="none",
    251    extra_prefixes=animation_extra_prefixes,
    252    rule_types_allowed=DEFAULT_RULES_EXCEPT_KEYFRAME,
    253    spec="https://drafts.csswg.org/css-animations/#propdef-animation-iteration-count",
    254    affects="",
    255 )}
    256 
    257 ${helpers.predefined_type(
    258    "animation-direction",
    259    "AnimationDirection",
    260    "computed::AnimationDirection::Normal",
    261    engines="gecko servo",
    262    initial_specified_value="specified::AnimationDirection::Normal",
    263    vector=True,
    264    need_index=True,
    265    animation_type="none",
    266    extra_prefixes=animation_extra_prefixes,
    267    spec="https://drafts.csswg.org/css-animations/#propdef-animation-direction",
    268    rule_types_allowed=DEFAULT_RULES_EXCEPT_KEYFRAME,
    269    affects="",
    270 )}
    271 
    272 ${helpers.predefined_type(
    273    "animation-play-state",
    274    "AnimationPlayState",
    275    "computed::AnimationPlayState::Running",
    276    engines="gecko servo",
    277    initial_specified_value="computed::AnimationPlayState::Running",
    278    vector=True,
    279    need_index=True,
    280    animation_type="none",
    281    extra_prefixes=animation_extra_prefixes,
    282    spec="https://drafts.csswg.org/css-animations/#propdef-animation-play-state",
    283    rule_types_allowed=DEFAULT_RULES_EXCEPT_KEYFRAME,
    284    affects="",
    285 )}
    286 
    287 ${helpers.predefined_type(
    288    "animation-fill-mode",
    289    "AnimationFillMode",
    290    "computed::AnimationFillMode::None",
    291    engines="gecko servo",
    292    initial_specified_value="computed::AnimationFillMode::None",
    293    vector=True,
    294    need_index=True,
    295    animation_type="none",
    296    extra_prefixes=animation_extra_prefixes,
    297    spec="https://drafts.csswg.org/css-animations/#propdef-animation-fill-mode",
    298    rule_types_allowed=DEFAULT_RULES_EXCEPT_KEYFRAME,
    299    affects="",
    300 )}
    301 
    302 ${helpers.predefined_type(
    303    "animation-composition",
    304    "AnimationComposition",
    305    "computed::AnimationComposition::Replace",
    306    engines="gecko servo",
    307    initial_specified_value="computed::AnimationComposition::Replace",
    308    vector=True,
    309    need_index=True,
    310    animation_type="none",
    311    servo_pref="layout.unimplemented",
    312    spec="https://drafts.csswg.org/css-animations-2/#animation-composition",
    313    affects="",
    314 )}
    315 
    316 ${helpers.predefined_type(
    317    "animation-delay",
    318    "Time",
    319    "computed::Time::zero()",
    320    engines="gecko servo",
    321    initial_specified_value="specified::Time::zero()",
    322    vector=True,
    323    need_index=True,
    324    animation_type="none",
    325    extra_prefixes=animation_extra_prefixes,
    326    spec="https://drafts.csswg.org/css-animations/#propdef-animation-delay",
    327    rule_types_allowed=DEFAULT_RULES_EXCEPT_KEYFRAME,
    328    affects="",
    329 )}
    330 
    331 ${helpers.predefined_type(
    332    "animation-timeline",
    333    "AnimationTimeline",
    334    "computed::AnimationTimeline::auto()",
    335    engines="gecko servo",
    336    servo_pref="layout.unimplemented",
    337    initial_specified_value="specified::AnimationTimeline::auto()",
    338    vector=True,
    339    need_index=True,
    340    animation_type="none",
    341    gecko_pref="layout.css.scroll-driven-animations.enabled",
    342    spec="https://drafts.csswg.org/css-animations-2/#propdef-animation-timeline",
    343    rule_types_allowed=DEFAULT_RULES_EXCEPT_KEYFRAME,
    344    affects="",
    345 )}
    346 
    347 ${helpers.predefined_type(
    348    "scroll-timeline-name",
    349    "TimelineName",
    350    "computed::TimelineName::none()",
    351    vector=True,
    352    need_index=True,
    353    engines="gecko",
    354    animation_type="none",
    355    gecko_pref="layout.css.scroll-driven-animations.enabled",
    356    spec="https://drafts.csswg.org/scroll-animations-1/#scroll-timeline-name",
    357    rule_types_allowed=DEFAULT_RULES_EXCEPT_KEYFRAME,
    358    affects="",
    359 )}
    360 
    361 ${helpers.predefined_type(
    362    "scroll-timeline-axis",
    363    "ScrollAxis",
    364    "computed::ScrollAxis::default()",
    365    vector=True,
    366    need_index=True,
    367    engines="gecko",
    368    animation_type="none",
    369    gecko_pref="layout.css.scroll-driven-animations.enabled",
    370    spec="https://drafts.csswg.org/scroll-animations-1/#scroll-timeline-axis",
    371    rule_types_allowed=DEFAULT_RULES_EXCEPT_KEYFRAME,
    372    affects="",
    373 )}
    374 
    375 ${helpers.predefined_type(
    376    "view-timeline-name",
    377    "TimelineName",
    378    "computed::TimelineName::none()",
    379    vector=True,
    380    need_index=True,
    381    engines="gecko",
    382    animation_type="none",
    383    gecko_pref="layout.css.scroll-driven-animations.enabled",
    384    spec="https://drafts.csswg.org/scroll-animations-1/#view-timeline-name",
    385    rule_types_allowed=DEFAULT_RULES_EXCEPT_KEYFRAME,
    386    affects="",
    387 )}
    388 
    389 ${helpers.predefined_type(
    390    "view-timeline-axis",
    391    "ScrollAxis",
    392    "computed::ScrollAxis::default()",
    393    vector=True,
    394    need_index=True,
    395    engines="gecko",
    396    animation_type="none",
    397    gecko_pref="layout.css.scroll-driven-animations.enabled",
    398    spec="https://drafts.csswg.org/scroll-animations-1/#view-timeline-axis",
    399    rule_types_allowed=DEFAULT_RULES_EXCEPT_KEYFRAME,
    400    affects="",
    401 )}
    402 
    403 ${helpers.predefined_type(
    404    "view-timeline-inset",
    405    "ViewTimelineInset",
    406    "computed::ViewTimelineInset::default()",
    407    vector=True,
    408    need_index=True,
    409    engines="gecko",
    410    animation_type="none",
    411    gecko_pref="layout.css.scroll-driven-animations.enabled",
    412    spec="https://drafts.csswg.org/scroll-animations-1/#view-timeline-axis",
    413    rule_types_allowed=DEFAULT_RULES_EXCEPT_KEYFRAME,
    414    affects="",
    415 )}
    416 
    417 ${helpers.single_keyword(
    418    "field-sizing",
    419    "fixed content",
    420    engines="gecko",
    421    gecko_enum_prefix="StyleFieldSizing",
    422    animation_type="discrete",
    423    gecko_pref="layout.css.field-sizing.enabled",
    424    spec="https://drafts.csswg.org/css-ui/#field-sizing",
    425    affects="layout",
    426 )}
    427 
    428 ${helpers.predefined_type(
    429    "view-transition-name",
    430    "ViewTransitionName",
    431    "computed::ViewTransitionName::none()",
    432    engines="gecko servo",
    433    servo_pref="layout.unimplemented",
    434    animation_type="discrete",
    435    gecko_pref="dom.viewTransitions.enabled",
    436    spec="https://drafts.csswg.org/css-view-transitions-1/#view-transition-name-prop",
    437    affects="",
    438    enabled_in="ua",
    439 )}
    440 
    441 ${helpers.predefined_type(
    442    "view-transition-class",
    443    "ViewTransitionClass",
    444    "computed::ViewTransitionClass::none()",
    445    engines="gecko servo",
    446    servo_pref="layout.unimplemented",
    447    animation_type="discrete",
    448    gecko_pref="dom.viewTransitions.enabled",
    449    spec="https://drafts.csswg.org/css-view-transitions-2/#view-transition-class-prop",
    450    affects="",
    451    enabled_in="ua",
    452 )}