| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 void HTMLLabelElement::defaultEventHandler(Event* evt) | 113 void HTMLLabelElement::defaultEventHandler(Event* evt) |
| 114 { | 114 { |
| 115 static bool processingClick = false; | 115 static bool processingClick = false; |
| 116 | 116 |
| 117 if (evt->type() == eventNames().clickEvent && !processingClick) { | 117 if (evt->type() == eventNames().clickEvent && !processingClick) { |
| 118 RefPtr<HTMLElement> element = control(); | 118 RefPtr<HTMLElement> element = control(); |
| 119 | 119 |
| 120 // If we can't find a control or if the control received the click | 120 // If we can't find a control or if the control received the click |
| 121 // event, then there's no need for us to do anything. | 121 // event, then there's no need for us to do anything. |
| 122 if (!element || (evt->target() && element->contains(evt->target()->toNod
e()))) | 122 if (!element || (evt->target() && element->containsIncludingShadowDOM(ev
t->target()->toNode()))) |
| 123 return; | 123 return; |
| 124 | 124 |
| 125 processingClick = true; | 125 processingClick = true; |
| 126 | 126 |
| 127 // Click the corresponding control. | 127 // Click the corresponding control. |
| 128 element->dispatchSimulatedClick(evt); | 128 element->dispatchSimulatedClick(evt); |
| 129 | 129 |
| 130 // If the control can be focused via the mouse, then do that too. | 130 // If the control can be focused via the mouse, then do that too. |
| 131 if (element->isMouseFocusable()) | 131 if (element->isMouseFocusable()) |
| 132 element->focus(); | 132 element->focus(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 159 if (attribute->name() == forAttr) { | 159 if (attribute->name() == forAttr) { |
| 160 // htmlFor attribute change affects other nodes than this. | 160 // htmlFor attribute change affects other nodes than this. |
| 161 // Clear the caches to ensure that the labels caches are cleared. | 161 // Clear the caches to ensure that the labels caches are cleared. |
| 162 if (document()) | 162 if (document()) |
| 163 document()->notifyLocalNodeListsLabelChanged(); | 163 document()->notifyLocalNodeListsLabelChanged(); |
| 164 } else | 164 } else |
| 165 HTMLElement::parseMappedAttribute(attribute); | 165 HTMLElement::parseMappedAttribute(attribute); |
| 166 } | 166 } |
| 167 | 167 |
| 168 } // namespace | 168 } // namespace |
| OLD | NEW |