Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-background-position.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-background-position.html b/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-background-position.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..13fec433480e4da2ac744f914b879c3cdcd46c89 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-background-position.html |
| @@ -0,0 +1,38 @@ |
| +<!DOCTYPE html> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<script> |
| +'use strict'; |
| + |
| +test(() => { |
| + let ThreeValuedPositionBackgroundPosition = 1983; // From UseCounter.h |
|
Bugs Nash
2017/05/22 23:07:08
as above
|
| + |
| + let isCounted = () => internals.isUseCounted(document, ThreeValuedPositionBackgroundPosition); |
| + var div = document.createElement('div'); |
| + |
| + // These properties have their own counters. |
| + div.style = 'shape-outside: circle(0px at left 10% top);'; |
| + div.style = 'background-image: radial-gradient(0em circle at left 10% top, yellow, blue);'; |
| + div.style = 'object-position: left 10% top;'; |
| + div.style = 'perspective-origin: left 10% top;'; |
| + // These values are invalid. |
| + div.style = 'offset-anchor: left 10% top;'; |
| + div.style = 'offset-position: left 10% top;'; |
| + div.style = 'transform-origin: left 10% top;'; |
| + // These obsolete properties will never ship. |
| + div.style = 'scroll-snap-coordinate: left 10% top;'; |
| + div.style = 'scroll-snap-destination: left 10% top;'; |
| + assert_false(isCounted(), |
| + 'non background-position should not be counted'); |
| + |
| + div.style = 'background-position: left;'; |
| + div.style = 'background-position: left 10%;'; |
| + div.style = 'background-position: left 10% top 20%;'; |
| + assert_false(isCounted(), |
| + '1,2,4 values should not be counted'); |
| + |
| + div.style = 'background-position: left 10% top;'; |
| + assert_true(isCounted(), |
| + 'background-position should be counted'); |
| +}, 'Three valued position syntax is use counted for background-position'); |
| +</script> |