Chromium Code Reviews| Index: Source/core/dom/Element.cpp |
| diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp |
| index f55b908a0f10051217cea48c90813516afe8afaa..590d95151d0a81b4a84705bf47fcc8d2ecf9d2ad 100644 |
| --- a/Source/core/dom/Element.cpp |
| +++ b/Source/core/dom/Element.cpp |
| @@ -1814,7 +1814,12 @@ PassRefPtrWillBeRawPtr<ShadowRoot> Element::createShadowRoot(ScriptState* script |
| return nullptr; |
| } |
| - return createShadowRoot(exceptionState); |
| + RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = createShadowRoot(exceptionState); |
| + |
| + if (shadowRootInitDict.hasDelegatesFocus()) |
| + shadowRoot->setDelegatesFocus(shadowRootInitDict.delegatesFocus()); |
| + |
| + return PassRefPtrWillBeRawPtr<ShadowRoot>(shadowRoot); |
|
tkent
2015/06/11 05:38:27
nit: return shadowRoot.release();
kochi
2015/06/11 05:44:23
Done.
|
| } |
| PassRefPtrWillBeRawPtr<ShadowRoot> Element::createShadowRoot(ExceptionState& exceptionState) |
| @@ -2252,6 +2257,7 @@ bool Element::supportsFocus() const |
| // it won't be focusable. Furthermore, supportsFocus cannot just return true |
| // always or else tabIndex() will change for all HTML elements. |
| return hasElementFlag(TabIndexWasSetExplicitly) || (hasEditableStyle() && parentNode() && !parentNode()->hasEditableStyle()) |
| + || (isShadowHost(this) && shadowRoot() && shadowRoot()->delegatesFocus()) |
| || supportsSpatialNavigationFocus(); |
| } |