| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 ScriptWrappable::init(this); | 59 ScriptWrappable::init(this); |
| 60 } | 60 } |
| 61 | 61 |
| 62 PassRefPtr<HTMLLabelElement> HTMLLabelElement::create(const QualifiedName& tagNa
me, Document* document) | 62 PassRefPtr<HTMLLabelElement> HTMLLabelElement::create(const QualifiedName& tagNa
me, Document* document) |
| 63 { | 63 { |
| 64 return adoptRef(new HTMLLabelElement(tagName, document)); | 64 return adoptRef(new HTMLLabelElement(tagName, document)); |
| 65 } | 65 } |
| 66 | 66 |
| 67 bool HTMLLabelElement::isFocusable() const | 67 bool HTMLLabelElement::isFocusable() const |
| 68 { | 68 { |
| 69 return false; | 69 HTMLLabelElement* that = const_cast<HTMLLabelElement*>(this); |
| 70 return that->isContentEditable(); |
| 70 } | 71 } |
| 71 | 72 |
| 72 LabelableElement* HTMLLabelElement::control() | 73 LabelableElement* HTMLLabelElement::control() |
| 73 { | 74 { |
| 74 const AtomicString& controlId = getAttribute(forAttr); | 75 const AtomicString& controlId = getAttribute(forAttr); |
| 75 if (controlId.isNull()) { | 76 if (controlId.isNull()) { |
| 76 // Search the children and descendants of the label element for a form e
lement. | 77 // Search the children and descendants of the label element for a form e
lement. |
| 77 // per http://dev.w3.org/html5/spec/Overview.html#the-label-element | 78 // per http://dev.w3.org/html5/spec/Overview.html#the-label-element |
| 78 // the form element must be "labelable form-associated element". | 79 // the form element must be "labelable form-associated element". |
| 79 Element* element = this; | 80 Element* element = this; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 166 |
| 166 void HTMLLabelElement::accessKeyAction(bool sendMouseEvents) | 167 void HTMLLabelElement::accessKeyAction(bool sendMouseEvents) |
| 167 { | 168 { |
| 168 if (HTMLElement* element = control()) | 169 if (HTMLElement* element = control()) |
| 169 element->accessKeyAction(sendMouseEvents); | 170 element->accessKeyAction(sendMouseEvents); |
| 170 else | 171 else |
| 171 HTMLElement::accessKeyAction(sendMouseEvents); | 172 HTMLElement::accessKeyAction(sendMouseEvents); |
| 172 } | 173 } |
| 173 | 174 |
| 174 } // namespace | 175 } // namespace |
| OLD | NEW |