3 Distributed under both the W3C Test Suite License [1] and the W3C
4 3-clause BSD License [2]. To contribute to a W3C Test Suite, see the
5 policies and contribution forms [3].
7 [1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license
8 [2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license
9 [3] http://www.w3.org/2004/10/27-testcases
13 <title>Shadow DOM Test: A_04_10_01</title>
14 <link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
15 <link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#custom-pseudo-elements">
16 <meta name="assert" content="Custom Pseudo-Elements: test valid pseudo-element">
17 <script src="../../../../../resources/testharness.js"></script>
18 <script src="../../../../../resources/testharnessreport.js"></script>
19 <script src="../../testcommon.js"></script>
20 <link rel="stylesheet" href="../../../../../resources/testharness.css">
25 // Test fails. See https://bugs.webkit.org/show_bug.cgi?id=103973
26 test(unit(function (ctx) {
28 var d = newRenderedHTMLDocument(ctx);
30 var style = d.createElement('style');
31 style.innerHTML = 'span {' +
34 d.head.appendChild(style);
36 var widget = d.createElement('div');
37 d.body.appendChild(widget);
39 var s = widget.createShadowRoot();
41 var thumb = d.createElement('span');
42 thumb.innerHTML = 'This is a pseudo-element';
43 //FIXME test works if prefixed version of API used.
44 //In other words works if webkitPseudo property is used
45 //thumb.webkitPseudo = 'x-thumb';
46 thumb.pseudo = 'x-thumb';
49 var height = thumb.offsetHeight;
51 assert_true(height > 0, 'Element should be rendered');
53 style = d.createElement('style');
54 style.innerHTML = 'div::x-thumb {' +
57 d.body.appendChild(style);
59 assert_true(thumb.offsetHeight > height, 'Pseudo-element style should be applied');
61 }), 'A_04_10_01_T01');