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

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

Issue 2121913002: [Typed OM] Add CSSValue -> CSSNumberValue conversion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync Created 4 years, 1 month 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/opacity.html
diff --git a/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/opacity.html b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/opacity.html
new file mode 100644
index 0000000000000000000000000000000000000000..5cb899741a0e001faf4745c746850cbb124d894e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/typedcssom/inlinestyle/opacity.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+
+<div id="testElement">text</div>
+
+<script>
+
+test(function() {
+ testElement.styleMap.set('opacity', new CSSNumberValue(3.5));
+ assert_equals(testElement.styleMap.get('opacity').value, 3.5);
+ assert_equals(getComputedStyleMap(testElement).get('opacity').value, 1);
+
+ testElement.styleMap.set('opacity', new CSSNumberValue(-5.2));
+ assert_equals(testElement.styleMap.get('opacity').value, -5.2);
+ assert_equals(getComputedStyleMap(testElement).get('opacity').value, 0);
+}, "Opacity is clamped when coming through Computed Style");
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698