Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(646)

Unified Diff: Source/core/dom/Element.cpp

Issue 1174893002: Implement ShadowRoot.delegatesFocus 1/4 (focus navigation) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix for nit review comment Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/webexposed/global-interface-listing-expected.txt ('k') | Source/core/dom/shadow/ShadowRoot.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index f55b908a0f10051217cea48c90813516afe8afaa..3e8f4d92a215c5a21bbf3e40969e61dfa2dc9bec 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 shadowRoot.release();
}
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();
}
« no previous file with comments | « LayoutTests/webexposed/global-interface-listing-expected.txt ('k') | Source/core/dom/shadow/ShadowRoot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698