| 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 2958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2969 VisualViewport& visualViewport = m_frame->page()->frameHost().visualViewport
(); | 2969 VisualViewport& visualViewport = m_frame->page()->frameHost().visualViewport
(); |
| 2970 | 2970 |
| 2971 if (!overrideTargetElement && start.anchorNode() && (selection.rootEditableE
lement() || selection.isRange())) { | 2971 if (!overrideTargetElement && start.anchorNode() && (selection.rootEditableE
lement() || selection.isRange())) { |
| 2972 IntRect firstRect = m_frame->editor().firstRectForRange(selection.select
ion().toNormalizedEphemeralRange()); | 2972 IntRect firstRect = m_frame->editor().firstRectForRange(selection.select
ion().toNormalizedEphemeralRange()); |
| 2973 | 2973 |
| 2974 int x = rightAligned ? firstRect.maxX() : firstRect.x(); | 2974 int x = rightAligned ? firstRect.maxX() : firstRect.x(); |
| 2975 // In a multiline edit, firstRect.maxY() would endup on the next line, s
o -1. | 2975 // In a multiline edit, firstRect.maxY() would endup on the next line, s
o -1. |
| 2976 int y = firstRect.maxY() ? firstRect.maxY() - 1 : 0; | 2976 int y = firstRect.maxY() ? firstRect.maxY() - 1 : 0; |
| 2977 locationInRootFrame = view->contentsToRootFrame(IntPoint(x, y)); | 2977 locationInRootFrame = view->contentsToRootFrame(IntPoint(x, y)); |
| 2978 } else if (focusedElement) { | 2978 } else if (focusedElement) { |
| 2979 IntRect clippedRect = focusedElement->boundsInViewport(); | 2979 IntRect clippedRect = focusedElement->boundsInViewportInt(); |
| 2980 locationInRootFrame = visualViewport.viewportToRootFrame(clippedRect.cen
ter()); | 2980 locationInRootFrame = visualViewport.viewportToRootFrame(clippedRect.cen
ter()); |
| 2981 } else { | 2981 } else { |
| 2982 locationInRootFrame = IntPoint( | 2982 locationInRootFrame = IntPoint( |
| 2983 rightAligned | 2983 rightAligned |
| 2984 ? visualViewport.visibleRect().maxX() - kContextMenuMargin | 2984 ? visualViewport.visibleRect().maxX() - kContextMenuMargin |
| 2985 : visualViewport.location().x() + kContextMenuMargin, | 2985 : visualViewport.location().x() + kContextMenuMargin, |
| 2986 visualViewport.location().y() + kContextMenuMargin); | 2986 visualViewport.location().y() + kContextMenuMargin); |
| 2987 } | 2987 } |
| 2988 | 2988 |
| 2989 m_frame->view()->setCursor(pointerCursor()); | 2989 m_frame->view()->setCursor(pointerCursor()); |
| (...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4137 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() | 4137 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() |
| 4138 { | 4138 { |
| 4139 #if OS(MACOSX) | 4139 #if OS(MACOSX) |
| 4140 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo
rmEvent::AltKey); | 4140 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo
rmEvent::AltKey); |
| 4141 #else | 4141 #else |
| 4142 return PlatformEvent::AltKey; | 4142 return PlatformEvent::AltKey; |
| 4143 #endif | 4143 #endif |
| 4144 } | 4144 } |
| 4145 | 4145 |
| 4146 } // namespace blink | 4146 } // namespace blink |
| OLD | NEW |