anchor.diff:      var tag = getTag(o);
       var newTag = quickMap[tag];
       if (newTag) return newTag;
  -    if (tag == "Document") {
  -      // IE calls both HTML and XML documents "Document", so we check for the
  -      // xmlVersion property, which is the empty string on HTML documents.
  -      // Since both dart:html classes Document and HtmlDocument share the same
  -      // type, we must patch the instances and not the prototype.
  -      if (!!o.xmlVersion) return "!Document";
  -      return "!HTMLDocument";
  -    }
       // Patches for types which report themselves as Objects.
       if (tag == "Object") {
         if (window.DataView && (o instanceof window.DataView)) return "DataView";
  
positive.code:   hooks = applyHooksTransformer(_ieHooksTransformer, hooks);
    hooks = applyHooksTransformer(_operaHooksTransformer, hooks);
    hooks = applyHooksTransformer(_safariHooksTransformer, hooks);
  
    // TODO(sra): Update ShadowDOM polyfil to use
    // [dartNativeDispatchHooksTransformer] and remove this hook.
  
negative.code:   hooks.prototypeForTag = prototypeForTagIE;
  }''');
  
  const _fixDocumentHooksTransformer = const JS_CONST(r'''
  function(hooks) {
    var getTag = hooks.getTag;
    var prototypeForTag = hooks.prototypeForTag;
    function getTagFixed(o) {
      var tag = getTag(o);
      if (tag == "Document") {
        // Some browsers and the polymer polyfill call both HTML and XML documents
        // "Document", so we check for the xmlVersion property, which is the empty
        // string on HTML documents. Since both dart:html classes Document and
        // HtmlDocument share the same type, we must patch the instances and not
        // the prototype.
        if (!!o.xmlVersion) return "!Document";
        return "!HTMLDocument";
      }
      return tag;
    }
  
    function prototypeForTagFixed(tag) {
      if (tag == "Document") return null;  // Do not pre-patch Document.
      return prototypeForTag(tag);
    }
  
    hooks.getTag = getTagFixed;
    hooks.prototypeForTag = prototypeForTagFixed;
  }''');
  
  const _firefoxHooksTransformer = const JS_CONST(r'''
  function(hooks) {
  