Changeset 217103 in webkit


Ignore:
Timestamp:
May 19, 2017 1:04:16 AM (7 years ago)
Author:
jmarcell@apple.com
Message:

Cherry-pick r217074. rdar://problem/32282945

Location:
branches/safari-604.1.21-branch
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-604.1.21-branch/Source/WebCore/ChangeLog

    r217035 r217103  
     12017-05-18  Jason Marcell  <jmarcell@apple.com>
     2
     3        Cherry-pick r217074. rdar://problem/32282945
     4
     5    2017-05-18  Wenson Hsieh  <wenson_hsieh@apple.com>
     6
     7            Selection around attachment elements should not persist when beginning a drag
     8            https://bugs.webkit.org/show_bug.cgi?id=172319
     9            <rdar://problem/32283008>
     10
     11            Reviewed by Tim Horton.
     12
     13            When beginning to drag an attachment element, save and restore the visible selection when calling out to the
     14            injected bundle for additional data, and when creating the drag image.
     15
     16            Augmented an existing API test: DataInteractionTests.AttachmentElementItemProviders.
     17
     18            * page/DragController.cpp:
     19            (WebCore::DragController::startDrag):
     20
    1212017-05-17  Jason Marcell  <jmarcell@apple.com>
    222
  • branches/safari-604.1.21-branch/Source/WebCore/page/DragController.cpp

    r216002 r217103  
    10611061#if ENABLE(ATTACHMENT_ELEMENT)
    10621062    if (is<HTMLAttachmentElement>(element) && m_dragSourceAction & DragSourceActionAttachment) {
     1063        src.editor().setIgnoreSelectionChanges(true);
     1064        auto previousSelection = src.selection().selection();
    10631065        if (!dataTransfer.pasteboard().hasData()) {
    10641066            selectElement(element);
     
    10891091        }
    10901092        doSystemDrag(WTFMove(dragImage), dragLoc, dragOrigin, { }, dataTransfer, src, DragSourceActionAttachment);
     1093        src.selection().setSelection(previousSelection);
     1094        src.editor().setIgnoreSelectionChanges(false);
    10911095        return true;
    10921096    }
  • branches/safari-604.1.21-branch/Tools/ChangeLog

    r217040 r217103  
     12017-05-18  Jason Marcell  <jmarcell@apple.com>
     2
     3        Cherry-pick r217074. rdar://problem/32282945
     4
     5    2017-05-18  Wenson Hsieh  <wenson_hsieh@apple.com>
     6
     7            Selection around attachment elements should not persist when beginning a drag
     8            https://bugs.webkit.org/show_bug.cgi?id=172319
     9            <rdar://problem/32283008>
     10
     11            Reviewed by Tim Horton.
     12
     13            Tests that temporary selection around an attachment does not persist longer than it needs to.
     14
     15            * TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
     16            (TestWebKitAPI::TEST):
     17
    1182017-05-17  Jason Marcell  <jmarcell@apple.com>
    219
  • branches/safari-604.1.21-branch/Tools/TestWebKitAPI/Tests/ios/DataInteractionTests.mm

    r217102 r217103  
    589589
    590590    EXPECT_WK_STREQ("hello", [injectedString UTF8String]);
     591    EXPECT_TRUE([webView stringByEvaluatingJavaScript:@"getSelection().isCollapsed"].boolValue);
    591592}
    592593
Note: See TracChangeset for help on using the changeset viewer.