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

Side by Side Diff: LayoutTests/fast/css/parsing-object-position.html

Issue 22839023: Add support for the object-position CSS property. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase master Created 7 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../js/resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <script>
8 description("This tests checks that all of the input values for obje ct-position parse correctly.");
9
10 function test(value)
11 {
12 var div = document.createElement("div");
13 div.setAttribute("style", value);
14 document.body.appendChild(div);
15
16 var result = div.style.getPropertyValue("object-position");
17 document.body.removeChild(div);
18 return result;
19 }
20
21 function testComputedStyle(value)
22 {
23 var div = document.createElement("div");
24 div.setAttribute("style", value);
25 document.body.appendChild(div);
26
27 var result = window.getComputedStyle(div).objectPosition;
28 document.body.removeChild(div);
29 return result;
30 }
31
32 shouldBeEqualToString('testComputedStyle(";")', '50% 50%');
33 shouldBeEqualToString('testComputedStyle("object-position: 10px;")', '10px 50%');
34 shouldBeEqualToString('testComputedStyle("object-position: 10px 10px ;")', '10px 10px');
35 shouldBeEqualToString('testComputedStyle("object-position: right top ;")', '100% 0%');
36 shouldBeEqualToString('testComputedStyle("object-position: top right ;")', '100% 0%');
37
38 shouldBeEqualToString('test("object-position: inherit;")', 'inherit' );
39 shouldBeEqualToString('test("object-position: initial;")', 'initial' );
40 shouldBeEqualToString('test("object-position: left;")', '0% 50%');
41 shouldBeEqualToString('test("object-position: top;")', '50% 0%');
42 shouldBeEqualToString('test("object-position: top right;")', '100% 0 %');
43 shouldBeEqualToString('test("object-position: right top;")', '100% 0 %');
44 shouldBeEqualToString('test("object-position: center center;")', '50 % 50%');
45 shouldBeEqualToString('test("object-position: center;")', '50% 50%') ;
46 shouldBeEqualToString('test("object-position: bottom center;")', '50 % 100%');
47 shouldBeEqualToString('test("object-position: left center;")', '0% 5 0%');
48 shouldBeEqualToString('test("object-position: bottom center;")', '50 % 100%');
49 shouldBeEqualToString('test("object-position: center left;")', '0% 5 0%');
50 shouldBeEqualToString('test("object-position: center bottom;")', '50 % 100%');
51 shouldBeEqualToString('test("object-position: 100px;")', '100px 50%' );
52 shouldBeEqualToString('test("object-position: 100px 100px;")', '100p x 100px');
53 shouldBeEqualToString('test("object-position: 100px 200px;")', '100p x 200px');
54 shouldBeEqualToString('test("object-position: -50% 0;")', '-50% 0px' );
55 shouldBeEqualToString('test("object-position: 3em 0;")', '3em 0px');
56 shouldBeEqualToString('test("object-position: left 33px;")', '0% 33p x');
57 shouldBeEqualToString('test("object-position: center 33px;")', '50% 33px');
58 shouldBeEqualToString('test("object-position: 33px center;")', '33px 50%');
59 shouldBeEqualToString('test("object-position: 33px bottom;")', '33px 100%');
60 shouldBeEqualToString('test("object-position: 1vh 1vw;")', '1vh 1vw' );
61
62 shouldBeNull('test("object-position: 100px 100px 100px;")');
63 shouldBeNull('test("object-position: 100px 100px 200px 200px;")');
64 shouldBeNull('test("object-position: top left center;")');
65 shouldBeNull('test("object-position: top top;")');
66 shouldBeNull('test("object-position: top bottom;")');
67 shouldBeNull('test("object-position: 33px left;")');
68 shouldBeNull('test("object-position: top 33px;")');
69 shouldBeNull('test("object-position: inherit inherit;")');
70 shouldBeNull('test("object-position: initial initial;")');
71 shouldBeNull('test("object-position: -webkit-fill-available;")');
72 shouldBeNull('test("object-position: min-content;")');
73 shouldBeNull('test("object-position: intrinsic;")');
74 shouldBeNull('test("object-position: auto;")');
75 shouldBeNull('test("object-position: none;")');
76 shouldBeNull('test("object-position: fill;")');
77 </script>
78 <script src="../js/resources/js-test-post.js"></script>
79 </body>
80 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698