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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/usecounter-summary-display-block.html

Issue 2122613002: Add a use counter for author rules setting display: block on summary. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bring patch to head. Update counter value in test. Created 4 years, 5 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/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/css/usecounter-summary-display-block.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/usecounter-summary-display-block.html b/third_party/WebKit/LayoutTests/fast/css/usecounter-summary-display-block.html
new file mode 100644
index 0000000000000000000000000000000000000000..5ab8f4ed875d884a1495d82e16b0a7ca15b5f128
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/usecounter-summary-display-block.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<style>
+summary.first {
+ display: list-item;
+}
+
+summary.second {
+ display: some-invalid-value;
+}
+
+summary.third {
+ display: block;
+}
+</style>
+<details><summary>A</summary>B</details>
+<script>
+'use strict';
+
+test(() => {
+ let SummaryElementWithDisplayBlockAuthorRule = 1434; // From UseCounter.h
+ let isCounted = () => internals.isUseCounted(document, SummaryElementWithDisplayBlockAuthorRule);
+ assert_false(isCounted(),
+ 'user agent stylesheet rules should not be counted');
+
+ let summary = document.querySelector('summary');
+ assert_equals(
+ 'block', window.getComputedStyle(summary).display,
+ 'the user agent stylsheet display property should be in effect');
+ assert_false(
+ isCounted(),
+ 'user agent stylesheet rules should not be counted');
+
+ summary.classList.add('first');
+ assert_equals(
+ 'list-item', window.getComputedStyle(summary).display,
+ 'the author stylsheet display property should be in effect');
+ assert_false(
+ isCounted(),
+ 'valid values other than block should not be counted');
+
+ summary.classList.remove('first');
+ summary.classList.add('second');
+ assert_equals(
+ 'block', window.getComputedStyle(summary).display,
+ 'the user agent stylesheet display property should be in effect ' +
+ 'when the author stylesheet value is invalid');
+ assert_false(
+ isCounted(),
+ 'only values from an author rule should be counted');
+
+ summary.classList.remove('second');
+ summary.classList.add('third');
+ assert_equals(
+ 'block', window.getComputedStyle(summary).display,
+ 'the author stylesheet display property should be in effect');
+ assert_true(
+ isCounted(),
+ 'author rules for display: block summary should tickle the counter');
+}, 'summary with author display: block is use counted');
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698