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

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

Issue 2115673003: Add support for custom properties and @apply when iterating InlineStylePropertyMap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a test, add a todo Created 4 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_iteration.html
diff --git a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_iteration.html b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_iteration.html
index e38592d3dd7eab459135eba24506306dfb448116..be11c935eec826ee603e5e879fab943c0a805c32 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_iteration.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/inlineStylePropertyMap_iteration.html
@@ -90,4 +90,40 @@ test(function() {
assert_equals(entries['border-image-repeat'].cssText, 'initial');
}, "Iterating entries over border element expansion");
+test(function() {
+ testElement.style = "background-color: var(--bg-color);";
+ var entries = [...testElement.styleMap.values()];
+
+ assert_equals(entries.length, 1);
+ assert_equals(entries[0].constructor, CSSStyleValue);
+ assert_equals(entries[0].cssText, 'var(--bg-color)');
+}, "Variable values come out as CSSStyleValues");
+
+test(function() {
+ testElement.style = '';
+ testElement.style.setProperty('--my-custom-property', '5px');
+
+ var entries = [...testElement.styleMap.entries()];
+ assert_equals(entries.length, 1);
+ var propertyAndValue = entries[0];
+ assert_equals(propertyAndValue.length, 2);
+
+ assert_equals(propertyAndValue[0], '--my-custom-property');
+ assert_equals(propertyAndValue[1].constructor, CSSStyleValue);
+ assert_equals(propertyAndValue[1].cssText, '5px');
+}, "Custom properties set on the element come out as CSSStyleValues");
+
+test(function() {
+ testElement.style.cssText = "@apply --foo";
+
+ var entries = [...testElement.styleMap.entries()];
+ assert_equals(entries.length, 1);
+ var propertyAndValue = entries[0];
+ assert_equals(propertyAndValue.length, 2);
+
+ assert_equals(propertyAndValue[0], '@apply');
+ assert_equals(propertyAndValue[1].constructor, CSSStyleValue);
+ assert_equals(propertyAndValue[1].cssText, '--foo');
+}, "@apply rules come out as CSSStyleValues");
+
</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698