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,118 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, IntoValue, Ruby, TypedData, Value, gc, typed_data, value::Id};
|
|
2
|
+
use style::values::specified::{CalcLengthPercentage, calc::CalcNode};
|
|
3
|
+
use style_traits::values::specified::AllowedNumericType;
|
|
4
|
+
|
|
5
|
+
use crate::{cached_value::CachedValue, declarations::calc::{abs::YAbs, anchor_function::YAnchorFunction, anchor_size_function::YAnchorSizeFunction, clamp::YClamp, hypot::YHypot, invert::YInvert, leaf::make_leaf, min_max::YMinMax, mod_rem::YModRem, negate::YNegate, product::YProduct, round::YRound, sign::YSign, sum::YSum}};
|
|
6
|
+
|
|
7
|
+
pub mod abs;
|
|
8
|
+
pub mod anchor_function;
|
|
9
|
+
pub mod anchor_size_function;
|
|
10
|
+
pub mod clamp;
|
|
11
|
+
pub mod hypot;
|
|
12
|
+
pub mod init;
|
|
13
|
+
pub mod invert;
|
|
14
|
+
pub mod leaf;
|
|
15
|
+
pub mod min_max;
|
|
16
|
+
pub mod mod_rem;
|
|
17
|
+
pub mod negate;
|
|
18
|
+
pub mod product;
|
|
19
|
+
pub mod round;
|
|
20
|
+
pub mod sign;
|
|
21
|
+
pub mod sum;
|
|
22
|
+
|
|
23
|
+
#[derive(TypedData)]
|
|
24
|
+
#[magnus(class = "Yass::Declarations::Calc", mark)]
|
|
25
|
+
pub struct YCalc {
|
|
26
|
+
clamping_mode: AllowedNumericType,
|
|
27
|
+
root: CachedValue<CalcNode>
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
impl YCalc {
|
|
31
|
+
pub fn new(calc_length_percentage: Box<CalcLengthPercentage>) -> Self {
|
|
32
|
+
Self {
|
|
33
|
+
clamping_mode: calc_length_percentage.clamping_mode,
|
|
34
|
+
root: CachedValue::new(calc_length_percentage.node, |calc_node, ruby| {
|
|
35
|
+
YCalc::make_node(calc_node, ruby)
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
pub fn make_node(calc_node: &CalcNode, ruby: &Ruby) -> Value {
|
|
41
|
+
match calc_node {
|
|
42
|
+
CalcNode::Leaf(leaf) => {
|
|
43
|
+
make_leaf(leaf, ruby)
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
CalcNode::Negate(generic_calc_node) => {
|
|
47
|
+
YNegate::new((**generic_calc_node).clone()).into_value_with(ruby)
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
CalcNode::Invert(generic_calc_node) => {
|
|
51
|
+
YInvert::new((**generic_calc_node).clone()).into_value_with(ruby)
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
CalcNode::Sum(owned_slice) => {
|
|
55
|
+
YSum::new(owned_slice).into_value_with(ruby)
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
CalcNode::Product(owned_slice) => {
|
|
59
|
+
YProduct::new(owned_slice).into_value_with(ruby)
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
CalcNode::MinMax(owned_slice, min_max_op) => {
|
|
63
|
+
YMinMax::new(owned_slice, min_max_op.clone()).into_value_with(ruby)
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
CalcNode::Clamp { min, center, max } => {
|
|
67
|
+
YClamp::new((**min).clone(), (**center).clone(), (**max).clone()).into_value_with(ruby)
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
CalcNode::Round { strategy, value, step } => {
|
|
71
|
+
YRound::new(strategy.clone(), (**value).clone(), (**step).clone()).into_value_with(ruby)
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
CalcNode::ModRem { dividend, divisor, op } => {
|
|
75
|
+
YModRem::new((**dividend).clone(), (**divisor).clone(), op.clone()).into_value_with(ruby)
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
CalcNode::Hypot(owned_slice) => {
|
|
79
|
+
YHypot::new(owned_slice).into_value_with(ruby)
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
CalcNode::Abs(generic_calc_node) => {
|
|
83
|
+
YAbs::new((**generic_calc_node).clone()).into_value_with(ruby)
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
CalcNode::Sign(generic_calc_node) => {
|
|
87
|
+
YSign::new((**generic_calc_node).clone()).into_value_with(ruby)
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
CalcNode::Anchor(generic_anchor_function) => {
|
|
91
|
+
YAnchorFunction::new((**generic_anchor_function).clone()).into_value_with(ruby)
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
CalcNode::AnchorSize(generic_anchor_size_function) => {
|
|
95
|
+
YAnchorSizeFunction::new((**generic_anchor_size_function).clone()).into_value_with(ruby)
|
|
96
|
+
},
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
pub fn clamping_mode(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Id {
|
|
101
|
+
match rb_self.clamping_mode {
|
|
102
|
+
AllowedNumericType::All => ruby.intern("all"),
|
|
103
|
+
AllowedNumericType::NonNegative => ruby.intern("non_negative"),
|
|
104
|
+
AllowedNumericType::AtLeastOne => ruby.intern("at_least_one"),
|
|
105
|
+
AllowedNumericType::ZeroToOne => ruby.intern("zero_to_one"),
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
pub fn root(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
110
|
+
rb_self.root.get(ruby)
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
impl DataTypeFunctions for YCalc {
|
|
115
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
116
|
+
self.root.mark(marker);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Error, RArray, Ruby, TypedData, Value, gc, typed_data, value::Id};
|
|
2
|
+
use style::values::{generics::calc::ModRemOp, specified::calc::CalcNode};
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::calc::YCalc};
|
|
5
|
+
|
|
6
|
+
#[derive(TypedData)]
|
|
7
|
+
#[magnus(class = "Yass::Declarations::Calc::ModRem", mark)]
|
|
8
|
+
pub struct YModRem {
|
|
9
|
+
dividend: CachedValue<CalcNode>,
|
|
10
|
+
divisor: CachedValue<CalcNode>,
|
|
11
|
+
op: ModRemOp
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
impl YModRem {
|
|
15
|
+
pub fn new(dividend: CalcNode, divisor: CalcNode, op: ModRemOp) -> Self {
|
|
16
|
+
Self {
|
|
17
|
+
dividend: CachedValue::new(dividend, |calc_node, ruby| {
|
|
18
|
+
YCalc::make_node(calc_node, ruby)
|
|
19
|
+
}),
|
|
20
|
+
|
|
21
|
+
divisor: CachedValue::new(divisor, |calc_node, ruby| {
|
|
22
|
+
YCalc::make_node(calc_node, ruby)
|
|
23
|
+
}),
|
|
24
|
+
|
|
25
|
+
op
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
pub fn children(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Result<RArray, Error> {
|
|
30
|
+
let result = ruby.ary_new_capa(3);
|
|
31
|
+
result.push(rb_self.dividend.get(ruby))?;
|
|
32
|
+
result.push(rb_self.divisor.get(ruby))?;
|
|
33
|
+
Ok(result)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
pub fn dividend(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
37
|
+
rb_self.dividend.get(ruby)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
pub fn divisor(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
41
|
+
rb_self.divisor.get(ruby)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
pub fn op(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Id {
|
|
45
|
+
match rb_self.op {
|
|
46
|
+
ModRemOp::Mod => ruby.intern("mod"),
|
|
47
|
+
ModRemOp::Rem => ruby.intern("rem"),
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
impl DataTypeFunctions for YModRem {
|
|
53
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
54
|
+
self.dividend.mark(marker);
|
|
55
|
+
self.divisor.mark(marker);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Error, RArray, Ruby, TypedData, gc, typed_data};
|
|
2
|
+
use style::values::specified::calc::CalcNode;
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::calc::YCalc};
|
|
5
|
+
|
|
6
|
+
#[derive(TypedData)]
|
|
7
|
+
#[magnus(class = "Yass::Declarations::Calc::Negate", mark)]
|
|
8
|
+
pub struct YNegate {
|
|
9
|
+
child: CachedValue<CalcNode>
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl YNegate {
|
|
13
|
+
pub fn new(child: CalcNode) -> Self {
|
|
14
|
+
Self {
|
|
15
|
+
child: CachedValue::new(child, |calc_node, ruby| {
|
|
16
|
+
YCalc::make_node(calc_node, ruby)
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
pub fn children(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Result<RArray, Error> {
|
|
22
|
+
let result = ruby.ary_new_capa(1);
|
|
23
|
+
result.push(rb_self.child.get(ruby))?;
|
|
24
|
+
Ok(result)
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
impl DataTypeFunctions for YNegate {
|
|
29
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
30
|
+
self.child.mark(marker);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Error, RArray, Ruby, TypedData, gc, typed_data};
|
|
2
|
+
use style::{OwnedSlice, values::specified::calc::CalcNode};
|
|
3
|
+
|
|
4
|
+
use crate::{declarations::calc::YCalc, cached_value_list::CachedValueList};
|
|
5
|
+
|
|
6
|
+
#[derive(TypedData)]
|
|
7
|
+
#[magnus(class = "Yass::Declarations::Calc::Product", mark)]
|
|
8
|
+
pub struct YProduct {
|
|
9
|
+
children: CachedValueList<CalcNode>
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl YProduct {
|
|
13
|
+
pub fn new(children: &OwnedSlice<CalcNode>) -> Self {
|
|
14
|
+
Self {
|
|
15
|
+
children: CachedValueList::new(children.to_vec(), |calc_node, _ctx, ruby| {
|
|
16
|
+
YCalc::make_node(calc_node, ruby)
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
pub fn children(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Result<RArray, Error> {
|
|
22
|
+
rb_self.children.to_a(ruby)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
impl DataTypeFunctions for YProduct {
|
|
27
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
28
|
+
self.children.mark(marker);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Error, RArray, Ruby, TypedData, Value, gc, typed_data, value::Id};
|
|
2
|
+
use style::values::{generics::calc::RoundingStrategy, specified::calc::CalcNode};
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::calc::YCalc};
|
|
5
|
+
|
|
6
|
+
#[derive(TypedData)]
|
|
7
|
+
#[magnus(class = "Yass::Declarations::Calc::Round", mark)]
|
|
8
|
+
pub struct YRound {
|
|
9
|
+
rounding_strategy: RoundingStrategy,
|
|
10
|
+
value: CachedValue<CalcNode>,
|
|
11
|
+
step: CachedValue<CalcNode>
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
impl YRound {
|
|
15
|
+
pub fn new(rounding_strategy: RoundingStrategy, value: CalcNode, step: CalcNode) -> Self {
|
|
16
|
+
Self {
|
|
17
|
+
rounding_strategy,
|
|
18
|
+
|
|
19
|
+
value: CachedValue::new(value, |calc_node, ruby| {
|
|
20
|
+
YCalc::make_node(calc_node, ruby)
|
|
21
|
+
}),
|
|
22
|
+
|
|
23
|
+
step: CachedValue::new(step, |calc_node, ruby| {
|
|
24
|
+
YCalc::make_node(calc_node, ruby)
|
|
25
|
+
})
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
pub fn children(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Result<RArray, Error> {
|
|
30
|
+
let result = ruby.ary_new_capa(2);
|
|
31
|
+
result.push(rb_self.value.get(ruby))?;
|
|
32
|
+
result.push(rb_self.step.get(ruby))?;
|
|
33
|
+
Ok(result)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
37
|
+
rb_self.value.get(ruby)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
pub fn step(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
41
|
+
rb_self.step.get(ruby)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
pub fn rounding_strategy(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Id {
|
|
45
|
+
match rb_self.rounding_strategy {
|
|
46
|
+
RoundingStrategy::Nearest => ruby.intern("nearest"),
|
|
47
|
+
RoundingStrategy::Up => ruby.intern("up"),
|
|
48
|
+
RoundingStrategy::Down => ruby.intern("down"),
|
|
49
|
+
RoundingStrategy::ToZero => ruby.intern("tozero"),
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
impl DataTypeFunctions for YRound {
|
|
55
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
56
|
+
self.value.mark(marker);
|
|
57
|
+
self.step.mark(marker);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Error, RArray, Ruby, TypedData, gc, typed_data};
|
|
2
|
+
use style::values::specified::calc::CalcNode;
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::calc::YCalc};
|
|
5
|
+
|
|
6
|
+
#[derive(TypedData)]
|
|
7
|
+
#[magnus(class = "Yass::Declarations::Calc::Sign", mark)]
|
|
8
|
+
pub struct YSign {
|
|
9
|
+
child: CachedValue<CalcNode>
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl YSign {
|
|
13
|
+
pub fn new(child: CalcNode) -> Self {
|
|
14
|
+
Self {
|
|
15
|
+
child: CachedValue::new(child, |calc_node, ruby| {
|
|
16
|
+
YCalc::make_node(calc_node, ruby)
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
pub fn children(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Result<RArray, Error> {
|
|
22
|
+
let result = ruby.ary_new_capa(1);
|
|
23
|
+
result.push(rb_self.child.get(ruby))?;
|
|
24
|
+
Ok(result)
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
impl DataTypeFunctions for YSign {
|
|
29
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
30
|
+
self.child.mark(marker);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Error, RArray, Ruby, TypedData, gc, typed_data};
|
|
2
|
+
use style::{OwnedSlice, values::specified::calc::CalcNode};
|
|
3
|
+
|
|
4
|
+
use crate::{declarations::calc::YCalc, cached_value_list::CachedValueList};
|
|
5
|
+
|
|
6
|
+
#[derive(TypedData)]
|
|
7
|
+
#[magnus(class = "Yass::Declarations::Calc::Sum", mark)]
|
|
8
|
+
pub struct YSum {
|
|
9
|
+
children: CachedValueList<CalcNode>
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl YSum {
|
|
13
|
+
pub fn new(children: &OwnedSlice<CalcNode>) -> Self {
|
|
14
|
+
Self {
|
|
15
|
+
children: CachedValueList::new(children.to_vec(), |calc_node, _ctx, ruby| {
|
|
16
|
+
YCalc::make_node(calc_node, ruby)
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
pub fn children(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Result<RArray, Error> {
|
|
22
|
+
rb_self.children.to_a(ruby)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
impl DataTypeFunctions for YSum {
|
|
27
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
28
|
+
self.children.mark(marker);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
use magnus::{Ruby, typed_data, value::Id};
|
|
2
|
+
use style::values::specified::table::CaptionSide;
|
|
3
|
+
|
|
4
|
+
#[magnus::wrap(class = "Yass::Declarations::CaptionSide")]
|
|
5
|
+
pub struct YCaptionSide {
|
|
6
|
+
caption_side: CaptionSide
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
impl YCaptionSide {
|
|
10
|
+
pub fn new(caption_side: CaptionSide) -> Self {
|
|
11
|
+
Self { caption_side }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Id {
|
|
15
|
+
match rb_self.caption_side {
|
|
16
|
+
CaptionSide::Top => ruby.intern("top"),
|
|
17
|
+
CaptionSide::Bottom => ruby.intern("bottom"),
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::generics::color::GenericCaretColor;
|
|
3
|
+
use style::values::specified::color::Color;
|
|
4
|
+
|
|
5
|
+
use crate::declarations::color::color::make_color_or_auto;
|
|
6
|
+
use crate::{cached_value::CachedValue};
|
|
7
|
+
|
|
8
|
+
#[derive(TypedData)]
|
|
9
|
+
#[magnus(class = "Yass::Declarations::CaretColor", mark)]
|
|
10
|
+
pub struct YCaretColor {
|
|
11
|
+
color: CachedValue<GenericCaretColor<Color>>,
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
impl YCaretColor {
|
|
15
|
+
pub fn new(caret_color: GenericCaretColor<Color>) -> Self {
|
|
16
|
+
Self {
|
|
17
|
+
color: CachedValue::new(caret_color, |caret_color, ruby| {
|
|
18
|
+
make_color_or_auto(&caret_color.0, ruby)
|
|
19
|
+
}),
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
pub fn color(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
24
|
+
rb_self.color.get(ruby)
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
impl DataTypeFunctions for YCaretColor {
|
|
29
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
30
|
+
self.color.mark(marker);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
use magnus::{Ruby, typed_data, value::Id};
|
|
2
|
+
use style::color::parsing::ChannelKeyword;
|
|
3
|
+
|
|
4
|
+
#[magnus::wrap(class = "Yass::Declarations::ChannelKeyword")]
|
|
5
|
+
pub struct YChannelKeyword {
|
|
6
|
+
channel_keyword: ChannelKeyword
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
impl YChannelKeyword {
|
|
10
|
+
pub fn new(channel_keyword: ChannelKeyword) -> Self {
|
|
11
|
+
Self { channel_keyword }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Id {
|
|
15
|
+
match rb_self.channel_keyword {
|
|
16
|
+
ChannelKeyword::Alpha => ruby.intern("alpha"),
|
|
17
|
+
ChannelKeyword::A => ruby.intern("a"),
|
|
18
|
+
ChannelKeyword::B => ruby.intern("b"),
|
|
19
|
+
ChannelKeyword::C => ruby.intern("c"),
|
|
20
|
+
ChannelKeyword::G => ruby.intern("g"),
|
|
21
|
+
ChannelKeyword::H => ruby.intern("h"),
|
|
22
|
+
ChannelKeyword::L => ruby.intern("l"),
|
|
23
|
+
ChannelKeyword::R => ruby.intern("r"),
|
|
24
|
+
ChannelKeyword::S => ruby.intern("s"),
|
|
25
|
+
ChannelKeyword::W => ruby.intern("w"),
|
|
26
|
+
ChannelKeyword::X => ruby.intern("x"),
|
|
27
|
+
ChannelKeyword::Y => ruby.intern("y"),
|
|
28
|
+
ChannelKeyword::Z => ruby.intern("z"),
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
use magnus::{Ruby, typed_data, value::Id};
|
|
2
|
+
use style::values::computed::Clear;
|
|
3
|
+
|
|
4
|
+
#[magnus::wrap(class = "Yass::Declarations::Clear")]
|
|
5
|
+
pub struct YClear {
|
|
6
|
+
clear: Clear
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
impl YClear {
|
|
10
|
+
pub fn new(clear: Clear) -> Self {
|
|
11
|
+
Self { clear }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Id {
|
|
15
|
+
match rb_self.clear {
|
|
16
|
+
Clear::None => ruby.intern("none"),
|
|
17
|
+
Clear::Left => ruby.intern("left"),
|
|
18
|
+
Clear::Right => ruby.intern("right"),
|
|
19
|
+
Clear::Both => ruby.intern("both"),
|
|
20
|
+
Clear::InlineStart => ruby.intern("inline_start"),
|
|
21
|
+
Clear::InlineEnd => ruby.intern("inline_end"),
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, IntoValue, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::{generics::{ClipRect, ClipRectOrAuto, length::LengthPercentageOrAuto}, specified::Length};
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::length::length_to_value};
|
|
5
|
+
|
|
6
|
+
type ClipSide = LengthPercentageOrAuto<Length>;
|
|
7
|
+
type ClipRectValue = ClipRect<ClipSide>;
|
|
8
|
+
type ClipValue = ClipRectOrAuto<ClipRectValue>;
|
|
9
|
+
|
|
10
|
+
fn make_clip_value(value: &ClipValue, ruby: &Ruby) -> Value {
|
|
11
|
+
match value {
|
|
12
|
+
ClipRectOrAuto::Auto => YClipAuto::new().into_value_with(ruby),
|
|
13
|
+
ClipRectOrAuto::Rect(rect) => YClipRect::new(rect.clone()).into_value_with(ruby),
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
fn make_clip_side(value: &ClipSide, ruby: &Ruby) -> Value {
|
|
18
|
+
match value {
|
|
19
|
+
LengthPercentageOrAuto::Auto => YClipLengthAuto::new().into_value_with(ruby),
|
|
20
|
+
LengthPercentageOrAuto::LengthPercentage(length) => {
|
|
21
|
+
YClipLength::new(length.clone()).into_value_with(ruby)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
#[derive(TypedData)]
|
|
27
|
+
#[magnus(class = "Yass::Declarations::Clip", mark)]
|
|
28
|
+
pub struct YClip {
|
|
29
|
+
value: CachedValue<ClipValue>,
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
impl YClip {
|
|
33
|
+
pub fn new(specified_value: Box<ClipRectOrAuto<ClipRect<LengthPercentageOrAuto<Length>>>>) -> Self {
|
|
34
|
+
Self {
|
|
35
|
+
value: CachedValue::new(*specified_value, make_clip_value),
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
40
|
+
rb_self.value.get(ruby)
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
impl DataTypeFunctions for YClip {
|
|
45
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
46
|
+
self.value.mark(marker);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
#[magnus::wrap(class = "Yass::Declarations::Clip::Auto")]
|
|
51
|
+
pub struct YClipAuto {}
|
|
52
|
+
|
|
53
|
+
impl YClipAuto {
|
|
54
|
+
pub fn new() -> Self {
|
|
55
|
+
Self {}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
#[derive(TypedData)]
|
|
60
|
+
#[magnus(class = "Yass::Declarations::Clip::Rect", mark)]
|
|
61
|
+
pub struct YClipRect {
|
|
62
|
+
top: CachedValue<ClipSide>,
|
|
63
|
+
right: CachedValue<ClipSide>,
|
|
64
|
+
bottom: CachedValue<ClipSide>,
|
|
65
|
+
left: CachedValue<ClipSide>,
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
impl YClipRect {
|
|
69
|
+
pub fn new(rect: ClipRectValue) -> Self {
|
|
70
|
+
Self {
|
|
71
|
+
top: CachedValue::new(rect.top, make_clip_side),
|
|
72
|
+
right: CachedValue::new(rect.right, make_clip_side),
|
|
73
|
+
bottom: CachedValue::new(rect.bottom, make_clip_side),
|
|
74
|
+
left: CachedValue::new(rect.left, make_clip_side),
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
pub fn top(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
79
|
+
rb_self.top.get(ruby)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
pub fn right(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
83
|
+
rb_self.right.get(ruby)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
pub fn bottom(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
87
|
+
rb_self.bottom.get(ruby)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
pub fn left(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
91
|
+
rb_self.left.get(ruby)
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
impl DataTypeFunctions for YClipRect {
|
|
96
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
97
|
+
self.top.mark(marker);
|
|
98
|
+
self.right.mark(marker);
|
|
99
|
+
self.bottom.mark(marker);
|
|
100
|
+
self.left.mark(marker);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
#[derive(TypedData)]
|
|
105
|
+
#[magnus(class = "Yass::Declarations::Clip::Length", mark)]
|
|
106
|
+
pub struct YClipLength {
|
|
107
|
+
length: CachedValue<Length>,
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
impl YClipLength {
|
|
111
|
+
pub fn new(length: Length) -> Self {
|
|
112
|
+
Self {
|
|
113
|
+
length: CachedValue::new(length, |length, ruby| length_to_value(length, ruby)),
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
118
|
+
rb_self.length.get(ruby)
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
impl DataTypeFunctions for YClipLength {
|
|
123
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
124
|
+
self.length.mark(marker);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
#[magnus::wrap(class = "Yass::Declarations::Clip::LengthAuto")]
|
|
129
|
+
pub struct YClipLengthAuto {}
|
|
130
|
+
|
|
131
|
+
impl YClipLengthAuto {
|
|
132
|
+
pub fn new() -> Self {
|
|
133
|
+
Self {}
|
|
134
|
+
}
|
|
135
|
+
}
|