Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2010 Apple Inc. All rights reserved. |
| 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 6 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 166 if (evt->IsMouseEvent() && ToMouseEvent(evt)->HasPosition()) { | 166 if (evt->IsMouseEvent() && ToMouseEvent(evt)->HasPosition()) { |
| 167 if (LocalFrame* frame = GetDocument().GetFrame()) { | 167 if (LocalFrame* frame = GetDocument().GetFrame()) { |
| 168 // Check if there is a selection and click is not on the | 168 // Check if there is a selection and click is not on the |
| 169 // selection. | 169 // selection. |
| 170 if (GetLayoutObject() && GetLayoutObject()->IsSelectable() && | 170 if (GetLayoutObject() && GetLayoutObject()->IsSelectable() && |
| 171 frame->Selection() | 171 frame->Selection() |
| 172 .ComputeVisibleSelectionInDOMTreeDeprecated() | 172 .ComputeVisibleSelectionInDOMTreeDeprecated() |
| 173 .IsRange() && | 173 .IsRange() && |
| 174 !frame->GetEventHandler() | 174 !frame->GetEventHandler() |
| 175 .GetSelectionController() | 175 .GetSelectionController() |
| 176 .MouseDownWasSingleClickInSelection()) | 176 .MouseDownWasSingleClickInSelection() && |
| 177 evt->target()->ToNode()->CanStartSelection()) | |
|
yosin_UTC9
2017/05/08 03:25:56
Regarding a comment of this condition: "Check if t
| |
| 177 is_label_text_selected = true; | 178 is_label_text_selected = true; |
| 178 // If selection is there and is single click i.e. text is | 179 // If selection is there and is single click i.e. text is |
| 179 // selected by dragging over label text, then return. | 180 // selected by dragging over label text, then return. |
| 180 // Click count >=2, meaning double click or triple click, | 181 // Click count >=2, meaning double click or triple click, |
| 181 // should pass click event to control element. | 182 // should pass click event to control element. |
| 182 // Only in case of drag, *neither* we pass the click event, | 183 // Only in case of drag, *neither* we pass the click event, |
| 183 // *nor* we focus the control element. | 184 // *nor* we focus the control element. |
| 184 if (is_label_text_selected && ToMouseEvent(evt)->ClickCount() == 1) | 185 if (is_label_text_selected && ToMouseEvent(evt)->ClickCount() == 1) |
| 185 return; | 186 return; |
| 186 } | 187 } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 } | 231 } |
| 231 | 232 |
| 232 void HTMLLabelElement::AccessKeyAction(bool send_mouse_events) { | 233 void HTMLLabelElement::AccessKeyAction(bool send_mouse_events) { |
| 233 if (HTMLElement* element = control()) | 234 if (HTMLElement* element = control()) |
| 234 element->AccessKeyAction(send_mouse_events); | 235 element->AccessKeyAction(send_mouse_events); |
| 235 else | 236 else |
| 236 HTMLElement::AccessKeyAction(send_mouse_events); | 237 HTMLElement::AccessKeyAction(send_mouse_events); |
| 237 } | 238 } |
| 238 | 239 |
| 239 } // namespace blink | 240 } // namespace blink |
| OLD | NEW |