Changeset 182957 in webkit
- Timestamp:
- Apr 17, 2015 11:21:30 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r182956 r182957 1 2015-04-17 Daniel Bates <dabates@apple.com> 2 3 REGRESSION: SVG does not support link dragging 4 https://bugs.webkit.org/show_bug.cgi?id=141597 5 6 Reviewed by Darin Adler. 7 8 Add a test to ensure we do not regress dragging of a HTML hyperlink or a SVG hyperlink. 9 10 * fast/events/drag-and-drop-link-expected.txt: Added. 11 * fast/events/drag-and-drop-link.html: Added. 12 * platform/efl/TestExpectations: Mark the test as "failure" since EFL does not support drag-and-drop. 13 * platform/gtk/TestExpectations: Mark the test as "failure" until we implement drag-and-drop support for 14 GTK+ as part of fixing <https://bugs.webkit.org/show_bug.cgi?id=42194>. 15 * platform/ios-simulator/TestExpectations: Skip the test since iOS does not implement 16 drag-and-drop support. 17 * platform/mac-wk2/TestExpectations: Skip the test until we implement drag-and-drop support in EventSender 18 for Mac as part of fixing <https://bugs.webkit.org/show_bug.cgi?id=42194>. 19 1 20 2015-04-17 Commit Queue <commit-queue@webkit.org> 2 21 -
trunk/LayoutTests/platform/efl/TestExpectations
r182956 r182957 344 344 webkit.org/b/86623 fast/events/drag-image-filename.html [ Timeout ] 345 345 webkit.org/b/86623 fast/events/drag-in-frames.html [ Failure ] 346 webkit.org/b/86623 fast/events/drag-and-drop-link.html [ Failure ] 346 347 webkit.org/b/86623 fast/events/drag-and-drop-link-into-focused-contenteditable.html [ Failure ] 347 348 webkit.org/b/86623 fast/events/drag-parent-node.html [ Failure ] -
trunk/LayoutTests/platform/gtk/TestExpectations
r182956 r182957 1411 1411 webkit.org/b/63706 fast/events/drag-and-drop.html [ Failure Timeout ] 1412 1412 webkit.org/b/63706 fast/events/drag-and-drop-subframe-dataTransfer.html [ Failure Timeout ] 1413 webkit.org/b/42194 fast/events/drag-and-drop-link.html [ Failure ] 1413 1414 webkit.org/b/63706 fast/events/drag-and-drop-link-into-focused-contenteditable.html [ Failure ] 1414 1415 webkit.org/b/63706 fast/events/drag-parent-node.html [ Failure ] -
trunk/LayoutTests/platform/ios-simulator/TestExpectations
r182956 r182957 158 158 fast/events/drag-image-filename.html 159 159 fast/events/drag-in-frames.html 160 fast/events/drag-and-drop-link.html 160 161 fast/events/drag-and-drop-link-into-focused-contenteditable.html 161 162 fast/events/drag-outside-window.html -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r182925 r182957 77 77 fast/events/drag-and-drop-fire-drag-dragover.html 78 78 fast/events/drag-and-drop.html 79 fast/events/drag-and-drop-link.html 79 80 fast/events/drag-in-frames.html 80 81 fast/events/drag-parent-node.html -
trunk/Source/WebCore/ChangeLog
r182956 r182957 1 2015-04-17 Daniel Bates <dabates@apple.com> 2 3 REGRESSION: SVG does not support link dragging 4 https://bugs.webkit.org/show_bug.cgi?id=141597 5 6 Reviewed by Darin Adler. 7 8 Fixes an issue where a SVG hyperlink cannot be dragged. We should support 9 dragging an SVG A element just as we support dragging an HTML A element. 10 11 Test: fast/events/drag-and-drop-link.html 12 13 * page/DragController.cpp: Removed explicit include of header Element.h as it will 14 be ultimately included by HTMLAnchorElement.h, among other headers. 15 (WebCore::isDraggableLink): Added. Extracted code from HitTestResult::isLiveLink(). 16 (WebCore::DragController::draggableElement): Call WebCore::isDraggableLink() to 17 determine whether a element is a hyperlink that can be dragged. 18 * page/DragController.h: 19 * page/EventHandler.cpp: 20 (WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent): Write code in terms of 21 WebCore::isDraggableLink(). 22 * rendering/HitTestResult.cpp: 23 (WebCore::HitTestResult::isLiveLink): Deleted. 24 * rendering/HitTestResult.h: 25 1 26 2015-04-17 Commit Queue <commit-queue@webkit.org> 2 27 -
trunk/Source/WebCore/page/DragController.cpp
r182748 r182957 27 27 #include "DragController.h" 28 28 29 #include "HTMLAnchorElement.h" 30 #include "SVGAElement.h" 31 29 32 #if ENABLE(DRAG_SUPPORT) 30 31 33 #include "CachedImage.h" 32 34 #include "CachedResourceLoader.h" … … 41 43 #include "Editor.h" 42 44 #include "EditorClient.h" 43 #include "Element.h"44 45 #include "EventHandler.h" 45 46 #include "ExceptionCodePlaceholder.h" … … 49 50 #include "FrameSelection.h" 50 51 #include "FrameView.h" 51 #include "HTMLAnchorElement.h"52 52 #include "HTMLAttachmentElement.h" 53 53 #include "HTMLImageElement.h" … … 81 81 #include <wtf/CurrentTime.h> 82 82 #include <wtf/RefPtr.h> 83 #endif 83 84 84 85 namespace WebCore { 85 86 87 bool isDraggableLink(const Element& element) 88 { 89 if (is<HTMLAnchorElement>(element)) 90 return downcast<HTMLAnchorElement>(element).isLiveLink(); 91 if (is<SVGAElement>(element)) 92 return element.isLink(); 93 return false; 94 } 95 96 #if ENABLE(DRAG_SUPPORT) 97 86 98 static PlatformMouseEvent createMouseEvent(DragData& dragData) 87 99 { … … 653 665 return element; 654 666 } 655 if ((m_dragSourceAction & DragSourceActionLink) 656 && is<HTMLAnchorElement>(*element) 657 && downcast<HTMLAnchorElement>(*element).isLiveLink()) { 667 if ((m_dragSourceAction & DragSourceActionLink) && isDraggableLink(*element)) { 658 668 state.type = static_cast<DragSourceAction>(state.type | DragSourceActionLink); 659 669 return element; … … 989 999 } 990 1000 1001 #endif // ENABLE(DRAG_SUPPORT) 1002 991 1003 } // namespace WebCore 992 993 #endif // ENABLE(DRAG_SUPPORT) -
trunk/Source/WebCore/page/DragController.h
r181760 r182957 141 141 }; 142 142 143 WEBCORE_EXPORT bool isDraggableLink(const Element&); 144 143 145 } 144 146 -
trunk/Source/WebCore/page/EventHandler.cpp
r182956 r182957 599 599 void EventHandler::selectClosestWordOrLinkFromMouseEvent(const MouseEventWithHitTestResults& result) 600 600 { 601 if (!result.hitTestResult().isLiveLink()) 601 Element* urlElement = result.hitTestResult().URLElement(); 602 if (!urlElement || !isDraggableLink(*urlElement)) 602 603 return selectClosestWordFromMouseEvent(result); 603 604 … … 606 607 if (targetNode && targetNode->renderer() && m_mouseDownMayStartSelect) { 607 608 VisibleSelection newSelection; 608 Element* URLElement = result.hitTestResult().URLElement();609 609 VisiblePosition pos(targetNode->renderer()->positionForPoint(result.localPoint(), nullptr)); 610 if (pos.isNotNull() && pos.deepEquivalent().deprecatedNode()->isDescendantOf( URLElement))611 newSelection = VisibleSelection::selectionFromContentsOfNode( URLElement);610 if (pos.isNotNull() && pos.deepEquivalent().deprecatedNode()->isDescendantOf(urlElement)) 611 newSelection = VisibleSelection::selectionFromContentsOfNode(urlElement); 612 612 613 613 updateSelectionForMouseDownDispatchingSelectStart(targetNode, expandSelectionToRespectSelectOnMouseDown(*targetNode, newSelection), WordGranularity); -
trunk/Source/WebCore/rendering/HitTestResult.cpp
r182573 r182957 609 609 } 610 610 611 bool HitTestResult::isLiveLink() const612 {613 if (!m_innerURLElement)614 return false;615 616 if (is<HTMLAnchorElement>(*m_innerURLElement))617 return downcast<HTMLAnchorElement>(*m_innerURLElement).isLiveLink();618 619 if (is<SVGAElement>(*m_innerURLElement))620 return m_innerURLElement->isLink();621 622 return false;623 }624 625 611 bool HitTestResult::isOverLink() const 626 612 { -
trunk/Source/WebCore/rendering/HitTestResult.h
r182573 r182957 112 112 #endif 113 113 WEBCORE_EXPORT String textContent() const; 114 WEBCORE_EXPORT bool isLiveLink() const;115 114 bool isOverLink() const; 116 115 WEBCORE_EXPORT bool isContentEditable() const; -
trunk/Source/WebKit/mac/ChangeLog
r182928 r182957 1 2015-04-17 Daniel Bates <dabates@apple.com> 2 3 REGRESSION: SVG does not support link dragging 4 https://bugs.webkit.org/show_bug.cgi?id=141597 5 6 Reviewed by Darin Adler. 7 8 Write -[WebElementDictionary _isLiveLink] in terms of WebCore::isDraggableLink(). 9 10 * Misc/WebElementDictionary.mm: 11 (-[WebElementDictionary _isLiveLink]): 12 1 13 2015-04-16 Sam Weinig <sam@webkit.org> 2 14 -
trunk/Source/WebKit/mac/Misc/WebElementDictionary.mm
r173364 r182957 37 37 #import "WebView.h" 38 38 #import "WebViewPrivate.h" 39 #import <WebCore/DragController.h> 39 40 #import <WebCore/Frame.h> 40 41 #import <WebCore/HitTestResult.h> … … 266 267 - (NSNumber *)_isLiveLink 267 268 { 268 return [NSNumber numberWithBool:_result->isLiveLink()]; 269 Element* urlElement = _result->URLElement(); 270 return [NSNumber numberWithBool:(urlElement && isDraggableLink(*urlElement))]; 269 271 } 270 272
Note: See TracChangeset
for help on using the changeset viewer.