| Index: Source/core/editing/FrameSelection.cpp
|
| diff --git a/Source/core/editing/FrameSelection.cpp b/Source/core/editing/FrameSelection.cpp
|
| index bdba0152fa4165f0b667948ef790bd507d0333b4..57fc93db93daffe3c79be1bd85f0274c0d16b5d9 100644
|
| --- a/Source/core/editing/FrameSelection.cpp
|
| +++ b/Source/core/editing/FrameSelection.cpp
|
| @@ -1669,9 +1669,20 @@ static String extractSelectedText(const FrameSelection& selection, TextIteratorB
|
| return plainText(selection.toNormalizedRange().get(), behavior).replace(0, "");
|
| }
|
|
|
| +template <typename Strategy>
|
| +static String extractSelectedHTMLAlgorithm(const FrameSelection& selection)
|
| +{
|
| + using PositionType = typename Strategy::PositionType;
|
| + PositionType start;
|
| + PositionType end;
|
| + VisibleSelection visibleSelection = selection.selection();
|
| + VisibleSelection::normalizePositions(Strategy::selectionStart(visibleSelection), Strategy::selectionEnd(visibleSelection), &start, &end);
|
| + return createMarkup(start, end, AnnotateForInterchange, ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs);
|
| +}
|
| +
|
| String FrameSelection::selectedHTMLForClipboard() const
|
| {
|
| - return createMarkup(m_selection.toNormalizedRange().get(), AnnotateForInterchange, ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs);
|
| + return extractSelectedHTMLAlgorithm<VisibleSelection::InDOMTree>(*this);
|
| }
|
|
|
| String FrameSelection::selectedText() const
|
|
|