diff options
Diffstat (limited to 'WebCore/editing/markup.cpp')
-rw-r--r-- | WebCore/editing/markup.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/WebCore/editing/markup.cpp b/WebCore/editing/markup.cpp index 606f141..46f0e94 100644 --- a/WebCore/editing/markup.cpp +++ b/WebCore/editing/markup.cpp @@ -49,6 +49,7 @@ #include "HTMLElement.h" #include "HTMLNames.h" #include "InlineTextBox.h" +#include "KURL.h" #include "Logging.h" #include "ProcessingInstruction.h" #include "QualifiedName.h" @@ -1018,7 +1019,7 @@ String createMarkup(const Range* range, Vector<Node*>* nodes, EAnnotateForInterc // Add a wrapper span with the styles that all of the nodes in the markup inherit. Node* parentOfLastClosed = lastClosed ? lastClosed->parentNode() : 0; if (parentOfLastClosed && parentOfLastClosed->renderer()) { - RefPtr<CSSMutableStyleDeclaration> style = editingStyleAtPosition(Position(parentOfLastClosed, 0)); + RefPtr<CSSMutableStyleDeclaration> style = ApplyStyleCommand::editingStyleAtPosition(Position(parentOfLastClosed, 0)); // Styles that Mail blockquotes contribute should only be placed on the Mail blockquote, to help // us differentiate those styles from ones that the user has applied. This helps us @@ -1042,7 +1043,7 @@ String createMarkup(const Range* range, Vector<Node*>* nodes, EAnnotateForInterc // Add a style span with the document's default styles. We add these in a separate // span so that at paste time we can differentiate between document defaults and user // applied styles. - RefPtr<CSSMutableStyleDeclaration> defaultStyle = editingStyleAtPosition(Position(document->documentElement(), 0)); + RefPtr<CSSMutableStyleDeclaration> defaultStyle = ApplyStyleCommand::editingStyleAtPosition(Position(document->documentElement(), 0)); if (defaultStyle->length() > 0) addStyleMarkup(preMarkups, markups, defaultStyle.get(), document); @@ -1287,4 +1288,15 @@ String createFullMarkup(const Range* range) return frame->documentTypeString() + createMarkup(range, 0, AnnotateForInterchange); } +String urlToMarkup(const KURL& url, const String& title) +{ + Vector<UChar> markup; + append(markup, "<a href=\""); + append(markup, url.string()); + append(markup, "\">"); + appendEscapedContent(markup, make_pair(title.characters(), title.length()), false); + append(markup, "</a>"); + return String::adopt(markup); +} + } |