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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/NodeTest.cpp
diff --git a/third_party/WebKit/Source/core/dom/NodeTest.cpp b/third_party/WebKit/Source/core/dom/NodeTest.cpp
index b1603d5524272e63ded96604b04d7af2c0173678..c57529bc923ce8c3f8598ae961878f40ca900018 100644
--- a/third_party/WebKit/Source/core/dom/NodeTest.cpp
+++ b/third_party/WebKit/Source/core/dom/NodeTest.cpp
@@ -36,4 +36,24 @@ TEST_F(NodeTest, canStartSelectionWithShadowDOM)
EXPECT_FALSE(one->firstChild()->canStartSelection());
}
+TEST_F(NodeTest, customElementState)
+{
+ const char* bodyContent = "<div id=div></div>";
+ setBodyContent(bodyContent);
+ Element* div = document().getElementById("div");
+ EXPECT_EQ(CustomElementState::Uncustomized, div->getCustomElementState());
+ 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
+ EXPECT_EQ(Node::V0NotCustomElement, div->getV0CustomElementState());
+
+ div->setCustomElementState(CustomElementState::Undefined);
+ EXPECT_EQ(CustomElementState::Undefined, div->getCustomElementState());
+ EXPECT_FALSE(div->isDefinedCustomElement());
+ EXPECT_EQ(Node::V0NotCustomElement, div->getV0CustomElementState());
+
+ div->setCustomElementState(CustomElementState::Customized);
+ EXPECT_EQ(CustomElementState::Customized, div->getCustomElementState());
+ EXPECT_TRUE(div->isDefinedCustomElement());
+ EXPECT_EQ(Node::V0NotCustomElement, div->getV0CustomElementState());
+}
+
} // namespace blink
« 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