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

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: Add rootElement() variant 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/SVGUseElement.h" 88 #include "core/svg/SVGUseElement.h"
89 #include "platform/PlatformGestureEvent.h" 89 #include "platform/PlatformGestureEvent.h"
90 #include "platform/PlatformKeyboardEvent.h" 90 #include "platform/PlatformKeyboardEvent.h"
91 #include "platform/PlatformTouchEvent.h" 91 #include "platform/PlatformTouchEvent.h"
92 #include "platform/PlatformWheelEvent.h" 92 #include "platform/PlatformWheelEvent.h"
93 #include "platform/WindowsKeyboardCodes.h" 93 #include "platform/WindowsKeyboardCodes.h"
94 #include "platform/geometry/FloatPoint.h" 94 #include "platform/geometry/FloatPoint.h"
95 #include "platform/graphics/Image.h" 95 #include "platform/graphics/Image.h"
96 #include "platform/heap/Handle.h" 96 #include "platform/heap/Handle.h"
97 #include "platform/scroll/ScrollAnimator.h" 97 #include "platform/scroll/ScrollAnimator.h"
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 578
579 m_mouseDownMayStartDrag = singleClick; 579 m_mouseDownMayStartDrag = singleClick;
580 580
581 m_mouseDownWasSingleClickInSelection = false; 581 m_mouseDownWasSingleClickInSelection = false;
582 582
583 m_mouseDown = event.event(); 583 m_mouseDown = event.event();
584 584
585 if (event.isOverWidget() && passWidgetMouseDownEventToWidget(event)) 585 if (event.isOverWidget() && passWidgetMouseDownEventToWidget(event))
586 return true; 586 return true;
587 587
588 if (m_frame->document()->isSVGDocument() 588 if (m_frame->document()->isSVGDocument() && m_frame->document()->accessSVGEx tensions().zoomAndPanEnabled()) {
589 && toSVGDocument(m_frame->document())->zoomAndPanEnabled()) {
590 if (event.event().shiftKey() && singleClick) { 589 if (event.event().shiftKey() && singleClick) {
591 m_svgPan = true; 590 m_svgPan = true;
592 toSVGDocument(m_frame->document())->startPan(m_frame->view()->window ToContents(event.event().position())); 591 m_frame->document()->accessSVGExtensions().startPan(m_frame->view()- >windowToContents(event.event().position()));
593 return true; 592 return true;
594 } 593 }
595 } 594 }
596 595
597 // We don't do this at the start of mouse down handling, 596 // We don't do this at the start of mouse down handling,
598 // because we don't want to do it until we know we didn't hit a widget. 597 // because we don't want to do it until we know we didn't hit a widget.
599 if (singleClick) 598 if (singleClick)
600 focusDocumentView(); 599 focusDocumentView();
601 600
602 Node* innerNode = event.targetNode(); 601 Node* innerNode = event.targetNode();
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after
1388 setLastKnownMousePosition(mouseEvent); 1387 setLastKnownMousePosition(mouseEvent);
1389 1388
1390 if (m_hoverTimer.isActive()) 1389 if (m_hoverTimer.isActive())
1391 m_hoverTimer.stop(); 1390 m_hoverTimer.stop();
1392 1391
1393 m_cursorUpdateTimer.stop(); 1392 m_cursorUpdateTimer.stop();
1394 1393
1395 cancelFakeMouseMoveEvent(); 1394 cancelFakeMouseMoveEvent();
1396 1395
1397 if (m_svgPan) { 1396 if (m_svgPan) {
1398 toSVGDocument(m_frame->document())->updatePan(m_frame->view()->windowToC ontents(m_lastKnownMousePosition)); 1397 m_frame->document()->accessSVGExtensions().updatePan(m_frame->view()->wi ndowToContents(m_lastKnownMousePosition));
1399 return true; 1398 return true;
1400 } 1399 }
1401 1400
1402 if (m_frameSetBeingResized) 1401 if (m_frameSetBeingResized)
1403 return !dispatchMouseEvent(EventTypeNames::mousemove, m_frameSetBeingRes ized.get(), 0, mouseEvent, false); 1402 return !dispatchMouseEvent(EventTypeNames::mousemove, m_frameSetBeingRes ized.get(), 0, mouseEvent, false);
1404 1403
1405 // Send events right to a scrollbar if the mouse is pressed. 1404 // Send events right to a scrollbar if the mouse is pressed.
1406 if (m_lastScrollbarUnderMouse && m_mousePressed) { 1405 if (m_lastScrollbarUnderMouse && m_mousePressed) {
1407 m_lastScrollbarUnderMouse->mouseMoved(mouseEvent); 1406 m_lastScrollbarUnderMouse->mouseMoved(mouseEvent);
1408 return true; 1407 return true;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
1518 #if OS(WIN) 1517 #if OS(WIN)
1519 if (Page* page = m_frame->page()) 1518 if (Page* page = m_frame->page())
1520 page->autoscrollController().handleMouseReleaseForPanScrolling(m_frame, mouseEvent); 1519 page->autoscrollController().handleMouseReleaseForPanScrolling(m_frame, mouseEvent);
1521 #endif 1520 #endif
1522 1521
1523 m_mousePressed = false; 1522 m_mousePressed = false;
1524 setLastKnownMousePosition(mouseEvent); 1523 setLastKnownMousePosition(mouseEvent);
1525 1524
1526 if (m_svgPan) { 1525 if (m_svgPan) {
1527 m_svgPan = false; 1526 m_svgPan = false;
1528 toSVGDocument(m_frame->document())->updatePan(m_frame->view()->windowToC ontents(m_lastKnownMousePosition)); 1527 m_frame->document()->accessSVGExtensions().updatePan(m_frame->view()->wi ndowToContents(m_lastKnownMousePosition));
1529 return true; 1528 return true;
1530 } 1529 }
1531 1530
1532 if (m_frameSetBeingResized) 1531 if (m_frameSetBeingResized)
1533 return !dispatchMouseEvent(EventTypeNames::mouseup, m_frameSetBeingResiz ed.get(), m_clickCount, mouseEvent, false); 1532 return !dispatchMouseEvent(EventTypeNames::mouseup, m_frameSetBeingResiz ed.get(), m_clickCount, mouseEvent, false);
1534 1533
1535 if (m_lastScrollbarUnderMouse) { 1534 if (m_lastScrollbarUnderMouse) {
1536 invalidateClick(); 1535 invalidateClick();
1537 m_lastScrollbarUnderMouse->mouseUp(mouseEvent); 1536 m_lastScrollbarUnderMouse->mouseUp(mouseEvent);
1538 bool setUnder = false; 1537 bool setUnder = false;
(...skipping 2194 matching lines...) Expand 10 before | Expand all | Expand 10 after
3733 unsigned EventHandler::accessKeyModifiers() 3732 unsigned EventHandler::accessKeyModifiers()
3734 { 3733 {
3735 #if OS(MACOSX) 3734 #if OS(MACOSX)
3736 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3735 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3737 #else 3736 #else
3738 return PlatformEvent::AltKey; 3737 return PlatformEvent::AltKey;
3739 #endif 3738 #endif
3740 } 3739 }
3741 3740
3742 } // namespace WebCore 3741 } // 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