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

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

Issue 2068053002: Rename Blink constants generated from IDL files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 507e1b4da659268aec8e59d04c4e4d3991da76b2..0255c592c1a641e206e04344b65f7d043af09c30 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -835,19 +835,19 @@ bool Document::importContainerNodeChildren(ContainerNode* oldContainerNode, Cont
Node* Document::importNode(Node* importedNode, bool deep, ExceptionState& exceptionState)
{
switch (importedNode->getNodeType()) {
- case TEXT_NODE:
+ case kTextNode:
return createTextNode(importedNode->nodeValue());
- case CDATA_SECTION_NODE:
+ case kCdataSectionNode:
return CDATASection::create(*this, importedNode->nodeValue());
- case PROCESSING_INSTRUCTION_NODE:
+ case kProcessingInstructionNode:
return createProcessingInstruction(importedNode->nodeName(), importedNode->nodeValue(), exceptionState);
- case COMMENT_NODE:
+ case kCommentNode:
return createComment(importedNode->nodeValue());
- case DOCUMENT_TYPE_NODE: {
+ case kDocumentTypeNode: {
DocumentType* doctype = toDocumentType(importedNode);
return DocumentType::create(this, doctype->name(), doctype->publicId(), doctype->systemId());
}
- case ELEMENT_NODE: {
+ case kElementNode: {
Element* oldElement = toElement(importedNode);
// FIXME: The following check might be unnecessary. Is it possible that
// oldElement has mismatched prefix/namespace?
@@ -871,9 +871,9 @@ Node* Document::importNode(Node* importedNode, bool deep, ExceptionState& except
return newElement;
}
- case ATTRIBUTE_NODE:
+ case kAttributeNode:
return Attr::create(*this, QualifiedName(nullAtom, AtomicString(toAttr(importedNode)->name()), nullAtom), toAttr(importedNode)->value());
- case DOCUMENT_FRAGMENT_NODE: {
+ case kDocumentFragmentNode: {
if (importedNode->isShadowRoot()) {
// ShadowRoot nodes should not be explicitly importable.
// Either they are imported along with their host node, or created implicitly.
@@ -887,7 +887,7 @@ Node* Document::importNode(Node* importedNode, bool deep, ExceptionState& except
return newFragment;
}
- case DOCUMENT_NODE:
+ case kDocumentNode:
exceptionState.throwDOMException(NotSupportedError, "The node provided is a document, which may not be imported.");
return nullptr;
}
@@ -901,10 +901,10 @@ Node* Document::adoptNode(Node* source, ExceptionState& exceptionState)
EventQueueScope scope;
switch (source->getNodeType()) {
- case DOCUMENT_NODE:
+ case kDocumentNode:
exceptionState.throwDOMException(NotSupportedError, "The node provided is of type '" + source->nodeName() + "', which may not be adopted.");
return nullptr;
- case ATTRIBUTE_NODE: {
+ case kAttributeNode: {
Attr* attr = toAttr(source);
if (Element* ownerElement = attr->ownerElement())
ownerElement->removeAttributeNode(attr, exceptionState);
@@ -1350,7 +1350,7 @@ String Document::nodeName() const
Node::NodeType Document::getNodeType() const
{
- return DOCUMENT_NODE;
+ return kDocumentNode;
}
FormController& Document::formController()
@@ -3190,17 +3190,17 @@ MouseEventWithHitTestResults Document::prepareMouseEvent(const HitTestRequest& r
bool Document::childTypeAllowed(NodeType type) const
{
switch (type) {
- case ATTRIBUTE_NODE:
- case CDATA_SECTION_NODE:
- case DOCUMENT_FRAGMENT_NODE:
- case DOCUMENT_NODE:
- case TEXT_NODE:
+ case kAttributeNode:
+ case kCdataSectionNode:
+ case kDocumentFragmentNode:
+ case kDocumentNode:
+ case kTextNode:
return false;
- case COMMENT_NODE:
- case PROCESSING_INSTRUCTION_NODE:
+ case kCommentNode:
+ case kProcessingInstructionNode:
return true;
- case DOCUMENT_TYPE_NODE:
- case ELEMENT_NODE:
+ case kDocumentTypeNode:
+ case kElementNode:
// Documents may contain no more than one of each of these.
// (One Element and one DocumentType.)
for (Node& c : NodeTraversal::childrenOf(*this)) {
@@ -3227,10 +3227,10 @@ bool Document::canAcceptChild(const Node& newChild, const Node* oldChild, Except
continue;
switch (child.getNodeType()) {
- case DOCUMENT_TYPE_NODE:
+ case kDocumentTypeNode:
numDoctypes++;
break;
- case ELEMENT_NODE:
+ case kElementNode:
numElements++;
break;
default:
@@ -3242,42 +3242,42 @@ bool Document::canAcceptChild(const Node& newChild, const Node* oldChild, Except
if (newChild.isDocumentFragment()) {
for (Node& child : NodeTraversal::childrenOf(toDocumentFragment(newChild))) {
switch (child.getNodeType()) {
- case ATTRIBUTE_NODE:
- case CDATA_SECTION_NODE:
- case DOCUMENT_FRAGMENT_NODE:
- case DOCUMENT_NODE:
- case TEXT_NODE:
+ case kAttributeNode:
+ case kCdataSectionNode:
+ case kDocumentFragmentNode:
+ case kDocumentNode:
+ case kTextNode:
exceptionState.throwDOMException(HierarchyRequestError, "Nodes of type '" + newChild.nodeName() +
"' may not be inserted inside nodes of type '#document'.");
return false;
- case COMMENT_NODE:
- case PROCESSING_INSTRUCTION_NODE:
+ case kCommentNode:
+ case kProcessingInstructionNode:
break;
- case DOCUMENT_TYPE_NODE:
+ case kDocumentTypeNode:
numDoctypes++;
break;
- case ELEMENT_NODE:
+ case kElementNode:
numElements++;
break;
}
}
} else {
switch (newChild.getNodeType()) {
- case ATTRIBUTE_NODE:
- case CDATA_SECTION_NODE:
- case DOCUMENT_FRAGMENT_NODE:
- case DOCUMENT_NODE:
- case TEXT_NODE:
+ case kAttributeNode:
+ case kCdataSectionNode:
+ case kDocumentFragmentNode:
+ case kDocumentNode:
+ case kTextNode:
exceptionState.throwDOMException(HierarchyRequestError, "Nodes of type '" + newChild.nodeName() +
"' may not be inserted inside nodes of type '#document'.");
return false;
- case COMMENT_NODE:
- case PROCESSING_INSTRUCTION_NODE:
+ case kCommentNode:
+ case kProcessingInstructionNode:
return true;
- case DOCUMENT_TYPE_NODE:
+ case kDocumentTypeNode:
numDoctypes++;
break;
- case ELEMENT_NODE:
+ case kElementNode:
numElements++;
break;
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/Comment.cpp ('k') | third_party/WebKit/Source/core/dom/DocumentFragment.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698