Chromium Code Reviews| Index: third_party/WebKit/Source/core/dom/Element.cpp |
| diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp |
| index 35399cff8565c8edc5b25c49a79ad22a1ff3878f..6f8c69281063f3b9af2a96af9801bd499d16e872 100644 |
| --- a/third_party/WebKit/Source/core/dom/Element.cpp |
| +++ b/third_party/WebKit/Source/core/dom/Element.cpp |
| @@ -258,24 +258,9 @@ bool Element::layoutObjectIsFocusable() const |
| return canvas->layoutObject() && canvas->layoutObject()->style()->visibility() == VISIBLE; |
| } |
| - // FIXME: These asserts should be in Node::isFocusable, but there are some |
| - // callsites like Document::setFocusedElement that would currently fail on |
| - // them. See crbug.com/251163 |
| - if (!layoutObject()) { |
| - // We can't just use needsStyleRecalc() because if the node is in a |
| - // display:none tree it might say it needs style recalc but the whole |
| - // document is actually up to date. |
| - // In addition, style cannot be cleared out for non-active documents, |
| - // so in that case the childNeedsStyleRecalc check is invalid. |
| - ASSERT(!document().isActive() || !document().childNeedsStyleRecalc()); |
| - } |
| - |
| // FIXME: Even if we are not visible, we might have a child that is visible. |
| // Hyatt wants to fix that some day with a "has visible content" flag or the like. |
| - if (!layoutObject() || layoutObject()->style()->visibility() != VISIBLE) |
| - return false; |
| - |
| - return true; |
| + return layoutObject() && layoutObject()->style()->visibility() == VISIBLE; |
| } |
| PassRefPtrWillBeRawPtr<Node> Element::cloneNode(bool deep) |
| @@ -2446,6 +2431,7 @@ bool Element::supportsSpatialNavigationFocus() const |
| bool Element::isFocusable() const |
| { |
| + ASSERT(!document().isActive() || !document().childNeedsStyleRecalc()); |
|
falken
2016/02/05 04:42:40
Was the comment about using childNeedsStyleRecalc(
tkent
2016/02/05 04:57:45
Ah, the comment is still valid. I add it again.
|
| return inDocument() && supportsFocus() && !isInert() && layoutObjectIsFocusable(); |
| } |