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

Unified Diff: third_party/WebKit/LayoutTests/css3/motion-path/offset-position.html

Issue 2247773004: [WIP] CSS Motion Path: offset-anchor and offset-position Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: offsetAnchor Created 4 years, 4 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/css3/motion-path/offset-position.html
diff --git a/third_party/WebKit/LayoutTests/css3/motion-path/offset-position.html b/third_party/WebKit/LayoutTests/css3/motion-path/offset-position.html
new file mode 100644
index 0000000000000000000000000000000000000000..0ff201db657b1e77968f4649816d375284a6c323
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/css3/motion-path/offset-position.html
@@ -0,0 +1,97 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<style>
+#div2 {
+ offset-position: auto;
+}
+#div3 {
+ offset-position: 10px 20px;
+}
+#div4 {
+ offset-position: 30px top;
+}
+#div5 {
+ offset-position: left 40px;
+}
+#div6 {
+ offset-position: center;
+}
+#div7 {
+ offset-position: 5em 6em;
+ font: 10px Ahem;
+}
+#div8 {
+ offset-position: 30% 40%;
+}
+#div9 {
+ offset-position: inherit;
+}
+</style>
+</head>
+<body>
+<div id="div1"></div>
+<div id="div2"></div>
+<div id="div3"></div>
+<div id="div4"></div>
+<div id="div5"></div>
+<div id="div6"></div>
+<div id="div7"></div>
+<div id="div8">
+ <div id="div9"></div>
+ <div id="div10"></div>
+</div>
+<span id="span1" style="offset-position: right bottom"></span>
+
+<script>
+"use strict";
+
+test(function() {
+ assert_equals(getComputedStyle(div1, null).offsetPosition, 'auto');
+}, 'offset-position default is auto');
+
+test(function() {
+ assert_equals(getComputedStyle(div2, null).offsetPosition, 'auto');
+}, 'offset-position auto remains auto');
+
+test(function() {
+ assert_equals(getComputedStyle(div3, null).offsetPosition, '10px 20px');
+}, 'offset-position can be fixed lengths');
+
+test(function() {
+ assert_equals(getComputedStyle(div4, null).offsetPosition, '30px 0%');
+}, 'offset-position can be a length and a keyword');
+
+test(function() {
+ assert_equals(getComputedStyle(div5, null).offsetPosition, '0% 40px');
+}, 'offset-position can be a keyword and a length');
+
+test(function() {
+ assert_equals(getComputedStyle(div6, null).offsetPosition, '50% 50%');
+}, 'offset-position can be supplied with a single keyword');
+
+test(function() {
+ assert_equals(getComputedStyle(div7, null).offsetPosition, '50px 60px');
+}, 'offset-position can be supplied with em');
+
+test(function() {
+ assert_equals(getComputedStyle(div8, null).offsetPosition, '30% 40%');
+}, 'offset-position is unaffected by child elements');
+
+test(function() {
+ assert_equals(getComputedStyle(div9, null).offsetPosition, '30% 40%');
+}, 'offset-position can be explicitly inherited');
+
+test(function() {
+ assert_equals(getComputedStyle(div10, null).offsetPosition, 'auto');
+}, 'offset-position is not inherited by default');
+
+test(function() {
+ assert_equals(span1.style.offsetPosition, 'right bottom');
+}, 'offset-position style can be set inline');
+
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698