| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 | 175 |
| 176 m_processingClick = true; | 176 m_processingClick = true; |
| 177 | 177 |
| 178 document().updateLayoutIgnorePendingStylesheets(); | 178 document().updateLayoutIgnorePendingStylesheets(); |
| 179 if (element->isMouseFocusable()) { | 179 if (element->isMouseFocusable()) { |
| 180 // If the label is *not* selected, or if the click happened on | 180 // If the label is *not* selected, or if the click happened on |
| 181 // selection of label, only then focus the control element. | 181 // selection of label, only then focus the control element. |
| 182 // In case of double click or triple click, selection will be there, | 182 // In case of double click or triple click, selection will be there, |
| 183 // so do not focus the control element. | 183 // so do not focus the control element. |
| 184 if (!isLabelTextSelected) | 184 if (!isLabelTextSelected) |
| 185 element->focus(true, FocusTypeMouse); | 185 element->focus(true, WebFocusTypeMouse); |
| 186 } | 186 } |
| 187 | 187 |
| 188 // Click the corresponding control. | 188 // Click the corresponding control. |
| 189 element->dispatchSimulatedClick(evt); | 189 element->dispatchSimulatedClick(evt); |
| 190 | 190 |
| 191 m_processingClick = false; | 191 m_processingClick = false; |
| 192 | 192 |
| 193 evt->setDefaultHandled(); | 193 evt->setDefaultHandled(); |
| 194 } | 194 } |
| 195 | 195 |
| 196 HTMLElement::defaultEventHandler(evt); | 196 HTMLElement::defaultEventHandler(evt); |
| 197 } | 197 } |
| 198 | 198 |
| 199 bool HTMLLabelElement::willRespondToMouseClickEvents() | 199 bool HTMLLabelElement::willRespondToMouseClickEvents() |
| 200 { | 200 { |
| 201 if (control() && control()->willRespondToMouseClickEvents()) | 201 if (control() && control()->willRespondToMouseClickEvents()) |
| 202 return true; | 202 return true; |
| 203 | 203 |
| 204 return HTMLElement::willRespondToMouseClickEvents(); | 204 return HTMLElement::willRespondToMouseClickEvents(); |
| 205 } | 205 } |
| 206 | 206 |
| 207 void HTMLLabelElement::focus(bool, FocusType type) | 207 void HTMLLabelElement::focus(bool, WebFocusType type) |
| 208 { | 208 { |
| 209 // to match other browsers, always restore previous selection | 209 // to match other browsers, always restore previous selection |
| 210 if (HTMLElement* element = control()) | 210 if (HTMLElement* element = control()) |
| 211 element->focus(true, type); | 211 element->focus(true, type); |
| 212 if (isFocusable()) | 212 if (isFocusable()) |
| 213 HTMLElement::focus(true, type); | 213 HTMLElement::focus(true, type); |
| 214 } | 214 } |
| 215 | 215 |
| 216 void HTMLLabelElement::accessKeyAction(bool sendMouseEvents) | 216 void HTMLLabelElement::accessKeyAction(bool sendMouseEvents) |
| 217 { | 217 { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 | 282 |
| 283 void HTMLLabelElement::parseAttribute(const QualifiedName& attributeName, const
AtomicString& attributeValue) | 283 void HTMLLabelElement::parseAttribute(const QualifiedName& attributeName, const
AtomicString& attributeValue) |
| 284 { | 284 { |
| 285 if (attributeName == formAttr) | 285 if (attributeName == formAttr) |
| 286 formAttributeChanged(); | 286 formAttributeChanged(); |
| 287 else | 287 else |
| 288 HTMLElement::parseAttribute(attributeName, attributeValue); | 288 HTMLElement::parseAttribute(attributeName, attributeValue); |
| 289 } | 289 } |
| 290 | 290 |
| 291 } // namespace | 291 } // namespace |
| OLD | NEW |