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

Unified Diff: third_party/WebKit/LayoutTests/typedcssom/computedstyle/left.html

Issue 2403423002: [CSSTypedOM] Computed StylePropertyMap use ComputedStyle for Lengths (Closed)
Patch Set: Use StyleValueFactory & ComputedStyleCSSValueMapping for unsupported Created 3 years, 11 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/computedstyle/left.html
diff --git a/third_party/WebKit/LayoutTests/typedcssom/computedstyle/left.html b/third_party/WebKit/LayoutTests/typedcssom/computedstyle/left.html
new file mode 100644
index 0000000000000000000000000000000000000000..e697a1636c886c8a1612abf4ea53c0fb8d44ac4a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/typedcssom/computedstyle/left.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src='../../resources/testharness.js'></script>
+<script src='../../resources/testharnessreport.js'></script>
+</head>
+<body>
+<div id='testElement'></div>
+
+<script>
+
+testElement.style.left = '10px';
+
+var t1 = async_test("Getting a 10px left results in a CSSSimpleLength");
+function t1Callback(computedStyleMap) {
+ t1.step(function() {
+ var result = computedStyleMap.get('left');
+ assert_true(result instanceof CSSSimpleLength);
+ assert_equals(result.cssText, '10px');
+ });
+ t1.done();
+}
+
+var t2 = async_test("getAll for left returns a single value");
+function t2Callback(computedStyleMap) {
+ t2.step(function() {
+ testElement.style.left = '20px';
+ var result = computedStyleMap.getAll('left');
+ assert_equals(result.length, 1);
+ assert_equals(result[0].cssText, '20px');
+ });
+ t2.done();
+}
+
+document.onreadystatechange = function() {
+ if (document.readyState == 'complete') {
+ var computedStyleMap = getComputedStyleMap(testElement);
+ t1Callback(computedStyleMap);
+ t2Callback(computedStyleMap);
+ }
+};
+
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698