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

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: rebase 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..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();
}
« 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