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

Side by Side Diff: sky/engine/core/frame/NewEventHandler.cpp

Issue 928393003: Remove the concept of document.documentElement (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « sky/engine/core/frame/LocalDOMWindow.cpp ('k') | sky/engine/core/page/EventHandler.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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sky/engine/config.h" 5 #include "sky/engine/config.h"
6 #include "sky/engine/core/frame/NewEventHandler.h" 6 #include "sky/engine/core/frame/NewEventHandler.h"
7 7
8 #include "sky/engine/core/dom/Document.h" 8 #include "sky/engine/core/dom/Document.h"
9 #include "sky/engine/core/dom/NodeRenderingTraversal.h" 9 #include "sky/engine/core/dom/NodeRenderingTraversal.h"
10 #include "sky/engine/core/editing/Editor.h" 10 #include "sky/engine/core/editing/Editor.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 NewEventHandler::~NewEventHandler() 48 NewEventHandler::~NewEventHandler()
49 { 49 {
50 } 50 }
51 51
52 Node* NewEventHandler::targetForKeyboardEvent() const 52 Node* NewEventHandler::targetForKeyboardEvent() const
53 { 53 {
54 Document* document = m_frame.document(); 54 Document* document = m_frame.document();
55 if (Node* focusedElement = document->focusedElement()) 55 if (Node* focusedElement = document->focusedElement())
56 return focusedElement; 56 return focusedElement;
57 return document->documentElement(); 57 return document;
58 } 58 }
59 59
60 Node* NewEventHandler::targetForHitTestResult(const HitTestResult& hitTestResult ) 60 Node* NewEventHandler::targetForHitTestResult(const HitTestResult& hitTestResult )
61 { 61 {
62 Node* node = hitTestResult.innerNode(); 62 Node* node = hitTestResult.innerNode();
63 if (!node) 63 if (!node)
64 return m_frame.document()->documentElement(); 64 return m_frame.document();
65 if (node->isTextNode()) 65 if (node->isTextNode())
66 return NodeRenderingTraversal::parent(node); 66 return NodeRenderingTraversal::parent(node);
67 return node; 67 return node;
68 } 68 }
69 69
70 HitTestResult NewEventHandler::performHitTest(const LayoutPoint& point) 70 HitTestResult NewEventHandler::performHitTest(const LayoutPoint& point)
71 { 71 {
72 HitTestResult result(point); 72 HitTestResult result(point);
73 if (!m_frame.contentRenderer()) 73 if (!m_frame.contentRenderer())
74 return result; 74 return result;
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 auto it = m_stateForPointer.find(event.pointer); 244 auto it = m_stateForPointer.find(event.pointer);
245 if (it == m_stateForPointer.end()) 245 if (it == m_stateForPointer.end())
246 return false; 246 return false;
247 PointerState stateCopy = it->second; 247 PointerState stateCopy = it->second;
248 m_stateForPointer.erase(it); 248 m_stateForPointer.erase(it);
249 ASSERT(stateCopy.target); 249 ASSERT(stateCopy.target);
250 return dispatchPointerEvent(stateCopy, event); 250 return dispatchPointerEvent(stateCopy, event);
251 } 251 }
252 252
253 } 253 }
OLDNEW
« no previous file with comments | « sky/engine/core/frame/LocalDOMWindow.cpp ('k') | sky/engine/core/page/EventHandler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698