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

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

Issue 1874623002: Implement iterable<DOMString, (StyleValue or sequence<StyleValue>)> for InlineStylePropertyMap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@computed-stylepropertymap-2
Patch Set: Update LayoutTests Created 4 years, 6 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_iterationWithModification.html
diff --git a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_iterationWithModification.html b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_iterationWithModification.html
new file mode 100644
index 0000000000000000000000000000000000000000..d9c1e167deadeb449545d8167b441059c5841bea
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_iterationWithModification.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+
+<div id="testElement"></div>
+
+<script>
+
+test(function() {
+ testElement.style = "width: 60px; border-left-width: 30px;";
+
+ var iterator = testElement.styleMap.entries();
+ var entry = iterator.next();
+ assert_equals(entry.value[0], 'width');
+ assert_true(entry.value[1] instanceof CSSSimpleLength);
+ assert_equals(entry.value[1].cssString, '60px');
+
+ // This shouldn't appear in the iterator.
+ testElement.style.borderTopWidth = '10px';
+
+ entry = iterator.next();
+ assert_equals(entry.value[0], 'border-left-width');
+ assert_true(entry.value[1] instanceof CSSSimpleLength);
+ assert_equals(entry.value[1].cssString, '30px');
+
+ assert_true(iterator.next().done);
+}, "Adding a property while iterating over entries() doesn't affect iterator");
+
+test(function() {
+ testElement.style = "width: 60px; border-left-width: 30px;";
+
+ var iterator = testElement.styleMap.values();
+ var entry = iterator.next();
+ assert_true(entry.value instanceof CSSSimpleLength);
+ assert_equals(entry.value.cssString, '60px');
+
+ // This shouldn't appear in the iterator.
+ testElement.style.borderTopWidth = '10px';
+
+ entry = iterator.next();
+ assert_true(entry.value instanceof CSSSimpleLength);
+ assert_equals(entry.value.cssString, '30px');
+
+ assert_true(iterator.next().done);
+}, "Adding a property while iterating over values() doesn't affect current iterator");
+
+test(function() {
+ testElement.style = "width: 60px; border-left-width: 30px;";
+
+ var iterator = testElement.styleMap.keys();
+ var entry = iterator.next();
+ assert_equals(entry.value, 'width');
+
+ // This shouldn't appear in the iterator.
+ testElement.style.borderTopWidth = '10px';
+
+ entry = iterator.next();
+ assert_equals(entry.value, 'border-left-width');
+
+ assert_true(iterator.next().done);
+}, "Adding a property while iterating over keys() doesn't affect iterator");
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698