summaryrefslogtreecommitdiffstats
path: root/WebCore/editing/CreateLinkCommand.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/editing/CreateLinkCommand.cpp')
-rw-r--r--WebCore/editing/CreateLinkCommand.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/WebCore/editing/CreateLinkCommand.cpp b/WebCore/editing/CreateLinkCommand.cpp
index 263feab..d7048fe 100644
--- a/WebCore/editing/CreateLinkCommand.cpp
+++ b/WebCore/editing/CreateLinkCommand.cpp
@@ -43,7 +43,7 @@ void CreateLinkCommand::doApply()
if (endingSelection().isNone())
return;
- RefPtr<HTMLAnchorElement> anchorElement = new HTMLAnchorElement(document());
+ RefPtr<HTMLAnchorElement> anchorElement = HTMLAnchorElement::create(document());
anchorElement->setHref(m_url);
if (endingSelection().isRange()) {
@@ -51,9 +51,9 @@ void CreateLinkCommand::doApply()
applyStyledElement(anchorElement.get());
} else {
insertNodeAt(anchorElement.get(), endingSelection().start());
- RefPtr<Text> textNode = new Text(document(), m_url);
+ RefPtr<Text> textNode = Text::create(document(), m_url);
appendNode(textNode.get(), anchorElement.get());
- setEndingSelection(VisibleSelection(positionBeforeNode(anchorElement.get()), positionAfterNode(anchorElement.get()), DOWNSTREAM));
+ setEndingSelection(VisibleSelection(positionInParentBeforeNode(anchorElement.get()), positionInParentAfterNode(anchorElement.get()), DOWNSTREAM));
}
}