⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 268847 in webkit


Ignore:
Timestamp:
Oct 21, 2020, 5:40:55 PM (6 years ago)
Author:
Megan Gardner
Message:

Stop gap patch fix for regression in r267329.
https://bugs.webkit.org/show_bug.cgi?id=218020
Source/WebCore:

<rdar://problem/69542459>

Reviewed by Darin Adler.

The refactoring in https://bugs.webkit.org/show_bug.cgi?id=216739 caused selections to
expand in both directions after a double-click and drag to expand on mac. This behavior
was not observed on iOS. This removes the error-prone calculation.
Note that this bug does not occur if only testing immediatly moving the drag point to the
end of the selection. Dragging across all the words as a real user would needs to be emulated.

Test: editing/selection/double-click-and-drag-over-anchor-to-select.html

  • editing/VisibleSelection.cpp:

(WebCore::VisibleSelection::validate):

LayoutTests:

Reviewed by Darin Adler.

  • editing/selection/double-click-and-drag-over-anchor-to-select-expected.txt: Added.
  • editing/selection/double-click-and-drag-over-anchor-to-select.html: Added.
  • resources/ui-helper.js:

(window.UIHelper.doubleClickAtMouseDown):
(window.UIHelper.mouseUp):
(window.UIHelper.dragMouseAcrossElement):
(window.UIHelper.doubleClickElementMouseDown):

Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r268846 r268847  
     12020-10-21  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Stop gap patch fix for regression in r267329.
     4        https://bugs.webkit.org/show_bug.cgi?id=218020
     5
     6        Reviewed by Darin Adler.
     7
     8        * editing/selection/double-click-and-drag-over-anchor-to-select-expected.txt: Added.
     9        * editing/selection/double-click-and-drag-over-anchor-to-select.html: Added.
     10        * resources/ui-helper.js:
     11        (window.UIHelper.doubleClickAtMouseDown):
     12        (window.UIHelper.mouseUp):
     13        (window.UIHelper.dragMouseAcrossElement):
     14        (window.UIHelper.doubleClickElementMouseDown):
     15
    1162020-10-21  Karl Rackler  <rackler@apple.com>
    217
  • trunk/LayoutTests/resources/ui-helper.js

    r266743 r268847  
    1717        eventSender.mouseUp();
    1818        eventSender.mouseDown();
     19        eventSender.mouseUp();
     20    }
     21
     22    static doubleClickAtMouseDown(x1, y1)
     23    {
     24        eventSender.mouseMoveTo(x1, y1);
     25        eventSender.mouseDown();
     26        eventSender.mouseUp();
     27        eventSender.mouseDown();
     28    }
     29
     30    static mouseUp()
     31    {
    1932        eventSender.mouseUp();
    2033    }
     
    2841        eventSender.mouseMoveTo(x2, y2);
    2942        eventSender.mouseUp();
     43    }
     44
     45    static dragMouseAcrossElement(element)
     46    {
     47        const x1 = element.offsetLeft + element.offsetWidth;
     48        const x2 = element.offsetLeft + element.offsetWidth * .75;
     49        const x3 = element.offsetLeft + element.offsetWidth / 2;
     50        const x4 = element.offsetLeft + element.offsetWidth / 4;
     51        const x5 = element.offsetLeft;
     52        const y = element.offsetTop + element.offsetHeight / 2;
     53        eventSender.mouseMoveTo(x1, y);
     54        eventSender.mouseMoveTo(x2, y);
     55        eventSender.mouseMoveTo(x3, y);
     56        eventSender.mouseMoveTo(x4, y);
     57        eventSender.mouseMoveTo(x5, y);
     58    }
     59
     60    static doubleClickElementMouseDown(element1)
     61    {
     62        const x1 = element1.offsetLeft + element1.offsetWidth / 2;
     63        const y1 = element1.offsetTop + element1.offsetHeight / 2;
     64        return UIHelper.doubleClickAtMouseDown(x1, y1);
    3065    }
    3166
  • trunk/Source/WebCore/ChangeLog

    r268843 r268847  
     12020-10-21  Megan Gardner  <megan_gardner@apple.com>
     2
     3        Stop gap patch fix for regression in r267329.
     4        https://bugs.webkit.org/show_bug.cgi?id=218020
     5        <rdar://problem/69542459>
     6
     7        Reviewed by Darin Adler.
     8
     9        The refactoring in https://bugs.webkit.org/show_bug.cgi?id=216739 caused selections to
     10        expand in both directions after a double-click and drag to expand on mac. This behavior
     11        was not observed on iOS. This removes the error-prone calculation.
     12        Note that this bug does not occur if only testing immediatly moving the drag point to the
     13        end of the selection. Dragging across all the words as a real user would needs to be emulated.
     14
     15        Test: editing/selection/double-click-and-drag-over-anchor-to-select.html
     16
     17        * editing/VisibleSelection.cpp:
     18        (WebCore::VisibleSelection::validate):
     19
    1202020-10-21  Alex Christensen  <achristensen@webkit.org>
    221
  • trunk/Source/WebCore/editing/VisibleSelection.cpp

    r267363 r268847  
    387387    updateSelectionType();
    388388
    389     bool shouldUpdateAnchor = m_start != startBeforeAdjustments;
    390     bool shouldUpdateFocus = m_end != endBeforeAdjustments;
     389    bool shouldUpdateAnchor = false; // Set to false because of <rdar://problem/69542459>. Can be returned to original logic when this problem is fully fixed.
     390    bool shouldUpdateFocus = false; // Ditto.
    391391
    392392    if (isRange()) {
Note: See TracChangeset for help on using the changeset viewer.