Fix SVG animations in shadow trees

This is a followup to [1] to fix SVG SMIL animations in shadow trees.
The main idea in this patch is to switch document() to treeScope() in
the id lookup.

This patch also contains two fixes for the remaining
targetElementFromIRIString instances that referenced document.

[1] https://src.chromium.org/viewvc/blink?view=rev&revision=171797

BUG=363927

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

git-svn-id: svn://svn.chromium.org/blink/trunk@171823 bbb929c8-8fbe-4397-9dbb-9b2b20218538