1
0

attributes.rs 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869
  1. use crate::elements::*;
  2. // map the rsx name of the attribute to the html name of the attribute and the namespace that contains it
  3. pub fn attrbute_to_static_str(attr: &str) -> Option<(&'static str, Option<&'static str>)> {
  4. NO_NAMESPACE_ATTRIBUTES
  5. .iter()
  6. .find(|&a| *a == attr)
  7. .map(|a| (*a, None))
  8. .or_else(|| {
  9. STYLE_ATTRIBUTES
  10. .iter()
  11. .find(|(a, _)| *a == attr)
  12. .map(|(_, b)| (*b, Some("style")))
  13. })
  14. .or_else(|| {
  15. MAPPED_ATTRIBUTES
  16. .iter()
  17. .find(|(a, _)| *a == attr)
  18. .map(|(_, b)| (*b, None))
  19. })
  20. .or_else(|| {
  21. svg::MAPPED_ATTRIBUTES
  22. .iter()
  23. .find(|(a, _)| *a == attr)
  24. .map(|(_, b)| (*b, None))
  25. })
  26. .or_else(|| {
  27. ELEMENTS_WITH_MAPPED_ATTRIBUTES
  28. .iter()
  29. .find_map(|(_, attrs)| {
  30. attrs
  31. .iter()
  32. .find(|(a, _)| *a == attr)
  33. .map(|(_, b)| (*b, None))
  34. })
  35. })
  36. .or_else(|| {
  37. ELEMENTS_WITH_NAMESPACE
  38. .iter()
  39. .find_map(|(_, _, attrs)| attrs.iter().find(|a| **a == attr).map(|a| (*a, None)))
  40. })
  41. .or_else(|| {
  42. ELEMENTS_WITHOUT_NAMESPACE
  43. .iter()
  44. .find_map(|(_, attrs)| attrs.iter().find(|a| **a == attr).map(|a| (*a, None)))
  45. })
  46. }
  47. macro_rules! no_namespace_trait_methods {
  48. (
  49. $(
  50. $(#[$attr:meta])*
  51. $name:ident;
  52. )*
  53. ) => {
  54. pub const NO_NAMESPACE_ATTRIBUTES: &'static [&'static str] = &[
  55. $(
  56. stringify!($name),
  57. )*
  58. ];
  59. };
  60. }
  61. macro_rules! style_trait_methods {
  62. (
  63. $(
  64. $(#[$attr:meta])*
  65. $name:ident: $lit:literal,
  66. )*
  67. ) => {
  68. pub const STYLE_ATTRIBUTES: &'static [(&'static str, &'static str)] = &[
  69. $(
  70. (stringify!($name), $lit),
  71. )*
  72. ];
  73. };
  74. }
  75. macro_rules! mapped_trait_methods {
  76. (
  77. $(
  78. $(#[$attr:meta])*
  79. $name:ident: $lit:literal,
  80. )*
  81. ) => {
  82. pub const MAPPED_ATTRIBUTES: &'static [(&'static str, &'static str)] = &[
  83. $(
  84. (stringify!($name), $lit),
  85. )*
  86. ("prevent_default", "dioxus-prevent-default"),
  87. ];
  88. };
  89. }
  90. no_namespace_trait_methods! {
  91. accesskey;
  92. /// The HTML class attribute is used to specify a class for an HTML element.
  93. ///
  94. /// ## Details
  95. /// Multiple HTML elements can share the same class.
  96. ///
  97. /// The class global attribute is a space-separated list of the case-sensitive classes of the element.
  98. /// Classes allow CSS and Javascript to select and access specific elements via the class selectors or
  99. /// functions like the DOM method document.getElementsByClassName.
  100. ///
  101. /// ## Example
  102. ///
  103. /// ### HTML:
  104. /// ```html
  105. /// <p class="note editorial">Above point sounds a bit obvious. Remove/rewrite?</p>
  106. /// ```
  107. ///
  108. /// ### CSS:
  109. /// ```css
  110. /// .note {
  111. /// font-style: italic;
  112. /// font-weight: bold;
  113. /// }
  114. ///
  115. /// .editorial {
  116. /// background: rgb(255, 0, 0, .25);
  117. /// padding: 10px;
  118. /// }
  119. /// ```
  120. class;
  121. contenteditable;
  122. data;
  123. dir;
  124. draggable;
  125. hidden;
  126. id;
  127. lang;
  128. spellcheck;
  129. style;
  130. tabindex;
  131. title;
  132. translate;
  133. role;
  134. /// dangerous_inner_html is Dioxus's replacement for using innerHTML in the browser DOM. In general, setting
  135. /// HTML from code is risky because it’s easy to inadvertently expose your users to a cross-site scripting (XSS)
  136. /// attack. So, you can set HTML directly from Dioxus, but you have to type out dangerous_inner_html to remind
  137. /// yourself that it’s dangerous
  138. dangerous_inner_html;
  139. }
  140. // This macro creates an explicit method call for each of the style attributes.
  141. //
  142. // The left token specifies the name of the attribute in the rsx! macro, and the right string literal specifies the
  143. // actual name of the attribute generated.
  144. //
  145. // This roughly follows the html spec
  146. style_trait_methods! {
  147. align_content: "align-content",
  148. align_items: "align-items",
  149. align_self: "align-self",
  150. alignment_adjust: "alignment-adjust",
  151. alignment_baseline: "alignment-baseline",
  152. all: "all",
  153. alt: "alt",
  154. animation: "animation",
  155. animation_delay: "animation-delay",
  156. animation_direction: "animation-direction",
  157. animation_duration: "animation-duration",
  158. animation_fill_mode: "animation-fill-mode",
  159. animation_iteration_count: "animation-iteration-count",
  160. animation_name: "animation-name",
  161. animation_play_state: "animation-play-state",
  162. animation_timing_function: "animation-timing-function",
  163. azimuth: "azimuth",
  164. backface_visibility: "backface-visibility",
  165. background: "background",
  166. background_attachment: "background-attachment",
  167. background_clip: "background-clip",
  168. background_color: "background-color",
  169. background_image: "background-image",
  170. background_origin: "background-origin",
  171. background_position: "background-position",
  172. background_repeat: "background-repeat",
  173. background_size: "background-size",
  174. background_blend_mode: "background-blend-mode",
  175. baseline_shift: "baseline-shift",
  176. bleed: "bleed",
  177. bookmark_label: "bookmark-label",
  178. bookmark_level: "bookmark-level",
  179. bookmark_state: "bookmark-state",
  180. border: "border",
  181. border_color: "border-color",
  182. border_style: "border-style",
  183. border_width: "border-width",
  184. border_bottom: "border-bottom",
  185. border_bottom_color: "border-bottom-color",
  186. border_bottom_style: "border-bottom-style",
  187. border_bottom_width: "border-bottom-width",
  188. border_left: "border-left",
  189. border_left_color: "border-left-color",
  190. border_left_style: "border-left-style",
  191. border_left_width: "border-left-width",
  192. border_right: "border-right",
  193. border_right_color: "border-right-color",
  194. border_right_style: "border-right-style",
  195. border_right_width: "border-right-width",
  196. border_top: "border-top",
  197. border_top_color: "border-top-color",
  198. border_top_style: "border-top-style",
  199. border_top_width: "border-top-width",
  200. border_collapse: "border-collapse",
  201. border_image: "border-image",
  202. border_image_outset: "border-image-outset",
  203. border_image_repeat: "border-image-repeat",
  204. border_image_slice: "border-image-slice",
  205. border_image_source: "border-image-source",
  206. border_image_width: "border-image-width",
  207. border_radius: "border-radius",
  208. border_bottom_left_radius: "border-bottom-left-radius",
  209. border_bottom_right_radius: "border-bottom-right-radius",
  210. border_top_left_radius: "border-top-left-radius",
  211. border_top_right_radius: "border-top-right-radius",
  212. border_spacing: "border-spacing",
  213. bottom: "bottom",
  214. box_decoration_break: "box-decoration-break",
  215. box_shadow: "box-shadow",
  216. box_sizing: "box-sizing",
  217. box_snap: "box-snap",
  218. break_after: "break-after",
  219. break_before: "break-before",
  220. break_inside: "break-inside",
  221. buffered_rendering: "buffered-rendering",
  222. caption_side: "caption-side",
  223. clear: "clear",
  224. clear_side: "clear-side",
  225. clip: "clip",
  226. clip_path: "clip-path",
  227. clip_rule: "clip-rule",
  228. color: "color",
  229. color_adjust: "color-adjust",
  230. color_correction: "color-correction",
  231. color_interpolation: "color-interpolation",
  232. color_interpolation_filters: "color-interpolation-filters",
  233. color_profile: "color-profile",
  234. color_rendering: "color-rendering",
  235. column_fill: "column-fill",
  236. column_gap: "column-gap",
  237. column_rule: "column-rule",
  238. column_rule_color: "column-rule-color",
  239. column_rule_style: "column-rule-style",
  240. column_rule_width: "column-rule-width",
  241. column_span: "column-span",
  242. columns: "columns",
  243. column_count: "column-count",
  244. column_width: "column-width",
  245. contain: "contain",
  246. content: "content",
  247. counter_increment: "counter-increment",
  248. counter_reset: "counter-reset",
  249. counter_set: "counter-set",
  250. cue: "cue",
  251. cue_after: "cue-after",
  252. cue_before: "cue-before",
  253. cursor: "cursor",
  254. direction: "direction",
  255. display: "display",
  256. display_inside: "display-inside",
  257. display_outside: "display-outside",
  258. display_extras: "display-extras",
  259. display_box: "display-box",
  260. dominant_baseline: "dominant-baseline",
  261. elevation: "elevation",
  262. empty_cells: "empty-cells",
  263. enable_background: "enable-background",
  264. fill: "fill",
  265. fill_opacity: "fill-opacity",
  266. fill_rule: "fill-rule",
  267. filter: "filter",
  268. float: "float",
  269. float_defer_column: "float-defer-column",
  270. float_defer_page: "float-defer-page",
  271. float_offset: "float-offset",
  272. float_wrap: "float-wrap",
  273. flow_into: "flow-into",
  274. flow_from: "flow-from",
  275. flex: "flex",
  276. flex_basis: "flex-basis",
  277. flex_grow: "flex-grow",
  278. flex_shrink: "flex-shrink",
  279. flex_flow: "flex-flow",
  280. flex_direction: "flex-direction",
  281. flex_wrap: "flex-wrap",
  282. flood_color: "flood-color",
  283. flood_opacity: "flood-opacity",
  284. font: "font",
  285. font_family: "font-family",
  286. font_size: "font-size",
  287. font_stretch: "font-stretch",
  288. font_style: "font-style",
  289. font_weight: "font-weight",
  290. font_feature_settings: "font-feature-settings",
  291. font_kerning: "font-kerning",
  292. font_language_override: "font-language-override",
  293. font_size_adjust: "font-size-adjust",
  294. font_synthesis: "font-synthesis",
  295. font_variant: "font-variant",
  296. font_variant_alternates: "font-variant-alternates",
  297. font_variant_caps: "font-variant-caps",
  298. font_variant_east_asian: "font-variant-east-asian",
  299. font_variant_ligatures: "font-variant-ligatures",
  300. font_variant_numeric: "font-variant-numeric",
  301. font_variant_position: "font-variant-position",
  302. footnote_policy: "footnote-policy",
  303. glyph_orientation_horizontal: "glyph-orientation-horizontal",
  304. glyph_orientation_vertical: "glyph-orientation-vertical",
  305. grid: "grid",
  306. grid_auto_flow: "grid-auto-flow",
  307. grid_auto_columns: "grid-auto-columns",
  308. grid_auto_rows: "grid-auto-rows",
  309. grid_template: "grid-template",
  310. grid_template_areas: "grid-template-areas",
  311. grid_template_columns: "grid-template-columns",
  312. grid_template_rows: "grid-template-rows",
  313. grid_area: "grid-area",
  314. grid_column: "grid-column",
  315. grid_column_start: "grid-column-start",
  316. grid_column_end: "grid-column-end",
  317. grid_row: "grid-row",
  318. grid_row_start: "grid-row-start",
  319. grid_row_end: "grid-row-end",
  320. hanging_punctuation: "hanging-punctuation",
  321. height: "height",
  322. hyphenate_character: "hyphenate-character",
  323. hyphenate_limit_chars: "hyphenate-limit-chars",
  324. hyphenate_limit_last: "hyphenate-limit-last",
  325. hyphenate_limit_lines: "hyphenate-limit-lines",
  326. hyphenate_limit_zone: "hyphenate-limit-zone",
  327. hyphens: "hyphens",
  328. icon: "icon",
  329. image_orientation: "image-orientation",
  330. image_resolution: "image-resolution",
  331. image_rendering: "image-rendering",
  332. ime: "ime",
  333. ime_align: "ime-align",
  334. ime_mode: "ime-mode",
  335. ime_offset: "ime-offset",
  336. ime_width: "ime-width",
  337. initial_letters: "initial-letters",
  338. inline_box_align: "inline-box-align",
  339. isolation: "isolation",
  340. justify_content: "justify-content",
  341. justify_items: "justify-items",
  342. justify_self: "justify-self",
  343. kerning: "kerning",
  344. left: "left",
  345. letter_spacing: "letter-spacing",
  346. lighting_color: "lighting-color",
  347. line_box_contain: "line-box-contain",
  348. line_break: "line-break",
  349. line_grid: "line-grid",
  350. line_height: "line-height",
  351. line_slack: "line-slack",
  352. line_snap: "line-snap",
  353. list_style: "list-style",
  354. list_style_image: "list-style-image",
  355. list_style_position: "list-style-position",
  356. list_style_type: "list-style-type",
  357. margin: "margin",
  358. margin_bottom: "margin-bottom",
  359. margin_left: "margin-left",
  360. margin_right: "margin-right",
  361. margin_top: "margin-top",
  362. marker: "marker",
  363. marker_end: "marker-end",
  364. marker_mid: "marker-mid",
  365. marker_pattern: "marker-pattern",
  366. marker_segment: "marker-segment",
  367. marker_start: "marker-start",
  368. marker_knockout_left: "marker-knockout-left",
  369. marker_knockout_right: "marker-knockout-right",
  370. marker_side: "marker-side",
  371. marks: "marks",
  372. marquee_direction: "marquee-direction",
  373. marquee_play_count: "marquee-play-count",
  374. marquee_speed: "marquee-speed",
  375. marquee_style: "marquee-style",
  376. mask: "mask",
  377. mask_image: "mask-image",
  378. mask_repeat: "mask-repeat",
  379. mask_position: "mask-position",
  380. mask_clip: "mask-clip",
  381. mask_origin: "mask-origin",
  382. mask_size: "mask-size",
  383. mask_box: "mask-box",
  384. mask_box_outset: "mask-box-outset",
  385. mask_box_repeat: "mask-box-repeat",
  386. mask_box_slice: "mask-box-slice",
  387. mask_box_source: "mask-box-source",
  388. mask_box_width: "mask-box-width",
  389. mask_type: "mask-type",
  390. max_height: "max-height",
  391. max_lines: "max-lines",
  392. max_width: "max-width",
  393. min_height: "min-height",
  394. min_width: "min-width",
  395. mix_blend_mode: "mix-blend-mode",
  396. nav_down: "nav-down",
  397. nav_index: "nav-index",
  398. nav_left: "nav-left",
  399. nav_right: "nav-right",
  400. nav_up: "nav-up",
  401. object_fit: "object-fit",
  402. object_position: "object-position",
  403. offset_after: "offset-after",
  404. offset_before: "offset-before",
  405. offset_end: "offset-end",
  406. offset_start: "offset-start",
  407. opacity: "opacity",
  408. order: "order",
  409. orphans: "orphans",
  410. outline: "outline",
  411. outline_color: "outline-color",
  412. outline_style: "outline-style",
  413. outline_width: "outline-width",
  414. outline_offset: "outline-offset",
  415. overflow: "overflow",
  416. overflow_x: "overflow-x",
  417. overflow_y: "overflow-y",
  418. overflow_style: "overflow-style",
  419. overflow_wrap: "overflow-wrap",
  420. padding: "padding",
  421. padding_bottom: "padding-bottom",
  422. padding_left: "padding-left",
  423. padding_right: "padding-right",
  424. padding_top: "padding-top",
  425. page: "page",
  426. page_break_after: "page-break-after",
  427. page_break_before: "page-break-before",
  428. page_break_inside: "page-break-inside",
  429. paint_order: "paint-order",
  430. pause: "pause",
  431. pause_after: "pause-after",
  432. pause_before: "pause-before",
  433. perspective: "perspective",
  434. perspective_origin: "perspective-origin",
  435. pitch: "pitch",
  436. pitch_range: "pitch-range",
  437. play_during: "play-during",
  438. pointer_events: "pointer-events",
  439. position: "position",
  440. quotes: "quotes",
  441. region_fragment: "region-fragment",
  442. resize: "resize",
  443. rest: "rest",
  444. rest_after: "rest-after",
  445. rest_before: "rest-before",
  446. richness: "richness",
  447. right: "right",
  448. ruby_align: "ruby-align",
  449. ruby_merge: "ruby-merge",
  450. ruby_position: "ruby-position",
  451. scroll_behavior: "scroll-behavior",
  452. scroll_snap_coordinate: "scroll-snap-coordinate",
  453. scroll_snap_destination: "scroll-snap-destination",
  454. scroll_snap_points_x: "scroll-snap-points-x",
  455. scroll_snap_points_y: "scroll-snap-points-y",
  456. scroll_snap_type: "scroll-snap-type",
  457. shape_image_threshold: "shape-image-threshold",
  458. shape_inside: "shape-inside",
  459. shape_margin: "shape-margin",
  460. shape_outside: "shape-outside",
  461. shape_padding: "shape-padding",
  462. shape_rendering: "shape-rendering",
  463. size: "size",
  464. speak: "speak",
  465. speak_as: "speak-as",
  466. speak_header: "speak-header",
  467. speak_numeral: "speak-numeral",
  468. speak_punctuation: "speak-punctuation",
  469. speech_rate: "speech-rate",
  470. stop_color: "stop-color",
  471. stop_opacity: "stop-opacity",
  472. stress: "stress",
  473. string_set: "string-set",
  474. stroke: "stroke",
  475. stroke_dasharray: "stroke-dasharray",
  476. stroke_dashoffset: "stroke-dashoffset",
  477. stroke_linecap: "stroke-linecap",
  478. stroke_linejoin: "stroke-linejoin",
  479. stroke_miterlimit: "stroke-miterlimit",
  480. stroke_opacity: "stroke-opacity",
  481. stroke_width: "stroke-width",
  482. tab_size: "tab-size",
  483. table_layout: "table-layout",
  484. text_align: "text-align",
  485. text_align_all: "text-align-all",
  486. text_align_last: "text-align-last",
  487. text_anchor: "text-anchor",
  488. text_combine_upright: "text-combine-upright",
  489. text_decoration: "text-decoration",
  490. text_decoration_color: "text-decoration-color",
  491. text_decoration_line: "text-decoration-line",
  492. text_decoration_style: "text-decoration-style",
  493. text_decoration_skip: "text-decoration-skip",
  494. text_emphasis: "text-emphasis",
  495. text_emphasis_color: "text-emphasis-color",
  496. text_emphasis_style: "text-emphasis-style",
  497. text_emphasis_position: "text-emphasis-position",
  498. text_emphasis_skip: "text-emphasis-skip",
  499. text_height: "text-height",
  500. text_indent: "text-indent",
  501. text_justify: "text-justify",
  502. text_orientation: "text-orientation",
  503. text_overflow: "text-overflow",
  504. text_rendering: "text-rendering",
  505. text_shadow: "text-shadow",
  506. text_size_adjust: "text-size-adjust",
  507. text_space_collapse: "text-space-collapse",
  508. text_spacing: "text-spacing",
  509. text_transform: "text-transform",
  510. text_underline_position: "text-underline-position",
  511. text_wrap: "text-wrap",
  512. top: "top",
  513. touch_action: "touch-action",
  514. transform: "transform",
  515. transform_box: "transform-box",
  516. transform_origin: "transform-origin",
  517. transform_style: "transform-style",
  518. transition: "transition",
  519. transition_delay: "transition-delay",
  520. transition_duration: "transition-duration",
  521. transition_property: "transition-property",
  522. unicode_bidi: "unicode-bidi",
  523. vector_effect: "vector-effect",
  524. vertical_align: "vertical-align",
  525. visibility: "visibility",
  526. voice_balance: "voice-balance",
  527. voice_duration: "voice-duration",
  528. voice_family: "voice-family",
  529. voice_pitch: "voice-pitch",
  530. voice_range: "voice-range",
  531. voice_rate: "voice-rate",
  532. voice_stress: "voice-stress",
  533. voice_volumn: "voice-volumn",
  534. volume: "volume",
  535. white_space: "white-space",
  536. widows: "widows",
  537. width: "width",
  538. will_change: "will-change",
  539. word_break: "word-break",
  540. word_spacing: "word-spacing",
  541. word_wrap: "word-wrap",
  542. wrap_flow: "wrap-flow",
  543. wrap_through: "wrap-through",
  544. writing_mode: "writing-mode",
  545. gap: "gap",
  546. list_styler_type: "list-style-type",
  547. row_gap: "row-gap",
  548. transition_timing_function: "transition-timing-function",
  549. user_select: "user-select",
  550. webkit_user_select: "-webkit-user-select",
  551. z_index : "z-index",
  552. }
  553. mapped_trait_methods! {
  554. aria_current: "aria-current",
  555. aria_details: "aria-details",
  556. aria_disabled: "aria-disabled",
  557. aria_hidden: "aria-hidden",
  558. aria_invalid: "aria-invalid",
  559. aria_keyshortcuts: "aria-keyshortcuts",
  560. aria_label: "aria-label",
  561. aria_roledescription: "aria-roledescription",
  562. // Widget Attributes
  563. aria_autocomplete: "aria-autocomplete",
  564. aria_checked: "aria-checked",
  565. aria_expanded: "aria-expanded",
  566. aria_haspopup: "aria-haspopup",
  567. aria_level: "aria-level",
  568. aria_modal: "aria-modal",
  569. aria_multiline: "aria-multiline",
  570. aria_multiselectable: "aria-multiselectable",
  571. aria_orientation: "aria-orientation",
  572. aria_placeholder: "aria-placeholder",
  573. aria_pressed: "aria-pressed",
  574. aria_readonly: "aria-readonly",
  575. aria_required: "aria-required",
  576. aria_selected: "aria-selected",
  577. aria_sort: "aria-sort",
  578. aria_valuemax: "aria-valuemax",
  579. aria_valuemin: "aria-valuemin",
  580. aria_valuenow: "aria-valuenow",
  581. aria_valuetext: "aria-valuetext",
  582. // Live Region Attributes
  583. aria_atomic: "aria-atomic",
  584. aria_busy: "aria-busy",
  585. aria_live: "aria-live",
  586. aria_relevant: "aria-relevant",
  587. aria_dropeffect: "aria-dropeffect",
  588. aria_grabbed: "aria-grabbed",
  589. // Relationship Attributes
  590. aria_activedescendant: "aria-activedescendant",
  591. aria_colcount: "aria-colcount",
  592. aria_colindex: "aria-colindex",
  593. aria_colspan: "aria-colspan",
  594. aria_controls: "aria-controls",
  595. aria_describedby: "aria-describedby",
  596. aria_errormessage: "aria-errormessage",
  597. aria_flowto: "aria-flowto",
  598. aria_labelledby: "aria-labelledby",
  599. aria_owns: "aria-owns",
  600. aria_posinset: "aria-posinset",
  601. aria_rowcount: "aria-rowcount",
  602. aria_rowindex: "aria-rowindex",
  603. aria_rowspan: "aria-rowspan",
  604. aria_setsize: "aria-setsize",
  605. }
  606. pub mod svg {
  607. mapped_trait_methods! {
  608. accent_height: "accent-height",
  609. accumulate: "accumulate",
  610. additive: "additive",
  611. alignment_baseline: "alignment-baseline",
  612. alphabetic: "alphabetic",
  613. amplitude: "amplitude",
  614. arabic_form: "arabic-form",
  615. ascent: "ascent",
  616. attributeName: "attributeName",
  617. attributeType: "attributeType",
  618. azimuth: "azimuth",
  619. baseFrequency: "baseFrequency",
  620. baseline_shift: "baseline-shift",
  621. baseProfile: "baseProfile",
  622. bbox: "bbox",
  623. begin: "begin",
  624. bias: "bias",
  625. by: "by",
  626. calcMode: "calcMode",
  627. cap_height: "cap-height",
  628. class: "class",
  629. clip: "clip",
  630. clipPathUnits: "clipPathUnits",
  631. clip_path: "clip-path",
  632. clip_rule: "clip-rule",
  633. color: "color",
  634. color_interpolation: "color-interpolation",
  635. color_interpolation_filters: "color-interpolation-filters",
  636. color_profile: "color-profile",
  637. color_rendering: "color-rendering",
  638. contentScriptType: "contentScriptType",
  639. contentStyleType: "contentStyleType",
  640. crossorigin: "crossorigin",
  641. cursor: "cursor",
  642. cx: "cx",
  643. cy: "cy",
  644. d: "d",
  645. decelerate: "decelerate",
  646. descent: "descent",
  647. diffuseConstant: "diffuseConstant",
  648. direction: "direction",
  649. display: "display",
  650. divisor: "divisor",
  651. dominant_baseline: "dominant-baseline",
  652. dur: "dur",
  653. dx: "dx",
  654. dy: "dy",
  655. edgeMode: "edgeMode",
  656. elevation: "elevation",
  657. enable_background: "enable-background",
  658. end: "end",
  659. exponent: "exponent",
  660. fill: "fill",
  661. fill_opacity: "fill-opacity",
  662. fill_rule: "fill-rule",
  663. filter: "filter",
  664. filterRes: "filterRes",
  665. filterUnits: "filterUnits",
  666. flood_color: "flood-color",
  667. flood_opacity: "flood-opacity",
  668. font_family: "font-family",
  669. font_size: "font-size",
  670. font_size_adjust: "font-size-adjust",
  671. font_stretch: "font-stretch",
  672. font_style: "font-style",
  673. font_variant: "font-variant",
  674. font_weight: "font-weight",
  675. format: "format",
  676. from: "from",
  677. fr: "fr",
  678. fx: "fx",
  679. fy: "fy",
  680. g1: "g1",
  681. g2: "g2",
  682. glyph_name: "glyph-name",
  683. glyph_orientation_horizontal: "glyph-orientation-horizontal",
  684. glyph_orientation_vertical: "glyph-orientation-vertical",
  685. glyphRef: "glyphRef",
  686. gradientTransform: "gradientTransform",
  687. gradientUnits: "gradientUnits",
  688. hanging: "hanging",
  689. height: "height",
  690. href: "href",
  691. hreflang: "hreflang",
  692. horiz_adv_x: "horiz-adv-x",
  693. horiz_origin_x: "horiz-origin-x",
  694. id: "id",
  695. ideographic: "ideographic",
  696. image_rendering: "image-rendering",
  697. _in: "_in",
  698. in2: "in2",
  699. intercept: "intercept",
  700. k: "k",
  701. k1: "k1",
  702. k2: "k2",
  703. k3: "k3",
  704. k4: "k4",
  705. kernelMatrix: "kernelMatrix",
  706. kernelUnitLength: "kernelUnitLength",
  707. kerning: "kerning",
  708. keyPoints: "keyPoints",
  709. keySplines: "keySplines",
  710. keyTimes: "keyTimes",
  711. lang: "lang",
  712. lengthAdjust: "lengthAdjust",
  713. letter_spacing: "letter-spacing",
  714. lighting_color: "lighting-color",
  715. limitingConeAngle: "limitingConeAngle",
  716. local: "local",
  717. marker_end: "marker-end",
  718. marker_mid: "marker-mid",
  719. marker_start: "marker_start",
  720. markerHeight: "markerHeight",
  721. markerUnits: "markerUnits",
  722. markerWidth: "markerWidth",
  723. mask: "mask",
  724. maskContentUnits: "maskContentUnits",
  725. maskUnits: "maskUnits",
  726. mathematical: "mathematical",
  727. max: "max",
  728. media: "media",
  729. method: "method",
  730. min: "min",
  731. mode: "mode",
  732. name: "name",
  733. numOctaves: "numOctaves",
  734. offset: "offset",
  735. opacity: "opacity",
  736. operator: "operator",
  737. order: "order",
  738. orient: "orient",
  739. orientation: "orientation",
  740. origin: "origin",
  741. overflow: "overflow",
  742. overline_position: "overline-position",
  743. overline_thickness: "overline-thickness",
  744. panose_1: "panose-1",
  745. paint_order: "paint-order",
  746. path: "path",
  747. pathLength: "pathLength",
  748. patternContentUnits: "patternContentUnits",
  749. patternTransform: "patternTransform",
  750. patternUnits: "patternUnits",
  751. ping: "ping",
  752. pointer_events: "pointer-events",
  753. points: "points",
  754. pointsAtX: "pointsAtX",
  755. pointsAtY: "pointsAtY",
  756. pointsAtZ: "pointsAtZ",
  757. preserveAlpha: "preserveAlpha",
  758. preserveAspectRatio: "preserveAspectRatio",
  759. primitiveUnits: "primitiveUnits",
  760. r: "r",
  761. radius: "radius",
  762. referrerPolicy: "referrerPolicy",
  763. refX: "refX",
  764. refY: "refY",
  765. rel: "rel",
  766. rendering_intent: "rendering-intent",
  767. repeatCount: "repeatCount",
  768. repeatDur: "repeatDur",
  769. requiredExtensions: "requiredExtensions",
  770. requiredFeatures: "requiredFeatures",
  771. restart: "restart",
  772. result: "result",
  773. role: "role",
  774. rotate: "rotate",
  775. rx: "rx",
  776. ry: "ry",
  777. scale: "scale",
  778. seed: "seed",
  779. shape_rendering: "shape-rendering",
  780. slope: "slope",
  781. spacing: "spacing",
  782. specularConstant: "specularConstant",
  783. specularExponent: "specularExponent",
  784. speed: "speed",
  785. spreadMethod: "spreadMethod",
  786. startOffset: "startOffset",
  787. stdDeviation: "stdDeviation",
  788. stemh: "stemh",
  789. stemv: "stemv",
  790. stitchTiles: "stitchTiles",
  791. stop_color: "stop_color",
  792. stop_opacity: "stop_opacity",
  793. strikethrough_position: "strikethrough-position",
  794. strikethrough_thickness: "strikethrough-thickness",
  795. string: "string",
  796. stroke: "stroke",
  797. stroke_dasharray: "stroke-dasharray",
  798. stroke_dashoffset: "stroke-dashoffset",
  799. stroke_linecap: "stroke-linecap",
  800. stroke_linejoin: "stroke-linejoin",
  801. stroke_miterlimit: "stroke-miterlimit",
  802. stroke_opacity: "stroke-opacity",
  803. stroke_width: "stroke-width",
  804. style: "style",
  805. surfaceScale: "surfaceScale",
  806. systemLanguage: "systemLanguage",
  807. tabindex: "tabindex",
  808. tableValues: "tableValues",
  809. target: "target",
  810. targetX: "targetX",
  811. targetY: "targetY",
  812. text_anchor: "text-anchor",
  813. text_decoration: "text-decoration",
  814. text_rendering: "text-rendering",
  815. textLength: "textLength",
  816. to: "to",
  817. transform: "transform",
  818. transform_origin: "transform-origin",
  819. r#type: "_type",
  820. u1: "u1",
  821. u2: "u2",
  822. underline_position: "underline-position",
  823. underline_thickness: "underline-thickness",
  824. unicode: "unicode",
  825. unicode_bidi: "unicode-bidi",
  826. unicode_range: "unicode-range",
  827. units_per_em: "units-per-em",
  828. v_alphabetic: "v-alphabetic",
  829. v_hanging: "v-hanging",
  830. v_ideographic: "v-ideographic",
  831. v_mathematical: "v-mathematical",
  832. values: "values",
  833. vector_effect: "vector-effect",
  834. version: "version",
  835. vert_adv_y: "vert-adv-y",
  836. vert_origin_x: "vert-origin-x",
  837. vert_origin_y: "vert-origin-y",
  838. view_box: "viewBox",
  839. view_target: "viewTarget",
  840. visibility: "visibility",
  841. width: "width",
  842. widths: "widths",
  843. word_spacing: "word-spacing",
  844. writing_mode: "writing-mode",
  845. x: "x",
  846. x_height: "x-height",
  847. x1: "x1",
  848. x2: "x2",
  849. xmlns: "xmlns",
  850. x_channel_selector: "xChannelSelector",
  851. y: "y",
  852. y1: "y1",
  853. y2: "y2",
  854. y_channel_selector: "yChannelSelector",
  855. z: "z",
  856. zoomAndPan: "zoomAndPan",
  857. }
  858. }