| Index: Source/core/dom/Element.cpp
|
| diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
|
| index 590d95151d0a81b4a84705bf47fcc8d2ecf9d2ad..6cd59d0bb0f764274278a7c1d0626b139bed38d0 100644
|
| --- a/Source/core/dom/Element.cpp
|
| +++ b/Source/core/dom/Element.cpp
|
| @@ -2193,6 +2193,18 @@ void Element::focus(bool restorePreviousSelection, WebFocusType type)
|
| if (!isFocusable())
|
| return;
|
|
|
| + if (shadowRoot() && shadowRoot()->delegatesFocus()) {
|
| + if (containsIncludingShadowDOM(document().focusedElement()))
|
| + return;
|
| +
|
| + // Slide the focus to its inner node.
|
| + Node* next = document().page()->focusController().findFocusableNode(WebFocusTypeForward, *this);
|
| + if (next && next->isElementNode() && containsIncludingShadowDOM(next)) {
|
| + toElement(next)->focus(false, WebFocusTypeForward);
|
| + return;
|
| + }
|
| + }
|
| +
|
| RefPtrWillBeRawPtr<Node> protect(this);
|
| if (!document().page()->focusController().setFocusedElement(this, document().frame(), type))
|
| return;
|
|
|