mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb/MathML: Parse mathml attributes as <length>s
`HTML::parse_dimension_value()` doesn't parse units except for `%` for percentages; it just ignores them and treats it as a number of pixels. Now that we can parse `<length>` and pals directly, do that instead, which makes non-px units work.
This commit is contained in:
parent
7aef3245ea
commit
1dfdfa37ea
Notes:
github-actions[bot]
2025-11-14 09:56:34 +00:00
Author: https://github.com/AtkinsSJ
Commit: 1dfdfa37ea
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6811
Reviewed-by: https://github.com/lpas
4 changed files with 16 additions and 4 deletions
|
|
@ -101,7 +101,7 @@ void MathMLElement::apply_presentational_hints(GC::Ref<CSS::CascadedProperties>
|
|||
// The mathsize attribute, if present, must have a value that is a valid <length-percentage>.
|
||||
// In that case, the user agent is expected to treat the attribute as a presentational hint setting the
|
||||
// element's font-size property to the corresponding value.
|
||||
if (auto parsed_value = HTML::parse_dimension_value(value))
|
||||
if (auto parsed_value = parse_css_type(CSS::Parser::ParsingParams { document() }, value, CSS::ValueType::LengthPercentage))
|
||||
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::FontSize, parsed_value.release_nonnull());
|
||||
} else if (name == AttributeNames::displaystyle) {
|
||||
// https://w3c.github.io/mathml-core/#dfn-displaystyle
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue