Remove spurious check in DomUtil.preventOutline (#5435)

The codes first execute "element.tabIndex"(show that element is not
NULL), then execute "!element" in the condition of if stmt(check whether
the element is NULL or not). It is a contradiction.
I think since the element must not be NULL(otherwise the execution of
"element.tabIndex" would be wrong) when the while stmt finishes, the
next if stmt doesn't need to check the element like "!element" again.
Checking the element.style is already enough. So remove the "!element".
This commit is contained in:
qjas 2017-04-05 18:12:56 +08:00 committed by Iván Sánchez Ortega
parent 61ff641951
commit 3e000fbe9d

View File

@ -297,7 +297,7 @@ export function preventOutline(element) {
while (element.tabIndex === -1) {
element = element.parentNode;
}
if (!element || !element.style) { return; }
if (!element.style) { return; }
restoreOutline();
_outlineElement = element;
_outlineStyle = element.style.outline;