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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/css/invalidation/nth-pseudo.html

Issue 2228933002: Use elementAfter/Before, not nodeAfter/Before for nth-invalidation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/dom/ContainerNode.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 #t1 > :nth-child(even) {
6 background-color: green
7 }
8 #t2 > :nth-last-child(even) {
9 background-color: green
10 }
11 </style>
12 <div id="t1">
13 <span></span>
14 </div>
15 <div id="t2">
16 <span></span>
17 </div>
18
19 <script>
20 function backgroundIsGreen(element) {
21 assert_equals(getComputedStyle(element).backgroundColor, "rgb(0, 128, 0) ");
22 }
23
24 function backgroundIsTransparent(element) {
25 assert_equals(getComputedStyle(element).backgroundColor, "rgba(0, 0, 0, 0)");
26 }
27
28 test(() => {
29 t1.offsetTop;
30 assert_equals(t1.lastChild.nodeType, Node.TEXT_NODE);
31 t1.insertBefore(document.createElement("span"), t1.lastChild);
32 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1);
33 }, "Appending an element sibling should not affect :nth-child of preceeding siblings.");
34
35 test(() => {
36 t2.offsetTop;
37 assert_equals(t2.firstChild.nodeType, Node.TEXT_NODE);
38 assert_equals(t2.firstChild.nextSibling.nodeType, Node.ELEMENT_NODE);
39 t2.insertBefore(document.createElement("span"), t2.firstChild.nextSiblin g);
40 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1);
41 }, "Prepending an element sibling should not affect :nth-last-child of succe eding siblings.");
42
43 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ContainerNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698