[@container] Resume skipped style recalc for dropped LayoutObjects

LayoutObject::IsChildAllowed() may disallow child LayoutObjects of
certain types. We are typically not able to detect this at style recalc
time, which means we may skip style recalc for size query containers
which will not be able to resume recalc in NGBlockNode. Detect this at
AttachLayoutTree time and force-resume the style recalc like we do for
legacy layout.

Bug: 1294268
Change-Id: I0a1a3d4437d84d913c3a75b056ae993601a5fb51
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3440249
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#967745}
diff --git a/css/css-contain/container-queries/math-block-container-child-crash.html b/css/css-contain/container-queries/math-block-container-child-crash.html
new file mode 100644
index 0000000..00b6836
--- /dev/null
+++ b/css/css-contain/container-queries/math-block-container-child-crash.html
@@ -0,0 +1,14 @@
+<!doctype html>
+<title>CSS Container Queries Test: Math block container child crash</title>
+<link rel="help" href="https://drafts.csswg.org/css-contain-3/#size-container">
+<link rel="help" href="https://crbug.com/1294268">
+<p>Pass if there is no crash.</p>
+<math id="m" style="display:block math"></math>
+<script>
+  let div = document.createElement("div");
+  div.style.containerType = "size";
+  m.appendChild(div);
+  div.appendChild(document.createElement("span"));
+  document.body.offsetTop;
+  div.style.color = "green";
+</script>