Changeset 164248 in webkit
- Timestamp:
- Feb 17, 2014, 2:12:30 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/Source/WebCore/ChangeLog ¶
r164245 r164248 1 2014-02-17 Antti Koivisto <antti@apple.com> 2 3 Node constructor should take Document reference 4 https://bugs.webkit.org/show_bug.cgi?id=128931 5 6 Reviewed by Geoff Garen. 7 8 * dom/Attr.cpp: 9 (WebCore::Attr::Attr): 10 * dom/CharacterData.h: 11 (WebCore::CharacterData::CharacterData): 12 * dom/ContainerNode.cpp: 13 (WebCore::ContainerNode::~ContainerNode): 14 * dom/ContainerNode.h: 15 (WebCore::ContainerNode::ContainerNode): 16 * dom/Document.cpp: 17 (WebCore::Document::Document): 18 * dom/Document.h: 19 (WebCore::Node::Node): 20 * dom/DocumentFragment.cpp: 21 (WebCore::DocumentFragment::DocumentFragment): 22 (WebCore::DocumentFragment::create): 23 * dom/DocumentFragment.h: 24 * dom/DocumentType.cpp: 25 (WebCore::DocumentType::DocumentType): 26 * dom/Element.h: 27 (WebCore::Element::Element): 28 * dom/Entity.h: 29 (WebCore::Entity::Entity): 30 * dom/EntityReference.cpp: 31 (WebCore::EntityReference::EntityReference): 32 * dom/Node.cpp: 33 (WebCore::Node::~Node): 34 (WebCore::Node::willBeDeletedFrom): 35 * dom/Node.h: 36 * dom/Notation.cpp: 37 * dom/Notation.h: 38 (WebCore::Notation::publicId): 39 (WebCore::Notation::systemId): 40 (WebCore::Notation::Notation): 41 42 Remove cruft from this non-instantiated class. 43 44 * dom/ShadowRoot.cpp: 45 (WebCore::ShadowRoot::ShadowRoot): 46 (WebCore::ShadowRoot::~ShadowRoot): 47 * dom/TemplateContentDocumentFragment.h: 48 1 49 2014-02-17 Sergio Correia <sergio.correia@openbossa.org> 2 50 -
TabularUnified trunk/Source/WebCore/dom/Attr.cpp ¶
r159856 r164248 38 38 39 39 Attr::Attr(Element* element, const QualifiedName& name) 40 : ContainerNode( &element->document())40 : ContainerNode(element->document()) 41 41 , m_element(element) 42 42 , m_name(name) … … 46 46 47 47 Attr::Attr(Document& document, const QualifiedName& name, const AtomicString& standaloneValue) 48 : ContainerNode( &document)48 : ContainerNode(document) 49 49 , m_element(0) 50 50 , m_name(name) -
TabularUnified trunk/Source/WebCore/dom/CharacterData.h ¶
r162158 r164248 50 50 protected: 51 51 CharacterData(Document& document, const String& text, ConstructionType type) 52 : Node( &document, type)52 : Node(document, type) 53 53 , m_data(!text.isNull() ? text : emptyString()) 54 54 { -
TabularUnified trunk/Source/WebCore/dom/ContainerNode.cpp ¶
r164195 r164248 151 151 ContainerNode::~ContainerNode() 152 152 { 153 willBeDeletedFrom( &document());153 willBeDeletedFrom(document()); 154 154 removeDetachedChildren(); 155 155 } -
TabularUnified trunk/Source/WebCore/dom/ContainerNode.h ¶
r163754 r164248 139 139 140 140 protected: 141 explicit ContainerNode(Document *, ConstructionType = CreateContainer);141 explicit ContainerNode(Document&, ConstructionType = CreateContainer); 142 142 143 143 static void queuePostAttachCallback(NodeCallback, Node&, unsigned = 0); … … 183 183 NODE_TYPE_CASTS(ContainerNode) 184 184 185 inline ContainerNode::ContainerNode(Document *document, ConstructionType type)185 inline ContainerNode::ContainerNode(Document& document, ConstructionType type) 186 186 : Node(document, type) 187 187 , m_firstChild(0) -
TabularUnified trunk/Source/WebCore/dom/Document.cpp ¶
r164242 r164248 394 394 395 395 Document::Document(Frame* frame, const URL& url, unsigned documentClasses, unsigned constructionFlags) 396 : ContainerNode( this, CreateDocument)396 : ContainerNode(*this, CreateDocument) 397 397 , TreeScope(*this) 398 398 #if ENABLE(TOUCH_EVENTS) && PLATFORM(IOS) -
TabularUnified trunk/Source/WebCore/dom/Document.h ¶
r164242 r164248 1709 1709 } 1710 1710 1711 inline Node::Node(Document *document, ConstructionType type)1711 inline Node::Node(Document& document, ConstructionType type) 1712 1712 : m_nodeFlags(type) 1713 1713 , m_parentNode(0) 1714 , m_treeScope( document)1714 , m_treeScope(&document) 1715 1715 , m_previous(0) 1716 1716 , m_next(0) 1717 1717 { 1718 document ->incrementReferencingNodeCount();1718 document.incrementReferencingNodeCount(); 1719 1719 1720 1720 #if !defined(NDEBUG) || (defined(DUMP_NODE_STATISTICS) && DUMP_NODE_STATISTICS) -
TabularUnified trunk/Source/WebCore/dom/DocumentFragment.cpp ¶
r162062 r164248 32 32 namespace WebCore { 33 33 34 DocumentFragment::DocumentFragment(Document *document, ConstructionType constructionType)34 DocumentFragment::DocumentFragment(Document& document, ConstructionType constructionType) 35 35 : ContainerNode(document, constructionType) 36 36 { … … 39 39 PassRefPtr<DocumentFragment> DocumentFragment::create(Document& document) 40 40 { 41 return adoptRef(new DocumentFragment( &document, Node::CreateDocumentFragment));41 return adoptRef(new DocumentFragment(document, Node::CreateDocumentFragment)); 42 42 } 43 43 44 44 PassRefPtr<DocumentFragment> DocumentFragment::create(ScriptExecutionContext& context) 45 45 { 46 return adoptRef(new DocumentFragment( &toDocument(context), Node::CreateDocumentFragment));46 return adoptRef(new DocumentFragment(toDocument(context), Node::CreateDocumentFragment)); 47 47 } 48 48 -
TabularUnified trunk/Source/WebCore/dom/DocumentFragment.h ¶
r162139 r164248 44 44 45 45 protected: 46 DocumentFragment(Document *, ConstructionType = CreateContainer);46 DocumentFragment(Document&, ConstructionType = CreateContainer); 47 47 virtual String nodeName() const override; 48 48 -
TabularUnified trunk/Source/WebCore/dom/DocumentType.cpp ¶
r156550 r164248 30 30 31 31 DocumentType::DocumentType(Document& document, const String& name, const String& publicId, const String& systemId) 32 : Node( &document, CreateOther)32 : Node(document, CreateOther) 33 33 , m_name(name) 34 34 , m_publicId(publicId) -
TabularUnified trunk/Source/WebCore/dom/Element.h ¶
r164176 r164248 570 570 protected: 571 571 Element(const QualifiedName& tagName, Document& document, ConstructionType type) 572 : ContainerNode( &document, type)572 : ContainerNode(document, type) 573 573 , m_tagName(tagName) 574 574 { -
TabularUnified trunk/Source/WebCore/dom/Entity.h ¶
r34336 r164248 36 36 37 37 private: 38 Entity() : ContainerNode(0) {} 38 Entity(Document& document) 39 : ContainerNode(document) 40 { } 39 41 }; 40 42 -
TabularUnified trunk/Source/WebCore/dom/EntityReference.cpp ¶
r155808 r164248 27 27 28 28 inline EntityReference::EntityReference(Document& document, const String& entityName) 29 : ContainerNode( &document)29 : ContainerNode(document) 30 30 , m_entityName(entityName) 31 31 { -
TabularUnified trunk/Source/WebCore/dom/Node.cpp ¶
r164242 r164248 307 307 308 308 if (!isContainerNode()) 309 willBeDeletedFrom( &document());309 willBeDeletedFrom(document()); 310 310 311 311 document().decrementReferencingNodeCount(); … … 314 314 } 315 315 316 void Node::willBeDeletedFrom(Document *document)316 void Node::willBeDeletedFrom(Document& document) 317 317 { 318 318 if (hasEventTargetData()) { 319 319 #if ENABLE(TOUCH_EVENTS) && PLATFORM(IOS) 320 if (document) 321 document->removeTouchEventListener(this, true); 320 document.removeTouchEventListener(this, true); 322 321 #endif 323 322 clearEventTargetData(); 324 323 } 325 324 326 if (document) { 327 if (AXObjectCache* cache = document->existingAXObjectCache()) 328 cache->remove(this); 329 } 325 if (AXObjectCache* cache = document.existingAXObjectCache()) 326 cache->remove(this); 330 327 } 331 328 -
TabularUnified trunk/Source/WebCore/dom/Node.h ¶
r164195 r164248 154 154 155 155 virtual ~Node(); 156 void willBeDeletedFrom(Document *);156 void willBeDeletedFrom(Document&); 157 157 158 158 // DOM methods & attributes for Node … … 625 625 CreateMathMLElement = CreateStyledElement | IsMathMLFlag, 626 626 }; 627 Node(Document *, ConstructionType);627 Node(Document&, ConstructionType); 628 628 629 629 virtual void didMoveToNewDocument(Document* oldDocument); -
TabularUnified trunk/Source/WebCore/dom/Notation.cpp ¶
r155808 r164248 1 /* 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com) 3 * Copyright (C) 2006, 2009 Apple Inc. All rights reserved. 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Library General Public 7 * License as published by the Free Software Foundation; either 8 * version 2 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Library General Public License for more details. 14 * 15 * You should have received a copy of the GNU Library General Public License 16 * along with this library; see the file COPYING.LIB. If not, write to 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 * Boston, MA 02110-1301, USA. 19 */ 20 21 #include "config.h" 22 #include "Notation.h" 23 24 #include "Document.h" 25 26 namespace WebCore { 27 28 Notation::Notation(Document& document, const String& name, const String& publicId, const String& systemId) 29 : ContainerNode(&document) 30 , m_name(name) 31 , m_publicId(publicId) 32 , m_systemId(systemId) 33 { 34 } 35 36 String Notation::nodeName() const 37 { 38 return m_name; 39 } 40 41 Node::NodeType Notation::nodeType() const 42 { 43 return NOTATION_NODE; 44 } 45 46 PassRefPtr<Node> Notation::cloneNode(bool /*deep*/) 47 { 48 // Spec says cloning Notation nodes is "implementation dependent". We do not support it. 49 return 0; 50 } 51 52 bool Notation::childTypeAllowed(NodeType) const 53 { 54 return false; 55 } 56 57 } // namespace 1 // FIXME: remove me -
TabularUnified trunk/Source/WebCore/dom/Notation.h ¶
r162180 r164248 29 29 // FIXME: This class is never instantiated. Maybe it should be removed. 30 30 31 class Notation final: public ContainerNode {31 class Notation : public ContainerNode { 32 32 public: 33 const String& publicId() const { return m_publicId; }34 const String& systemId() const { return m_systemId; }33 String publicId() const { ASSERT_NOT_REACHED(); return String(); } 34 String systemId() const { ASSERT_NOT_REACHED(); return String(); } 35 35 36 36 private: 37 Notation(Document&, const String& name, const String& publicId, const String& systemId); 38 39 virtual String nodeName() const override; 40 virtual NodeType nodeType() const override; 41 virtual PassRefPtr<Node> cloneNode(bool deep) override; 42 virtual bool childTypeAllowed(NodeType) const override; 43 44 String m_name; 45 String m_publicId; 46 String m_systemId; 37 Notation(Document& document) 38 : ContainerNode(document) 39 { } 47 40 }; 48 41 -
TabularUnified trunk/Source/WebCore/dom/ShadowRoot.cpp ¶
r164195 r164248 53 53 54 54 ShadowRoot::ShadowRoot(Document& document, ShadowRootType type) 55 : DocumentFragment( &document, CreateShadowRoot)55 : DocumentFragment(document, CreateShadowRoot) 56 56 , TreeScope(*this, document) 57 57 , m_resetStyleInheritance(false) … … 67 67 // clears Node::m_treeScope thus ContainerNode is no longer able 68 68 // to access it Document reference after that. 69 willBeDeletedFrom( &document());69 willBeDeletedFrom(document()); 70 70 71 71 // We must remove all of our children first before the TreeScope destructor -
TabularUnified trunk/Source/WebCore/dom/TemplateContentDocumentFragment.h ¶
r162158 r164248 46 46 private: 47 47 TemplateContentDocumentFragment(Document& document, const Element* host) 48 : DocumentFragment( &document, CreateDocumentFragment)48 : DocumentFragment(document, CreateDocumentFragment) 49 49 , m_host(host) 50 50 {
Note:
See TracChangeset
for help on using the changeset viewer.