Title: [216372] releases/WebKitGTK/webkit-2.16
- Revision
- 216372
- Author
- carlo...@webkit.org
- Date
- 2017-05-08 02:10:32 -0700 (Mon, 08 May 2017)
Log Message
Merge r215581 - Inline anchor elements cannot be dragged when starting the drag from a block descendant
https://bugs.webkit.org/show_bug.cgi?id=171062
<rdar://problem/31697835>
Reviewed by Tim Horton.
Source/WebCore:
Tweaks DragController::draggableElement to traverse the DOM instead of the render tree when finding a draggable
element. This prevents us from skipping elements that are in the DOM ancestor chain, but appear as siblings to
the hit-tested node's renderer in the render tree.
There was also previously a check to ensure that we skip anonymous RenderObjects while traversing up the chain,
but this is no longer necessary fter this change, since all the elements we traverse in the DOM should have
renderers that are not anonymous.
Test: fast/events/drag-and-drop-link-containing-block.html
* page/DragController.cpp:
(WebCore::DragController::draggableElement):
LayoutTests:
Adds a new test on WK1 Mac to verify that link dragging succeeds when the link's anchor element is inline and
the drag is started from a block element under the link.
* fast/events/drag-and-drop-link-containing-block-expected.txt: Added.
* fast/events/drag-and-drop-link-containing-block.html: Added.
* platform/ios/TestExpectations:
* platform/mac-wk2/TestExpectations:
Skip the test on iOS and Mac WK2.
Modified Paths
Added Paths
Diff
Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/ChangeLog (216371 => 216372)
--- releases/WebKitGTK/webkit-2.16/LayoutTests/ChangeLog 2017-05-08 09:04:59 UTC (rev 216371)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/ChangeLog 2017-05-08 09:10:32 UTC (rev 216372)
@@ -1,3 +1,21 @@
+2017-04-20 Wenson Hsieh <wenson_hs...@apple.com>
+
+ Inline anchor elements cannot be dragged when starting the drag from a block descendant
+ https://bugs.webkit.org/show_bug.cgi?id=171062
+ <rdar://problem/31697835>
+
+ Reviewed by Tim Horton.
+
+ Adds a new test on WK1 Mac to verify that link dragging succeeds when the link's anchor element is inline and
+ the drag is started from a block element under the link.
+
+ * fast/events/drag-and-drop-link-containing-block-expected.txt: Added.
+ * fast/events/drag-and-drop-link-containing-block.html: Added.
+ * platform/ios/TestExpectations:
+ * platform/mac-wk2/TestExpectations:
+
+ Skip the test on iOS and Mac WK2.
+
2017-04-19 Alex Christensen <achristen...@webkit.org>
Parsing large XML strings fails
Added: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/events/drag-and-drop-link-containing-block-expected.txt (0 => 216372)
--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/events/drag-and-drop-link-containing-block-expected.txt (rev 0)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/events/drag-and-drop-link-containing-block-expected.txt 2017-05-08 09:10:32 UTC (rev 216372)
@@ -0,0 +1,6 @@
+Try to drag me
+
+
+PASS (drag started)
+PASS (dropped)
+
Added: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/events/drag-and-drop-link-containing-block.html (0 => 216372)
--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/events/drag-and-drop-link-containing-block.html (rev 0)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/events/drag-and-drop-link-containing-block.html 2017-05-08 09:10:32 UTC (rev 216372)
@@ -0,0 +1,46 @@
+<style>
+a {
+ font-size: 100px;
+ width: 100%;
+ white-space: nowrap;
+ font-family: -apple-system;
+}
+
+#drop {
+ position: absolute;
+ top: 300px;
+ left: 0;
+ width: 100%;
+ height: 200px;
+ border: 1px blue dashed;
+}
+</style>
+<a id="drag" href="" to drag me</h1></a>
+<div id="drop"><br></div>
+<script>
+(() => {
+ drag.addEventListener("dragstart", event => {
+ drop.insertAdjacentHTML("beforeend", `<code style="color: green">PASS (drag started)</code><br>`);
+ });
+ drop.addEventListener("dragenter", event => event.preventDefault());
+ drop.addEventListener("dragover", event => event.preventDefault());
+ drop.addEventListener("drop", event => {
+ drop.insertAdjacentHTML("beforeend", `<code style="color: green">PASS (dropped)</code><br>`);
+ event.preventDefault();
+ if (window.testRunner)
+ testRunner.notifyDone();
+ });
+
+ if (!window.testRunner || !window.eventSender)
+ return;
+
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+ eventSender.mouseMoveTo(100, 80);
+ eventSender.mouseDown();
+ eventSender.leapForward(100);
+ eventSender.mouseMoveTo(100, 400);
+ eventSender.mouseUp();
+})();
+</script>
+
Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/platform/gtk/TestExpectations (216371 => 216372)
--- releases/WebKitGTK/webkit-2.16/LayoutTests/platform/gtk/TestExpectations 2017-05-08 09:04:59 UTC (rev 216371)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/platform/gtk/TestExpectations 2017-05-08 09:10:32 UTC (rev 216372)
@@ -1883,6 +1883,7 @@
webkit.org/b/157179 fast/events/crash-on-mutate-during-drop.html [ Failure ]
webkit.org/b/157179 fast/events/drag-and-drop-dataTransfer-types-nocrash.html [ Failure ]
webkit.org/b/157179 fast/events/drag-and-drop-fire-drag-dragover.html [ Failure ]
+webkit.org/b/157179 fast/events/drag-and-drop-link-containing-block.html [ Failure ]
webkit.org/b/157179 fast/events/drag-and-drop.html [ Failure Timeout ]
webkit.org/b/157179 fast/events/drag-and-drop-subframe-dataTransfer.html [ Failure Timeout ]
webkit.org/b/42194 fast/events/drag-and-drop-link.html [ Failure ]
Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/platform/mac-wk2/TestExpectations (216371 => 216372)
--- releases/WebKitGTK/webkit-2.16/LayoutTests/platform/mac-wk2/TestExpectations 2017-05-08 09:04:59 UTC (rev 216371)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/platform/mac-wk2/TestExpectations 2017-05-08 09:10:32 UTC (rev 216372)
@@ -102,6 +102,7 @@
fast/events/drag-and-drop.html
fast/events/drag-and-drop-link.html
fast/events/drag-and-drop-link-fast-multiple-times-does-not-crash.html
+fast/events/drag-and-drop-link-containing-block.html
fast/events/drag-in-frames.html
fast/events/drag-parent-node.html
fast/events/draggable-div-nodata.html
Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog (216371 => 216372)
--- releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog 2017-05-08 09:04:59 UTC (rev 216371)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog 2017-05-08 09:10:32 UTC (rev 216372)
@@ -1,3 +1,24 @@
+2017-04-20 Wenson Hsieh <wenson_hs...@apple.com>
+
+ Inline anchor elements cannot be dragged when starting the drag from a block descendant
+ https://bugs.webkit.org/show_bug.cgi?id=171062
+ <rdar://problem/31697835>
+
+ Reviewed by Tim Horton.
+
+ Tweaks DragController::draggableElement to traverse the DOM instead of the render tree when finding a draggable
+ element. This prevents us from skipping elements that are in the DOM ancestor chain, but appear as siblings to
+ the hit-tested node's renderer in the render tree.
+
+ There was also previously a check to ensure that we skip anonymous RenderObjects while traversing up the chain,
+ but this is no longer necessary fter this change, since all the elements we traverse in the DOM should have
+ renderers that are not anonymous.
+
+ Test: fast/events/drag-and-drop-link-containing-block.html
+
+ * page/DragController.cpp:
+ (WebCore::DragController::draggableElement):
+
2017-04-19 Alex Christensen <achristen...@webkit.org>
Parsing large XML strings fails
Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/page/DragController.cpp (216371 => 216372)
--- releases/WebKitGTK/webkit-2.16/Source/WebCore/page/DragController.cpp 2017-05-08 09:04:59 UTC (rev 216371)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/page/DragController.cpp 2017-05-08 09:10:32 UTC (rev 216372)
@@ -658,13 +658,11 @@
state.type = DragSourceActionNone;
#endif
- for (auto* renderer = startElement->renderer(); renderer; renderer = renderer->parent()) {
- Element* element = renderer->nonPseudoElement();
- if (!element) {
- // Anonymous render blocks don't correspond to actual DOM elements, so we skip over them
- // for the purposes of finding a draggable element.
+ for (auto* element = startElement; element; element = element->parentOrShadowHostElement()) {
+ auto* renderer = element->renderer();
+ if (!renderer)
continue;
- }
+
EUserDrag dragMode = renderer->style().userDrag();
if ((m_dragSourceAction & DragSourceActionDHTML) && dragMode == DRAG_ELEMENT) {
state.type = static_cast<DragSourceAction>(state.type | DragSourceActionDHTML);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes