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

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

Issue 2352273002: CSS Motion Path: offset-anchor and offset-position (Closed)
Patch Set: rebase 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/css3/motion-path/offset-position.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/css3/motion-path/offset-anchor.html
diff --git a/third_party/WebKit/LayoutTests/css3/motion-path/offset-anchor.html b/third_party/WebKit/LayoutTests/css3/motion-path/offset-anchor.html
new file mode 100644
index 0000000000000000000000000000000000000000..44b4480149b3ae3b4126e78338354af75bc8e4b3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/css3/motion-path/offset-anchor.html
@@ -0,0 +1,74 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<style>
+body {
+ font-size: 10px;
+}
+#container {
+ offset-anchor: 30% 40%;
+}
+#child1 {
+ offset-anchor: inherit;
+}
+</style>
+<div id="container">
+ <div id="child1"></div>
+ <div id="child2"></div>
+</div>
+<script>
+"use strict";
+
+test(function() {
+ var element = document.createElement('div');
+ document.body.appendChild(element);
+ assert_equals(getComputedStyle(element, null).offsetAnchor, '50% 50%');
+}, 'offset-anchor default is 50% 50%');
+
+test(function() {
+ assert_equals(getComputedStyle(container, null).offsetAnchor, '30% 40%');
+}, 'offset-anchor can be two percentages');
+
+test(function() {
+ assert_equals(getComputedStyle(child1, null).offsetAnchor, '30% 40%');
+}, 'offset-anchor can explicitly inherited');
+
+test(function() {
+ assert_equals(getComputedStyle(child2, null).offsetAnchor, '50% 50%');
+}, 'offset-anchor is not inherited by default');
+
+function computed(specified) {
+ var element = document.createElement('div');
+ element.style['offset-anchor'] = specified;
+ document.body.appendChild(element);
+ return getComputedStyle(element, null).offsetAnchor;
+}
+
+test(function() {
+ assert_equals(computed('auto'), 'auto');
+}, 'offset-anchor can be auto');
+
+test(function() {
+ assert_equals(computed('10px 20px'), '10px 20px');
+}, 'offset-anchor can be two lengths');
+
+test(function() {
+ assert_equals(computed('30px top'), '30px 0%');
+}, 'offset-anchor can be a length and a keyword');
+
+test(function() {
+ assert_equals(computed('left 40px'), '0% 40px');
+}, 'offset-anchor can be a keyword and a length');
+
+test(function() {
+ assert_equals(computed('top'), '50% 0%');
+}, 'offset-anchor can be supplied with a single keyword');
+
+test(function() {
+ assert_equals(computed('center'), '50% 50%');
+}, 'offset-anchor can be supplied with center');
+
+test(function() {
+ assert_equals(computed('5em 6em'), '50px 60px');
+}, 'offset-anchor can be supplied with em');
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/css3/motion-path/offset-position.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698