Ref-ify various Document-related things.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Dec 2014 03:11:36 +0000 (03:11 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Dec 2014 03:11:36 +0000 (03:11 +0000)
<https://webkit.org/b/139796>

Reviewed by Anders Carlsson.

Source/WebCore:

* bindings/objc/DOMHTML.mm:
(-[DOMHTMLDocument createDocumentFragmentWithText:]):
* dom/CDATASection.cpp:
(WebCore::CDATASection::create):
(WebCore::CDATASection::virtualCreate):
* dom/CDATASection.h:
* dom/Comment.cpp:
(WebCore::Comment::create):
* dom/Comment.h:
* dom/Document.cpp:
(WebCore::Document::create):
(WebCore::Document::createDocumentFragment):
(WebCore::Document::createTextNode):
(WebCore::Document::createComment):
(WebCore::Document::createEditingTextNode):
(WebCore::Document::createCSSStyleDeclaration):
(WebCore::Document::createElement):
(WebCore::Document::createRange):
(WebCore::Document::createParser):
(WebCore::Document::cloneNodeInternal):
(WebCore::Document::cloneDocumentWithoutChildren):
* dom/Document.h:
(WebCore::Document::create):
(WebCore::Document::createXHTML):
(WebCore::Document::createNonRenderedPlaceholder):
* dom/DocumentFragment.cpp:
(WebCore::DocumentFragment::create):
* dom/DocumentFragment.h:
* dom/DocumentType.h:
* dom/EntityReference.cpp:
(WebCore::EntityReference::create):
* dom/EntityReference.h:
* dom/Text.cpp:
(WebCore::Text::create):
(WebCore::Text::createEditingText):
(WebCore::Text::splitText):
(WebCore::Text::virtualCreate):
(WebCore::Text::createWithLengthLimit):
* dom/Text.h:
* editing/markup.cpp:
(WebCore::replaceChildrenWithText):
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocument::createParser):
* html/FTPDirectoryDocument.h:
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::createParser):
(WebCore::HTMLDocument::cloneDocumentWithoutChildren):
* html/HTMLDocument.h:
(WebCore::HTMLDocument::create):
(WebCore::HTMLDocument::createSynthesizedDocument):
* html/ImageDocument.cpp:
(WebCore::ImageDocument::createParser):
* html/ImageDocument.h:
* html/MediaDocument.cpp:
(WebCore::MediaDocument::createParser):
* html/MediaDocument.h:
* html/PluginDocument.cpp:
(WebCore::PluginDocument::createParser):
* html/PluginDocument.h:
* html/TextDocument.cpp:
(WebCore::TextDocument::createParser):
* html/TextDocument.h:
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::insertTextNode):
* html/parser/HTMLDocumentParser.h:
(WebCore::HTMLDocumentParser::create):
* loader/SinkDocument.cpp:
(WebCore::SinkDocument::createParser):
* loader/SinkDocument.h:
* svg/SVGDocument.cpp:
(WebCore::SVGDocument::cloneDocumentWithoutChildren):
* svg/SVGDocument.h:
* xml/parser/XMLDocumentParser.h:
(WebCore::XMLDocumentParser::create):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLParserContext::createStringParser):
(WebCore::XMLParserContext::createMemoryParser):

Source/WebKit/mac:

* WebView/WebFrame.mm:
(-[WebFrame _replaceSelectionWithNode:selectReplacement:smartReplace:matchStyle:]):

Source/WebKit2:

* WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
(-[WKDOMDocument createTextNode:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@177559 268f45cc-cd09-0410-ab3c-d52691b4dbfc

41 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/objc/DOMHTML.mm
Source/WebCore/dom/CDATASection.cpp
Source/WebCore/dom/CDATASection.h
Source/WebCore/dom/Comment.cpp
Source/WebCore/dom/Comment.h
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/DocumentFragment.cpp
Source/WebCore/dom/DocumentFragment.h
Source/WebCore/dom/DocumentType.h
Source/WebCore/dom/EntityReference.cpp
Source/WebCore/dom/EntityReference.h
Source/WebCore/dom/Text.cpp
Source/WebCore/dom/Text.h
Source/WebCore/editing/markup.cpp
Source/WebCore/html/FTPDirectoryDocument.cpp
Source/WebCore/html/FTPDirectoryDocument.h
Source/WebCore/html/HTMLDocument.cpp
Source/WebCore/html/HTMLDocument.h
Source/WebCore/html/ImageDocument.cpp
Source/WebCore/html/ImageDocument.h
Source/WebCore/html/MediaDocument.cpp
Source/WebCore/html/MediaDocument.h
Source/WebCore/html/PluginDocument.cpp
Source/WebCore/html/PluginDocument.h
Source/WebCore/html/TextDocument.cpp
Source/WebCore/html/TextDocument.h
Source/WebCore/html/parser/HTMLConstructionSite.cpp
Source/WebCore/html/parser/HTMLDocumentParser.h
Source/WebCore/html/parser/TextDocumentParser.h
Source/WebCore/loader/SinkDocument.cpp
Source/WebCore/loader/SinkDocument.h
Source/WebCore/svg/SVGDocument.cpp
Source/WebCore/svg/SVGDocument.h
Source/WebCore/xml/parser/XMLDocumentParser.h
Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebFrame.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm

index db28dd2..2d5a466 100644 (file)
@@ -1,3 +1,88 @@
+2014-12-18  Andreas Kling  <akling@apple.com>
+
+        Ref-ify various Document-related things.
+        <https://webkit.org/b/139796>
+
+        Reviewed by Anders Carlsson.
+
+        * bindings/objc/DOMHTML.mm:
+        (-[DOMHTMLDocument createDocumentFragmentWithText:]):
+        * dom/CDATASection.cpp:
+        (WebCore::CDATASection::create):
+        (WebCore::CDATASection::virtualCreate):
+        * dom/CDATASection.h:
+        * dom/Comment.cpp:
+        (WebCore::Comment::create):
+        * dom/Comment.h:
+        * dom/Document.cpp:
+        (WebCore::Document::create):
+        (WebCore::Document::createDocumentFragment):
+        (WebCore::Document::createTextNode):
+        (WebCore::Document::createComment):
+        (WebCore::Document::createEditingTextNode):
+        (WebCore::Document::createCSSStyleDeclaration):
+        (WebCore::Document::createElement):
+        (WebCore::Document::createRange):
+        (WebCore::Document::createParser):
+        (WebCore::Document::cloneNodeInternal):
+        (WebCore::Document::cloneDocumentWithoutChildren):
+        * dom/Document.h:
+        (WebCore::Document::create):
+        (WebCore::Document::createXHTML):
+        (WebCore::Document::createNonRenderedPlaceholder):
+        * dom/DocumentFragment.cpp:
+        (WebCore::DocumentFragment::create):
+        * dom/DocumentFragment.h:
+        * dom/DocumentType.h:
+        * dom/EntityReference.cpp:
+        (WebCore::EntityReference::create):
+        * dom/EntityReference.h:
+        * dom/Text.cpp:
+        (WebCore::Text::create):
+        (WebCore::Text::createEditingText):
+        (WebCore::Text::splitText):
+        (WebCore::Text::virtualCreate):
+        (WebCore::Text::createWithLengthLimit):
+        * dom/Text.h:
+        * editing/markup.cpp:
+        (WebCore::replaceChildrenWithText):
+        * html/FTPDirectoryDocument.cpp:
+        (WebCore::FTPDirectoryDocument::createParser):
+        * html/FTPDirectoryDocument.h:
+        * html/HTMLDocument.cpp:
+        (WebCore::HTMLDocument::createParser):
+        (WebCore::HTMLDocument::cloneDocumentWithoutChildren):
+        * html/HTMLDocument.h:
+        (WebCore::HTMLDocument::create):
+        (WebCore::HTMLDocument::createSynthesizedDocument):
+        * html/ImageDocument.cpp:
+        (WebCore::ImageDocument::createParser):
+        * html/ImageDocument.h:
+        * html/MediaDocument.cpp:
+        (WebCore::MediaDocument::createParser):
+        * html/MediaDocument.h:
+        * html/PluginDocument.cpp:
+        (WebCore::PluginDocument::createParser):
+        * html/PluginDocument.h:
+        * html/TextDocument.cpp:
+        (WebCore::TextDocument::createParser):
+        * html/TextDocument.h:
+        * html/parser/HTMLConstructionSite.cpp:
+        (WebCore::HTMLConstructionSite::insertTextNode):
+        * html/parser/HTMLDocumentParser.h:
+        (WebCore::HTMLDocumentParser::create):
+        * loader/SinkDocument.cpp:
+        (WebCore::SinkDocument::createParser):
+        * loader/SinkDocument.h:
+        * svg/SVGDocument.cpp:
+        (WebCore::SVGDocument::cloneDocumentWithoutChildren):
+        * svg/SVGDocument.h:
+        * xml/parser/XMLDocumentParser.h:
+        (WebCore::XMLDocumentParser::create):
+        * xml/parser/XMLDocumentParserLibxml2.cpp:
+        (WebCore::XMLParserContext::createStringParser):
+        (WebCore::XMLParserContext::createMemoryParser):
+
 2014-12-18  Anders Carlsson  <andersca@apple.com>
 
         Use MachSendRight in WebKit2
index d6c4ddf..41c8337 100644 (file)
@@ -152,7 +152,7 @@ using namespace WebCore;
 - (DOMDocumentFragment *)createDocumentFragmentWithText:(NSString *)text
 {
     // FIXME: Since this is not a contextual fragment, it won't handle whitespace properly.
-    return kit(createFragmentFromText(*core(self)->createRange().get(), text).get());
+    return kit(createFragmentFromText(core(self)->createRange(), text).get());
 }
 
 @end
index 52b9faf..c59bf1e 100644 (file)
@@ -31,9 +31,9 @@ inline CDATASection::CDATASection(Document& document, const String& data)
 {
 }
 
-RefPtr<CDATASection> CDATASection::create(Document& document, const String& data)
+Ref<CDATASection> CDATASection::create(Document& document, const String& data)
 {
-    return adoptRef(new CDATASection(document, data));
+    return adoptRef(*new CDATASection(document, data));
 }
 
 String CDATASection::nodeName() const
@@ -56,7 +56,7 @@ bool CDATASection::childTypeAllowed(NodeType) const
     return false;
 }
 
-RefPtr<Text> CDATASection::virtualCreate(const String& data)
+Ref<Text> CDATASection::virtualCreate(const String& data)
 {
     return create(document(), data);
 }
index c78ea8a..bf5a61c 100644 (file)
@@ -29,7 +29,7 @@ namespace WebCore {
 
 class CDATASection final : public Text {
 public:
-    static RefPtr<CDATASection> create(Document&, const String&);
+    static Ref<CDATASection> create(Document&, const String&);
 
 private:
     CDATASection(Document&, const String&);
@@ -38,7 +38,7 @@ private:
     virtual NodeType nodeType() const override;
     virtual RefPtr<Node> cloneNodeInternal(Document&, CloningOperation) override;
     virtual bool childTypeAllowed(NodeType) const override;
-    virtual RefPtr<Text> virtualCreate(const String&) override;
+    virtual Ref<Text> virtualCreate(const String&) override;
 };
 
 } // namespace WebCore
index e0fb717..49f5405 100644 (file)
@@ -31,14 +31,14 @@ inline Comment::Comment(Document& document, const String& text)
 {
 }
 
-RefPtr<Comment> Comment::create(Document& document, const String& text)
+Ref<Comment> Comment::create(Document& document, const String& text)
 {
-    return adoptRef(new Comment(document, text));
+    return adoptRef(*new Comment(document, text));
 }
 
-RefPtr<Comment> Comment::create(ScriptExecutionContext& context, const String& text)
+Ref<Comment> Comment::create(ScriptExecutionContext& context, const String& text)
 {
-    return adoptRef(new Comment(downcast<Document>(context), text));
+    return adoptRef(*new Comment(downcast<Document>(context), text));
 }
 
 String Comment::nodeName() const
index c692806..3f44e56 100644 (file)
@@ -29,8 +29,8 @@ namespace WebCore {
 
 class Comment final : public CharacterData {
 public:
-    static RefPtr<Comment> create(Document&, const String&);
-    static RefPtr<Comment> create(ScriptExecutionContext&, const String&);
+    static Ref<Comment> create(Document&, const String&);
+    static Ref<Comment> create(ScriptExecutionContext&, const String&);
 
 private:
     Comment(Document&, const String&);
index bfe1c5c..0e1a5fd 100644 (file)
@@ -564,11 +564,11 @@ static bool isAttributeOnAllOwners(const WebCore::QualifiedName& attribute, cons
 }
 #endif
 
-RefPtr<Document> Document::create(ScriptExecutionContext& context)
+Ref<Document> Document::create(ScriptExecutionContext& context)
 {
-    RefPtr<Document> document = adoptRef(new Document(nullptr, URL()));
+    Ref<Document> document = adoptRef(*new Document(nullptr, URL()));
     document->setSecurityOrigin(context.securityOrigin());
-    return document.release();
+    return document;
 }
 
 Document::~Document()
@@ -860,17 +860,17 @@ RefPtr<Element> Document::createElement(const AtomicString& name, ExceptionCode&
     return createElement(QualifiedName(nullAtom, name, nullAtom), false);
 }
 
-RefPtr<DocumentFragment> Document::createDocumentFragment()
+Ref<DocumentFragment> Document::createDocumentFragment()
 {
     return DocumentFragment::create(document());
 }
 
-RefPtr<Text> Document::createTextNode(const String& data)
+Ref<Text> Document::createTextNode(const String& data)
 {
     return Text::create(*this, data);
 }
 
-RefPtr<Comment> Document::createComment(const String& data)
+Ref<Comment> Document::createComment(const String& data)
 {
     return Comment::create(*this, data);
 }
@@ -910,15 +910,15 @@ RefPtr<EntityReference> Document::createEntityReference(const String& name, Exce
     return EntityReference::create(*this, name);
 }
 
-RefPtr<Text> Document::createEditingTextNode(const String& text)
+Ref<Text> Document::createEditingTextNode(const String& text)
 {
     return Text::createEditingText(*this, text);
 }
 
-RefPtr<CSSStyleDeclaration> Document::createCSSStyleDeclaration()
+Ref<CSSStyleDeclaration> Document::createCSSStyleDeclaration()
 {
     Ref<MutableStyleProperties> propertySet(MutableStyleProperties::create());
-    return propertySet->ensureCSSStyleDeclaration();
+    return *propertySet->ensureCSSStyleDeclaration();
 }
 
 RefPtr<Node> Document::importNode(Node* importedNode, bool deep, ExceptionCode& ec)
@@ -1031,7 +1031,7 @@ bool Document::hasValidNamespaceForAttributes(const QualifiedName& qName)
 }
 
 // FIXME: This should really be in a possible ElementFactory class.
-RefPtr<Element> Document::createElement(const QualifiedName& name, bool createdByParser)
+Ref<Element> Document::createElement(const QualifiedName& name, bool createdByParser)
 {
     RefPtr<Element> element;
 
@@ -1053,7 +1053,7 @@ RefPtr<Element> Document::createElement(const QualifiedName& name, bool createdB
     // <image> uses imgTag so we need a special rule.
     ASSERT((name.matches(imageTag) && element->tagQName().matches(imgTag) && element->tagQName().prefix() == name.prefix()) || name == element->tagQName());
 
-    return element.release();
+    return element.releaseNonNull();
 }
 
 bool Document::cssRegionsEnabled() const
@@ -1652,7 +1652,7 @@ Settings* Document::settings() const
     return m_frame ? &m_frame->settings() : nullptr;
 }
 
-RefPtr<Range> Document::createRange()
+Ref<Range> Document::createRange()
 {
     return Range::create(*this);
 }
@@ -2218,7 +2218,7 @@ void Document::setVisuallyOrdered()
         renderView()->style().setRTLOrdering(VisualOrder);
 }
 
-RefPtr<DocumentParser> Document::createParser()
+Ref<DocumentParser> Document::createParser()
 {
     // FIXME: this should probably pass the frame instead
     return XMLDocumentParser::create(*this, view());
@@ -3163,20 +3163,20 @@ bool Document::canReplaceChild(Node* newChild, Node* oldChild)
 
 RefPtr<Node> Document::cloneNodeInternal(Document&, CloningOperation type)
 {
-    RefPtr<Document> clone = cloneDocumentWithoutChildren();
+    Ref<Document> clone = cloneDocumentWithoutChildren();
     clone->cloneDataFromDocument(*this);
     switch (type) {
     case CloningOperation::OnlySelf:
     case CloningOperation::SelfWithTemplateContent:
         break;
     case CloningOperation::Everything:
-        cloneChildNodes(clone.get());
+        cloneChildNodes(clone.ptr());
         break;
     }
-    return clone;
+    return WTF::move(clone);
 }
 
-RefPtr<Document> Document::cloneDocumentWithoutChildren() const
+Ref<Document> Document::cloneDocumentWithoutChildren() const
 {
     return isXHTMLDocument() ? createXHTML(nullptr, url()) : create(nullptr, url());
 }
index 4a7fef2..ec48f2a 100644 (file)
@@ -257,19 +257,19 @@ enum class DocumentCompatibilityMode : unsigned char {
 
 class Document : public ContainerNode, public TreeScope, public ScriptExecutionContext {
 public:
-    static RefPtr<Document> create(Frame* frame, const URL& url)
+    static Ref<Document> create(Frame* frame, const URL& url)
     {
-        return adoptRef(new Document(frame, url));
+        return adoptRef(*new Document(frame, url));
     }
-    static RefPtr<Document> createXHTML(Frame* frame, const URL& url)
+    static Ref<Document> createXHTML(Frame* frame, const URL& url)
     {
-        return adoptRef(new Document(frame, url, XHTMLDocumentClass));
+        return adoptRef(*new Document(frame, url, XHTMLDocumentClass));
     }
-    static RefPtr<Document> createNonRenderedPlaceholder(Frame* frame, const URL& url)
+    static Ref<Document> createNonRenderedPlaceholder(Frame* frame, const URL& url)
     {
-        return adoptRef(new Document(frame, url, DefaultDocumentClass, NonRenderedPlaceholder));
+        return adoptRef(*new Document(frame, url, DefaultDocumentClass, NonRenderedPlaceholder));
     }
-    static RefPtr<Document> create(ScriptExecutionContext&);
+    static Ref<Document> create(ScriptExecutionContext&);
 
     virtual ~Document();
 
@@ -422,9 +422,9 @@ public:
     bool hasManifest() const;
     
     virtual RefPtr<Element> createElement(const AtomicString& tagName, ExceptionCode&);
-    WEBCORE_EXPORT RefPtr<DocumentFragment> createDocumentFragment();
-    WEBCORE_EXPORT RefPtr<Text> createTextNode(const String& data);
-    RefPtr<Comment> createComment(const String& data);
+    WEBCORE_EXPORT Ref<DocumentFragment> createDocumentFragment();
+    WEBCORE_EXPORT Ref<Text> createTextNode(const String& data);
+    Ref<Comment> createComment(const String& data);
     RefPtr<CDATASection> createCDATASection(const String& data, ExceptionCode&);
     RefPtr<ProcessingInstruction> createProcessingInstruction(const String& target, const String& data, ExceptionCode&);
     RefPtr<Attr> createAttribute(const String& name, ExceptionCode&);
@@ -433,7 +433,7 @@ public:
     RefPtr<Node> importNode(Node* importedNode, ExceptionCode& ec) { return importNode(importedNode, true, ec); }
     RefPtr<Node> importNode(Node* importedNode, bool deep, ExceptionCode&);
     WEBCORE_EXPORT RefPtr<Element> createElementNS(const String& namespaceURI, const String& qualifiedName, ExceptionCode&);
-    WEBCORE_EXPORT RefPtr<Element> createElement(const QualifiedName&, bool createdByParser);
+    WEBCORE_EXPORT Ref<Element> createElement(const QualifiedName&, bool createdByParser);
 
     bool cssRegionsEnabled() const;
     bool cssCompositingEnabled() const;
@@ -582,7 +582,7 @@ public:
 
     float deviceScaleFactor() const;
 
-    WEBCORE_EXPORT RefPtr<Range> createRange();
+    WEBCORE_EXPORT Ref<Range> createRange();
 
     RefPtr<NodeIterator> createNodeIterator(Node* root, unsigned whatToShow,
         PassRefPtr<NodeFilter>, bool expandEntityReferences, ExceptionCode&);
@@ -591,8 +591,8 @@ public:
         PassRefPtr<NodeFilter>, bool expandEntityReferences, ExceptionCode&);
 
     // Special support for editing
-    RefPtr<CSSStyleDeclaration> createCSSStyleDeclaration();
-    RefPtr<Text> createEditingTextNode(const String&);
+    Ref<CSSStyleDeclaration> createCSSStyleDeclaration();
+    Ref<Text> createEditingTextNode(const String&);
 
     void recalcStyle(Style::Change = Style::NoChange);
     WEBCORE_EXPORT void updateStyleIfNeeded();
@@ -689,7 +689,7 @@ public:
 
     CSSStyleSheet& elementSheet();
     
-    virtual RefPtr<DocumentParser> createParser();
+    virtual Ref<DocumentParser> createParser();
     DocumentParser* parser() const { return m_parser.get(); }
     ScriptableDocumentParser* scriptableDocumentParser() const;
     
@@ -1287,7 +1287,7 @@ protected:
 
     void clearXMLVersion() { m_xmlVersion = String(); }
 
-    virtual RefPtr<Document> cloneDocumentWithoutChildren() const;
+    virtual Ref<Document> cloneDocumentWithoutChildren() const;
 
 private:
     friend class Node;
index 6fe0378..a0190e4 100644 (file)
@@ -36,14 +36,14 @@ DocumentFragment::DocumentFragment(Document& document, ConstructionType construc
 {
 }
 
-RefPtr<DocumentFragment> DocumentFragment::create(Document& document)
+Ref<DocumentFragment> DocumentFragment::create(Document& document)
 {
-    return adoptRef(new DocumentFragment(document, Node::CreateDocumentFragment));
+    return adoptRef(*new DocumentFragment(document, Node::CreateDocumentFragment));
 }
 
-RefPtr<DocumentFragment> DocumentFragment::create(ScriptExecutionContext& context)
+Ref<DocumentFragment> DocumentFragment::create(ScriptExecutionContext& context)
 {
-    return adoptRef(new DocumentFragment(downcast<Document>(context), Node::CreateDocumentFragment));
+    return adoptRef(*new DocumentFragment(downcast<Document>(context), Node::CreateDocumentFragment));
 }
 
 String DocumentFragment::nodeName() const
index a9d4e69..11998ff 100644 (file)
@@ -33,8 +33,8 @@ class ScriptExecutionContext;
 
 class DocumentFragment : public ContainerNode {
 public:
-    static RefPtr<DocumentFragment> create(Document&);
-    static RefPtr<DocumentFragment> create(ScriptExecutionContext&);
+    static Ref<DocumentFragment> create(Document&);
+    static Ref<DocumentFragment> create(ScriptExecutionContext&);
 
     void parseHTML(const String&, Element* contextElement, ParserContentPolicy = AllowScriptingContent);
     bool parseXML(const String&, Element* contextElement, ParserContentPolicy = AllowScriptingContent);
index 63f9128..c7a1d9b 100644 (file)
@@ -32,9 +32,9 @@ class NamedNodeMap;
 
 class DocumentType final : public Node {
 public:
-    static RefPtr<DocumentType> create(Document& document, const String& name, const String& publicId, const String& systemId)
+    static Ref<DocumentType> create(Document& document, const String& name, const String& publicId, const String& systemId)
     {
-        return adoptRef(new DocumentType(document, name, publicId, systemId));
+        return adoptRef(*new DocumentType(document, name, publicId, systemId));
     }
 
     // FIXME: We return null entities and notations. Current implementation of NamedNodeMap doesn't work without an associated Element yet.
index 88ad688..a2ff63b 100644 (file)
@@ -31,9 +31,9 @@ inline EntityReference::EntityReference(Document& document, const String& entity
 {
 }
 
-RefPtr<EntityReference> EntityReference::create(Document& document, const String& entityName)
+Ref<EntityReference> EntityReference::create(Document& document, const String& entityName)
 {
-    return adoptRef(new EntityReference(document, entityName));
+    return adoptRef(*new EntityReference(document, entityName));
 }
 
 String EntityReference::nodeName() const
index 5e8da8d..03f43cd 100644 (file)
@@ -28,7 +28,7 @@ namespace WebCore {
 
 class EntityReference final : public ContainerNode {
 public:
-    static RefPtr<EntityReference> create(Document&, const String& entityName);
+    static Ref<EntityReference> create(Document&, const String& entityName);
 
 private:
     EntityReference(Document&, const String& entityName);
index 70697a4..2b5e964 100644 (file)
 
 namespace WebCore {
 
-RefPtr<Text> Text::create(Document& document, const String& data)
+Ref<Text> Text::create(Document& document, const String& data)
 {
-    return adoptRef(new Text(document, data, CreateText));
+    return adoptRef(*new Text(document, data, CreateText));
 }
 
-RefPtr<Text> Text::create(ScriptExecutionContext& context, const String& data)
+Ref<Text> Text::create(ScriptExecutionContext& context, const String& data)
 {
-    return adoptRef(new Text(downcast<Document>(context), data, CreateText));
+    return adoptRef(*new Text(downcast<Document>(context), data, CreateText));
 }
 
-RefPtr<Text> Text::createEditingText(Document& document, const String& data)
+Ref<Text> Text::createEditingText(Document& document, const String& data)
 {
-    return adoptRef(new Text(document, data, CreateEditingText));
+    return adoptRef(*new Text(document, data, CreateEditingText));
 }
 
 Text::~Text()
@@ -71,13 +71,13 @@ RefPtr<Text> Text::splitText(unsigned offset, ExceptionCode& ec)
 
     EventQueueScope scope;
     String oldStr = data();
-    RefPtr<Text> newText = virtualCreate(oldStr.substring(offset));
+    Ref<Text> newText = virtualCreate(oldStr.substring(offset));
     setDataWithoutUpdate(oldStr.substring(0, offset));
 
     dispatchModifiedEvent(oldStr);
 
     if (parentNode())
-        parentNode()->insertBefore(newText.get(), nextSibling(), ec);
+        parentNode()->insertBefore(newText.ptr(), nextSibling(), ec);
     if (ec)
         return 0;
 
@@ -87,7 +87,7 @@ RefPtr<Text> Text::splitText(unsigned offset, ExceptionCode& ec)
     if (renderer())
         renderer()->setTextWithOffset(dataImpl(), 0, oldStr.length());
 
-    return newText.release();
+    return WTF::move(newText);
 }
 
 static const Text* earliestLogicallyAdjacentTextNode(const Text* text)
@@ -203,21 +203,20 @@ bool Text::childTypeAllowed(NodeType) const
     return false;
 }
 
-RefPtr<Text> Text::virtualCreate(const String& data)
+Ref<Text> Text::virtualCreate(const String& data)
 {
     return create(document(), data);
 }
 
-RefPtr<Text> Text::createWithLengthLimit(Document& document, const String& data, unsigned start, unsigned lengthLimit)
+Ref<Text> Text::createWithLengthLimit(Document& document, const String& data, unsigned start, unsigned lengthLimit)
 {
     unsigned dataLength = data.length();
 
     if (!start && dataLength <= lengthLimit)
         return create(document, data);
 
-    RefPtr<Text> result = Text::create(document, String());
+    Ref<Text> result = Text::create(document, String());
     result->parserAppendData(data, start, lengthLimit);
-
     return result;
 }
 
index 2b3d407..91cdef7 100644 (file)
@@ -35,10 +35,10 @@ class Text : public CharacterData {
 public:
     static const unsigned defaultLengthLimit = 1 << 16;
 
-    static RefPtr<Text> create(Document&, const String&);
-    static RefPtr<Text> create(ScriptExecutionContext&, const String&);
-    static RefPtr<Text> createWithLengthLimit(Document&, const String&, unsigned positionInString, unsigned lengthLimit = defaultLengthLimit);
-    static RefPtr<Text> createEditingText(Document&, const String&);
+    static Ref<Text> create(Document&, const String&);
+    static Ref<Text> create(ScriptExecutionContext&, const String&);
+    static Ref<Text> createWithLengthLimit(Document&, const String&, unsigned positionInString, unsigned lengthLimit = defaultLengthLimit);
+    static Ref<Text> createEditingText(Document&, const String&);
 
     virtual ~Text();
 
@@ -67,7 +67,7 @@ private:
     virtual RefPtr<Node> cloneNodeInternal(Document&, CloningOperation) override;
     virtual bool childTypeAllowed(NodeType) const override;
 
-    virtual RefPtr<Text> virtualCreate(const String&);
+    virtual Ref<Text> virtualCreate(const String&);
 
 #ifndef NDEBUG
     virtual void formatForDebugger(char* buffer, unsigned length) const override;
index dc31166..bbe2a62 100644 (file)
@@ -994,15 +994,15 @@ void replaceChildrenWithText(ContainerNode& container, const String& text, Excep
         return;
     }
 
-    RefPtr<Text> textNode = Text::create(containerNode->document(), text);
+    Ref<Text> textNode = Text::create(containerNode->document(), text);
 
     if (hasOneChild(containerNode)) {
-        containerNode->replaceChild(textNode.release(), containerNode->firstChild(), ec);
+        containerNode->replaceChild(WTF::move(textNode), containerNode->firstChild(), ec);
         return;
     }
 
     containerNode->removeChildren();
-    containerNode->appendChild(textNode.release(), ec);
+    containerNode->appendChild(WTF::move(textNode), ec);
 }
 
 }
index 6796480..6661fae 100644 (file)
@@ -48,9 +48,9 @@ using namespace HTMLNames;
     
 class FTPDirectoryDocumentParser final : public HTMLDocumentParser {
 public:
-    static RefPtr<FTPDirectoryDocumentParser> create(HTMLDocument& document)
+    static Ref<FTPDirectoryDocumentParser> create(HTMLDocument& document)
     {
-        return adoptRef(new FTPDirectoryDocumentParser(document));
+        return adoptRef(*new FTPDirectoryDocumentParser(document));
     }
 
     virtual void append(PassRefPtr<StringImpl>) override;
@@ -432,7 +432,7 @@ FTPDirectoryDocument::FTPDirectoryDocument(Frame* frame, const URL& url)
 #endif
 }
 
-RefPtr<DocumentParser> FTPDirectoryDocument::createParser()
+Ref<DocumentParser> FTPDirectoryDocument::createParser()
 {
     return FTPDirectoryDocumentParser::create(*this);
 }
index 7ca19e7..d1d3d87 100644 (file)
@@ -40,7 +40,7 @@ public:
 
 private:
     FTPDirectoryDocument(Frame*, const URL&);
-    virtual RefPtr<DocumentParser> createParser() override;
+    virtual Ref<DocumentParser> createParser() override;
 };
     
 } // namespace WebCore
index a693eb0..88b9b29 100644 (file)
@@ -224,7 +224,7 @@ void HTMLDocument::releaseEvents()
 {
 }
 
-RefPtr<DocumentParser> HTMLDocument::createParser()
+Ref<DocumentParser> HTMLDocument::createParser()
 {
     return HTMLDocumentParser::create(*this);
 }
@@ -342,7 +342,7 @@ bool HTMLDocument::isFrameSet() const
     return is<HTMLFrameSetElement>(body());
 }
 
-RefPtr<Document> HTMLDocument::cloneDocumentWithoutChildren() const
+Ref<Document> HTMLDocument::cloneDocumentWithoutChildren() const
 {
     return create(nullptr, url());
 }
index 9e9aa25..4a6a46c 100644 (file)
@@ -31,14 +31,14 @@ namespace WebCore {
 
 class HTMLDocument : public Document, public CachedResourceClient {
 public:
-    static RefPtr<HTMLDocument> create(Frame* frame, const URL& url)
+    static Ref<HTMLDocument> create(Frame* frame, const URL& url)
     {
-        return adoptRef(new HTMLDocument(frame, url, HTMLDocumentClass));
+        return adoptRef(*new HTMLDocument(frame, url, HTMLDocumentClass));
     }
 
-    static RefPtr<HTMLDocument> createSynthesizedDocument(Frame* frame, const URL& url)
+    static Ref<HTMLDocument> createSynthesizedDocument(Frame* frame, const URL& url)
     {
-        return adoptRef(new HTMLDocument(frame, url, HTMLDocumentClass, Synthesized));
+        return adoptRef(*new HTMLDocument(frame, url, HTMLDocumentClass, Synthesized));
     }
 
     virtual ~HTMLDocument();
@@ -89,8 +89,8 @@ private:
     virtual RefPtr<Element> createElement(const AtomicString& tagName, ExceptionCode&) override;
 
     virtual bool isFrameSet() const override;
-    virtual RefPtr<DocumentParser> createParser() override;
-    virtual RefPtr<Document> cloneDocumentWithoutChildren() const override final;
+    virtual Ref<DocumentParser> createParser() override;
+    virtual Ref<Document> cloneDocumentWithoutChildren() const override final;
 
     DocumentOrderedMap m_documentNamedItem;
     DocumentOrderedMap m_windowNamedItem;
index a3bc1db..891e67e 100644 (file)
@@ -54,7 +54,7 @@ using namespace HTMLNames;
 #if !PLATFORM(IOS)
 class ImageEventListener final : public EventListener {
 public:
-    static RefPtr<ImageEventListener> create(ImageDocument& document) { return adoptRef(new ImageEventListener(document)); }
+    static Ref<ImageEventListener> create(ImageDocument& document) { return adoptRef(*new ImageEventListener(document)); }
 
 private:
     ImageEventListener(ImageDocument& document)
@@ -72,9 +72,9 @@ private:
 
 class ImageDocumentParser final : public RawDataDocumentParser {
 public:
-    static RefPtr<ImageDocumentParser> create(ImageDocument& document)
+    static Ref<ImageDocumentParser> create(ImageDocument& document)
     {
-        return adoptRef(new ImageDocumentParser(document));
+        return adoptRef(*new ImageDocumentParser(document));
     }
 
 private:
@@ -202,7 +202,7 @@ ImageDocument::ImageDocument(Frame& frame, const URL& url)
     lockCompatibilityMode();
 }
     
-RefPtr<DocumentParser> ImageDocument::createParser()
+Ref<DocumentParser> ImageDocument::createParser()
 {
     return ImageDocumentParser::create(*this);
 }
index 71d5bac..5e7e4bd 100644 (file)
@@ -34,9 +34,9 @@ class HTMLImageElement;
 
 class ImageDocument final : public HTMLDocument {
 public:
-    static RefPtr<ImageDocument> create(Frame& frame, const URL& url)
+    static Ref<ImageDocument> create(Frame& frame, const URL& url)
     {
-        return adoptRef(new ImageDocument(frame, url));
+        return adoptRef(*new ImageDocument(frame, url));
     }
 
     WEBCORE_EXPORT HTMLImageElement* imageElement() const;
@@ -54,7 +54,7 @@ public:
 private:
     ImageDocument(Frame&, const URL&);
 
-    virtual RefPtr<DocumentParser> createParser() override;
+    virtual Ref<DocumentParser> createParser() override;
 
     LayoutSize imageSize();
 
index 41a3701..892b87f 100644 (file)
@@ -52,9 +52,9 @@ using namespace HTMLNames;
 // FIXME: Share more code with PluginDocumentParser.
 class MediaDocumentParser final : public RawDataDocumentParser {
 public:
-    static RefPtr<MediaDocumentParser> create(MediaDocument& document)
+    static Ref<MediaDocumentParser> create(MediaDocument& document)
     {
-        return adoptRef(new MediaDocumentParser(document));
+        return adoptRef(*new MediaDocumentParser(document));
     }
     
 private:
@@ -153,7 +153,7 @@ MediaDocument::~MediaDocument()
     ASSERT(!m_replaceMediaElementTimer.isActive());
 }
 
-RefPtr<DocumentParser> MediaDocument::createParser()
+Ref<DocumentParser> MediaDocument::createParser()
 {
     return MediaDocumentParser::create(*this);
 }
index 917988c..1cca785 100644 (file)
@@ -34,9 +34,9 @@ namespace WebCore {
 
 class MediaDocument final : public HTMLDocument {
 public:
-    static RefPtr<MediaDocument> create(Frame* frame, const URL& url)
+    static Ref<MediaDocument> create(Frame* frame, const URL& url)
     {
-        return adoptRef(new MediaDocument(frame, url));
+        return adoptRef(*new MediaDocument(frame, url));
     }
     virtual ~MediaDocument();
 
@@ -46,7 +46,7 @@ public:
 private:
     MediaDocument(Frame*, const URL&);
 
-    virtual RefPtr<DocumentParser> createParser() override;
+    virtual Ref<DocumentParser> createParser() override;
 
     virtual void defaultEventHandler(Event*) override;
 
index 77e14cd..7796c27 100644 (file)
@@ -46,9 +46,9 @@ using namespace HTMLNames;
 // FIXME: Share more code with MediaDocumentParser.
 class PluginDocumentParser final : public RawDataDocumentParser {
 public:
-    static RefPtr<PluginDocumentParser> create(PluginDocument& document)
+    static Ref<PluginDocumentParser> create(PluginDocument& document)
     {
-        return adoptRef(new PluginDocumentParser(document));
+        return adoptRef(*new PluginDocumentParser(document));
     }
 
 private:
@@ -148,7 +148,7 @@ PluginDocument::PluginDocument(Frame* frame, const URL& url)
     lockCompatibilityMode();
 }
 
-RefPtr<DocumentParser> PluginDocument::createParser()
+Ref<DocumentParser> PluginDocument::createParser()
 {
     return PluginDocumentParser::create(*this);
 }
index a281de9..ae2379d 100644 (file)
@@ -34,9 +34,9 @@ class Widget;
 
 class PluginDocument final : public HTMLDocument {
 public:
-    static RefPtr<PluginDocument> create(Frame* frame, const URL& url)
+    static Ref<PluginDocument> create(Frame* frame, const URL& url)
     {
-        return adoptRef(new PluginDocument(frame, url));
+        return adoptRef(*new PluginDocument(frame, url));
     }
 
     void setPluginElement(PassRefPtr<HTMLPlugInElement>);
@@ -53,7 +53,7 @@ public:
 private:
     PluginDocument(Frame*, const URL&);
 
-    virtual RefPtr<DocumentParser> createParser() override;
+    virtual Ref<DocumentParser> createParser() override;
 
     void setShouldLoadPluginManually(bool loadManually) { m_shouldLoadPluginManually = loadManually; }
 
index 66b0f8f..71b3ef9 100644 (file)
@@ -36,7 +36,7 @@ TextDocument::TextDocument(Frame* frame, const URL& url)
     lockCompatibilityMode();
 }
 
-RefPtr<DocumentParser> TextDocument::createParser()
+Ref<DocumentParser> TextDocument::createParser()
 {
     return TextDocumentParser::create(*this);
 }
index a5d27fa..d947d75 100644 (file)
@@ -31,15 +31,15 @@ namespace WebCore {
 
 class TextDocument final : public HTMLDocument {
 public:
-    static RefPtr<TextDocument> create(Frame* frame, const URL& url)
+    static Ref<TextDocument> create(Frame* frame, const URL& url)
     {
-        return adoptRef(new TextDocument(frame, url));
+        return adoptRef(*new TextDocument(frame, url));
     }
 
 private:
     TextDocument(Frame*, const URL&);
     
-    virtual RefPtr<DocumentParser> createParser() override;
+    virtual Ref<DocumentParser> createParser() override;
 };
 
 }
index 8d63b2b..350819b 100644 (file)
@@ -553,7 +553,7 @@ void HTMLConstructionSite::insertTextNode(const String& characters, WhitespaceMo
     }
 
     while (currentPosition < characters.length()) {
-        RefPtr<Text> textNode = Text::createWithLengthLimit(task.parent->document(), shouldUseAtomicString ? AtomicString(characters).string() : characters, currentPosition, lengthLimit);
+        Ref<Text> textNode = Text::createWithLengthLimit(task.parent->document(), shouldUseAtomicString ? AtomicString(characters).string() : characters, currentPosition, lengthLimit);
         // If we have a whole string of unbreakable characters the above could lead to an infinite loop. Exceeding the length limit is the lesser evil.
         if (!textNode->length()) {
             String substring = characters.substring(currentPosition);
@@ -562,7 +562,7 @@ void HTMLConstructionSite::insertTextNode(const String& characters, WhitespaceMo
 
         currentPosition += textNode->length();
         ASSERT(currentPosition <= characters.length());
-        task.child = textNode.release();
+        task.child = WTF::move(textNode);
 
         executeTask(task);
     }
index 91adc3d..6cfe8db 100644 (file)
@@ -62,9 +62,9 @@ class PumpSession;
 class HTMLDocumentParser :  public ScriptableDocumentParser, HTMLScriptRunnerHost, CachedResourceClient {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    static RefPtr<HTMLDocumentParser> create(HTMLDocument& document)
+    static Ref<HTMLDocumentParser> create(HTMLDocument& document)
     {
-        return adoptRef(new HTMLDocumentParser(document));
+        return adoptRef(*new HTMLDocumentParser(document));
     }
     virtual ~HTMLDocumentParser();
 
@@ -93,9 +93,9 @@ protected:
     void forcePlaintextForTextDocument();
 
 private:
-    static RefPtr<HTMLDocumentParser> create(DocumentFragment& fragment, Element* contextElement, ParserContentPolicy parserContentPolicy)
+    static Ref<HTMLDocumentParser> create(DocumentFragment& fragment, Element* contextElement, ParserContentPolicy parserContentPolicy)
     {
-        return adoptRef(new HTMLDocumentParser(fragment, contextElement, parserContentPolicy));
+        return adoptRef(*new HTMLDocumentParser(fragment, contextElement, parserContentPolicy));
     }
 
     // DocumentParser
index e3c7a53..5c78eb1 100644 (file)
@@ -32,9 +32,9 @@ namespace WebCore {
 
 class TextDocumentParser final : public HTMLDocumentParser {
 public:
-    static PassRefPtr<TextDocumentParser> create(HTMLDocument& document)
+    static Ref<TextDocumentParser> create(HTMLDocument& document)
     {
-        return adoptRef(new TextDocumentParser(document));
+        return adoptRef(*new TextDocumentParser(document));
     }
     virtual ~TextDocumentParser();
 
index fc4bb3a..a530fb0 100644 (file)
@@ -32,9 +32,9 @@ namespace WebCore {
 
 class SinkDocumentParser final : public RawDataDocumentParser {
 public:
-    static RefPtr<SinkDocumentParser> create(SinkDocument& document)
+    static Ref<SinkDocumentParser> create(SinkDocument& document)
     {
-        return adoptRef(new SinkDocumentParser(document));
+        return adoptRef(*new SinkDocumentParser(document));
     }
     
 private:
@@ -56,7 +56,7 @@ SinkDocument::SinkDocument(Frame* frame, const URL& url)
     lockCompatibilityMode();
 }
 
-RefPtr<DocumentParser> SinkDocument::createParser()
+Ref<DocumentParser> SinkDocument::createParser()
 {
     return SinkDocumentParser::create(*this);
 }
index c781f69..e79343d 100644 (file)
@@ -32,15 +32,15 @@ namespace WebCore {
 
 class SinkDocument final : public HTMLDocument {
 public:
-    static RefPtr<SinkDocument> create(Frame* frame, const URL& url)
+    static Ref<SinkDocument> create(Frame* frame, const URL& url)
     {
-        return adoptRef(new SinkDocument(frame, url));
+        return adoptRef(*new SinkDocument(frame, url));
     }
 
 private:
     SinkDocument(Frame*, const URL&);
     
-    virtual RefPtr<DocumentParser> createParser();
+    virtual Ref<DocumentParser> createParser();
 };
 
 
index 0dea08f..38779ae 100644 (file)
@@ -76,7 +76,7 @@ void SVGDocument::updatePan(const FloatPoint& pos) const
     }
 }
 
-RefPtr<Document> SVGDocument::cloneDocumentWithoutChildren() const
+Ref<Document> SVGDocument::cloneDocumentWithoutChildren() const
 {
     return create(nullptr, url());
 }
index ff51d56..2bac995 100644 (file)
@@ -32,9 +32,9 @@ class SVGSVGElement;
 
 class SVGDocument final : public Document {
 public:
-    static RefPtr<SVGDocument> create(Frame* frame, const URL& url)
+    static Ref<SVGDocument> create(Frame* frame, const URL& url)
     {
-        return adoptRef(new SVGDocument(frame, url));
+        return adoptRef(*new SVGDocument(frame, url));
     }
 
     SVGSVGElement* rootElement() const;
@@ -47,7 +47,7 @@ public:
 private:
     SVGDocument(Frame*, const URL&);
 
-    virtual RefPtr<Document> cloneDocumentWithoutChildren() const override;
+    virtual Ref<Document> cloneDocumentWithoutChildren() const override;
 
     FloatPoint m_translate;
 };
index 31f02bc..22e8796 100644 (file)
@@ -52,8 +52,8 @@ class Text;
 
     class XMLParserContext : public RefCounted<XMLParserContext> {
     public:
-        static PassRefPtr<XMLParserContext> createMemoryParser(xmlSAXHandlerPtr, void* userData, const CString& chunk);
-        static PassRefPtr<XMLParserContext> createStringParser(xmlSAXHandlerPtr, void* userData);
+        static RefPtr<XMLParserContext> createMemoryParser(xmlSAXHandlerPtr, void* userData, const CString& chunk);
+        static Ref<XMLParserContext> createStringParser(xmlSAXHandlerPtr, void* userData);
         ~XMLParserContext();
         xmlParserCtxtPtr context() const { return m_context; }
 
@@ -68,13 +68,13 @@ class Text;
     class XMLDocumentParser : public ScriptableDocumentParser, public CachedResourceClient {
         WTF_MAKE_FAST_ALLOCATED;
     public:
-        static PassRefPtr<XMLDocumentParser> create(Document& document, FrameView* view)
+        static Ref<XMLDocumentParser> create(Document& document, FrameView* view)
         {
-            return adoptRef(new XMLDocumentParser(document, view));
+            return adoptRef(*new XMLDocumentParser(document, view));
         }
-        static PassRefPtr<XMLDocumentParser> create(DocumentFragment& fragment, Element* element, ParserContentPolicy parserContentPolicy)
+        static Ref<XMLDocumentParser> create(DocumentFragment& fragment, Element* element, ParserContentPolicy parserContentPolicy)
         {
-            return adoptRef(new XMLDocumentParser(fragment, element, parserContentPolicy));
+            return adoptRef(*new XMLDocumentParser(fragment, element, parserContentPolicy));
         }
 
         ~XMLDocumentParser();
index af10c6c..72c9b9c 100644 (file)
@@ -508,7 +508,7 @@ static void errorFunc(void*, const char*, ...)
 
 static bool didInit = false;
 
-PassRefPtr<XMLParserContext> XMLParserContext::createStringParser(xmlSAXHandlerPtr handlers, void* userData)
+Ref<XMLParserContext> XMLParserContext::createStringParser(xmlSAXHandlerPtr handlers, void* userData)
 {
     if (!didInit) {
         xmlInitParser();
@@ -526,12 +526,12 @@ PassRefPtr<XMLParserContext> XMLParserContext::createStringParser(xmlSAXHandlerP
 
     switchToUTF16(parser);
 
-    return adoptRef(new XMLParserContext(parser));
+    return adoptRef(*new XMLParserContext(parser));
 }
 
 
 // Chunk should be encoded in UTF-8
-PassRefPtr<XMLParserContext> XMLParserContext::createMemoryParser(xmlSAXHandlerPtr handlers, void* userData, const CString& chunk)
+RefPtr<XMLParserContext> XMLParserContext::createMemoryParser(xmlSAXHandlerPtr handlers, void* userData, const CString& chunk)
 {
     if (!didInit) {
         xmlInitParser();
@@ -562,7 +562,7 @@ PassRefPtr<XMLParserContext> XMLParserContext::createMemoryParser(xmlSAXHandlerP
     parser->str_xml_ns = xmlDictLookup(parser->dict, XML_XML_NAMESPACE, 36);
     parser->_private = userData;
 
-    return adoptRef(new XMLParserContext(parser));
+    return adoptRef(*new XMLParserContext(parser));
 }
 
 // --------------------------------
index d243ba6..f8dd8d6 100644 (file)
@@ -1,3 +1,13 @@
+2014-12-18  Andreas Kling  <akling@apple.com>
+
+        Ref-ify various Document-related things.
+        <https://webkit.org/b/139796>
+
+        Reviewed by Anders Carlsson.
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame _replaceSelectionWithNode:selectReplacement:smartReplace:matchStyle:]):
+
 2014-12-18  Beth Dakin  <bdakin@apple.com>
 
         Need to re-enable action menus
index 170bf8d..10c9cfd 100644 (file)
@@ -913,7 +913,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
 
 - (void)_replaceSelectionWithNode:(DOMNode *)node selectReplacement:(BOOL)selectReplacement smartReplace:(BOOL)smartReplace matchStyle:(BOOL)matchStyle
 {
-    DOMDocumentFragment *fragment = kit(_private->coreFrame->document()->createDocumentFragment().get());
+    DOMDocumentFragment *fragment = kit(_private->coreFrame->document()->createDocumentFragment().ptr());
     [fragment appendChild:node];
     [self _replaceSelectionWithFragment:fragment selectReplacement:selectReplacement smartReplace:smartReplace matchStyle:matchStyle];
 }
index c6c1ad2..f1416b8 100644 (file)
@@ -1,3 +1,13 @@
+2014-12-18  Andreas Kling  <akling@apple.com>
+
+        Ref-ify various Document-related things.
+        <https://webkit.org/b/139796>
+
+        Reviewed by Anders Carlsson.
+
+        * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
+        (-[WKDOMDocument createTextNode:]):
+
 2014-12-18  Beth Dakin  <bdakin@apple.com>
 
         Speculative build fix.
index 8316629..513ccbf 100644 (file)
@@ -44,7 +44,7 @@
 
 - (WKDOMText *)createTextNode:(NSString *)data
 {
-    return WebKit::toWKDOMText(downcast<WebCore::Document>(*_impl).createTextNode(data).get());
+    return WebKit::toWKDOMText(downcast<WebCore::Document>(*_impl).createTextNode(data).ptr());
 }
 
 - (WKDOMElement *)body