Commit 70ff25dc authored by alekseys@chromium.org's avatar alekseys@chromium.org

Fix infinite loop around FocusManager.onDocumentFocus_() when getFocusParent()...

Fix infinite loop around FocusManager.onDocumentFocus_() when getFocusParent() returns document.body (encountered the problem trying to add FocusManager to Print Preview).

BUG=276784

Review URL: https://codereview.chromium.org/398243003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284186 0039d316-1c4b-4281-b951-d872f2087c98
parent 054550b8
...@@ -29,20 +29,7 @@ cr.define('cr.ui', function() { ...@@ -29,20 +29,7 @@ cr.define('cr.ui', function() {
* @private * @private
*/ */
isDescendantOf_: function(parent, child) { isDescendantOf_: function(parent, child) {
var current = child; return parent && !(parent === child) && parent.contains(child);
while (current) {
current = current.parentNode;
if (typeof(current) == 'undefined' ||
typeof(current) == 'null' ||
current === document.body) {
return false;
} else if (current === parent) {
return true;
}
}
return false;
}, },
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment