code: function insertBefore(node, ref_node) {
      if (ref_node && tree.Logical.getParentNode(ref_node) !== this) {
        throw Error('The ref_node to be inserted before is not a child ' +
          'of this node');
      }
      // remove node from its current position iff it's in a tree.
      if (node.nodeType !== Node.DOCUMENT_FRAGMENT_NODE) {
        var parent = tree.Logical.getParentNode(node);
        mixinImpl.removeNodeFromParent(node, parent);
      }
      if (!mixinImpl.addNode(this, node, ref_node)) {
        if (ref_node) {
          // if ref_node is an insertion point replace with first distributed node
          var root = mixinImpl.ownerShadyRootForNode(ref_node);
          if (root) {
            ref_node = ref_node.localName === root.getInsertionPointTag() ?
              mixinImpl.firstComposedNode(ref_node) : ref_node;
          }
        }
        // if adding to a shadyRoot, add to host instead
        var container = isShadyRoot(this) ?
          this.host : this;
        if (ref_node) {
          tree.Composed.insertBefore(container, node, ref_node);
        } else {
          tree.Composed.appendChild(container, node);
        }
      }
      mixinImpl._scheduleObserver(this, node);
      return node;
    }
docs: cases in which we may not be able to just do standard native call 1. container has a shadyRoot (needsDistribution IFF the shadyRoot has an insertion point) 2. container is a shadyRoot (don't distribute, instead set container to container.host. 3. node is <content> (host of container needs distribution)