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,419 @@
|
|
|
1
|
+
use magnus::{
|
|
2
|
+
DataTypeFunctions, Error, IntoValue, RArray, Ruby, TypedData, Value, gc, typed_data,
|
|
3
|
+
value::Id,
|
|
4
|
+
};
|
|
5
|
+
use style::values::{
|
|
6
|
+
CssUrl,
|
|
7
|
+
generics::{
|
|
8
|
+
NonNegative,
|
|
9
|
+
basic_shape::{
|
|
10
|
+
ArcRadii, ArcSize, ArcSweep, AxisEndPoint, AxisPosition, AxisPositionKeyword,
|
|
11
|
+
BasicShape as StyloBasicShape, ClipPath as StyloClipPath, CommandEndPoint,
|
|
12
|
+
ControlPoint, ControlReference, CoordinatePair, FillRule, PolygonCoord,
|
|
13
|
+
RelativeControlPoint, ShapeBox, ShapeGeometryBox, ShapeRadius as GenericShapeRadius,
|
|
14
|
+
},
|
|
15
|
+
border::{BorderCornerRadius, BorderRadius as GenericBorderRadius},
|
|
16
|
+
position::{Position, PositionOrAuto as GenericPositionOrAuto}
|
|
17
|
+
},
|
|
18
|
+
specified::{
|
|
19
|
+
Angle,
|
|
20
|
+
LengthPercentage,
|
|
21
|
+
PositionComponent,
|
|
22
|
+
basic_shape::{BasicShapeRect, PathOrShapeFunction as GenericPathOrShapeFunction, ShapeRectFunction, Xywh},
|
|
23
|
+
length::LengthPercentageOrAuto,
|
|
24
|
+
position::{HorizontalPositionKeyword, VerticalPositionKeyword},
|
|
25
|
+
svg_path::PathCommand,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
use style_traits::ToCss;
|
|
29
|
+
|
|
30
|
+
use crate::{
|
|
31
|
+
cached_value::CachedValue,
|
|
32
|
+
cached_value_list::CachedValueList,
|
|
33
|
+
declarations::{
|
|
34
|
+
angle::YAngle,
|
|
35
|
+
horizontal_position_component::make_horizontal_position_component,
|
|
36
|
+
number::YNumber,
|
|
37
|
+
size::{YLengthPercentage, length_percentage_to_value},
|
|
38
|
+
vertical_position_component::make_vertical_position_component,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
pub mod circle_ellipse;
|
|
43
|
+
pub mod init;
|
|
44
|
+
pub mod path;
|
|
45
|
+
pub mod rect;
|
|
46
|
+
pub mod shape;
|
|
47
|
+
pub mod shape_box;
|
|
48
|
+
|
|
49
|
+
use self::{
|
|
50
|
+
circle_ellipse::{
|
|
51
|
+
YClipPathAuto, YClipPathCircle, YClipPathEllipse, YClipPathPosition,
|
|
52
|
+
YClipPathPositionAuto, YClipPathShapeRadiusClosestSide, YClipPathShapeRadiusFarthestSide,
|
|
53
|
+
YClipPathShapeRadiusLength,
|
|
54
|
+
},
|
|
55
|
+
path::{
|
|
56
|
+
YClipPathPathCommand, YClipPathPathFunction, YClipPathPathOrShape, YClipPathPolygon,
|
|
57
|
+
},
|
|
58
|
+
rect::{
|
|
59
|
+
YClipPathBorderCornerRadius, YClipPathBorderRadius, YClipPathInsetRect,
|
|
60
|
+
YClipPathRect, YClipPathRectFunction, YClipPathXywhRect,
|
|
61
|
+
},
|
|
62
|
+
shape::{
|
|
63
|
+
YClipPathArcRadii,
|
|
64
|
+
YClipPathAxisEndPointByCoordinate,
|
|
65
|
+
YClipPathAxisEndPointToPosition,
|
|
66
|
+
YClipPathCommandEndPointByCoordinate,
|
|
67
|
+
YClipPathCommandEndPointToPosition,
|
|
68
|
+
YClipPathCoordinatePair,
|
|
69
|
+
YClipPathControlPointAbsolute,
|
|
70
|
+
YClipPathControlPointRelative,
|
|
71
|
+
YClipPathShapeCommand,
|
|
72
|
+
YClipPathShapeFunction,
|
|
73
|
+
},
|
|
74
|
+
shape_box::{
|
|
75
|
+
YClipPathBorderBox, YClipPathContentBox, YClipPathElementDependent, YClipPathFillBox,
|
|
76
|
+
YClipPathMarginBox, YClipPathPaddingBox, YClipPathStrokeBox, YClipPathViewBox,
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
type ClipPathPosition = Position<
|
|
81
|
+
PositionComponent<HorizontalPositionKeyword>,
|
|
82
|
+
PositionComponent<VerticalPositionKeyword>,
|
|
83
|
+
>;
|
|
84
|
+
|
|
85
|
+
pub type ClipPathBasicShape =
|
|
86
|
+
StyloBasicShape<Angle, ClipPathPosition, LengthPercentage, BasicShapeRect>;
|
|
87
|
+
|
|
88
|
+
type ClipPath = StyloClipPath<ClipPathBasicShape, CssUrl>;
|
|
89
|
+
|
|
90
|
+
type ClipPathPathOrShape = GenericPathOrShapeFunction;
|
|
91
|
+
|
|
92
|
+
type ClipPathShapePosition = style::values::generics::basic_shape::ShapePosition<LengthPercentage>;
|
|
93
|
+
|
|
94
|
+
type ClipPathPositionOrAuto = GenericPositionOrAuto<ClipPathShapePosition>;
|
|
95
|
+
|
|
96
|
+
type ClipPathShapeRadius = GenericShapeRadius<LengthPercentage>;
|
|
97
|
+
|
|
98
|
+
type ClipPathShapeCommand =
|
|
99
|
+
style::values::generics::basic_shape::ShapeCommand<Angle, ClipPathPosition, LengthPercentage>;
|
|
100
|
+
|
|
101
|
+
type ClipPathBorderRadius = GenericBorderRadius<NonNegative<LengthPercentage>>;
|
|
102
|
+
|
|
103
|
+
type ClipPathBorderCornerRadius = BorderCornerRadius<NonNegative<LengthPercentage>>;
|
|
104
|
+
|
|
105
|
+
type ClipPathCommandEndPoint = CommandEndPoint<ClipPathPosition, LengthPercentage>;
|
|
106
|
+
|
|
107
|
+
type ClipPathAxisEndPoint = AxisEndPoint<LengthPercentage>;
|
|
108
|
+
|
|
109
|
+
type ClipPathControlPoint = ControlPoint<ClipPathPosition, LengthPercentage>;
|
|
110
|
+
|
|
111
|
+
type ClipPathSvgPosition = style::values::generics::basic_shape::ShapePosition<style::values::CSSFloat>;
|
|
112
|
+
|
|
113
|
+
type ClipPathPathCommandEndPoint = CommandEndPoint<ClipPathSvgPosition, style::values::CSSFloat>;
|
|
114
|
+
|
|
115
|
+
type ClipPathPathAxisEndPoint = AxisEndPoint<style::values::CSSFloat>;
|
|
116
|
+
|
|
117
|
+
type ClipPathPathControlPoint = ControlPoint<ClipPathSvgPosition, style::values::CSSFloat>;
|
|
118
|
+
|
|
119
|
+
type ClipPathPathArcRadii = ArcRadii<style::values::CSSFloat>;
|
|
120
|
+
|
|
121
|
+
fn fill_rule_to_id(fill_rule: FillRule, ruby: &Ruby) -> Id {
|
|
122
|
+
match fill_rule {
|
|
123
|
+
FillRule::Nonzero => ruby.intern("nonzero"),
|
|
124
|
+
FillRule::Evenodd => ruby.intern("evenodd"),
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
fn make_length_percentage_or_auto(value: &LengthPercentageOrAuto, ruby: &Ruby) -> Value {
|
|
129
|
+
match value {
|
|
130
|
+
LengthPercentageOrAuto::Auto => YClipPathAuto::new().into_value_with(ruby),
|
|
131
|
+
LengthPercentageOrAuto::LengthPercentage(length_percentage) => {
|
|
132
|
+
length_percentage_to_value(length_percentage, ruby)
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
fn make_shape_radius(shape_radius: &ClipPathShapeRadius, ruby: &Ruby) -> Value {
|
|
138
|
+
match shape_radius {
|
|
139
|
+
ClipPathShapeRadius::Length(length_percentage) => {
|
|
140
|
+
YClipPathShapeRadiusLength::new(length_percentage.clone()).into_value_with(ruby)
|
|
141
|
+
}
|
|
142
|
+
ClipPathShapeRadius::ClosestSide => {
|
|
143
|
+
YClipPathShapeRadiusClosestSide::new().into_value_with(ruby)
|
|
144
|
+
}
|
|
145
|
+
ClipPathShapeRadius::FarthestSide => {
|
|
146
|
+
YClipPathShapeRadiusFarthestSide::new().into_value_with(ruby)
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
fn make_shape_position_or_auto(position: &ClipPathPositionOrAuto, ruby: &Ruby) -> Value {
|
|
152
|
+
match position {
|
|
153
|
+
ClipPathPositionOrAuto::Auto => YClipPathPositionAuto::new().into_value_with(ruby),
|
|
154
|
+
ClipPathPositionOrAuto::Position(position) => {
|
|
155
|
+
YClipPathPosition::new(position.clone()).into_value_with(ruby)
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
fn make_border_corner_radius(corner: &ClipPathBorderCornerRadius, ruby: &Ruby) -> Value {
|
|
161
|
+
YClipPathBorderCornerRadius::new(corner.clone()).into_value_with(ruby)
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
fn make_border_radius(radius: &ClipPathBorderRadius, ruby: &Ruby) -> Value {
|
|
165
|
+
YClipPathBorderRadius::new(radius.clone()).into_value_with(ruby)
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
fn axis_position_keyword_to_id(keyword: AxisPositionKeyword, ruby: &Ruby) -> Id {
|
|
169
|
+
match keyword {
|
|
170
|
+
AxisPositionKeyword::Center => ruby.intern("center"),
|
|
171
|
+
AxisPositionKeyword::Left => ruby.intern("left"),
|
|
172
|
+
AxisPositionKeyword::Right => ruby.intern("right"),
|
|
173
|
+
AxisPositionKeyword::Top => ruby.intern("top"),
|
|
174
|
+
AxisPositionKeyword::Bottom => ruby.intern("bottom"),
|
|
175
|
+
AxisPositionKeyword::XStart => ruby.intern("x_start"),
|
|
176
|
+
AxisPositionKeyword::XEnd => ruby.intern("x_end"),
|
|
177
|
+
AxisPositionKeyword::YStart => ruby.intern("y_start"),
|
|
178
|
+
AxisPositionKeyword::YEnd => ruby.intern("y_end"),
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
fn make_coordinate_pair(coord: &CoordinatePair<LengthPercentage>, ruby: &Ruby) -> Value {
|
|
183
|
+
YClipPathCoordinatePair::new(coord.clone()).into_value_with(ruby)
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
fn make_command_end_point(point: &ClipPathCommandEndPoint, ruby: &Ruby) -> Value {
|
|
187
|
+
match point {
|
|
188
|
+
CommandEndPoint::ToPosition(position) => {
|
|
189
|
+
YClipPathCommandEndPointToPosition::new(position.clone()).into_value_with(ruby)
|
|
190
|
+
}
|
|
191
|
+
CommandEndPoint::ByCoordinate(coord) => {
|
|
192
|
+
YClipPathCommandEndPointByCoordinate::new(coord.clone()).into_value_with(ruby)
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
fn make_axis_end_point(point: &ClipPathAxisEndPoint, ruby: &Ruby) -> Value {
|
|
198
|
+
match point {
|
|
199
|
+
AxisEndPoint::ToPosition(position) => {
|
|
200
|
+
YClipPathAxisEndPointToPosition::new(position.clone()).into_value_with(ruby)
|
|
201
|
+
}
|
|
202
|
+
AxisEndPoint::ByCoordinate(coord) => {
|
|
203
|
+
YClipPathAxisEndPointByCoordinate::new(coord.clone()).into_value_with(ruby)
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
fn make_control_point(point: &ClipPathControlPoint, ruby: &Ruby) -> Value {
|
|
209
|
+
match point {
|
|
210
|
+
ControlPoint::Absolute(position) => {
|
|
211
|
+
YClipPathControlPointAbsolute::new(position.clone()).into_value_with(ruby)
|
|
212
|
+
}
|
|
213
|
+
ControlPoint::Relative(relative) => {
|
|
214
|
+
YClipPathControlPointRelative::new(relative.clone()).into_value_with(ruby)
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
fn make_arc_radii(radii: &ArcRadii<LengthPercentage>, ruby: &Ruby) -> Value {
|
|
220
|
+
YClipPathArcRadii::new(radii.clone()).into_value_with(ruby)
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
fn arc_sweep_to_id(arc_sweep: ArcSweep, ruby: &Ruby) -> Id {
|
|
224
|
+
match arc_sweep {
|
|
225
|
+
ArcSweep::Ccw => ruby.intern("ccw"),
|
|
226
|
+
ArcSweep::Cw => ruby.intern("cw"),
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
fn arc_size_to_id(arc_size: ArcSize, ruby: &Ruby) -> Id {
|
|
231
|
+
match arc_size {
|
|
232
|
+
ArcSize::Small => ruby.intern("small"),
|
|
233
|
+
ArcSize::Large => ruby.intern("large"),
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
fn make_shape_command(shape_command: &ClipPathShapeCommand, ruby: &Ruby) -> Value {
|
|
238
|
+
YClipPathShapeCommand::new(shape_command.clone()).into_value_with(ruby)
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
fn make_path_command(path_command: &PathCommand, ruby: &Ruby) -> Value {
|
|
242
|
+
YClipPathPathCommand::new(*path_command).into_value_with(ruby)
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
fn make_shape_box(shape_box: &ShapeBox, ruby: &Ruby) -> Value {
|
|
246
|
+
match shape_box {
|
|
247
|
+
ShapeBox::MarginBox => YClipPathMarginBox::new().into_value_with(ruby),
|
|
248
|
+
ShapeBox::BorderBox => YClipPathBorderBox::new().into_value_with(ruby),
|
|
249
|
+
ShapeBox::PaddingBox => YClipPathPaddingBox::new().into_value_with(ruby),
|
|
250
|
+
ShapeBox::ContentBox => YClipPathContentBox::new().into_value_with(ruby),
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
fn make_shape_geometry_box(reference_box: &ShapeGeometryBox, ruby: &Ruby) -> Value {
|
|
255
|
+
match reference_box {
|
|
256
|
+
ShapeGeometryBox::ElementDependent => {
|
|
257
|
+
YClipPathElementDependent::new().into_value_with(ruby)
|
|
258
|
+
}
|
|
259
|
+
ShapeGeometryBox::FillBox => YClipPathFillBox::new().into_value_with(ruby),
|
|
260
|
+
ShapeGeometryBox::StrokeBox => YClipPathStrokeBox::new().into_value_with(ruby),
|
|
261
|
+
ShapeGeometryBox::ViewBox => YClipPathViewBox::new().into_value_with(ruby),
|
|
262
|
+
ShapeGeometryBox::ShapeBox(shape_box) => make_shape_box(shape_box, ruby),
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
fn make_basic_shape_rect(rect: &BasicShapeRect, ruby: &Ruby) -> Value {
|
|
267
|
+
match rect {
|
|
268
|
+
BasicShapeRect::Inset(inset_rect) => {
|
|
269
|
+
YClipPathInsetRect::new(inset_rect.clone()).into_value_with(ruby)
|
|
270
|
+
}
|
|
271
|
+
BasicShapeRect::Xywh(xywh) => YClipPathXywhRect::new(xywh.clone()).into_value_with(ruby),
|
|
272
|
+
BasicShapeRect::Rect(shape_rect) => {
|
|
273
|
+
YClipPathRectFunction::new(shape_rect.clone()).into_value_with(ruby)
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
fn make_basic_shape_path_or_shape(path_or_shape: &ClipPathPathOrShape, ruby: &Ruby) -> Value {
|
|
279
|
+
match path_or_shape {
|
|
280
|
+
ClipPathPathOrShape::Path(path) => {
|
|
281
|
+
YClipPathPathFunction::new(path.clone()).into_value_with(ruby)
|
|
282
|
+
}
|
|
283
|
+
ClipPathPathOrShape::Shape(shape) => {
|
|
284
|
+
YClipPathShapeFunction::new(shape.clone()).into_value_with(ruby)
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
pub fn make_basic_shape(basic_shape: &ClipPathBasicShape, ruby: &Ruby) -> Value {
|
|
290
|
+
match basic_shape {
|
|
291
|
+
ClipPathBasicShape::Rect(rect) => YClipPathRect::new(rect.clone()).into_value_with(ruby),
|
|
292
|
+
ClipPathBasicShape::Circle(circle) => {
|
|
293
|
+
YClipPathCircle::new(circle.clone()).into_value_with(ruby)
|
|
294
|
+
}
|
|
295
|
+
ClipPathBasicShape::Ellipse(ellipse) => {
|
|
296
|
+
YClipPathEllipse::new(ellipse.clone()).into_value_with(ruby)
|
|
297
|
+
}
|
|
298
|
+
ClipPathBasicShape::Polygon(polygon) => {
|
|
299
|
+
YClipPathPolygon::new(polygon.clone()).into_value_with(ruby)
|
|
300
|
+
}
|
|
301
|
+
ClipPathBasicShape::PathOrShape(path_or_shape) => {
|
|
302
|
+
YClipPathPathOrShape::new(path_or_shape.clone()).into_value_with(ruby)
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
fn make_clip_path(clip_path: &ClipPath, ruby: &Ruby) -> Value {
|
|
308
|
+
match clip_path {
|
|
309
|
+
ClipPath::None => YClipPathNone::new().into_value_with(ruby),
|
|
310
|
+
ClipPath::Url(url) => YClipPathUrl::new(url.to_css_string()).into_value_with(ruby),
|
|
311
|
+
ClipPath::Shape(basic_shape, reference_box) => {
|
|
312
|
+
YClipPathShape::new((**basic_shape).clone(), *reference_box).into_value_with(ruby)
|
|
313
|
+
}
|
|
314
|
+
ClipPath::Box(reference_box) => YClipPathBox::new(*reference_box).into_value_with(ruby),
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
#[derive(TypedData)]
|
|
319
|
+
#[magnus(class = "Yass::Declarations::ClipPath", mark)]
|
|
320
|
+
pub struct YClipPath {
|
|
321
|
+
clip_path: CachedValue<ClipPath>,
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
impl YClipPath {
|
|
325
|
+
pub fn new(clip_path: ClipPath) -> Self {
|
|
326
|
+
Self {
|
|
327
|
+
clip_path: CachedValue::new(clip_path, make_clip_path),
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
332
|
+
rb_self.clip_path.get(ruby)
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
impl DataTypeFunctions for YClipPath {
|
|
337
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
338
|
+
self.clip_path.mark(marker);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
#[magnus::wrap(class = "Yass::Declarations::ClipPath::None")]
|
|
343
|
+
pub struct YClipPathNone {}
|
|
344
|
+
|
|
345
|
+
impl YClipPathNone {
|
|
346
|
+
pub fn new() -> Self {
|
|
347
|
+
Self {}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
#[magnus::wrap(class = "Yass::Declarations::ClipPath::Url")]
|
|
352
|
+
pub struct YClipPathUrl {
|
|
353
|
+
css: String,
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
impl YClipPathUrl {
|
|
357
|
+
pub fn new(css: String) -> Self {
|
|
358
|
+
Self { css }
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
362
|
+
ruby.str_new(&rb_self.css).into_value_with(ruby)
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
#[derive(TypedData)]
|
|
367
|
+
#[magnus(class = "Yass::Declarations::ClipPath::Shape", mark)]
|
|
368
|
+
pub struct YClipPathShape {
|
|
369
|
+
basic_shape: CachedValue<ClipPathBasicShape>,
|
|
370
|
+
reference_box: CachedValue<ShapeGeometryBox>,
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
impl YClipPathShape {
|
|
374
|
+
pub fn new(basic_shape: ClipPathBasicShape, reference_box: ShapeGeometryBox) -> Self {
|
|
375
|
+
Self {
|
|
376
|
+
basic_shape: CachedValue::new(basic_shape, make_basic_shape),
|
|
377
|
+
reference_box: CachedValue::new(reference_box, make_shape_geometry_box),
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
pub fn shape(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
382
|
+
rb_self.basic_shape.get(ruby)
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
pub fn reference_box(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
386
|
+
rb_self.reference_box.get(ruby)
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
impl DataTypeFunctions for YClipPathShape {
|
|
391
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
392
|
+
self.basic_shape.mark(marker);
|
|
393
|
+
self.reference_box.mark(marker);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
#[derive(TypedData)]
|
|
398
|
+
#[magnus(class = "Yass::Declarations::ClipPath::Box", mark)]
|
|
399
|
+
pub struct YClipPathBox {
|
|
400
|
+
reference_box: CachedValue<ShapeGeometryBox>,
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
impl YClipPathBox {
|
|
404
|
+
pub fn new(reference_box: ShapeGeometryBox) -> Self {
|
|
405
|
+
Self {
|
|
406
|
+
reference_box: CachedValue::new(reference_box, make_shape_geometry_box),
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
pub fn reference_box(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
411
|
+
rb_self.reference_box.get(ruby)
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
impl DataTypeFunctions for YClipPathBox {
|
|
416
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
417
|
+
self.reference_box.mark(marker);
|
|
418
|
+
}
|
|
419
|
+
}
|