Changeset 292898 in webkit
- Timestamp:
- Apr 14, 2022, 6:45:58 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 20 edited
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/dom/TextEvent.cpp (modified) (2 diffs)
-
Source/WebCore/dom/TextEvent.h (modified) (3 diffs)
-
Source/WebCore/dom/TextEventInputType.h (modified) (1 diff)
-
Source/WebCore/editing/EditAction.cpp (modified) (1 diff)
-
Source/WebCore/editing/EditAction.h (modified) (1 diff)
-
Source/WebCore/editing/Editor.cpp (modified) (4 diffs)
-
Source/WebCore/editing/Editor.h (modified) (2 diffs)
-
Source/WebCore/editing/cocoa/EditorCocoa.mm (modified) (2 diffs)
-
Source/WebCore/en.lproj/Localizable.strings (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm (modified) (1 diff)
-
Source/WebKit/UIProcess/WebPageProxy.h (modified) (2 diffs)
-
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (modified) (1 diff)
-
Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm (modified) (1 diff)
-
Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm (modified) (2 diffs)
-
Source/WebKit/WebProcess/WebPage/WebPage.h (modified) (1 diff)
-
Source/WebKit/WebProcess/WebPage/WebPage.messages.in (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKitCocoa/ImageAnalysisTests.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r292895 r292898 1 2022-04-14 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Undo option after invoking "Markup Image" says "Undo Paste" 4 https://bugs.webkit.org/show_bug.cgi?id=239351 5 rdar://91647863 6 7 Reviewed by Darin Adler. 8 9 Add plumbing to allow a caller of `Editor::replaceNodeFromPasteboard` to specify an `EditAction` for the editing 10 command that is not just `EditAction::Paste`, and use it to supply a more specific edit action type of 11 `MarkupImage` in the case where "Markup Image" is used to replace an image element with other image data. This 12 allows the undo/redo title to be more accurate than simply "Undo/Redo Paste". 13 14 Test: ImageAnalysisTests.PerformImageAnalysisMarkup 15 16 * dom/TextEvent.cpp: 17 (WebCore::TextEvent::createForPlainTextPaste): 18 (WebCore::TextEvent::createForFragmentPaste): 19 (WebCore::TextEvent::TextEvent): 20 * dom/TextEvent.h: 21 * dom/TextEventInputType.h: 22 23 Introduce TextEventInputMarkup. This is used to preserve the fact that a `TextEvent` was triggered via 24 "Markup Image" as opposed to a regular "Paste" command, when plumbing this event object through DOM event 25 propagation code. Once it reenters editing code, we consult this type to re-map this event to 26 `EditAction::MarkupImage` if appropriate. 27 28 I opted for this (slightly more roundabout) approach to prevent a potential layering violation, due to TextEvent 29 otherwise knowing about `EditAction`. 30 31 * editing/EditAction.cpp: 32 (WebCore::undoRedoLabel): 33 * editing/EditAction.h: 34 35 Introduce EditAction::MarkupImage. Additionally, alphabetically sort these enum types. 36 37 * editing/Editor.cpp: 38 (WebCore::Editor::handleTextEvent): 39 (WebCore::Editor::pasteAsFragment): 40 (WebCore::Editor::replaceSelectionWithFragment): 41 * editing/Editor.h: 42 * editing/cocoa/EditorCocoa.mm: 43 (WebCore::Editor::replaceNodeFromPasteboard): 44 45 Add an `EditAction` argument; by default, this is `EditAction::Paste`. 46 47 * en.lproj/Localizable.strings: 48 49 Add a new localized string to represent the name of the "Markup Image" item, for the purposes of setting the 50 Redo/Undo action title. 51 1 52 2022-04-14 Caitlin Potter <caitp@igalia.com> 2 53 -
trunk/Source/WebCore/dom/TextEvent.cpp
r283237 r292898 49 49 Ref<TextEvent> TextEvent::createForPlainTextPaste(RefPtr<WindowProxy>&& view, const String& data, bool shouldSmartReplace) 50 50 { 51 return adoptRef(*new TextEvent(WTFMove(view), data, nullptr, shouldSmartReplace, false, MailBlockquoteHandling::RespectBlockquote));51 return adoptRef(*new TextEvent(WTFMove(view), data, nullptr, TextEventInputPaste, shouldSmartReplace, false, MailBlockquoteHandling::RespectBlockquote)); 52 52 } 53 53 54 Ref<TextEvent> TextEvent::createForFragmentPaste(RefPtr<WindowProxy>&& view, RefPtr<DocumentFragment>&& data, bool shouldSmartReplace, bool shouldMatchStyle, MailBlockquoteHandling mailBlockquoteHandling)54 Ref<TextEvent> TextEvent::createForFragmentPaste(RefPtr<WindowProxy>&& view, RefPtr<DocumentFragment>&& data, TextEventInputType inputType, bool shouldSmartReplace, bool shouldMatchStyle, MailBlockquoteHandling mailBlockquoteHandling) 55 55 { 56 return adoptRef(*new TextEvent(WTFMove(view), emptyString(), WTFMove(data), shouldSmartReplace, shouldMatchStyle, mailBlockquoteHandling));56 return adoptRef(*new TextEvent(WTFMove(view), emptyString(), WTFMove(data), inputType, shouldSmartReplace, shouldMatchStyle, mailBlockquoteHandling)); 57 57 } 58 58 … … 85 85 } 86 86 87 TextEvent::TextEvent(RefPtr<WindowProxy>&& view, const String& data, RefPtr<DocumentFragment>&& pastingFragment, bool shouldSmartReplace, bool shouldMatchStyle, MailBlockquoteHandling mailBlockquoteHandling)87 TextEvent::TextEvent(RefPtr<WindowProxy>&& view, const String& data, RefPtr<DocumentFragment>&& pastingFragment, TextEventInputType inputType, bool shouldSmartReplace, bool shouldMatchStyle, MailBlockquoteHandling mailBlockquoteHandling) 88 88 : UIEvent(eventNames().textInputEvent, CanBubble::Yes, IsCancelable::Yes, IsComposed::Yes, WTFMove(view), 0) 89 , m_inputType( TextEventInputPaste)89 , m_inputType(inputType) 90 90 , m_data(data) 91 91 , m_pastingFragment(WTFMove(pastingFragment)) -
trunk/Source/WebCore/dom/TextEvent.h
r250060 r292898 43 43 static Ref<TextEvent> createForBindings(); 44 44 static Ref<TextEvent> createForPlainTextPaste(RefPtr<WindowProxy>&&, const String& data, bool shouldSmartReplace); 45 static Ref<TextEvent> createForFragmentPaste(RefPtr<WindowProxy>&&, RefPtr<DocumentFragment>&& data, bool shouldSmartReplace, bool shouldMatchStyle, MailBlockquoteHandling);45 static Ref<TextEvent> createForFragmentPaste(RefPtr<WindowProxy>&&, RefPtr<DocumentFragment>&& data, TextEventInputType, bool shouldSmartReplace, bool shouldMatchStyle, MailBlockquoteHandling); 46 46 static Ref<TextEvent> createForDrop(RefPtr<WindowProxy>&&, const String& data); 47 47 static Ref<TextEvent> createForDictation(RefPtr<WindowProxy>&&, const String& data, const Vector<DictationAlternative>& dictationAlternatives); … … 63 63 bool isAutocompletion() const { return m_inputType == TextEventInputAutocompletion; } 64 64 bool isKeyboard() const { return m_inputType == TextEventInputKeyboard; } 65 bool isMarkup() const { return m_inputType == TextEventInputMarkup; } 65 66 66 67 bool shouldSmartReplace() const { return m_shouldSmartReplace; } … … 74 75 75 76 TextEvent(RefPtr<WindowProxy>&&, const String& data, TextEventInputType = TextEventInputKeyboard); 76 TextEvent(RefPtr<WindowProxy>&&, const String& data, RefPtr<DocumentFragment>&&, bool shouldSmartReplace, bool shouldMatchStyle, MailBlockquoteHandling);77 TextEvent(RefPtr<WindowProxy>&&, const String& data, RefPtr<DocumentFragment>&&, TextEventInputType, bool shouldSmartReplace, bool shouldMatchStyle, MailBlockquoteHandling); 77 78 TextEvent(RefPtr<WindowProxy>&&, const String& data, const Vector<DictationAlternative>& dictationAlternatives); 78 79 -
trunk/Source/WebCore/dom/TextEventInputType.h
r208179 r292898 37 37 TextEventInputDrop, 38 38 TextEventInputDictation, 39 TextEventInputMarkup, 39 40 TextEventInputOther, 40 41 }; -
trunk/Source/WebCore/editing/EditAction.cpp
r266342 r292898 143 143 case EditAction::ConvertToUnorderedList: 144 144 return WEB_UI_STRING_KEY("Convert to Unordered List", "Convert to Unordered List (Undo action name)", "Undo action name"); 145 case EditAction::MarkupImage: 146 return WEB_UI_STRING_KEY("Markup Image", "Image analysis markup menu item (Undo action name)", "Undo action name"); 145 147 } 146 148 return { }; -
trunk/Source/WebCore/editing/EditAction.h
r266342 r292898 33 33 34 34 enum class EditAction : uint8_t { 35 Unspecified,36 Insert,37 InsertReplacement,38 InsertFromDrop,39 SetColor,40 SetBackgroundColor,41 TurnOffKerning,42 TightenKerning,43 LoosenKerning,44 UseStandardKerning,45 TurnOffLigatures,46 UseStandardLigatures,47 UseAllLigatures,48 RaiseBaseline,49 LowerBaseline,50 SetTraditionalCharacterShape,51 SetFont,52 ChangeAttributes,53 35 AlignLeft, 54 36 AlignRight, 37 Bold, 55 38 Center, 39 ChangeAttributes, 40 ConvertToOrderedList, 41 ConvertToUnorderedList, 42 CreateLink, 43 Cut, 44 Delete, 45 DeleteByDrag, 46 Dictation, 47 FormatBlock, 48 Indent, 49 Insert, 50 InsertFromDrop, 51 InsertOrderedList, 52 InsertReplacement, 53 InsertUnorderedList, 54 Italics, 56 55 Justify, 57 SetInlineWritingDirection, 58 SetBlockWritingDirection, 59 Subscript, 60 Superscript, 61 Underline, 62 StrikeThrough, 56 LoosenKerning, 57 LowerBaseline, 58 MarkupImage, 59 Outdent, 63 60 Outline, 64 Unscript,65 DeleteByDrag,66 Cut,67 Bold,68 Italics,69 Delete,70 Dictation,71 61 Paste, 72 62 PasteFont, 73 63 PasteRuler, 74 TypingDeleteSelection, 64 RaiseBaseline, 65 SetBackgroundColor, 66 SetBlockWritingDirection, 67 SetColor, 68 SetFont, 69 SetInlineWritingDirection, 70 SetTraditionalCharacterShape, 71 StrikeThrough, 72 Subscript, 73 Superscript, 74 TightenKerning, 75 TurnOffKerning, 76 TurnOffLigatures, 75 77 TypingDeleteBackward, 78 TypingDeleteFinalComposition, 76 79 TypingDeleteForward, 77 TypingDeleteWordBackward,78 TypingDeleteWordForward,79 80 TypingDeleteLineBackward, 80 81 TypingDeleteLineForward, 81 82 TypingDeletePendingComposition, 82 TypingDeleteFinalComposition, 83 TypingInsertText, 83 TypingDeleteSelection, 84 TypingDeleteWordBackward, 85 TypingDeleteWordForward, 86 TypingInsertFinalComposition, 84 87 TypingInsertLineBreak, 85 88 TypingInsertParagraph, 86 89 TypingInsertPendingComposition, 87 TypingInsert FinalComposition,88 CreateLink,90 TypingInsertText, 91 Underline, 89 92 Unlink, 90 FormatBlock, 91 InsertOrderedList, 92 InsertUnorderedList, 93 ConvertToOrderedList, 94 ConvertToUnorderedList, 95 Indent, 96 Outdent 93 Unscript, 94 Unspecified, 95 UseAllLigatures, 96 UseStandardKerning, 97 UseStandardLigatures, 97 98 }; 98 99 -
trunk/Source/WebCore/editing/Editor.cpp
r292810 r292898 338 338 return false; 339 339 340 if (event.isPaste()) { 340 if (event.isPaste() || event.isMarkup()) { 341 auto action = event.isMarkup() ? EditAction::MarkupImage : EditAction::Paste; 341 342 if (event.pastingFragment()) { 342 343 #if PLATFORM(IOS_FAMILY) … … 344 345 return true; 345 346 #endif 346 replaceSelectionWithFragment(*event.pastingFragment(), SelectReplacement::No, event.shouldSmartReplace() ? SmartReplace::Yes : SmartReplace::No, event.shouldMatchStyle() ? MatchStyle::Yes : MatchStyle::No, EditAction::Paste, event.mailBlockquoteHandling());347 replaceSelectionWithFragment(*event.pastingFragment(), SelectReplacement::No, event.shouldSmartReplace() ? SmartReplace::Yes : SmartReplace::No, event.shouldMatchStyle() ? MatchStyle::Yes : MatchStyle::No, action, event.mailBlockquoteHandling()); 347 348 } else 348 replaceSelectionWithText(event.data(), SelectReplacement::No, event.shouldSmartReplace() ? SmartReplace::Yes : SmartReplace::No, EditAction::Paste);349 replaceSelectionWithText(event.data(), SelectReplacement::No, event.shouldSmartReplace() ? SmartReplace::Yes : SmartReplace::No, action); 349 350 return true; 350 351 } … … 627 628 } 628 629 629 void Editor::pasteAsFragment(Ref<DocumentFragment>&& pastingFragment, bool smartReplace, bool matchStyle, MailBlockquoteHandling respectsMailBlockquote )630 void Editor::pasteAsFragment(Ref<DocumentFragment>&& pastingFragment, bool smartReplace, bool matchStyle, MailBlockquoteHandling respectsMailBlockquote, EditAction action) 630 631 { 631 632 auto target = findEventTargetFromSelection(); 632 633 if (!target) 633 634 return; 634 target->dispatchEvent(TextEvent::createForFragmentPaste(document().windowProxy(), WTFMove(pastingFragment), smartReplace, matchStyle, respectsMailBlockquote)); 635 636 ASSERT(action == EditAction::MarkupImage || action == EditAction::Paste); 637 auto type = action == EditAction::MarkupImage ? TextEventInputMarkup : TextEventInputPaste; 638 target->dispatchEvent(TextEvent::createForFragmentPaste(document().windowProxy(), WTFMove(pastingFragment), type, smartReplace, matchStyle, respectsMailBlockquote)); 635 639 } 636 640 … … 687 691 688 692 AccessibilityReplacedText replacedText; 689 if (AXObjectCache::accessibilityEnabled() && (editingAction == EditAction::Paste || editingAction == EditAction::Insert ))693 if (AXObjectCache::accessibilityEnabled() && (editingAction == EditAction::Paste || editingAction == EditAction::Insert || editingAction == EditAction::MarkupImage)) 690 694 replacedText = AccessibilityReplacedText(selection); 691 695 -
trunk/Source/WebCore/editing/Editor.h
r292032 r292898 445 445 void dismissCorrectionPanelAsIgnored(); 446 446 447 WEBCORE_EXPORT void pasteAsFragment(Ref<DocumentFragment>&&, bool smartReplace, bool matchStyle, MailBlockquoteHandling = MailBlockquoteHandling::RespectBlockquote );447 WEBCORE_EXPORT void pasteAsFragment(Ref<DocumentFragment>&&, bool smartReplace, bool matchStyle, MailBlockquoteHandling = MailBlockquoteHandling::RespectBlockquote, EditAction = EditAction::Paste); 448 448 WEBCORE_EXPORT void pasteAsPlainText(const String&, bool smartReplace); 449 449 … … 538 538 WEBCORE_EXPORT void replaceSelectionWithAttributedString(NSAttributedString *, MailBlockquoteHandling = MailBlockquoteHandling::RespectBlockquote); 539 539 WEBCORE_EXPORT void readSelectionFromPasteboard(const String& pasteboardName); 540 WEBCORE_EXPORT void replaceNodeFromPasteboard(Node&, const String& pasteboardName );540 WEBCORE_EXPORT void replaceNodeFromPasteboard(Node&, const String& pasteboardName, EditAction = EditAction::Paste); 541 541 #endif 542 542 -
trunk/Source/WebCore/editing/cocoa/EditorCocoa.mm
r290578 r292898 347 347 } 348 348 349 void Editor::replaceNodeFromPasteboard(Node& node, const String& pasteboardName )349 void Editor::replaceNodeFromPasteboard(Node& node, const String& pasteboardName, EditAction action) 350 350 { 351 351 if (node.document() != m_document) … … 378 378 maybeCopyNodeAttributesToFragment(node, *fragment); 379 379 if (shouldInsertFragment(*fragment, *range, EditorInsertAction::Pasted)) 380 pasteAsFragment(fragment.releaseNonNull(), false, false, MailBlockquoteHandling::IgnoreBlockquote );380 pasteAsFragment(fragment.releaseNonNull(), false, false, MailBlockquoteHandling::IgnoreBlockquote, action); 381 381 } 382 382 -
trunk/Source/WebCore/en.lproj/Localizable.strings
r291567 r292898 549 549 550 550 /* Undo action name */ 551 "Image analysis markup menu item (Undo action name)" = "Markup Image"; 552 553 /* Undo action name */ 551 554 "Indent (Undo action name)" = "Indent"; 552 555 -
trunk/Source/WebKit/ChangeLog
r292896 r292898 1 2022-04-14 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Undo option after invoking "Markup Image" says "Undo Paste" 4 https://bugs.webkit.org/show_bug.cgi?id=239351 5 rdar://91647863 6 7 Reviewed by Darin Adler. 8 9 Rename `replaceWithPasteboardData` to the more specific `replaceImageWithMarkupResults`. This method was 10 introduced (and is currently only used) to drive image replacement using "Markup Image"; giving this method a 11 more specific name allows us to hard-code `EditAction::MarkupImage` when calling into Editor to carry out the 12 replacement editing action in `WebPage::replaceImageWithMarkupResults`. 13 14 See WebCore/ChangeLog for additional details. 15 16 * UIProcess/Cocoa/WebPageProxyCocoa.mm: 17 (WebKit::WebPageProxy::replaceImageWithMarkupResults): 18 (WebKit::WebPageProxy::replaceWithPasteboardData): Deleted. 19 * UIProcess/WebPageProxy.h: 20 * UIProcess/ios/WKContentViewInteraction.mm: 21 (-[WKContentView imageAnalysisMarkupMenu]): 22 * UIProcess/mac/WebContextMenuProxyMac.mm: 23 (WebKit::WebContextMenuProxyMac::applyMarkupToControlledImage): 24 * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: 25 (WebKit::WebPage::replaceImageWithMarkupResults): 26 (WebKit::WebPage::replaceWithPasteboardData): Deleted. 27 * WebProcess/WebPage/WebPage.h: 28 * WebProcess/WebPage/WebPage.messages.in: 29 1 30 2022-04-14 Wenson Hsieh <wenson_hsieh@apple.com> 2 31 -
trunk/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm
r291810 r292898 916 916 } 917 917 918 void WebPageProxy::replace WithPasteboardData(const ElementContext& elementContext, const Vector<String>& types, const IPC::DataReference& data)919 { 920 send(Messages::WebPage::Replace WithPasteboardData(elementContext, types, data));918 void WebPageProxy::replaceImageWithMarkupResults(const ElementContext& elementContext, const Vector<String>& types, const IPC::DataReference& data) 919 { 920 send(Messages::WebPage::ReplaceImageWithMarkupResults(elementContext, types, data)); 921 921 } 922 922 -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r292812 r292898 268 268 enum class DOMPasteAccessCategory : uint8_t; 269 269 enum class DOMPasteAccessResponse : uint8_t; 270 enum class EditAction : uint8_t; 270 271 enum class EventMakesGamepadsVisible : bool; 271 272 enum class LockBackForwardList : bool; … … 1195 1196 // Called by the UI process when it is ready to send its tokens to the web process. 1196 1197 void registerUIProcessAccessibilityTokens(const IPC::DataReference& elemenToken, const IPC::DataReference& windowToken); 1197 void replace WithPasteboardData(const WebCore::ElementContext&, const Vector<String>& types, const IPC::DataReference&);1198 void replaceImageWithMarkupResults(const WebCore::ElementContext&, const Vector<String>& types, const IPC::DataReference&); 1198 1199 void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&); 1199 1200 bool readSelectionFromPasteboard(const String& pasteboardName); -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r292896 r292898 4735 4735 auto [elementContext, image, preferredMIMEType] = *view->_imageAnalysisMarkupData; 4736 4736 if (auto [data, type] = WebKit::transcodeWithPreferredMIMEType(image.get(), preferredMIMEType.createCFString().get(), (__bridge CFStringRef)UTTypeTIFF.identifier); data) 4737 view->_page->replace WithPasteboardData(elementContext, { String { type.get() } }, { static_cast<const uint8_t*>([data bytes]), [data length] });4737 view->_page->replaceImageWithMarkupResults(elementContext, { String { type.get() } }, { static_cast<const uint8_t*>([data bytes]), [data length] }); 4738 4738 }]; 4739 4739 } -
trunk/Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm
r292800 r292898 350 350 return; 351 351 352 protectedPage->replace WithPasteboardData(elementContext, { String(type.get()) }, IPC::DataReference(static_cast<const uint8_t*>([data bytes]), [data length]));352 protectedPage->replaceImageWithMarkupResults(elementContext, { String(type.get()) }, IPC::DataReference(static_cast<const uint8_t*>([data bytes]), [data length])); 353 353 }); 354 354 #endif // ENABLE(IMAGE_ANALYSIS_ENHANCEMENTS) -
trunk/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm
r292587 r292898 567 567 }; 568 568 569 void WebPage::replace WithPasteboardData(const ElementContext& elementContext, const Vector<String>& types, const IPC::DataReference& data)569 void WebPage::replaceImageWithMarkupResults(const ElementContext& elementContext, const Vector<String>& types, const IPC::DataReference& data) 570 570 { 571 571 Ref frame = CheckedRef(m_page->focusController())->focusedOrMainFrame(); … … 595 595 OverridePasteboardForSelectionReplacement overridePasteboard { types, data }; 596 596 IgnoreSelectionChangeForScope ignoreSelectionChanges { frame.get() }; 597 frame->editor().replaceNodeFromPasteboard(*element, replaceSelectionPasteboardName() );597 frame->editor().replaceNodeFromPasteboard(*element, replaceSelectionPasteboardName(), EditAction::MarkupImage); 598 598 } 599 599 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r292800 r292898 978 978 979 979 #if PLATFORM(COCOA) 980 void replace WithPasteboardData(const WebCore::ElementContext&, const Vector<String>& types, const IPC::DataReference&);980 void replaceImageWithMarkupResults(const WebCore::ElementContext&, const Vector<String>& types, const IPC::DataReference&); 981 981 void replaceSelectionWithPasteboardData(const Vector<String>& types, const IPC::DataReference&); 982 982 #endif -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
r292800 r292898 471 471 GetDataSelectionForPasteboard(String pasteboardType) -> (WebKit::SharedMemory::IPCHandle ipcHandle) Synchronous 472 472 ReadSelectionFromPasteboard(String pasteboardName) -> (bool result) Synchronous 473 Replace WithPasteboardData(struct WebCore::ElementContext context, Vector<String> types, IPC::DataReference data)473 ReplaceImageWithMarkupResults(struct WebCore::ElementContext context, Vector<String> types, IPC::DataReference data) 474 474 ReplaceSelectionWithPasteboardData(Vector<String> types, IPC::DataReference data) 475 475 -
trunk/Tools/ChangeLog
r292894 r292898 1 2022-04-14 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Undo option after invoking "Markup Image" says "Undo Paste" 4 https://bugs.webkit.org/show_bug.cgi?id=239351 5 rdar://91647863 6 7 Reviewed by Darin Adler. 8 9 Augment an existing API test to verify that the resulting undo action title after invoking "Markup Image" is not 10 "Undo Paste". 11 12 * TestWebKitAPI/Tests/WebKitCocoa/ImageAnalysisTests.mm: 13 (TestWebKitAPI::TEST): 14 1 15 2022-04-14 Robert Jenner <Jenner@apple.com> 2 16 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ImageAnalysisTests.mm
r292259 r292898 342 342 return [[webView objectByEvaluatingJavaScript:@"document.images[0].getBoundingClientRect().width"] intValue] == 215; 343 343 }, 3, @"Expected bounding client rect to become 215."); 344 345 NSString *undoTitle = [webView undoManager].undoMenuItemTitle; 346 EXPECT_GT(undoTitle.length, 0U); 347 EXPECT_FALSE([undoTitle containsString:@"Paste"]); 344 348 } 345 349
Note:
See TracChangeset
for help on using the changeset viewer.