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

Unified Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 2170383002: CustomElements: adopt node (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge conflict resolution 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/dom/ElementRareData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Element.cpp
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index 9cce24f6a0f58afd4ba5c6ec0704733e4ab0c8db..8fb4a4d37b6c25f79605301a33d289ddf59be2d9 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -1941,15 +1941,30 @@ void Element::setNeedsCompositingUpdate()
layoutObject->layer()->updateSelfPaintingLayer();
}
-void Element::setCustomElementDefinition(V0CustomElementDefinition* definition)
+void Element::v0SetCustomElementDefinition(V0CustomElementDefinition* definition)
{
if (!hasRareData() && !definition)
return;
+ DCHECK(!v0CustomElementDefinition());
+ ensureElementRareData().v0SetCustomElementDefinition(definition);
+}
+
+V0CustomElementDefinition* Element::v0CustomElementDefinition() const
+{
+ if (hasRareData())
+ return elementRareData()->v0CustomElementDefinition();
+ return nullptr;
+}
+
+void Element::setCustomElementDefinition(CustomElementDefinition* definition)
+{
+ DCHECK(definition);
DCHECK(!customElementDefinition());
ensureElementRareData().setCustomElementDefinition(definition);
+ this->setCustomElementState(CustomElementState::Custom);
}
-V0CustomElementDefinition* Element::customElementDefinition() const
+CustomElementDefinition* Element::customElementDefinition() const
{
if (hasRareData())
return elementRareData()->customElementDefinition();
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.h ('k') | third_party/WebKit/Source/core/dom/ElementRareData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698