From 88d35c547c4e5bb80cf4f7e914f9e204c227333c Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Sun, 9 Mar 2025 13:59:33 +0000 Subject: [PATCH] LibWeb/CSS: Implement the `caret-color` property --- Libraries/LibWeb/CSS/ComputedProperties.cpp | 12 + Libraries/LibWeb/CSS/ComputedProperties.h | 1 + Libraries/LibWeb/CSS/ComputedValues.h | 4 + Libraries/LibWeb/CSS/Properties.json | 12 + .../CSS/ResolvedCSSStyleDeclaration.cpp | 4 +- Libraries/LibWeb/Layout/Node.cpp | 2 + Libraries/LibWeb/Painting/PaintableBox.cpp | 6 +- ...upported-properties-and-default-values.txt | 4 +- ...eclaration-has-indexed-property-getter.txt | 429 +++++++++--------- .../css/getComputedStyle-print-all.txt | 3 +- .../wpt-import/css/css-ui/caret-color-013.txt | 16 + .../css-ui/parsing/caret-color-invalid.txt | 9 + .../css/css-ui/parsing/caret-color-valid.txt | 7 + .../css/css-ui/caret-color-013.html | 50 ++ .../css-ui/parsing/caret-color-invalid.html | 21 + .../css/css-ui/parsing/caret-color-valid.html | 19 + 16 files changed, 381 insertions(+), 218 deletions(-) create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-ui/caret-color-013.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-ui/parsing/caret-color-invalid.txt create mode 100644 Tests/LibWeb/Text/expected/wpt-import/css/css-ui/parsing/caret-color-valid.txt create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-ui/caret-color-013.html create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-ui/parsing/caret-color-invalid.html create mode 100644 Tests/LibWeb/Text/input/wpt-import/css/css-ui/parsing/caret-color-valid.html diff --git a/Libraries/LibWeb/CSS/ComputedProperties.cpp b/Libraries/LibWeb/CSS/ComputedProperties.cpp index 966722f3188..ad4c21b06ae 100644 --- a/Libraries/LibWeb/CSS/ComputedProperties.cpp +++ b/Libraries/LibWeb/CSS/ComputedProperties.cpp @@ -832,6 +832,18 @@ Float ComputedProperties::float_() const return keyword_to_float(value.to_keyword()).release_value(); } +Color ComputedProperties::caret_color(Layout::NodeWithStyle const& node) const +{ + auto const& value = property(PropertyID::CaretColor); + if (value.is_keyword() && value.to_keyword() == Keyword::Auto) + return node.computed_values().color(); + + if (value.has_color()) + return value.to_color(node); + + return InitialValues::caret_color(); +} + Clear ComputedProperties::clear() const { auto const& value = property(PropertyID::Clear); diff --git a/Libraries/LibWeb/CSS/ComputedProperties.h b/Libraries/LibWeb/CSS/ComputedProperties.h index 32ce17103ba..39060a0db23 100644 --- a/Libraries/LibWeb/CSS/ComputedProperties.h +++ b/Libraries/LibWeb/CSS/ComputedProperties.h @@ -86,6 +86,7 @@ public: Clip clip() const; Display display() const; Float float_() const; + Color caret_color(Layout::NodeWithStyle const&) const; Clear clear() const; ColumnSpan column_span() const; struct ContentDataAndQuoteNestingLevel { diff --git a/Libraries/LibWeb/CSS/ComputedValues.h b/Libraries/LibWeb/CSS/ComputedValues.h index debda92e1a7..c6c70dd53aa 100644 --- a/Libraries/LibWeb/CSS/ComputedValues.h +++ b/Libraries/LibWeb/CSS/ComputedValues.h @@ -93,6 +93,7 @@ public: static CSS::Float float_() { return CSS::Float::None; } static CSS::Length border_spacing() { return CSS::Length::make_px(0); } static CSS::CaptionSide caption_side() { return CSS::CaptionSide::Top; } + static Color caret_color() { return Color::Black; } static CSS::Clear clear() { return CSS::Clear::None; } static CSS::Clip clip() { return CSS::Clip::make_auto(); } static CSS::PreferredColorScheme color_scheme() { return CSS::PreferredColorScheme::Auto; } @@ -374,6 +375,7 @@ public: CSS::Length border_spacing_horizontal() const { return m_inherited.border_spacing_horizontal; } CSS::Length border_spacing_vertical() const { return m_inherited.border_spacing_vertical; } CSS::CaptionSide caption_side() const { return m_inherited.caption_side; } + Color caret_color() const { return m_inherited.caret_color; } CSS::Clear clear() const { return m_noninherited.clear; } CSS::Clip clip() const { return m_noninherited.clip; } CSS::PreferredColorScheme color_scheme() const { return m_inherited.color_scheme; } @@ -555,6 +557,7 @@ public: protected: struct { + Color caret_color { InitialValues::caret_color() }; RefPtr font_list {}; CSSPixels font_size { InitialValues::font_size() }; int font_weight { InitialValues::font_weight() }; @@ -744,6 +747,7 @@ public: } void set_aspect_ratio(AspectRatio aspect_ratio) { m_noninherited.aspect_ratio = move(aspect_ratio); } + void set_caret_color(Color caret_color) { m_inherited.caret_color = caret_color; } void set_font_list(NonnullRefPtr font_list) { m_inherited.font_list = move(font_list); } void set_font_size(CSSPixels font_size) { m_inherited.font_size = font_size; } void set_font_weight(int font_weight) { m_inherited.font_weight = font_weight; } diff --git a/Libraries/LibWeb/CSS/Properties.json b/Libraries/LibWeb/CSS/Properties.json index f45c6fd0d6d..feaabf4b7c6 100644 --- a/Libraries/LibWeb/CSS/Properties.json +++ b/Libraries/LibWeb/CSS/Properties.json @@ -818,6 +818,18 @@ "caption-side" ] }, + "caret-color": { + "affects-layout": false, + "animation-type": "by-computed-value", + "inherited": true, + "initial": "auto", + "valid-identifiers": [ + "auto" + ], + "valid-types": [ + "color" + ] + }, "clear": { "animation-type": "discrete", "inherited": false, diff --git a/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp b/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp index afe377992ce..a3292c10630 100644 --- a/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp +++ b/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp @@ -203,7 +203,7 @@ RefPtr ResolvedCSSStyleDeclaration::style_value_for_propert // -> border-right-color // -> border-top-color // -> box-shadow - // FIXME: -> caret-color + // -> caret-color // -> color // -> outline-color // -> A resolved value special case property like color defined in another specification @@ -220,6 +220,8 @@ RefPtr ResolvedCSSStyleDeclaration::style_value_for_propert return CSSColorValue::create_from_color(layout_node.computed_values().border_top().color, ColorSyntax::Modern); case PropertyID::BoxShadow: return style_value_for_shadow(layout_node.computed_values().box_shadow()); + case PropertyID::CaretColor: + return CSSColorValue::create_from_color(layout_node.computed_values().caret_color(), ColorSyntax::Modern); case PropertyID::Color: return CSSColorValue::create_from_color(layout_node.computed_values().color(), ColorSyntax::Modern); case PropertyID::OutlineColor: diff --git a/Libraries/LibWeb/Layout/Node.cpp b/Libraries/LibWeb/Layout/Node.cpp index aece5f6e4a5..7d98c5853b8 100644 --- a/Libraries/LibWeb/Layout/Node.cpp +++ b/Libraries/LibWeb/Layout/Node.cpp @@ -943,6 +943,8 @@ void NodeWithStyle::apply_style(CSS::ComputedProperties const& computed_style) computed_values.set_mix_blend_mode(computed_style.mix_blend_mode()); computed_values.set_view_transition_name(computed_style.view_transition_name()); + computed_values.set_caret_color(computed_style.caret_color(*this)); + propagate_style_to_anonymous_wrappers(); if (auto* box_node = as_if(*this)) diff --git a/Libraries/LibWeb/Painting/PaintableBox.cpp b/Libraries/LibWeb/Painting/PaintableBox.cpp index 599f90c9945..a7fb33b4ee9 100644 --- a/Libraries/LibWeb/Painting/PaintableBox.cpp +++ b/Libraries/LibWeb/Painting/PaintableBox.cpp @@ -657,6 +657,10 @@ void paint_cursor_if_needed(PaintContext& context, TextPaintable const& paintabl if (!dom_node || (!dom_node->is_editable() && !active_element_is_editable)) return; + auto caret_color = paintable.computed_values().caret_color(); + if (caret_color.alpha() == 0) + return; + auto fragment_rect = fragment.absolute_rect(); auto text = fragment.string_view(); @@ -670,7 +674,7 @@ void paint_cursor_if_needed(PaintContext& context, TextPaintable const& paintabl auto cursor_device_rect = context.rounded_device_rect(cursor_rect).to_type(); - context.display_list_recorder().draw_rect(cursor_device_rect, paintable.computed_values().color()); + context.display_list_recorder().draw_rect(cursor_device_rect, caret_color); } void paint_text_decoration(PaintContext& context, TextPaintable const& paintable, PaintableFragment const& fragment) diff --git a/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-all-supported-properties-and-default-values.txt b/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-all-supported-properties-and-default-values.txt index afc43a69d0f..b4108636ba4 100644 --- a/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-all-supported-properties-and-default-values.txt +++ b/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-all-supported-properties-and-default-values.txt @@ -1,6 +1,6 @@ All supported properties and their default values exposed from CSSStyleDeclaration from getComputedStyle: 'cssText': '' -'length': '219' +'length': '220' 'parentRule': 'null' 'cssFloat': 'none' 'WebkitAlignContent': 'normal' @@ -245,6 +245,8 @@ All supported properties and their default values exposed from CSSStyleDeclarati 'box-sizing': 'content-box' 'captionSide': 'top' 'caption-side': 'top' +'caretColor': 'rgb(0, 0, 0)' +'caret-color': 'rgb(0, 0, 0)' 'clear': 'none' 'clip': 'auto' 'clipPath': 'none' diff --git a/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt b/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt index aeba2e39f4d..c5fade5a04f 100644 --- a/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt +++ b/Tests/LibWeb/Text/expected/css/CSSStyleDeclaration-has-indexed-property-getter.txt @@ -5,220 +5,221 @@ All properties associated with getComputedStyle(document.body): "2": "border-collapse", "3": "border-spacing", "4": "caption-side", - "5": "clip-rule", - "6": "color", - "7": "color-scheme", - "8": "cursor", - "9": "direction", - "10": "fill", - "11": "fill-opacity", - "12": "fill-rule", - "13": "font-family", - "14": "font-feature-settings", - "15": "font-language-override", - "16": "font-size", - "17": "font-style", - "18": "font-variant-alternates", - "19": "font-variant-caps", - "20": "font-variant-east-asian", - "21": "font-variant-emoji", - "22": "font-variant-ligatures", - "23": "font-variant-numeric", - "24": "font-variant-position", - "25": "font-variation-settings", - "26": "font-weight", - "27": "font-width", - "28": "image-rendering", - "29": "letter-spacing", - "30": "line-height", - "31": "list-style-image", - "32": "list-style-position", - "33": "list-style-type", - "34": "math-depth", - "35": "math-shift", - "36": "math-style", - "37": "pointer-events", - "38": "quotes", - "39": "stroke", - "40": "stroke-dasharray", - "41": "stroke-dashoffset", - "42": "stroke-linecap", - "43": "stroke-linejoin", - "44": "stroke-miterlimit", - "45": "stroke-opacity", - "46": "stroke-width", - "47": "tab-size", - "48": "text-align", - "49": "text-anchor", - "50": "text-decoration-line", - "51": "text-indent", - "52": "text-justify", - "53": "text-shadow", - "54": "text-transform", - "55": "visibility", - "56": "white-space", - "57": "word-break", - "58": "word-spacing", - "59": "word-wrap", - "60": "writing-mode", - "61": "align-content", - "62": "align-items", - "63": "align-self", - "64": "animation-delay", - "65": "animation-direction", - "66": "animation-duration", - "67": "animation-fill-mode", - "68": "animation-iteration-count", - "69": "animation-name", - "70": "animation-play-state", - "71": "animation-timing-function", - "72": "appearance", - "73": "aspect-ratio", - "74": "backdrop-filter", - "75": "background-attachment", - "76": "background-clip", - "77": "background-color", - "78": "background-image", - "79": "background-origin", - "80": "background-position-x", - "81": "background-position-y", - "82": "background-repeat", - "83": "background-size", - "84": "block-size", - "85": "border-bottom-color", - "86": "border-bottom-left-radius", - "87": "border-bottom-right-radius", - "88": "border-bottom-style", - "89": "border-bottom-width", - "90": "border-left-color", - "91": "border-left-style", - "92": "border-left-width", - "93": "border-right-color", - "94": "border-right-style", - "95": "border-right-width", - "96": "border-top-color", - "97": "border-top-left-radius", - "98": "border-top-right-radius", - "99": "border-top-style", - "100": "border-top-width", - "101": "bottom", - "102": "box-shadow", - "103": "box-sizing", - "104": "clear", - "105": "clip", - "106": "clip-path", - "107": "column-count", - "108": "column-gap", - "109": "column-span", - "110": "column-width", - "111": "contain", - "112": "content", - "113": "content-visibility", - "114": "counter-increment", - "115": "counter-reset", - "116": "counter-set", - "117": "cx", - "118": "cy", - "119": "display", - "120": "filter", - "121": "flex-basis", - "122": "flex-direction", - "123": "flex-grow", - "124": "flex-shrink", - "125": "flex-wrap", - "126": "float", - "127": "grid-auto-columns", - "128": "grid-auto-flow", - "129": "grid-auto-rows", - "130": "grid-column-end", - "131": "grid-column-start", - "132": "grid-row-end", - "133": "grid-row-start", - "134": "grid-template-areas", - "135": "grid-template-columns", - "136": "grid-template-rows", - "137": "height", - "138": "inline-size", - "139": "inset-block-end", - "140": "inset-block-start", - "141": "inset-inline-end", - "142": "inset-inline-start", - "143": "isolation", - "144": "justify-content", - "145": "justify-items", - "146": "justify-self", - "147": "left", - "148": "margin-block-end", - "149": "margin-block-start", - "150": "margin-bottom", - "151": "margin-inline-end", - "152": "margin-inline-start", - "153": "margin-left", - "154": "margin-right", - "155": "margin-top", - "156": "mask-image", - "157": "mask-type", - "158": "max-block-size", - "159": "max-height", - "160": "max-inline-size", - "161": "max-width", - "162": "min-block-size", - "163": "min-height", - "164": "min-inline-size", - "165": "min-width", - "166": "mix-blend-mode", - "167": "object-fit", - "168": "object-position", - "169": "opacity", - "170": "order", - "171": "outline-color", - "172": "outline-offset", - "173": "outline-style", - "174": "outline-width", - "175": "overflow-x", - "176": "overflow-y", - "177": "padding-block-end", - "178": "padding-block-start", - "179": "padding-bottom", - "180": "padding-inline-end", - "181": "padding-inline-start", - "182": "padding-left", - "183": "padding-right", - "184": "padding-top", - "185": "position", - "186": "r", - "187": "right", - "188": "rotate", - "189": "row-gap", - "190": "rx", - "191": "ry", - "192": "scale", - "193": "scrollbar-gutter", - "194": "scrollbar-width", - "195": "stop-color", - "196": "stop-opacity", - "197": "table-layout", - "198": "text-decoration-color", - "199": "text-decoration-style", - "200": "text-decoration-thickness", - "201": "text-overflow", - "202": "top", - "203": "transform", - "204": "transform-box", - "205": "transform-origin", - "206": "transition-delay", - "207": "transition-duration", - "208": "transition-property", - "209": "transition-timing-function", - "210": "translate", - "211": "unicode-bidi", - "212": "user-select", - "213": "vertical-align", - "214": "view-transition-name", - "215": "width", - "216": "x", - "217": "y", - "218": "z-index" + "5": "caret-color", + "6": "clip-rule", + "7": "color", + "8": "color-scheme", + "9": "cursor", + "10": "direction", + "11": "fill", + "12": "fill-opacity", + "13": "fill-rule", + "14": "font-family", + "15": "font-feature-settings", + "16": "font-language-override", + "17": "font-size", + "18": "font-style", + "19": "font-variant-alternates", + "20": "font-variant-caps", + "21": "font-variant-east-asian", + "22": "font-variant-emoji", + "23": "font-variant-ligatures", + "24": "font-variant-numeric", + "25": "font-variant-position", + "26": "font-variation-settings", + "27": "font-weight", + "28": "font-width", + "29": "image-rendering", + "30": "letter-spacing", + "31": "line-height", + "32": "list-style-image", + "33": "list-style-position", + "34": "list-style-type", + "35": "math-depth", + "36": "math-shift", + "37": "math-style", + "38": "pointer-events", + "39": "quotes", + "40": "stroke", + "41": "stroke-dasharray", + "42": "stroke-dashoffset", + "43": "stroke-linecap", + "44": "stroke-linejoin", + "45": "stroke-miterlimit", + "46": "stroke-opacity", + "47": "stroke-width", + "48": "tab-size", + "49": "text-align", + "50": "text-anchor", + "51": "text-decoration-line", + "52": "text-indent", + "53": "text-justify", + "54": "text-shadow", + "55": "text-transform", + "56": "visibility", + "57": "white-space", + "58": "word-break", + "59": "word-spacing", + "60": "word-wrap", + "61": "writing-mode", + "62": "align-content", + "63": "align-items", + "64": "align-self", + "65": "animation-delay", + "66": "animation-direction", + "67": "animation-duration", + "68": "animation-fill-mode", + "69": "animation-iteration-count", + "70": "animation-name", + "71": "animation-play-state", + "72": "animation-timing-function", + "73": "appearance", + "74": "aspect-ratio", + "75": "backdrop-filter", + "76": "background-attachment", + "77": "background-clip", + "78": "background-color", + "79": "background-image", + "80": "background-origin", + "81": "background-position-x", + "82": "background-position-y", + "83": "background-repeat", + "84": "background-size", + "85": "block-size", + "86": "border-bottom-color", + "87": "border-bottom-left-radius", + "88": "border-bottom-right-radius", + "89": "border-bottom-style", + "90": "border-bottom-width", + "91": "border-left-color", + "92": "border-left-style", + "93": "border-left-width", + "94": "border-right-color", + "95": "border-right-style", + "96": "border-right-width", + "97": "border-top-color", + "98": "border-top-left-radius", + "99": "border-top-right-radius", + "100": "border-top-style", + "101": "border-top-width", + "102": "bottom", + "103": "box-shadow", + "104": "box-sizing", + "105": "clear", + "106": "clip", + "107": "clip-path", + "108": "column-count", + "109": "column-gap", + "110": "column-span", + "111": "column-width", + "112": "contain", + "113": "content", + "114": "content-visibility", + "115": "counter-increment", + "116": "counter-reset", + "117": "counter-set", + "118": "cx", + "119": "cy", + "120": "display", + "121": "filter", + "122": "flex-basis", + "123": "flex-direction", + "124": "flex-grow", + "125": "flex-shrink", + "126": "flex-wrap", + "127": "float", + "128": "grid-auto-columns", + "129": "grid-auto-flow", + "130": "grid-auto-rows", + "131": "grid-column-end", + "132": "grid-column-start", + "133": "grid-row-end", + "134": "grid-row-start", + "135": "grid-template-areas", + "136": "grid-template-columns", + "137": "grid-template-rows", + "138": "height", + "139": "inline-size", + "140": "inset-block-end", + "141": "inset-block-start", + "142": "inset-inline-end", + "143": "inset-inline-start", + "144": "isolation", + "145": "justify-content", + "146": "justify-items", + "147": "justify-self", + "148": "left", + "149": "margin-block-end", + "150": "margin-block-start", + "151": "margin-bottom", + "152": "margin-inline-end", + "153": "margin-inline-start", + "154": "margin-left", + "155": "margin-right", + "156": "margin-top", + "157": "mask-image", + "158": "mask-type", + "159": "max-block-size", + "160": "max-height", + "161": "max-inline-size", + "162": "max-width", + "163": "min-block-size", + "164": "min-height", + "165": "min-inline-size", + "166": "min-width", + "167": "mix-blend-mode", + "168": "object-fit", + "169": "object-position", + "170": "opacity", + "171": "order", + "172": "outline-color", + "173": "outline-offset", + "174": "outline-style", + "175": "outline-width", + "176": "overflow-x", + "177": "overflow-y", + "178": "padding-block-end", + "179": "padding-block-start", + "180": "padding-bottom", + "181": "padding-inline-end", + "182": "padding-inline-start", + "183": "padding-left", + "184": "padding-right", + "185": "padding-top", + "186": "position", + "187": "r", + "188": "right", + "189": "rotate", + "190": "row-gap", + "191": "rx", + "192": "ry", + "193": "scale", + "194": "scrollbar-gutter", + "195": "scrollbar-width", + "196": "stop-color", + "197": "stop-opacity", + "198": "table-layout", + "199": "text-decoration-color", + "200": "text-decoration-style", + "201": "text-decoration-thickness", + "202": "text-overflow", + "203": "top", + "204": "transform", + "205": "transform-box", + "206": "transform-origin", + "207": "transition-delay", + "208": "transition-duration", + "209": "transition-property", + "210": "transition-timing-function", + "211": "translate", + "212": "unicode-bidi", + "213": "user-select", + "214": "vertical-align", + "215": "view-transition-name", + "216": "width", + "217": "x", + "218": "y", + "219": "z-index" } All properties associated with document.body.style by default: {} diff --git a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt index 90a96c09ed2..e826e6fb3a3 100644 --- a/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt +++ b/Tests/LibWeb/Text/expected/css/getComputedStyle-print-all.txt @@ -3,6 +3,7 @@ accent-color: auto border-collapse: separate border-spacing: 0px caption-side: top +caret-color: rgb(0, 0, 0) clip-rule: nonzero color: rgb(0, 0, 0) color-scheme: normal @@ -135,7 +136,7 @@ grid-row-start: auto grid-template-areas: none grid-template-columns: auto grid-template-rows: auto -height: 1918px +height: 1932px inline-size: auto inset-block-end: auto inset-block-start: auto diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-ui/caret-color-013.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-ui/caret-color-013.txt new file mode 100644 index 00000000000..bf4e9863b84 --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-ui/caret-color-013.txt @@ -0,0 +1,16 @@ +Harness status: OK + +Found 11 tests + +11 Pass +Pass Test default caret-color +Pass Test caret-color: initial +Pass Test caret-color: inherit +Pass Test caret-color: auto +Pass Test caret-color: currentcolor +Pass Test caret-color: lime +Pass Reset caret-color: initial +Pass Test caret-color: rgb(0, 100, 100) +Pass Test caret-color: initial (inherited) +Pass Test caret-color: inherit (inherited) +Pass Test caret-color: blue (inherited) \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-ui/parsing/caret-color-invalid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-ui/parsing/caret-color-invalid.txt new file mode 100644 index 00000000000..d0b0073a6bd --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-ui/parsing/caret-color-invalid.txt @@ -0,0 +1,9 @@ +Harness status: OK + +Found 4 tests + +4 Pass +Pass e.style['caret-color'] = "none" should not set the property value +Pass e.style['caret-color'] = "invert" should not set the property value +Pass e.style['caret-color'] = "50%" should not set the property value +Pass e.style['caret-color'] = "red green" should not set the property value \ No newline at end of file diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-ui/parsing/caret-color-valid.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-ui/parsing/caret-color-valid.txt new file mode 100644 index 00000000000..76d4cc7f97e --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-ui/parsing/caret-color-valid.txt @@ -0,0 +1,7 @@ +Harness status: OK + +Found 2 tests + +2 Pass +Pass e.style['caret-color'] = "auto" should set the property value +Pass e.style['caret-color'] = "rgba(10, 20, 30, 0.4)" should set the property value \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-ui/caret-color-013.html b/Tests/LibWeb/Text/input/wpt-import/css/css-ui/caret-color-013.html new file mode 100644 index 00000000000..35d505597df --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-ui/caret-color-013.html @@ -0,0 +1,50 @@ + + +CSS Basic User Interface Test: caret-color dynamic changes + + + + + + + + +
+
+ +
+ + diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-ui/parsing/caret-color-invalid.html b/Tests/LibWeb/Text/input/wpt-import/css/css-ui/parsing/caret-color-invalid.html new file mode 100644 index 00000000000..348c1c8a32c --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-ui/parsing/caret-color-invalid.html @@ -0,0 +1,21 @@ + + + + +CSS UI Level 3: parsing caret-color with invalid values + + + + + + + + + + + diff --git a/Tests/LibWeb/Text/input/wpt-import/css/css-ui/parsing/caret-color-valid.html b/Tests/LibWeb/Text/input/wpt-import/css/css-ui/parsing/caret-color-valid.html new file mode 100644 index 00000000000..844a77785f6 --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/css/css-ui/parsing/caret-color-valid.html @@ -0,0 +1,19 @@ + + + + +CSS UI Level 3: parsing caret-color with valid values + + + + + + + + + + +