From aab669a05f943c587f6acccd94d53a8544170c1c Mon Sep 17 00:00:00 2001 From: Konstantin Tokarev Date: Thu, 15 Jun 2017 12:13:20 +0300 Subject: Import WebKit commit 6d0ad27b6bc4209fb8d8cee2692dc0c6a5462051 Change-Id: Ifdedb7bc3162434686201813dc1d994cf5ae7e70 Reviewed-by: Konstantin Tokarev --- Source/WebCore/page/DragController.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Source/WebCore/page/DragController.cpp') diff --git a/Source/WebCore/page/DragController.cpp b/Source/WebCore/page/DragController.cpp index c4cbb67ef..7a874db56 100644 --- a/Source/WebCore/page/DragController.cpp +++ b/Source/WebCore/page/DragController.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007, 2009, 2010, 2013, 2015 Apple Inc. All rights reserved. + * Copyright (C) 2007, 2009-2010, 2013, 2015-2016 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -432,6 +432,7 @@ DragOperation DragController::operationForLoad(DragData& dragData) static bool setSelectionToDragCaret(Frame* frame, VisibleSelection& dragCaret, RefPtr& range, const IntPoint& point) { + Ref protector(*frame); frame->selection().setSelection(dragCaret); if (frame->selection().selection().isNone()) { dragCaret = frame->visiblePositionForPoint(point); @@ -752,6 +753,7 @@ bool DragController::startDrag(Frame& src, const DragState& state, DragOperation if (!src.view() || !src.contentRenderer() || !state.source) return false; + Ref protector(src); HitTestResult hitTestResult = src.eventHandler().hitTestResultAtPoint(dragOrigin, HitTestRequest::ReadOnly | HitTestRequest::Active); // FIXME(136836): Investigate whether all elements should use the containsIncludingShadowDOM() path here. -- cgit v1.2.1