diff --git a/Tests/LibWeb/Text/expected/css/getComputedStyle-no-paintable.txt b/Tests/LibWeb/Text/expected/css/getComputedStyle-no-paintable-box.txt
similarity index 100%
rename from Tests/LibWeb/Text/expected/css/getComputedStyle-no-paintable.txt
rename to Tests/LibWeb/Text/expected/css/getComputedStyle-no-paintable-box.txt
diff --git a/Tests/LibWeb/Text/input/css/getComputedStyle-no-paintable-box.html b/Tests/LibWeb/Text/input/css/getComputedStyle-no-paintable-box.html
new file mode 100644
index 00000000000..a29761227c4
--- /dev/null
+++ b/Tests/LibWeb/Text/input/css/getComputedStyle-no-paintable-box.html
@@ -0,0 +1,21 @@
+
+
+
diff --git a/Tests/LibWeb/Text/input/css/getComputedStyle-no-paintable.html b/Tests/LibWeb/Text/input/css/getComputedStyle-no-paintable.html
deleted file mode 100644
index 59895287277..00000000000
--- a/Tests/LibWeb/Text/input/css/getComputedStyle-no-paintable.html
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
diff --git a/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp b/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp
index 87bc7ff1565..b7af79c58a6 100644
--- a/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp
+++ b/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp
@@ -523,14 +523,14 @@ RefPtr 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(*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(*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;