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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 } | 132 } |
133 return false; | 133 return false; |
134 } | 134 } |
135 | 135 |
136 void HTMLLabelElement::defaultEventHandler(Event* evt) { | 136 void HTMLLabelElement::defaultEventHandler(Event* evt) { |
137 if (evt->type() == EventTypeNames::click && !m_processingClick) { | 137 if (evt->type() == EventTypeNames::click && !m_processingClick) { |
138 HTMLElement* element = control(); | 138 HTMLElement* element = control(); |
139 | 139 |
140 // If we can't find a control or if the control received the click | 140 // If we can't find a control or if the control received the click |
141 // event, then there's no need for us to do anything. | 141 // event, then there's no need for us to do anything. |
142 if (!element || (evt->target() && | 142 if (!element || |
143 element->isShadowIncludingInclusiveAncestorOf( | 143 (evt->target() && |
144 evt->target()->toNode()))) | 144 element->isShadowIncludingInclusiveAncestorOf( |
| 145 evt->target()->toNode()))) |
145 return; | 146 return; |
146 | 147 |
147 if (evt->target() && isInInteractiveContent(evt->target()->toNode())) | 148 if (evt->target() && isInInteractiveContent(evt->target()->toNode())) |
148 return; | 149 return; |
149 | 150 |
150 // Behaviour of label element is as follows: | 151 // Behaviour of label element is as follows: |
151 // - If there is double click, two clicks will be passed to control | 152 // - If there is double click, two clicks will be passed to control |
152 // element. Control element will *not* be focused. | 153 // element. Control element will *not* be focused. |
153 // - If there is selection of label element by dragging, no click | 154 // - If there is selection of label element by dragging, no click |
154 // event is passed. Also, no focus on control element. | 155 // event is passed. Also, no focus on control element. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 } | 229 } |
229 | 230 |
230 void HTMLLabelElement::accessKeyAction(bool sendMouseEvents) { | 231 void HTMLLabelElement::accessKeyAction(bool sendMouseEvents) { |
231 if (HTMLElement* element = control()) | 232 if (HTMLElement* element = control()) |
232 element->accessKeyAction(sendMouseEvents); | 233 element->accessKeyAction(sendMouseEvents); |
233 else | 234 else |
234 HTMLElement::accessKeyAction(sendMouseEvents); | 235 HTMLElement::accessKeyAction(sendMouseEvents); |
235 } | 236 } |
236 | 237 |
237 } // namespace blink | 238 } // namespace blink |
OLD | NEW |