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

Unified Diff: third_party/WebKit/LayoutTests/typedcssom/inlinestyle/unsupported-properties.html

Issue 2038773002: [Typed OM] Add an "UnsupportedStyleValue" in C++ that just has a string for unknown types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@stylevaue
Patch Set: Address comments about comments 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/unsupported-properties.html
diff --git a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/unsupported-properties.html b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/unsupported-properties.html
new file mode 100644
index 0000000000000000000000000000000000000000..4c4c2562f3bdc8a6e62a3d5bc76026860b106f10
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/unsupported-properties.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+
+<div id="testElement"></div>
+<div id="secondElement"></div>
+
+<script>
+
+// This set of tests looks at properties that are not yet supported
+// by the typed OM. It will probably need to be updated as we start
+// supporting some of these properties.
+
+test(function() {
+ testElement.style.backgroundImage = 'url("")';
+
+ var result = testElement.styleMap.get('background-image');
+ assert_equals(result.constructor, CSSStyleValue);
+ assert_equals(result.cssString, 'url("")');
+}, 'Unsupported property returns a base StyleValue with the correct cssString.');
+
+test(function() {
+ testElement.style.backgroundImage = 'url("")';
+
+ secondElement.styleMap.set('background-image', testElement.styleMap.get('background-image'));
+
+ var result = secondElement.styleMap.get('background-image');
+ assert_equals(result.constructor, CSSStyleValue);
+ assert_equals(result.cssString, 'url("")');
+}, 'Setting the same property using the result of getting an unknown value works');
+
+test(function() {
+ testElement.style.color = 'green';
+
+ secondElement.styleMap.set('border-left-color', testElement.styleMap.get('color'));
+
+ var result = secondElement.styleMap.get('border-left-color');
+ assert_equals(result.constructor, CSSStyleValue);
+ assert_equals(result.cssString, 'green');
+}, 'Setting a different property using the result of getting an unknown value works');
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698