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

Unified Diff: sky/engine/core/page/EventHandler.cpp

Issue 925933004: Prune HitTestResult and stop special-casing links. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/page/EventHandler.h ('k') | sky/engine/core/rendering/HitTestResult.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/page/EventHandler.cpp
diff --git a/sky/engine/core/page/EventHandler.cpp b/sky/engine/core/page/EventHandler.cpp
index 91a33fd4420fba74bbe6c5c9dc7b18d9b515c0f0..5fe441236cb1a918926f435428a21ac4624f1809 100644
--- a/sky/engine/core/page/EventHandler.cpp
+++ b/sky/engine/core/page/EventHandler.cpp
@@ -219,14 +219,6 @@ HitTestResult EventHandler::hitTestResultAtPoint(const LayoutPoint& point, HitTe
return result;
}
-bool EventHandler::useHandCursor(Node* node, bool isOverLink)
-{
- if (!node)
- return false;
-
- return isOverLink && !node->hasEditableStyle();
-}
-
void EventHandler::cursorUpdateTimerFired(Timer<EventHandler>*)
{
ASSERT(m_frame);
@@ -247,7 +239,7 @@ OptionalCursor EventHandler::selectCursor(const HitTestResult& result)
Node* node = result.innerPossiblyPseudoNode();
if (!node)
- return selectAutoCursor(result, node, iBeamCursor());
+ return selectAutoCursor(result, node);
RenderObject* renderer = node->renderer();
RenderStyle* style = renderer ? renderer->style() : 0;
@@ -296,8 +288,7 @@ OptionalCursor EventHandler::selectCursor(const HitTestResult& result)
switch (style ? style->cursor() : CURSOR_AUTO) {
case CURSOR_AUTO: {
- const Cursor& iBeam = iBeamCursor();
- return selectAutoCursor(result, node, iBeam);
+ return selectAutoCursor(result, node);
}
case CURSOR_CROSS:
return crossCursor();
@@ -373,16 +364,11 @@ OptionalCursor EventHandler::selectCursor(const HitTestResult& result)
return pointerCursor();
}
-OptionalCursor EventHandler::selectAutoCursor(const HitTestResult& result, Node* node, const Cursor& iBeam)
+OptionalCursor EventHandler::selectAutoCursor(const HitTestResult& result, Node* node)
{
- bool editable = (node && node->hasEditableStyle());
-
- if (useHandCursor(node, result.isOverLink()))
- return handCursor();
-
RenderObject* renderer = node ? node->renderer() : 0;
- if (editable || (renderer && renderer->isText() && node->canStartSelection()))
- return iBeam;
+ if ((node && node->hasEditableStyle()) || (renderer && renderer->isText() && node->canStartSelection()))
esprehn 2015/02/13 22:13:13 if (!node || !renderer) return pointerCursor();
+ return iBeamCursor();
return pointerCursor();
}
« no previous file with comments | « sky/engine/core/page/EventHandler.h ('k') | sky/engine/core/rendering/HitTestResult.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698