| 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, 2008, 2009, 2013 Apple Inc. All rights
reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights
reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 LayoutTheme::theme().controlStateChanged(*layoutObject(), FocusControlState)
; | 976 LayoutTheme::theme().controlStateChanged(*layoutObject(), FocusControlState)
; |
| 977 } | 977 } |
| 978 | 978 |
| 979 void ContainerNode::setFocus(bool received) | 979 void ContainerNode::setFocus(bool received) |
| 980 { | 980 { |
| 981 // Recurse up author shadow trees to mark shadow hosts if it matches :focus. | 981 // Recurse up author shadow trees to mark shadow hosts if it matches :focus. |
| 982 // TODO(kochi): Handle UA shadows which marks multiple nodes as focused such
as | 982 // TODO(kochi): Handle UA shadows which marks multiple nodes as focused such
as |
| 983 // <input type="date"> the same way as author shadow. | 983 // <input type="date"> the same way as author shadow. |
| 984 if (ShadowRoot* root = containingShadowRoot()) { | 984 if (ShadowRoot* root = containingShadowRoot()) { |
| 985 if (root->type() != ShadowRootType::UserAgent) | 985 if (root->type() != ShadowRootType::UserAgent) |
| 986 shadowHost()->setFocus(received); | 986 ownerShadowHost()->setFocus(received); |
| 987 } | 987 } |
| 988 | 988 |
| 989 // If this is an author shadow host and indirectly focused (has focused elem
ent within | 989 // If this is an author shadow host and indirectly focused (has focused elem
ent within |
| 990 // its shadow root), update focus. | 990 // its shadow root), update focus. |
| 991 if (isElementNode() && document().focusedElement() && document().focusedElem
ent() != this) { | 991 if (isElementNode() && document().focusedElement() && document().focusedElem
ent() != this) { |
| 992 if (toElement(this)->authorShadowRoot()) | 992 if (toElement(this)->authorShadowRoot()) |
| 993 received = received && toElement(this)->authorShadowRoot()->delegate
sFocus(); | 993 received = received && toElement(this)->authorShadowRoot()->delegate
sFocus(); |
| 994 } | 994 } |
| 995 | 995 |
| 996 if (focused() == received) | 996 if (focused() == received) |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1380 return true; | 1380 return true; |
| 1381 | 1381 |
| 1382 if (node->isElementNode() && toElement(node)->shadow()) | 1382 if (node->isElementNode() && toElement(node)->shadow()) |
| 1383 return true; | 1383 return true; |
| 1384 | 1384 |
| 1385 return false; | 1385 return false; |
| 1386 } | 1386 } |
| 1387 #endif | 1387 #endif |
| 1388 | 1388 |
| 1389 } // namespace blink | 1389 } // namespace blink |
| OLD | NEW |