| 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>
|
|
|