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,30 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::specified::Size;
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::size::make_size};
|
|
5
|
+
|
|
6
|
+
#[derive(TypedData)]
|
|
7
|
+
#[magnus(class = "Yass::Declarations::InlineSize", mark)]
|
|
8
|
+
pub struct YInlineSize {
|
|
9
|
+
size: CachedValue<Size>
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl YInlineSize {
|
|
13
|
+
pub fn new(size: Size) -> Self {
|
|
14
|
+
Self {
|
|
15
|
+
size: CachedValue::new(size, |s, ruby| {
|
|
16
|
+
make_size(s, ruby)
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
pub fn size(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
22
|
+
rb_self.size.get(ruby)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
impl DataTypeFunctions for YInlineSize {
|
|
27
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
28
|
+
self.size.mark(marker);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, IntoValue, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::specified::{Inset, LengthPercentage};
|
|
3
|
+
use style_traits::ToCss;
|
|
4
|
+
|
|
5
|
+
use crate::{cached_value::CachedValue, declarations::size::length_percentage_to_value};
|
|
6
|
+
|
|
7
|
+
pub fn make_inset(inset: &Inset, ruby: &Ruby) -> Value {
|
|
8
|
+
match inset {
|
|
9
|
+
Inset::Auto => YInsetAuto::new().into_value_with(ruby),
|
|
10
|
+
Inset::LengthPercentage(length_percentage) => {
|
|
11
|
+
YInsetLengthPercentage::new(length_percentage.clone()).into_value_with(ruby)
|
|
12
|
+
}
|
|
13
|
+
Inset::AnchorContainingCalcFunction(length_percentage) => {
|
|
14
|
+
YInsetAnchorContainingCalcFunction::new(length_percentage.clone()).into_value_with(ruby)
|
|
15
|
+
}
|
|
16
|
+
Inset::AnchorFunction(anchor_function) => {
|
|
17
|
+
YInsetAnchorFunction::new(anchor_function.to_css_string()).into_value_with(ruby)
|
|
18
|
+
}
|
|
19
|
+
Inset::AnchorSizeFunction(anchor_size_function) => {
|
|
20
|
+
YInsetAnchorSizeFunction::new(anchor_size_function.to_css_string()).into_value_with(ruby)
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
#[magnus::wrap(class = "Yass::Declarations::Inset::Auto")]
|
|
26
|
+
pub struct YInsetAuto {}
|
|
27
|
+
|
|
28
|
+
impl YInsetAuto {
|
|
29
|
+
pub fn new() -> Self {
|
|
30
|
+
Self {}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
#[derive(TypedData)]
|
|
35
|
+
#[magnus(class = "Yass::Declarations::Inset::LengthPercentage", mark)]
|
|
36
|
+
pub struct YInsetLengthPercentage {
|
|
37
|
+
length_percentage: CachedValue<LengthPercentage>,
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
impl YInsetLengthPercentage {
|
|
41
|
+
pub fn new(length_percentage: LengthPercentage) -> Self {
|
|
42
|
+
Self {
|
|
43
|
+
length_percentage: CachedValue::new(length_percentage, |value, ruby| {
|
|
44
|
+
length_percentage_to_value(value, ruby)
|
|
45
|
+
}),
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
50
|
+
rb_self.length_percentage.get(ruby)
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
impl DataTypeFunctions for YInsetLengthPercentage {
|
|
55
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
56
|
+
self.length_percentage.mark(marker);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
#[derive(TypedData)]
|
|
61
|
+
#[magnus(class = "Yass::Declarations::Inset::AnchorContainingCalcFunction", mark)]
|
|
62
|
+
pub struct YInsetAnchorContainingCalcFunction {
|
|
63
|
+
length_percentage: CachedValue<LengthPercentage>,
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
impl YInsetAnchorContainingCalcFunction {
|
|
67
|
+
pub fn new(length_percentage: LengthPercentage) -> Self {
|
|
68
|
+
Self {
|
|
69
|
+
length_percentage: CachedValue::new(length_percentage, |value, ruby| {
|
|
70
|
+
length_percentage_to_value(value, ruby)
|
|
71
|
+
}),
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
76
|
+
rb_self.length_percentage.get(ruby)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
impl DataTypeFunctions for YInsetAnchorContainingCalcFunction {
|
|
81
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
82
|
+
self.length_percentage.mark(marker);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
#[magnus::wrap(class = "Yass::Declarations::Inset::AnchorFunction")]
|
|
87
|
+
pub struct YInsetAnchorFunction {
|
|
88
|
+
css: String,
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
impl YInsetAnchorFunction {
|
|
92
|
+
pub fn new(css: String) -> Self {
|
|
93
|
+
Self { css }
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
97
|
+
ruby.str_new(&rb_self.css).into_value_with(ruby)
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
#[magnus::wrap(class = "Yass::Declarations::Inset::AnchorSizeFunction")]
|
|
102
|
+
pub struct YInsetAnchorSizeFunction {
|
|
103
|
+
css: String,
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
impl YInsetAnchorSizeFunction {
|
|
107
|
+
pub fn new(css: String) -> Self {
|
|
108
|
+
Self { css }
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
112
|
+
ruby.str_new(&rb_self.css).into_value_with(ruby)
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -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::InsetBlockEnd", mark)]
|
|
8
|
+
pub struct YInsetBlockEnd {
|
|
9
|
+
inset: CachedValue<Inset>,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl YInsetBlockEnd {
|
|
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 YInsetBlockEnd {
|
|
25
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
26
|
+
self.inset.mark(marker);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -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::InsetBlockStart", mark)]
|
|
8
|
+
pub struct YInsetBlockStart {
|
|
9
|
+
inset: CachedValue<Inset>,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl YInsetBlockStart {
|
|
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 YInsetBlockStart {
|
|
25
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
26
|
+
self.inset.mark(marker);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -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::InsetInlineEnd", mark)]
|
|
8
|
+
pub struct YInsetInlineEnd {
|
|
9
|
+
inset: CachedValue<Inset>,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl YInsetInlineEnd {
|
|
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 YInsetInlineEnd {
|
|
25
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
26
|
+
self.inset.mark(marker);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -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::InsetInlineStart", mark)]
|
|
8
|
+
pub struct YInsetInlineStart {
|
|
9
|
+
inset: CachedValue<Inset>,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl YInsetInlineStart {
|
|
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 YInsetInlineStart {
|
|
25
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
26
|
+
self.inset.mark(marker);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
use magnus::{Ruby, typed_data, value::Id};
|
|
2
|
+
use style::computed_values::isolation::T;
|
|
3
|
+
|
|
4
|
+
#[magnus::wrap(class = "Yass::Declarations::Isolation")]
|
|
5
|
+
pub struct YIsolation {
|
|
6
|
+
specified_value: T
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
impl YIsolation {
|
|
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::Auto => ruby.intern("auto"),
|
|
17
|
+
T::Isolate => ruby.intern("isolate"),
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
use magnus::{Ruby, typed_data, value::Id};
|
|
2
|
+
use style::values::computed::ContentDistribution;
|
|
3
|
+
|
|
4
|
+
use crate::declarations::align_flags;
|
|
5
|
+
|
|
6
|
+
#[magnus::wrap(class = "Yass::Declarations::JustifyContent")]
|
|
7
|
+
pub struct YJustifyContent {
|
|
8
|
+
content_distribution: ContentDistribution
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
impl YJustifyContent {
|
|
12
|
+
pub fn new(content_distribution: ContentDistribution) -> Self {
|
|
13
|
+
Self { content_distribution }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Option<Id> {
|
|
17
|
+
align_flags::to_id(rb_self.content_distribution.primary().value(), ruby)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
use magnus::{Error, Ruby, typed_data, value::Id};
|
|
2
|
+
use style::values::{specified::JustifyItems, specified::align::AlignFlags};
|
|
3
|
+
|
|
4
|
+
#[magnus::wrap(class = "Yass::Declarations::JustifyItems")]
|
|
5
|
+
pub struct YJustifyItems {
|
|
6
|
+
justify_items: JustifyItems
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
impl YJustifyItems {
|
|
10
|
+
pub fn new(justify_items: JustifyItems) -> Self {
|
|
11
|
+
Self { justify_items }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Result<Id, Error> {
|
|
15
|
+
match rb_self.justify_items.0.value() {
|
|
16
|
+
AlignFlags::AUTO => Ok(ruby.intern("auto")),
|
|
17
|
+
AlignFlags::NORMAL => Ok(ruby.intern("normal")),
|
|
18
|
+
AlignFlags::START => Ok(ruby.intern("start")),
|
|
19
|
+
AlignFlags::END => Ok(ruby.intern("end")),
|
|
20
|
+
AlignFlags::FLEX_START => Ok(ruby.intern("flex_start")),
|
|
21
|
+
AlignFlags::FLEX_END => Ok(ruby.intern("flex_end")),
|
|
22
|
+
AlignFlags::CENTER => Ok(ruby.intern("center")),
|
|
23
|
+
AlignFlags::LEFT => Ok(ruby.intern("left")),
|
|
24
|
+
AlignFlags::RIGHT => Ok(ruby.intern("right")),
|
|
25
|
+
AlignFlags::BASELINE => Ok(ruby.intern("baseline")),
|
|
26
|
+
AlignFlags::LAST_BASELINE => Ok(ruby.intern("last_baseline")),
|
|
27
|
+
AlignFlags::STRETCH => Ok(ruby.intern("stretch")),
|
|
28
|
+
AlignFlags::SELF_START => Ok(ruby.intern("self_start")),
|
|
29
|
+
AlignFlags::SELF_END => Ok(ruby.intern("self_end")),
|
|
30
|
+
AlignFlags::SPACE_BETWEEN => Ok(ruby.intern("space_between")),
|
|
31
|
+
AlignFlags::SPACE_AROUND => Ok(ruby.intern("space_around")),
|
|
32
|
+
AlignFlags::SPACE_EVENLY => Ok(ruby.intern("space_evenly")),
|
|
33
|
+
AlignFlags::ANCHOR_CENTER => Ok(ruby.intern("anchor_center")),
|
|
34
|
+
_ => Err(Error::new(ruby.exception_arg_error(), "unreachable"))
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
use magnus::{Ruby, typed_data, value::Id};
|
|
2
|
+
use style::values::computed::SelfAlignment;
|
|
3
|
+
|
|
4
|
+
use crate::declarations::align_flags;
|
|
5
|
+
|
|
6
|
+
#[magnus::wrap(class = "Yass::Declarations::JustifySelf")]
|
|
7
|
+
pub struct YJustifySelf {
|
|
8
|
+
self_alignment: SelfAlignment
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
impl YJustifySelf {
|
|
12
|
+
pub fn new(self_alignment: SelfAlignment) -> Self {
|
|
13
|
+
Self { self_alignment }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Option<Id> {
|
|
17
|
+
align_flags::to_id(rb_self.self_alignment.0.value(), ruby)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -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::Left", mark)]
|
|
8
|
+
pub struct YLeft {
|
|
9
|
+
inset: CachedValue<Inset>,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl YLeft {
|
|
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 YLeft {
|
|
25
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
26
|
+
self.inset.mark(marker);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
use magnus::{IntoValue, Ruby, Value, typed_data, value::Id};
|
|
2
|
+
use style::values::specified::{AbsoluteLength, CharacterWidth, FontRelativeLength, Length, NoCalcLength, ViewportPercentageLength, length::ContainerRelativeLength};
|
|
3
|
+
|
|
4
|
+
use crate::declarations::calc::YCalc;
|
|
5
|
+
|
|
6
|
+
pub fn length_to_value(length: &Length, ruby: &Ruby) -> Value {
|
|
7
|
+
match length {
|
|
8
|
+
Length::NoCalc(no_calc_length) => no_calc_length_to_value(no_calc_length, ruby),
|
|
9
|
+
Length::Calc(calc_length_percentage) => {
|
|
10
|
+
YCalc::new(calc_length_percentage.clone()).into_value_with(ruby)
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
pub fn no_calc_length_to_value(length: &NoCalcLength, ruby: &Ruby) -> Value {
|
|
16
|
+
match length {
|
|
17
|
+
NoCalcLength::Absolute(absolute_length) => {
|
|
18
|
+
YAbsoluteLength::new(*absolute_length).into_value_with(ruby)
|
|
19
|
+
},
|
|
20
|
+
NoCalcLength::FontRelative(font_relative_length) => {
|
|
21
|
+
YFontRelativeLength::new(*font_relative_length).into_value_with(ruby)
|
|
22
|
+
},
|
|
23
|
+
NoCalcLength::ViewportPercentage(viewport_percentage_length) => {
|
|
24
|
+
YViewportPercentageLength::new(*viewport_percentage_length).into_value_with(ruby)
|
|
25
|
+
},
|
|
26
|
+
NoCalcLength::ContainerRelative(container_relative_length) => {
|
|
27
|
+
YContainerRelativeLength::new(*container_relative_length).into_value_with(ruby)
|
|
28
|
+
},
|
|
29
|
+
NoCalcLength::ServoCharacterWidth(character_width) => {
|
|
30
|
+
YCharacterWidthLength::new(*character_width).into_value_with(ruby)
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
#[magnus::wrap(class = "Yass::Declarations::Length::Absolute")]
|
|
36
|
+
pub struct YAbsoluteLength {
|
|
37
|
+
absolute_length: AbsoluteLength
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
impl YAbsoluteLength {
|
|
41
|
+
pub fn new(absolute_length: AbsoluteLength) -> Self {
|
|
42
|
+
Self { absolute_length }
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
pub fn value(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> f32 {
|
|
46
|
+
match rb_self.absolute_length {
|
|
47
|
+
AbsoluteLength::Px(value) => value,
|
|
48
|
+
AbsoluteLength::In(value) => value,
|
|
49
|
+
AbsoluteLength::Cm(value) => value,
|
|
50
|
+
AbsoluteLength::Mm(value) => value,
|
|
51
|
+
AbsoluteLength::Q(value) => value,
|
|
52
|
+
AbsoluteLength::Pt(value) => value,
|
|
53
|
+
AbsoluteLength::Pc(value) => value,
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
pub fn unit(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Id {
|
|
58
|
+
match rb_self.absolute_length {
|
|
59
|
+
AbsoluteLength::Px(_) => ruby.intern("px"),
|
|
60
|
+
AbsoluteLength::In(_) => ruby.intern("in"),
|
|
61
|
+
AbsoluteLength::Cm(_) => ruby.intern("cm"),
|
|
62
|
+
AbsoluteLength::Mm(_) => ruby.intern("mm"),
|
|
63
|
+
AbsoluteLength::Q(_) => ruby.intern("q"),
|
|
64
|
+
AbsoluteLength::Pt(_) => ruby.intern("pt"),
|
|
65
|
+
AbsoluteLength::Pc(_) => ruby.intern("pc"),
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
#[magnus::wrap(class = "Yass::Declarations::Length::FontRelative")]
|
|
71
|
+
pub struct YFontRelativeLength {
|
|
72
|
+
font_relative_length: FontRelativeLength
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
impl YFontRelativeLength {
|
|
76
|
+
pub fn new(font_relative_length: FontRelativeLength) -> Self {
|
|
77
|
+
Self { font_relative_length }
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
pub fn value(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> f32 {
|
|
81
|
+
match rb_self.font_relative_length {
|
|
82
|
+
FontRelativeLength::Em(value) => value,
|
|
83
|
+
FontRelativeLength::Ex(value) => value,
|
|
84
|
+
FontRelativeLength::Rex(value) => value,
|
|
85
|
+
FontRelativeLength::Ch(value) => value,
|
|
86
|
+
FontRelativeLength::Rch(value) => value,
|
|
87
|
+
FontRelativeLength::Cap(value) => value,
|
|
88
|
+
FontRelativeLength::Rcap(value) => value,
|
|
89
|
+
FontRelativeLength::Ic(value) => value,
|
|
90
|
+
FontRelativeLength::Ric(value) => value,
|
|
91
|
+
FontRelativeLength::Rem(value) => value,
|
|
92
|
+
FontRelativeLength::Lh(value) => value,
|
|
93
|
+
FontRelativeLength::Rlh(value) => value,
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
pub fn unit(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Id {
|
|
98
|
+
match rb_self.font_relative_length {
|
|
99
|
+
FontRelativeLength::Em(_) => ruby.intern("em"),
|
|
100
|
+
FontRelativeLength::Ex(_) => ruby.intern("ex"),
|
|
101
|
+
FontRelativeLength::Rex(_) => ruby.intern("rex"),
|
|
102
|
+
FontRelativeLength::Ch(_) => ruby.intern("ch"),
|
|
103
|
+
FontRelativeLength::Rch(_) => ruby.intern("rch"),
|
|
104
|
+
FontRelativeLength::Cap(_) => ruby.intern("cap"),
|
|
105
|
+
FontRelativeLength::Rcap(_) => ruby.intern("rcap"),
|
|
106
|
+
FontRelativeLength::Ic(_) => ruby.intern("ic"),
|
|
107
|
+
FontRelativeLength::Ric(_) => ruby.intern("ric"),
|
|
108
|
+
FontRelativeLength::Rem(_) => ruby.intern("rem"),
|
|
109
|
+
FontRelativeLength::Lh(_) => ruby.intern("lh"),
|
|
110
|
+
FontRelativeLength::Rlh(_) => ruby.intern("rlh"),
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
#[magnus::wrap(class = "Yass::Declarations::Length::ViewportPercentage")]
|
|
116
|
+
pub struct YViewportPercentageLength {
|
|
117
|
+
viewport_percentage_length: ViewportPercentageLength
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
impl YViewportPercentageLength {
|
|
121
|
+
pub fn new(viewport_percentage_length: ViewportPercentageLength) -> Self {
|
|
122
|
+
Self { viewport_percentage_length }
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
pub fn value(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> f32 {
|
|
126
|
+
match rb_self.viewport_percentage_length {
|
|
127
|
+
ViewportPercentageLength::Vw(value) => value,
|
|
128
|
+
ViewportPercentageLength::Svw(value) => value,
|
|
129
|
+
ViewportPercentageLength::Lvw(value) => value,
|
|
130
|
+
ViewportPercentageLength::Dvw(value) => value,
|
|
131
|
+
ViewportPercentageLength::Vh(value) => value,
|
|
132
|
+
ViewportPercentageLength::Svh(value) => value,
|
|
133
|
+
ViewportPercentageLength::Lvh(value) => value,
|
|
134
|
+
ViewportPercentageLength::Dvh(value) => value,
|
|
135
|
+
ViewportPercentageLength::Vmin(value) => value,
|
|
136
|
+
ViewportPercentageLength::Svmin(value) => value,
|
|
137
|
+
ViewportPercentageLength::Lvmin(value) => value,
|
|
138
|
+
ViewportPercentageLength::Dvmin(value) => value,
|
|
139
|
+
ViewportPercentageLength::Vmax(value) => value,
|
|
140
|
+
ViewportPercentageLength::Svmax(value) => value,
|
|
141
|
+
ViewportPercentageLength::Lvmax(value) => value,
|
|
142
|
+
ViewportPercentageLength::Dvmax(value) => value,
|
|
143
|
+
ViewportPercentageLength::Vb(value) => value,
|
|
144
|
+
ViewportPercentageLength::Svb(value) => value,
|
|
145
|
+
ViewportPercentageLength::Lvb(value) => value,
|
|
146
|
+
ViewportPercentageLength::Dvb(value) => value,
|
|
147
|
+
ViewportPercentageLength::Vi(value) => value,
|
|
148
|
+
ViewportPercentageLength::Svi(value) => value,
|
|
149
|
+
ViewportPercentageLength::Lvi(value) => value,
|
|
150
|
+
ViewportPercentageLength::Dvi(value) => value,
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
pub fn unit(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Id {
|
|
155
|
+
match rb_self.viewport_percentage_length {
|
|
156
|
+
ViewportPercentageLength::Vw(_) => ruby.intern("vw"),
|
|
157
|
+
ViewportPercentageLength::Svw(_) => ruby.intern("svw"),
|
|
158
|
+
ViewportPercentageLength::Lvw(_) => ruby.intern("lvw"),
|
|
159
|
+
ViewportPercentageLength::Dvw(_) => ruby.intern("dvw"),
|
|
160
|
+
ViewportPercentageLength::Vh(_) => ruby.intern("vh"),
|
|
161
|
+
ViewportPercentageLength::Svh(_) => ruby.intern("svh"),
|
|
162
|
+
ViewportPercentageLength::Lvh(_) => ruby.intern("lvh"),
|
|
163
|
+
ViewportPercentageLength::Dvh(_) => ruby.intern("dvh"),
|
|
164
|
+
ViewportPercentageLength::Vmin(_) => ruby.intern("vmin"),
|
|
165
|
+
ViewportPercentageLength::Svmin(_) => ruby.intern("svmin"),
|
|
166
|
+
ViewportPercentageLength::Lvmin(_) => ruby.intern("lvmin"),
|
|
167
|
+
ViewportPercentageLength::Dvmin(_) => ruby.intern("dvmin"),
|
|
168
|
+
ViewportPercentageLength::Vmax(_) => ruby.intern("vmax"),
|
|
169
|
+
ViewportPercentageLength::Svmax(_) => ruby.intern("svmax"),
|
|
170
|
+
ViewportPercentageLength::Lvmax(_) => ruby.intern("lvmax"),
|
|
171
|
+
ViewportPercentageLength::Dvmax(_) => ruby.intern("dvmax"),
|
|
172
|
+
ViewportPercentageLength::Vb(_) => ruby.intern("vb"),
|
|
173
|
+
ViewportPercentageLength::Svb(_) => ruby.intern("svb"),
|
|
174
|
+
ViewportPercentageLength::Lvb(_) => ruby.intern("lvb"),
|
|
175
|
+
ViewportPercentageLength::Dvb(_) => ruby.intern("dvb"),
|
|
176
|
+
ViewportPercentageLength::Vi(_) => ruby.intern("vi"),
|
|
177
|
+
ViewportPercentageLength::Svi(_) => ruby.intern("svi"),
|
|
178
|
+
ViewportPercentageLength::Lvi(_) => ruby.intern("lvi"),
|
|
179
|
+
ViewportPercentageLength::Dvi(_) => ruby.intern("dvi"),
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
#[magnus::wrap(class = "Yass::Declarations::Length::ContainerRelative")]
|
|
185
|
+
pub struct YContainerRelativeLength {
|
|
186
|
+
container_relative_length: ContainerRelativeLength
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
impl YContainerRelativeLength {
|
|
190
|
+
pub fn new(container_relative_length: ContainerRelativeLength) -> Self {
|
|
191
|
+
Self { container_relative_length }
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
pub fn value(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> f32 {
|
|
195
|
+
match rb_self.container_relative_length {
|
|
196
|
+
ContainerRelativeLength::Cqw(value) => value,
|
|
197
|
+
ContainerRelativeLength::Cqh(value) => value,
|
|
198
|
+
ContainerRelativeLength::Cqi(value) => value,
|
|
199
|
+
ContainerRelativeLength::Cqb(value) => value,
|
|
200
|
+
ContainerRelativeLength::Cqmin(value) => value,
|
|
201
|
+
ContainerRelativeLength::Cqmax(value) => value,
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
pub fn unit(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Id {
|
|
206
|
+
match rb_self.container_relative_length {
|
|
207
|
+
ContainerRelativeLength::Cqw(_) => ruby.intern("cqw"),
|
|
208
|
+
ContainerRelativeLength::Cqh(_) => ruby.intern("cqh"),
|
|
209
|
+
ContainerRelativeLength::Cqi(_) => ruby.intern("cqi"),
|
|
210
|
+
ContainerRelativeLength::Cqb(_) => ruby.intern("cqb"),
|
|
211
|
+
ContainerRelativeLength::Cqmin(_) => ruby.intern("cqmin"),
|
|
212
|
+
ContainerRelativeLength::Cqmax(_) => ruby.intern("cqmax"),
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
#[magnus::wrap(class = "Yass::Declarations::Length::CharacterWidth")]
|
|
218
|
+
pub struct YCharacterWidthLength {
|
|
219
|
+
character_width_length: CharacterWidth
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
impl YCharacterWidthLength {
|
|
223
|
+
pub fn new(character_width_length: CharacterWidth) -> Self {
|
|
224
|
+
Self { character_width_length }
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
pub fn value(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> i32 {
|
|
228
|
+
rb_self.character_width_length.0
|
|
229
|
+
}
|
|
230
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, IntoValue, Ruby, TypedData, Value, gc::Marker, typed_data};
|
|
2
|
+
use style::values::specified::LetterSpacing;
|
|
3
|
+
use style::values::specified::text::Spacing;
|
|
4
|
+
|
|
5
|
+
use crate::{cached_value::CachedValue, declarations::size::length_percentage_to_value};
|
|
6
|
+
|
|
7
|
+
fn letter_spacing_to_value(letter_spacing: &LetterSpacing, ruby: &Ruby) -> Value {
|
|
8
|
+
match &letter_spacing.0 {
|
|
9
|
+
Spacing::Normal => YLetterSpacingNormal::new().into_value_with(ruby),
|
|
10
|
+
Spacing::Value(length_percentage) => {
|
|
11
|
+
length_percentage_to_value(length_percentage, ruby)
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
#[derive(TypedData)]
|
|
17
|
+
#[magnus(class = "Yass::Declarations::LetterSpacing", mark)]
|
|
18
|
+
pub struct YLetterSpacing {
|
|
19
|
+
value: CachedValue<LetterSpacing>,
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
impl YLetterSpacing {
|
|
23
|
+
pub fn new(letter_spacing: LetterSpacing) -> Self {
|
|
24
|
+
Self {
|
|
25
|
+
value: CachedValue::new(letter_spacing, letter_spacing_to_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 YLetterSpacing {
|
|
35
|
+
fn mark(&self, marker: &Marker) {
|
|
36
|
+
self.value.mark(marker);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
#[magnus::wrap(class = "Yass::Declarations::LetterSpacing::Normal")]
|
|
41
|
+
pub struct YLetterSpacingNormal {}
|
|
42
|
+
|
|
43
|
+
impl YLetterSpacingNormal {
|
|
44
|
+
pub fn new() -> Self {
|
|
45
|
+
Self {}
|
|
46
|
+
}
|
|
47
|
+
}
|