WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-218020-20201021125329.patch (text/plain), 8.38 KB, created by
Megan Gardner
on 2020-10-21 12:53:30 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Megan Gardner
Created:
2020-10-21 12:53:30 PDT
Size:
8.38 KB
patch
obsolete
>Subversion Revision: 268771 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index e471e3bc2540eae7674c6e678261a088529f9c9d..2cee38f84a3a05d97709a9236a94fadc431a356a 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,22 @@ >+2020-10-21 Megan Gardner <megan_gardner@apple.com> >+ >+ Stop gap patch fix for regression in r267329. >+ https://bugs.webkit.org/show_bug.cgi?id=218020 >+ <rdar://problem/69542459> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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): >+ > 2020-10-20 Antoine Quint <graouts@webkit.org> > > REGRESSION (r268483): Map jumps around while zooming on windy.com, strava.com >diff --git a/Source/WebCore/editing/VisibleSelection.cpp b/Source/WebCore/editing/VisibleSelection.cpp >index 3a2393952ddc9ec7cc5ef38894c549cfec639e42..c0f0a12653aa067822299142fe2ac59b56ed05b6 100644 >--- a/Source/WebCore/editing/VisibleSelection.cpp >+++ b/Source/WebCore/editing/VisibleSelection.cpp >@@ -386,8 +386,8 @@ void VisibleSelection::validate(TextGranularity granularity) > adjustSelectionToAvoidCrossingEditingBoundaries(); > updateSelectionType(); > >- bool shouldUpdateAnchor = m_start != startBeforeAdjustments; >- bool shouldUpdateFocus = m_end != endBeforeAdjustments; >+ bool shouldUpdateAnchor = false; >+ bool shouldUpdateFocus = false; > > if (isRange()) { > // "Constrain" the selection to be the smallest equivalent range of nodes. >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 1eeb8c63f32580bd3b60bf11287817371cac8938..db123bc512c7cc682fc0b97890a75aa62a963f79 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,18 @@ >+2020-10-21 Megan Gardner <megan_gardner@apple.com> >+ >+ Stop gap patch fix for regression in r267329. >+ https://bugs.webkit.org/show_bug.cgi?id=218020 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * 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): >+ > 2020-10-20 Antoine Quint <graouts@webkit.org> > > REGRESSION (r268483): Map jumps around while zooming on windy.com, strava.com >diff --git a/LayoutTests/editing/mac/selection/double-click-and-drag-over-anchor-to-select-expected.txt b/LayoutTests/editing/mac/selection/double-click-and-drag-over-anchor-to-select-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..05359658b55664c7e54a74939e81bac118bbc8ea >--- /dev/null >+++ b/LayoutTests/editing/mac/selection/double-click-and-drag-over-anchor-to-select-expected.txt >@@ -0,0 +1,56 @@ >+ >+Before extending the selection: >+| " >+ " >+| <p> >+| "The " >+| <span> >+| id="end" >+| "quick" >+| " " >+| <span> >+| id="middle3" >+| "brown" >+| " " >+| <span> >+| id="middle2" >+| "fox" >+| " " >+| <span> >+| id="middle1" >+| "jumped" >+| " " >+| <span> >+| id="start" >+| "over" >+| " the lazy dog. And then there was another sentence." >+| " >+" >+ >+quick brown fox jumped over: >+| " >+ " >+| <p> >+| "The " >+| <span> >+| id="end" >+| "<#selection-focus>quick" >+| " " >+| <span> >+| id="middle3" >+| "brown" >+| " " >+| <span> >+| id="middle2" >+| "fox" >+| " " >+| <span> >+| id="middle1" >+| "jumped" >+| " " >+| <span> >+| id="start" >+| "over<#selection-anchor>" >+| " the lazy dog. And then there was another sentence." >+| " >+" >diff --git a/LayoutTests/editing/mac/selection/double-click-and-drag-over-anchor-to-select.html b/LayoutTests/editing/mac/selection/double-click-and-drag-over-anchor-to-select.html >new file mode 100644 >index 0000000000000000000000000000000000000000..dd87431e4f6b8be0f1f513987199375300fe16ce >--- /dev/null >+++ b/LayoutTests/editing/mac/selection/double-click-and-drag-over-anchor-to-select.html >@@ -0,0 +1,52 @@ >+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] --> >+<html> >+<head> >+<meta name="viewport" content="width=device-width, initial-scale=1"> >+<script src="../../resources/dump-as-markup.js"></script> >+<script src="../../resources/ui-helper.js"></script> >+<style> >+p { >+ font-size: 20px; >+} >+ >+p + p { >+ margin-top: 100px; >+} >+ >+#start { >+ border: 1px solid blue; >+} >+ >+#end { >+ padding-right: 2px; >+ border: 1px solid tomato; >+} >+</style> >+</head> >+<body> >+<div>This test verifies that double-clicking and then dragging over the selection anchor point (in LTR languages, this is dragging left) to extend the text selection does not extend the selection from the original selection focus as well (in LRT languages, the selection should not extent to the right as well while dragging left). To test manually, load the page and double click on 'over' and drag to 'quick'. The text 'quick brown fox jumped over' should be selected, and nothing else.</div> >+<div id="container"> >+ <p>The <span id="end">quick</span> <span id="middle3">brown</span> <span id="middle2">fox</span> <span id="middle1">jumped</span> <span id="start">over</span> the lazy dog. And then there was another sentence.</p> >+</div> >+<script> >+ >+(async function () { >+ if (!window.testRunner) >+ return; >+ >+ internals.settings.setEditingBehavior("Mac"); >+ Markup.dump(document.getElementById("container"), "Before extending the selection"); >+ >+ UIHelper.doubleClickElementMouseDown(document.getElementById("start")); >+ UIHelper.dragMouseAcrossElement(document.getElementById("middle1")); >+ UIHelper.dragMouseAcrossElement(document.getElementById("middle2")); >+ UIHelper.dragMouseAcrossElement(document.getElementById("middle3")); >+ UIHelper.dragMouseAcrossElement(document.getElementById("end")); >+ UIHelper.mouseUp(); >+ >+ Markup.dump(document.getElementById("container"), document.getSelection().toString()); >+ Markup.notifyDone(); >+})(); >+</script> >+</body> >+</html> >\ No newline at end of file >diff --git a/LayoutTests/resources/ui-helper.js b/LayoutTests/resources/ui-helper.js >index 25493ecb8d3310e1d9b76e400e3c8ff731ff258a..69f0286522b270c2d563cc99bf556aae7c9ad23d 100644 >--- a/LayoutTests/resources/ui-helper.js >+++ b/LayoutTests/resources/ui-helper.js >@@ -19,6 +19,19 @@ window.UIHelper = class UIHelper { > eventSender.mouseUp(); > } > >+ static doubleClickAtMouseDown(x1, y1) >+ { >+ eventSender.mouseMoveTo(x1, y1); >+ eventSender.mouseDown(); >+ eventSender.mouseUp(); >+ eventSender.mouseDown(); >+ } >+ >+ static mouseUp() >+ { >+ eventSender.mouseUp(); >+ } >+ > static doubleClickAtThenDragTo(x1, y1, x2, y2) > { > eventSender.mouseMoveTo(x1, y1); >@@ -29,6 +42,28 @@ window.UIHelper = class UIHelper { > eventSender.mouseUp(); > } > >+ static dragMouseAcrossElement(element) >+ { >+ const x1 = element.offsetLeft + element.offsetWidth; >+ const x2 = element.offsetLeft + element.offsetWidth * .75; >+ const x3 = element.offsetLeft + element.offsetWidth / 2; >+ const x4 = element.offsetLeft + element.offsetWidth / 4; >+ const x5 = element.offsetLeft; >+ const y = element.offsetTop + element.offsetHeight / 2; >+ eventSender.mouseMoveTo(x1, y); >+ eventSender.mouseMoveTo(x2, y); >+ eventSender.mouseMoveTo(x3, y); >+ eventSender.mouseMoveTo(x4, y); >+ eventSender.mouseMoveTo(x5, y); >+ } >+ >+ static doubleClickElementMouseDown(element1) >+ { >+ const x1 = element1.offsetLeft + element1.offsetWidth / 2; >+ const y1 = element1.offsetTop + element1.offsetHeight / 2; >+ return UIHelper.doubleClickAtMouseDown(x1, y1); >+ } >+ > static async moveMouseAndWaitForFrame(x, y) > { > eventSender.mouseMoveTo(x, y);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ews-feeder
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 218020
:
411980
|
412012
|
412017
|
412019
|
412033
|
412039