Improve perfomance on large DOMs when container is not whole document.
Fix lint issue