mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb/MathML: Combine mspace height and depth when both are valid
This commit is contained in:
parent
1dfdfa37ea
commit
2512a934d6
Notes:
github-actions[bot]
2025-11-14 09:56:28 +00:00
Author: https://github.com/AtkinsSJ
Commit: 2512a934d6
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6811
Reviewed-by: https://github.com/lpas
3 changed files with 10 additions and 1 deletions
|
|
@ -60,7 +60,8 @@ void MathMLMspaceElement::apply_presentational_hints(GC::Ref<CSS::CascadedProper
|
|||
auto depth_value = parse_non_percentage_value(AttributeNames::depth);
|
||||
|
||||
if (height_value && depth_value) {
|
||||
// FIXME: set the presentational hint to calculate height + depth
|
||||
auto height_string = MUST(String::formatted("calc({} + {})", attribute(AttributeNames::height).value(), attribute(AttributeNames::depth).value()));
|
||||
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::Height, parse_css_type(parsing_params, height_string, CSS::ValueType::Length).release_nonnull());
|
||||
} else if (height_value) {
|
||||
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::Height, height_value.release_nonnull());
|
||||
} else if (depth_value) {
|
||||
|
|
|
|||
|
|
@ -28,3 +28,7 @@ height: 32px
|
|||
height: 30px
|
||||
height: auto
|
||||
height: 48px
|
||||
height: 20px
|
||||
height: 30px
|
||||
height: 50px
|
||||
height: 56px
|
||||
|
|
|
|||
|
|
@ -49,6 +49,10 @@
|
|||
<mspace depth="30px"></mspace>
|
||||
<mspace depth="20%"></mspace>
|
||||
<mspace depth="3em"></mspace>
|
||||
<mspace depth="1%" height="20px"></mspace>
|
||||
<mspace depth="30px" height="1%"></mspace>
|
||||
<mspace depth="30px" height="20px"></mspace>
|
||||
<mspace depth="1.5em" height="2em"></mspace>
|
||||
</math>
|
||||
</body>
|
||||
<script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue