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

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

Issue 1982973002: Add CustomElementState for Custom Elements v1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test Created 4 years, 7 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
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/Node.h" 5 #include "core/dom/Node.h"
6 6
7 #include "core/editing/EditingTestBase.h" 7 #include "core/editing/EditingTestBase.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
(...skipping 18 matching lines...) Expand all
29 const char* bodyContent = "<div id=host><span id=one>one</span></div>"; 29 const char* bodyContent = "<div id=host><span id=one>one</span></div>";
30 const char* shadowContent = "<a href='http://www.msn.com'><content></content ></a>"; 30 const char* shadowContent = "<a href='http://www.msn.com'><content></content ></a>";
31 setBodyContent(bodyContent); 31 setBodyContent(bodyContent);
32 setShadowContent(shadowContent, "host"); 32 setShadowContent(shadowContent, "host");
33 Node* one = document().getElementById("one"); 33 Node* one = document().getElementById("one");
34 34
35 EXPECT_FALSE(one->canStartSelection()); 35 EXPECT_FALSE(one->canStartSelection());
36 EXPECT_FALSE(one->firstChild()->canStartSelection()); 36 EXPECT_FALSE(one->firstChild()->canStartSelection());
37 } 37 }
38 38
39 TEST_F(NodeTest, customElementState)
40 {
41 const char* bodyContent = "<div id=div></div>";
42 setBodyContent(bodyContent);
43 Element* div = document().getElementById("div");
44 EXPECT_EQ(CustomElementState::Uncustomized, div->getCustomElementState());
45 EXPECT_TRUE(div->isDefinedCustomElement());
dominicc (has gone to gerrit) 2016/05/18 07:56:22 I think in practice code needs to distinguish thre
kojii 2016/05/18 08:32:15 When you need to distinguish the three, getCustomE
46 EXPECT_EQ(Node::V0NotCustomElement, div->getV0CustomElementState());
47
48 div->setCustomElementState(CustomElementState::Undefined);
49 EXPECT_EQ(CustomElementState::Undefined, div->getCustomElementState());
50 EXPECT_FALSE(div->isDefinedCustomElement());
51 EXPECT_EQ(Node::V0NotCustomElement, div->getV0CustomElementState());
52
53 div->setCustomElementState(CustomElementState::Customized);
54 EXPECT_EQ(CustomElementState::Customized, div->getCustomElementState());
55 EXPECT_TRUE(div->isDefinedCustomElement());
56 EXPECT_EQ(Node::V0NotCustomElement, div->getV0CustomElementState());
57 }
58
39 } // namespace blink 59 } // namespace blink
OLDNEW
« third_party/WebKit/Source/core/dom/Node.cpp ('K') | « third_party/WebKit/Source/core/dom/Node.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698