[css-typed-om] Disallow CSS-wide keywords for StylePropertyMap.set

We don't support this properly, and the spec does not handle CSS-keywords
either. Disallow it until we can add proper support for this.

Fixed: 1292905
Bug: 1310761
Change-Id: Ieb3d20edfea72c2ccb0928536fdfd86d10aad1a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3551609
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/main@{#986411}
diff --git a/css/css-typed-om/set-css-wide-in-custom-property-crash.html b/css/css-typed-om/set-css-wide-in-custom-property-crash.html
new file mode 100644
index 0000000..bc977c9
--- /dev/null
+++ b/css/css-typed-om/set-css-wide-in-custom-property-crash.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<title>Don't crash when setting a CSS-wide keyword on a custom property</title>
+<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-set">
+<link rel="help" href="https://crbug.com/1310761<">
+<div id="target">
+  Don't crash
+</div>
+<script>
+  for (let keyword of ['initial', 'inherit', 'unset', 'revert', 'revert-layer']) {
+    try {
+      target.attributeStyleMap.set('--x', new CSSKeywordValue(keyword));
+    } catch (e) {
+    }
+  }
+</script>