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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 154 |
155 // If the click is not simulated and the text of the label element | 155 // If the click is not simulated and the text of the label element |
156 // is selected by dragging over it, then return without passing the | 156 // is selected by dragging over it, then return without passing the |
157 // click event to control element. | 157 // click event to control element. |
158 // Note: a click event may be not a mouse event if created by | 158 // Note: a click event may be not a mouse event if created by |
159 // document.createEvent(). | 159 // document.createEvent(). |
160 if (evt->isMouseEvent() && !toMouseEvent(evt)->isSimulated()) { | 160 if (evt->isMouseEvent() && !toMouseEvent(evt)->isSimulated()) { |
161 if (LocalFrame* frame = document().frame()) { | 161 if (LocalFrame* frame = document().frame()) { |
162 // Check if there is a selection and click is not on the | 162 // Check if there is a selection and click is not on the |
163 // selection. | 163 // selection. |
164 if (!Position::nodeIsUserSelectNone(this) && frame->selection().
isRange() && !frame->eventHandler().selectionController().mouseDownWasSingleClic
kInSelection()) | 164 if (!nodeIsUserSelectNone(this) && frame->selection().isRange()
&& !frame->eventHandler().selectionController().mouseDownWasSingleClickInSelecti
on()) |
165 isLabelTextSelected = true; | 165 isLabelTextSelected = true; |
166 // If selection is there and is single click i.e. text is | 166 // If selection is there and is single click i.e. text is |
167 // selected by dragging over label text, then return. | 167 // selected by dragging over label text, then return. |
168 // Click count >=2, meaning double click or triple click, | 168 // Click count >=2, meaning double click or triple click, |
169 // should pass click event to control element. | 169 // should pass click event to control element. |
170 // Only in case of drag, *neither* we pass the click event, | 170 // Only in case of drag, *neither* we pass the click event, |
171 // *nor* we focus the control element. | 171 // *nor* we focus the control element. |
172 if (isLabelTextSelected && frame->eventHandler().clickCount() ==
1) | 172 if (isLabelTextSelected && frame->eventHandler().clickCount() ==
1) |
173 return; | 173 return; |
174 } | 174 } |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 | 283 |
284 void HTMLLabelElement::parseAttribute(const QualifiedName& attributeName, const
AtomicString& attributeValue) | 284 void HTMLLabelElement::parseAttribute(const QualifiedName& attributeName, const
AtomicString& attributeValue) |
285 { | 285 { |
286 if (attributeName == formAttr) | 286 if (attributeName == formAttr) |
287 formAttributeChanged(); | 287 formAttributeChanged(); |
288 else | 288 else |
289 HTMLElement::parseAttribute(attributeName, attributeValue); | 289 HTMLElement::parseAttribute(attributeName, attributeValue); |
290 } | 290 } |
291 | 291 |
292 } // namespace | 292 } // namespace |
OLD | NEW |