dymokomi/luce-browser-engine
Source of release 0.6.1
0.6.1 / src / web / css / style_values / tests_style_values_1_values.lucb
#==============================================================================================
#
# tests_style_values_1_values - the values of region r34's oracle dump
#
# DESCRIPTION:
# Ladybird has no unit tests for its style values. The test "the style values print what
# the reference build prints" (tests_style_values_1) builds every value below with the
# values' own `create` functions (the value parsers are regions r32/r33), prints what the
# local oracle prints (luce-browser-tools/oracles/luce-browser-engine/style_values_1/
# oracle.cpp, over the reference build's LibWeb), and compares the dump line by line with
# the oracle's output (tests_style_values_1_expected). This part builds the values, in the
# oracle's order and with its labels.
#
#==============================================================================================
# mark: Building blocks =========================================================================
## A labelled value of the dump.
struct TestStyleValue:
var label: str
var value: CssStyleValue*
## NumberStyleValue::create.
func tsv_num(value: f64) -> CssStyleValue*:
return css_number_style_value_create(value).css_style_value()
## LengthStyleValue::create(Length(value, unit)).
func tsv_len(value: f64, unit_: css_data.LengthUnit) -> CssStyleValue*:
return css_length_style_value_create(css_length_new(value, unit_)).css_style_value()
## PercentageStyleValue::create(Percentage(value)).
func tsv_pct(value: f64) -> CssStyleValue*:
return css_percentage_style_value_create(css_percentage_new(value)).css_style_value()
## KeywordStyleValue::create.
func tsv_kw(keyword: css_data.Keyword) -> CssStyleValue*:
return css_keyword_style_value_create(keyword).css_style_value()
## EdgeStyleValue::create.
func tsv_edge(edge: css_data.PositionEdge?, offset: CssStyleValue*?) -> CssEdgeStyleValue*:
return css_edge_style_value_create(edge, offset)
## The oracle's `rgb`: ColorFunctionStyleValue::create(RGB, number channels).
func tsv_rgb(r: f64, g: f64, b: f64, alpha: CssStyleValue*? = none, syntax: CssColorSyntax = CssColorSyntax.legacy, name: ak.FlyString? = none) -> CssStyleValue*:
return css_color_function_style_value_create(CssColorStyleValueColorType.rgb, tsv_num(r), tsv_num(g), tsv_num(b), alpha, syntax, name).css_style_value()
## A color function of another color type.
func tsv_color(type_: CssColorStyleValueColorType, c1: CssStyleValue*, c2: CssStyleValue*, c3: CssStyleValue*, alpha: CssStyleValue*? = none, syntax: CssColorSyntax = CssColorSyntax.modern) -> CssStyleValue*:
return css_color_function_style_value_create(type_, c1, c2, c3, alpha, syntax).css_style_value()
## A color stop.
func tsv_stop(color: CssStyleValue*, position: CssStyleValue*? = none, hint: CssStyleValue*? = none) -> CssColorStopListElement:
return CssColorStopListElement(transition_hint = hint, color_stop = CssColorStopListElementColorStop(color = color, position = position, second_position = none))
## CSS::URL(text).
func tsv_url(text: str) -> CssUrl:
var url: CssUrl = ---
css_url_construct(&url, ak.string_from_str(text), CssUrlType.url, ak.Vector[CssRequestUrlModifier]())
return url
## ImageStyleValue::create(URL(text)).
func tsv_image(text: str) -> CssImageStyleValue*:
return css_image_style_value_create_css_url(tsv_url(text))
## The component values of `text`, parsed.
func tsv_component_values(text: str) -> ak.Vector[css_syntax.ComponentValue]:
var parsing_params: CssParsingParams = ---
css_parsing_params_construct_css_parsing_mode(&parsing_params)
var parser = css_parser_create(parsing_params, ak.sv(text))
return css_parser_parse_as_list_of_component_values(&parser)
## A list of values.
func tsv_list(values: const (CssStyleValue*)[], separator: CssStyleValueListSeparator, collapsible: CssStyleValueListCollapsible = CssStyleValueListCollapsible.yes) -> CssStyleValueList*:
var vector = ak.Vector[CssStyleValue*]()
for value in values:
ak.vector_append_t(&vector, value)
return css_style_value_list_create(vector, separator, collapsible)
## A vector of color stops.
func tsv_stops(stops: const CssColorStopListElement[]) -> ak.Vector[CssColorStopListElement]:
var vector = ak.Vector[CssColorStopListElement]()
for stop in stops:
ak.vector_append_t(&vector, stop)
return vector
## A radial size of one extent.
func tsv_extent(extent: css_data.RadialExtent) -> CssRadialSizeStyleValue*:
var components = ak.Vector[CssRadialSizeStyleValueComponent]()
ak.vector_append_t(&components, CssRadialSizeStyleValueComponent.radial_extent(extent))
return css_radial_size_style_value_create(components)
## A polar color interpolation method.
func tsv_polar(color_space: css_data.PolarColorSpace, hue: css_data.HueInterpolationMethod) -> CssStyleValue*:
return css_color_interpolation_method_style_value_create(.polar_color_interpolation_method(display_list.PolarColorInterpolationMethod(color_space = color_space, hue_interpolation_method = hue))).css_style_value()
## A rectangular color interpolation method.
func tsv_rectangular(color_space: css_data.RectangularColorSpace) -> CssStyleValue*:
return css_color_interpolation_method_style_value_create(.rectangular_color_space(color_space)).css_style_value()
## A color-mix() component.
func tsv_mix(color: CssStyleValue*, percentage: CssStyleValue*?) -> CssColorMixStyleValueColorMixComponent:
return CssColorMixStyleValueColorMixComponent(color = color, percentage = percentage)
## Append a labelled value.
func tsv_add(values: ak.Vector[TestStyleValue]*, label: str, value: CssStyleValue*):
ak.vector_append_t(values, TestStyleValue(label = label, value = value))
# mark: The values ==============================================================================
## The oracle's values, in its order.
func test_build_style_values() -> ak.Vector[TestStyleValue]:
var v = ak.Vector[TestStyleValue]()
let px = css_data.LengthUnit.px
let em = css_data.LengthUnit.em
# Keywords
tsv_add(&v, "kw-inherit", tsv_kw(css_data.Keyword.inherit))
tsv_add(&v, "kw-initial", tsv_kw(css_data.Keyword.initial))
tsv_add(&v, "kw-unset", tsv_kw(css_data.Keyword.unset))
tsv_add(&v, "kw-revert", tsv_kw(css_data.Keyword.revert))
tsv_add(&v, "kw-revert-layer", tsv_kw(css_data.Keyword.revert_layer))
tsv_add(&v, "kw-auto", tsv_kw(css_data.Keyword.auto))
tsv_add(&v, "kw-none", tsv_kw(css_data.Keyword.none_))
tsv_add(&v, "kw-currentcolor", tsv_kw(css_data.Keyword.currentcolor))
tsv_add(&v, "kw-canvas", tsv_kw(css_data.Keyword.canvas))
tsv_add(&v, "kw-canvastext", tsv_kw(css_data.Keyword.canvastext))
tsv_add(&v, "kw-buttonface", tsv_kw(css_data.Keyword.buttonface))
tsv_add(&v, "kw-accentcolor", tsv_kw(css_data.Keyword.accentcolor))
tsv_add(&v, "kw-accentcolortext", tsv_kw(css_data.Keyword.accentcolortext))
tsv_add(&v, "kw-highlight", tsv_kw(css_data.Keyword.highlight))
tsv_add(&v, "kw-mark", tsv_kw(css_data.Keyword.mark))
tsv_add(&v, "kw-linktext", tsv_kw(css_data.Keyword.linktext))
tsv_add(&v, "kw-libweb-buttonfacedisabled", tsv_kw(css_data.Keyword.libweb_buttonfacedisabled))
tsv_add(&v, "kw-libweb-buttonfacehover", tsv_kw(css_data.Keyword.libweb_buttonfacehover))
tsv_add(&v, "kw-libweb-palette-base", tsv_kw(css_data.Keyword.libweb_palette_base))
tsv_add(&v, "kw-block", tsv_kw(css_data.Keyword.block))
# Numbers, integers and dimensions
tsv_add(&v, "number-0", tsv_num(0.0))
tsv_add(&v, "number-1.5", tsv_num(1.5))
tsv_add(&v, "number--2.25", tsv_num(-2.25))
tsv_add(&v, "number-third", tsv_num(1.0 / 3.0))
tsv_add(&v, "number-1e10", tsv_num(1e10))
tsv_add(&v, "integer-0", css_integer_style_value_create(0).css_style_value())
tsv_add(&v, "integer-42", css_integer_style_value_create(42).css_style_value())
tsv_add(&v, "integer--7", css_integer_style_value_create(-7).css_style_value())
tsv_add(&v, "length-0px", tsv_len(0.0, px))
tsv_add(&v, "length-1px", tsv_len(1.0, px))
tsv_add(&v, "length-12px", tsv_len(12.0, px))
tsv_add(&v, "length-1.5em", tsv_len(1.5, em))
tsv_add(&v, "length-2rem", tsv_len(2.0, css_data.LengthUnit.rem))
tsv_add(&v, "length-50vw", tsv_len(50.0, css_data.LengthUnit.vw))
tsv_add(&v, "length-3in", tsv_len(3.0, css_data.LengthUnit.in_))
tsv_add(&v, "percentage-50", tsv_pct(50.0))
tsv_add(&v, "percentage-12.5", tsv_pct(12.5))
tsv_add(&v, "angle-90deg", css_angle_style_value_create(css_angle_new(90.0, css_data.AngleUnit.deg)).css_style_value())
tsv_add(&v, "angle-0.25turn", css_angle_style_value_create(css_angle_new(0.25, css_data.AngleUnit.turn)).css_style_value())
tsv_add(&v, "angle-1rad", css_angle_style_value_create(css_angle_new(1.0, css_data.AngleUnit.rad)).css_style_value())
tsv_add(&v, "time-1.5s", css_time_style_value_create(css_time_new(1.5, css_data.TimeUnit.s)).css_style_value())
tsv_add(&v, "time-250ms", css_time_style_value_create(css_time_new(250.0, css_data.TimeUnit.ms)).css_style_value())
tsv_add(&v, "frequency-2khz", css_frequency_style_value_create(css_frequency_new(2.0, css_data.FrequencyUnit.k_hz)).css_style_value())
tsv_add(&v, "resolution-2x", css_resolution_style_value_create(css_resolution_new(2.0, css_data.ResolutionUnit.x)).css_style_value())
tsv_add(&v, "resolution-96dpi", css_resolution_style_value_create(css_resolution_new(96.0, css_data.ResolutionUnit.dpi)).css_style_value())
tsv_add(&v, "flex-1fr", css_flex_style_value_create(css_flex_new(1.0, css_data.FlexUnit.fr)).css_style_value())
# Strings, identifiers, URLs, displays
tsv_add(&v, "string-plain", css_string_style_value_create(ak.fly_string_from_str("hello")).css_style_value())
tsv_add(&v, "string-quotes", css_string_style_value_create(ak.fly_string_from_str("a\"b\\c\nd")).css_style_value())
tsv_add(&v, "custom-ident-foo", css_custom_ident_style_value_create(ak.fly_string_from_str("foo")).css_style_value())
tsv_add(&v, "custom-ident-escaped", css_custom_ident_style_value_create(ak.fly_string_from_str("1st item")).css_style_value())
tsv_add(&v, "url-plain", css_url_style_value_create(tsv_url("image.png")).css_style_value())
tsv_add(&v, "url-fallback", css_url_style_value_create(tsv_url("paint.svg#p"), tsv_kw(css_data.Keyword.none_)).css_style_value())
tsv_add(&v, "display-block", css_display_style_value_create(css_display_new(css_data.DisplayOutside.block, css_data.DisplayInside.flow)).css_style_value())
tsv_add(&v, "display-inline-flex", css_display_style_value_create(css_display_new(css_data.DisplayOutside.inline, css_data.DisplayInside.flex)).css_style_value())
tsv_add(&v, "unicode-range", css_unicode_range_style_value_create(web_fonts.unicode_range_create(0x41, 0x5a)).css_style_value())
# Colors
tsv_add(&v, "rgb-red", tsv_rgb(255.0, 0.0, 0.0))
tsv_add(&v, "rgb-named-Red", tsv_rgb(255.0, 0.0, 0.0, none, CssColorSyntax.legacy, ak.fly_string_from_str("Red")))
tsv_add(&v, "rgb-half-alpha", tsv_rgb(10.0, 20.0, 30.0, tsv_num(0.5)))
tsv_add(&v, "rgb-modern-none", tsv_color(CssColorStyleValueColorType.rgb, tsv_kw(css_data.Keyword.none_), tsv_num(128.0), tsv_pct(50.0), tsv_pct(25.0)))
tsv_add(&v, "rgb-out-of-range", tsv_rgb(300.0, -5.0, 127.5, tsv_num(2.0)))
tsv_add(&v, "hsl", tsv_color(CssColorStyleValueColorType.hsl, tsv_num(120.0), tsv_pct(50.0), tsv_pct(50.0), none, CssColorSyntax.legacy))
tsv_add(&v, "hsl-angle", tsv_color(CssColorStyleValueColorType.hsl, css_angle_style_value_create(css_angle_new(0.5, css_data.AngleUnit.turn)).css_style_value(), tsv_num(100.0), tsv_num(25.0), tsv_num(0.25)))
tsv_add(&v, "hwb", tsv_color(CssColorStyleValueColorType.hwb, tsv_num(200.0), tsv_pct(10.0), tsv_pct(20.0)))
tsv_add(&v, "hwb-gray", tsv_color(CssColorStyleValueColorType.hwb, tsv_num(0.0), tsv_pct(70.0), tsv_pct(60.0), tsv_pct(80.0)))
tsv_add(&v, "lab", tsv_color(CssColorStyleValueColorType.lab, tsv_num(50.0), tsv_num(40.0), tsv_num(-30.0)))
tsv_add(&v, "lch", tsv_color(CssColorStyleValueColorType.lch, tsv_pct(60.0), tsv_num(50.0), tsv_num(270.0)))
tsv_add(&v, "oklab", tsv_color(CssColorStyleValueColorType.ok_lab, tsv_num(0.7), tsv_num(-0.1), tsv_num(0.1), tsv_pct(90.0)))
tsv_add(&v, "oklch", tsv_color(CssColorStyleValueColorType.oklch, tsv_num(0.5), tsv_num(0.2), tsv_num(30.0)))
tsv_add(&v, "color-srgb", tsv_color(CssColorStyleValueColorType.s_rgb, tsv_num(0.25), tsv_pct(50.0), tsv_num(1.0)))
tsv_add(&v, "color-display-p3", tsv_color(CssColorStyleValueColorType.display_p3, tsv_num(1.0), tsv_num(0.0), tsv_num(0.0), tsv_num(0.75)))
tsv_add(&v, "color-xyz-d65", tsv_color(CssColorStyleValueColorType.xyzd65, tsv_num(0.2), tsv_num(0.3), tsv_num(0.4)))
tsv_add(&v, "color-rec2020-negative-alpha", tsv_color(CssColorStyleValueColorType.rec2020, tsv_num(0.5), tsv_num(0.5), tsv_num(0.5), tsv_num(-1.0)))
tsv_add(&v, "from-color", css_color_style_value_create_from_color(gfx.color_new_u8_u8_u8_u8(1, 2, 3, 128), CssColorSyntax.modern).css_style_value())
tsv_add(&v, "color-mix-default", css_color_mix_style_value_create(none, tsv_mix(tsv_rgb(255.0, 0.0, 0.0), none), tsv_mix(tsv_rgb(0.0, 0.0, 255.0), none)).css_style_value())
tsv_add(&v, "color-mix-srgb-40", css_color_mix_style_value_create(tsv_rectangular(css_data.RectangularColorSpace.srgb), tsv_mix(tsv_rgb(255.0, 0.0, 0.0), tsv_pct(40.0)), tsv_mix(tsv_rgb(0.0, 0.0, 255.0), none)).css_style_value())
tsv_add(&v, "color-mix-p2-30", css_color_mix_style_value_create(none, tsv_mix(tsv_rgb(255.0, 255.0, 0.0), none), tsv_mix(tsv_rgb(0.0, 128.0, 0.0), tsv_pct(30.0))).css_style_value())
tsv_add(&v, "color-mix-both-sum-50", css_color_mix_style_value_create(tsv_polar(css_data.PolarColorSpace.hsl, css_data.HueInterpolationMethod.longer), tsv_mix(tsv_rgb(255.0, 0.0, 0.0), tsv_pct(20.0)), tsv_mix(tsv_rgb(0.0, 0.0, 255.0), tsv_pct(30.0))).css_style_value())
tsv_add(&v, "color-mix-currentcolor", css_color_mix_style_value_create(none, tsv_mix(tsv_kw(css_data.Keyword.currentcolor), tsv_pct(50.0)), tsv_mix(tsv_rgb(0.0, 0.0, 255.0), tsv_pct(50.0))).css_style_value())
tsv_add(&v, "light-dark", css_light_dark_style_value_create(tsv_rgb(255.0, 255.0, 255.0), tsv_rgb(0.0, 0.0, 0.0)).css_style_value())
tsv_add(&v, "color-scheme-normal", css_color_scheme_style_value_normal().css_style_value())
var schemes = ak.Vector[ak.String]()
ak.vector_append_t(&schemes, ak.string_from_str("light"))
ak.vector_append_t(&schemes, ak.string_from_str("dark"))
tsv_add(&v, "color-scheme-light-dark-only", css_color_scheme_style_value_create(schemes, true).css_style_value())
tsv_add(&v, "cim-srgb", tsv_rectangular(css_data.RectangularColorSpace.srgb))
tsv_add(&v, "cim-hsl-longer", tsv_polar(css_data.PolarColorSpace.hsl, css_data.HueInterpolationMethod.longer))
tsv_add(&v, "cim-lch-shorter", tsv_polar(css_data.PolarColorSpace.lch, css_data.HueInterpolationMethod.shorter))
# Positions and edges
tsv_add(&v, "edge-center", tsv_edge(css_data.PositionEdge.center, none).css_style_value())
tsv_add(&v, "edge-left-10px", tsv_edge(css_data.PositionEdge.left, tsv_len(10.0, px)).css_style_value())
tsv_add(&v, "edge-right", tsv_edge(css_data.PositionEdge.right, none).css_style_value())
tsv_add(&v, "edge-25%", tsv_edge(none, tsv_pct(25.0)).css_style_value())
tsv_add(&v, "position-center", css_position_style_value_create_center().css_style_value())
tsv_add(&v, "position-computed-center", css_position_style_value_create_computed_center().css_style_value())
tsv_add(&v, "position-left-top", css_position_style_value_create(tsv_edge(css_data.PositionEdge.left, none), tsv_edge(css_data.PositionEdge.top, tsv_len(1.0, em))).css_style_value())
test_build_style_values_2(&v)
return v
## The oracle's values from the gradients on.
func test_build_style_values_2(v: ak.Vector[TestStyleValue]*):
let px = css_data.LengthUnit.px
let em = css_data.LengthUnit.em
# Gradients
let two_stops = tsv_stops([tsv_stop(tsv_rgb(255.0, 0.0, 0.0)), tsv_stop(tsv_rgb(0.0, 0.0, 255.0), tsv_pct(50.0))])
let hinted_stops = tsv_stops([tsv_stop(tsv_kw(css_data.Keyword.currentcolor), tsv_len(1.0, em)), tsv_stop(tsv_rgb(0.0, 255.0, 0.0), tsv_pct(30.0), tsv_pct(20.0)), tsv_stop(tsv_color(CssColorStyleValueColorType.ok_lab, tsv_num(0.5), tsv_num(0.0), tsv_num(0.0)), tsv_pct(60.0))])
tsv_add(v, "linear-to-bottom", css_linear_gradient_style_value_create(.css_side_or_corner(CssSideOrCorner.bottom), two_stops, CssLinearGradientStyleValueGradientType.standard, CssGradientRepeating.no, none).css_style_value())
tsv_add(v, "linear-to-top-left", css_linear_gradient_style_value_create(.css_side_or_corner(CssSideOrCorner.top_left), two_stops, CssLinearGradientStyleValueGradientType.standard, CssGradientRepeating.yes, tsv_rectangular(css_data.RectangularColorSpace.oklab)).css_style_value())
tsv_add(v, "linear-angle-modern", css_linear_gradient_style_value_create(.css_style_value(css_angle_style_value_create(css_angle_new(45.0, css_data.AngleUnit.deg)).css_style_value()), hinted_stops, CssLinearGradientStyleValueGradientType.standard, CssGradientRepeating.no, tsv_rectangular(css_data.RectangularColorSpace.srgb)).css_style_value())
tsv_add(v, "linear-webkit", css_linear_gradient_style_value_create(.css_side_or_corner(CssSideOrCorner.left), two_stops, CssLinearGradientStyleValueGradientType.web_kit, CssGradientRepeating.no, none).css_style_value())
tsv_add(v, "conic-default", css_conic_gradient_style_value_create(none, css_position_style_value_create_center(), two_stops, CssGradientRepeating.no, none).css_style_value())
tsv_add(v, "conic-from-at", css_conic_gradient_style_value_create(css_angle_style_value_create(css_angle_new(90.0, css_data.AngleUnit.deg)).css_style_value(), css_position_style_value_create(tsv_edge(css_data.PositionEdge.left, none), tsv_edge(none, tsv_pct(30.0))), hinted_stops, CssGradientRepeating.yes, tsv_polar(css_data.PolarColorSpace.oklch, css_data.HueInterpolationMethod.increasing)).css_style_value())
tsv_add(v, "radial-size-farthest-corner", tsv_extent(css_data.RadialExtent.farthest_corner).css_style_value())
tsv_add(v, "radial-size-closest-side", tsv_extent(css_data.RadialExtent.closest_side).css_style_value())
var length_components = ak.Vector[CssRadialSizeStyleValueComponent]()
ak.vector_append_t(&length_components, CssRadialSizeStyleValueComponent.css_style_value(tsv_len(10.0, px)))
ak.vector_append_t(&length_components, CssRadialSizeStyleValueComponent.css_style_value(tsv_pct(20.0)))
tsv_add(v, "radial-size-lengths", css_radial_size_style_value_create(length_components).css_style_value())
var em_components = ak.Vector[CssRadialSizeStyleValueComponent]()
ak.vector_append_t(&em_components, CssRadialSizeStyleValueComponent.css_style_value(tsv_len(2.0, em)))
tsv_add(v, "radial-size-em", css_radial_size_style_value_create(em_components).css_style_value())
tsv_add(v, "radial-default", css_radial_gradient_style_value_create(CssRadialGradientStyleValueEndingShape.ellipse, tsv_extent(css_data.RadialExtent.farthest_corner).css_style_value(), css_position_style_value_create_center(), two_stops, CssGradientRepeating.no, none).css_style_value())
tsv_add(v, "radial-circle-at", css_radial_gradient_style_value_create(CssRadialGradientStyleValueEndingShape.circle, tsv_extent(css_data.RadialExtent.closest_side).css_style_value(), css_position_style_value_create(tsv_edge(css_data.PositionEdge.right, none), tsv_edge(css_data.PositionEdge.bottom, none)), hinted_stops, CssGradientRepeating.yes, tsv_rectangular(css_data.RectangularColorSpace.display_p3)).css_style_value())
# Boxes, borders and backgrounds
tsv_add(v, "background-size-auto-auto", css_background_size_style_value_create(tsv_kw(css_data.Keyword.auto), tsv_kw(css_data.Keyword.auto)).css_style_value())
tsv_add(v, "background-size-em-auto", css_background_size_style_value_create(tsv_len(2.0, em), tsv_kw(css_data.Keyword.auto)).css_style_value())
tsv_add(v, "border-image-slice-1", css_border_image_slice_style_value_create(tsv_num(1.0), tsv_num(1.0), tsv_num(1.0), tsv_num(1.0), false).css_style_value())
tsv_add(v, "border-image-slice-2", css_border_image_slice_style_value_create(tsv_num(1.0), tsv_num(2.0), tsv_num(1.0), tsv_num(2.0), true).css_style_value())
tsv_add(v, "border-image-slice-3", css_border_image_slice_style_value_create(tsv_num(1.0), tsv_num(2.0), tsv_num(3.0), tsv_num(2.0), false).css_style_value())
tsv_add(v, "border-image-slice-4", css_border_image_slice_style_value_create(tsv_num(1.0), tsv_pct(2.0), tsv_num(3.0), tsv_num(4.0), false).css_style_value())
tsv_add(v, "border-radius-circle", css_border_radius_style_value_create(tsv_len(5.0, px), tsv_len(5.0, px)).css_style_value())
tsv_add(v, "border-radius-ellipse", css_border_radius_style_value_create(tsv_len(1.0, em), tsv_pct(10.0)).css_style_value())
tsv_add(v, "border-radius-zero", css_border_radius_style_value_create_zero().css_style_value())
tsv_add(v, "border-radius-rect-zero", css_border_radius_rect_style_value_create_zero().css_style_value())
tsv_add(v, "border-radius-rect-mixed", css_border_radius_rect_style_value_create(css_border_radius_style_value_create(tsv_len(1.0, px), tsv_len(2.0, px)).css_style_value(), css_border_radius_style_value_create(tsv_len(3.0, px), tsv_len(3.0, px)).css_style_value(), css_border_radius_style_value_create(tsv_len(1.0, px), tsv_len(2.0, px)).css_style_value(), css_border_radius_style_value_create(tsv_len(3.0, px), tsv_len(3.0, px)).css_style_value()).css_style_value())
tsv_add(v, "rect", css_rect_style_value_create(tsv_len(1.0, px), tsv_kw(css_data.Keyword.auto), tsv_len(2.0, em), tsv_len(3.0, px)).css_style_value())
tsv_add(v, "repeat-repeat-repeat", css_repeat_style_style_value_create(css_data.Repetition.repeat, css_data.Repetition.repeat).css_style_value())
tsv_add(v, "repeat-x", css_repeat_style_style_value_create(css_data.Repetition.repeat, css_data.Repetition.no_repeat).css_style_value())
tsv_add(v, "repeat-y", css_repeat_style_style_value_create(css_data.Repetition.no_repeat, css_data.Repetition.repeat).css_style_value())
tsv_add(v, "repeat-space-round", css_repeat_style_style_value_create(css_data.Repetition.space, css_data.Repetition.round).css_style_value())
tsv_add(v, "scrollbar-gutter-auto", css_scrollbar_gutter_style_value_create(css_data.ScrollbarGutter.auto).css_style_value())
tsv_add(v, "scrollbar-gutter-both", css_scrollbar_gutter_style_value_create(css_data.ScrollbarGutter.both_edges).css_style_value())
tsv_add(v, "scrollbar-color", css_scrollbar_color_style_value_create(tsv_rgb(1.0, 2.0, 3.0), tsv_kw(css_data.Keyword.canvas)).css_style_value())
tsv_add(v, "shadow-box", css_shadow_style_value_create(CssShadowStyleValueShadowType.normal, tsv_rgb(0.0, 0.0, 0.0, tsv_num(0.5)), tsv_len(1.0, px), tsv_len(2.0, px), tsv_len(3.0, px), tsv_len(4.0, em), CssShadowPlacement.inner).css_style_value())
tsv_add(v, "shadow-text-minimal", css_shadow_style_value_create(CssShadowStyleValueShadowType.text, none, tsv_len(1.0, px), tsv_len(1.0, px), none, tsv_len(9.0, px), CssShadowPlacement.outer).css_style_value())
tsv_add(v, "superellipse-2", css_superellipse_style_value_create(tsv_num(2.0)).css_style_value())
tsv_add(v, "superellipse-inf", css_superellipse_style_value_create(tsv_num(math.infinity)).css_style_value())
tsv_add(v, "superellipse--inf", css_superellipse_style_value_create(tsv_num(-math.infinity)).css_style_value())
tsv_add(v, "superellipse-0.5", css_superellipse_style_value_create(tsv_num(0.5)).css_style_value())
tsv_add(v, "text-indent", css_text_indent_style_value_create(tsv_len(2.0, em), CssTextIndentStyleValueHanging.yes, CssTextIndentStyleValueEachLine.yes).css_style_value())
tsv_add(v, "text-indent-plain", css_text_indent_style_value_create(tsv_pct(5.0), CssTextIndentStyleValueHanging.no, CssTextIndentStyleValueEachLine.no).css_style_value())
tsv_add(v, "tup-auto-auto", css_text_underline_position_style_value_create(css_data.TextUnderlinePositionHorizontal.auto, css_data.TextUnderlinePositionVertical.auto).css_style_value())
tsv_add(v, "tup-under", css_text_underline_position_style_value_create(css_data.TextUnderlinePositionHorizontal.under, css_data.TextUnderlinePositionVertical.auto).css_style_value())
tsv_add(v, "tup-left", css_text_underline_position_style_value_create(css_data.TextUnderlinePositionHorizontal.auto, css_data.TextUnderlinePositionVertical.left).css_style_value())
tsv_add(v, "tup-from-font-right", css_text_underline_position_style_value_create(css_data.TextUnderlinePositionHorizontal.from_font, css_data.TextUnderlinePositionVertical.right).css_style_value())
test_build_style_values_3(v, two_stops)
## The oracle's values from the lists on.
func test_build_style_values_3(v: ak.Vector[TestStyleValue]*, two_stops: ak.Vector[CssColorStopListElement]):
let px = css_data.LengthUnit.px
let em = css_data.LengthUnit.em
# Lists, tuples, functions and the rest
tsv_add(v, "list-space", tsv_list([tsv_len(1.0, px), tsv_len(2.0, em)], CssStyleValueListSeparator.space).css_style_value())
tsv_add(v, "list-space-same", tsv_list([tsv_len(3.0, px), tsv_len(3.0, px)], CssStyleValueListSeparator.space).css_style_value())
tsv_add(v, "list-space-same-not-collapsible", tsv_list([tsv_len(3.0, px), tsv_len(3.0, px)], CssStyleValueListSeparator.space, CssStyleValueListCollapsible.no).css_style_value())
tsv_add(v, "list-comma", tsv_list([tsv_kw(css_data.Keyword.auto), tsv_num(2.0), css_string_style_value_create(ak.fly_string_from_str("x")).css_style_value()], CssStyleValueListSeparator.comma).css_style_value())
tsv_add(v, "list-empty", css_style_value_list_create(ak.Vector[CssStyleValue*](), CssStyleValueListSeparator.comma).css_style_value())
var tuple = ak.Vector[CssStyleValue*?]()
ak.vector_append_t(&tuple, tsv_kw(css_data.Keyword.normal))
ak.vector_append_t(&tuple, none)
ak.vector_append_t(&tuple, tsv_len(1.0, em))
tsv_add(v, "tuple", css_tuple_style_value_create(tuple).css_style_value())
tsv_add(v, "function", css_function_style_value_create(ak.fly_string_from_str("scroll"), tsv_len(2.0, em)).css_style_value())
tsv_add(v, "opacity-percentage", css_opacity_value_style_value_create(tsv_pct(40.0)).css_style_value())
tsv_add(v, "opacity-number", css_opacity_value_style_value_create(tsv_num(1.5)).css_style_value())
tsv_add(v, "opacity-half", css_opacity_value_style_value_create(tsv_num(0.5)).css_style_value())
tsv_add(v, "ott-feature-1", css_open_type_tagged_style_value_create(CssOpenTypeTaggedStyleValueMode.font_feature_settings, ak.fly_string_from_str("liga"), css_integer_style_value_create(1).css_style_value()).css_style_value())
tsv_add(v, "ott-feature-0", css_open_type_tagged_style_value_create(CssOpenTypeTaggedStyleValueMode.font_feature_settings, ak.fly_string_from_str("smcp"), css_integer_style_value_create(0).css_style_value()).css_style_value())
tsv_add(v, "ott-variation", css_open_type_tagged_style_value_create(CssOpenTypeTaggedStyleValueMode.font_variation_settings, ak.fly_string_from_str("wght"), tsv_num(1.0)).css_style_value())
tsv_add(v, "ratio", css_ratio_style_value_create(tsv_num(16.0), tsv_num(9.0)).css_style_value())
tsv_add(v, "anchor", css_anchor_style_value_create(ak.fly_string_from_str("--a"), tsv_kw(css_data.Keyword.top), tsv_len(5.0, px)).css_style_value())
tsv_add(v, "anchor-no-name", css_anchor_style_value_create(none, tsv_pct(50.0), none).css_style_value())
tsv_add(v, "anchor-size", css_anchor_size_style_value_create(ak.fly_string_from_str("--b"), css_data.AnchorSize.width, tsv_len(1.0, em)).css_style_value())
tsv_add(v, "anchor-size-empty", css_anchor_size_style_value_create(none, none, none).css_style_value())
tsv_add(v, "anchor-size-only-size", css_anchor_size_style_value_create(none, css_data.AnchorSize.self_block, none).css_style_value())
let content_list = tsv_list([css_string_style_value_create(ak.fly_string_from_str("a")).css_style_value(), tsv_kw(css_data.Keyword.open_quote)], CssStyleValueListSeparator.space)
let alt_list = tsv_list([css_string_style_value_create(ak.fly_string_from_str("alt")).css_style_value()], CssStyleValueListSeparator.space)
tsv_add(v, "content", css_content_style_value_create(content_list, alt_list).css_style_value())
let only_content = tsv_list([css_string_style_value_create(ak.fly_string_from_str("b")).css_style_value()], CssStyleValueListSeparator.space)
tsv_add(v, "content-no-alt", css_content_style_value_create(only_content, none).css_style_value())
tsv_add(v, "random-fixed", css_random_value_sharing_style_value_create_fixed(tsv_num(0.25)).css_style_value())
tsv_add(v, "random-auto-shared", css_random_value_sharing_style_value_create_auto(ak.fly_string_from_str("width 0"), true).css_style_value())
tsv_add(v, "random-dashed", css_random_value_sharing_style_value_create_dashed_ident(ak.fly_string_from_str("--r"), false).css_style_value())
tsv_add(v, "random-dashed-shared", css_random_value_sharing_style_value_create_dashed_ident(ak.fly_string_from_str("--r"), true).css_style_value())
tsv_add(v, "sibling-count", css_tree_counting_function_style_value_create(CssTreeCountingFunctionStyleValueTreeCountingFunction.sibling_count, CssTreeCountingFunctionStyleValueComputedType.integer).css_style_value())
tsv_add(v, "sibling-index", css_tree_counting_function_style_value_create(CssTreeCountingFunctionStyleValueTreeCountingFunction.sibling_index, CssTreeCountingFunctionStyleValueComputedType.number).css_style_value())
tsv_add(v, "image", tsv_image("a.png").css_style_value())
var options = ak.Vector[CssImageSetStyleValueOption]()
ak.vector_append_t(&options, CssImageSetStyleValueOption(image = tsv_image("a.png").css_abstract_image_style_value(), resolution = css_resolution_style_value_create(css_resolution_new(1.0, css_data.ResolutionUnit.x)).css_style_value(), type_ = none))
ak.vector_append_t(&options, CssImageSetStyleValueOption(image = tsv_image("b.webp").css_abstract_image_style_value(), resolution = css_resolution_style_value_create(css_resolution_new(2.0, css_data.ResolutionUnit.x)).css_style_value(), type_ = ak.string_from_str("image/webp")))
let gradient = css_linear_gradient_style_value_create(.css_side_or_corner(CssSideOrCorner.bottom), two_stops, CssLinearGradientStyleValueGradientType.standard, CssGradientRepeating.no, none)
ak.vector_append_t(&options, CssImageSetStyleValueOption(image = gradient.css_abstract_image_style_value(), resolution = css_resolution_style_value_create(css_resolution_new(3.0, css_data.ResolutionUnit.x)).css_style_value(), type_ = ak.string_from_str("image/\"x\"")))
tsv_add(v, "image-set", css_image_set_style_value_create(options).css_style_value())
tsv_add(v, "cursor", css_cursor_style_value_create(tsv_image("c.cur").css_abstract_image_style_value(), tsv_num(2.0), tsv_num(3.0)).css_style_value())
tsv_add(v, "cursor-no-hotspot", css_cursor_style_value_create(tsv_image("d.cur").css_abstract_image_style_value(), none, none).css_style_value())
tsv_add(v, "guaranteed-invalid", css_guaranteed_invalid_style_value_create().css_style_value())
tsv_add(v, "pending-substitution", css_pending_substitution_style_value_create(tsv_num(1.0)).css_style_value())
tsv_add(v, "unresolved", css_unresolved_style_value_create(tsv_component_values(" var(--x, 3px) calc(1px + 2px) "), css_syntax.SubstitutionFunctionsPresence(var_ = true)).css_style_value())
tsv_add(v, "unresolved-original-text", css_unresolved_style_value_create(tsv_component_values("attr(x)"), css_syntax.SubstitutionFunctionsPresence(attr = true), ak.string_from_str("attr( x )")).css_style_value())