Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights |
| 3 * reserved. | 3 * reserved. |
| 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 4 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) | 5 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) |
| 6 * | 6 * |
| 7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
| 8 * modification, are permitted provided that the following conditions | 8 * modification, are permitted provided that the following conditions |
| 9 * are met: | 9 * are met: |
| 10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
| (...skipping 1804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1815 #if OS(WIN) | 1815 #if OS(WIN) |
| 1816 int right_aligned = ::GetSystemMetrics(SM_MENUDROPALIGNMENT); | 1816 int right_aligned = ::GetSystemMetrics(SM_MENUDROPALIGNMENT); |
| 1817 #else | 1817 #else |
| 1818 int right_aligned = 0; | 1818 int right_aligned = 0; |
| 1819 #endif | 1819 #endif |
| 1820 IntPoint location_in_root_frame; | 1820 IntPoint location_in_root_frame; |
| 1821 | 1821 |
| 1822 Element* focused_element = | 1822 Element* focused_element = |
| 1823 override_target_element ? override_target_element : doc->FocusedElement(); | 1823 override_target_element ? override_target_element : doc->FocusedElement(); |
| 1824 FrameSelection& selection = frame_->Selection(); | 1824 FrameSelection& selection = frame_->Selection(); |
| 1825 Position start = | |
| 1826 selection.ComputeVisibleSelectionInDOMTreeDeprecated().Start(); | |
| 1827 VisualViewport& visual_viewport = frame_->GetPage()->GetVisualViewport(); | 1825 VisualViewport& visual_viewport = frame_->GetPage()->GetVisualViewport(); |
| 1828 | 1826 |
| 1829 if (!override_target_element && start.AnchorNode() && !selection.IsHidden() && | 1827 if (!override_target_element && selection.SelectionHasFocus()) { |
|
yosin_UTC9
2017/05/16 09:45:22
It seems |start.AnchorNode() && !selection.IsHidde
hugoh_UTC2
2017/05/16 12:48:14
Right! Context menu should not use a hidden caret
| |
| 1830 (selection.ComputeVisibleSelectionInDOMTreeDeprecated() | |
| 1831 .RootEditableElement() || | |
| 1832 selection.ComputeVisibleSelectionInDOMTreeDeprecated().IsRange())) { | |
| 1833 // TODO(editing-dev): Use of updateStyleAndLayoutIgnorePendingStylesheets | 1828 // TODO(editing-dev): Use of updateStyleAndLayoutIgnorePendingStylesheets |
| 1834 // needs to be audited. See http://crbug.com/590369 for more details. | 1829 // needs to be audited. See http://crbug.com/590369 for more details. |
| 1835 doc->UpdateStyleAndLayoutIgnorePendingStylesheets(); | 1830 doc->UpdateStyleAndLayoutIgnorePendingStylesheets(); |
| 1836 | 1831 |
| 1837 IntRect first_rect = frame_->GetEditor().FirstRectForRange( | 1832 IntRect first_rect = frame_->GetEditor().FirstRectForRange( |
| 1838 selection.ComputeVisibleSelectionInDOMTree() | 1833 selection.ComputeVisibleSelectionInDOMTree() |
| 1839 .ToNormalizedEphemeralRange()); | 1834 .ToNormalizedEphemeralRange()); |
| 1840 | 1835 |
| 1841 int x = right_aligned ? first_rect.MaxX() : first_rect.X(); | 1836 int x = right_aligned ? first_rect.MaxX() : first_rect.X(); |
| 1842 // In a multiline edit, firstRect.maxY() would end up on the next line, so | 1837 // In a multiline edit, firstRect.maxY() would end up on the next line, so |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2117 MouseEventWithHitTestResults& mev, | 2112 MouseEventWithHitTestResults& mev, |
| 2118 LocalFrame* subframe) { | 2113 LocalFrame* subframe) { |
| 2119 WebInputEventResult result = | 2114 WebInputEventResult result = |
| 2120 subframe->GetEventHandler().HandleMouseReleaseEvent(mev.Event()); | 2115 subframe->GetEventHandler().HandleMouseReleaseEvent(mev.Event()); |
| 2121 if (result != WebInputEventResult::kNotHandled) | 2116 if (result != WebInputEventResult::kNotHandled) |
| 2122 return result; | 2117 return result; |
| 2123 return WebInputEventResult::kHandledSystem; | 2118 return WebInputEventResult::kHandledSystem; |
| 2124 } | 2119 } |
| 2125 | 2120 |
| 2126 } // namespace blink | 2121 } // namespace blink |
| OLD | NEW |