| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <style> |
| 5 summary.first { |
| 6 display: list-item; |
| 7 } |
| 8 |
| 9 summary.second { |
| 10 display: some-invalid-value; |
| 11 } |
| 12 |
| 13 summary.third { |
| 14 display: block; |
| 15 } |
| 16 </style> |
| 17 <details><summary>A</summary>B</details> |
| 18 <script> |
| 19 'use strict'; |
| 20 |
| 21 test(() => { |
| 22 let SummaryElementWithDisplayBlockAuthorRule = 1434; // From UseCounter.h |
| 23 let isCounted = () => internals.isUseCounted(document, SummaryElementWithDis
playBlockAuthorRule); |
| 24 assert_false(isCounted(), |
| 25 'user agent stylesheet rules should not be counted'); |
| 26 |
| 27 let summary = document.querySelector('summary'); |
| 28 assert_equals( |
| 29 'block', window.getComputedStyle(summary).display, |
| 30 'the user agent stylsheet display property should be in effect'); |
| 31 assert_false( |
| 32 isCounted(), |
| 33 'user agent stylesheet rules should not be counted'); |
| 34 |
| 35 summary.classList.add('first'); |
| 36 assert_equals( |
| 37 'list-item', window.getComputedStyle(summary).display, |
| 38 'the author stylsheet display property should be in effect'); |
| 39 assert_false( |
| 40 isCounted(), |
| 41 'valid values other than block should not be counted'); |
| 42 |
| 43 summary.classList.remove('first'); |
| 44 summary.classList.add('second'); |
| 45 assert_equals( |
| 46 'block', window.getComputedStyle(summary).display, |
| 47 'the user agent stylesheet display property should be in effect ' + |
| 48 'when the author stylesheet value is invalid'); |
| 49 assert_false( |
| 50 isCounted(), |
| 51 'only values from an author rule should be counted'); |
| 52 |
| 53 summary.classList.remove('second'); |
| 54 summary.classList.add('third'); |
| 55 assert_equals( |
| 56 'block', window.getComputedStyle(summary).display, |
| 57 'the author stylesheet display property should be in effect'); |
| 58 assert_true( |
| 59 isCounted(), |
| 60 'author rules for display: block summary should tickle the counter'); |
| 61 }, 'summary with author display: block is use counted'); |
| 62 </script> |
| OLD | NEW |