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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-radial-gradient.html

Issue 2888283006: CSS: Use count position values with 3 parts (Closed)
Patch Set: use count in the property APIs 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-radial-gradient.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-radial-gradient.html b/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-radial-gradient.html
new file mode 100644
index 0000000000000000000000000000000000000000..f15a2176999d497bf3769924f1cc9b3d27d6b0dc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/usecounter-position3value-radial-gradient.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+'use strict';
+
+test(() => {
+ let ThreeValuedPositionGradient = 1985; // From UseCounter.h
+
+ let isCounted = () => internals.isUseCounted(document, ThreeValuedPositionGradient);
+ var div = document.createElement('div');
+
+ // These properties have their own counters.
+ div.style = 'background-position: left 10% top;';
+ div.style = 'shape-outside: circle(0px at left 10% top);';
+ 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 gradient should not be counted');
+
+ div.style = 'background-image: radial-gradient(0em circle at left, blue);';
+ div.style = 'background-image: radial-gradient(0em circle at left 10%, yellow, blue);';
+ div.style = 'background-image: radial-gradient(0em circle at left 10% top 20%, yellow, blue);';
+ assert_false(isCounted(),
+ '1,2,4 values should not be counted');
+
+ div.style = 'background-image: radial-gradient(0em circle at left 10% top, yellow, blue);';
+ assert_true(isCounted(),
+ 'gradient should be counted');
+}, 'Three valued position syntax is use counted for radial-gradient');
+</script>

Powered by Google App Engine
This is Rietveld 408576698