Changeset 235955 in webkit
- Timestamp:
- Sep 12, 2018, 3:26:12 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r235954 r235955 1 2018-09-12 Dan Bernstein <mitz@apple.com> 2 3 [Cocoa] Complete support for Paste as Quotation 4 https://bugs.webkit.org/show_bug.cgi?id=189504 5 6 Reviewed by Wenson Hsieh. 7 8 Took a few existing tests of the Paste as Quotation behavior and modified them to use the 9 new PasteAsQuotation command. The only difference in the results is that the blockquote has 10 the "type" attribute set to "cite". 11 12 * editing/pasteboard/4930986-1-paste-as-quotation-expected.txt: Added. 13 * editing/pasteboard/4930986-1-paste-as-quotation.html: Added. 14 * editing/pasteboard/4930986-2-paste-as-quotation-expected.txt: Added. 15 * editing/pasteboard/4930986-2-paste-as-quotation.html: Added. 16 * editing/pasteboard/4930986-3-paste-as-quotation-expected.txt: Added. 17 * editing/pasteboard/4930986-3-paste-as-quotation.html: Added. 18 1 19 2018-09-12 Sihui Liu <sihui_liu@apple.com> 2 20 -
trunk/Source/WebCore/ChangeLog
r235953 r235955 1 2018-09-12 Dan Bernstein <mitz@apple.com> 2 3 [Cocoa] Complete support for Paste as Quotation 4 https://bugs.webkit.org/show_bug.cgi?id=189504 5 6 Reviewed by Wenson Hsieh. 7 8 Tests: editing/pasteboard/4930986-1-paste-as-quotation.html 9 editing/pasteboard/4930986-2-paste-as-quotation.html 10 editing/pasteboard/4930986-3-paste-as-quotation.html 11 12 * editing/Editor.cpp: 13 Added ClipboardEventKind::PasteAsQuotation. 14 (WebCore::eventNameForClipboardEvent): Map PasteAsQuotation to the "paste" DOM event name. 15 (WebCore::createDataTransferForClipboardEvent): Place the unquoted content in the event. 16 This means that currently event handlers can’t emulate pasting as quotation, because they 17 neither have the quoted content nor knowledge that quoting has been requested. We could 18 change this in the future if needed. 19 (WebCore::Editor::paste): Updated for change in pasteWithPasteboard’s argument type. 20 (WebCore::Editor::pasteAsQuotation): Added. Similar to paste, but passes 21 PasteOption::AsQuotation to pasteWithPasteboard. 22 (WebCore::Editor::quoteFragmentForPasting): Added. Quoting for pasting consists of enclosing 23 the fragment in a blockquote element with the "type" attribute set to "cite" and the 24 "class" attribute set to a well-known value, which is used to trigger special behavior in 25 ReplaceSelectionCommand. The behavior includes removing the "class" attribute in the end, 26 so eventually, we could stop using this form of in-band signaling. 27 * editing/Editor.h: Declared PasteOption enum class to encompass the existing allowPlainText 28 and MailBlockquoteHandling arguments to pasteWithPasteboard as well as the new AsQuotation 29 behavior. 30 31 * editing/EditorCommand.cpp: 32 (WebCore::executePasteAsQuotation): Added. Similar to executing Paste. 33 (WebCore::createCommandMap): Added an entry for PasteAsQuotation, based on the Paste entry. 34 35 * editing/cocoa/EditorCocoa.mm: 36 (WebCore::Editor::webContentFromPasteboard): Moved from EditorIOS.mm and EditorMac.mm to 37 here. 38 39 * editing/gtk/EditorGtk.cpp: 40 (WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to 41 quote the fragment if needed. 42 43 * editing/ios/EditorIOS.mm: 44 (WebCore::Editor::pasteWithPasteboard): Ditto. 45 (WebCore::Editor::webContentFromPasteboard): Moved to EditorCocoa.mm. 46 47 * editing/mac/EditorMac.mm: 48 (WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to 49 quote the fragment if needed. 50 (WebCore::Editor::readSelectionFromPasteboard): Updated for new OptionSet argument to 51 pasteWithPasteboard. 52 (WebCore::Editor::webContentFromPasteboard): Moved to EditorCocoa.mm. 53 54 * editing/win/EditorWin.cpp: 55 (WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to 56 quote the fragment if needed. 57 58 * editing/wpe/EditorWPE.cpp: 59 (WebCore::Editor::pasteWithPasteboard): Ditto. 60 1 61 2018-09-11 Simon Fraser <simon.fraser@apple.com> 2 62 -
trunk/Source/WebCore/editing/Editor.cpp
r235775 r235955 55 55 #include "GraphicsContext.h" 56 56 #include "HTMLAttachmentElement.h" 57 #include "HTMLBRElement.h" 57 58 #include "HTMLCollection.h" 58 59 #include "HTMLFormControlElement.h" … … 61 62 #include "HTMLInputElement.h" 62 63 #include "HTMLNames.h" 64 #include "HTMLQuoteElement.h" 63 65 #include "HTMLSpanElement.h" 64 66 #include "HitTestResult.h" … … 328 330 Paste, 329 331 PasteAsPlainText, 332 PasteAsQuotation, 330 333 BeforeCopy, 331 334 BeforeCut, … … 342 345 case ClipboardEventKind::Paste: 343 346 case ClipboardEventKind::PasteAsPlainText: 347 case ClipboardEventKind::PasteAsQuotation: 344 348 return eventNames().pasteEvent; 345 349 case ClipboardEventKind::BeforeCopy: … … 370 374 FALLTHROUGH; 371 375 case ClipboardEventKind::Paste: 376 case ClipboardEventKind::PasteAsQuotation: 372 377 return DataTransfer::createForCopyAndPaste(document, DataTransfer::StoreMode::Readonly, Pasteboard::createForCopyAndPaste()); 373 378 case ClipboardEventKind::BeforeCopy: … … 1405 1410 ResourceCacheValidationSuppressor validationSuppressor(document().cachedResourceLoader()); 1406 1411 if (m_frame.selection().selection().isContentRichlyEditable()) 1407 pasteWithPasteboard(&pasteboard, true);1412 pasteWithPasteboard(&pasteboard, { PasteOption::AllowPlainText }); 1408 1413 else 1409 1414 pasteAsPlainTextWithPasteboard(pasteboard); … … 1418 1423 updateMarkersForWordsAffectedByEditing(false); 1419 1424 pasteAsPlainTextWithPasteboard(*Pasteboard::createForCopyAndPaste()); 1425 } 1426 1427 void Editor::pasteAsQuotation() 1428 { 1429 if (!dispatchClipboardEvent(findEventTargetFromSelection(), ClipboardEventKind::PasteAsQuotation)) 1430 return; 1431 if (!canPaste()) 1432 return; 1433 updateMarkersForWordsAffectedByEditing(false); 1434 ResourceCacheValidationSuppressor validationSuppressor(document().cachedResourceLoader()); 1435 auto pasteboard = Pasteboard::createForCopyAndPaste(); 1436 if (m_frame.selection().selection().isContentRichlyEditable()) 1437 pasteWithPasteboard(pasteboard.get(), { PasteOption::AllowPlainText, PasteOption::AsQuotation }); 1438 else 1439 pasteAsPlainTextWithPasteboard(*pasteboard); 1440 } 1441 1442 void Editor::quoteFragmentForPasting(DocumentFragment& fragment) 1443 { 1444 auto blockQuote = HTMLQuoteElement::create(blockquoteTag, document()); 1445 blockQuote->setAttributeWithoutSynchronization(typeAttr, AtomicString("cite")); 1446 blockQuote->setAttributeWithoutSynchronization(classAttr, AtomicString(ApplePasteAsQuotation)); 1447 1448 auto childNode = fragment.firstChild(); 1449 1450 if (childNode) { 1451 while (childNode) { 1452 blockQuote->appendChild(*childNode); 1453 childNode = fragment.firstChild(); 1454 } 1455 } else 1456 blockQuote->appendChild(HTMLBRElement::create(document())); 1457 1458 fragment.appendChild(blockQuote); 1420 1459 } 1421 1460 -
trunk/Source/WebCore/editing/Editor.h
r235857 r235955 130 130 ~Editor(); 131 131 132 enum class PasteOption : uint8_t { 133 AllowPlainText = 1 << 0, 134 IgnoreMailBlockquote = 1 << 1, 135 AsQuotation = 1 << 2, 136 }; 137 132 138 WEBCORE_EXPORT EditorClient* client() const; 133 139 WEBCORE_EXPORT TextCheckerClient* textChecker() const; … … 159 165 void paste(Pasteboard&); 160 166 WEBCORE_EXPORT void pasteAsPlainText(); 167 void pasteAsQuotation(); 161 168 WEBCORE_EXPORT void performDelete(); 162 169 … … 520 527 bool canSmartReplaceWithPasteboard(Pasteboard&); 521 528 void pasteAsPlainTextWithPasteboard(Pasteboard&); 522 void pasteWithPasteboard(Pasteboard*, bool allowPlainText, MailBlockquoteHandling = MailBlockquoteHandling::RespectBlockquote);529 void pasteWithPasteboard(Pasteboard*, OptionSet<PasteOption>); 523 530 String plainTextFromPasteboard(const PasteboardPlainText&); 531 532 void quoteFragmentForPasting(DocumentFragment&); 524 533 525 534 void revealSelectionAfterEditingOperation(const ScrollAlignment& = ScrollAlignment::alignCenterIfNeeded, RevealExtentOption = DoNotRevealExtent); -
trunk/Source/WebCore/editing/EditorCommand.cpp
r235775 r235955 924 924 } else 925 925 frame.editor().pasteAsPlainText(); 926 return true; 927 } 928 929 static bool executePasteAsQuotation(Frame& frame, Event*, EditorCommandSource source, const String&) 930 { 931 if (source == CommandFromMenuOrKeyBinding) { 932 UserTypingGestureIndicator typingGestureIndicator(frame); 933 frame.editor().pasteAsQuotation(); 934 } else 935 frame.editor().pasteAsQuotation(); 926 936 return true; 927 937 } … … 1637 1647 { "PasteAndMatchStyle", { executePasteAndMatchStyle, supportedPaste, enabledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabledPaste } }, 1638 1648 { "PasteAsPlainText", { executePasteAsPlainText, supportedPaste, enabledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabledPaste } }, 1649 { "PasteAsQuotation", { executePasteAsQuotation, supportedPaste, enabledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabledPaste } }, 1639 1650 { "Print", { executePrint, supported, enabled, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1640 1651 { "Redo", { executeRedo, supported, enabledRedo, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, -
trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm
r235343 r235955 292 292 } 293 293 294 } 294 // FIXME: Should give this function a name that makes it clear it adds resources to the document loader as a side effect. 295 // Or refactor so it does not do that. 296 RefPtr<DocumentFragment> Editor::webContentFromPasteboard(Pasteboard& pasteboard, Range& context, bool allowPlainText, bool& chosePlainText) 297 { 298 WebContentReader reader(m_frame, context, allowPlainText); 299 pasteboard.read(reader); 300 chosePlainText = reader.madeFragmentFromPlainText; 301 return WTFMove(reader.fragment); 302 } 303 304 } -
trunk/Source/WebCore/editing/gtk/EditorGtk.cpp
r222603 r235955 87 87 } 88 88 89 void Editor::pasteWithPasteboard(Pasteboard* pasteboard, bool allowPlainText, MailBlockquoteHandling mailBlockquoteHandling)89 void Editor::pasteWithPasteboard(Pasteboard* pasteboard, OptionSet<PasteOption> options) 90 90 { 91 91 RefPtr<Range> range = selectedRange(); … … 94 94 95 95 bool chosePlainText; 96 RefPtr<DocumentFragment> fragment = createFragmentFromPasteboardData(*pasteboard, m_frame, *range, allowPlainText, chosePlainText); 96 RefPtr<DocumentFragment> fragment = createFragmentFromPasteboardData(*pasteboard, m_frame, *range, options.contains(PasteOption::AllowPlainText), chosePlainText); 97 98 if (fragment && options.contains(PasteOption::AsQuotation)) 99 quoteFragmentForPasting(*fragment); 100 97 101 if (fragment && shouldInsertFragment(*fragment, range.get(), EditorInsertAction::Pasted)) 98 pasteAsFragment(fragment.releaseNonNull(), canSmartReplaceWithPasteboard(*pasteboard), chosePlainText, mailBlockquoteHandling);102 pasteAsFragment(fragment.releaseNonNull(), canSmartReplaceWithPasteboard(*pasteboard), chosePlainText, options.contains(PasteOption::IgnoreMailBlockquote) ? MailBlockquoteHandling::IgnoreBlockquote : MailBlockquoteHandling::RespectBlockquote); 99 103 } 100 104 -
trunk/Source/WebCore/editing/ios/EditorIOS.mm
r235775 r235955 216 216 } 217 217 218 // FIXME: Should give this function a name that makes it clear it adds resources to the document loader as a side effect. 219 // Or refactor so it does not do that. 220 RefPtr<DocumentFragment> Editor::webContentFromPasteboard(Pasteboard& pasteboard, Range& context, bool allowPlainText, bool& chosePlainText) 221 { 222 WebContentReader reader(m_frame, context, allowPlainText); 223 pasteboard.read(reader); 224 chosePlainText = reader.madeFragmentFromPlainText; 225 return WTFMove(reader.fragment); 226 } 227 228 void Editor::pasteWithPasteboard(Pasteboard* pasteboard, bool allowPlainText, MailBlockquoteHandling mailBlockquoteHandling) 218 void Editor::pasteWithPasteboard(Pasteboard* pasteboard, OptionSet<PasteOption> options) 229 219 { 230 220 RefPtr<Range> range = selectedRange(); 221 bool allowPlainText = options.contains(PasteOption::AllowPlainText); 231 222 WebContentReader reader(m_frame, *range, allowPlainText); 232 223 int numberOfPasteboardItems = client()->getPasteboardItemsCount(); … … 244 235 } 245 236 237 if (fragment && options.contains(PasteOption::AsQuotation)) 238 quoteFragmentForPasting(*fragment); 239 246 240 if (fragment && shouldInsertFragment(*fragment, range.get(), EditorInsertAction::Pasted)) 247 pasteAsFragment(fragment.releaseNonNull(), canSmartReplaceWithPasteboard(*pasteboard), false, mailBlockquoteHandling);241 pasteAsFragment(fragment.releaseNonNull(), canSmartReplaceWithPasteboard(*pasteboard), false, options.contains(PasteOption::IgnoreMailBlockquote) ? MailBlockquoteHandling::IgnoreBlockquote : MailBlockquoteHandling::RespectBlockquote); 248 242 } 249 243 -
trunk/Source/WebCore/editing/mac/EditorMac.mm
r235935 r235955 78 78 } 79 79 80 void Editor::pasteWithPasteboard(Pasteboard* pasteboard, bool allowPlainText, MailBlockquoteHandling mailBlockquoteHandling)80 void Editor::pasteWithPasteboard(Pasteboard* pasteboard, OptionSet<PasteOption> options) 81 81 { 82 82 RefPtr<Range> range = selectedRange(); … … 88 88 89 89 bool chosePlainText; 90 RefPtr<DocumentFragment> fragment = webContentFromPasteboard(*pasteboard, *range, allowPlainText, chosePlainText); 90 RefPtr<DocumentFragment> fragment = webContentFromPasteboard(*pasteboard, *range, options.contains(PasteOption::AllowPlainText), chosePlainText); 91 92 if (fragment && options.contains(PasteOption::AsQuotation)) 93 quoteFragmentForPasting(*fragment); 91 94 92 95 if (fragment && shouldInsertFragment(*fragment, range.get(), EditorInsertAction::Pasted)) 93 pasteAsFragment(fragment.releaseNonNull(), canSmartReplaceWithPasteboard(*pasteboard), false, mailBlockquoteHandling);96 pasteAsFragment(fragment.releaseNonNull(), canSmartReplaceWithPasteboard(*pasteboard), false, options.contains(PasteOption::IgnoreMailBlockquote) ? MailBlockquoteHandling::IgnoreBlockquote : MailBlockquoteHandling::RespectBlockquote ); 94 97 95 98 client()->setInsertionPasteboard(String()); … … 121 124 Pasteboard pasteboard(pasteboardName); 122 125 if (m_frame.selection().selection().isContentRichlyEditable()) 123 pasteWithPasteboard(&pasteboard, true);126 pasteWithPasteboard(&pasteboard, { PasteOption::AllowPlainText }); 124 127 else 125 128 pasteAsPlainTextWithPasteboard(pasteboard); … … 277 280 } 278 281 279 // FIXME: Should give this function a name that makes it clear it adds resources to the document loader as a side effect.280 // Or refactor so it does not do that.281 RefPtr<DocumentFragment> Editor::webContentFromPasteboard(Pasteboard& pasteboard, Range& context, bool allowPlainText, bool& chosePlainText)282 {283 WebContentReader reader(m_frame, context, allowPlainText);284 pasteboard.read(reader);285 chosePlainText = reader.madeFragmentFromPlainText;286 return WTFMove(reader.fragment);287 }288 289 282 } // namespace WebCore 290 283 -
trunk/Source/WebCore/editing/win/EditorWin.cpp
r216351 r235955 36 36 namespace WebCore { 37 37 38 void Editor::pasteWithPasteboard(Pasteboard* pasteboard, bool allowPlainText, MailBlockquoteHandling mailBlockquoteHandling)38 void Editor::pasteWithPasteboard(Pasteboard* pasteboard, OptionSet<PasteOption> options) 39 39 { 40 40 RefPtr<Range> range = selectedRange(); … … 43 43 44 44 bool chosePlainText; 45 RefPtr<DocumentFragment> fragment = pasteboard->documentFragment(m_frame, *range, allowPlainText, chosePlainText); 45 RefPtr<DocumentFragment> fragment = pasteboard->documentFragment(m_frame, *range, options.contains(PasteOption::AllowPlainText), chosePlainText); 46 47 if (fragment && options.contains(PasteOption::AsQuotation)) 48 quoteFragmentForPasting(*fragment); 49 46 50 if (fragment && shouldInsertFragment(*fragment, range.get(), EditorInsertAction::Pasted)) 47 pasteAsFragment(fragment.releaseNonNull(), canSmartReplaceWithPasteboard(*pasteboard), chosePlainText, mailBlockquoteHandling);51 pasteAsFragment(fragment.releaseNonNull(), canSmartReplaceWithPasteboard(*pasteboard), chosePlainText, options.contains(PasteOption::IgnoreMailBlockquote) ? MailBlockquoteHandling::IgnoreBlockquote : MailBlockquoteHandling::RespectBlockquote); 48 52 } 49 53 -
trunk/Source/WebCore/editing/wpe/EditorWPE.cpp
r222680 r235955 74 74 } 75 75 76 void Editor::pasteWithPasteboard(Pasteboard* pasteboard, bool allowPlainText, MailBlockquoteHandling mailBlockquoteHandling)76 void Editor::pasteWithPasteboard(Pasteboard* pasteboard, OptionSet<PasteOption> options) 77 77 { 78 78 RefPtr<Range> range = selectedRange(); … … 81 81 82 82 bool chosePlainText; 83 RefPtr<DocumentFragment> fragment = createFragmentFromPasteboardData(*pasteboard, m_frame, *range, allowPlainText, chosePlainText); 83 RefPtr<DocumentFragment> fragment = createFragmentFromPasteboardData(*pasteboard, m_frame, *range, options.contains(PasteOption::AllowPlainText), chosePlainText); 84 85 if (fragment && options.contains(PasteOption::AsQuotation)) 86 quoteFragmentForPasting(*fragment); 87 84 88 if (fragment && shouldInsertFragment(*fragment, range.get(), EditorInsertAction::Pasted)) 85 pasteAsFragment(*fragment, canSmartReplaceWithPasteboard(*pasteboard), chosePlainText, mailBlockquoteHandling);89 pasteAsFragment(*fragment, canSmartReplaceWithPasteboard(*pasteboard), chosePlainText, options.contains(PasteOption::IgnoreMailBlockquote) ? MailBlockquoteHandling::IgnoreBlockquote : MailBlockquoteHandling::RespectBlockquote); 86 90 } 87 91 -
trunk/Source/WebKit/ChangeLog
r235954 r235955 1 2018-09-12 Dan Bernstein <mitz@apple.com> 2 3 [Cocoa] Complete support for Paste as Quotation 4 https://bugs.webkit.org/show_bug.cgi?id=189504 5 6 Reviewed by Wenson Hsieh. 7 8 * UIProcess/API/Cocoa/WKWebView.mm: 9 (-[WKWebView canPerformAction:withSender:]): Handle _pasteAsQuotation:. It’s not included 10 in FOR_EACH_WKCONTENTVIEW_ACTION, because it’s declared and implemented in the WKPrivate 11 category. If we add more actions in the category, it could make sense to fold them into 12 a new FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION. 13 (-[WKWebView targetForAction:withSender:]): Handle _pasteAsQuotation:. 14 (-[WKWebView _pasteAsQuotation:]): Send to the WebViewImpl or the WKContentView. 15 * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared a new _pasteAsQuotation: action. 16 17 * UIProcess/Cocoa/WebViewImpl.mm: 18 (WebKit::selectorExceptionMap): Added a custom mapping from the new selector to the 19 PasteAsQuotation command. 20 21 * UIProcess/ios/WKContentViewInteraction.h: Declare methods for the new action. 22 * UIProcess/ios/WKContentViewInteraction.mm: 23 Forward _pasteAsQuotation: to the WKWebView so that clients get a chance to override its 24 behavior. 25 (-[WKContentView _pasteAsQuotationForWebView:]): Send the command to the page. 26 1 27 2018-09-12 Sihui Liu <sihui_liu@apple.com> 2 28 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r235944 r235955 1388 1388 FOR_EACH_WKCONTENTVIEW_ACTION(FORWARD_CANPERFORMACTION_TO_WKCONTENTVIEW) 1389 1389 1390 FORWARD_CANPERFORMACTION_TO_WKCONTENTVIEW(_pasteAsQuotation) 1391 1390 1392 #undef FORWARD_CANPERFORMACTION_TO_WKCONTENTVIEW 1391 1393 … … 1400 1402 1401 1403 FOR_EACH_WKCONTENTVIEW_ACTION(FORWARD_TARGETFORACTION_TO_WKCONTENTVIEW) 1404 1405 FORWARD_TARGETFORACTION_TO_WKCONTENTVIEW(_pasteAsQuotation) 1402 1406 1403 1407 #undef FORWARD_TARGETFORACTION_TO_WKCONTENTVIEW … … 4548 4552 } 4549 4553 4554 - (void)_pasteAsQuotation:(id)sender 4555 { 4556 #if PLATFORM(MAC) 4557 _impl->executeEditCommandForSelector(_cmd); 4558 #else 4559 if (self.usesStandardContentView) 4560 [_contentView _pasteAsQuotationForWebView:sender]; 4561 #endif 4562 } 4563 4550 4564 - (void)_evaluateJavaScriptWithoutUserGesture:(NSString *)javaScriptString completionHandler:(void (^)(id, NSError *))completionHandler 4551 4565 { -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
r235944 r235955 185 185 - (_WKAttachment *)_insertAttachmentWithFileWrapper:(NSFileWrapper *)fileWrapper contentType:(NSString *)contentType options:(_WKAttachmentDisplayOptions *)options completion:(void(^)(BOOL success))completionHandler WK_API_DEPRECATED_WITH_REPLACEMENT("-_insertAttachmentWithFileWrapper:contentType:completion:", macosx(WK_MAC_TBA, WK_MAC_TBA), ios(WK_IOS_TBA, WK_IOS_TBA)); 186 186 - (_WKAttachment *)_insertAttachmentWithFileWrapper:(NSFileWrapper *)fileWrapper contentType:(NSString *)contentType completion:(void(^)(BOOL success))completionHandler WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); 187 188 - (IBAction)_pasteAsQuotation:(id)sender WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); 187 189 188 190 #if TARGET_OS_IPHONE -
trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
r235944 r235955 2625 2625 { @selector(pageUpAndModifySelection:), "MovePageUpAndModifySelection"_s }, 2626 2626 { @selector(scrollPageDown:), "ScrollPageForward"_s }, 2627 { @selector(scrollPageUp:), "ScrollPageBackward"_s } 2627 { @selector(scrollPageUp:), "ScrollPageBackward"_s }, 2628 #if WK_API_ENABLED 2629 { @selector(_pasteAsQuotation:), "PasteAsQuotation"_s }, 2630 #endif 2628 2631 }; 2629 2632 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
r235878 r235955 317 317 - (void)_action ## ForWebView:(id)sender; 318 318 FOR_EACH_WKCONTENTVIEW_ACTION(DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW) 319 DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW(_pasteAsQuotation) 319 320 #undef DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW 320 321 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r235878 r235955 2162 2162 FOR_EACH_WKCONTENTVIEW_ACTION(FORWARD_ACTION_TO_WKWEBVIEW) 2163 2163 2164 FORWARD_ACTION_TO_WKWEBVIEW(_pasteAsQuotation) 2165 2164 2166 #undef FORWARD_ACTION_TO_WKWEBVIEW 2165 2167 … … 2461 2463 { 2462 2464 _page->executeEditCommand("paste"_s); 2465 } 2466 2467 - (void)_pasteAsQuotationForWebView:(id)sender 2468 { 2469 _page->executeEditCommand("PasteAsQuotation"_s); 2463 2470 } 2464 2471 -
trunk/Tools/ChangeLog
r235954 r235955 1 2018-09-12 Dan Bernstein <mitz@apple.com> 2 3 [Cocoa] Complete support for Paste as Quotation 4 https://bugs.webkit.org/show_bug.cgi?id=189504 5 6 Reviewed by Wenson Hsieh. 7 8 * MiniBrowser/mac/MainMenu.xib: Added a Paste as Quotation command in the Edit menu. 9 1 10 2018-09-12 Sihui Liu <sihui_liu@apple.com> 2 11 -
trunk/Tools/MiniBrowser/mac/MainMenu.xib
r226008 r235955 198 198 </connections> 199 199 </menuItem> 200 <menuItem title="Paste as Quotation" keyEquivalent="V" id="8Ng-DB-z0Y"> 201 <connections> 202 <action selector="_pasteAsQuotation:" target="-1" id="6Mn-XC-2qO"/> 203 </connections> 204 </menuItem> 200 205 <menuItem title="Paste and Match Style" keyEquivalent="V" id="485"> 201 206 <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
Note:
See TracChangeset
for help on using the changeset viewer.