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