mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-21 17:51:52 +00:00
LibWeb: Don't crash when resolving grid properties of inline elements
Previously, attempting to get the computed value for a grid-template-rows or grid-template-columns property would cause a crash for inline elements.
This commit is contained in:
parent
f65df3f59f
commit
087fcb84cb
Notes:
github-actions[bot]
2024-09-20 06:17:26 +00:00
Author: https://github.com/tcl3
Commit: 087fcb84cb
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1454
4 changed files with 23 additions and 17 deletions
|
@ -523,14 +523,14 @@ RefPtr<CSSStyleValue const> ResolvedCSSStyleDeclaration::style_value_for_propert
|
|||
// For grid-template-columns and grid-template-rows the resolved value is the used value.
|
||||
// https://www.w3.org/TR/css-grid-2/#resolved-track-list-standalone
|
||||
if (property_id == PropertyID::GridTemplateColumns) {
|
||||
if (layout_node.paintable()) {
|
||||
if (layout_node.paintable() && layout_node.paintable()->is_paintable_box()) {
|
||||
auto const& paintable_box = verify_cast<Painting::PaintableBox const>(*layout_node.paintable());
|
||||
if (auto used_values_for_grid_template_columns = paintable_box.used_values_for_grid_template_columns()) {
|
||||
return used_values_for_grid_template_columns;
|
||||
}
|
||||
}
|
||||
} else if (property_id == PropertyID::GridTemplateRows) {
|
||||
if (layout_node.paintable()) {
|
||||
if (layout_node.paintable() && layout_node.paintable()->is_paintable_box()) {
|
||||
auto const& paintable_box = verify_cast<Painting::PaintableBox const>(*layout_node.paintable());
|
||||
if (auto used_values_for_grid_template_rows = paintable_box.used_values_for_grid_template_rows()) {
|
||||
return used_values_for_grid_template_rows;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue