Change setProperty to take in nullable |value|

IDL allows |value| to be nullable.

Change-Id: I1db4a7929f0a83c4772e1a11384afb70ead53501
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136722
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
diff --git a/sdk_nnbd/lib/html/dart2js/html_dart2js.dart b/sdk_nnbd/lib/html/dart2js/html_dart2js.dart
index 535ad28..fe02954 100644
--- a/sdk_nnbd/lib/html/dart2js/html_dart2js.dart
+++ b/sdk_nnbd/lib/html/dart2js/html_dart2js.dart
@@ -4096,7 +4096,7 @@
     return JS('bool', '# in #', propertyName, this);
   }
 
-  void setProperty(String propertyName, String value, [String? priority]) {
+  void setProperty(String propertyName, String? value, [String? priority]) {
     return _setPropertyHelper(
         _browserPropertyName(propertyName), value, priority);
   }
@@ -5275,7 +5275,7 @@
       _elementCssStyleDeclarationSetIterable!.first
           .getPropertyValue(propertyName);
 
-  void setProperty(String propertyName, String value, [String? priority]) {
+  void setProperty(String propertyName, String? value, [String? priority]) {
     _elementCssStyleDeclarationSetIterable!
         .forEach((e) => e.setProperty(propertyName, value, priority));
   }
@@ -5746,7 +5746,7 @@
 
 abstract class CssStyleDeclarationBase {
   String getPropertyValue(String propertyName);
-  void setProperty(String propertyName, String value, [String? priority]);
+  void setProperty(String propertyName, String? value, [String? priority]);
 
   /** Gets the value of "align-content" */
   String get alignContent => getPropertyValue('align-content');
diff --git a/tools/dom/scripts/css_code_generator.py b/tools/dom/scripts/css_code_generator.py
index 8910ed1..9459b582 100644
--- a/tools/dom/scripts/css_code_generator.py
+++ b/tools/dom/scripts/css_code_generator.py
@@ -150,7 +150,7 @@
   }
 
 
-  void setProperty(String propertyName, String value,
+  void setProperty(String propertyName, String$NULLABLE value,
       [String$NULLABLE priority]) {
     return _setPropertyHelper(_browserPropertyName(propertyName),
       value, priority);
@@ -240,7 +240,7 @@
       _elementCssStyleDeclarationSetIterable$NULLASSERT.first.getPropertyValue(
           propertyName);
 
-  void setProperty(String propertyName, String value,
+  void setProperty(String propertyName, String$NULLABLE value,
       [String$NULLABLE priority]) {
     _elementCssStyleDeclarationSetIterable$NULLASSERT.forEach((e) =>
         e.setProperty(propertyName, value, priority));
@@ -277,7 +277,7 @@
 
 abstract class CssStyleDeclarationBase {
   String getPropertyValue(String propertyName);
-  void setProperty(String propertyName, String value,
+  void setProperty(String propertyName, String$NULLABLE value,
       [String$NULLABLE priority]);
 """)
 
diff --git a/tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate b/tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate
index 5359faa..292bafd 100644
--- a/tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate
+++ b/tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate
@@ -52,7 +52,7 @@
   }
 
 
-  void setProperty(String propertyName, String value,
+  void setProperty(String propertyName, String$NULLABLE value,
       [String$NULLABLE priority]) {
     return _setPropertyHelper(_browserPropertyName(propertyName),
       value, priority);
@@ -1114,7 +1114,7 @@
       _elementCssStyleDeclarationSetIterable$NULLASSERT.first.getPropertyValue(
           propertyName);
 
-  void setProperty(String propertyName, String value,
+  void setProperty(String propertyName, String$NULLABLE value,
       [String$NULLABLE priority]) {
     _elementCssStyleDeclarationSetIterable$NULLASSERT.forEach((e) =>
         e.setProperty(propertyName, value, priority));
@@ -1588,7 +1588,7 @@
 
 abstract class CssStyleDeclarationBase {
   String getPropertyValue(String propertyName);
-  void setProperty(String propertyName, String value,
+  void setProperty(String propertyName, String$NULLABLE value,
       [String$NULLABLE priority]);
 
   /** Gets the value of "align-content" */