[css-anchor-position] Update position-anchor in AnchorEvaluator

The AnchorEvaluator initially gets the position-anchor from the previous
style resolution set, but never modified it, which meant the anchor
functions would never pick up any position-anchor changes from
@position-try rules.

Make position-anchor a high priority property and update the
AnchorEvaluator with the position-anchor name before resolving any
anchor functions.

Bug: 329584105
Change-Id: I81829b2c46cf1020c06f99987aa8e7cfed6ec05a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5380334
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Reviewed-by: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1277587}
diff --git a/css/css-anchor-position/position-try-position-anchor.html b/css/css-anchor-position/position-try-position-anchor.html
new file mode 100644
index 0000000..7355c23
--- /dev/null
+++ b/css/css-anchor-position/position-try-position-anchor.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<title>CSS Anchor Positioning Test: @position-try can set position-anchor</title>
+<link rel="help" href="https://drafts.csswg.org/css-anchor-1/#fallback">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/check-layout-th.js"></script>
+<script src="support/test-common.js"></script>
+<style>
+  #cb {
+    position: relative;
+    width: 400px;
+    height: 400px;
+  }
+  .anchor {
+    width: 100px;
+    height: 100px;
+  }
+  #anchor-a {
+    anchor-name: --a;
+    /* Makes #anchored overflow when aligned with right edge */
+    margin-left: 100px;
+  }
+  #anchor-b {
+    anchor-name: --b;
+  }
+  #anchored {
+    position: absolute;
+    left: anchor(right);
+    width: 300px;
+    height: 100px;
+    position-anchor: --a;
+    position-try-options: --pf;
+  }
+  @position-try --pf {
+    position-anchor: --b;
+  }
+</style>
+<body onload="checkLayoutForAnchorPos('#anchored')">
+<div id="cb">
+  <div id="anchor-a" class="anchor"></div>
+  <div id="anchor-b" class="anchor"></div>
+  <div id="anchored" data-offset-x="100"></div>
+</div>