yass-css 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (429) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +11 -0
  3. data/CODE_OF_CONDUCT.md +132 -0
  4. data/Cargo.lock +1447 -0
  5. data/Cargo.toml +7 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +139 -0
  8. data/Rakefile +130 -0
  9. data/codegen/ruby_module_tree.rb +178 -0
  10. data/codegen/rust_file_set.rb +84 -0
  11. data/codegen/utils.rb +27 -0
  12. data/dockerfiles/windows.dockerfile +3 -0
  13. data/examples/basic_example.rb +32 -0
  14. data/examples/font_example.rb +19 -0
  15. data/examples/media_example.rb +31 -0
  16. data/examples/visitor_example.rb +41 -0
  17. data/ext/.DS_Store +0 -0
  18. data/ext/yass/Cargo.toml +24 -0
  19. data/ext/yass/extconf.rb +6 -0
  20. data/ext/yass/src/.DS_Store +0 -0
  21. data/ext/yass/src/cached_value.rs +48 -0
  22. data/ext/yass/src/cached_value_list.rs +63 -0
  23. data/ext/yass/src/declarations/.DS_Store +0 -0
  24. data/ext/yass/src/declarations/align_content.rs +19 -0
  25. data/ext/yass/src/declarations/align_flags.rs +26 -0
  26. data/ext/yass/src/declarations/align_items.rs +37 -0
  27. data/ext/yass/src/declarations/align_self.rs +19 -0
  28. data/ext/yass/src/declarations/alignment_baseline.rs +27 -0
  29. data/ext/yass/src/declarations/angle.rs +25 -0
  30. data/ext/yass/src/declarations/animation/auto.rs +8 -0
  31. data/ext/yass/src/declarations/animation/init.rs +40 -0
  32. data/ext/yass/src/declarations/animation/inset.rs +50 -0
  33. data/ext/yass/src/declarations/animation/length_auto.rs +8 -0
  34. data/ext/yass/src/declarations/animation/mod.rs +11 -0
  35. data/ext/yass/src/declarations/animation/range_value.rs +47 -0
  36. data/ext/yass/src/declarations/animation/scroll_axis.rs +22 -0
  37. data/ext/yass/src/declarations/animation/scroll_function.rs +40 -0
  38. data/ext/yass/src/declarations/animation/scroller.rs +21 -0
  39. data/ext/yass/src/declarations/animation/timeline_name.rs +16 -0
  40. data/ext/yass/src/declarations/animation/timing_function/cubic_bezier.rs +60 -0
  41. data/ext/yass/src/declarations/animation/timing_function/init.rs +29 -0
  42. data/ext/yass/src/declarations/animation/timing_function/keyword.rs +23 -0
  43. data/ext/yass/src/declarations/animation/timing_function/mod.rs +5 -0
  44. data/ext/yass/src/declarations/animation/timing_function/piecewise_linear_function.rs +49 -0
  45. data/ext/yass/src/declarations/animation/timing_function/steps.rs +30 -0
  46. data/ext/yass/src/declarations/animation/view_function.rs +40 -0
  47. data/ext/yass/src/declarations/animation_composition.rs +29 -0
  48. data/ext/yass/src/declarations/animation_delay.rs +30 -0
  49. data/ext/yass/src/declarations/animation_direction.rs +30 -0
  50. data/ext/yass/src/declarations/animation_duration.rs +67 -0
  51. data/ext/yass/src/declarations/animation_fill_mode.rs +30 -0
  52. data/ext/yass/src/declarations/animation_iteration_count.rs +33 -0
  53. data/ext/yass/src/declarations/animation_name.rs +23 -0
  54. data/ext/yass/src/declarations/animation_play_state.rs +28 -0
  55. data/ext/yass/src/declarations/animation_range_end.rs +30 -0
  56. data/ext/yass/src/declarations/animation_range_start.rs +30 -0
  57. data/ext/yass/src/declarations/animation_timeline.rs +42 -0
  58. data/ext/yass/src/declarations/animation_timing_function.rs +46 -0
  59. data/ext/yass/src/declarations/aspect_ratio.rs +43 -0
  60. data/ext/yass/src/declarations/backdrop_filter.rs +30 -0
  61. data/ext/yass/src/declarations/backface_visibility.rs +20 -0
  62. data/ext/yass/src/declarations/background_attachment.rs +25 -0
  63. data/ext/yass/src/declarations/background_blend_mode.rs +42 -0
  64. data/ext/yass/src/declarations/background_clip.rs +25 -0
  65. data/ext/yass/src/declarations/background_color.rs +30 -0
  66. data/ext/yass/src/declarations/background_image.rs +30 -0
  67. data/ext/yass/src/declarations/background_origin.rs +29 -0
  68. data/ext/yass/src/declarations/background_position_x.rs +30 -0
  69. data/ext/yass/src/declarations/background_position_y.rs +30 -0
  70. data/ext/yass/src/declarations/background_repeat.rs +58 -0
  71. data/ext/yass/src/declarations/background_size.rs +120 -0
  72. data/ext/yass/src/declarations/baseline_shift.rs +63 -0
  73. data/ext/yass/src/declarations/baseline_source.rs +21 -0
  74. data/ext/yass/src/declarations/block_size.rs +30 -0
  75. data/ext/yass/src/declarations/border_block_end_color.rs +30 -0
  76. data/ext/yass/src/declarations/border_block_end_style.rs +19 -0
  77. data/ext/yass/src/declarations/border_block_end_width.rs +24 -0
  78. data/ext/yass/src/declarations/border_block_start_color.rs +30 -0
  79. data/ext/yass/src/declarations/border_block_start_style.rs +19 -0
  80. data/ext/yass/src/declarations/border_block_start_width.rs +24 -0
  81. data/ext/yass/src/declarations/border_bottom_color.rs +30 -0
  82. data/ext/yass/src/declarations/border_bottom_left_radius.rs +40 -0
  83. data/ext/yass/src/declarations/border_bottom_right_radius.rs +40 -0
  84. data/ext/yass/src/declarations/border_bottom_style.rs +19 -0
  85. data/ext/yass/src/declarations/border_bottom_width.rs +24 -0
  86. data/ext/yass/src/declarations/border_collapse.rs +20 -0
  87. data/ext/yass/src/declarations/border_end_end_radius.rs +40 -0
  88. data/ext/yass/src/declarations/border_end_start_radius.rs +40 -0
  89. data/ext/yass/src/declarations/border_image_outset.rs +73 -0
  90. data/ext/yass/src/declarations/border_image_repeat.rs +30 -0
  91. data/ext/yass/src/declarations/border_image_slice.rs +78 -0
  92. data/ext/yass/src/declarations/border_image_source.rs +28 -0
  93. data/ext/yass/src/declarations/border_image_width.rs +85 -0
  94. data/ext/yass/src/declarations/border_inline_end_color.rs +30 -0
  95. data/ext/yass/src/declarations/border_inline_end_style.rs +19 -0
  96. data/ext/yass/src/declarations/border_inline_end_width.rs +24 -0
  97. data/ext/yass/src/declarations/border_inline_start_color.rs +30 -0
  98. data/ext/yass/src/declarations/border_inline_start_style.rs +19 -0
  99. data/ext/yass/src/declarations/border_inline_start_width.rs +24 -0
  100. data/ext/yass/src/declarations/border_left_color.rs +30 -0
  101. data/ext/yass/src/declarations/border_left_style.rs +19 -0
  102. data/ext/yass/src/declarations/border_left_width.rs +24 -0
  103. data/ext/yass/src/declarations/border_right_color.rs +30 -0
  104. data/ext/yass/src/declarations/border_right_style.rs +19 -0
  105. data/ext/yass/src/declarations/border_right_width.rs +24 -0
  106. data/ext/yass/src/declarations/border_spacing.rs +51 -0
  107. data/ext/yass/src/declarations/border_start_end_radius.rs +40 -0
  108. data/ext/yass/src/declarations/border_start_start_radius.rs +40 -0
  109. data/ext/yass/src/declarations/border_style.rs +17 -0
  110. data/ext/yass/src/declarations/border_top_color.rs +30 -0
  111. data/ext/yass/src/declarations/border_top_left_radius.rs +40 -0
  112. data/ext/yass/src/declarations/border_top_right_radius.rs +40 -0
  113. data/ext/yass/src/declarations/border_top_style.rs +19 -0
  114. data/ext/yass/src/declarations/border_top_width.rs +24 -0
  115. data/ext/yass/src/declarations/bottom.rs +28 -0
  116. data/ext/yass/src/declarations/box_shadow.rs +113 -0
  117. data/ext/yass/src/declarations/box_sizing.rs +20 -0
  118. data/ext/yass/src/declarations/calc/abs.rs +32 -0
  119. data/ext/yass/src/declarations/calc/anchor_function.rs +96 -0
  120. data/ext/yass/src/declarations/calc/anchor_size_function.rs +84 -0
  121. data/ext/yass/src/declarations/calc/clamp.rs +58 -0
  122. data/ext/yass/src/declarations/calc/hypot.rs +30 -0
  123. data/ext/yass/src/declarations/calc/init.rs +72 -0
  124. data/ext/yass/src/declarations/calc/invert.rs +32 -0
  125. data/ext/yass/src/declarations/calc/leaf.rs +36 -0
  126. data/ext/yass/src/declarations/calc/min_max.rs +40 -0
  127. data/ext/yass/src/declarations/calc/mod.rs +118 -0
  128. data/ext/yass/src/declarations/calc/mod_rem.rs +57 -0
  129. data/ext/yass/src/declarations/calc/negate.rs +32 -0
  130. data/ext/yass/src/declarations/calc/product.rs +30 -0
  131. data/ext/yass/src/declarations/calc/round.rs +59 -0
  132. data/ext/yass/src/declarations/calc/sign.rs +32 -0
  133. data/ext/yass/src/declarations/calc/sum.rs +30 -0
  134. data/ext/yass/src/declarations/caption_side.rs +20 -0
  135. data/ext/yass/src/declarations/caret_color.rs +32 -0
  136. data/ext/yass/src/declarations/channel_keyword.rs +31 -0
  137. data/ext/yass/src/declarations/clear.rs +24 -0
  138. data/ext/yass/src/declarations/clip.rs +135 -0
  139. data/ext/yass/src/declarations/clip_path/circle_ellipse.rs +168 -0
  140. data/ext/yass/src/declarations/clip_path/init.rs +267 -0
  141. data/ext/yass/src/declarations/clip_path/mod.rs +419 -0
  142. data/ext/yass/src/declarations/clip_path/path.rs +734 -0
  143. data/ext/yass/src/declarations/clip_path/rect.rs +288 -0
  144. data/ext/yass/src/declarations/clip_path/shape.rs +672 -0
  145. data/ext/yass/src/declarations/clip_path/shape_box.rs +71 -0
  146. data/ext/yass/src/declarations/color/absolute.rs +46 -0
  147. data/ext/yass/src/declarations/color/absolute_color.rs +53 -0
  148. data/ext/yass/src/declarations/color/auto.rs +8 -0
  149. data/ext/yass/src/declarations/color/color.rs +38 -0
  150. data/ext/yass/src/declarations/color/color_components.rs +25 -0
  151. data/ext/yass/src/declarations/color/color_function.rs +151 -0
  152. data/ext/yass/src/declarations/color/color_function_component.rs +61 -0
  153. data/ext/yass/src/declarations/color/color_interpolation_method.rs +29 -0
  154. data/ext/yass/src/declarations/color/color_mix.rs +60 -0
  155. data/ext/yass/src/declarations/color/color_mix_item.rs +43 -0
  156. data/ext/yass/src/declarations/color/current_color.rs +8 -0
  157. data/ext/yass/src/declarations/color/init.rs +60 -0
  158. data/ext/yass/src/declarations/color/light_dark.rs +43 -0
  159. data/ext/yass/src/declarations/color/mod.rs +69 -0
  160. data/ext/yass/src/declarations/color/stored_color_function_component.rs +70 -0
  161. data/ext/yass/src/declarations/color/system_color.rs +60 -0
  162. data/ext/yass/src/declarations/color_scheme.rs +26 -0
  163. data/ext/yass/src/declarations/column_count.rs +37 -0
  164. data/ext/yass/src/declarations/column_gap.rs +74 -0
  165. data/ext/yass/src/declarations/column_span.rs +20 -0
  166. data/ext/yass/src/declarations/column_width.rs +70 -0
  167. data/ext/yass/src/declarations/contain.rs +106 -0
  168. data/ext/yass/src/declarations/container_name.rs +32 -0
  169. data/ext/yass/src/declarations/container_type.rs +52 -0
  170. data/ext/yass/src/declarations/content.rs +309 -0
  171. data/ext/yass/src/declarations/counter_increment.rs +60 -0
  172. data/ext/yass/src/declarations/counter_reset.rs +60 -0
  173. data/ext/yass/src/declarations/csswide_keyword.rs +28 -0
  174. data/ext/yass/src/declarations/cursor.rs +125 -0
  175. data/ext/yass/src/declarations/custom.rs +108 -0
  176. data/ext/yass/src/declarations/declaration.rs +716 -0
  177. data/ext/yass/src/declarations/direction.rs +20 -0
  178. data/ext/yass/src/declarations/display.rs +74 -0
  179. data/ext/yass/src/declarations/empty_cells.rs +20 -0
  180. data/ext/yass/src/declarations/filter/blur.rs +28 -0
  181. data/ext/yass/src/declarations/filter/brightness.rs +30 -0
  182. data/ext/yass/src/declarations/filter/contrast.rs +30 -0
  183. data/ext/yass/src/declarations/filter/drop_shadow.rs +68 -0
  184. data/ext/yass/src/declarations/filter/grayscale.rs +30 -0
  185. data/ext/yass/src/declarations/filter/hue_rotate.rs +28 -0
  186. data/ext/yass/src/declarations/filter/init.rs +43 -0
  187. data/ext/yass/src/declarations/filter/invert.rs +30 -0
  188. data/ext/yass/src/declarations/filter/mod.rs +80 -0
  189. data/ext/yass/src/declarations/filter/opacity.rs +30 -0
  190. data/ext/yass/src/declarations/filter/saturate.rs +30 -0
  191. data/ext/yass/src/declarations/filter/sepia.rs +30 -0
  192. data/ext/yass/src/declarations/flex_basis.rs +71 -0
  193. data/ext/yass/src/declarations/flex_direction.rs +22 -0
  194. data/ext/yass/src/declarations/flex_grow.rs +30 -0
  195. data/ext/yass/src/declarations/flex_shrink.rs +30 -0
  196. data/ext/yass/src/declarations/flex_wrap.rs +21 -0
  197. data/ext/yass/src/declarations/float.rs +23 -0
  198. data/ext/yass/src/declarations/font_family.rs +28 -0
  199. data/ext/yass/src/declarations/font_language_override.rs +30 -0
  200. data/ext/yass/src/declarations/font_optical_sizing.rs +20 -0
  201. data/ext/yass/src/declarations/font_size.rs +126 -0
  202. data/ext/yass/src/declarations/font_stretch.rs +102 -0
  203. data/ext/yass/src/declarations/font_style.rs +101 -0
  204. data/ext/yass/src/declarations/font_synthesis_weight.rs +20 -0
  205. data/ext/yass/src/declarations/font_variant_caps.rs +20 -0
  206. data/ext/yass/src/declarations/font_variation_settings.rs +54 -0
  207. data/ext/yass/src/declarations/font_weight.rs +85 -0
  208. data/ext/yass/src/declarations/grid_auto_columns.rs +32 -0
  209. data/ext/yass/src/declarations/grid_auto_flow.rs +35 -0
  210. data/ext/yass/src/declarations/grid_auto_rows.rs +33 -0
  211. data/ext/yass/src/declarations/grid_column_end.rs +39 -0
  212. data/ext/yass/src/declarations/grid_column_start.rs +39 -0
  213. data/ext/yass/src/declarations/grid_row_end.rs +39 -0
  214. data/ext/yass/src/declarations/grid_row_start.rs +39 -0
  215. data/ext/yass/src/declarations/grid_template.rs +355 -0
  216. data/ext/yass/src/declarations/grid_template_areas.rs +131 -0
  217. data/ext/yass/src/declarations/grid_template_columns.rs +31 -0
  218. data/ext/yass/src/declarations/grid_template_rows.rs +31 -0
  219. data/ext/yass/src/declarations/height.rs +30 -0
  220. data/ext/yass/src/declarations/horizontal_position_component.rs +93 -0
  221. data/ext/yass/src/declarations/image_rendering.rs +21 -0
  222. data/ext/yass/src/declarations/images/angle_or_percentage.rs +35 -0
  223. data/ext/yass/src/declarations/images/circle.rs +72 -0
  224. data/ext/yass/src/declarations/images/conic_gradient.rs +80 -0
  225. data/ext/yass/src/declarations/images/cross_fade.rs +33 -0
  226. data/ext/yass/src/declarations/images/cross_fade_element.rs +44 -0
  227. data/ext/yass/src/declarations/images/cross_fade_image.rs +68 -0
  228. data/ext/yass/src/declarations/images/ellipse.rs +67 -0
  229. data/ext/yass/src/declarations/images/ending_shape.rs +38 -0
  230. data/ext/yass/src/declarations/images/gradient_angle_or_percentage_item.rs +103 -0
  231. data/ext/yass/src/declarations/images/gradient_length_percentage_item.rs +106 -0
  232. data/ext/yass/src/declarations/images/image_set.rs +30 -0
  233. data/ext/yass/src/declarations/images/image_set_item.rs +53 -0
  234. data/ext/yass/src/declarations/images/init.rs +145 -0
  235. data/ext/yass/src/declarations/images/light_dark.rs +40 -0
  236. data/ext/yass/src/declarations/images/line_direction.rs +100 -0
  237. data/ext/yass/src/declarations/images/linear_gradient.rs +75 -0
  238. data/ext/yass/src/declarations/images/mod.rs +93 -0
  239. data/ext/yass/src/declarations/images/none.rs +8 -0
  240. data/ext/yass/src/declarations/images/position.rs +40 -0
  241. data/ext/yass/src/declarations/images/radial_gradient.rs +86 -0
  242. data/ext/yass/src/declarations/images/url.rs +28 -0
  243. data/ext/yass/src/declarations/init.rs +1620 -0
  244. data/ext/yass/src/declarations/inline_size.rs +30 -0
  245. data/ext/yass/src/declarations/inset.rs +114 -0
  246. data/ext/yass/src/declarations/inset_block_end.rs +28 -0
  247. data/ext/yass/src/declarations/inset_block_start.rs +28 -0
  248. data/ext/yass/src/declarations/inset_inline_end.rs +28 -0
  249. data/ext/yass/src/declarations/inset_inline_start.rs +28 -0
  250. data/ext/yass/src/declarations/isolation.rs +20 -0
  251. data/ext/yass/src/declarations/justify_content.rs +19 -0
  252. data/ext/yass/src/declarations/justify_items.rs +37 -0
  253. data/ext/yass/src/declarations/justify_self.rs +19 -0
  254. data/ext/yass/src/declarations/left.rs +28 -0
  255. data/ext/yass/src/declarations/length.rs +230 -0
  256. data/ext/yass/src/declarations/letter_spacing.rs +47 -0
  257. data/ext/yass/src/declarations/line_break.rs +23 -0
  258. data/ext/yass/src/declarations/line_height.rs +51 -0
  259. data/ext/yass/src/declarations/list_style_image.rs +28 -0
  260. data/ext/yass/src/declarations/list_style_position.rs +20 -0
  261. data/ext/yass/src/declarations/list_style_type.rs +132 -0
  262. data/ext/yass/src/declarations/margin.rs +103 -0
  263. data/ext/yass/src/declarations/margin_block_end.rs +28 -0
  264. data/ext/yass/src/declarations/margin_block_start.rs +28 -0
  265. data/ext/yass/src/declarations/margin_bottom.rs +28 -0
  266. data/ext/yass/src/declarations/margin_inline_end.rs +28 -0
  267. data/ext/yass/src/declarations/margin_inline_start.rs +28 -0
  268. data/ext/yass/src/declarations/margin_left.rs +28 -0
  269. data/ext/yass/src/declarations/margin_right.rs +28 -0
  270. data/ext/yass/src/declarations/margin_top.rs +28 -0
  271. data/ext/yass/src/declarations/mask_image.rs +30 -0
  272. data/ext/yass/src/declarations/max_block_size.rs +30 -0
  273. data/ext/yass/src/declarations/max_height.rs +30 -0
  274. data/ext/yass/src/declarations/max_inline_size.rs +30 -0
  275. data/ext/yass/src/declarations/max_width.rs +30 -0
  276. data/ext/yass/src/declarations/min_block_size.rs +30 -0
  277. data/ext/yass/src/declarations/min_height.rs +30 -0
  278. data/ext/yass/src/declarations/min_inline_size.rs +30 -0
  279. data/ext/yass/src/declarations/min_width.rs +30 -0
  280. data/ext/yass/src/declarations/mix_blend_mode.rs +35 -0
  281. data/ext/yass/src/declarations/mod.rs +257 -0
  282. data/ext/yass/src/declarations/number.rs +16 -0
  283. data/ext/yass/src/declarations/object_fit.rs +23 -0
  284. data/ext/yass/src/declarations/object_position.rs +40 -0
  285. data/ext/yass/src/declarations/offset_path.rs +275 -0
  286. data/ext/yass/src/declarations/opacity.rs +39 -0
  287. data/ext/yass/src/declarations/order.rs +17 -0
  288. data/ext/yass/src/declarations/outline_color.rs +30 -0
  289. data/ext/yass/src/declarations/outline_offset.rs +22 -0
  290. data/ext/yass/src/declarations/outline_style.rs +22 -0
  291. data/ext/yass/src/declarations/outline_width.rs +24 -0
  292. data/ext/yass/src/declarations/overflow.rs +12 -0
  293. data/ext/yass/src/declarations/overflow_block.rs +19 -0
  294. data/ext/yass/src/declarations/overflow_clip_margin.rs +40 -0
  295. data/ext/yass/src/declarations/overflow_inline.rs +19 -0
  296. data/ext/yass/src/declarations/overflow_wrap.rs +21 -0
  297. data/ext/yass/src/declarations/overflow_x.rs +19 -0
  298. data/ext/yass/src/declarations/overflow_y.rs +19 -0
  299. data/ext/yass/src/declarations/padding_block_end.rs +30 -0
  300. data/ext/yass/src/declarations/padding_block_start.rs +30 -0
  301. data/ext/yass/src/declarations/padding_bottom.rs +30 -0
  302. data/ext/yass/src/declarations/padding_inline_end.rs +30 -0
  303. data/ext/yass/src/declarations/padding_inline_start.rs +30 -0
  304. data/ext/yass/src/declarations/padding_left.rs +30 -0
  305. data/ext/yass/src/declarations/padding_right.rs +30 -0
  306. data/ext/yass/src/declarations/padding_top.rs +30 -0
  307. data/ext/yass/src/declarations/percentage.rs +16 -0
  308. data/ext/yass/src/declarations/perspective.rs +72 -0
  309. data/ext/yass/src/declarations/perspective_origin.rs +41 -0
  310. data/ext/yass/src/declarations/pointer_events.rs +20 -0
  311. data/ext/yass/src/declarations/position.rs +23 -0
  312. data/ext/yass/src/declarations/position_area.rs +82 -0
  313. data/ext/yass/src/declarations/position_try_fallbacks.rs +175 -0
  314. data/ext/yass/src/declarations/quotes.rs +107 -0
  315. data/ext/yass/src/declarations/resolution.rs +17 -0
  316. data/ext/yass/src/declarations/right.rs +28 -0
  317. data/ext/yass/src/declarations/rotate.rs +103 -0
  318. data/ext/yass/src/declarations/row_gap.rs +74 -0
  319. data/ext/yass/src/declarations/scale.rs +90 -0
  320. data/ext/yass/src/declarations/servo_overflow_clip_box.rs +20 -0
  321. data/ext/yass/src/declarations/servo_top_layer.rs +20 -0
  322. data/ext/yass/src/declarations/size/anchor_max_size_function.rs +53 -0
  323. data/ext/yass/src/declarations/size/anchor_size_function.rs +56 -0
  324. data/ext/yass/src/declarations/size/anchor_size_keyword.rs +25 -0
  325. data/ext/yass/src/declarations/size/init.rs +45 -0
  326. data/ext/yass/src/declarations/size/mod.rs +227 -0
  327. data/ext/yass/src/declarations/table_layout.rs +20 -0
  328. data/ext/yass/src/declarations/text_align.rs +31 -0
  329. data/ext/yass/src/declarations/text_align_last.rs +25 -0
  330. data/ext/yass/src/declarations/text_decoration_color.rs +30 -0
  331. data/ext/yass/src/declarations/text_decoration_line.rs +77 -0
  332. data/ext/yass/src/declarations/text_decoration_style.rs +24 -0
  333. data/ext/yass/src/declarations/text_indent.rs +40 -0
  334. data/ext/yass/src/declarations/text_justify.rs +22 -0
  335. data/ext/yass/src/declarations/text_overflow.rs +86 -0
  336. data/ext/yass/src/declarations/text_rendering.rs +22 -0
  337. data/ext/yass/src/declarations/text_shadow.rs +98 -0
  338. data/ext/yass/src/declarations/text_transform.rs +50 -0
  339. data/ext/yass/src/declarations/text_wrap_mode.rs +20 -0
  340. data/ext/yass/src/declarations/time.rs +21 -0
  341. data/ext/yass/src/declarations/top.rs +28 -0
  342. data/ext/yass/src/declarations/track_breadth.rs +88 -0
  343. data/ext/yass/src/declarations/track_size.rs +71 -0
  344. data/ext/yass/src/declarations/transform.rs +844 -0
  345. data/ext/yass/src/declarations/transform_origin.rs +99 -0
  346. data/ext/yass/src/declarations/transform_style.rs +20 -0
  347. data/ext/yass/src/declarations/transition_behavior.rs +28 -0
  348. data/ext/yass/src/declarations/transition_delay.rs +30 -0
  349. data/ext/yass/src/declarations/transition_duration.rs +30 -0
  350. data/ext/yass/src/declarations/transition_property.rs +122 -0
  351. data/ext/yass/src/declarations/transition_timing_function.rs +46 -0
  352. data/ext/yass/src/declarations/translate.rs +84 -0
  353. data/ext/yass/src/declarations/unicode_bidi.rs +24 -0
  354. data/ext/yass/src/declarations/vertical_position_component.rs +93 -0
  355. data/ext/yass/src/declarations/view_transition_class.rs +31 -0
  356. data/ext/yass/src/declarations/view_transition_name.rs +18 -0
  357. data/ext/yass/src/declarations/visibility.rs +21 -0
  358. data/ext/yass/src/declarations/webkit_text_security.rs +22 -0
  359. data/ext/yass/src/declarations/white_space_collapse.rs +22 -0
  360. data/ext/yass/src/declarations/width.rs +30 -0
  361. data/ext/yass/src/declarations/will_change.rs +83 -0
  362. data/ext/yass/src/declarations/with_variables.rs +35 -0
  363. data/ext/yass/src/declarations/word_break.rs +21 -0
  364. data/ext/yass/src/declarations/word_spacing.rs +47 -0
  365. data/ext/yass/src/declarations/writing_mode.rs +21 -0
  366. data/ext/yass/src/declarations/xlang.rs +21 -0
  367. data/ext/yass/src/declarations/zindex.rs +61 -0
  368. data/ext/yass/src/declarations/zoom.rs +87 -0
  369. data/ext/yass/src/general/init.rs +15 -0
  370. data/ext/yass/src/general/mod.rs +43 -0
  371. data/ext/yass/src/lib.rs +72 -0
  372. data/ext/yass/src/optional_cached_value.rs +33 -0
  373. data/ext/yass/src/rules/font_face_rule.rs +206 -0
  374. data/ext/yass/src/rules/fonts/family.rs +98 -0
  375. data/ext/yass/src/rules/fonts/init.rs +81 -0
  376. data/ext/yass/src/rules/fonts/metrics.rs +26 -0
  377. data/ext/yass/src/rules/fonts/mod.rs +7 -0
  378. data/ext/yass/src/rules/fonts/source.rs +126 -0
  379. data/ext/yass/src/rules/fonts/stretch.rs +96 -0
  380. data/ext/yass/src/rules/fonts/style.rs +59 -0
  381. data/ext/yass/src/rules/fonts/weight.rs +74 -0
  382. data/ext/yass/src/rules/init.rs +89 -0
  383. data/ext/yass/src/rules/media_rule.rs +474 -0
  384. data/ext/yass/src/rules/mod.rs +6 -0
  385. data/ext/yass/src/rules/rule.rs +33 -0
  386. data/ext/yass/src/rules/style_rule.rs +82 -0
  387. data/ext/yass/src/selectors/an_plus_b.rs +21 -0
  388. data/ext/yass/src/selectors/attribute_in_no_namespace.rs +34 -0
  389. data/ext/yass/src/selectors/attribute_in_no_namespace_exists.rs +16 -0
  390. data/ext/yass/src/selectors/attribute_other.rs +41 -0
  391. data/ext/yass/src/selectors/class.rs +16 -0
  392. data/ext/yass/src/selectors/combinator.rs +49 -0
  393. data/ext/yass/src/selectors/default_namespace.rs +16 -0
  394. data/ext/yass/src/selectors/has.rs +31 -0
  395. data/ext/yass/src/selectors/host.rs +35 -0
  396. data/ext/yass/src/selectors/id.rs +16 -0
  397. data/ext/yass/src/selectors/init.rs +146 -0
  398. data/ext/yass/src/selectors/is.rs +27 -0
  399. data/ext/yass/src/selectors/local_name.rs +18 -0
  400. data/ext/yass/src/selectors/mod.rs +54 -0
  401. data/ext/yass/src/selectors/namespace.rs +21 -0
  402. data/ext/yass/src/selectors/negation.rs +27 -0
  403. data/ext/yass/src/selectors/non_ts_pseudo_class.rs +63 -0
  404. data/ext/yass/src/selectors/nth.rs +51 -0
  405. data/ext/yass/src/selectors/nth_of.rs +43 -0
  406. data/ext/yass/src/selectors/part.rs +22 -0
  407. data/ext/yass/src/selectors/relative_selector.rs +40 -0
  408. data/ext/yass/src/selectors/selector.rs +230 -0
  409. data/ext/yass/src/selectors/selector_child.rs +460 -0
  410. data/ext/yass/src/selectors/selector_list.rs +27 -0
  411. data/ext/yass/src/selectors/slotted.rs +28 -0
  412. data/ext/yass/src/selectors/specific_namespace_constraint.rs +21 -0
  413. data/ext/yass/src/selectors/unit_selectors.rs +87 -0
  414. data/ext/yass/src/selectors/where.rs +27 -0
  415. data/ext/yass/src/sheet.rs +42 -0
  416. data/ext/yass/src/utils.rs +9 -0
  417. data/lib/yass/declarations.rb +7975 -0
  418. data/lib/yass/general.rb +31 -0
  419. data/lib/yass/node.rb +9 -0
  420. data/lib/yass/rules.rb +515 -0
  421. data/lib/yass/selectors.rb +325 -0
  422. data/lib/yass/stylesheet.rb +13 -0
  423. data/lib/yass/version.rb +5 -0
  424. data/lib/yass/visitor.rb +2463 -0
  425. data/lib/yass.rb +49 -0
  426. data/scripts/build_all.sh +44 -0
  427. data/scripts/detect.rb +39 -0
  428. data/scripts/wpt.rb +20 -0
  429. metadata +486 -0
@@ -0,0 +1,734 @@
1
+ use super::*;
2
+
3
+ #[derive(TypedData)]
4
+ #[magnus(class = "Yass::Declarations::ClipPath::Polygon", mark)]
5
+ pub struct YClipPathPolygon {
6
+ fill: FillRule,
7
+ coordinates: CachedValueList<PolygonCoord<LengthPercentage>>,
8
+ }
9
+
10
+ impl YClipPathPolygon {
11
+ pub fn new(polygon: style::values::generics::basic_shape::Polygon<LengthPercentage>) -> Self {
12
+ Self {
13
+ fill: polygon.fill,
14
+ coordinates: CachedValueList::new(polygon.coordinates.to_vec(), |coord, _ctx, ruby| {
15
+ YClipPathPolygonCoord::new(coord.clone()).into_value_with(ruby)
16
+ }),
17
+ }
18
+ }
19
+
20
+ pub fn fill(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Id {
21
+ fill_rule_to_id(rb_self.fill, ruby)
22
+ }
23
+
24
+ pub fn coordinates(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Result<RArray, Error> {
25
+ rb_self.coordinates.to_a(ruby)
26
+ }
27
+ }
28
+
29
+ impl DataTypeFunctions for YClipPathPolygon {
30
+ fn mark(&self, marker: &gc::Marker) {
31
+ self.coordinates.mark(marker);
32
+ }
33
+ }
34
+
35
+ #[derive(TypedData)]
36
+ #[magnus(class = "Yass::Declarations::ClipPath::PolygonCoord", mark)]
37
+ pub struct YClipPathPolygonCoord {
38
+ x: CachedValue<LengthPercentage>,
39
+ y: CachedValue<LengthPercentage>,
40
+ }
41
+
42
+ impl YClipPathPolygonCoord {
43
+ pub fn new(coord: PolygonCoord<LengthPercentage>) -> Self {
44
+ Self {
45
+ x: CachedValue::new(coord.0, |value, ruby| {
46
+ length_percentage_to_value(value, ruby)
47
+ }),
48
+
49
+ y: CachedValue::new(coord.1, |value, ruby| {
50
+ length_percentage_to_value(value, ruby)
51
+ }),
52
+ }
53
+ }
54
+
55
+ pub fn x(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
56
+ rb_self.x.get(ruby)
57
+ }
58
+
59
+ pub fn y(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
60
+ rb_self.y.get(ruby)
61
+ }
62
+ }
63
+
64
+ impl DataTypeFunctions for YClipPathPolygonCoord {
65
+ fn mark(&self, marker: &gc::Marker) {
66
+ self.x.mark(marker);
67
+ self.y.mark(marker);
68
+ }
69
+ }
70
+
71
+ #[derive(TypedData)]
72
+ #[magnus(class = "Yass::Declarations::ClipPath::PathOrShape", mark)]
73
+ pub struct YClipPathPathOrShape {
74
+ value: CachedValue<ClipPathPathOrShape>,
75
+ }
76
+
77
+ impl YClipPathPathOrShape {
78
+ pub fn new(path_or_shape: ClipPathPathOrShape) -> Self {
79
+ Self {
80
+ value: CachedValue::new(path_or_shape, make_basic_shape_path_or_shape),
81
+ }
82
+ }
83
+
84
+ pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
85
+ rb_self.value.get(ruby)
86
+ }
87
+ }
88
+
89
+ impl DataTypeFunctions for YClipPathPathOrShape {
90
+ fn mark(&self, marker: &gc::Marker) {
91
+ self.value.mark(marker);
92
+ }
93
+ }
94
+
95
+ #[derive(TypedData)]
96
+ #[magnus(class = "Yass::Declarations::ClipPath::PathFunction", mark)]
97
+ pub struct YClipPathPathFunction {
98
+ fill: FillRule,
99
+ commands: CachedValueList<PathCommand>,
100
+ }
101
+
102
+ impl YClipPathPathFunction {
103
+ pub fn new(path: style::values::generics::basic_shape::Path) -> Self {
104
+ Self {
105
+ fill: path.fill,
106
+ commands: CachedValueList::new(path.path.commands().to_vec(), |command, _ctx, ruby| {
107
+ make_path_command(command, ruby)
108
+ }),
109
+ }
110
+ }
111
+
112
+ pub fn fill(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Id {
113
+ fill_rule_to_id(rb_self.fill, ruby)
114
+ }
115
+
116
+ pub fn commands(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Result<RArray, Error> {
117
+ rb_self.commands.to_a(ruby)
118
+ }
119
+ }
120
+
121
+ impl DataTypeFunctions for YClipPathPathFunction {
122
+ fn mark(&self, marker: &gc::Marker) {
123
+ self.commands.mark(marker);
124
+ }
125
+ }
126
+
127
+ fn make_path_command_value(command: &PathCommand, ruby: &Ruby) -> Value {
128
+ match command {
129
+ PathCommand::Move { point } => {
130
+ YClipPathPathCommandMove::new(*point).into_value_with(ruby)
131
+ }
132
+ PathCommand::Line { point } => {
133
+ YClipPathPathCommandLine::new(*point).into_value_with(ruby)
134
+ }
135
+ PathCommand::HLine { x } => {
136
+ YClipPathPathCommandHLine::new(*x).into_value_with(ruby)
137
+ }
138
+ PathCommand::VLine { y } => {
139
+ YClipPathPathCommandVLine::new(*y).into_value_with(ruby)
140
+ }
141
+ PathCommand::CubicCurve {
142
+ control1,
143
+ control2,
144
+ point,
145
+ } => YClipPathPathCommandCubicCurve::new(*control1, *control2, *point).into_value_with(ruby),
146
+ PathCommand::QuadCurve { control1, point } => {
147
+ YClipPathPathCommandQuadCurve::new(*control1, *point).into_value_with(ruby)
148
+ }
149
+ PathCommand::SmoothCubic { control2, point } => {
150
+ YClipPathPathCommandSmoothCubic::new(*control2, *point).into_value_with(ruby)
151
+ }
152
+ PathCommand::SmoothQuad { point } => {
153
+ YClipPathPathCommandSmoothQuad::new(*point).into_value_with(ruby)
154
+ }
155
+ PathCommand::Arc {
156
+ radii,
157
+ arc_sweep,
158
+ arc_size,
159
+ rotate,
160
+ point,
161
+ } => YClipPathPathCommandArc::new(*radii, *arc_sweep, *arc_size, *rotate, *point)
162
+ .into_value_with(ruby),
163
+ PathCommand::Close => YClipPathPathCommandClose::new().into_value_with(ruby),
164
+ }
165
+ }
166
+
167
+ #[derive(TypedData)]
168
+ #[magnus(class = "Yass::Declarations::ClipPath::PathCommand", mark)]
169
+ pub struct YClipPathPathCommand {
170
+ value: CachedValue<PathCommand>,
171
+ }
172
+
173
+ impl YClipPathPathCommand {
174
+ pub fn new(command: PathCommand) -> Self {
175
+ Self {
176
+ value: CachedValue::new(command, make_path_command_value),
177
+ }
178
+ }
179
+
180
+ pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
181
+ rb_self.value.get(ruby)
182
+ }
183
+ }
184
+
185
+ impl DataTypeFunctions for YClipPathPathCommand {
186
+ fn mark(&self, marker: &gc::Marker) {
187
+ self.value.mark(marker);
188
+ }
189
+ }
190
+
191
+ #[derive(TypedData)]
192
+ #[magnus(class = "Yass::Declarations::ClipPath::PathCommandMove", mark)]
193
+ pub struct YClipPathPathCommandMove {
194
+ point: CachedValue<ClipPathPathCommandEndPoint>,
195
+ }
196
+
197
+ impl YClipPathPathCommandMove {
198
+ pub fn new(point: ClipPathPathCommandEndPoint) -> Self {
199
+ Self {
200
+ point: CachedValue::new(point, make_path_command_end_point),
201
+ }
202
+ }
203
+
204
+ pub fn point(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
205
+ rb_self.point.get(ruby)
206
+ }
207
+ }
208
+
209
+ impl DataTypeFunctions for YClipPathPathCommandMove {
210
+ fn mark(&self, marker: &gc::Marker) {
211
+ self.point.mark(marker);
212
+ }
213
+ }
214
+
215
+ #[derive(TypedData)]
216
+ #[magnus(class = "Yass::Declarations::ClipPath::PathCommandLine", mark)]
217
+ pub struct YClipPathPathCommandLine {
218
+ point: CachedValue<ClipPathPathCommandEndPoint>,
219
+ }
220
+
221
+ impl YClipPathPathCommandLine {
222
+ pub fn new(point: ClipPathPathCommandEndPoint) -> Self {
223
+ Self {
224
+ point: CachedValue::new(point, make_path_command_end_point),
225
+ }
226
+ }
227
+
228
+ pub fn point(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
229
+ rb_self.point.get(ruby)
230
+ }
231
+ }
232
+
233
+ impl DataTypeFunctions for YClipPathPathCommandLine {
234
+ fn mark(&self, marker: &gc::Marker) {
235
+ self.point.mark(marker);
236
+ }
237
+ }
238
+
239
+ #[derive(TypedData)]
240
+ #[magnus(class = "Yass::Declarations::ClipPath::PathCommandHLine", mark)]
241
+ pub struct YClipPathPathCommandHLine {
242
+ x: CachedValue<ClipPathPathAxisEndPoint>,
243
+ }
244
+
245
+ impl YClipPathPathCommandHLine {
246
+ pub fn new(x: ClipPathPathAxisEndPoint) -> Self {
247
+ Self {
248
+ x: CachedValue::new(x, make_path_axis_end_point),
249
+ }
250
+ }
251
+
252
+ pub fn x(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
253
+ rb_self.x.get(ruby)
254
+ }
255
+ }
256
+
257
+ impl DataTypeFunctions for YClipPathPathCommandHLine {
258
+ fn mark(&self, marker: &gc::Marker) {
259
+ self.x.mark(marker);
260
+ }
261
+ }
262
+
263
+ #[derive(TypedData)]
264
+ #[magnus(class = "Yass::Declarations::ClipPath::PathCommandVLine", mark)]
265
+ pub struct YClipPathPathCommandVLine {
266
+ y: CachedValue<ClipPathPathAxisEndPoint>,
267
+ }
268
+
269
+ impl YClipPathPathCommandVLine {
270
+ pub fn new(y: ClipPathPathAxisEndPoint) -> Self {
271
+ Self {
272
+ y: CachedValue::new(y, make_path_axis_end_point),
273
+ }
274
+ }
275
+
276
+ pub fn y(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
277
+ rb_self.y.get(ruby)
278
+ }
279
+ }
280
+
281
+ impl DataTypeFunctions for YClipPathPathCommandVLine {
282
+ fn mark(&self, marker: &gc::Marker) {
283
+ self.y.mark(marker);
284
+ }
285
+ }
286
+
287
+ #[derive(TypedData)]
288
+ #[magnus(class = "Yass::Declarations::ClipPath::PathCommandCubicCurve", mark)]
289
+ pub struct YClipPathPathCommandCubicCurve {
290
+ control1: CachedValue<ClipPathPathControlPoint>,
291
+ control2: CachedValue<ClipPathPathControlPoint>,
292
+ point: CachedValue<ClipPathPathCommandEndPoint>,
293
+ }
294
+
295
+ impl YClipPathPathCommandCubicCurve {
296
+ pub fn new(
297
+ control1: ClipPathPathControlPoint,
298
+ control2: ClipPathPathControlPoint,
299
+ point: ClipPathPathCommandEndPoint,
300
+ ) -> Self {
301
+ Self {
302
+ control1: CachedValue::new(control1, make_path_control_point),
303
+ control2: CachedValue::new(control2, make_path_control_point),
304
+ point: CachedValue::new(point, make_path_command_end_point),
305
+ }
306
+ }
307
+
308
+ pub fn control1(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
309
+ rb_self.control1.get(ruby)
310
+ }
311
+
312
+ pub fn control2(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
313
+ rb_self.control2.get(ruby)
314
+ }
315
+
316
+ pub fn point(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
317
+ rb_self.point.get(ruby)
318
+ }
319
+ }
320
+
321
+ impl DataTypeFunctions for YClipPathPathCommandCubicCurve {
322
+ fn mark(&self, marker: &gc::Marker) {
323
+ self.control1.mark(marker);
324
+ self.control2.mark(marker);
325
+ self.point.mark(marker);
326
+ }
327
+ }
328
+
329
+ #[derive(TypedData)]
330
+ #[magnus(class = "Yass::Declarations::ClipPath::PathCommandQuadCurve", mark)]
331
+ pub struct YClipPathPathCommandQuadCurve {
332
+ control1: CachedValue<ClipPathPathControlPoint>,
333
+ point: CachedValue<ClipPathPathCommandEndPoint>,
334
+ }
335
+
336
+ impl YClipPathPathCommandQuadCurve {
337
+ pub fn new(control1: ClipPathPathControlPoint, point: ClipPathPathCommandEndPoint) -> Self {
338
+ Self {
339
+ control1: CachedValue::new(control1, make_path_control_point),
340
+ point: CachedValue::new(point, make_path_command_end_point),
341
+ }
342
+ }
343
+
344
+ pub fn control1(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
345
+ rb_self.control1.get(ruby)
346
+ }
347
+
348
+ pub fn point(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
349
+ rb_self.point.get(ruby)
350
+ }
351
+ }
352
+
353
+ impl DataTypeFunctions for YClipPathPathCommandQuadCurve {
354
+ fn mark(&self, marker: &gc::Marker) {
355
+ self.control1.mark(marker);
356
+ self.point.mark(marker);
357
+ }
358
+ }
359
+
360
+ #[derive(TypedData)]
361
+ #[magnus(class = "Yass::Declarations::ClipPath::PathCommandSmoothCubic", mark)]
362
+ pub struct YClipPathPathCommandSmoothCubic {
363
+ control2: CachedValue<ClipPathPathControlPoint>,
364
+ point: CachedValue<ClipPathPathCommandEndPoint>,
365
+ }
366
+
367
+ impl YClipPathPathCommandSmoothCubic {
368
+ pub fn new(control2: ClipPathPathControlPoint, point: ClipPathPathCommandEndPoint) -> Self {
369
+ Self {
370
+ control2: CachedValue::new(control2, make_path_control_point),
371
+ point: CachedValue::new(point, make_path_command_end_point),
372
+ }
373
+ }
374
+
375
+ pub fn control2(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
376
+ rb_self.control2.get(ruby)
377
+ }
378
+
379
+ pub fn point(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
380
+ rb_self.point.get(ruby)
381
+ }
382
+ }
383
+
384
+ impl DataTypeFunctions for YClipPathPathCommandSmoothCubic {
385
+ fn mark(&self, marker: &gc::Marker) {
386
+ self.control2.mark(marker);
387
+ self.point.mark(marker);
388
+ }
389
+ }
390
+
391
+ #[derive(TypedData)]
392
+ #[magnus(class = "Yass::Declarations::ClipPath::PathCommandSmoothQuad", mark)]
393
+ pub struct YClipPathPathCommandSmoothQuad {
394
+ point: CachedValue<ClipPathPathCommandEndPoint>,
395
+ }
396
+
397
+ impl YClipPathPathCommandSmoothQuad {
398
+ pub fn new(point: ClipPathPathCommandEndPoint) -> Self {
399
+ Self {
400
+ point: CachedValue::new(point, make_path_command_end_point),
401
+ }
402
+ }
403
+
404
+ pub fn point(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
405
+ rb_self.point.get(ruby)
406
+ }
407
+ }
408
+
409
+ impl DataTypeFunctions for YClipPathPathCommandSmoothQuad {
410
+ fn mark(&self, marker: &gc::Marker) {
411
+ self.point.mark(marker);
412
+ }
413
+ }
414
+
415
+ #[derive(TypedData)]
416
+ #[magnus(class = "Yass::Declarations::ClipPath::PathCommandArc", mark)]
417
+ pub struct YClipPathPathCommandArc {
418
+ radii: CachedValue<ClipPathPathArcRadii>,
419
+ arc_sweep: ArcSweep,
420
+ arc_size: ArcSize,
421
+ rotate: CachedValue<style::values::CSSFloat>,
422
+ point: CachedValue<ClipPathPathCommandEndPoint>,
423
+ }
424
+
425
+ impl YClipPathPathCommandArc {
426
+ pub fn new(
427
+ radii: ClipPathPathArcRadii,
428
+ arc_sweep: ArcSweep,
429
+ arc_size: ArcSize,
430
+ rotate: style::values::CSSFloat,
431
+ point: ClipPathPathCommandEndPoint,
432
+ ) -> Self {
433
+ Self {
434
+ radii: CachedValue::new(radii, make_path_arc_radii),
435
+ arc_sweep,
436
+ arc_size,
437
+ rotate: CachedValue::new(rotate, |rotate, ruby| {
438
+ YNumber::new(*rotate).into_value_with(ruby)
439
+ }),
440
+ point: CachedValue::new(point, make_path_command_end_point),
441
+ }
442
+ }
443
+
444
+ pub fn radii(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
445
+ rb_self.radii.get(ruby)
446
+ }
447
+
448
+ pub fn arc_sweep(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Id {
449
+ arc_sweep_to_id(rb_self.arc_sweep, ruby)
450
+ }
451
+
452
+ pub fn arc_size(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Id {
453
+ arc_size_to_id(rb_self.arc_size, ruby)
454
+ }
455
+
456
+ pub fn rotate(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
457
+ rb_self.rotate.get(ruby)
458
+ }
459
+
460
+ pub fn point(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
461
+ rb_self.point.get(ruby)
462
+ }
463
+ }
464
+
465
+ impl DataTypeFunctions for YClipPathPathCommandArc {
466
+ fn mark(&self, marker: &gc::Marker) {
467
+ self.radii.mark(marker);
468
+ self.rotate.mark(marker);
469
+ self.point.mark(marker);
470
+ }
471
+ }
472
+
473
+ #[magnus::wrap(class = "Yass::Declarations::ClipPath::PathCommandClose")]
474
+ pub struct YClipPathPathCommandClose {}
475
+
476
+ impl YClipPathPathCommandClose {
477
+ pub fn new() -> Self {
478
+ Self {}
479
+ }
480
+ }
481
+
482
+ fn make_path_coordinate_pair(coord: &CoordinatePair<style::values::CSSFloat>, ruby: &Ruby) -> Value {
483
+ YClipPathPathCoordinatePair::new(*coord).into_value_with(ruby)
484
+ }
485
+
486
+ fn make_path_command_end_point(point: &ClipPathPathCommandEndPoint, ruby: &Ruby) -> Value {
487
+ match point {
488
+ CommandEndPoint::ToPosition(position) => {
489
+ YClipPathPathCommandEndPointToPosition::new(*position).into_value_with(ruby)
490
+ }
491
+ CommandEndPoint::ByCoordinate(coord) => {
492
+ YClipPathPathCommandEndPointByCoordinate::new(*coord).into_value_with(ruby)
493
+ }
494
+ }
495
+ }
496
+
497
+ fn make_path_axis_end_point(point: &ClipPathPathAxisEndPoint, ruby: &Ruby) -> Value {
498
+ match point {
499
+ AxisEndPoint::ToPosition(position) => {
500
+ YClipPathPathAxisEndPointToPosition::new(*position).into_value_with(ruby)
501
+ }
502
+ AxisEndPoint::ByCoordinate(coord) => {
503
+ YClipPathPathAxisEndPointByCoordinate::new(*coord).into_value_with(ruby)
504
+ }
505
+ }
506
+ }
507
+
508
+ fn make_path_control_point(point: &ClipPathPathControlPoint, ruby: &Ruby) -> Value {
509
+ match point {
510
+ ControlPoint::Absolute(position) => {
511
+ YClipPathPathControlPointAbsolute::new(*position).into_value_with(ruby)
512
+ }
513
+ ControlPoint::Relative(relative) => {
514
+ YClipPathPathControlPointRelative::new(*relative).into_value_with(ruby)
515
+ }
516
+ }
517
+ }
518
+
519
+ fn make_path_arc_radii(radii: &ClipPathPathArcRadii, ruby: &Ruby) -> Value {
520
+ YClipPathPathArcRadii::new(*radii).into_value_with(ruby)
521
+ }
522
+
523
+ #[magnus::wrap(class = "Yass::Declarations::ClipPath::PathCommandEndPointToPosition")]
524
+ pub struct YClipPathPathCommandEndPointToPosition {
525
+ position: ClipPathSvgPosition,
526
+ }
527
+
528
+ impl YClipPathPathCommandEndPointToPosition {
529
+ pub fn new(position: ClipPathSvgPosition) -> Self {
530
+ Self { position }
531
+ }
532
+
533
+ pub fn x(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> f32 {
534
+ rb_self.position.horizontal
535
+ }
536
+
537
+ pub fn y(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> f32 {
538
+ rb_self.position.vertical
539
+ }
540
+ }
541
+
542
+ #[derive(TypedData)]
543
+ #[magnus(class = "Yass::Declarations::ClipPath::PathCommandEndPointByCoordinate", mark)]
544
+ pub struct YClipPathPathCommandEndPointByCoordinate {
545
+ coord: CachedValue<CoordinatePair<style::values::CSSFloat>>,
546
+ }
547
+
548
+ impl YClipPathPathCommandEndPointByCoordinate {
549
+ pub fn new(coord: CoordinatePair<style::values::CSSFloat>) -> Self {
550
+ Self {
551
+ coord: CachedValue::new(coord, make_path_coordinate_pair),
552
+ }
553
+ }
554
+
555
+ pub fn coord(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
556
+ rb_self.coord.get(ruby)
557
+ }
558
+ }
559
+
560
+ impl DataTypeFunctions for YClipPathPathCommandEndPointByCoordinate {
561
+ fn mark(&self, marker: &gc::Marker) {
562
+ self.coord.mark(marker);
563
+ }
564
+ }
565
+
566
+ #[magnus::wrap(class = "Yass::Declarations::ClipPath::PathCoordinatePair")]
567
+ pub struct YClipPathPathCoordinatePair {
568
+ coord: CoordinatePair<style::values::CSSFloat>,
569
+ }
570
+
571
+ impl YClipPathPathCoordinatePair {
572
+ pub fn new(coord: CoordinatePair<style::values::CSSFloat>) -> Self {
573
+ Self { coord }
574
+ }
575
+
576
+ pub fn x(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> f32 {
577
+ rb_self.coord.x
578
+ }
579
+
580
+ pub fn y(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> f32 {
581
+ rb_self.coord.y
582
+ }
583
+ }
584
+
585
+ #[magnus::wrap(class = "Yass::Declarations::ClipPath::PathAxisEndPointToPosition")]
586
+ pub struct YClipPathPathAxisEndPointToPosition {
587
+ position: AxisPosition<style::values::CSSFloat>,
588
+ }
589
+
590
+ impl YClipPathPathAxisEndPointToPosition {
591
+ pub fn new(position: AxisPosition<style::values::CSSFloat>) -> Self {
592
+ Self { position }
593
+ }
594
+
595
+ pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
596
+ match rb_self.position {
597
+ AxisPosition::LengthPercent(value) => YNumber::new(value).into_value_with(ruby),
598
+ AxisPosition::Keyword(keyword) => axis_position_keyword_to_id(keyword, ruby).into_value_with(ruby),
599
+ }
600
+ }
601
+ }
602
+
603
+ #[magnus::wrap(class = "Yass::Declarations::ClipPath::PathAxisEndPointByCoordinate")]
604
+ pub struct YClipPathPathAxisEndPointByCoordinate {
605
+ coord: style::values::CSSFloat,
606
+ }
607
+
608
+ impl YClipPathPathAxisEndPointByCoordinate {
609
+ pub fn new(coord: style::values::CSSFloat) -> Self {
610
+ Self { coord }
611
+ }
612
+
613
+ pub fn value(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> f32 {
614
+ rb_self.coord
615
+ }
616
+ }
617
+
618
+ #[magnus::wrap(class = "Yass::Declarations::ClipPath::PathControlPointAbsolute")]
619
+ pub struct YClipPathPathControlPointAbsolute {
620
+ position: ClipPathSvgPosition,
621
+ }
622
+
623
+ impl YClipPathPathControlPointAbsolute {
624
+ pub fn new(position: ClipPathSvgPosition) -> Self {
625
+ Self { position }
626
+ }
627
+
628
+ pub fn x(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> f32 {
629
+ rb_self.position.horizontal
630
+ }
631
+
632
+ pub fn y(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> f32 {
633
+ rb_self.position.vertical
634
+ }
635
+ }
636
+
637
+ #[derive(TypedData)]
638
+ #[magnus(class = "Yass::Declarations::ClipPath::PathControlPointRelative", mark)]
639
+ pub struct YClipPathPathControlPointRelative {
640
+ relative: CachedValue<RelativeControlPoint<style::values::CSSFloat>>,
641
+ }
642
+
643
+ impl YClipPathPathControlPointRelative {
644
+ pub fn new(relative: RelativeControlPoint<style::values::CSSFloat>) -> Self {
645
+ Self {
646
+ relative: CachedValue::new(relative, |relative, ruby| {
647
+ YClipPathPathRelativeControlPoint::new(*relative).into_value_with(ruby)
648
+ }),
649
+ }
650
+ }
651
+
652
+ pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
653
+ rb_self.relative.get(ruby)
654
+ }
655
+ }
656
+
657
+ impl DataTypeFunctions for YClipPathPathControlPointRelative {
658
+ fn mark(&self, marker: &gc::Marker) {
659
+ self.relative.mark(marker);
660
+ }
661
+ }
662
+
663
+ #[derive(TypedData)]
664
+ #[magnus(class = "Yass::Declarations::ClipPath::PathRelativeControlPoint", mark)]
665
+ pub struct YClipPathPathRelativeControlPoint {
666
+ coord: CachedValue<CoordinatePair<style::values::CSSFloat>>,
667
+ reference: ControlReference,
668
+ }
669
+
670
+ impl YClipPathPathRelativeControlPoint {
671
+ pub fn new(relative: RelativeControlPoint<style::values::CSSFloat>) -> Self {
672
+ Self {
673
+ coord: CachedValue::new(relative.coord, make_path_coordinate_pair),
674
+ reference: relative.reference,
675
+ }
676
+ }
677
+
678
+ pub fn coord(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
679
+ rb_self.coord.get(ruby)
680
+ }
681
+
682
+ pub fn reference(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Id {
683
+ match rb_self.reference {
684
+ ControlReference::Start => ruby.intern("start"),
685
+ ControlReference::End => ruby.intern("end"),
686
+ ControlReference::Origin => ruby.intern("origin"),
687
+ }
688
+ }
689
+ }
690
+
691
+ impl DataTypeFunctions for YClipPathPathRelativeControlPoint {
692
+ fn mark(&self, marker: &gc::Marker) {
693
+ self.coord.mark(marker);
694
+ }
695
+ }
696
+
697
+ #[derive(TypedData)]
698
+ #[magnus(class = "Yass::Declarations::ClipPath::PathArcRadii", mark)]
699
+ pub struct YClipPathPathArcRadii {
700
+ rx: CachedValue<style::values::CSSFloat>,
701
+ ry: CachedValue<style::values::generics::Optional<style::values::CSSFloat>>,
702
+ }
703
+
704
+ impl YClipPathPathArcRadii {
705
+ pub fn new(radii: ClipPathPathArcRadii) -> Self {
706
+ Self {
707
+ rx: CachedValue::new(radii.rx, |rx, ruby| YNumber::new(*rx).into_value_with(ruby)),
708
+ ry: CachedValue::new(radii.ry, |ry, ruby| {
709
+ match ry {
710
+ style::values::generics::Optional::Some(value) => {
711
+ YNumber::new(*value).into_value_with(ruby)
712
+ },
713
+
714
+ style::values::generics::Optional::None => ruby.qnil().into_value_with(ruby),
715
+ }
716
+ }),
717
+ }
718
+ }
719
+
720
+ pub fn rx(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
721
+ rb_self.rx.get(ruby)
722
+ }
723
+
724
+ pub fn ry(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
725
+ rb_self.ry.get(ruby)
726
+ }
727
+ }
728
+
729
+ impl DataTypeFunctions for YClipPathPathArcRadii {
730
+ fn mark(&self, marker: &gc::Marker) {
731
+ self.rx.mark(marker);
732
+ self.ry.mark(marker);
733
+ }
734
+ }