Must pass the right element to IsContainerForContainerQueries().

During interleaved layout and style recalculation we failed to stop at
the container query container when forcing legacy layout fallback,
because we passed the wrong element to ComputedStyle::
IsContainerForContainerQueries(). The element passed needs to be the one
that has/had/will have the style of |this|.

Went through all the callsites for IsContainerForContainerQueries() to
make sure that it's being used correctly. The one in
ForceLegacyLayoutInFormattingContext() is what caused the problem, but
also found and corrected an additional one.

Bug: 1289718
Change-Id: I2d2e88ad30cf29591f8c57360df88bc0491a491a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3412093
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/main@{#962539}
diff --git a/css/css-contain/container-queries/chrome-bug-1289718-000-crash.html b/css/css-contain/container-queries/chrome-bug-1289718-000-crash.html
new file mode 100644
index 0000000..5dab634
--- /dev/null
+++ b/css/css-contain/container-queries/chrome-bug-1289718-000-crash.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
+<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1289718">
+<div style="container:inline-size;">
+  <span style="columns:2;"></span>
+</div>
diff --git a/css/css-contain/container-queries/chrome-bug-1289718-001-crash.html b/css/css-contain/container-queries/chrome-bug-1289718-001-crash.html
new file mode 100644
index 0000000..7236714
--- /dev/null
+++ b/css/css-contain/container-queries/chrome-bug-1289718-001-crash.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
+<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1289718">
+<div style="container:inline-size;">
+  <video style="columns:2;"></video>
+</div>