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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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>
OLDNEW
« 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