| 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 * Copyright (C) 2004, 2005, 2006, 2009, 2011 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2009, 2011 Apple Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 } | 185 } |
| 186 | 186 |
| 187 bool HTMLAreaElement::isMouseFocusable() const | 187 bool HTMLAreaElement::isMouseFocusable() const |
| 188 { | 188 { |
| 189 return isFocusable(); | 189 return isFocusable(); |
| 190 } | 190 } |
| 191 | 191 |
| 192 bool HTMLAreaElement::rendererIsFocusable() const | 192 bool HTMLAreaElement::rendererIsFocusable() const |
| 193 { | 193 { |
| 194 HTMLImageElement* image = imageElement(); | 194 HTMLImageElement* image = imageElement(); |
| 195 if (!image || !image->renderer() || image->renderer()->style()->visibility()
!= VISIBLE) | 195 if (!image || !image->layoutObject() || image->layoutObject()->style()->visi
bility() != VISIBLE) |
| 196 return false; | 196 return false; |
| 197 | 197 |
| 198 return supportsFocus() && Element::tabIndex() >= 0; | 198 return supportsFocus() && Element::tabIndex() >= 0; |
| 199 } | 199 } |
| 200 | 200 |
| 201 void HTMLAreaElement::setFocus(bool shouldBeFocused) | 201 void HTMLAreaElement::setFocus(bool shouldBeFocused) |
| 202 { | 202 { |
| 203 if (focused() == shouldBeFocused) | 203 if (focused() == shouldBeFocused) |
| 204 return; | 204 return; |
| 205 | 205 |
| 206 HTMLAnchorElement::setFocus(shouldBeFocused); | 206 HTMLAnchorElement::setFocus(shouldBeFocused); |
| 207 | 207 |
| 208 HTMLImageElement* imageElement = this->imageElement(); | 208 HTMLImageElement* imageElement = this->imageElement(); |
| 209 if (!imageElement) | 209 if (!imageElement) |
| 210 return; | 210 return; |
| 211 | 211 |
| 212 LayoutObject* renderer = imageElement->renderer(); | 212 LayoutObject* renderer = imageElement->layoutObject(); |
| 213 if (!renderer || !renderer->isImage()) | 213 if (!renderer || !renderer->isImage()) |
| 214 return; | 214 return; |
| 215 | 215 |
| 216 toLayoutImage(renderer)->areaElementFocusChanged(this); | 216 toLayoutImage(renderer)->areaElementFocusChanged(this); |
| 217 } | 217 } |
| 218 | 218 |
| 219 void HTMLAreaElement::updateFocusAppearance(bool restorePreviousSelection) | 219 void HTMLAreaElement::updateFocusAppearance(bool restorePreviousSelection) |
| 220 { | 220 { |
| 221 if (!isFocusable()) | 221 if (!isFocusable()) |
| 222 return; | 222 return; |
| 223 | 223 |
| 224 HTMLImageElement* imageElement = this->imageElement(); | 224 HTMLImageElement* imageElement = this->imageElement(); |
| 225 if (!imageElement) | 225 if (!imageElement) |
| 226 return; | 226 return; |
| 227 | 227 |
| 228 imageElement->updateFocusAppearance(restorePreviousSelection); | 228 imageElement->updateFocusAppearance(restorePreviousSelection); |
| 229 } | 229 } |
| 230 | 230 |
| 231 } | 231 } |
| OLD | NEW |