Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: third_party/WebKit/LayoutTests/typedcssom/inlineStylePropertyMap_delete.html

Issue 1590193002: Partial implementation of inline StylePropertyMap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@maps
Patch Set: Remove missed WillBe type in Element.h and Element.cpp Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/typedcssom/inlineStylePropertyMap_delete.html
diff --git a/third_party/WebKit/LayoutTests/typedcssom/inlineStylePropertyMap_delete.html b/third_party/WebKit/LayoutTests/typedcssom/inlineStylePropertyMap_delete.html
new file mode 100644
index 0000000000000000000000000000000000000000..b5a8889e10b0edcf70d2a10be962705188f1e06c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/typedcssom/inlineStylePropertyMap_delete.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+
+<div id="testElement"></div>
+
+<script>
+
+// Delete
+test(function() {
+ testElement.style.width = '80px';
+ assert_equals('80px', testElement.styleMap.get('width').cssString);
+
+ testElement.styleMap.delete('width');
+ assert_equals(null, testElement.styleMap.get('width'));
+ assert_equals('', testElement.style.width);
+}, "delete() removes the value from the property");
+
+test(function() {
+ assert_equals(null, testElement.styleMap.get('height'));
+ testElement.styleMap.delete('height');
+ assert_equals(null, testElement.styleMap.get('height'));
+}, "delete() does nothing if the property isn't set");
+
+test(function() {
+ assert_throws(new TypeError(), function() {
+ testElement.styleMap.delete('lemons');
+ });
+}, "Attempting to delete an invalid property throws");
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698