Changeset 146835 in webkit
- Timestamp:
- Mar 25, 2013 6:33:10 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r146834 r146835 1 2013-03-25 Tony Chang <tony@chromium.org> 2 3 Image alt text not included in plain-text version when copying 4 https://bugs.webkit.org/show_bug.cgi?id=11200 5 6 Reviewed by Ryosuke Niwa. 7 8 * editing/pasteboard/copy-image-with-alt-text-expected.txt: Added. 9 * editing/pasteboard/copy-image-with-alt-text.html: Added. 10 1 11 2013-03-25 James Robinson <jamesr@chromium.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r146833 r146835 1 2013-03-25 Tony Chang <tony@chromium.org> 2 3 Image alt text not included in plain-text version when copying 4 https://bugs.webkit.org/show_bug.cgi?id=11200 5 6 Reviewed by Ryosuke Niwa. 7 8 Add a setting to enable copying image alt text to the clipboard and drag and drop pasteboard. 9 This setting is disabled by default, so each port can enable if they want to match IE10 and 10 Firefox's behavior. 11 12 Test: editing/pasteboard/copy-image-with-alt-text.html 13 14 * editing/Editor.cpp: 15 (WebCore::Editor::cut): Explicitly ask that the selection on the pasteboard as being for the clipboard. 16 (WebCore::Editor::copy): Explicitly ask that the selection on the pasteboard as being for the clipboard. 17 (WebCore::Editor::selectedText): Add a private version of selectedText() that can choose between having image alt text or not. 18 (WebCore::Editor::selectedTextForClipboard): Ask for image alt text if the setting is enabled. 19 * editing/Editor.h: 20 * editing/TextIterator.cpp: 21 (WebCore::TextIterator::TextIterator): Add a bool to keep track of whether or not to emit image alt text. 22 (WebCore::TextIterator::handleReplacedElement): If there's alt text, point the iterator to it. 23 * editing/TextIterator.h: 24 (TextIterator): 25 * editing/mac/EditorMac.mm: 26 (WebCore::Editor::takeFindStringFromSelection): Use the same text as on the clipboard. 27 (WebCore::Editor::writeSelectionToPasteboard): Don't include image alt text since this is 28 used by Services. 29 (WebCore::Editor::stringSelectionForPasteboard): Don't include image alt text since this is 30 used by Services. 31 * page/DragController.cpp: 32 (WebCore::DragController::startDrag): Use image alt text (matches Firefox). 33 * page/Settings.in: Add a setting that disables image alt text by default. 34 * platform/Pasteboard.h: 35 * platform/blackberry/PasteboardBlackBerry.cpp: 36 (WebCore::Pasteboard::writeSelection): Add ShouldSerializeSelectedTextForClipboard parameter. 37 * platform/chromium/ClipboardChromium.cpp: 38 (WebCore::ClipboardChromium::writeRange): Use clipboard text when writing ranges (used by d&d). 39 * platform/chromium/PasteboardChromium.cpp: 40 (WebCore::Pasteboard::writeSelection): Add ShouldSerializeSelectedTextForClipboard parameter. 41 * platform/efl/PasteboardEfl.cpp: 42 (WebCore::Pasteboard::writeSelection): Update function param. 43 * platform/gtk/ClipboardGtk.cpp: 44 (WebCore::ClipboardGtk::writeRange): Use clipboard text when writing ranges (used by d&d). 45 * platform/gtk/PasteboardGtk.cpp: 46 (WebCore::Pasteboard::writeSelection): Add ShouldSerializeSelectedTextForClipboard parameter. 47 * platform/mac/ClipboardMac.mm: 48 (WebCore::ClipboardMac::writeRange): Use clipboard text when writing ranges (used by d&d). 49 * platform/mac/PasteboardMac.mm: 50 (WebCore::Pasteboard::getStringSelection): Use ShouldSerializeSelectedTextForClipboard to determine whether the selected 51 text is for the clipboard or not. 52 (WebCore::Pasteboard::writeSelectionForTypes): Pass ShouldSerializeSelectedTextForClipboard through. 53 (WebCore::Pasteboard::writeSelection): Add ShouldSerializeSelectedTextForClipboard parameter. 54 * platform/qt/ClipboardQt.cpp: 55 (WebCore::ClipboardQt::writeRange): Use clipboard text when writing ranges (used by d&d). 56 * platform/qt/PasteboardQt.cpp: 57 (WebCore::Pasteboard::writeSelection): Add ShouldSerializeSelectedTextForClipboard parameter. 58 * platform/win/ClipboardWin.cpp: 59 (WebCore::ClipboardWin::writeRange): Use clipboard text when writing ranges (used by d&d). 60 * platform/win/PasteboardWin.cpp: 61 (WebCore::Pasteboard::writeSelection): Add ShouldSerializeSelectedTextForClipboard parameter. 62 * platform/wince/PasteboardWinCE.cpp: 63 (WebCore::Pasteboard::writeSelection): Add ShouldSerializeSelectedTextForClipboard parameter. 64 * platform/wx/PasteboardWx.cpp: 65 (WebCore::Pasteboard::writeSelection): Add ShouldSerializeSelectedTextForClipboard parameter. 66 * rendering/RenderImage.h: 67 (WebCore::RenderImage::altText): Add a getter for the alt text. 68 1 69 2013-03-25 Dean Jackson <dino@apple.com> 2 70 -
trunk/Source/WebCore/editing/Editor.cpp
r146726 r146835 1044 1044 updateMarkersForWordsAffectedByEditing(true); 1045 1045 if (enclosingTextFormControl(m_frame->selection()->start())) { 1046 Pasteboard::generalPasteboard()->writePlainText(selectedText (),1046 Pasteboard::generalPasteboard()->writePlainText(selectedTextForClipboard(), 1047 1047 canSmartCopyOrDelete() ? Pasteboard::CanSmartReplace : Pasteboard::CannotSmartReplace); 1048 1048 } else 1049 Pasteboard::generalPasteboard()->writeSelection(selection.get(), canSmartCopyOrDelete(), m_frame );1049 Pasteboard::generalPasteboard()->writeSelection(selection.get(), canSmartCopyOrDelete(), m_frame, IncludeImageAltTextForClipboard); 1050 1050 didWriteSelectionToPasteboard(); 1051 1051 deleteSelectionWithSmartDelete(canSmartCopyOrDelete()); … … 1064 1064 willWriteSelectionToPasteboard(selectedRange()); 1065 1065 if (enclosingTextFormControl(m_frame->selection()->start())) { 1066 Pasteboard::generalPasteboard()->writePlainText(selectedText (),1066 Pasteboard::generalPasteboard()->writePlainText(selectedTextForClipboard(), 1067 1067 canSmartCopyOrDelete() ? Pasteboard::CanSmartReplace : Pasteboard::CannotSmartReplace); 1068 1068 } else { … … 1071 1071 Pasteboard::generalPasteboard()->writeImage(imageElement, document->url(), document->title()); 1072 1072 else 1073 Pasteboard::generalPasteboard()->writeSelection(selectedRange().get(), canSmartCopyOrDelete(), m_frame );1073 Pasteboard::generalPasteboard()->writeSelection(selectedRange().get(), canSmartCopyOrDelete(), m_frame, IncludeImageAltTextForClipboard); 1074 1074 } 1075 1075 … … 2614 2614 String Editor::selectedText() const 2615 2615 { 2616 return selectedText(TextIteratorDefaultBehavior); 2617 } 2618 2619 String Editor::selectedTextForClipboard() const 2620 { 2621 if (m_frame->settings() && m_frame->settings()->selectionIncludesAltImageText()) 2622 return selectedText(TextIteratorEmitsImageAltText); 2623 return selectedText(); 2624 } 2625 2626 String Editor::selectedText(TextIteratorBehavior behavior) const 2627 { 2616 2628 // We remove '\0' characters because they are not visibly rendered to the user. 2617 return plainText(m_frame->selection()->toNormalizedRange().get() ).replace(0, "");2629 return plainText(m_frame->selection()->toNormalizedRange().get(), behavior).replace(0, ""); 2618 2630 } 2619 2631 -
trunk/Source/WebCore/editing/Editor.h
r142711 r146835 39 39 #include "FrameSelection.h" 40 40 #include "TextChecking.h" 41 #include "TextIterator.h" 41 42 #include "VisibleSelection.h" 42 43 #include "WritingDirection.h" … … 356 357 357 358 String selectedText() const; 359 String selectedTextForClipboard() const; 358 360 bool findString(const String&, FindOptions); 359 361 // FIXME: Switch callers over to the FindOptions version and retire this one. … … 443 445 TextCheckingTypeMask resolveTextCheckingTypeMask(TextCheckingTypeMask); 444 446 447 String selectedText(TextIteratorBehavior) const; 448 445 449 void selectComposition(); 446 450 enum SetCompositionMode { ConfirmComposition, CancelComposition }; -
trunk/Source/WebCore/editing/TextIterator.cpp
r146796 r146835 39 39 #include "NodeTraversal.h" 40 40 #include "Range.h" 41 #include "RenderImage.h" 41 42 #include "RenderTableCell.h" 42 43 #include "RenderTableRow.h" … … 267 268 , m_stopsOnFormControls(behavior & TextIteratorStopsOnFormControls) 268 269 , m_shouldStop(false) 270 , m_emitsImageAltText(behavior & TextIteratorEmitsImageAltText) 269 271 { 270 272 if (!r) … … 689 691 m_positionStartOffset = 0; 690 692 m_positionEndOffset = 1; 691 692 693 m_textCharacters = 0; 694 695 if (m_emitsImageAltText && renderer->isImage() && renderer->isRenderImage()) { 696 m_text = toRenderImage(renderer)->altText(); 697 if (!m_text.isEmpty()) { 698 m_textLength = m_text.length(); 699 m_lastCharacter = m_text[m_textLength - 1]; 700 return true; 701 } 702 } 703 693 704 m_textLength = 0; 694 695 705 m_lastCharacter = 0; 696 706 -
trunk/Source/WebCore/editing/TextIterator.h
r146796 r146835 45 45 TextIteratorEmitsObjectReplacementCharacters = 1 << 4, 46 46 TextIteratorEmitsOriginalText = 1 << 5, 47 TextIteratorStopsOnFormControls = 1 << 6 47 TextIteratorStopsOnFormControls = 1 << 6, 48 TextIteratorEmitsImageAltText = 1 << 7, 48 49 }; 49 50 … … 193 194 // Used when m_stopsOnFormControls is set to determine if the iterator should keep advancing. 194 195 bool m_shouldStop; 196 197 bool m_emitsImageAltText; 195 198 }; 196 199 -
trunk/Source/WebCore/editing/mac/EditorMac.mm
r143863 r146835 263 263 types.append(String(NSStringPboardType)); 264 264 platformStrategies()->pasteboardStrategy()->setTypes(types, NSFindPboard); 265 platformStrategies()->pasteboardStrategy()->setStringForType(m_frame->displayStringModifiedByEncoding(selectedText ()), NSStringPboardType, NSFindPboard);265 platformStrategies()->pasteboardStrategy()->setStringForType(m_frame->displayStringModifiedByEncoding(selectedTextForClipboard()), NSStringPboardType, NSFindPboard); 266 266 } 267 267 … … 269 269 { 270 270 Pasteboard pasteboard(pasteboardName); 271 pasteboard.writeSelectionForTypes(pasteboardTypes, true, m_frame );271 pasteboard.writeSelectionForTypes(pasteboardTypes, true, m_frame, DefaultSelectedTextType); 272 272 } 273 273 … … 283 283 String Editor::stringSelectionForPasteboard() 284 284 { 285 return Pasteboard::getStringSelection(m_frame );285 return Pasteboard::getStringSelection(m_frame, DefaultSelectedTextType); 286 286 } 287 287 -
trunk/Source/WebCore/page/DragController.cpp
r145818 r146835 790 790 if (!clipboard->hasData()) { 791 791 if (enclosingTextFormControl(src->selection()->start())) 792 clipboard->writePlainText(src->editor()->selectedText ());792 clipboard->writePlainText(src->editor()->selectedTextForClipboard()); 793 793 else { 794 794 RefPtr<Range> selectionRange = src->selection()->toNormalizedRange(); -
trunk/Source/WebCore/page/Settings.in
r146664 r146835 204 204 smartInsertDeleteEnabled initial=defaultSmartInsertDeleteEnabled 205 205 selectTrailingWhitespaceEnabled initial=defaultSelectTrailingWhitespaceEnabled 206 207 selectionIncludesAltImageText initial=false -
trunk/Source/WebCore/platform/Pasteboard.h
r127862 r146835 64 64 #endif 65 65 66 66 class ArchiveResource; 67 67 class Clipboard; 68 68 class DocumentFragment; … … 73 73 class Range; 74 74 class SharedBuffer; 75 76 enum ShouldSerializeSelectedTextForClipboard { DefaultSelectedTextType, IncludeImageAltTextForClipboard }; 75 77 76 78 class Pasteboard { … … 84 86 #if PLATFORM(MAC) 85 87 // This is required to support OS X services. 86 void writeSelectionForTypes(const Vector<String>& pasteboardTypes, bool canSmartCopyOrDelete, Frame* );88 void writeSelectionForTypes(const Vector<String>& pasteboardTypes, bool canSmartCopyOrDelete, Frame*, ShouldSerializeSelectedTextForClipboard); 87 89 explicit Pasteboard(const String& pasteboardName); 88 static String getStringSelection(Frame* );90 static String getStringSelection(Frame*, ShouldSerializeSelectedTextForClipboard); 89 91 static PassRefPtr<SharedBuffer> getDataSelection(Frame*, const String& pasteboardType); 90 92 #endif 91 93 92 94 static Pasteboard* generalPasteboard(); 93 void writeSelection(Range*, bool canSmartCopyOrDelete, Frame* );95 void writeSelection(Range*, bool canSmartCopyOrDelete, Frame*, ShouldSerializeSelectedTextForClipboard = DefaultSelectedTextType); 94 96 void writePlainText(const String&, SmartReplaceOption); 95 97 void writeURL(const KURL&, const String&, Frame* = 0); -
trunk/Source/WebCore/platform/blackberry/PasteboardBlackBerry.cpp
r146264 r146835 62 62 } 63 63 64 void Pasteboard::writeSelection(Range* selectedRange, bool, Frame* frame )64 void Pasteboard::writeSelection(Range* selectedRange, bool, Frame* frame, ShouldSerializeSelectedTextForClipboard shouldSerializeSelectedTextForClipboard) 65 65 { 66 WTF::String text = frame->editor()->selectedText();66 WTF::String text = shouldSerializeSelectedTextForClipboard == IncludeImageAltTextForClipboard ? frame->editor()->selectedTextForClipboard() : frame->editor()->selectedText(); 67 67 WTF::String html = createMarkup(selectedRange, 0, AnnotateForInterchange); 68 68 WTF::String url = frame->document()->url().string(); -
trunk/Source/WebCore/platform/chromium/ClipboardChromium.cpp
r146644 r146835 433 433 m_dataObject->setHTMLAndBaseURL(createMarkup(selectedRange, 0, AnnotateForInterchange, false, ResolveNonLocalURLs), frame->document()->url()); 434 434 435 String str = frame->editor()->selectedText ();435 String str = frame->editor()->selectedTextForClipboard(); 436 436 #if OS(WINDOWS) 437 437 replaceNewlinesWithWindowsStyleNewlines(str); -
trunk/Source/WebCore/platform/chromium/PasteboardChromium.cpp
r146264 r146835 86 86 } 87 87 88 void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame )88 void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame, ShouldSerializeSelectedTextForClipboard shouldSerializeSelectedTextForClipboard) 89 89 { 90 90 String html = createMarkup(selectedRange, 0, AnnotateForInterchange, false, ResolveNonLocalURLs); 91 91 KURL url = selectedRange->startContainer()->document()->url(); 92 String plainText = frame->editor()->selectedText();92 String plainText = shouldSerializeSelectedTextForClipboard == IncludeImageAltTextForClipboard ? frame->editor()->selectedTextForClipboard() : frame->editor()->selectedText(); 93 93 #if OS(WINDOWS) 94 94 replaceNewlinesWithWindowsStyleNewlines(plainText); -
trunk/Source/WebCore/platform/efl/PasteboardEfl.cpp
r128570 r146835 52 52 } 53 53 54 void Pasteboard::writeSelection(Range*, bool, Frame* )54 void Pasteboard::writeSelection(Range*, bool, Frame*, ShouldSerializeSelectedTextForClipboard) 55 55 { 56 56 notImplemented(); -
trunk/Source/WebCore/platform/gtk/ClipboardGtk.cpp
r146644 r146835 312 312 ASSERT(range); 313 313 314 m_dataObject->setText(frame->editor()->selectedText ());314 m_dataObject->setText(frame->editor()->selectedTextForClipboard()); 315 315 m_dataObject->setMarkup(createMarkup(range, 0, AnnotateForInterchange, false, ResolveNonLocalURLs)); 316 316 -
trunk/Source/WebCore/platform/gtk/PasteboardGtk.cpp
r146264 r146835 57 57 } 58 58 59 void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame )60 { 61 PasteboardHelper* helper = PasteboardHelper::defaultPasteboardHelper(); 62 GtkClipboard* clipboard = helper->getCurrentClipboard(frame); 63 64 DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard); 65 dataObject->clearAll(); 66 67 dataObject->setText( frame->editor()->selectedText());59 void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame, ShouldSerializeSelectedTextForClipboard shouldSerializeSelectedTextForClipboard) 60 { 61 PasteboardHelper* helper = PasteboardHelper::defaultPasteboardHelper(); 62 GtkClipboard* clipboard = helper->getCurrentClipboard(frame); 63 64 DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard); 65 dataObject->clearAll(); 66 67 dataObject->setText(shouldSerializeSelectedTextForClipboard == IncludeImageAltTextForClipboard ? frame->editor()->selectedTextForClipboard() : frame->editor()->selectedText()); 68 68 dataObject->setMarkup(createMarkup(selectedRange, 0, AnnotateForInterchange, false, ResolveNonLocalURLs)); 69 69 helper->writeClipboardContents(clipboard, canSmartCopyOrDelete ? PasteboardHelper::IncludeSmartPaste : PasteboardHelper::DoNotIncludeSmartPaste); -
trunk/Source/WebCore/platform/mac/ClipboardMac.mm
r146644 r146835 378 378 ASSERT(frame); 379 379 Pasteboard pasteboard(m_pasteboardName); 380 pasteboard.writeSelection(range, frame->editor()->smartInsertDeleteEnabled() && frame->selection()->granularity() == WordGranularity, frame );380 pasteboard.writeSelection(range, frame->editor()->smartInsertDeleteEnabled() && frame->selection()->granularity() == WordGranularity, frame, IncludeImageAltTextForClipboard); 381 381 } 382 382 -
trunk/Source/WebCore/platform/mac/PasteboardMac.mm
r146391 r146835 136 136 } 137 137 138 String Pasteboard::getStringSelection(Frame* frame )139 { 140 String text = frame->editor()->selectedText();138 String Pasteboard::getStringSelection(Frame* frame, ShouldSerializeSelectedTextForClipboard shouldSerializeSelectedTextForClipboard) 139 { 140 String text = shouldSerializeSelectedTextForClipboard == IncludeImageAltTextForClipboard ? frame->editor()->selectedTextForClipboard() : frame->editor()->selectedText(); 141 141 text.replace(noBreakSpace, ' '); 142 142 return text; … … 176 176 } 177 177 178 void Pasteboard::writeSelectionForTypes(const Vector<String>& pasteboardTypes, bool canSmartCopyOrDelete, Frame* frame )178 void Pasteboard::writeSelectionForTypes(const Vector<String>& pasteboardTypes, bool canSmartCopyOrDelete, Frame* frame, ShouldSerializeSelectedTextForClipboard shouldSerializeSelectedTextForClipboard) 179 179 { 180 180 NSAttributedString* attributedString = nil; … … 209 209 // Put plain string on the pasteboard. 210 210 if (types.contains(String(NSStringPboardType))) 211 platformStrategies()->pasteboardStrategy()->setStringForType(getStringSelection(frame ), NSStringPboardType, m_pasteboardName);211 platformStrategies()->pasteboardStrategy()->setStringForType(getStringSelection(frame, shouldSerializeSelectedTextForClipboard), NSStringPboardType, m_pasteboardName); 212 212 213 213 if (types.contains(WebSmartPastePboardType)) … … 228 228 } 229 229 230 void Pasteboard::writeSelection(Range*, bool canSmartCopyOrDelete, Frame* frame )231 { 232 writeSelectionForTypes(Vector<String>(), canSmartCopyOrDelete, frame );230 void Pasteboard::writeSelection(Range*, bool canSmartCopyOrDelete, Frame* frame, ShouldSerializeSelectedTextForClipboard shouldSerializeSelectedTextForClipboard) 231 { 232 writeSelectionForTypes(Vector<String>(), canSmartCopyOrDelete, frame, shouldSerializeSelectedTextForClipboard); 233 233 } 234 234 -
trunk/Source/WebCore/platform/qt/ClipboardQt.cpp
r146723 r146835 327 327 if (!m_writableData) 328 328 m_writableData = new QMimeData; 329 QString text = frame->editor()->selectedText ();329 QString text = frame->editor()->selectedTextForClipboard(); 330 330 text.replace(QChar(0xa0), QLatin1Char(' ')); 331 331 m_writableData->setText(text); -
trunk/Source/WebCore/platform/qt/PasteboardQt.cpp
r146264 r146835 60 60 } 61 61 62 void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame )62 void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame, ShouldSerializeSelectedTextForClipboard shouldSerializeSelectedTextForClipboard) 63 63 { 64 64 QMimeData* md = new QMimeData; 65 QString text = frame->editor()->selectedText();65 QString text = shouldSerializeSelectedTextForClipboard == IncludeImageAltTextForClipboard ? frame->editor()->selectedTextForClipboard() : frame->editor()->selectedText(); 66 66 text.replace(QChar(0xa0), QLatin1Char(' ')); 67 67 md->setText(text); -
trunk/Source/WebCore/platform/win/ClipboardWin.cpp
r146644 r146835 748 748 ::GlobalFree(medium.hGlobal); 749 749 750 String str = frame->editor()->selectedText ();750 String str = frame->editor()->selectedTextForClipboard(); 751 751 replaceNewlinesWithWindowsStyleNewlines(str); 752 752 replaceNBSPWithSpace(str); -
trunk/Source/WebCore/platform/win/PasteboardWin.cpp
r144536 r146835 114 114 } 115 115 116 void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame )116 void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame, ShouldSerializeSelectedTextForClipboard shouldSerializeSelectedTextForClipboard) 117 117 { 118 118 clear(); … … 130 130 131 131 // Put plain string on the pasteboard. CF_UNICODETEXT covers CF_TEXT as well 132 String str = frame->editor()->selectedText();132 String str = shouldSerializeSelectedTextForClipboard == IncludeImageAltTextForClipboard ? frame->editor()->selectedTextForClipboard() : frame->editor()->selectedText(); 133 133 replaceNewlinesWithWindowsStyleNewlines(str); 134 134 replaceNBSPWithSpace(str); -
trunk/Source/WebCore/platform/wince/PasteboardWinCE.cpp
r141877 r146835 110 110 } 111 111 112 void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame )112 void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame, ShouldSerializeSelectedTextForClipboard shouldSerializeSelectedTextForClipboard) 113 113 { 114 114 clear(); … … 125 125 126 126 // Put plain string on the pasteboard. CF_UNICODETEXT covers CF_TEXT as well 127 String str = frame->selectedText();127 String str = shouldSerializeSelectedTextForClipboard == IncludeImageAltTextForClipboard ? frame->editor()->selectedTextForClipboard() : frame->editor()->selectedText(); 128 128 replaceNewlinesWithWindowsStyleNewlines(str); 129 129 replaceNBSPWithSpace(str); -
trunk/Source/WebCore/platform/wx/PasteboardWx.cpp
r146264 r146835 51 51 } 52 52 53 void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame )53 void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame, ShouldSerializeSelectedTextForClipboard shouldSerializeSelectedTextForClipboard) 54 54 { 55 55 if (wxTheClipboard->Open()) { … … 57 57 wxTheClipboard->SetData(new wxHTMLDataObject(createMarkup(selectedRange, 0, AnnotateForInterchange))); 58 58 #endif 59 wxTheClipboard->SetData(new wxTextDataObject( frame->editor()->selectedText()));59 wxTheClipboard->SetData(new wxTextDataObject(shouldSerializeSelectedTextForClipboard == IncludeImageAltTextForClipboard ? frame->editor()->selectedTextForClipboard() : frame->editor()->selectedText())); 60 60 wxTheClipboard->Close(); 61 61 } -
trunk/Source/WebCore/rendering/RenderImage.h
r146279 r146835 59 59 60 60 bool isGeneratedContent() const { return m_isGeneratedContent; } 61 62 String altText() const { return m_altText; } 61 63 62 64 protected:
Note: See TracChangeset
for help on using the changeset viewer.