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

Unified Diff: third_party/WebKit/LayoutTests/typedcssom/cssSimpleLength.html

Issue 2377243002: Add support for CSSValue->CSSSimpleLength when it is a percentage. (Closed)
Patch Set: Update test expectations Created 4 years, 3 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/LayoutTests/typedcssom/inlinestyle/left-top-right-bottom-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/typedcssom/cssSimpleLength.html
diff --git a/third_party/WebKit/LayoutTests/typedcssom/cssSimpleLength.html b/third_party/WebKit/LayoutTests/typedcssom/cssSimpleLength.html
index 7298c469847b3bec4737369f5c894ed42c2c9858..72fd90b1085902e4d92274c48bb44b8f388806c0 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/cssSimpleLength.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/cssSimpleLength.html
@@ -5,6 +5,26 @@
<script>
test(function() {
+ var simpleLength = new CSSSimpleLength(1, 'px');
+ assert_equals(simpleLength.value, 1);
+ assert_equals(simpleLength.type, 'px');
+
+ simpleLength.value = 2;
+ simpleLength.type = 'em';
+
+ assert_equals(simpleLength.value, 1);
+ assert_equals(simpleLength.type, 'px');
+}, 'CSSSimpleLengths are immutable');
+
+test(function() {
+ var units = ['px', 'percent', 'em', 'ex', 'ch', 'rem', 'vw', 'vh', 'vmin', 'vmax', 'cm', 'mm', 'in', 'pc', 'pt'];
+ for (var i = 0; i < units.length; ++i) {
+ var simpleLength = new CSSSimpleLength(i, units[i]);
+ assert_equals(simpleLength.type, units[i]);
+ }
+}, 'Each unit type is returned according to the spec');
+
+test(function() {
var simpleLength1 = new CSSSimpleLength(5.1, 'px');
var simpleLength2 = new CSSSimpleLength(10, 'px');
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/typedcssom/inlinestyle/left-top-right-bottom-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698