Chromium Code Reviews| 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..19289bb018d220ce3672a8e0bd0c9fb7ac19ca28 |
| --- /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 SimpleLength); |
| + 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 SimpleLength); |
| + assert_equals(entry.value[1].cssString, '30px'); |
| + |
| + assert_true(iterator.next().done); |
| +}, 'Adding a property while iterating over entries() doesn\'t affect iterator'); |
|
Timothy Loh
2016/05/13 04:57:45
use a double-quoted string here and elsewhere to a
meade_UTC10
2016/05/13 05:46:34
Done.
|
| + |
| +test(function() { |
| + testElement.style = "width: 60px; border-left-width: 30px;"; |
| + |
| + var iterator = testElement.styleMap.values(); |
| + var entry = iterator.next(); |
| + assert_true(entry.value instanceof SimpleLength); |
| + 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 SimpleLength); |
| + 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> |