[polymer] Make deep_utils skip shadow root if it's same as element
[polymer] Make deep_utils skip shadow root if it's same as element

This prevents a bug where Polymer <template dom-repeat="..."> elements
are causing infinite recursion when doing a depth-first traversal of the
DOM (including shadow DOMs).

TBR=aiolos@chromium.org
NOPRESUBMIT=true
NOTRY=true
BUG=catapult:#2285

Review-Url: https://codereview.chromium.org/2000143004

catapult-project/catapult,catapult-project/catapult-csm,sahiljain/catapult,catapult-project/catapult-csm,catapult-project/catapult,catapult-project/catapult-csm,catapult-project/catapult,catapult-project/catapult,benschmaus/catapult,catapult-project/catapult,catapult-project/catapult-csm,catapult-project/catapult,catapult-project/catapult-csm,catapult-project/catapult-csm,benschmaus/catapult,sahiljain/catapult,sahiljain/catapult,catapult-project/catapult,benschmaus/catapult,sahiljain/catapult,sahiljain/catapult,catapult-project/catapult-csm,benschmaus/catapult,benschmaus/catapult,benschmaus/catapult,sahiljain/catapult,benschmaus/catapult