Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: Source/core/page/EventHandler.cpp

Issue 268803005: Replace SVGDocument by XMLDocument (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix mentioned issues Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/html/HTMLFrameOwnerElement.cpp ('k') | Source/core/svg/SVGDocument.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 #include "core/page/TouchAdjustment.h" 77 #include "core/page/TouchAdjustment.h"
78 #include "core/rendering/HitTestRequest.h" 78 #include "core/rendering/HitTestRequest.h"
79 #include "core/rendering/HitTestResult.h" 79 #include "core/rendering/HitTestResult.h"
80 #include "core/rendering/RenderFlowThread.h" 80 #include "core/rendering/RenderFlowThread.h"
81 #include "core/rendering/RenderLayer.h" 81 #include "core/rendering/RenderLayer.h"
82 #include "core/rendering/RenderTextControlSingleLine.h" 82 #include "core/rendering/RenderTextControlSingleLine.h"
83 #include "core/rendering/RenderView.h" 83 #include "core/rendering/RenderView.h"
84 #include "core/rendering/RenderWidget.h" 84 #include "core/rendering/RenderWidget.h"
85 #include "core/rendering/style/CursorList.h" 85 #include "core/rendering/style/CursorList.h"
86 #include "core/rendering/style/RenderStyle.h" 86 #include "core/rendering/style/RenderStyle.h"
87 #include "core/svg/SVGDocument.h" 87 #include "core/svg/SVGDocumentExtensions.h"
88 #include "core/svg/SVGElementInstance.h" 88 #include "core/svg/SVGElementInstance.h"
89 #include "core/svg/SVGUseElement.h" 89 #include "core/svg/SVGUseElement.h"
90 #include "platform/PlatformGestureEvent.h" 90 #include "platform/PlatformGestureEvent.h"
91 #include "platform/PlatformKeyboardEvent.h" 91 #include "platform/PlatformKeyboardEvent.h"
92 #include "platform/PlatformTouchEvent.h" 92 #include "platform/PlatformTouchEvent.h"
93 #include "platform/PlatformWheelEvent.h" 93 #include "platform/PlatformWheelEvent.h"
94 #include "platform/WindowsKeyboardCodes.h" 94 #include "platform/WindowsKeyboardCodes.h"
95 #include "platform/geometry/FloatPoint.h" 95 #include "platform/geometry/FloatPoint.h"
96 #include "platform/graphics/Image.h" 96 #include "platform/graphics/Image.h"
97 #include "platform/heap/Handle.h" 97 #include "platform/heap/Handle.h"
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 580
581 m_mouseDownMayStartDrag = singleClick; 581 m_mouseDownMayStartDrag = singleClick;
582 582
583 m_mouseDownWasSingleClickInSelection = false; 583 m_mouseDownWasSingleClickInSelection = false;
584 584
585 m_mouseDown = event.event(); 585 m_mouseDown = event.event();
586 586
587 if (event.isOverWidget() && passWidgetMouseDownEventToWidget(event)) 587 if (event.isOverWidget() && passWidgetMouseDownEventToWidget(event))
588 return true; 588 return true;
589 589
590 if (m_frame->document()->isSVGDocument() 590 if (m_frame->document()->isSVGDocument() && m_frame->document()->accessSVGEx tensions().zoomAndPanEnabled()) {
591 && toSVGDocument(m_frame->document())->zoomAndPanEnabled()) {
592 if (event.event().shiftKey() && singleClick) { 591 if (event.event().shiftKey() && singleClick) {
593 m_svgPan = true; 592 m_svgPan = true;
594 toSVGDocument(m_frame->document())->startPan(m_frame->view()->window ToContents(event.event().position())); 593 m_frame->document()->accessSVGExtensions().startPan(m_frame->view()- >windowToContents(event.event().position()));
pdr. 2014/05/05 17:37:59 Nit: inside the if statement we can just use svgEx
595 return true; 594 return true;
596 } 595 }
597 } 596 }
598 597
599 // We don't do this at the start of mouse down handling, 598 // We don't do this at the start of mouse down handling,
600 // because we don't want to do it until we know we didn't hit a widget. 599 // because we don't want to do it until we know we didn't hit a widget.
601 if (singleClick) 600 if (singleClick)
602 focusDocumentView(); 601 focusDocumentView();
603 602
604 Node* innerNode = event.targetNode(); 603 Node* innerNode = event.targetNode();
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
1390 setLastKnownMousePosition(mouseEvent); 1389 setLastKnownMousePosition(mouseEvent);
1391 1390
1392 if (m_hoverTimer.isActive()) 1391 if (m_hoverTimer.isActive())
1393 m_hoverTimer.stop(); 1392 m_hoverTimer.stop();
1394 1393
1395 m_cursorUpdateTimer.stop(); 1394 m_cursorUpdateTimer.stop();
1396 1395
1397 cancelFakeMouseMoveEvent(); 1396 cancelFakeMouseMoveEvent();
1398 1397
1399 if (m_svgPan) { 1398 if (m_svgPan) {
1400 toSVGDocument(m_frame->document())->updatePan(m_frame->view()->windowToC ontents(m_lastKnownMousePosition)); 1399 m_frame->document()->svgExtensions()->updatePan(m_frame->view()->windowT oContents(m_lastKnownMousePosition));
pdr. 2014/05/05 17:37:59 Nit: It isn't obvious to me that this always hits
1401 return true; 1400 return true;
1402 } 1401 }
1403 1402
1404 if (m_frameSetBeingResized) 1403 if (m_frameSetBeingResized)
1405 return !dispatchMouseEvent(EventTypeNames::mousemove, m_frameSetBeingRes ized.get(), 0, mouseEvent, false); 1404 return !dispatchMouseEvent(EventTypeNames::mousemove, m_frameSetBeingRes ized.get(), 0, mouseEvent, false);
1406 1405
1407 // Send events right to a scrollbar if the mouse is pressed. 1406 // Send events right to a scrollbar if the mouse is pressed.
1408 if (m_lastScrollbarUnderMouse && m_mousePressed) { 1407 if (m_lastScrollbarUnderMouse && m_mousePressed) {
1409 m_lastScrollbarUnderMouse->mouseMoved(mouseEvent); 1408 m_lastScrollbarUnderMouse->mouseMoved(mouseEvent);
1410 return true; 1409 return true;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
1520 #if OS(WIN) 1519 #if OS(WIN)
1521 if (Page* page = m_frame->page()) 1520 if (Page* page = m_frame->page())
1522 page->autoscrollController().handleMouseReleaseForPanScrolling(m_frame, mouseEvent); 1521 page->autoscrollController().handleMouseReleaseForPanScrolling(m_frame, mouseEvent);
1523 #endif 1522 #endif
1524 1523
1525 m_mousePressed = false; 1524 m_mousePressed = false;
1526 setLastKnownMousePosition(mouseEvent); 1525 setLastKnownMousePosition(mouseEvent);
1527 1526
1528 if (m_svgPan) { 1527 if (m_svgPan) {
1529 m_svgPan = false; 1528 m_svgPan = false;
1530 toSVGDocument(m_frame->document())->updatePan(m_frame->view()->windowToC ontents(m_lastKnownMousePosition)); 1529 m_frame->document()->svgExtensions()->updatePan(m_frame->view()->windowT oContents(m_lastKnownMousePosition));
1531 return true; 1530 return true;
1532 } 1531 }
1533 1532
1534 if (m_frameSetBeingResized) 1533 if (m_frameSetBeingResized)
1535 return !dispatchMouseEvent(EventTypeNames::mouseup, m_frameSetBeingResiz ed.get(), m_clickCount, mouseEvent, false); 1534 return !dispatchMouseEvent(EventTypeNames::mouseup, m_frameSetBeingResiz ed.get(), m_clickCount, mouseEvent, false);
1536 1535
1537 if (m_lastScrollbarUnderMouse) { 1536 if (m_lastScrollbarUnderMouse) {
1538 invalidateClick(); 1537 invalidateClick();
1539 m_lastScrollbarUnderMouse->mouseUp(mouseEvent); 1538 m_lastScrollbarUnderMouse->mouseUp(mouseEvent);
1540 bool setUnder = false; 1539 bool setUnder = false;
(...skipping 2244 matching lines...) Expand 10 before | Expand all | Expand 10 after
3785 unsigned EventHandler::accessKeyModifiers() 3784 unsigned EventHandler::accessKeyModifiers()
3786 { 3785 {
3787 #if OS(MACOSX) 3786 #if OS(MACOSX)
3788 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3787 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3789 #else 3788 #else
3790 return PlatformEvent::AltKey; 3789 return PlatformEvent::AltKey;
3791 #endif 3790 #endif
3792 } 3791 }
3793 3792
3794 } // namespace WebCore 3793 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/HTMLFrameOwnerElement.cpp ('k') | Source/core/svg/SVGDocument.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698