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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-background-position.html

Issue 2888283006: CSS: Use count position values with 3 parts (Closed)
Patch Set: distinct use counters Created 3 years, 7 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/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..62cf67731ea73a45ab555c3a14c13e01346519a8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-background-position.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+'use strict';
+
+test(() => {
+ // From UseCounter.h
+ let ThreeValuedPositionBasicShape = 1977;
+ let ThreeValuedPositionGradient = 1978;
+ let ThreeValuedPositionObjectPosition = 1979;
+ let ThreeValuedPositionPerspectiveOrigin = 1980;
+
+ var div = document.createElement('div');
+ div.style = 'background-position: 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(internals.isUseCounted(document, ThreeValuedPositionBasicShape));
+ assert_false(internals.isUseCounted(document, ThreeValuedPositionGradient));
+ assert_false(internals.isUseCounted(document, ThreeValuedPositionObjectPosition));
+ assert_false(internals.isUseCounted(document, ThreeValuedPositionPerspectiveOrigin));
+
+ 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;';
+
+ assert_true(internals.isUseCounted(document, ThreeValuedPositionBasicShape));
+ assert_true(internals.isUseCounted(document, ThreeValuedPositionGradient));
+ assert_true(internals.isUseCounted(document, ThreeValuedPositionObjectPosition));
+ assert_true(internals.isUseCounted(document, ThreeValuedPositionPerspectiveOrigin));
+}, 'Three valued position syntax is not use counted for background-position');
+</script>

Powered by Google App Engine
This is Rietveld 408576698