diff --git a/Base/res/html/misc/background-position-xy.html b/Base/res/html/misc/background-position-xy.html
index 7bc880e16e9..a89fcca4f57 100644
--- a/Base/res/html/misc/background-position-xy.html
+++ b/Base/res/html/misc/background-position-xy.html
@@ -15,6 +15,7 @@
+
background-position-y
@@ -23,3 +24,4 @@
+
diff --git a/Tests/LibWeb/Text/expected/background-position-xy.txt b/Tests/LibWeb/Text/expected/background-position-xy.txt
new file mode 100644
index 00000000000..65c214a2496
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/background-position-xy.txt
@@ -0,0 +1,2 @@
+ right 0px
+bottom 0px
diff --git a/Tests/LibWeb/Text/input/background-position-xy.html b/Tests/LibWeb/Text/input/background-position-xy.html
new file mode 100644
index 00000000000..14ba2b52396
--- /dev/null
+++ b/Tests/LibWeb/Text/input/background-position-xy.html
@@ -0,0 +1,21 @@
+
+
+
+
diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp
index 2aa09f40ef9..a974ddc543d 100644
--- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp
+++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp
@@ -4783,7 +4783,9 @@ ErrorOr> Parser::parse_single_background_position_x_or_y_valu
return EdgeStyleValue::create(relative_edge, *offset);
}
- return nullptr;
+ // If no offset is provided create this element but with an offset of default value of zero
+ transaction.commit();
+ return EdgeStyleValue::create(relative_edge, Length::make_px(0));
}
ErrorOr> Parser::parse_single_background_repeat_value(TokenStream& tokens)