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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/usecounter-angle-zero-transform.html

Issue 2898133002: CSS: Use count unitless 0 supplied as <angle> (Closed)
Patch Set: test 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-angle-zero-transform.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/usecounter-angle-zero-transform.html b/third_party/WebKit/LayoutTests/fast/css/usecounter-angle-zero-transform.html
new file mode 100644
index 0000000000000000000000000000000000000000..ed0d667cebf27449cbfdc866105e61b7b3d5a631
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/usecounter-angle-zero-transform.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script>
+'use strict';
+
+test(() => {
+ let UnitlessZeroAngleTransform = 2010; // From UseCounter.h
+
+ let isCounted = () => internals.isUseCounted(document, UnitlessZeroAngleTransform);
+ var div = document.createElement('div');
+
+ // These values are invalid.
+ div.style = 'image-orientation: 0;';
+ div.style = 'rotate: 0;';
+ div.style = 'offset-path: ray(0 closest-side);';
+ // These properties have their own counters.
+ div.style = 'filter: hue-rotate(0);';
+ div.style = 'background-image: linear-gradient(0, red, black);';
+ div.style = 'offset-rotate: 0;';
+ assert_false(isCounted(),
+ 'non transform should not be counted');
+
+ div.style = 'transform: skewX(0deg);';
+ assert_false(isCounted(),
+ '0deg should not be counted');
+
+ div.style = 'transform: skewX(0);';
+ assert_true(isCounted(),
+ '0 should be counted');
+}, 'angle 0 is use counted for transform');
+</script>

Powered by Google App Engine
This is Rietveld 408576698