mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb/MathML: Parse mathcolor and mathbackground as <color>
The difference is that parsing as the `color` property's value also allows the CSS-wide keywords, which we don't want here. The added test cases make sure that those keywords are *not* valid: - `color` should inherit its parent value of `orange` - `background-color` doesn't inherit, so should be its initial value of `transparent`
This commit is contained in:
parent
2512a934d6
commit
e561749164
Notes:
github-actions[bot]
2025-11-14 09:56:21 +00:00
Author: https://github.com/AtkinsSJ
Commit: e561749164
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6811
Reviewed-by: https://github.com/lpas
3 changed files with 8 additions and 4 deletions
|
|
@ -91,10 +91,10 @@ void MathMLElement::apply_presentational_hints(GC::Ref<CSS::CascadedProperties>
|
|||
// The mathcolor and mathbackground attributes, if present, must have a value that is a <color>. In that case,
|
||||
// the user agent is expected to treat these attributes as a presentational hint setting the element's color
|
||||
// and background-color properties to the corresponding values.
|
||||
if (auto parsed_value = parse_css_value(CSS::Parser::ParsingParams { document() }, value, CSS::PropertyID::Color))
|
||||
if (auto parsed_value = parse_css_type(CSS::Parser::ParsingParams { document() }, value, CSS::ValueType::Color))
|
||||
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::Color, parsed_value.release_nonnull());
|
||||
} else if (name == AttributeNames::mathbackground) {
|
||||
if (auto parsed_value = parse_css_value(CSS::Parser::ParsingParams { document() }, value, CSS::PropertyID::BackgroundColor))
|
||||
if (auto parsed_value = parse_css_type(CSS::Parser::ParsingParams { document() }, value, CSS::ValueType::Color))
|
||||
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BackgroundColor, parsed_value.release_nonnull());
|
||||
} else if (name == AttributeNames::mathsize) {
|
||||
// https://w3c.github.io/mathml-core/#dfn-mathsize
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue