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 1806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1817 #if OS(WIN) | 1817 #if OS(WIN) |
| 1818 int right_aligned = ::GetSystemMetrics(SM_MENUDROPALIGNMENT); | 1818 int right_aligned = ::GetSystemMetrics(SM_MENUDROPALIGNMENT); |
| 1819 #else | 1819 #else |
| 1820 int right_aligned = 0; | 1820 int right_aligned = 0; |
| 1821 #endif | 1821 #endif |
| 1822 IntPoint location_in_root_frame; | 1822 IntPoint location_in_root_frame; |
| 1823 | 1823 |
| 1824 Element* focused_element = | 1824 Element* focused_element = |
| 1825 override_target_element ? override_target_element : doc->FocusedElement(); | 1825 override_target_element ? override_target_element : doc->FocusedElement(); |
| 1826 FrameSelection& selection = frame_->Selection(); | 1826 FrameSelection& selection = frame_->Selection(); |
| 1827 Position start = | |
| 1828 selection.ComputeVisibleSelectionInDOMTreeDeprecated().Start(); | |
| 1829 VisualViewport& visual_viewport = frame_->GetPage()->GetVisualViewport(); | 1827 VisualViewport& visual_viewport = frame_->GetPage()->GetVisualViewport(); |
| 1830 | 1828 |
| 1831 if (!override_target_element && start.AnchorNode() && !selection.IsHidden() && | 1829 if (!override_target_element && |
|
Xiaocheng
2017/05/17 02:06:27
The current impl is incorrect. When we have an unf
hugoh_UTC2
2017/05/17 09:07:47
Thanks. You're right. I fixed this in PS3.
| |
| 1832 (selection.ComputeVisibleSelectionInDOMTreeDeprecated() | 1830 (selection.ComputeVisibleSelectionInDOMTreeDeprecated().IsRange() || |
|
yosin_UTC9
2017/05/17 01:54:59
I would like to move this condition expression, ex
hugoh_UTC2
2017/05/17 09:07:47
Done, see PS3.
| |
| 1833 .RootEditableElement() || | 1831 selection.ComputeVisibleSelectionInDOMTreeDeprecated() |
| 1834 selection.ComputeVisibleSelectionInDOMTreeDeprecated().IsRange())) { | 1832 .RootEditableElement()) && |
| 1833 !selection.IsHidden()) { | |
| 1835 // TODO(editing-dev): Use of updateStyleAndLayoutIgnorePendingStylesheets | 1834 // TODO(editing-dev): Use of updateStyleAndLayoutIgnorePendingStylesheets |
| 1836 // needs to be audited. See http://crbug.com/590369 for more details. | 1835 // needs to be audited. See http://crbug.com/590369 for more details. |
| 1837 doc->UpdateStyleAndLayoutIgnorePendingStylesheets(); | 1836 doc->UpdateStyleAndLayoutIgnorePendingStylesheets(); |
| 1838 | 1837 |
| 1839 IntRect first_rect = frame_->GetEditor().FirstRectForRange( | 1838 IntRect first_rect = frame_->GetEditor().FirstRectForRange( |
| 1840 selection.ComputeVisibleSelectionInDOMTree() | 1839 selection.ComputeVisibleSelectionInDOMTree() |
| 1841 .ToNormalizedEphemeralRange()); | 1840 .ToNormalizedEphemeralRange()); |
| 1842 | 1841 |
| 1843 int x = right_aligned ? first_rect.MaxX() : first_rect.X(); | 1842 int x = right_aligned ? first_rect.MaxX() : first_rect.X(); |
| 1844 // In a multiline edit, firstRect.maxY() would end up on the next line, so | 1843 // 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... | |
| 2119 MouseEventWithHitTestResults& mev, | 2118 MouseEventWithHitTestResults& mev, |
| 2120 LocalFrame* subframe) { | 2119 LocalFrame* subframe) { |
| 2121 WebInputEventResult result = | 2120 WebInputEventResult result = |
| 2122 subframe->GetEventHandler().HandleMouseReleaseEvent(mev.Event()); | 2121 subframe->GetEventHandler().HandleMouseReleaseEvent(mev.Event()); |
| 2123 if (result != WebInputEventResult::kNotHandled) | 2122 if (result != WebInputEventResult::kNotHandled) |
| 2124 return result; | 2123 return result; |
| 2125 return WebInputEventResult::kHandledSystem; | 2124 return WebInputEventResult::kHandledSystem; |
| 2126 } | 2125 } |
| 2127 | 2126 |
| 2128 } // namespace blink | 2127 } // namespace blink |
| OLD | NEW |