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

Unified Diff: third_party/WebKit/Source/core/page/FocusController.cpp

Issue 1954023002: Move asserts in FocusNavigationController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add a unittest, remove layout test Created 4 years, 7 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 | « no previous file | third_party/WebKit/Source/core/page/FocusControllerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/page/FocusController.cpp
diff --git a/third_party/WebKit/Source/core/page/FocusController.cpp b/third_party/WebKit/Source/core/page/FocusController.cpp
index 42e6f3d80c8630ca756b7d8216f3c31352b41323..d4de93aa6b6bc5bfc54549ff2b8243fa6b80606d 100644
--- a/third_party/WebKit/Source/core/page/FocusController.cpp
+++ b/third_party/WebKit/Source/core/page/FocusController.cpp
@@ -364,13 +364,6 @@ inline bool isShadowHostWithoutCustomFocusLogic(const Element& element)
return isShadowHost(element) && !hasCustomFocusLogic(element);
}
-#if ENABLE(ASSERT)
-inline bool isNonFocusableShadowHost(const Element& element)
-{
- return isShadowHostWithoutCustomFocusLogic(element) && !element.isFocusable();
-}
-#endif
-
inline bool isNonKeyboardFocusableShadowHost(const Element& element)
{
return isShadowHostWithoutCustomFocusLogic(element) && !(element.shadowRootIfV1() ? element.isFocusable() : element.isKeyboardFocusable());
@@ -646,7 +639,6 @@ Element* findFocusableElementDescendingDownIntoFrameDocument(WebFocusType type,
Element* findFocusableElementAcrossFocusScopesForward(ScopedFocusNavigation& scope)
{
Element* current = scope.currentElement();
- ASSERT(!current || !isNonFocusableShadowHost(*current));
Element* found;
if (current && isShadowHostWithoutCustomFocusLogic(*current)) {
ScopedFocusNavigation innerScope = ScopedFocusNavigation::ownedByShadowHost(*current);
@@ -670,7 +662,6 @@ Element* findFocusableElementAcrossFocusScopesForward(ScopedFocusNavigation& sco
Element* findFocusableElementAcrossFocusScopesBackward(ScopedFocusNavigation& scope)
{
- ASSERT(!scope.currentElement() || !isNonFocusableShadowHost(*scope.currentElement()));
Element* found = findFocusableElementRecursivelyBackward(scope);
// If there's no focusable element to advance to, move up the focus scopes until we find one.
@@ -979,6 +970,8 @@ bool FocusController::advanceFocusInDocumentOrder(LocalFrame* frame, Element* st
return true;
}
+ ASSERT(element->isFocusable());
+
// FIXME: It would be nice to just be able to call setFocusedElement(element)
// here, but we can't do that because some elements (e.g. HTMLInputElement
// and HTMLTextAreaElement) do extra work in their focus() methods.
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/page/FocusControllerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698