Index: sky/tests/styles/inline-style-crash.sky |
diff --git a/sky/tests/styles/inline-style-crash.sky b/sky/tests/styles/inline-style-crash.sky |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9a017c79b95286bedfa2845dc7beb851e72fe8a6 |
--- /dev/null |
+++ b/sky/tests/styles/inline-style-crash.sky |
@@ -0,0 +1,28 @@ |
+<html> |
+<foo /> |
+<script> |
+import "../resources/third_party/unittest/unittest.dart"; |
+import "../resources/unit.dart"; |
+ |
+import "dart:sky"; |
+ |
+void main() { |
+ initUnit(); |
+ |
+ test('should not crash when setting style to null', () { |
+ var foo = document.querySelector('foo'); |
+ expect(foo.style['color'], isNull); |
+ foo.style["color"] = null; // This used to crash. |
+ expect(foo.style['color'], isNull); |
+ foo.style["color"] = "blue"; |
+ expect(foo.style['color'], equals("rgb(0, 0, 255)")); |
+ foo.style["color"] = null; |
+ expect(foo.style['color'], isNull); |
+ foo.style["color"] = "blue"; |
+ expect(foo.style['color'], equals("rgb(0, 0, 255)")); |
+ foo.style.removeProperty("color"); |
+ expect(foo.style['color'], isNull); |
+ }); |
+} |
+</script> |
+</html> |