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