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 2471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2482 return findBestZoomableArea(targetNode, targetArea, touchCenter, touchRect,
WillBeHeapVector<RefPtrWillBeMember<Node>>(nodes)); | 2482 return findBestZoomableArea(targetNode, targetArea, touchCenter, touchRect,
WillBeHeapVector<RefPtrWillBeMember<Node>>(nodes)); |
2483 } | 2483 } |
2484 | 2484 |
2485 // Update the hover and active state across all frames for this gesture. | 2485 // Update the hover and active state across all frames for this gesture. |
2486 // This logic is different than the mouse case because mice send MouseLeave even
ts to frames as they're exited. | 2486 // This logic is different than the mouse case because mice send MouseLeave even
ts to frames as they're exited. |
2487 // With gestures, a single event conceptually both 'leaves' whatever frame curre
ntly had hover and enters a new frame | 2487 // With gestures, a single event conceptually both 'leaves' whatever frame curre
ntly had hover and enters a new frame |
2488 void EventHandler::updateGestureHoverActiveState(const HitTestRequest& request,
Element* innerElement) | 2488 void EventHandler::updateGestureHoverActiveState(const HitTestRequest& request,
Element* innerElement) |
2489 { | 2489 { |
2490 ASSERT(m_frame == m_frame->localFrameRoot()); | 2490 ASSERT(m_frame == m_frame->localFrameRoot()); |
2491 | 2491 |
2492 WillBeHeapVector<LocalFrame*> newHoverFrameChain; | 2492 WillBeHeapVector<RawPtrWillBeMember<LocalFrame>> newHoverFrameChain; |
2493 LocalFrame* newHoverFrameInDocument = innerElement ? innerElement->document(
).frame() : nullptr; | 2493 LocalFrame* newHoverFrameInDocument = innerElement ? innerElement->document(
).frame() : nullptr; |
2494 // Insert the ancestors of the frame having the new hovered node to the fram
e chain | 2494 // Insert the ancestors of the frame having the new hovered node to the fram
e chain |
2495 // The frame chain doesn't include the main frame to avoid the redundant wor
k that cleans the hover state. | 2495 // The frame chain doesn't include the main frame to avoid the redundant wor
k that cleans the hover state. |
2496 // Because the hover state for the main frame is updated by calling Document
::updateHoverActiveState | 2496 // Because the hover state for the main frame is updated by calling Document
::updateHoverActiveState |
2497 while (newHoverFrameInDocument && newHoverFrameInDocument != m_frame) { | 2497 while (newHoverFrameInDocument && newHoverFrameInDocument != m_frame) { |
2498 newHoverFrameChain.append(newHoverFrameInDocument); | 2498 newHoverFrameChain.append(newHoverFrameInDocument); |
2499 Frame* parentFrame = newHoverFrameInDocument->tree().parent(); | 2499 Frame* parentFrame = newHoverFrameInDocument->tree().parent(); |
2500 newHoverFrameInDocument = parentFrame && parentFrame->isLocalFrame() ? t
oLocalFrame(parentFrame) : nullptr; | 2500 newHoverFrameInDocument = parentFrame && parentFrame->isLocalFrame() ? t
oLocalFrame(parentFrame) : nullptr; |
2501 } | 2501 } |
2502 | 2502 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2542 ASSERT(m_frame == m_frame->localFrameRoot()); | 2542 ASSERT(m_frame == m_frame->localFrameRoot()); |
2543 | 2543 |
2544 // Behaviour of this function is as follows: | 2544 // Behaviour of this function is as follows: |
2545 // - Create the chain of all entered frames. | 2545 // - Create the chain of all entered frames. |
2546 // - Compare the last frame chain under the gesture to newly entered frame c
hain from the main frame one by one. | 2546 // - Compare the last frame chain under the gesture to newly entered frame c
hain from the main frame one by one. |
2547 // - If the last frame doesn't match with the entered frame, then create the
chain of exited frames from the last frame chain. | 2547 // - If the last frame doesn't match with the entered frame, then create the
chain of exited frames from the last frame chain. |
2548 // - Dispatch mouseout/mouseleave events of the exited frames from the insid
e out. | 2548 // - Dispatch mouseout/mouseleave events of the exited frames from the insid
e out. |
2549 // - Dispatch mouseover/mouseenter events of the entered frames into the ins
ide. | 2549 // - Dispatch mouseover/mouseenter events of the entered frames into the ins
ide. |
2550 | 2550 |
2551 // Insert the ancestors of the frame having the new target node to the enter
ed frame chain | 2551 // Insert the ancestors of the frame having the new target node to the enter
ed frame chain |
2552 WillBeHeapVector<LocalFrame*> enteredFrameChain; | 2552 WillBeHeapVector<RawPtrWillBeMember<LocalFrame>> enteredFrameChain; |
2553 LocalFrame* enteredFrameInDocument = targetedEvent.hitTestResult().innerNode
Frame(); | 2553 LocalFrame* enteredFrameInDocument = targetedEvent.hitTestResult().innerNode
Frame(); |
2554 while (enteredFrameInDocument) { | 2554 while (enteredFrameInDocument) { |
2555 enteredFrameChain.append(enteredFrameInDocument); | 2555 enteredFrameChain.append(enteredFrameInDocument); |
2556 Frame* parentFrame = enteredFrameInDocument->tree().parent(); | 2556 Frame* parentFrame = enteredFrameInDocument->tree().parent(); |
2557 enteredFrameInDocument = parentFrame && parentFrame->isLocalFrame() ? to
LocalFrame(parentFrame) : nullptr; | 2557 enteredFrameInDocument = parentFrame && parentFrame->isLocalFrame() ? to
LocalFrame(parentFrame) : nullptr; |
2558 } | 2558 } |
2559 | 2559 |
2560 size_t indexEnteredFrameChain = enteredFrameChain.size(); | 2560 size_t indexEnteredFrameChain = enteredFrameChain.size(); |
2561 LocalFrame* exitedFrameInDocument = m_frame; | 2561 LocalFrame* exitedFrameInDocument = m_frame; |
2562 WillBeHeapVector<LocalFrame*> exitedFrameChain; | 2562 WillBeHeapVector<RawPtrWillBeMember<LocalFrame>> exitedFrameChain; |
2563 // Insert the frame from the disagreement between last frames and entered fr
ames | 2563 // Insert the frame from the disagreement between last frames and entered fr
ames |
2564 while (exitedFrameInDocument) { | 2564 while (exitedFrameInDocument) { |
2565 Node* lastNodeUnderTap = exitedFrameInDocument->eventHandler().m_nodeUnd
erMouse.get(); | 2565 Node* lastNodeUnderTap = exitedFrameInDocument->eventHandler().m_nodeUnd
erMouse.get(); |
2566 if (!lastNodeUnderTap) | 2566 if (!lastNodeUnderTap) |
2567 break; | 2567 break; |
2568 | 2568 |
2569 LocalFrame* nextExitedFrameInDocument = nullptr; | 2569 LocalFrame* nextExitedFrameInDocument = nullptr; |
2570 if (lastNodeUnderTap->isFrameOwnerElement()) { | 2570 if (lastNodeUnderTap->isFrameOwnerElement()) { |
2571 HTMLFrameOwnerElement* owner = toHTMLFrameOwnerElement(lastNodeUnder
Tap); | 2571 HTMLFrameOwnerElement* owner = toHTMLFrameOwnerElement(lastNodeUnder
Tap); |
2572 if (owner->contentFrame() && owner->contentFrame()->isLocalFrame()) | 2572 if (owner->contentFrame() && owner->contentFrame()->isLocalFrame()) |
(...skipping 1457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4030 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() | 4030 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() |
4031 { | 4031 { |
4032 #if OS(MACOSX) | 4032 #if OS(MACOSX) |
4033 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo
rmEvent::AltKey); | 4033 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo
rmEvent::AltKey); |
4034 #else | 4034 #else |
4035 return PlatformEvent::AltKey; | 4035 return PlatformEvent::AltKey; |
4036 #endif | 4036 #endif |
4037 } | 4037 } |
4038 | 4038 |
4039 } // namespace blink | 4039 } // namespace blink |
OLD | NEW |