| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 if (!element.isFormControlElement()) | 62 if (!element.isFormControlElement()) |
| 63 UseCounter::count( | 63 UseCounter::count( |
| 64 document(), | 64 document(), |
| 65 UseCounter::HTMLLabelElementControlForNonFormAssociatedElement); | 65 UseCounter::HTMLLabelElementControlForNonFormAssociatedElement); |
| 66 return &element; | 66 return &element; |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 return nullptr; | 69 return nullptr; |
| 70 } | 70 } |
| 71 | 71 |
| 72 if (!isInTreeScope()) |
| 73 return nullptr; |
| 74 |
| 72 if (Element* element = treeScope().getElementById(controlId)) { | 75 if (Element* element = treeScope().getElementById(controlId)) { |
| 73 if (isLabelableElement(*element) && | 76 if (isLabelableElement(*element) && |
| 74 toLabelableElement(*element).supportLabels()) { | 77 toLabelableElement(*element).supportLabels()) { |
| 75 if (!element->isFormControlElement()) | 78 if (!element->isFormControlElement()) |
| 76 UseCounter::count( | 79 UseCounter::count( |
| 77 document(), | 80 document(), |
| 78 UseCounter::HTMLLabelElementControlForNonFormAssociatedElement); | 81 UseCounter::HTMLLabelElementControlForNonFormAssociatedElement); |
| 79 return toLabelableElement(element); | 82 return toLabelableElement(element); |
| 80 } | 83 } |
| 81 } | 84 } |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 } | 228 } |
| 226 | 229 |
| 227 void HTMLLabelElement::accessKeyAction(bool sendMouseEvents) { | 230 void HTMLLabelElement::accessKeyAction(bool sendMouseEvents) { |
| 228 if (HTMLElement* element = control()) | 231 if (HTMLElement* element = control()) |
| 229 element->accessKeyAction(sendMouseEvents); | 232 element->accessKeyAction(sendMouseEvents); |
| 230 else | 233 else |
| 231 HTMLElement::accessKeyAction(sendMouseEvents); | 234 HTMLElement::accessKeyAction(sendMouseEvents); |
| 232 } | 235 } |
| 233 | 236 |
| 234 } // namespace blink | 237 } // namespace blink |
| OLD | NEW |