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,43 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::{
|
|
3
|
+
generics::color::GenericLightDark,
|
|
4
|
+
specified::Color,
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
use crate::{cached_value::CachedValue, declarations::color::color::make_color};
|
|
8
|
+
|
|
9
|
+
#[derive(TypedData)]
|
|
10
|
+
#[magnus(class = "Yass::Declarations::Color::LightDark", mark)]
|
|
11
|
+
pub struct YLightDark {
|
|
12
|
+
light: CachedValue<Color>,
|
|
13
|
+
dark: CachedValue<Color>,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
impl YLightDark {
|
|
17
|
+
pub fn new(light_dark: GenericLightDark<Color>) -> Self {
|
|
18
|
+
Self {
|
|
19
|
+
light: CachedValue::new(light_dark.light, |color, ruby| {
|
|
20
|
+
make_color(&color, ruby)
|
|
21
|
+
}),
|
|
22
|
+
|
|
23
|
+
dark: CachedValue::new(light_dark.dark, |color, ruby| {
|
|
24
|
+
make_color(&color, ruby)
|
|
25
|
+
}),
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
pub fn light(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
30
|
+
rb_self.light.get(ruby)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
pub fn dark(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
34
|
+
rb_self.dark.get(ruby)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
impl DataTypeFunctions for YLightDark {
|
|
39
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
40
|
+
self.light.mark(marker);
|
|
41
|
+
self.dark.mark(marker);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, Ruby, TypedData, Value, gc, typed_data, value::Id};
|
|
2
|
+
use style::{
|
|
3
|
+
color::ColorSpace,
|
|
4
|
+
values::specified::{Color, ColorPropertyValue},
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
use crate::{cached_value::CachedValue, declarations::color::color::make_color};
|
|
8
|
+
|
|
9
|
+
pub mod absolute_color;
|
|
10
|
+
pub mod absolute;
|
|
11
|
+
pub mod auto;
|
|
12
|
+
pub mod color_components;
|
|
13
|
+
pub mod color_function_component;
|
|
14
|
+
pub mod color_function;
|
|
15
|
+
pub mod color_interpolation_method;
|
|
16
|
+
pub mod color_mix_item;
|
|
17
|
+
pub mod color_mix;
|
|
18
|
+
pub mod current_color;
|
|
19
|
+
pub mod init;
|
|
20
|
+
pub mod light_dark;
|
|
21
|
+
pub mod color;
|
|
22
|
+
pub mod stored_color_function_component;
|
|
23
|
+
pub mod system_color;
|
|
24
|
+
|
|
25
|
+
#[derive(TypedData)]
|
|
26
|
+
#[magnus(class = "Yass::Declarations::Color", mark)]
|
|
27
|
+
pub struct YColor {
|
|
28
|
+
color: CachedValue<Color>,
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
impl YColor {
|
|
32
|
+
pub fn new(color_property_value: ColorPropertyValue) -> Self {
|
|
33
|
+
Self {
|
|
34
|
+
color: CachedValue::new(color_property_value.0, |color, ruby| {
|
|
35
|
+
make_color(&color, ruby)
|
|
36
|
+
}),
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
pub fn color(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
41
|
+
rb_self.color.get(ruby)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
impl DataTypeFunctions for YColor {
|
|
46
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
47
|
+
self.color.mark(marker);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
pub fn color_space_to_id(color_space: ColorSpace, ruby: &Ruby) -> Id {
|
|
52
|
+
match color_space {
|
|
53
|
+
ColorSpace::Srgb => ruby.intern("srgb"),
|
|
54
|
+
ColorSpace::Hsl => ruby.intern("hsl"),
|
|
55
|
+
ColorSpace::Hwb => ruby.intern("hwb"),
|
|
56
|
+
ColorSpace::Lab => ruby.intern("lab"),
|
|
57
|
+
ColorSpace::Lch => ruby.intern("lch"),
|
|
58
|
+
ColorSpace::Oklab => ruby.intern("oklab"),
|
|
59
|
+
ColorSpace::Oklch => ruby.intern("oklch"),
|
|
60
|
+
ColorSpace::SrgbLinear => ruby.intern("srgb_linear"),
|
|
61
|
+
ColorSpace::DisplayP3 => ruby.intern("display_p3"),
|
|
62
|
+
ColorSpace::DisplayP3Linear => ruby.intern("display_p3_linear"),
|
|
63
|
+
ColorSpace::A98Rgb => ruby.intern("a98_rgb"),
|
|
64
|
+
ColorSpace::ProphotoRgb => ruby.intern("prophoto_rgb"),
|
|
65
|
+
ColorSpace::Rec2020 => ruby.intern("rec2020"),
|
|
66
|
+
ColorSpace::XyzD50 => ruby.intern("xyz_d50"),
|
|
67
|
+
ColorSpace::XyzD65 => ruby.intern("xyz_d65"),
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
use magnus::{IntoValue, Ruby, Value};
|
|
2
|
+
use style::{color::{component::ColorComponent, parsing::{ChannelKeyword, NumberOrAngleComponent, NumberOrPercentageComponent}}, values::specified::{Angle, calc::CalcNode}};
|
|
3
|
+
|
|
4
|
+
use crate::declarations::{angle::YAngle, number::YNumber, percentage::YPercentage};
|
|
5
|
+
|
|
6
|
+
#[derive(Clone)]
|
|
7
|
+
pub enum StoredColorFunctionComponent {
|
|
8
|
+
NumberOrPercentage(ColorComponent<NumberOrPercentageComponent>),
|
|
9
|
+
NumberOrAngle(ColorComponent<NumberOrAngleComponent>),
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl StoredColorFunctionComponent {
|
|
13
|
+
pub fn value(&self) -> Option<StoredColorComponentValue> {
|
|
14
|
+
match self {
|
|
15
|
+
Self::NumberOrPercentage(component) => match component {
|
|
16
|
+
ColorComponent::Value(NumberOrPercentageComponent::Number(value)) => Some(StoredColorComponentValue::Number(*value)),
|
|
17
|
+
ColorComponent::Value(NumberOrPercentageComponent::Percentage(value)) => Some(StoredColorComponentValue::Percentage(*value)),
|
|
18
|
+
_ => None,
|
|
19
|
+
},
|
|
20
|
+
Self::NumberOrAngle(component) => match component {
|
|
21
|
+
ColorComponent::Value(NumberOrAngleComponent::Number(value)) => Some(StoredColorComponentValue::Number(*value)),
|
|
22
|
+
ColorComponent::Value(NumberOrAngleComponent::Angle(value)) => Some(StoredColorComponentValue::Angle(*value)),
|
|
23
|
+
_ => None,
|
|
24
|
+
},
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
pub fn channel_keyword(&self) -> Option<ChannelKeyword> {
|
|
29
|
+
match self {
|
|
30
|
+
Self::NumberOrPercentage(component) => match component {
|
|
31
|
+
ColorComponent::ChannelKeyword(channel_keyword) => Some(*channel_keyword),
|
|
32
|
+
_ => None,
|
|
33
|
+
},
|
|
34
|
+
Self::NumberOrAngle(component) => match component {
|
|
35
|
+
ColorComponent::ChannelKeyword(channel_keyword) => Some(*channel_keyword),
|
|
36
|
+
_ => None,
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
pub fn calc_node(&self) -> Option<CalcNode> {
|
|
42
|
+
match self {
|
|
43
|
+
Self::NumberOrPercentage(component) => match component {
|
|
44
|
+
ColorComponent::Calc(calc_node) => Some((**calc_node).clone()),
|
|
45
|
+
_ => None,
|
|
46
|
+
},
|
|
47
|
+
Self::NumberOrAngle(component) => match component {
|
|
48
|
+
ColorComponent::Calc(calc_node) => Some((**calc_node).clone()),
|
|
49
|
+
_ => None,
|
|
50
|
+
},
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
#[derive(Clone)]
|
|
56
|
+
pub enum StoredColorComponentValue {
|
|
57
|
+
Number(f32),
|
|
58
|
+
Percentage(f32),
|
|
59
|
+
Angle(f32),
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
impl StoredColorComponentValue {
|
|
63
|
+
pub fn to_value(&self, ruby: &Ruby) -> Value {
|
|
64
|
+
match self {
|
|
65
|
+
Self::Number(value) => YNumber::new(*value).into_value_with(ruby),
|
|
66
|
+
Self::Percentage(value) => YPercentage::new(*value).into_value_with(ruby),
|
|
67
|
+
Self::Angle(value) => YAngle::new(Angle::from_degrees(*value, false)).into_value_with(ruby),
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
use magnus::{Ruby, typed_data, value::Id};
|
|
2
|
+
use style::values::specified::color::SystemColor;
|
|
3
|
+
|
|
4
|
+
#[magnus::wrap(class = "Yass::Declarations::Color::SystemColor")]
|
|
5
|
+
pub struct YSystemColor {
|
|
6
|
+
system_color: SystemColor
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
impl YSystemColor {
|
|
10
|
+
pub fn new(system_color: SystemColor) -> Self {
|
|
11
|
+
Self { system_color }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Id {
|
|
15
|
+
match rb_self.system_color {
|
|
16
|
+
SystemColor::Accentcolor => ruby.intern("accent_color"),
|
|
17
|
+
SystemColor::Accentcolortext => ruby.intern("accent_color_text"),
|
|
18
|
+
SystemColor::Activetext => ruby.intern("active_text"),
|
|
19
|
+
SystemColor::Linktext => ruby.intern("link_text"),
|
|
20
|
+
SystemColor::Visitedtext => ruby.intern("visited_text"),
|
|
21
|
+
SystemColor::Buttonborder => ruby.intern("button_border"),
|
|
22
|
+
SystemColor::Buttonface => ruby.intern("button_face"),
|
|
23
|
+
SystemColor::Buttontext => ruby.intern("button_text"),
|
|
24
|
+
SystemColor::Canvas => ruby.intern("canvas"),
|
|
25
|
+
SystemColor::Canvastext => ruby.intern("canvas_text"),
|
|
26
|
+
SystemColor::Field => ruby.intern("field"),
|
|
27
|
+
SystemColor::Fieldtext => ruby.intern("field_text"),
|
|
28
|
+
SystemColor::Graytext => ruby.intern("gray_text"),
|
|
29
|
+
SystemColor::Highlight => ruby.intern("highlight"),
|
|
30
|
+
SystemColor::Highlighttext => ruby.intern("highlight_text"),
|
|
31
|
+
SystemColor::Mark => ruby.intern("mark"),
|
|
32
|
+
SystemColor::Marktext => ruby.intern("mark_text"),
|
|
33
|
+
SystemColor::Selecteditem => ruby.intern("selected_item"),
|
|
34
|
+
SystemColor::Selecteditemtext => ruby.intern("selected_item_text"),
|
|
35
|
+
SystemColor::Activeborder => ruby.intern("active_border"),
|
|
36
|
+
SystemColor::Inactiveborder => ruby.intern("inactive_border"),
|
|
37
|
+
SystemColor::Threeddarkshadow => ruby.intern("threed_dark_shadow"),
|
|
38
|
+
SystemColor::Threedhighlight => ruby.intern("threed_highlight"),
|
|
39
|
+
SystemColor::Threedlightshadow => ruby.intern("threed_light_shadow"),
|
|
40
|
+
SystemColor::Threedshadow => ruby.intern("threed_shadow"),
|
|
41
|
+
SystemColor::Windowframe => ruby.intern("window_frame"),
|
|
42
|
+
SystemColor::Buttonhighlight => ruby.intern("button_highlight"),
|
|
43
|
+
SystemColor::Buttonshadow => ruby.intern("button_shadow"),
|
|
44
|
+
SystemColor::Threedface => ruby.intern("threed_face"),
|
|
45
|
+
SystemColor::Activecaption => ruby.intern("active_caption"),
|
|
46
|
+
SystemColor::Appworkspace => ruby.intern("app_workspace"),
|
|
47
|
+
SystemColor::Background => ruby.intern("background"),
|
|
48
|
+
SystemColor::Inactivecaption => ruby.intern("inactive_caption"),
|
|
49
|
+
SystemColor::Infobackground => ruby.intern("info_background"),
|
|
50
|
+
SystemColor::Menu => ruby.intern("menu"),
|
|
51
|
+
SystemColor::Scrollbar => ruby.intern("scrollbar"),
|
|
52
|
+
SystemColor::Window => ruby.intern("window"),
|
|
53
|
+
SystemColor::Captiontext => ruby.intern("caption_text"),
|
|
54
|
+
SystemColor::Infotext => ruby.intern("info_text"),
|
|
55
|
+
SystemColor::Menutext => ruby.intern("menu_text"),
|
|
56
|
+
SystemColor::Windowtext => ruby.intern("window_text"),
|
|
57
|
+
SystemColor::Inactivecaptiontext => ruby.intern("inactive_caption_text"),
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
use magnus::{Error, RArray, Ruby, typed_data};
|
|
2
|
+
use style::values::{computed::ColorScheme};
|
|
3
|
+
use style_traits::ToCss;
|
|
4
|
+
|
|
5
|
+
#[magnus::wrap(class = "Yass::Declarations::ColorScheme")]
|
|
6
|
+
pub struct YColorScheme {
|
|
7
|
+
color_scheme: ColorScheme
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
impl YColorScheme {
|
|
11
|
+
pub fn new(color_scheme: ColorScheme) -> Self {
|
|
12
|
+
Self { color_scheme }
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
pub fn values(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Result<RArray, Error> {
|
|
16
|
+
let css = rb_self.color_scheme.to_css_string();
|
|
17
|
+
let idents: Vec<&str> = css.split_whitespace().collect();
|
|
18
|
+
let result = ruby.ary_new_capa(idents.len());
|
|
19
|
+
|
|
20
|
+
for ident in idents {
|
|
21
|
+
result.push(ruby.str_new(ident))?
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
Ok(result)
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
use magnus::{IntoValue, Ruby, Value, typed_data};
|
|
2
|
+
use style::values::{generics::{GreaterThanOrEqualToOne, column::ColumnCount}, specified::Integer};
|
|
3
|
+
|
|
4
|
+
pub fn make_column_count(column_count: &ColumnCount<GreaterThanOrEqualToOne<Integer>>, ruby: &Ruby) -> Value {
|
|
5
|
+
match column_count {
|
|
6
|
+
ColumnCount::Auto => YColumnCountAuto::new().into_value_with(ruby),
|
|
7
|
+
ColumnCount::Integer(greater_than_or_equal_to_one) => {
|
|
8
|
+
YColumnCountInteger::new(greater_than_or_equal_to_one.clone()).into_value_with(ruby)
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
#[magnus::wrap(class = "Yass::Declarations::ColumnCount::Auto")]
|
|
14
|
+
pub struct YColumnCountAuto {}
|
|
15
|
+
|
|
16
|
+
impl YColumnCountAuto {
|
|
17
|
+
pub fn new() -> Self {
|
|
18
|
+
Self {}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
#[magnus::wrap(class = "Yass::Declarations::ColumnCount::Integer")]
|
|
23
|
+
pub struct YColumnCountInteger {
|
|
24
|
+
value: i32,
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
impl YColumnCountInteger {
|
|
28
|
+
pub fn new(greater_than_or_equal_to_one: GreaterThanOrEqualToOne<Integer>) -> Self {
|
|
29
|
+
Self {
|
|
30
|
+
value: greater_than_or_equal_to_one.0.value(),
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
pub fn value(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> i32 {
|
|
35
|
+
rb_self.value
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, IntoValue, Ruby, TypedData, Value, gc::Marker, typed_data};
|
|
2
|
+
use style::values::{generics::{NonNegative, length::LengthPercentageOrNormal}, specified::LengthPercentage};
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::size::length_percentage_to_value};
|
|
5
|
+
|
|
6
|
+
type ColumnGapValue = LengthPercentageOrNormal<NonNegative<LengthPercentage>>;
|
|
7
|
+
|
|
8
|
+
fn column_gap_value_to_ruby(value: &ColumnGapValue, ruby: &Ruby) -> Value {
|
|
9
|
+
match value {
|
|
10
|
+
LengthPercentageOrNormal::Normal => YColumnGapNormal::new().into_value_with(ruby),
|
|
11
|
+
LengthPercentageOrNormal::LengthPercentage(length_percentage) => {
|
|
12
|
+
YColumnGapLengthPercentage::new(length_percentage.clone()).into_value_with(ruby)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
#[derive(TypedData)]
|
|
18
|
+
#[magnus(class = "Yass::Declarations::ColumnGap", mark)]
|
|
19
|
+
pub struct YColumnGap {
|
|
20
|
+
value: CachedValue<ColumnGapValue>,
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
impl YColumnGap {
|
|
24
|
+
pub fn new(value: ColumnGapValue) -> Self {
|
|
25
|
+
Self {
|
|
26
|
+
value: CachedValue::new(value, column_gap_value_to_ruby),
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
31
|
+
rb_self.value.get(ruby)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
impl DataTypeFunctions for YColumnGap {
|
|
36
|
+
fn mark(&self, marker: &Marker) {
|
|
37
|
+
self.value.mark(marker);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
#[magnus::wrap(class = "Yass::Declarations::ColumnGap::Normal")]
|
|
42
|
+
pub struct YColumnGapNormal {}
|
|
43
|
+
|
|
44
|
+
impl YColumnGapNormal {
|
|
45
|
+
pub fn new() -> Self {
|
|
46
|
+
Self {}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
#[derive(TypedData)]
|
|
51
|
+
#[magnus(class = "Yass::Declarations::ColumnGap::LengthPercentage", mark)]
|
|
52
|
+
pub struct YColumnGapLengthPercentage {
|
|
53
|
+
length_percentage: CachedValue<NonNegative<LengthPercentage>>,
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
impl YColumnGapLengthPercentage {
|
|
57
|
+
pub fn new(length_percentage: NonNegative<LengthPercentage>) -> Self {
|
|
58
|
+
Self {
|
|
59
|
+
length_percentage: CachedValue::new(length_percentage, |value, ruby| {
|
|
60
|
+
length_percentage_to_value(&value.0, ruby)
|
|
61
|
+
}),
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
66
|
+
rb_self.length_percentage.get(ruby)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
impl DataTypeFunctions for YColumnGapLengthPercentage {
|
|
71
|
+
fn mark(&self, marker: &Marker) {
|
|
72
|
+
self.length_percentage.mark(marker);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
use magnus::{Ruby, typed_data, value::Id};
|
|
2
|
+
use style::computed_values::column_span::T;
|
|
3
|
+
|
|
4
|
+
#[magnus::wrap(class = "Yass::Declarations::ColumnSpan")]
|
|
5
|
+
pub struct YColumnSpan {
|
|
6
|
+
specified_value: T
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
impl YColumnSpan {
|
|
10
|
+
pub fn new(specified_value: T) -> Self {
|
|
11
|
+
Self { specified_value }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Id {
|
|
15
|
+
match rb_self.specified_value {
|
|
16
|
+
T::None => ruby.intern("none"),
|
|
17
|
+
T::All => ruby.intern("all"),
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
use magnus::{DataTypeFunctions, IntoValue, Ruby, TypedData, Value, gc, typed_data};
|
|
2
|
+
use style::values::{generics::{NonNegative, length::LengthPercentageOrAuto}, specified::Length};
|
|
3
|
+
|
|
4
|
+
use crate::{cached_value::CachedValue, declarations::length::length_to_value};
|
|
5
|
+
|
|
6
|
+
fn make_column_width_value(value: &LengthPercentageOrAuto<NonNegative<Length>>, ruby: &Ruby) -> Value {
|
|
7
|
+
match value {
|
|
8
|
+
LengthPercentageOrAuto::Auto => YColumnWidthAuto::new().into_value_with(ruby),
|
|
9
|
+
LengthPercentageOrAuto::LengthPercentage(non_negative) => {
|
|
10
|
+
YColumnWidthLength::new(non_negative.clone()).into_value_with(ruby)
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
#[derive(TypedData)]
|
|
16
|
+
#[magnus(class = "Yass::Declarations::ColumnWidth", mark)]
|
|
17
|
+
pub struct YColumnWidth {
|
|
18
|
+
value: CachedValue<LengthPercentageOrAuto<NonNegative<Length>>>,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
impl YColumnWidth {
|
|
22
|
+
pub fn new(non_negative_length_or_auto: LengthPercentageOrAuto<NonNegative<Length>>) -> Self {
|
|
23
|
+
Self {
|
|
24
|
+
value: CachedValue::new(non_negative_length_or_auto, make_column_width_value),
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
29
|
+
rb_self.value.get(ruby)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
impl DataTypeFunctions for YColumnWidth {
|
|
34
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
35
|
+
self.value.mark(marker);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
#[magnus::wrap(class = "Yass::Declarations::ColumnWidth::Auto")]
|
|
40
|
+
pub struct YColumnWidthAuto {}
|
|
41
|
+
|
|
42
|
+
impl YColumnWidthAuto {
|
|
43
|
+
pub fn new() -> Self {
|
|
44
|
+
Self {}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
#[derive(TypedData)]
|
|
49
|
+
#[magnus(class = "Yass::Declarations::ColumnWidth::Length", mark)]
|
|
50
|
+
pub struct YColumnWidthLength {
|
|
51
|
+
length: CachedValue<NonNegative<Length>>,
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
impl YColumnWidthLength {
|
|
55
|
+
pub fn new(non_negative: NonNegative<Length>) -> Self {
|
|
56
|
+
Self {
|
|
57
|
+
length: CachedValue::new(non_negative, |v, ruby| length_to_value(&v.0, ruby)),
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
pub fn value(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Value {
|
|
62
|
+
rb_self.length.get(ruby)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
impl DataTypeFunctions for YColumnWidthLength {
|
|
67
|
+
fn mark(&self, marker: &gc::Marker) {
|
|
68
|
+
self.length.mark(marker);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
use magnus::{Error, RArray, Ruby, typed_data};
|
|
2
|
+
use style::values::computed::Contain;
|
|
3
|
+
|
|
4
|
+
#[magnus::wrap(class = "Yass::Declarations::Contain")]
|
|
5
|
+
pub struct YContain {
|
|
6
|
+
contain: Contain
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
impl YContain {
|
|
10
|
+
pub fn new(contain: Contain) -> Self {
|
|
11
|
+
Self { contain }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
pub fn values(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Result<RArray, Error> {
|
|
15
|
+
let contain = rb_self.contain;
|
|
16
|
+
let result = ruby.ary_new();
|
|
17
|
+
|
|
18
|
+
if contain.is_empty() {
|
|
19
|
+
result.push(ruby.intern("none"))?;
|
|
20
|
+
return Ok(result);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if contain.contains(Contain::STRICT) {
|
|
24
|
+
result.push(ruby.intern("strict"))?;
|
|
25
|
+
return Ok(result);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if contain.contains(Contain::CONTENT) {
|
|
29
|
+
result.push(ruby.intern("content"))?;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if contain.contains(Contain::SIZE) {
|
|
33
|
+
result.push(ruby.intern("size"))?;
|
|
34
|
+
} else {
|
|
35
|
+
if contain.contains(Contain::INLINE_SIZE) {
|
|
36
|
+
result.push(ruby.intern("inline_size"))?;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if contain.contains(Contain::BLOCK_SIZE) {
|
|
40
|
+
result.push(ruby.intern("block_size"))?;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if !contain.contains(Contain::CONTENT) {
|
|
45
|
+
if contain.contains(Contain::LAYOUT) {
|
|
46
|
+
result.push(ruby.intern("layout"))?;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if contain.contains(Contain::STYLE) {
|
|
50
|
+
result.push(ruby.intern("style"))?;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if contain.contains(Contain::PAINT) {
|
|
54
|
+
result.push(ruby.intern("paint"))?;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
Ok(result)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
pub fn is_none(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> bool {
|
|
62
|
+
rb_self.contain.is_empty()
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
pub fn is_inline_size(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> bool {
|
|
66
|
+
rb_self.contain.contains(Contain::STRICT) ||
|
|
67
|
+
rb_self.contain.contains(Contain::SIZE) ||
|
|
68
|
+
rb_self.contain.contains(Contain::INLINE_SIZE)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
pub fn is_block_size(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> bool {
|
|
72
|
+
rb_self.contain.contains(Contain::STRICT) ||
|
|
73
|
+
rb_self.contain.contains(Contain::SIZE) ||
|
|
74
|
+
rb_self.contain.contains(Contain::BLOCK_SIZE)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
pub fn is_layout(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> bool {
|
|
78
|
+
rb_self.contain.contains(Contain::STRICT) ||
|
|
79
|
+
rb_self.contain.contains(Contain::CONTENT) ||
|
|
80
|
+
rb_self.contain.contains(Contain::LAYOUT)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
pub fn is_style(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> bool {
|
|
84
|
+
rb_self.contain.contains(Contain::STRICT) ||
|
|
85
|
+
rb_self.contain.contains(Contain::CONTENT) ||
|
|
86
|
+
rb_self.contain.contains(Contain::STYLE)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
pub fn is_paint(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> bool {
|
|
90
|
+
rb_self.contain.contains(Contain::STRICT) ||
|
|
91
|
+
rb_self.contain.contains(Contain::CONTENT) ||
|
|
92
|
+
rb_self.contain.contains(Contain::PAINT)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
pub fn is_size(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> bool {
|
|
96
|
+
rb_self.contain.contains(Contain::STRICT) || rb_self.contain.contains(Contain::SIZE)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
pub fn is_content(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> bool {
|
|
100
|
+
rb_self.contain.contains(Contain::STRICT) || rb_self.contain.contains(Contain::CONTENT)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
pub fn is_strict(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> bool {
|
|
104
|
+
rb_self.contain.contains(Contain::STRICT)
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
use magnus::{Error, RArray, Ruby, typed_data};
|
|
2
|
+
use style::values::computed::ContainerName;
|
|
3
|
+
use style_traits::ToCss;
|
|
4
|
+
|
|
5
|
+
#[magnus::wrap(class = "Yass::Declarations::ContainerName")]
|
|
6
|
+
pub struct YContainerName {
|
|
7
|
+
container_name: ContainerName
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
impl YContainerName {
|
|
11
|
+
pub fn new(container_name: ContainerName) -> Self {
|
|
12
|
+
Self { container_name }
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
pub fn values(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Result<RArray, Error> {
|
|
16
|
+
// Stylo keeps the underlying list private, so we split the serialized
|
|
17
|
+
// CSS value to expose each container name.
|
|
18
|
+
let css = rb_self.container_name.to_css_string();
|
|
19
|
+
let idents: Vec<&str> = css.split_whitespace().collect();
|
|
20
|
+
let result = ruby.ary_new_capa(idents.len());
|
|
21
|
+
|
|
22
|
+
for ident in idents {
|
|
23
|
+
result.push(ruby.str_new(ident))?;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
Ok(result)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
pub fn is_none(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> bool {
|
|
30
|
+
rb_self.container_name.is_none()
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
use magnus::{Error, RArray, Ruby, typed_data};
|
|
2
|
+
use style::values::computed::ContainerType;
|
|
3
|
+
|
|
4
|
+
#[magnus::wrap(class = "Yass::Declarations::ContainerType")]
|
|
5
|
+
pub struct YContainerType {
|
|
6
|
+
container_type: ContainerType
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
impl YContainerType {
|
|
10
|
+
pub fn new(container_type: ContainerType) -> Self {
|
|
11
|
+
Self { container_type }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
pub fn values(ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> Result<RArray, Error> {
|
|
15
|
+
let container_type = rb_self.container_type;
|
|
16
|
+
let result = ruby.ary_new();
|
|
17
|
+
|
|
18
|
+
if container_type.is_normal() {
|
|
19
|
+
result.push(ruby.intern("normal"))?;
|
|
20
|
+
return Ok(result);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if container_type.contains(ContainerType::SIZE) {
|
|
24
|
+
result.push(ruby.intern("size"))?;
|
|
25
|
+
} else if container_type.contains(ContainerType::INLINE_SIZE) {
|
|
26
|
+
result.push(ruby.intern("inline_size"))?;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if container_type.contains(ContainerType::SCROLL_STATE) {
|
|
30
|
+
result.push(ruby.intern("scroll_state"))?;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
Ok(result)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
pub fn is_normal(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> bool {
|
|
37
|
+
rb_self.container_type.is_normal()
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
pub fn is_inline_size(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> bool {
|
|
41
|
+
rb_self.container_type.contains(ContainerType::SIZE) ||
|
|
42
|
+
rb_self.container_type.contains(ContainerType::INLINE_SIZE)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
pub fn is_size(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> bool {
|
|
46
|
+
rb_self.container_type.contains(ContainerType::SIZE)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
pub fn is_scroll_state(_ruby: &Ruby, rb_self: typed_data::Obj<Self>) -> bool {
|
|
50
|
+
rb_self.container_type.contains(ContainerType::SCROLL_STATE)
|
|
51
|
+
}
|
|
52
|
+
}
|