From jmesserly on the bug:
Ah, this is a known limitation from Shadow DOM. Try:
document.querySelector('body')
Unfortunately, from previous bugs filed on https://github.com/polymer/ShadowDOM it is apparently not possible to fix this in the polyfill.
The only problematic members are directly accessing "document" and navigating the tree. As soon as you call a method (like querySelector), anything after that will work. If you use "body" a lot, then try:
final body = document.querySelector('body');