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

Unified Diff: third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_getAll.html

Issue 1590193002: Partial implementation of inline StylePropertyMap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@maps
Patch Set: 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/inlinestyle/inlineStylePropertyMap_getAll.html
diff --git a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_getAll.html b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_getAll.html
new file mode 100644
index 0000000000000000000000000000000000000000..e1098ee2741f8c5afb4e931b12cf61a1b0404a70
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_getAll.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+
+<div id="testElement"></div>
+
+<script>
+
+test(function() {
+ // TODO(meade): Make this a test case for a property with multiple values when that is supported.
+ testElement.styleMap.set('width', new SimpleLength(90, 'px'));
+ var result = testElement.styleMap.getAll('width');
+ assert_equals(result.length, 1);
+ assert_equals(result[0].cssString, '90px');
+}, "getAll() returns a list of values");
+
+test(function() {
+ testElement.styleMap.set('width', new SimpleLength(100, 'px'));
+ var lowerResult = testElement.styleMap.getAll('width');
+ var upperResult = testElement.styleMap.getAll('WIDTH');
+ var mixedResult = testElement.styleMap.getAll('wIdTh');
+
+ assert_equals(lowerResult.length, 1);
+ assert_equals(upperResult.length, 1);
+ assert_equals(mixedResult.length, 1);
+ assert_equals(lowerResult[0].cssString, '100px');
+ assert_equals(upperResult[0].cssString, '100px');
+ assert_equals(mixedResult[0].cssString, '100px');
+}, "getAll is case-insensitive for the property name");
+
+test(function() {
+ assert_array_equals(testElement.styleMap.getAll('height'), []);
+}, "getAll() returns an empty list if the property isn't set");
+
+test(function() {
+ assert_throws(new TypeError(), function() {
+ testElement.styleMap.getAll('lemons');
+ });
+}, "getAll() throws if you try to get an invalid property");
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698