Oilpan: Add HeapCollection thread affinity detection traits.

While investigating Keishi's changelist I noticed that these
were missing. They determine the thread affinity for heap
allocated collections. This is needed in order to get
persistent handles to such collections allocated in the
right thread heap.

R=haraken@chromium.org, vegorov@chromium.org
BUG=

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

git-svn-id: svn://svn.chromium.org/blink/trunk@166723 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Make the event *related-target* resolution algorithm work for multiple shadow trees.

The relevant spec issue is: https://www.w3.org/Bugs/Public/show_bug.cgi?id=24351

This is similar to https://codereview.chromium.org/145533002,
where I've made the event retargeting algorithm work for multiple shadow trees.

On the other hand, this patch fixes the *related-target* resolution algorithm for multiple shadow trees.

There has been an issue in *related-target resolution algorithm* for multiple shadow trees.
If a target is in the younger shadow tree and a related-target is in the older shadow tree, an event listener in the older shadow tree could see the node in the younger shadow tree as a related target. That should be fixed.

This patch correctly implements the relevant spec and fixed the issue.

I've also added assertions for non-nullness of adjusted targets (and adjusted related-targets) by early checking target's document and related target's document.

BUG=337089

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

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