OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r
ights reserved. |
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
9 * Copyright (C) 2011 Google Inc. All rights reserved. | 9 * Copyright (C) 2011 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 SVGDocumentClass = 1 << 5, | 207 SVGDocumentClass = 1 << 5, |
208 XMLDocumentClass = 1 << 6, | 208 XMLDocumentClass = 1 << 6, |
209 }; | 209 }; |
210 | 210 |
211 enum ShadowCascadeOrder { | 211 enum ShadowCascadeOrder { |
212 ShadowCascadeNone, | 212 ShadowCascadeNone, |
213 ShadowCascadeV0, | 213 ShadowCascadeV0, |
214 ShadowCascadeV1 | 214 ShadowCascadeV1 |
215 }; | 215 }; |
216 | 216 |
| 217 enum CreateElementFlags { |
| 218 CreatedByParser = 1 << 0, |
| 219 // Synchronous custom elements flag: |
| 220 // https://dom.spec.whatwg.org/#concept-create-element |
| 221 SynchronousCustomElements = 0 << 1, |
| 222 AsynchronousCustomElements = 1 << 1, |
| 223 |
| 224 // Aliases by callers. |
| 225 // Clone a node: https://dom.spec.whatwg.org/#concept-node-clone |
| 226 CreatedByCloneNode = AsynchronousCustomElements, |
| 227 CreatedByImportNode = CreatedByCloneNode, |
| 228 // https://dom.spec.whatwg.org/#dom-document-createelement |
| 229 CreatedByCreateElement = SynchronousCustomElements, |
| 230 // https://html.spec.whatwg.org/#create-an-element-for-the-token |
| 231 CreatedByFragmentParser = CreatedByParser | AsynchronousCustomElements, |
| 232 }; |
| 233 |
217 using DocumentClassFlags = unsigned char; | 234 using DocumentClassFlags = unsigned char; |
218 | 235 |
219 class CORE_EXPORT Document : public ContainerNode, public TreeScope, public Secu
rityContext, public ExecutionContext, public Supplementable<Document> { | 236 class CORE_EXPORT Document : public ContainerNode, public TreeScope, public Secu
rityContext, public ExecutionContext, public Supplementable<Document> { |
220 DEFINE_WRAPPERTYPEINFO(); | 237 DEFINE_WRAPPERTYPEINFO(); |
221 USING_GARBAGE_COLLECTED_MIXIN(Document); | 238 USING_GARBAGE_COLLECTED_MIXIN(Document); |
222 public: | 239 public: |
223 static Document* create(const DocumentInit& initializer = DocumentInit()) | 240 static Document* create(const DocumentInit& initializer = DocumentInit()) |
224 { | 241 { |
225 return new Document(initializer); | 242 return new Document(initializer); |
226 } | 243 } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 Element* createElement(const AtomicString& name, ExceptionState&); | 302 Element* createElement(const AtomicString& name, ExceptionState&); |
286 DocumentFragment* createDocumentFragment(); | 303 DocumentFragment* createDocumentFragment(); |
287 Text* createTextNode(const String& data); | 304 Text* createTextNode(const String& data); |
288 Comment* createComment(const String& data); | 305 Comment* createComment(const String& data); |
289 CDATASection* createCDATASection(const String& data, ExceptionState&); | 306 CDATASection* createCDATASection(const String& data, ExceptionState&); |
290 ProcessingInstruction* createProcessingInstruction(const String& target, con
st String& data, ExceptionState&); | 307 ProcessingInstruction* createProcessingInstruction(const String& target, con
st String& data, ExceptionState&); |
291 Attr* createAttribute(const AtomicString& name, ExceptionState&); | 308 Attr* createAttribute(const AtomicString& name, ExceptionState&); |
292 Attr* createAttributeNS(const AtomicString& namespaceURI, const AtomicString
& qualifiedName, ExceptionState&, bool shouldIgnoreNamespaceChecks = false); | 309 Attr* createAttributeNS(const AtomicString& namespaceURI, const AtomicString
& qualifiedName, ExceptionState&, bool shouldIgnoreNamespaceChecks = false); |
293 Node* importNode(Node* importedNode, bool deep, ExceptionState&); | 310 Node* importNode(Node* importedNode, bool deep, ExceptionState&); |
294 Element* createElementNS(const AtomicString& namespaceURI, const AtomicStrin
g& qualifiedName, ExceptionState&); | 311 Element* createElementNS(const AtomicString& namespaceURI, const AtomicStrin
g& qualifiedName, ExceptionState&); |
295 Element* createElement(const QualifiedName&, bool createdByParser); | 312 Element* createElement(const QualifiedName&, CreateElementFlags); |
296 | 313 |
297 Element* elementFromPoint(int x, int y) const; | 314 Element* elementFromPoint(int x, int y) const; |
298 HeapVector<Member<Element>> elementsFromPoint(int x, int y) const; | 315 HeapVector<Member<Element>> elementsFromPoint(int x, int y) const; |
299 Range* caretRangeFromPoint(int x, int y); | 316 Range* caretRangeFromPoint(int x, int y); |
300 Element* scrollingElement(); | 317 Element* scrollingElement(); |
301 VisualViewport* visualViewport(); | 318 VisualViewport* visualViewport(); |
302 | 319 |
303 String readyState() const; | 320 String readyState() const; |
304 | 321 |
305 AtomicString characterSet() const { return Document::encodingName(); } | 322 AtomicString characterSet() const { return Document::encodingName(); } |
(...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1437 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true); | 1454 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true); |
1438 | 1455 |
1439 } // namespace blink | 1456 } // namespace blink |
1440 | 1457 |
1441 #ifndef NDEBUG | 1458 #ifndef NDEBUG |
1442 // Outside the WebCore namespace for ease of invocation from gdb. | 1459 // Outside the WebCore namespace for ease of invocation from gdb. |
1443 CORE_EXPORT void showLiveDocumentInstances(); | 1460 CORE_EXPORT void showLiveDocumentInstances(); |
1444 #endif | 1461 #endif |
1445 | 1462 |
1446 #endif // Document_h | 1463 #endif // Document_h |
OLD | NEW |