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

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

Issue 2002063003: Change "bool createdByParser" of createElement() to enum (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cestate
Patch Set: Add ImportNode 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/Document.h
diff --git a/third_party/WebKit/Source/core/dom/Document.h b/third_party/WebKit/Source/core/dom/Document.h
index 2816210aa4d48655d719edabd21b46e1998617dd..f7edeeab08b9e17b301b1b6e47573976faab0d55 100644
--- a/third_party/WebKit/Source/core/dom/Document.h
+++ b/third_party/WebKit/Source/core/dom/Document.h
@@ -214,6 +214,23 @@ enum ShadowCascadeOrder {
ShadowCascadeV1
};
+enum CreateElementFlags {
+ CreatedByParser = 1 << 0,
+ // Synchronous custom elements flag:
+ // https://dom.spec.whatwg.org/#concept-create-element
+ SynchronousCustomElements = 0 << 1,
+ AsynchronousCustomElements = 1 << 1,
+
+ // Aliases by callers.
+ // Clone a node: https://dom.spec.whatwg.org/#concept-node-clone
+ CreatedByCloneNode = AsynchronousCustomElements,
+ CreatedByImportNode = CreatedByCloneNode,
+ // https://dom.spec.whatwg.org/#dom-document-createelement
+ CreatedByCreateElement = SynchronousCustomElements,
+ // https://html.spec.whatwg.org/#create-an-element-for-the-token
+ CreatedByFragmentParser = CreatedByParser | AsynchronousCustomElements,
+};
+
using DocumentClassFlags = unsigned char;
class CORE_EXPORT Document : public ContainerNode, public TreeScope, public SecurityContext, public ExecutionContext, public Supplementable<Document> {
@@ -292,7 +309,7 @@ public:
Attr* createAttributeNS(const AtomicString& namespaceURI, const AtomicString& qualifiedName, ExceptionState&, bool shouldIgnoreNamespaceChecks = false);
Node* importNode(Node* importedNode, bool deep, ExceptionState&);
Element* createElementNS(const AtomicString& namespaceURI, const AtomicString& qualifiedName, ExceptionState&);
- Element* createElement(const QualifiedName&, bool createdByParser);
+ Element* createElement(const QualifiedName&, CreateElementFlags);
Element* elementFromPoint(int x, int y) const;
HeapVector<Member<Element>> elementsFromPoint(int x, int y) const;

Powered by Google App Engine
This is Rietveld 408576698