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

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: remove assertion 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
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..4cf75560954ed0a8b0d6aaaa1ac6d94cfc4dcab7 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));
hayato 2016/05/10 07:58:15 Could you help me to understand how this ASSERT hi
kochi 2016/05/10 09:49:51 This assertion is, if de morgan's law is applied:
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.

Powered by Google App Engine
This is Rietveld 408576698