Don't update style on new focused element if it isn't in the same doc

This fixes a DCHECK when an iframe is moved out of the active document
from within the synchronous onblur event.

Fixed: 1204223
Change-Id: Ifda36722099554d327998b4cfd27e35aa379651c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2873191
Auto-Submit: Mason Freed <masonf@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#879742}
diff --git a/html/semantics/embedded-content/the-iframe-element/iframe-document-move-crash.html b/html/semantics/embedded-content/the-iframe-element/iframe-document-move-crash.html
new file mode 100644
index 0000000..43da8bf
--- /dev/null
+++ b/html/semantics/embedded-content/the-iframe-element/iframe-document-move-crash.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+This test passes if it does not crash.
+<script>
+  var doc1 = document.documentElement;
+  let iframe1 = document.createElement("iframe");
+  doc1.appendChild(iframe1);
+  separateDoc = document.implementation.createDocument("", null);
+  iframe1.addEventListener("DOMFocusOut", function () {  separateDoc.adoptNode(iframe1); });
+  iframe1.focus();
+  iframe1 = document.createElement("iframe");
+  doc1.appendChild(iframe1);
+  iframe1.focus();
+</script>