diff --git a/src/Css/Style.php b/src/Css/Style.php
index <HASH>..<HASH> 100644
--- a/src/Css/Style.php
+++ b/src/Css/Style.php
@@ -2224,7 +2224,8 @@ class Style
      */
     protected function _compute_background_repeat($val)
     {
-        return $val;
+        $keywords = ["repeat", "repeat-x", "repeat-y", "no-repeat"];
+        return in_array($val, $keywords, true) ? $val : null;
     }
 
     /**
@@ -2234,7 +2235,8 @@ class Style
      */
     protected function _compute_background_attachment($val)
     {
-        return $val;
+        $keywords = ["scroll", "fixed"];
+        return in_array($val, $keywords, true) ? $val : null;
     }
 
     /**
Drop invalid `background-repeat` and `background-attachment`