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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/window-internals-isCSSPropertyUseCounted.html

Issue 1711703002: Add internals.isCSSPropertyUseCounted functionality (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/css/window-internals-isCSSPropertyUseCounted.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/window-internals-isCSSPropertyUseCounted.html b/third_party/WebKit/LayoutTests/fast/css/window-internals-isCSSPropertyUseCounted.html
new file mode 100644
index 0000000000000000000000000000000000000000..5abe8501e796695c47b59d20c847ddf054249c99
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/window-internals-isCSSPropertyUseCounted.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+
+<style>
+div {
+ padding-left: 100px;
+ padding-bottom: 100px;
+ color:green;
+ background-color: green;
+ opacity: invalid value;
+ border: black solid 5px;
+ border-left: thick dashed lightgreen;
+ -webkit-border-end-color: pink;
+}
+</style>
+
+<div id="target"></div>
+
+<script>
+test(function() {
+ assert_true(internals.isCSSPropertyUseCounted(document, "color"));
+ assert_true(internals.isCSSPropertyUseCounted(document, "background-color"));
+ assert_true(internals.isCSSPropertyUseCounted(document, "padding-bottom"));
+ assert_true(internals.isCSSPropertyUseCounted(document, "padding-left"));
+ assert_true(internals.isCSSPropertyUseCounted(document, "-webkit-border-end-color"));
+}, "Test setting and reading css properties");
+
+test(function() {
+ assert_true(internals.isCSSPropertyUseCounted(document, "border"))
+ assert_false(internals.isCSSPropertyUseCounted(document, "border-color"));
+ assert_false(internals.isCSSPropertyUseCounted(document, "border-style"));
+ assert_false(internals.isCSSPropertyUseCounted(document, "border-width"));
+
+ assert_true(internals.isCSSPropertyUseCounted(document, "border-left"))
+ assert_false(internals.isCSSPropertyUseCounted(document, "border-left-color"));
+ assert_false(internals.isCSSPropertyUseCounted(document, "border-left-style"));
+ assert_false(internals.isCSSPropertyUseCounted(document, "border-left-width"));
+
+}, "Test setting a shorthand and reading longhand");
+
+test(function() {
+ assert_false(internals.isCSSPropertyUseCounted(document, "opacity"));
+}, "Test that properties with invalid values aren't counted");
+
+test(function() {
+ assert_false(internals.isCSSPropertyUseCounted(document, "box-sizing"));
+}, "Test that properties specified in UA stylesheet aren't counted");
+
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698