| OLD | NEW |
| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 #include "sky/engine/core/rendering/HitTestRequest.h" | 56 #include "sky/engine/core/rendering/HitTestRequest.h" |
| 57 #include "sky/engine/core/rendering/HitTestResult.h" | 57 #include "sky/engine/core/rendering/HitTestResult.h" |
| 58 #include "sky/engine/core/rendering/RenderLayer.h" | 58 #include "sky/engine/core/rendering/RenderLayer.h" |
| 59 #include "sky/engine/core/rendering/RenderView.h" | 59 #include "sky/engine/core/rendering/RenderView.h" |
| 60 #include "sky/engine/core/rendering/style/RenderStyle.h" | 60 #include "sky/engine/core/rendering/style/RenderStyle.h" |
| 61 #include "sky/engine/platform/TraceEvent.h" | 61 #include "sky/engine/platform/TraceEvent.h" |
| 62 #include "sky/engine/platform/KeyboardCodes.h" | 62 #include "sky/engine/platform/KeyboardCodes.h" |
| 63 #include "sky/engine/platform/geometry/FloatPoint.h" | 63 #include "sky/engine/platform/geometry/FloatPoint.h" |
| 64 #include "sky/engine/platform/graphics/Image.h" | 64 #include "sky/engine/platform/graphics/Image.h" |
| 65 #include "sky/engine/platform/heap/Handle.h" | 65 #include "sky/engine/platform/heap/Handle.h" |
| 66 #include "sky/engine/platform/scroll/ScrollAnimator.h" | |
| 67 #include "sky/engine/platform/scroll/Scrollbar.h" | |
| 68 #include "sky/engine/wtf/Assertions.h" | 66 #include "sky/engine/wtf/Assertions.h" |
| 69 #include "sky/engine/wtf/CurrentTime.h" | 67 #include "sky/engine/wtf/CurrentTime.h" |
| 70 #include "sky/engine/wtf/StdLibExtras.h" | 68 #include "sky/engine/wtf/StdLibExtras.h" |
| 71 #include "sky/engine/wtf/TemporaryChange.h" | 69 #include "sky/engine/wtf/TemporaryChange.h" |
| 72 | 70 |
| 73 namespace blink { | 71 namespace blink { |
| 74 | 72 |
| 75 // The amount of time to wait for a cursor update on style and layout changes | 73 // The amount of time to wait for a cursor update on style and layout changes |
| 76 // Set to 50Hz, no need to be faster than common screen refresh rate | 74 // Set to 50Hz, no need to be faster than common screen refresh rate |
| 77 static const double cursorUpdateInterval = 0.02; | 75 static const double cursorUpdateInterval = 0.02; |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 } | 430 } |
| 433 | 431 |
| 434 OptionalCursor EventHandler::selectAutoCursor(const HitTestResult& result, Node*
node, const Cursor& iBeam) | 432 OptionalCursor EventHandler::selectAutoCursor(const HitTestResult& result, Node*
node, const Cursor& iBeam) |
| 435 { | 433 { |
| 436 bool editable = (node && node->hasEditableStyle()); | 434 bool editable = (node && node->hasEditableStyle()); |
| 437 | 435 |
| 438 if (useHandCursor(node, result.isOverLink())) | 436 if (useHandCursor(node, result.isOverLink())) |
| 439 return handCursor(); | 437 return handCursor(); |
| 440 | 438 |
| 441 RenderObject* renderer = node ? node->renderer() : 0; | 439 RenderObject* renderer = node ? node->renderer() : 0; |
| 442 if ((editable || (renderer && renderer->isText() && node->canStartSelection(
))) && !result.scrollbar()) | 440 if (editable || (renderer && renderer->isText() && node->canStartSelection()
)) |
| 443 return iBeam; | 441 return iBeam; |
| 444 return pointerCursor(); | 442 return pointerCursor(); |
| 445 } | 443 } |
| 446 | 444 |
| 447 void EventHandler::invalidateClick() | 445 void EventHandler::invalidateClick() |
| 448 { | 446 { |
| 449 m_clickCount = 0; | 447 m_clickCount = 0; |
| 450 m_clickNode = nullptr; | 448 m_clickNode = nullptr; |
| 451 } | 449 } |
| 452 | 450 |
| 453 bool EventHandler::isInsideScrollbar(const IntPoint& windowPoint) const | |
| 454 { | |
| 455 if (RenderView* renderView = m_frame->contentRenderer()) { | |
| 456 HitTestRequest request(HitTestRequest::ReadOnly); | |
| 457 HitTestResult result(windowPoint); | |
| 458 renderView->hitTest(request, result); | |
| 459 return result.scrollbar(); | |
| 460 } | |
| 461 | |
| 462 return false; | |
| 463 } | |
| 464 | |
| 465 void EventHandler::scheduleCursorUpdate() | 451 void EventHandler::scheduleCursorUpdate() |
| 466 { | 452 { |
| 467 if (!m_cursorUpdateTimer.isActive()) | 453 if (!m_cursorUpdateTimer.isActive()) |
| 468 m_cursorUpdateTimer.startOneShot(cursorUpdateInterval, FROM_HERE); | 454 m_cursorUpdateTimer.startOneShot(cursorUpdateInterval, FROM_HERE); |
| 469 } | 455 } |
| 470 | 456 |
| 471 bool EventHandler::isCursorVisible() const | 457 bool EventHandler::isCursorVisible() const |
| 472 { | 458 { |
| 473 return m_frame->page()->isCursorVisible(); | 459 return m_frame->page()->isCursorVisible(); |
| 474 } | 460 } |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 | 595 |
| 610 void EventHandler::focusDocumentView() | 596 void EventHandler::focusDocumentView() |
| 611 { | 597 { |
| 612 Page* page = m_frame->page(); | 598 Page* page = m_frame->page(); |
| 613 if (!page) | 599 if (!page) |
| 614 return; | 600 return; |
| 615 page->focusController().focusDocumentView(m_frame); | 601 page->focusController().focusDocumentView(m_frame); |
| 616 } | 602 } |
| 617 | 603 |
| 618 } // namespace blink | 604 } // namespace blink |
| OLD | NEW |