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

Side by Side Diff: third_party/WebKit/Source/core/dom/shadow/FlatTreeTraversalTest.cpp

Issue 2460813002: Make slots in non-shadow trees participate in a flat tree (Closed)
Patch Set: update expectation Created 4 years, 1 month 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/dom/shadow/FlatTreeTraversal.h" 5 #include "core/dom/shadow/FlatTreeTraversal.h"
6 6
7 #include "bindings/core/v8/ExceptionStatePlaceholder.h" 7 #include "bindings/core/v8/ExceptionStatePlaceholder.h"
8 #include "core/dom/Document.h" 8 #include "core/dom/Document.h"
9 #include "core/dom/Element.h" 9 #include "core/dom/Element.h"
10 #include "core/dom/Node.h" 10 #include "core/dom/Node.h"
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 "<div id='parent'>" 576 "<div id='parent'>"
577 "<slot>" 577 "<slot>"
578 "<div id='child1'></div>" 578 "<div id='child1'></div>"
579 "<div id='child2'></div>" 579 "<div id='child2'></div>"
580 "</slot>" 580 "</slot>"
581 "</div>"; 581 "</div>";
582 582
583 setupDocumentTree(mainHTML); 583 setupDocumentTree(mainHTML);
584 Element* body = document().body(); 584 Element* body = document().body();
585 Element* parent = body->querySelector("#parent"); 585 Element* parent = body->querySelector("#parent");
586 Element* slot = body->querySelector("slot");
586 Element* child1 = body->querySelector("#child1"); 587 Element* child1 = body->querySelector("#child1");
587 Element* child2 = body->querySelector("#child2"); 588 Element* child2 = body->querySelector("#child2");
588 589
589 EXPECT_EQ(child1, FlatTreeTraversal::firstChild(*parent)); 590 EXPECT_EQ(slot, FlatTreeTraversal::firstChild(*parent));
591 EXPECT_EQ(child1, FlatTreeTraversal::firstChild(*slot));
590 EXPECT_EQ(child2, FlatTreeTraversal::nextSibling(*child1)); 592 EXPECT_EQ(child2, FlatTreeTraversal::nextSibling(*child1));
591 EXPECT_EQ(nullptr, FlatTreeTraversal::nextSibling(*child2)); 593 EXPECT_EQ(nullptr, FlatTreeTraversal::nextSibling(*child2));
592 EXPECT_EQ(parent, FlatTreeTraversal::parent(*child1)); 594 EXPECT_EQ(slot, FlatTreeTraversal::parent(*child1));
593 EXPECT_EQ(parent, FlatTreeTraversal::parent(*child2)); 595 EXPECT_EQ(slot, FlatTreeTraversal::parent(*child2));
596 EXPECT_EQ(parent, FlatTreeTraversal::parent(*slot));
594 } 597 }
595 598
596 } // namespace blink 599 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/shadow/FlatTreeTraversal.cpp ('k') | third_party/WebKit/Source/core/editing/Position.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698