Fix AtEnd() in fallback eager declaration block parsing.

When trying to parse a CSS declaration block lazily, and falling back
to eager parsing because we see a { in it, we would not actually end
parsing it properly; the } would not trigger AtEnd(). Beside performance
issues, this would cause the fallback behavior at missing semicolon
at the end of the block to become different. Fix by reading the {
when opening the parse, setting up the block stack properly.

Fixed: 1413840
Change-Id: Ibc165990f75f0ccf1f20415b3add07ca6cd5203b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4232538
Auto-Submit: Steinar H Gunderson <sesse@chromium.org>
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Steinar H Gunderson <sesse@chromium.org>
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1102711}
diff --git a/css/css-syntax/missing-semicolon-ref.html b/css/css-syntax/missing-semicolon-ref.html
new file mode 100644
index 0000000..ef8251e
--- /dev/null
+++ b/css/css-syntax/missing-semicolon-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>Missing semicolon at end of block should not keep declaration from being applied</title>
+  </head>
+  <body>
+    <div style="color: green;">Test passes if this paragraph is green.</div>
+  </body>
+</html>
diff --git a/css/css-syntax/missing-semicolon.html b/css/css-syntax/missing-semicolon.html
new file mode 100644
index 0000000..d8e70e6
--- /dev/null
+++ b/css/css-syntax/missing-semicolon.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>Missing semicolon at end of block should not keep declaration from being applied</title>
+    <link rel="author" title="Steinar H. Gunderson" href="mailto:sesse@chromium.org">
+    <link rel="help" href="https://crbug.com/1413840">
+    <link rel="match" href="missing-semicolon-ref.html">
+    <link rel="stylesheet" href="support/missing-semicolon.css">
+  </head>
+  <body>
+    <div class="c">Test passes if this paragraph is green.</div>
+  </body>
+</html>
diff --git a/css/css-syntax/support/missing-semicolon.css b/css/css-syntax/support/missing-semicolon.css
new file mode 100644
index 0000000..0d9a0bb
--- /dev/null
+++ b/css/css-syntax/support/missing-semicolon.css
@@ -0,0 +1,5 @@
+.c {
+  /* This { needs to be there to send Chromium into a different path. */
+  color: red;
+  color: green
+}