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,23 @@
|
|
|
1
|
+
use magnus::{Ruby, typed_data, value::Id};
|
|
2
|
+
use style::values::computed::LineBreak;
|
|
3
|
+
|
|
4
|
+
#[magnus::wrap(class = "Yass::Declarations::LineBreak")]
|
|
5
|
+
pub struct YLineBreak {
|
|
6
|
+
line_break: LineBreak
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
impl YLineBreak {
|
|
10
|
+
pub fn new(line_break: LineBreak) -> Self {
|
|
11
|
+
Self { line_break }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Id {
|
|
15
|
+
match rb_self.line_break {
|
|
16
|
+
LineBreak::Auto => ruby.intern("auto"),
|
|
17
|
+
LineBreak::Loose => ruby.intern("loose"),
|
|
18
|
+
LineBreak::Normal => ruby.intern("normal"),
|
|
19
|
+
LineBreak::Strict => ruby.intern("strict"),
|
|
20
|
+
LineBreak::Anywhere => ruby.intern("anywhere"),
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, IntoValue, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::generics::font::GenericLineHeight;
|
|
3
|
+
use style::values::specified::{LineHeight};
|
|
4
|
+
|
|
5
|
+
use crate::declarations::size::length_percentage_to_value;
|
|
6
|
+
use crate::{cached_value::CachedValue, declarations::{number::YNumber}};
|
|
7
|
+
|
|
8
|
+
fn make_line_height(line_height: &LineHeight, ruby: &Ruby) -> Value {
|
|
9
|
+
match line_height {
|
|
10
|
+
GenericLineHeight::Normal => YLineHeightNormal::new().into_value_with(ruby),
|
|
11
|
+
GenericLineHeight::Number(non_negative_number) => {
|
|
12
|
+
YNumber::new(non_negative_number.get()).into_value_with(ruby).into_value_with(ruby)
|
|
13
|
+
},
|
|
14
|
+
GenericLineHeight::Length(non_negative_lp) => {
|
|
15
|
+
length_percentage_to_value(&non_negative_lp.0, ruby)
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
#[derive(TypedData)]
|
|
21
|
+
#[magnus(class = "Yass::Declarations::LineHeight", mark)]
|
|
22
|
+
pub struct YLineHeight {
|
|
23
|
+
value: CachedValue<LineHeight>,
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
impl YLineHeight {
|
|
27
|
+
pub fn new(line_height: LineHeight) -> Self {
|
|
28
|
+
Self {
|
|
29
|
+
value: CachedValue::new(line_height, make_line_height),
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
34
|
+
rb_self.value.get(ruby)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
impl DataTypeFunctions for YLineHeight {
|
|
39
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
40
|
+
self.value.mark(marker);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
#[magnus::wrap(class = "Yass::Declarations::LineHeight::Normal")]
|
|
45
|
+
pub struct YLineHeightNormal {}
|
|
46
|
+
|
|
47
|
+
impl YLineHeightNormal {
|
|
48
|
+
pub fn new() -> Self {
|
|
49
|
+
Self {}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::specified::Image;
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::images::image_to_value};
|
|
5
|
+
|
|
6
|
+
#[derive(TypedData)]
|
|
7
|
+
#[magnus(class = "Yass::Declarations::ListStyleImage", mark)]
|
|
8
|
+
pub struct YListStyleImage {
|
|
9
|
+
image: CachedValue<Image>,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl YListStyleImage {
|
|
13
|
+
pub fn new(image: Image) -> Self {
|
|
14
|
+
Self {
|
|
15
|
+
image: CachedValue::new(image, |image, ruby| image_to_value(image, ruby)),
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
pub fn image(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
20
|
+
rb_self.image.get(ruby)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
impl DataTypeFunctions for YListStyleImage {
|
|
25
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
26
|
+
self.image.mark(marker);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
use magnus::{Ruby, typed_data, value::Id};
|
|
2
|
+
use style::computed_values::list_style_position::T;
|
|
3
|
+
|
|
4
|
+
#[magnus::wrap(class = "Yass::Declarations::ListStylePosition")]
|
|
5
|
+
pub struct YListStylePosition {
|
|
6
|
+
specified_value: T
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
impl YListStylePosition {
|
|
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::Inside => ruby.intern("inside"),
|
|
17
|
+
T::Outside => ruby.intern("outside"),
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Error, IntoValue, RArray, RString, Ruby, TypedData, Value, gc, typed_data, value::Id};
|
|
2
|
+
use style::{counter_style::{CounterStyle, Symbol, Symbols, SymbolsType}, values::computed::ListStyleType};
|
|
3
|
+
|
|
4
|
+
use crate::cached_value::CachedValue;
|
|
5
|
+
|
|
6
|
+
fn make_list_style_type_value(list_style_type: &ListStyleType, ruby: &Ruby) -> Value {
|
|
7
|
+
match &list_style_type.0 {
|
|
8
|
+
CounterStyle::None => YListStyleTypeNone::new().into_value_with(ruby),
|
|
9
|
+
CounterStyle::Name(name) => YListStyleTypeName::new(name.0.to_string()).into_value_with(ruby),
|
|
10
|
+
CounterStyle::String(value) => YListStyleTypeString::new(value.to_string()).into_value_with(ruby),
|
|
11
|
+
CounterStyle::Symbols { ty, symbols } => {
|
|
12
|
+
YListStyleTypeSymbols::new(*ty, symbols.clone()).into_value_with(ruby)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
fn symbols_type_name(symbols_type: SymbolsType) -> &'static str {
|
|
18
|
+
match symbols_type {
|
|
19
|
+
SymbolsType::Cyclic => "cyclic",
|
|
20
|
+
SymbolsType::Numeric => "numeric",
|
|
21
|
+
SymbolsType::Alphabetic => "alphabetic",
|
|
22
|
+
SymbolsType::Symbolic => "symbolic",
|
|
23
|
+
SymbolsType::Fixed => "fixed",
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
#[derive(TypedData)]
|
|
28
|
+
#[magnus(class = "Yass::Declarations::ListStyleType", mark)]
|
|
29
|
+
pub struct YListStyleType {
|
|
30
|
+
list_style_type: CachedValue<ListStyleType>,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
impl YListStyleType {
|
|
34
|
+
pub fn new(list_style_type: ListStyleType) -> Self {
|
|
35
|
+
Self {
|
|
36
|
+
list_style_type: CachedValue::new(list_style_type, make_list_style_type_value),
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
41
|
+
rb_self.list_style_type.get(ruby)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
pub fn bullet(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> bool {
|
|
45
|
+
if let Some(value) = &rb_self.list_style_type.value {
|
|
46
|
+
value.is_bullet()
|
|
47
|
+
} else {
|
|
48
|
+
false
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
impl DataTypeFunctions for YListStyleType {
|
|
54
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
55
|
+
self.list_style_type.mark(marker);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
#[magnus::wrap(class = "Yass::Declarations::ListStyleType::None")]
|
|
60
|
+
pub struct YListStyleTypeNone {}
|
|
61
|
+
|
|
62
|
+
impl YListStyleTypeNone {
|
|
63
|
+
pub fn new() -> Self {
|
|
64
|
+
Self {}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
#[magnus::wrap(class = "Yass::Declarations::ListStyleType::Name")]
|
|
69
|
+
pub struct YListStyleTypeName {
|
|
70
|
+
name: String,
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
impl YListStyleTypeName {
|
|
74
|
+
pub fn new(name: String) -> Self {
|
|
75
|
+
Self { name }
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
pub fn value(ruby: &Ruby, rb_self: &Self) -> Id {
|
|
79
|
+
ruby.intern(&rb_self.name)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
#[magnus::wrap(class = "Yass::Declarations::ListStyleType::String")]
|
|
84
|
+
pub struct YListStyleTypeString {
|
|
85
|
+
value: String,
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
impl YListStyleTypeString {
|
|
89
|
+
pub fn new(value: String) -> Self {
|
|
90
|
+
Self { value }
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
pub fn value(ruby: &Ruby, rb_self: &Self) -> RString {
|
|
94
|
+
ruby.str_new(&rb_self.value)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
#[magnus::wrap(class = "Yass::Declarations::ListStyleType::Symbols")]
|
|
99
|
+
pub struct YListStyleTypeSymbols {
|
|
100
|
+
kind: SymbolsType,
|
|
101
|
+
symbols: Vec<String>,
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
impl YListStyleTypeSymbols {
|
|
105
|
+
pub fn new(kind: SymbolsType, symbols: Symbols) -> Self {
|
|
106
|
+
Self {
|
|
107
|
+
kind,
|
|
108
|
+
symbols: symbols
|
|
109
|
+
.0
|
|
110
|
+
.iter()
|
|
111
|
+
.map(|symbol| match symbol {
|
|
112
|
+
Symbol::String(value) => (&**value).to_owned(),
|
|
113
|
+
Symbol::Ident(ident) => ident.0.to_string(),
|
|
114
|
+
})
|
|
115
|
+
.collect(),
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
pub fn ty(ruby: &Ruby, rb_self: &Self) -> Value {
|
|
120
|
+
ruby.intern(symbols_type_name(rb_self.kind)).into_value_with(ruby)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
pub fn symbols(ruby: &Ruby, rb_self: &Self) -> Result<RArray, Error> {
|
|
124
|
+
let array = ruby.ary_new_capa(rb_self.symbols.len());
|
|
125
|
+
|
|
126
|
+
for symbol in rb_self.symbols.iter() {
|
|
127
|
+
array.push(ruby.str_new(symbol))?;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
Ok(array)
|
|
131
|
+
}
|
|
132
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, IntoValue, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::{generics::{Optional, length::{AnchorSizeKeyword, GenericAnchorSizeFunction, GenericMargin}}, specified::{LengthPercentage, Margin}};
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::size::{YLengthPercentage, anchor_size_keyword::YAnchorSizeKeyword, length_percentage_to_value}};
|
|
5
|
+
|
|
6
|
+
pub fn make_margin(margin: &Margin, ruby: &Ruby) -> Value {
|
|
7
|
+
match margin {
|
|
8
|
+
Margin::Auto => YMarginAuto::new().into_value_with(ruby),
|
|
9
|
+
Margin::LengthPercentage(length_percentage) => {
|
|
10
|
+
YLengthPercentage::new(length_percentage.clone()).into_value_with(ruby)
|
|
11
|
+
}
|
|
12
|
+
Margin::AnchorSizeFunction(anchor_size_function) => {
|
|
13
|
+
YMarginAnchorSizeFunction::new(*anchor_size_function.clone()).into_value_with(ruby)
|
|
14
|
+
}
|
|
15
|
+
Margin::AnchorContainingCalcFunction(length_percentage) => {
|
|
16
|
+
YMarginAnchorContainingCalcFunction::new(length_percentage.clone()).into_value_with(ruby)
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
#[magnus::wrap(class = "Yass::Declarations::Margin::Auto")]
|
|
22
|
+
pub struct YMarginAuto {}
|
|
23
|
+
|
|
24
|
+
impl YMarginAuto {
|
|
25
|
+
pub fn new() -> Self {
|
|
26
|
+
Self {}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
#[derive(TypedData)]
|
|
31
|
+
#[magnus(class = "Yass::Declarations::Margin::AnchorContainingCalcFunction", mark)]
|
|
32
|
+
pub struct YMarginAnchorContainingCalcFunction {
|
|
33
|
+
length_percentage: CachedValue<LengthPercentage>,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
impl YMarginAnchorContainingCalcFunction {
|
|
37
|
+
pub fn new(length_percentage: LengthPercentage) -> Self {
|
|
38
|
+
Self {
|
|
39
|
+
length_percentage: CachedValue::new(length_percentage, |value, ruby| {
|
|
40
|
+
length_percentage_to_value(value, ruby)
|
|
41
|
+
}),
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
46
|
+
rb_self.length_percentage.get(ruby)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
impl DataTypeFunctions for YMarginAnchorContainingCalcFunction {
|
|
51
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
52
|
+
self.length_percentage.mark(marker);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
#[derive(TypedData)]
|
|
57
|
+
#[magnus(class = "Yass::Declarations::Margin::AnchorSizeFunction", mark)]
|
|
58
|
+
pub struct YMarginAnchorSizeFunction {
|
|
59
|
+
target_element: CachedValue<String>,
|
|
60
|
+
size: CachedValue<AnchorSizeKeyword>,
|
|
61
|
+
fallback: CachedValue<Optional<GenericMargin<LengthPercentage>>>
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
impl YMarginAnchorSizeFunction {
|
|
65
|
+
pub fn new(anchor_size: GenericAnchorSizeFunction<GenericMargin<LengthPercentage>>) -> Self {
|
|
66
|
+
Self {
|
|
67
|
+
target_element: CachedValue::new(anchor_size.target_element.value.0.to_string(), |el, ruby| {
|
|
68
|
+
ruby.str_new(el).into_value_with(ruby)
|
|
69
|
+
}),
|
|
70
|
+
|
|
71
|
+
size: CachedValue::new(anchor_size.size, |size, ruby| {
|
|
72
|
+
YAnchorSizeKeyword::new(*size).into_value_with(ruby)
|
|
73
|
+
}),
|
|
74
|
+
|
|
75
|
+
fallback: CachedValue::new(anchor_size.fallback, |fallback, ruby| {
|
|
76
|
+
match fallback {
|
|
77
|
+
Optional::Some(fb) => make_margin(fb, ruby),
|
|
78
|
+
Optional::None => ruby.qnil().into_value_with(ruby)
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
pub fn target_element(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
85
|
+
rb_self.target_element.get(ruby)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
pub fn size(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
89
|
+
rb_self.size.get(ruby)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
pub fn fallback(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
93
|
+
rb_self.fallback.get(ruby)
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
impl DataTypeFunctions for YMarginAnchorSizeFunction {
|
|
98
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
99
|
+
self.target_element.mark(marker);
|
|
100
|
+
self.size.mark(marker);
|
|
101
|
+
self.fallback.mark(marker);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::specified::Margin;
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::margin::make_margin};
|
|
5
|
+
|
|
6
|
+
#[derive(TypedData)]
|
|
7
|
+
#[magnus(class = "Yass::Declarations::MarginBlockEnd", mark)]
|
|
8
|
+
pub struct YMarginBlockEnd {
|
|
9
|
+
margin: CachedValue<Margin>,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl YMarginBlockEnd {
|
|
13
|
+
pub fn new(margin: Margin) -> Self {
|
|
14
|
+
Self {
|
|
15
|
+
margin: CachedValue::new(margin, |value, ruby| make_margin(value, ruby)),
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
20
|
+
rb_self.margin.get(ruby)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
impl DataTypeFunctions for YMarginBlockEnd {
|
|
25
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
26
|
+
self.margin.mark(marker);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::specified::Margin;
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::margin::make_margin};
|
|
5
|
+
|
|
6
|
+
#[derive(TypedData)]
|
|
7
|
+
#[magnus(class = "Yass::Declarations::MarginBlockStart", mark)]
|
|
8
|
+
pub struct YMarginBlockStart {
|
|
9
|
+
margin: CachedValue<Margin>,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl YMarginBlockStart {
|
|
13
|
+
pub fn new(margin: Margin) -> Self {
|
|
14
|
+
Self {
|
|
15
|
+
margin: CachedValue::new(margin, |value, ruby| make_margin(value, ruby)),
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
20
|
+
rb_self.margin.get(ruby)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
impl DataTypeFunctions for YMarginBlockStart {
|
|
25
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
26
|
+
self.margin.mark(marker);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::specified::Margin;
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::margin::make_margin};
|
|
5
|
+
|
|
6
|
+
#[derive(TypedData)]
|
|
7
|
+
#[magnus(class = "Yass::Declarations::MarginBottom", mark)]
|
|
8
|
+
pub struct YMarginBottom {
|
|
9
|
+
margin: CachedValue<Margin>,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl YMarginBottom {
|
|
13
|
+
pub fn new(margin: Margin) -> Self {
|
|
14
|
+
Self {
|
|
15
|
+
margin: CachedValue::new(margin, |value, ruby| make_margin(value, ruby)),
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
20
|
+
rb_self.margin.get(ruby)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
impl DataTypeFunctions for YMarginBottom {
|
|
25
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
26
|
+
self.margin.mark(marker);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::specified::Margin;
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::margin::make_margin};
|
|
5
|
+
|
|
6
|
+
#[derive(TypedData)]
|
|
7
|
+
#[magnus(class = "Yass::Declarations::MarginInlineEnd", mark)]
|
|
8
|
+
pub struct YMarginInlineEnd {
|
|
9
|
+
margin: CachedValue<Margin>,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl YMarginInlineEnd {
|
|
13
|
+
pub fn new(margin: Margin) -> Self {
|
|
14
|
+
Self {
|
|
15
|
+
margin: CachedValue::new(margin, |value, ruby| make_margin(value, ruby)),
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
20
|
+
rb_self.margin.get(ruby)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
impl DataTypeFunctions for YMarginInlineEnd {
|
|
25
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
26
|
+
self.margin.mark(marker);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::specified::Margin;
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::margin::make_margin};
|
|
5
|
+
|
|
6
|
+
#[derive(TypedData)]
|
|
7
|
+
#[magnus(class = "Yass::Declarations::MarginInlineStart", mark)]
|
|
8
|
+
pub struct YMarginInlineStart {
|
|
9
|
+
margin: CachedValue<Margin>,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl YMarginInlineStart {
|
|
13
|
+
pub fn new(margin: Margin) -> Self {
|
|
14
|
+
Self {
|
|
15
|
+
margin: CachedValue::new(margin, |value, ruby| make_margin(value, ruby)),
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
20
|
+
rb_self.margin.get(ruby)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
impl DataTypeFunctions for YMarginInlineStart {
|
|
25
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
26
|
+
self.margin.mark(marker);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::specified::Margin;
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::margin::make_margin};
|
|
5
|
+
|
|
6
|
+
#[derive(TypedData)]
|
|
7
|
+
#[magnus(class = "Yass::Declarations::MarginLeft", mark)]
|
|
8
|
+
pub struct YMarginLeft {
|
|
9
|
+
margin: CachedValue<Margin>,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl YMarginLeft {
|
|
13
|
+
pub fn new(margin: Margin) -> Self {
|
|
14
|
+
Self {
|
|
15
|
+
margin: CachedValue::new(margin, |value, ruby| make_margin(value, ruby)),
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
20
|
+
rb_self.margin.get(ruby)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
impl DataTypeFunctions for YMarginLeft {
|
|
25
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
26
|
+
self.margin.mark(marker);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::specified::Margin;
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::margin::make_margin};
|
|
5
|
+
|
|
6
|
+
#[derive(TypedData)]
|
|
7
|
+
#[magnus(class = "Yass::Declarations::MarginRight", mark)]
|
|
8
|
+
pub struct YMarginRight {
|
|
9
|
+
margin: CachedValue<Margin>,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl YMarginRight {
|
|
13
|
+
pub fn new(margin: Margin) -> Self {
|
|
14
|
+
Self {
|
|
15
|
+
margin: CachedValue::new(margin, |value, ruby| make_margin(value, ruby)),
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
20
|
+
rb_self.margin.get(ruby)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
impl DataTypeFunctions for YMarginRight {
|
|
25
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
26
|
+
self.margin.mark(marker);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::specified::Margin;
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::margin::make_margin};
|
|
5
|
+
|
|
6
|
+
#[derive(TypedData)]
|
|
7
|
+
#[magnus(class = "Yass::Declarations::MarginTop", mark)]
|
|
8
|
+
pub struct YMarginTop {
|
|
9
|
+
margin: CachedValue<Margin>,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl YMarginTop {
|
|
13
|
+
pub fn new(margin: Margin) -> Self {
|
|
14
|
+
Self {
|
|
15
|
+
margin: CachedValue::new(margin, |value, ruby| make_margin(value, ruby)),
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
20
|
+
rb_self.margin.get(ruby)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
impl DataTypeFunctions for YMarginTop {
|
|
25
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
26
|
+
self.margin.mark(marker);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Error, RArray, Ruby, TypedData, gc, typed_data};
|
|
2
|
+
use style::properties::longhands::mask_image::{SingleSpecifiedValue, SpecifiedValue};
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value_list::CachedValueList, declarations::images::image_to_value};
|
|
5
|
+
|
|
6
|
+
#[derive(TypedData)]
|
|
7
|
+
#[magnus(class = "Yass::Declarations::MaskImage", mark)]
|
|
8
|
+
pub struct YMaskImage {
|
|
9
|
+
values: CachedValueList<SingleSpecifiedValue>,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl YMaskImage {
|
|
13
|
+
pub fn new(specified_value: SpecifiedValue) -> Self {
|
|
14
|
+
Self {
|
|
15
|
+
values: CachedValueList::new(specified_value.0.to_vec(), |value, _ctx, ruby| {
|
|
16
|
+
image_to_value(value, ruby)
|
|
17
|
+
}),
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
pub fn values(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Result<RArray, Error> {
|
|
22
|
+
rb_self.values.to_a(ruby)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
impl DataTypeFunctions for YMaskImage {
|
|
27
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
28
|
+
self.values.mark(marker);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::specified::MaxSize;
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::size::make_max_size};
|
|
5
|
+
|
|
6
|
+
#[derive(TypedData)]
|
|
7
|
+
#[magnus(class = "Yass::Declarations::MaxBlockSize", mark)]
|
|
8
|
+
pub struct YMaxBlockSize {
|
|
9
|
+
max_size: CachedValue<MaxSize>
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl YMaxBlockSize {
|
|
13
|
+
pub fn new(max_size: MaxSize) -> Self {
|
|
14
|
+
Self {
|
|
15
|
+
max_size: CachedValue::new(max_size, |ms, ruby| {
|
|
16
|
+
make_max_size(ms, ruby)
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
pub fn size(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
22
|
+
rb_self.max_size.get(ruby)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
impl DataTypeFunctions for YMaxBlockSize {
|
|
27
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
28
|
+
self.max_size.mark(marker);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::specified::MaxSize;
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::size::make_max_size};
|
|
5
|
+
|
|
6
|
+
#[derive(TypedData)]
|
|
7
|
+
#[magnus(class = "Yass::Declarations::MaxHeight", mark)]
|
|
8
|
+
pub struct YMaxHeight {
|
|
9
|
+
max_size: CachedValue<MaxSize>
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl YMaxHeight {
|
|
13
|
+
pub fn new(max_size: MaxSize) -> Self {
|
|
14
|
+
Self {
|
|
15
|
+
max_size: CachedValue::new(max_size, |ms, ruby| {
|
|
16
|
+
make_max_size(ms, ruby)
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
pub fn size(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
22
|
+
rb_self.max_size.get(ruby)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
impl DataTypeFunctions for YMaxHeight {
|
|
27
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
28
|
+
self.max_size.mark(marker);
|
|
29
|
+
}
|
|
30
|
+
}
|