Changeset 48515 in webkit
- Timestamp:
- Sep 18, 2009 11:01:59 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r48503 r48515 1 2009-09-18 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Adele Peterson. 4 5 Test for https://bugs.webkit.org/show_bug.cgi?id=29276 6 REGRESSION(r48334): WebKit crashes on file select by drag 7 8 * fast/events/drag-file-crash-expected.txt: Added. 9 * fast/events/drag-file-crash.html: Added. 10 1 11 2009-09-18 Steve Block <steveblock@google.com> 2 12 -
trunk/WebCore/ChangeLog
r48514 r48515 1 2009-09-18 Sam Weinig <sam@webkit.org> 2 3 Reviewed by Adele Peterson. 4 5 Follow up fix for https://bugs.webkit.org/show_bug.cgi?id=29276 6 REGRESSION(r48334): WebKit crashes on file select by drag 7 8 Don't use Document.elementFromPoint since it returns null if the point 9 is outside the viewport. Instead, just hit test ourselves. 10 11 Test: fast/events/drag-file-crash.html 12 13 * page/DragController.cpp: 14 (WebCore::elementUnderMouse): 15 (WebCore::DragController::tryDocumentDrag): 16 (WebCore::DragController::concludeEditDrag): 17 1 18 2009-09-18 Darin Adler <darin@apple.com> 2 19 -
trunk/WebCore/page/DragController.cpp
r48500 r48515 48 48 #include "HTMLInputElement.h" 49 49 #include "HTMLNames.h" 50 #include "HitTestRequest.h" 50 51 #include "HitTestResult.h" 51 52 #include "Image.h" … … 55 56 #include "RenderFileUploadControl.h" 56 57 #include "RenderImage.h" 58 #include "RenderView.h" 57 59 #include "ReplaceSelectionCommand.h" 58 60 #include "ResourceRequest.h" … … 255 257 } 256 258 259 static Element* elementUnderMouse(Document* documentUnderMouse, const IntPoint& p) 260 { 261 float zoomFactor = documentUnderMouse->frame()->pageZoomFactor(); 262 IntPoint point = roundedIntPoint(FloatPoint(p.x() * zoomFactor, p.y() * zoomFactor)); 263 264 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active); 265 HitTestResult result(point); 266 documentUnderMouse->renderView()->layer()->hitTest(request, result); 267 268 Node* n = result.innerNode(); 269 while (n && !n->isElementNode()) 270 n = n->parentNode(); 271 if (n) 272 n = n->shadowAncestorNode(); 273 274 ASSERT(n); 275 return static_cast<Element*>(n); 276 } 277 257 278 bool DragController::tryDocumentDrag(DragData* dragData, DragDestinationAction actionMask, DragOperation& operation) 258 279 { … … 289 310 } 290 311 291 IntPoint point = frameView->convertFromContainingWindow(dragData->clientPosition()); 292 Element* element = m_documentUnderMouse->elementFromPoint(point.x(), point.y()); 293 ASSERT(element); 312 IntPoint point = frameView->windowToContents(dragData->clientPosition()); 313 Element* element = elementUnderMouse(m_documentUnderMouse, point); 294 314 if (!asFileInput(element)) { 295 315 VisibleSelection dragCaret = m_documentUnderMouse->frame()->visiblePositionForPoint(point); … … 340 360 return false; 341 361 342 IntPoint point = m_documentUnderMouse->view()->convertFromContainingWindow(dragData->clientPosition()); 343 Element* element = m_documentUnderMouse->elementFromPoint(point.x(), point.y()); 344 ASSERT(element); 362 IntPoint point = m_documentUnderMouse->view()->windowToContents(dragData->clientPosition()); 363 Element* element = elementUnderMouse(m_documentUnderMouse, point); 345 364 Frame* innerFrame = element->ownerDocument()->frame(); 346 365 ASSERT(innerFrame);
Note: See TracChangeset
for help on using the changeset viewer.