Changeset 238475 in webkit
- Timestamp:
- Nov 25, 2018 4:11:16 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 25 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r238465 r238475 1 2018-11-25 Tim Horton <timothy_horton@apple.com> 2 3 Make it possible to insert editable images with a gesture 4 https://bugs.webkit.org/show_bug.cgi?id=191937 5 6 Reviewed by Wenson Hsieh. 7 8 * editing/images/basic-editable-image-from-execCommand-expected.txt: Added. 9 * editing/images/basic-editable-image-from-execCommand.html: Added. 10 Add a test that ensures that editable images also work when 11 inserted via the editor command. 12 13 * editing/images/redo-insert-editable-image-maintains-strokes-expected.txt: Added. 14 * editing/images/redo-insert-editable-image-maintains-strokes.html: Added. 15 Add a test that ensures that strokes are maintained when re-doing an 16 un-done editable image insertion. 17 18 * editing/images/undo-insert-editable-image-expected.txt: Added. 19 * editing/images/undo-insert-editable-image.html: Added. 20 Add a test that ensures that the selection stays in a sensible place 21 when undoing and redoing editable image insertion. 22 1 23 2018-11-23 Ryosuke Niwa <rniwa@webkit.org> 2 24 -
trunk/Source/WebCore/ChangeLog
r238473 r238475 1 2018-11-25 Tim Horton <timothy_horton@apple.com> 2 3 Make it possible to insert editable images with a gesture 4 https://bugs.webkit.org/show_bug.cgi?id=191937 5 6 Reviewed by Wenson Hsieh. 7 8 Tests: 9 editing/images/redo-insert-editable-image-maintains-strokes.html, 10 editing/images/undo-insert-editable-image.html, 11 editing/images/basic-editable-image-from-execCommand.html 12 13 * Sources.txt: 14 * WebCore.xcodeproj/project.pbxproj: 15 * Source/WebCore/editing/EditorCommand.cpp: 16 * Source/WebCore/en.lproj/Localizable.strings: 17 * editing/EditAction.h: 18 * editing/Editor.cpp: 19 (WebCore::Editor::insertEditableImage): 20 * editing/Editor.h: 21 * editing/InsertEditableImageCommand.cpp: Added. 22 (WebCore::InsertEditableImageCommand::InsertEditableImageCommand): 23 (WebCore::InsertEditableImageCommand::doApply): 24 * editing/InsertEditableImageCommand.h: Added. 25 (WebCore::InsertEditableImageCommand::create): 26 * editing/VisibleSelection.cpp: 27 Add an editor command that inserts an editable image. 28 It will likely get a bit more complicated, but for now it just inserts 29 a 100% by 300px editable image. 30 1 31 2018-11-24 Wenson Hsieh <wenson_hsieh@apple.com> 2 32 -
trunk/Source/WebCore/Sources.txt
r238457 r238475 915 915 editing/InsertNestedListCommand.cpp 916 916 editing/IndentOutdentCommand.cpp 917 editing/InsertEditableImageCommand.cpp 917 918 editing/InsertIntoTextNodeCommand.cpp 918 919 editing/InsertLineBreakCommand.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r238451 r238475 755 755 2D76BB821945632400CFD29A /* RunLoopObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D76BB801945632400CFD29A /* RunLoopObserver.h */; settings = {ATTRIBUTES = (Private, ); }; }; 756 756 2D7ED0AB1BAE99170043B3E5 /* TimerEventBasedMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D7ED0A91BAE99170043B3E5 /* TimerEventBasedMock.h */; }; 757 2D81E1CF21A78CC200A32CF4 /* InsertEditableImageCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D81E1CD21A78CC200A32CF4 /* InsertEditableImageCommand.h */; }; 757 758 2D8287F716E4A0380086BD00 /* HitTestLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D8287F516E4A0380086BD00 /* HitTestLocation.h */; settings = {ATTRIBUTES = (Private, ); }; }; 758 759 2D8B92CE203D13E1009C868F /* UnifiedSource481.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE5F84AD1FA1A48B006DB63B /* UnifiedSource481.cpp */; }; … … 6650 6651 2D76BB8319456F8100CFD29A /* RunLoopObserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RunLoopObserver.cpp; sourceTree = "<group>"; }; 6651 6652 2D7ED0A91BAE99170043B3E5 /* TimerEventBasedMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimerEventBasedMock.h; sourceTree = "<group>"; }; 6653 2D81E1CB21A78CC100A32CF4 /* InsertEditableImageCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InsertEditableImageCommand.cpp; sourceTree = "<group>"; }; 6654 2D81E1CD21A78CC200A32CF4 /* InsertEditableImageCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InsertEditableImageCommand.h; sourceTree = "<group>"; }; 6652 6655 2D8287F416E4A0380086BD00 /* HitTestLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HitTestLocation.cpp; sourceTree = "<group>"; }; 6653 6656 2D8287F516E4A0380086BD00 /* HitTestLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HitTestLocation.h; sourceTree = "<group>"; }; … … 20854 20857 DB23C2C90A508D29002489EB /* IndentOutdentCommand.cpp */, 20855 20858 DB23C2CA0A508D29002489EB /* IndentOutdentCommand.h */, 20859 2D81E1CB21A78CC100A32CF4 /* InsertEditableImageCommand.cpp */, 20860 2D81E1CD21A78CC200A32CF4 /* InsertEditableImageCommand.h */, 20856 20861 93309D9A099E64910056E581 /* InsertIntoTextNodeCommand.cpp */, 20857 20862 93309D9B099E64910056E581 /* InsertIntoTextNodeCommand.h */, … … 29206 29211 37E3524D12450C6600BAF5D9 /* InputType.h in Headers */, 29207 29212 C348612415FDE21E007A1CC9 /* InputTypeNames.h in Headers */, 29213 2D81E1CF21A78CC200A32CF4 /* InsertEditableImageCommand.h in Headers */, 29208 29214 93309DEA099E64920056E581 /* InsertIntoTextNodeCommand.h in Headers */, 29209 29215 93309DEC099E64920056E581 /* InsertLineBreakCommand.h in Headers */, -
trunk/Source/WebCore/editing/EditAction.h
r238080 r238475 88 88 ConvertToUnorderedList, 89 89 Indent, 90 Outdent 90 Outdent, 91 InsertEditableImage 91 92 }; 92 93 -
trunk/Source/WebCore/editing/Editor.cpp
r238454 r238475 69 69 #include "IndentOutdentCommand.h" 70 70 #include "InputEvent.h" 71 #include "InsertEditableImageCommand.h" 71 72 #include "InsertListCommand.h" 72 73 #include "InsertTextCommand.h" … … 4251 4252 } 4252 4253 4254 void Editor::insertEditableImage() 4255 { 4256 InsertEditableImageCommand::create(document())->apply(); 4257 } 4258 4253 4259 } // namespace WebCore -
trunk/Source/WebCore/editing/Editor.h
r238454 r238475 533 533 #endif 534 534 535 WEBCORE_EXPORT void insertEditableImage(); 536 535 537 private: 536 538 Document& document() const; -
trunk/Source/WebCore/editing/EditorCommand.cpp
r238454 r238475 47 47 #include "HTMLNames.h" 48 48 #include "IndentOutdentCommand.h" 49 #include "InsertEditableImageCommand.h" 49 50 #include "InsertListCommand.h" 50 51 #include "InsertNestedListCommand.h" … … 479 480 } 480 481 482 static bool executeInsertEditableImage(Frame& frame, Event*, EditorCommandSource, const String&) 483 { 484 ASSERT(frame.document()); 485 InsertEditableImageCommand::create(*frame.document())->apply(); 486 return true; 487 } 488 481 489 static bool executeInsertLineBreak(Frame& frame, Event* event, EditorCommandSource source, const String&) 482 490 { … … 1370 1378 { 1371 1379 return frame.editor().canUndo(); 1380 } 1381 1382 static bool enabledInRichlyEditableTextWithEditableImagesEnabled(Frame& frame, Event* event, EditorCommandSource source) 1383 { 1384 if (!frame.settings().editableImagesEnabled()) 1385 return false; 1386 return enabledInRichlyEditableText(frame, event, source); 1372 1387 } 1373 1388 … … 1591 1606 { "Indent", { executeIndent, supported, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1592 1607 { "InsertBacktab", { executeInsertBacktab, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, isTextInsertion, doNotAllowExecutionWhenDisabled } }, 1608 { "InsertEditableImage", { executeInsertEditableImage, supported, enabledInRichlyEditableTextWithEditableImagesEnabled, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1593 1609 { "InsertHTML", { executeInsertHTML, supported, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, 1594 1610 { "InsertHorizontalRule", { executeInsertHorizontalRule, supported, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } }, -
trunk/Source/WebCore/editing/InsertEditableImageCommand.h
r238474 r238475 1 1 /* 2 * Copyright (C) 20 04-2018 Apple Inc.All rights reserved.2 * Copyright (C) 2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #pragma once 27 27 28 #include "CompositeEditCommand.h" 29 28 30 namespace WebCore { 29 31 30 enum class EditAction : uint8_t { 31 Unspecified, 32 Insert, 33 InsertReplacement, 34 InsertFromDrop, 35 SetColor, 36 SetBackgroundColor, 37 TurnOffKerning, 38 TightenKerning, 39 LoosenKerning, 40 UseStandardKerning, 41 TurnOffLigatures, 42 UseStandardLigatures, 43 UseAllLigatures, 44 RaiseBaseline, 45 LowerBaseline, 46 SetTraditionalCharacterShape, 47 SetFont, 48 ChangeAttributes, 49 AlignLeft, 50 AlignRight, 51 Center, 52 Justify, 53 SetWritingDirection, 54 Subscript, 55 Superscript, 56 Underline, 57 Outline, 58 Unscript, 59 DeleteByDrag, 60 Cut, 61 Bold, 62 Italics, 63 Delete, 64 Dictation, 65 Paste, 66 PasteFont, 67 PasteRuler, 68 TypingDeleteSelection, 69 TypingDeleteBackward, 70 TypingDeleteForward, 71 TypingDeleteWordBackward, 72 TypingDeleteWordForward, 73 TypingDeleteLineBackward, 74 TypingDeleteLineForward, 75 TypingDeletePendingComposition, 76 TypingDeleteFinalComposition, 77 TypingInsertText, 78 TypingInsertLineBreak, 79 TypingInsertParagraph, 80 TypingInsertPendingComposition, 81 TypingInsertFinalComposition, 82 CreateLink, 83 Unlink, 84 FormatBlock, 85 InsertOrderedList, 86 InsertUnorderedList, 87 ConvertToOrderedList, 88 ConvertToUnorderedList, 89 Indent, 90 Outdent 32 class InsertEditableImageCommand : public CompositeEditCommand { 33 public: 34 static Ref<InsertEditableImageCommand> create(Document& document) 35 { 36 return adoptRef(*new InsertEditableImageCommand(document)); 37 } 38 39 private: 40 InsertEditableImageCommand(Document&); 41 42 void doApply() override; 43 EditAction editingAction() const final { return EditAction::InsertEditableImage; } 91 44 }; 92 45 -
trunk/Source/WebCore/editing/VisibleSelection.cpp
r236522 r238475 32 32 #include "HTMLInputElement.h" 33 33 #include "Settings.h" 34 #include "ShadowRoot.h" 34 35 #include "TextIterator.h" 35 36 #include "VisibleUnits.h" -
trunk/Source/WebCore/en.lproj/Localizable.strings
r238473 r238475 357 357 358 358 /* Undo action name */ 359 "Insert Drawing (Undo action name)" = "Insert Drawing"; 360 361 /* Undo action name */ 359 362 "Insert List (Undo action name)" = "Insert List"; 360 363 -
trunk/Source/WebKit/ChangeLog
r238474 r238475 1 2018-11-25 Tim Horton <timothy_horton@apple.com> 2 3 Make it possible to insert editable images with a gesture 4 https://bugs.webkit.org/show_bug.cgi?id=191937 5 6 Reviewed by Wenson Hsieh. 7 8 * UIProcess/API/Cocoa/WKWebView.mm: 9 (-[WKWebView _stylusTapGestureShouldCreateEditableImage]): 10 * UIProcess/API/Cocoa/WKWebViewInternal.h: 11 Add a internal getter for a WKWebViewConfiguration property. 12 13 * UIProcess/WebEditCommandProxy.cpp: 14 (WebKit::WebEditCommandProxy::nameForEditAction): 15 Add a undo name. 16 17 * UIProcess/WebPageProxy.h: 18 * UIProcess/ios/WKContentViewInteraction.h: 19 * UIProcess/ios/WKContentViewInteraction.mm: 20 (-[WKContentView setupInteraction]): 21 (-[WKContentView cleanupInteraction]): 22 (-[WKContentView _removeDefaultGestureRecognizers]): 23 (-[WKContentView _addDefaultGestureRecognizers]): 24 Add a single-stylus-tap gesture recognizer. 25 26 (-[WKContentView _stylusSingleTapRecognized:]): 27 If allowed, request to insert an editable image when a stylus tap occurs. 28 29 * UIProcess/ios/WebPageProxyIOS.mm: 30 (WebKit::WebPageProxy::handleStylusSingleTapAtPoint): 31 * WebProcess/WebPage/WebPage.h: 32 * WebProcess/WebPage/WebPage.messages.in: 33 * WebProcess/WebPage/ios/WebPageIOS.mm: 34 (WebKit::WebPage::handleStylusSingleTapAtPoint): 35 Do a hit test, select the hit position, insert an editable image, and 36 then de-assist any assisted node (to make the keyboard go away). 37 For now, we'll only insert if we hit non-replaced elements, 38 though this heuristic will need to be enhanced significantly once we 39 decide on a design. 40 1 41 2018-11-25 Tim Horton <timothy_horton@apple.com> 2 42 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r238474 r238475 2439 2439 // initial scale, this simply becomes a test of the current scale against 1. 2440 2440 return !areEssentiallyEqualAsFloat(contentZoomScale(self), 1); 2441 } 2442 2443 - (BOOL)_stylusTapGestureShouldCreateEditableImage 2444 { 2445 return [_configuration _editableImagesEnabled]; 2441 2446 } 2442 2447 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h
r238235 r238475 168 168 169 169 @property (nonatomic, readonly) BOOL _allowsDoubleTapGestures; 170 @property (nonatomic, readonly) BOOL _stylusTapGestureShouldCreateEditableImage; 170 171 @property (nonatomic, readonly) BOOL _haveSetObscuredInsets; 171 172 @property (nonatomic, readonly) UIEdgeInsets _computedObscuredInset; -
trunk/Source/WebKit/UIProcess/WebEditCommandProxy.cpp
r238473 r238475 178 178 case EditAction::ConvertToUnorderedList: 179 179 return WEB_UI_STRING_KEY("Convert to Unordered List", "Convert to Unordered List (Undo action name)", "Undo action name"); 180 case EditAction::InsertEditableImage: 181 return WEB_UI_STRING_KEY("Insert Drawing", "Insert Drawing (Undo action name)", "Undo action name"); 180 182 } 181 183 return String(); -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r238471 r238475 653 653 void getSelectionContext(WTF::Function<void(const String&, const String&, const String&, CallbackBase::Error)>&&); 654 654 void handleTwoFingerTapAtPoint(const WebCore::IntPoint&, uint64_t requestID); 655 void handleStylusSingleTapAtPoint(const WebCore::IntPoint&, uint64_t requestID); 655 656 void setForceAlwaysUserScalable(bool); 656 657 bool forceAlwaysUserScalable() const { return m_forceAlwaysUserScalable; } -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h
r238235 r238475 211 211 RetainPtr<UITapGestureRecognizer> _twoFingerDoubleTapGestureRecognizer; 212 212 RetainPtr<UITapGestureRecognizer> _twoFingerSingleTapGestureRecognizer; 213 RetainPtr<UITapGestureRecognizer> _stylusSingleTapGestureRecognizer; 213 214 RetainPtr<WKInspectorNodeSearchGestureRecognizer> _inspectorNodeSearchGestureRecognizer; 214 215 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r238360 r238475 692 692 [self addGestureRecognizer:_twoFingerSingleTapGestureRecognizer.get()]; 693 693 694 _stylusSingleTapGestureRecognizer = adoptNS([[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(_stylusSingleTapRecognized:)]); 695 [_stylusSingleTapGestureRecognizer setNumberOfTapsRequired:1]; 696 [_stylusSingleTapGestureRecognizer setDelegate:self]; 697 [_stylusSingleTapGestureRecognizer setAllowedTouchTypes:@[ @(UITouchTypePencil) ]]; 698 [self addGestureRecognizer:_stylusSingleTapGestureRecognizer.get()]; 699 694 700 #if HAVE(LINK_PREVIEW) 695 701 [self _registerPreview]; … … 779 785 [self removeGestureRecognizer:_twoFingerSingleTapGestureRecognizer.get()]; 780 786 787 [_stylusSingleTapGestureRecognizer setDelegate:nil]; 788 [self removeGestureRecognizer:_stylusSingleTapGestureRecognizer.get()]; 789 781 790 _layerTreeTransactionIdAtLastTouchStart = 0; 782 791 … … 835 844 [self removeGestureRecognizer:_twoFingerDoubleTapGestureRecognizer.get()]; 836 845 [self removeGestureRecognizer:_twoFingerSingleTapGestureRecognizer.get()]; 846 [self removeGestureRecognizer:_stylusSingleTapGestureRecognizer.get()]; 837 847 #if PLATFORM(IOSMAC) 838 848 [self removeGestureRecognizer:_hoverGestureRecognizer.get()]; … … 849 859 [self addGestureRecognizer:_twoFingerDoubleTapGestureRecognizer.get()]; 850 860 [self addGestureRecognizer:_twoFingerSingleTapGestureRecognizer.get()]; 861 [self addGestureRecognizer:_stylusSingleTapGestureRecognizer.get()]; 851 862 #if PLATFORM(IOSMAC) 852 863 [self addGestureRecognizer:_hoverGestureRecognizer.get()]; … … 1895 1906 _isExpectingFastSingleTapCommit = YES; 1896 1907 _page->handleTwoFingerTapAtPoint(roundedIntPoint(gestureRecognizer.centroid), ++_latestTapID); 1908 } 1909 1910 - (void)_stylusSingleTapRecognized:(UITapGestureRecognizer *)gestureRecognizer 1911 { 1912 if (!_webView._stylusTapGestureShouldCreateEditableImage) 1913 return; 1914 1915 ASSERT(gestureRecognizer == _stylusSingleTapGestureRecognizer); 1916 _page->handleStylusSingleTapAtPoint(roundedIntPoint(gestureRecognizer.location), ++_latestTapID); 1897 1917 } 1898 1918 -
trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
r238468 r238475 598 598 } 599 599 600 void WebPageProxy::handleStylusSingleTapAtPoint(const WebCore::IntPoint& point, uint64_t requestID) 601 { 602 process().send(Messages::WebPage::HandleStylusSingleTapAtPoint(point, requestID), m_pageID); 603 } 604 600 605 void WebPageProxy::selectWithTwoTouches(const WebCore::IntPoint from, const WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, WTF::Function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>&& callbackFunction) 601 606 { -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r238471 r238475 654 654 void getSelectionContext(CallbackID); 655 655 void handleTwoFingerTapAtPoint(const WebCore::IntPoint&, uint64_t requestID); 656 void handleStylusSingleTapAtPoint(const WebCore::IntPoint&, uint64_t requestID); 656 657 void getRectsForGranularityWithSelectionOffset(uint32_t, int32_t, CallbackID); 657 658 void getRectsAtSelectionOffsetWithText(int32_t, const String&, CallbackID); -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
r238471 r238475 100 100 SetAllowsMediaDocumentInlinePlayback(bool allows) 101 101 HandleTwoFingerTapAtPoint(WebCore::IntPoint point, uint64_t requestID) 102 HandleStylusSingleTapAtPoint(WebCore::IntPoint point, uint64_t requestID) 102 103 SetForceAlwaysUserScalable(bool userScalable) 103 104 GetRectsForGranularityWithSelectionOffset(uint32_t granularity, int32_t offset, WebKit::CallbackID callbackID) -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r238461 r238475 759 759 } 760 760 761 void WebPage::handleStylusSingleTapAtPoint(const WebCore::IntPoint& point, uint64_t requestID) 762 { 763 auto& frame = m_page->focusController().focusedOrMainFrame(); 764 765 auto pointInDocument = frame.view()->rootViewToContents(point); 766 HitTestResult hitTest = frame.eventHandler().hitTestResultAtPoint(pointInDocument, HitTestRequest::ReadOnly | HitTestRequest::Active); 767 768 Node* node = hitTest.innerNonSharedNode(); 769 if (!node) 770 return; 771 auto renderer = node->renderer(); 772 if (!renderer) 773 return; 774 775 if (renderer->isReplaced()) 776 return; 777 778 VisiblePosition position = renderer->positionForPoint(hitTest.localPoint(), nullptr); 779 if (position.isNull()) 780 position = firstPositionInOrBeforeNode(node); 781 782 if (position.isNull()) 783 return; 784 785 auto range = Range::create(*frame.document(), position, position); 786 frame.selection().setSelectedRange(range.ptr(), position.affinity(), WebCore::FrameSelection::ShouldCloseTyping::Yes, UserTriggered); 787 frame.editor().insertEditableImage(); 788 resetAssistedNodeForFrame(m_mainFrame.get()); 789 } 790 761 791 void WebPage::potentialTapAtPosition(uint64_t requestID, const WebCore::FloatPoint& position) 762 792 { -
trunk/Source/WebKitLegacy/mac/ChangeLog
r238473 r238475 1 2018-11-25 Tim Horton <timothy_horton@apple.com> 2 3 Make it possible to insert editable images with a gesture 4 https://bugs.webkit.org/show_bug.cgi?id=191937 5 6 Reviewed by Wenson Hsieh. 7 8 * WebCoreSupport/WebEditorClient.mm: 9 (undoNameForEditAction): 10 Add a undo name. 11 1 12 2018-11-24 Wenson Hsieh <wenson_hsieh@apple.com> 2 13 -
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm
r238473 r238475 656 656 case EditAction::ConvertToOrderedList: return UI_STRING_KEY_INTERNAL("Convert to Ordered List", "Convert to Ordered List (Undo action name)", "Undo action name"); 657 657 case EditAction::ConvertToUnorderedList: return UI_STRING_KEY_INTERNAL("Convert to Unordered List", "Convert to Unordered List (Undo action name)", "Undo action name"); 658 case EditAction::InsertEditableImage: return UI_STRING_KEY_INTERNAL("Insert Drawing", "Insert Drawing (Undo action name)", "Undo action name"); 658 659 } 659 660 return nil; -
trunk/Tools/ChangeLog
r238471 r238475 1 2018-11-25 Tim Horton <timothy_horton@apple.com> 2 3 Make it possible to insert editable images with a gesture 4 https://bugs.webkit.org/show_bug.cgi?id=191937 5 6 Reviewed by Wenson Hsieh. 7 8 * WebKitTestRunner/ios/UIScriptControllerIOS.mm: 9 (WTR::UIScriptController::drawSquareInEditableImage): 10 If the canvas already has a drawing, draw a new stroke on top of it 11 instead of removing the existing stroke. 12 1 13 2018-11-24 Wenson Hsieh <wenson_hsieh@apple.com> 2 14 -
trunk/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm
r238235 r238475 891 891 892 892 PKCanvasView *canvasView = findEditableImageCanvas(); 893 RetainPtr<PKDrawing> drawing = adoptNS([[pkDrawingClass alloc] init]);893 RetainPtr<PKDrawing> drawing = canvasView.drawing ?: adoptNS([[pkDrawingClass alloc] init]); 894 894 RetainPtr<CGPathRef> path = adoptCF(CGPathCreateWithRect(CGRectMake(0, 0, 50, 50), NULL)); 895 895 RetainPtr<PKInk> ink = [pkInkClass inkWithType:0 color:UIColor.greenColor weight:100.0];
Note: See TracChangeset
for help on using the changeset viewer.