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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/css3-text/css3-text-decoration/resources/text-decoration-skip-css-support.js

Issue 2394273006: Add CSS support for text-decoration-skip (Closed)
Patch Set: Histograms typo fixed, DCHECK Created 4 years, 2 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
OLDNEW
(Empty)
1 var validWriteExpectations = ['ink',
2 'objects',
3 'objects ink'];
4
5 var writeInvalidExpectations = ['none objects', // Combinations with none invali d
6 'none', // none currently not supported
7 'abc def',
8 '',
9 'objects objects',
10 'ink ink',
11 'edges'] // not supported yet
12
13 setup({ explicit_done: true });
14
15 function styleAndComputedStyleReadback() {
16
17 var testContainer = document.createElement("div");
18 document.body.appendChild(testContainer);
19
20 for (validValue of validWriteExpectations) {
21 testContainer.style.textDecorationSkip = validValue;
22 test(function() {
23 assert_equals(testContainer.style.textDecorationSkip, validValue);
24 assert_equals(getComputedStyle(testContainer).textDecorationSkip, va lidValue);
25 }, 'text-decoration-skip value ' + validValue + ' should be equal when r eading it back from style and getComputedstyle.');
26 }
27
28 document.body.removeChild(testContainer);
29 }
30
31 function testInheritance() {
32 var testContainer = document.createElement('div');
33 var testContainerChild = document.createElement('div');
34 testContainer.appendChild(testContainerChild);
35 document.body.appendChild(testContainer);
36
37 for (validValue of validWriteExpectations) {
38 testContainer.style.textDecorationSkip = validValue;
39 test(function() {
40 assert_equals(testContainerChild.style.textDecorationSkip, '');
41 assert_equals(getComputedStyle(testContainerChild).textDecorationSki p, validValue);
42 }, 'text-decoration-skip value ' + validValue + ' should be inherited to computed style of child.');
43 }
44 document.body.removeChild(testContainer);
45 }
46
47 function validWriteTests() {
48 for (validValue of validWriteExpectations) {
49 test(function() {
50 assert_true(CSS.supports('text-decoration-skip', validValue));
51 }, 'Value ' + validValue + ' valid for property text-decoration-skip');
52 }
53 }
54
55 function invalidWriteTests() {
56 for (invalidValue of writeInvalidExpectations) {
57 test(function() {
58 assert_false(CSS.supports('text-decoration-skip', invalidValue));
59 }, 'Value ' + invalidValue + ' invalid for property text-decoration-skip ');
60 }
61 }
62
63 window.addEventListener('load', function() {
64 validWriteTests();
65 invalidWriteTests();
66 styleAndComputedStyleReadback();
67 testInheritance();
68 done();
69 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698