OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../media-file.js"></script> | 2 <script src="../media-file.js"></script> |
3 <script src="../video-test.js"></script> | 3 <script src="../video-test.js"></script> |
4 <script src="../media-controls.js"></script> | 4 <script src="../media-controls.js"></script> |
5 <style> | 5 <style> |
6 video::cue, | 6 video::cue, |
7 video::cue(c), | 7 video::cue(c), |
8 video::cue(i:past), | 8 video::cue(i:past), |
9 video::cue(.b:future) { background-color: red } | 9 video::cue(.b:future) { background-color: red } |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 cueNode = textTrackDisplayElement(video, "cue"); | 25 cueNode = textTrackDisplayElement(video, "cue"); |
26 iNode = cueNode.firstElementChild; | 26 iNode = cueNode.firstElementChild; |
27 cNode = iNode.nextSibling.nextSibling; | 27 cNode = iNode.nextSibling.nextSibling; |
28 bNode = cNode.nextSibling.nextSibling; | 28 bNode = cNode.nextSibling.nextSibling; |
29 | 29 |
30 testExpected("getComputedStyle(cueNode).backgroundColor", red); | 30 testExpected("getComputedStyle(cueNode).backgroundColor", red); |
31 ascendant.offsetTop; | 31 ascendant.offsetTop; |
32 ascendant.classList.add("cue"); | 32 ascendant.classList.add("cue"); |
33 if (window.internals) | 33 if (window.internals) |
34 testExpected("internals.updateStyleAndReturnAffectedElementCount()", 9); | 34 testExpected("internals.updateStyleAndReturnAffectedElementCount()", 8); |
35 testExpected("getComputedStyle(cueNode).backgroundColor", green); | 35 testExpected("getComputedStyle(cueNode).backgroundColor", green); |
36 | 36 |
37 testExpected("getComputedStyle(cNode).backgroundColor", red); | 37 testExpected("getComputedStyle(cNode).backgroundColor", red); |
38 ascendant.offsetTop; | 38 ascendant.offsetTop; |
39 ascendant.classList.add("cuefunc"); | 39 ascendant.classList.add("cuefunc"); |
40 if (window.internals) | 40 if (window.internals) |
41 testExpected("internals.updateStyleAndReturnAffectedElementCount()", 2); | 41 testExpected("internals.updateStyleAndReturnAffectedElementCount()", 1); |
42 testExpected("getComputedStyle(cNode).backgroundColor", green); | 42 testExpected("getComputedStyle(cNode).backgroundColor", green); |
43 | 43 |
44 testExpected("getComputedStyle(iNode).backgroundColor", red); | 44 testExpected("getComputedStyle(iNode).backgroundColor", red); |
45 ascendant.offsetTop; | 45 ascendant.offsetTop; |
46 ascendant.classList.add("past"); | 46 ascendant.classList.add("past"); |
47 if (window.internals) | 47 if (window.internals) |
48 testExpected("internals.updateStyleAndReturnAffectedElementCount()", 2); | 48 testExpected("internals.updateStyleAndReturnAffectedElementCount()", 1); |
49 testExpected("getComputedStyle(iNode).backgroundColor", green); | 49 testExpected("getComputedStyle(iNode).backgroundColor", green); |
50 | 50 |
51 testExpected("getComputedStyle(bNode).backgroundColor", red); | 51 testExpected("getComputedStyle(bNode).backgroundColor", red); |
52 ascendant.offsetTop; | 52 ascendant.offsetTop; |
53 ascendant.classList.add("future"); | 53 ascendant.classList.add("future"); |
54 if (window.internals) | 54 if (window.internals) |
55 testExpected("internals.updateStyleAndReturnAffectedElementCount()", 2); | 55 testExpected("internals.updateStyleAndReturnAffectedElementCount()", 1); |
56 testExpected("getComputedStyle(bNode).backgroundColor", green); | 56 testExpected("getComputedStyle(bNode).backgroundColor", green); |
57 | 57 |
58 endTest(); | 58 endTest(); |
59 } | 59 } |
60 | 60 |
61 window.onload = function() { | 61 window.onload = function() { |
62 consoleWrite("Check that descendant style invalidation works with ::cue sele
ctors."); | 62 consoleWrite("Check that descendant style invalidation works with ::cue sele
ctors."); |
63 findMediaElement(); | 63 findMediaElement(); |
64 video.src = findMediaFile("video", "../content/test"); | 64 video.src = findMediaFile("video", "../content/test"); |
65 waitForEvent("seeked", seeked); | 65 waitForEvent("seeked", seeked); |
66 waitForEvent("canplaythrough", function() { video.currentTime = 0.1; }); | 66 waitForEvent("canplaythrough", function() { video.currentTime = 0.1; }); |
67 }; | 67 }; |
68 </script> | 68 </script> |
69 <div id="ascendant"> | 69 <div id="ascendant"> |
70 <video> | 70 <video> |
71 <track src="captions-webvtt/invalidation.vtt" kind="captions" default> | 71 <track src="captions-webvtt/invalidation.vtt" kind="captions" default> |
72 </video> | 72 </video> |
73 <div></div> | 73 <div></div> |
74 <div></div> | 74 <div></div> |
75 </div> | 75 </div> |
76 <div> | 76 <div> |
77 <div></div> | 77 <div></div> |
78 </div> | 78 </div> |
OLD | NEW |