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,107 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Error, IntoValue, RArray, RString, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::{computed::Quotes, specified::list::{QuoteList, QuotePair}};
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, cached_value_list::CachedValueList};
|
|
5
|
+
|
|
6
|
+
fn make_quotes_value(quotes: &Quotes, ruby: &Ruby) -> Value {
|
|
7
|
+
match quotes {
|
|
8
|
+
Quotes::Auto => YQuotesAuto::new().into_value_with(ruby),
|
|
9
|
+
Quotes::QuoteList(quote_list) if quote_list.0.is_empty() => {
|
|
10
|
+
YQuotesNone::new().into_value_with(ruby)
|
|
11
|
+
}
|
|
12
|
+
Quotes::QuoteList(quote_list) => {
|
|
13
|
+
YQuotesQuoteList::new(quote_list.clone()).into_value_with(ruby)
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
#[derive(TypedData)]
|
|
19
|
+
#[magnus(class = "Yass::Declarations::Quotes", mark)]
|
|
20
|
+
pub struct YQuotes {
|
|
21
|
+
quotes: CachedValue<Quotes>,
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
impl YQuotes {
|
|
25
|
+
pub fn new(quotes: Quotes) -> Self {
|
|
26
|
+
Self {
|
|
27
|
+
quotes: CachedValue::new(quotes, make_quotes_value),
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
32
|
+
rb_self.quotes.get(ruby)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
impl DataTypeFunctions for YQuotes {
|
|
37
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
38
|
+
self.quotes.mark(marker);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#[magnus::wrap(class = "Yass::Declarations::Quotes::Auto")]
|
|
43
|
+
pub struct YQuotesAuto {}
|
|
44
|
+
|
|
45
|
+
impl YQuotesAuto {
|
|
46
|
+
pub fn new() -> Self {
|
|
47
|
+
Self {}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
#[magnus::wrap(class = "Yass::Declarations::Quotes::None")]
|
|
52
|
+
pub struct YQuotesNone {}
|
|
53
|
+
|
|
54
|
+
impl YQuotesNone {
|
|
55
|
+
pub fn new() -> Self {
|
|
56
|
+
Self {}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
#[derive(TypedData)]
|
|
61
|
+
#[magnus(class = "Yass::Declarations::Quotes::QuoteList", mark)]
|
|
62
|
+
pub struct YQuotesQuoteList {
|
|
63
|
+
values: CachedValueList<QuotePair>,
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
impl YQuotesQuoteList {
|
|
67
|
+
pub fn new(quote_list: QuoteList) -> Self {
|
|
68
|
+
Self {
|
|
69
|
+
values: CachedValueList::new(quote_list.0.iter().cloned().collect(), |quote_pair, _ctx, ruby| {
|
|
70
|
+
YQuotesQuotePair::new(quote_pair.clone()).into_value_with(ruby)
|
|
71
|
+
}),
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
pub fn values(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Result<RArray, Error> {
|
|
76
|
+
rb_self.values.to_a(ruby)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
impl DataTypeFunctions for YQuotesQuoteList {
|
|
81
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
82
|
+
self.values.mark(marker);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
#[magnus::wrap(class = "Yass::Declarations::Quotes::QuotePair")]
|
|
87
|
+
pub struct YQuotesQuotePair {
|
|
88
|
+
opening: String,
|
|
89
|
+
closing: String,
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
impl YQuotesQuotePair {
|
|
93
|
+
pub fn new(quote_pair: QuotePair) -> Self {
|
|
94
|
+
Self {
|
|
95
|
+
opening: quote_pair.opening.to_string(),
|
|
96
|
+
closing: quote_pair.closing.to_string(),
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
pub fn opening(ruby: &Ruby, rb_self: &Self) -> RString {
|
|
101
|
+
ruby.str_new(&rb_self.opening)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
pub fn closing(ruby: &Ruby, rb_self: &Self) -> RString {
|
|
105
|
+
ruby.str_new(&rb_self.closing)
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
use magnus::{Ruby, typed_data};
|
|
2
|
+
use style::values::specified::Resolution;
|
|
3
|
+
|
|
4
|
+
#[magnus::wrap(class = "Yass::Declarations::Resolution")]
|
|
5
|
+
pub struct YResolution {
|
|
6
|
+
resolution: Resolution
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
impl YResolution {
|
|
10
|
+
pub fn new(resolution: Resolution) -> Self {
|
|
11
|
+
Self { resolution }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
pub fn dpi(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> f32 {
|
|
15
|
+
rb_self.resolution.dpi()
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::specified::Inset;
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::inset::make_inset};
|
|
5
|
+
|
|
6
|
+
#[derive(TypedData)]
|
|
7
|
+
#[magnus(class = "Yass::Declarations::Right", mark)]
|
|
8
|
+
pub struct YRight {
|
|
9
|
+
inset: CachedValue<Inset>,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl YRight {
|
|
13
|
+
pub fn new(inset: Inset) -> Self {
|
|
14
|
+
Self {
|
|
15
|
+
inset: CachedValue::new(inset, |value, ruby| make_inset(value, ruby)),
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
20
|
+
rb_self.inset.get(ruby)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
impl DataTypeFunctions for YRight {
|
|
25
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
26
|
+
self.inset.mark(marker);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, IntoValue, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::{generics::transform::Rotate, specified::{Angle, Number}};
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::{angle::YAngle, number::YNumber}};
|
|
5
|
+
|
|
6
|
+
fn make_rotate_value(value: &Rotate<Number, Angle>, ruby: &Ruby) -> Value {
|
|
7
|
+
match value {
|
|
8
|
+
Rotate::None => YRotateNone::new().into_value_with(ruby),
|
|
9
|
+
Rotate::Rotate(angle) => YAngle::new(angle.clone()).into_value_with(ruby),
|
|
10
|
+
Rotate::Rotate3D(x, y, z, angle) => {
|
|
11
|
+
YRotate3D::new(*x, *y, *z, *angle).into_value_with(ruby)
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
#[derive(TypedData)]
|
|
17
|
+
#[magnus(class = "Yass::Declarations::Rotate", mark)]
|
|
18
|
+
pub struct YRotate {
|
|
19
|
+
value: CachedValue<Rotate<Number, Angle>>,
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
impl YRotate {
|
|
23
|
+
pub fn new(specified_value: Box<Rotate<Number, Angle>>) -> Self {
|
|
24
|
+
Self {
|
|
25
|
+
value: CachedValue::new(*specified_value, make_rotate_value),
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
30
|
+
rb_self.value.get(ruby)
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
impl DataTypeFunctions for YRotate {
|
|
35
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
36
|
+
self.value.mark(marker);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
#[magnus::wrap(class = "Yass::Declarations::Rotate::None")]
|
|
41
|
+
pub struct YRotateNone {}
|
|
42
|
+
|
|
43
|
+
impl YRotateNone {
|
|
44
|
+
pub fn new() -> Self {
|
|
45
|
+
Self {}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
#[derive(TypedData)]
|
|
50
|
+
#[magnus(class = "Yass::Declarations::Rotate::Rotate3D", mark)]
|
|
51
|
+
pub struct YRotate3D {
|
|
52
|
+
x: CachedValue<Number>,
|
|
53
|
+
y: CachedValue<Number>,
|
|
54
|
+
z: CachedValue<Number>,
|
|
55
|
+
angle: CachedValue<Angle>,
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
impl YRotate3D {
|
|
59
|
+
pub fn new(x: Number, y: Number, z: Number, angle: Angle) -> Self {
|
|
60
|
+
Self {
|
|
61
|
+
x: CachedValue::new(x, |number, ruby| {
|
|
62
|
+
YNumber::new(number.get()).into_value_with(ruby)
|
|
63
|
+
}),
|
|
64
|
+
|
|
65
|
+
y: CachedValue::new(y, |number, ruby| {
|
|
66
|
+
YNumber::new(number.get()).into_value_with(ruby)
|
|
67
|
+
}),
|
|
68
|
+
|
|
69
|
+
z: CachedValue::new(z, |number, ruby| {
|
|
70
|
+
YNumber::new(number.get()).into_value_with(ruby)
|
|
71
|
+
}),
|
|
72
|
+
|
|
73
|
+
angle: CachedValue::new(angle, |angle, ruby| {
|
|
74
|
+
YAngle::new(*angle).into_value_with(ruby)
|
|
75
|
+
}),
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
pub fn x(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
80
|
+
rb_self.x.get(ruby)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
pub fn y(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
84
|
+
rb_self.y.get(ruby)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
pub fn z(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
88
|
+
rb_self.z.get(ruby)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
pub fn angle(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
92
|
+
rb_self.angle.get(ruby)
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
impl DataTypeFunctions for YRotate3D {
|
|
97
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
98
|
+
self.x.mark(marker);
|
|
99
|
+
self.y.mark(marker);
|
|
100
|
+
self.z.mark(marker);
|
|
101
|
+
self.angle.mark(marker);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, IntoValue, Ruby, TypedData, Value, gc::Marker, typed_data};
|
|
2
|
+
use style::values::{generics::{NonNegative, length::LengthPercentageOrNormal}, specified::LengthPercentage};
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::size::length_percentage_to_value};
|
|
5
|
+
|
|
6
|
+
type RowGapValue = LengthPercentageOrNormal<NonNegative<LengthPercentage>>;
|
|
7
|
+
|
|
8
|
+
fn row_gap_to_value(value: &RowGapValue, ruby: &Ruby) -> Value {
|
|
9
|
+
match value {
|
|
10
|
+
LengthPercentageOrNormal::Normal => YRowGapNormal::new().into_value_with(ruby),
|
|
11
|
+
LengthPercentageOrNormal::LengthPercentage(length_percentage) => {
|
|
12
|
+
YRowGapLengthPercentage::new(length_percentage.clone()).into_value_with(ruby)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
#[derive(TypedData)]
|
|
18
|
+
#[magnus(class = "Yass::Declarations::RowGap", mark)]
|
|
19
|
+
pub struct YRowGap {
|
|
20
|
+
value: CachedValue<RowGapValue>,
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
impl YRowGap {
|
|
24
|
+
pub fn new(value: RowGapValue) -> Self {
|
|
25
|
+
Self {
|
|
26
|
+
value: CachedValue::new(value, row_gap_to_value),
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
31
|
+
rb_self.value.get(ruby)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
impl DataTypeFunctions for YRowGap {
|
|
36
|
+
fn mark(&self, marker: &Marker) {
|
|
37
|
+
self.value.mark(marker);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
#[magnus::wrap(class = "Yass::Declarations::RowGap::Normal")]
|
|
42
|
+
pub struct YRowGapNormal {}
|
|
43
|
+
|
|
44
|
+
impl YRowGapNormal {
|
|
45
|
+
pub fn new() -> Self {
|
|
46
|
+
Self {}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
#[derive(TypedData)]
|
|
51
|
+
#[magnus(class = "Yass::Declarations::RowGap::LengthPercentage", mark)]
|
|
52
|
+
pub struct YRowGapLengthPercentage {
|
|
53
|
+
length_percentage: CachedValue<NonNegative<LengthPercentage>>,
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
impl YRowGapLengthPercentage {
|
|
57
|
+
pub fn new(length_percentage: NonNegative<LengthPercentage>) -> Self {
|
|
58
|
+
Self {
|
|
59
|
+
length_percentage: CachedValue::new(length_percentage, |value, ruby| {
|
|
60
|
+
length_percentage_to_value(&value.0, ruby)
|
|
61
|
+
}),
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
66
|
+
rb_self.length_percentage.get(ruby)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
impl DataTypeFunctions for YRowGapLengthPercentage {
|
|
71
|
+
fn mark(&self, marker: &Marker) {
|
|
72
|
+
self.length_percentage.mark(marker);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, IntoValue, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::{generics::transform::Scale, specified::Number};
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::number::YNumber};
|
|
5
|
+
|
|
6
|
+
fn make_scale_value(value: &Scale<Number>, ruby: &Ruby) -> Value {
|
|
7
|
+
match value {
|
|
8
|
+
Scale::None => YScaleNone::new().into_value_with(ruby),
|
|
9
|
+
Scale::Scale(x, y, z) => YScaleCoords::new(*x, *y, *z).into_value_with(ruby),
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
#[derive(TypedData)]
|
|
14
|
+
#[magnus(class = "Yass::Declarations::Scale", mark)]
|
|
15
|
+
pub struct YScale {
|
|
16
|
+
value: CachedValue<Scale<Number>>,
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
impl YScale {
|
|
20
|
+
pub fn new(specified_value: Box<Scale<Number>>) -> Self {
|
|
21
|
+
Self {
|
|
22
|
+
value: CachedValue::new(*specified_value, make_scale_value),
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
27
|
+
rb_self.value.get(ruby)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
impl DataTypeFunctions for YScale {
|
|
32
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
33
|
+
self.value.mark(marker);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
#[magnus::wrap(class = "Yass::Declarations::Scale::None")]
|
|
38
|
+
pub struct YScaleNone {}
|
|
39
|
+
|
|
40
|
+
impl YScaleNone {
|
|
41
|
+
pub fn new() -> Self {
|
|
42
|
+
Self {}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
#[derive(TypedData)]
|
|
47
|
+
#[magnus(class = "Yass::Declarations::Scale::Coords", mark)]
|
|
48
|
+
pub struct YScaleCoords {
|
|
49
|
+
x: CachedValue<Number>,
|
|
50
|
+
y: CachedValue<Number>,
|
|
51
|
+
z: CachedValue<Number>,
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
impl YScaleCoords {
|
|
55
|
+
pub fn new(x: Number, y: Number, z: Number) -> Self {
|
|
56
|
+
Self {
|
|
57
|
+
x: CachedValue::new(x, |number, ruby| {
|
|
58
|
+
YNumber::new(number.get()).into_value_with(ruby)
|
|
59
|
+
}),
|
|
60
|
+
|
|
61
|
+
y: CachedValue::new(y, |number, ruby| {
|
|
62
|
+
YNumber::new(number.get()).into_value_with(ruby)
|
|
63
|
+
}),
|
|
64
|
+
|
|
65
|
+
z: CachedValue::new(z, |number, ruby| {
|
|
66
|
+
YNumber::new(number.get()).into_value_with(ruby)
|
|
67
|
+
}),
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
pub fn x(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
72
|
+
rb_self.x.get(ruby)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
pub fn y(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
76
|
+
rb_self.y.get(ruby)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
pub fn z(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
80
|
+
rb_self.z.get(ruby)
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
impl DataTypeFunctions for YScaleCoords {
|
|
85
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
86
|
+
self.x.mark(marker);
|
|
87
|
+
self.y.mark(marker);
|
|
88
|
+
self.z.mark(marker);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
use magnus::{Ruby, typed_data, value::Id};
|
|
2
|
+
use style::computed_values::_servo_overflow_clip_box::T;
|
|
3
|
+
|
|
4
|
+
#[magnus::wrap(class = "Yass::Declarations::ServoOverflowClipBox")]
|
|
5
|
+
pub struct YServoOverflowClipBox {
|
|
6
|
+
specified_value: T
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
impl YServoOverflowClipBox {
|
|
10
|
+
pub fn new(specified_value: T) -> Self {
|
|
11
|
+
Self { specified_value }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Id {
|
|
15
|
+
match rb_self.specified_value {
|
|
16
|
+
T::PaddingBox => ruby.intern("padding_box"),
|
|
17
|
+
T::ContentBox => ruby.intern("content_box"),
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
use magnus::{Ruby, typed_data, value::Id};
|
|
2
|
+
use style::computed_values::_servo_top_layer::T;
|
|
3
|
+
|
|
4
|
+
#[magnus::wrap(class = "Yass::Declarations::ServoTopLayer")]
|
|
5
|
+
pub struct YServoTopLayer {
|
|
6
|
+
specified_value: T
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
impl YServoTopLayer {
|
|
10
|
+
pub fn new(specified_value: T) -> Self {
|
|
11
|
+
Self { specified_value }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Id {
|
|
15
|
+
match rb_self.specified_value {
|
|
16
|
+
T::None => ruby.intern("none"),
|
|
17
|
+
T::Top => ruby.intern("top"),
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, IntoValue, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::{generics::{NonNegative, Optional, length::{AnchorSizeKeyword, GenericAnchorSizeFunction, MaxSize}}, specified::LengthPercentage};
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::size::{anchor_size_keyword::YAnchorSizeKeyword, make_max_size}};
|
|
5
|
+
|
|
6
|
+
#[derive(TypedData)]
|
|
7
|
+
#[magnus(class = "Yass::Declarations::Size::AnchorMaxSizeFunction", mark)]
|
|
8
|
+
pub struct YAnchorMaxSizeFunction {
|
|
9
|
+
target_element: CachedValue<String>,
|
|
10
|
+
size: CachedValue<AnchorSizeKeyword>,
|
|
11
|
+
fallback: CachedValue<Optional<MaxSize<NonNegative<LengthPercentage>>>>
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
impl YAnchorMaxSizeFunction {
|
|
15
|
+
pub fn new(anchor_size: GenericAnchorSizeFunction<MaxSize<NonNegative<LengthPercentage>>>) -> Self {
|
|
16
|
+
Self {
|
|
17
|
+
target_element: CachedValue::new(anchor_size.target_element.value.0.to_string(), |el, ruby| {
|
|
18
|
+
ruby.str_new(el).into_value_with(ruby)
|
|
19
|
+
}),
|
|
20
|
+
|
|
21
|
+
size: CachedValue::new(anchor_size.size, |size, ruby| {
|
|
22
|
+
YAnchorSizeKeyword::new(*size).into_value_with(ruby)
|
|
23
|
+
}),
|
|
24
|
+
|
|
25
|
+
fallback: CachedValue::new(anchor_size.fallback, |fallback, ruby| {
|
|
26
|
+
match fallback {
|
|
27
|
+
Optional::Some(fb) => make_max_size(fb, ruby).into_value_with(ruby),
|
|
28
|
+
Optional::None => ruby.qnil().into_value_with(ruby)
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
pub fn target_element(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
35
|
+
rb_self.target_element.get(ruby)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
pub fn size(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
39
|
+
rb_self.size.get(ruby)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
pub fn fallback(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
43
|
+
rb_self.fallback.get(ruby)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
impl DataTypeFunctions for YAnchorMaxSizeFunction {
|
|
48
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
49
|
+
self.target_element.mark(marker);
|
|
50
|
+
self.size.mark(marker);
|
|
51
|
+
self.fallback.mark(marker);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, IntoValue, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::{generics::{NonNegative, Optional, length::{AnchorSizeKeyword, GenericAnchorSizeFunction, Size}}, specified::LengthPercentage};
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::size::{anchor_size_keyword::YAnchorSizeKeyword, make_size}};
|
|
5
|
+
|
|
6
|
+
#[derive(TypedData)]
|
|
7
|
+
#[magnus(class = "Yass::Declarations::Size::AnchorSizeFunction", mark)]
|
|
8
|
+
pub struct YAnchorSizeFunction {
|
|
9
|
+
target_element: CachedValue<String>,
|
|
10
|
+
size: CachedValue<AnchorSizeKeyword>,
|
|
11
|
+
fallback: CachedValue<Optional<Size<NonNegative<LengthPercentage>>>>
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
impl YAnchorSizeFunction {
|
|
15
|
+
pub fn new(anchor_size: GenericAnchorSizeFunction<Size<NonNegative<LengthPercentage>>>) -> Self {
|
|
16
|
+
Self {
|
|
17
|
+
target_element: CachedValue::new(anchor_size.target_element.value.0.to_string(), |el, ruby| {
|
|
18
|
+
ruby.str_new(el).into_value_with(ruby)
|
|
19
|
+
}),
|
|
20
|
+
|
|
21
|
+
size: CachedValue::new(anchor_size.size, |size, ruby| {
|
|
22
|
+
YAnchorSizeKeyword::new(*size).into_value_with(ruby)
|
|
23
|
+
}),
|
|
24
|
+
|
|
25
|
+
fallback: CachedValue::new(anchor_size.fallback, |fallback, ruby| {
|
|
26
|
+
match fallback {
|
|
27
|
+
Optional::Some(fb) => {
|
|
28
|
+
make_size(fb, ruby).into_value_with(ruby)
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
Optional::None => ruby.qnil().into_value_with(ruby)
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
pub fn target_element(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
38
|
+
rb_self.target_element.get(ruby)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
pub fn size(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
42
|
+
rb_self.size.get(ruby)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
pub fn fallback(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
46
|
+
rb_self.fallback.get(ruby)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
impl DataTypeFunctions for YAnchorSizeFunction {
|
|
51
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
52
|
+
self.target_element.mark(marker);
|
|
53
|
+
self.size.mark(marker);
|
|
54
|
+
self.fallback.mark(marker);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
use magnus::{Ruby, typed_data, value::Id};
|
|
2
|
+
use style::values::generics::length::AnchorSizeKeyword;
|
|
3
|
+
|
|
4
|
+
#[magnus::wrap(class = "Yass::Declarations::Calc::AnchorSizeKeyword")]
|
|
5
|
+
pub struct YAnchorSizeKeyword {
|
|
6
|
+
anchor_size_keyword: AnchorSizeKeyword
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
impl YAnchorSizeKeyword {
|
|
10
|
+
pub fn new(anchor_size_keyword: AnchorSizeKeyword) -> Self {
|
|
11
|
+
Self { anchor_size_keyword }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Id {
|
|
15
|
+
match rb_self.anchor_size_keyword {
|
|
16
|
+
AnchorSizeKeyword::None => unreachable!(),
|
|
17
|
+
AnchorSizeKeyword::Width => ruby.intern("width"),
|
|
18
|
+
AnchorSizeKeyword::Height => ruby.intern("height"),
|
|
19
|
+
AnchorSizeKeyword::Block => ruby.intern("block"),
|
|
20
|
+
AnchorSizeKeyword::Inline => ruby.intern("inline"),
|
|
21
|
+
AnchorSizeKeyword::SelfBlock => ruby.intern("self_block"),
|
|
22
|
+
AnchorSizeKeyword::SelfInline => ruby.intern("self_inline"),
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
use magnus::{Error, Module, RModule, Ruby, method};
|
|
2
|
+
|
|
3
|
+
use crate::declarations::size::{YAnchorContainingCalcFunction, YFitContentFunction, YLengthPercentage, anchor_max_size_function::YAnchorMaxSizeFunction, anchor_size_function::YAnchorSizeFunction, anchor_size_keyword::YAnchorSizeKeyword};
|
|
4
|
+
|
|
5
|
+
pub fn init(ruby: &Ruby, _yass_module: &RModule, declarations_module: &RModule) -> Result<(), Error> {
|
|
6
|
+
let size_module = declarations_module.define_module("Size")?;
|
|
7
|
+
|
|
8
|
+
let length_percentage_class = size_module.define_class("LengthPercentage", ruby.class_object())?;
|
|
9
|
+
length_percentage_class.define_method("value", method!(YLengthPercentage::value, 0))?;
|
|
10
|
+
|
|
11
|
+
let _none_class = size_module.define_class("None", ruby.class_object())?;
|
|
12
|
+
|
|
13
|
+
let _auto_class = size_module.define_class("Auto", ruby.class_object())?;
|
|
14
|
+
|
|
15
|
+
let _max_content_class = size_module.define_class("MaxContent", ruby.class_object())?;
|
|
16
|
+
|
|
17
|
+
let _min_content_class = size_module.define_class("MinContent", ruby.class_object())?;
|
|
18
|
+
|
|
19
|
+
let _fit_content_class = size_module.define_class("FitContent", ruby.class_object())?;
|
|
20
|
+
|
|
21
|
+
let _webkit_fill_available_class = size_module.define_class("WebkitFillAvailable", ruby.class_object())?;
|
|
22
|
+
|
|
23
|
+
let _stretch_class = size_module.define_class("Stretch", ruby.class_object())?;
|
|
24
|
+
|
|
25
|
+
let fit_content_function_class = size_module.define_class("FitContentFunction", ruby.class_object())?;
|
|
26
|
+
fit_content_function_class.define_method("value", method!(YFitContentFunction::value, 0))?;
|
|
27
|
+
|
|
28
|
+
let anchor_containing_calc_function_class = size_module.define_class("AnchorContainingCalcFunction", ruby.class_object())?;
|
|
29
|
+
anchor_containing_calc_function_class.define_method("value", method!(YAnchorContainingCalcFunction::value, 0))?;
|
|
30
|
+
|
|
31
|
+
let anchor_size_function_class = size_module.define_class("AnchorSizeFunction", ruby.class_object())?;
|
|
32
|
+
anchor_size_function_class.define_method("target_element", method!(YAnchorSizeFunction::target_element, 0))?;
|
|
33
|
+
anchor_size_function_class.define_method("size", method!(YAnchorSizeFunction::size, 0))?;
|
|
34
|
+
anchor_size_function_class.define_method("fallback", method!(YAnchorSizeFunction::fallback, 0))?;
|
|
35
|
+
|
|
36
|
+
let anchor_max_size_function_class = size_module.define_class("AnchorMaxSizeFunction", ruby.class_object())?;
|
|
37
|
+
anchor_max_size_function_class.define_method("target_element", method!(YAnchorMaxSizeFunction::target_element, 0))?;
|
|
38
|
+
anchor_max_size_function_class.define_method("size", method!(YAnchorMaxSizeFunction::size, 0))?;
|
|
39
|
+
anchor_max_size_function_class.define_method("fallback", method!(YAnchorMaxSizeFunction::fallback, 0))?;
|
|
40
|
+
|
|
41
|
+
let anchor_size_keyword_class = size_module.define_class("AnchorSizeKeyword", ruby.class_object())?;
|
|
42
|
+
anchor_size_keyword_class.define_method("value", method!(YAnchorSizeKeyword::value, 0))?;
|
|
43
|
+
|
|
44
|
+
Ok(())
|
|
45
|
+
}
|