Changeset 207797 in webkit
- Timestamp:
- Oct 24, 2016 6:48:42 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r207795 r207797 1 2016-10-24 Chris Dumez <cdumez@apple.com> 2 3 event.(dataTransfer|clipboardData).getData('text/html') (onpaste, ondrop) 4 https://bugs.webkit.org/show_bug.cgi?id=19893 5 <rdar://problem/6055546> 6 7 Reviewed by Ryosuke Niwa. 8 9 Unskip corresponding tests on Mac. 10 11 * editing/pasteboard/onpaste-text-html-expected.txt: 12 * fast/events/ondrop-text-html-expected.txt: 13 * platform/mac/TestExpectations: 14 * platform/wk2/TestExpectations: 15 1 16 2016-10-24 Alex Christensen <achristensen@webkit.org> 2 17 -
trunk/LayoutTests/editing/pasteboard/onpaste-text-html-expected.txt
r145168 r207797 1 1 CONSOLE MESSAGE: line 21: text/plain: This test verifies that we can get text/html from the clipboard during an onpaste event. 2 CONSOLE MESSAGE: line 23: text/html: <span style="color: rgb(0, 0, 0); font-size: medium; font-style: normal; font-variant : normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none;">This test verifies that we can get text/html from the clipboard during an onpaste event.<span class="Apple-converted-space"> </span></span>2 CONSOLE MESSAGE: line 23: text/html: <span style="color: rgb(0, 0, 0); font-size: medium; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none;">This test verifies that we can get text/html from the clipboard during an onpaste event.<span class="Apple-converted-space"> </span></span> 3 3 This test verifies that we can get text/html from the clipboard during an onpaste event. This test requires DRT. 4 4 Paste content in this div.This test verifies that we can get text/html from the clipboard during an onpaste event. -
trunk/LayoutTests/fast/events/ondrop-text-html-expected.txt
r145168 r207797 1 1 CONSOLE MESSAGE: line 21: text/plain: This test verifies that we can get text/html from the drag object during an ondrop event. 2 CONSOLE MESSAGE: line 23: text/html: <span style="color: rgb(0, 0, 0); font-size: medium; font-style: normal; font-variant : normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none;">This test verifies that we can get text/html from the drag object during an ondrop event.<span class="Apple-converted-space"> </span></span>2 CONSOLE MESSAGE: line 23: text/html: <span style="color: rgb(0, 0, 0); font-size: medium; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none;">This test verifies that we can get text/html from the drag object during an ondrop event.<span class="Apple-converted-space"> </span></span> 3 3 This test verifies that we can get text/html from the drag object during an ondrop event. This test requires DRT. 4 4 PASS -
trunk/LayoutTests/platform/mac/TestExpectations
r207786 r207797 96 96 # Need to add functionality to DumpRenderTree to handle scrollbar policy changes 97 97 fast/overflow/scrollbar-restored-and-then-locked.html 98 99 # Mac port doesn't put text/html on the pasteboard for app compatibility: https://bugs.webkit.org/show_bug.cgi?id=19893100 editing/pasteboard/onpaste-text-html-types.html101 editing/pasteboard/onpaste-text-html.html102 fast/events/ondrop-text-html.html103 98 104 99 # EventSendingController does not send events on areas outside the WebView. -
trunk/LayoutTests/platform/wk2/TestExpectations
r207330 r207797 225 225 fast/events/moving-text-should-fire-drop-and-dragend-events.html 226 226 fast/events/moving-text-should-fire-drop-and-dragend-events-2.html 227 fast/events/ondrop-text-html.html 227 228 editing/pasteboard/drag-drop-url-with-style.html 228 229 -
trunk/Source/WebCore/ChangeLog
r207795 r207797 1 2016-10-24 Chris Dumez <cdumez@apple.com> 2 3 event.(dataTransfer|clipboardData).getData('text/html') (onpaste, ondrop) 4 https://bugs.webkit.org/show_bug.cgi?id=19893 5 <rdar://problem/6055546> 6 7 Reviewed by Ryosuke Niwa. 8 9 We now write selection as HTML as well to the pasteboard so that 10 event.(dataTransfer|clipboardData).getData('text/html') now works. 11 12 I have verified manually that it is still possible to copy text from 13 Safari and paste it to Excel 2011 Mac after this change. The text is 14 now pasted as HTML instead of text, which is fine because Excel can 15 display HTML. 16 17 No new tests, unskipped existing tests. 18 19 * editing/Editor.h: 20 * editing/mac/EditorMac.mm: 21 (WebCore::Editor::selectionInHTMLFormat): 22 (WebCore::Editor::writeSelectionToPasteboard): 23 * platform/Pasteboard.h: 24 * platform/mac/PasteboardMac.mm: 25 (WebCore::Pasteboard::write): 26 1 27 2016-10-24 Alex Christensen <achristensen@webkit.org> 2 28 -
trunk/Source/WebCore/editing/Editor.h
r207670 r207797 510 510 #if PLATFORM(COCOA) 511 511 RefPtr<SharedBuffer> selectionInWebArchiveFormat(); 512 String selectionInHTMLFormat(); 512 513 RefPtr<SharedBuffer> imageInWebArchiveFormat(Element&); 513 514 RefPtr<Range> adjustedSelectionRange(); -
trunk/Source/WebCore/editing/mac/EditorMac.mm
r206965 r207797 311 311 } 312 312 313 String Editor::selectionInHTMLFormat() 314 { 315 return createMarkup(*selectedRange(), nullptr, AnnotateForInterchange, false, ResolveNonLocalURLs); 316 } 317 313 318 RefPtr<SharedBuffer> Editor::imageInWebArchiveFormat(Element& imageElement) 314 319 { … … 394 399 content.dataInRTFDFormat = [attributedString containsAttachments] ? dataInRTFDFormat(attributedString) : 0; 395 400 content.dataInRTFFormat = dataInRTFFormat(attributedString); 401 content.dataInHTMLFormat = selectionInHTMLFormat(); 396 402 content.dataInStringFormat = stringSelectionForPasteboardWithImageAltText(); 397 403 client()->getClientPasteboardDataForRange(selectedRange().get(), content.clientTypes, content.clientData); -
trunk/Source/WebCore/platform/Pasteboard.h
r206965 r207797 71 71 RefPtr<SharedBuffer> dataInRTFDFormat; 72 72 RefPtr<SharedBuffer> dataInRTFFormat; 73 String dataInHTMLFormat; 73 74 String dataInStringFormat; 74 75 Vector<String> clientTypes; -
trunk/Source/WebCore/platform/mac/PasteboardMac.mm
r206965 r207797 154 154 if (content.dataInRTFFormat) 155 155 types.append(String(NSRTFPboardType)); 156 if (!content.dataInHTMLFormat.isNull()) 157 types.append(String(NSHTMLPboardType)); 156 158 if (!content.dataInStringFormat.isNull()) 157 159 types.append(String(NSStringPboardType)); … … 171 173 if (content.dataInRTFFormat) 172 174 m_changeCount = platformStrategies()->pasteboardStrategy()->setBufferForType(content.dataInRTFFormat.get(), NSRTFPboardType, m_pasteboardName); 175 if (!content.dataInHTMLFormat.isNull()) 176 m_changeCount = platformStrategies()->pasteboardStrategy()->setStringForType(content.dataInHTMLFormat, NSHTMLPboardType, m_pasteboardName); 173 177 if (!content.dataInStringFormat.isNull()) 174 178 m_changeCount = platformStrategies()->pasteboardStrategy()->setStringForType(content.dataInStringFormat, NSStringPboardType, m_pasteboardName);
Note: See TracChangeset
for help on using the changeset viewer.