Fix a few crashes related to popup=manual

In a few cases, it was assumed that popup=manual pop-ups would be
present in the popup_positions map, causing a crash in hashset.at().
This is now fixed.

Bug: 1307772
Change-Id: I1f0a5200bc2074d7058ea74c57e6e56c1e8aaf7f
Fixed: 1349587
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3827318
Auto-Submit: Mason Freed <masonf@chromium.org>
Commit-Queue: Mason Freed <masonf@chromium.org>
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1035248}
diff --git a/html/semantics/popups/popup-appearance-ref.tentative.html b/html/semantics/popups/popup-appearance-ref.tentative.html
index 4133fdb..95f43db 100644
--- a/html/semantics/popups/popup-appearance-ref.tentative.html
+++ b/html/semantics/popups/popup-appearance-ref.tentative.html
@@ -4,7 +4,7 @@
 <link rel="stylesheet" href="resources/popup-styles.css">
 
 <style>
-.fake-pop-up {top: 100px;}
+.fake-pop-up {top: 100px; bottom: auto;}
 #blank {left: -300px;}
 #auto {left: -100px;}
 #hint {left: 100px;}
diff --git a/html/semantics/popups/popup-appearance.tentative.html b/html/semantics/popups/popup-appearance.tentative.html
index e118ced..8442131 100644
--- a/html/semantics/popups/popup-appearance.tentative.html
+++ b/html/semantics/popups/popup-appearance.tentative.html
@@ -6,7 +6,7 @@
 <link rel="match" href="popup-appearance-ref.tentative.html">
 
 <style>
-[popup] {top: 100px}
+[popup] {top: 100px; bottom: auto;}
 [popup=""] {left: -300px}
 [popup=auto] {left: -100px; }
 [popup=hint] {left: 100px; }
diff --git a/html/semantics/popups/popup-manual-crash.tentative.html b/html/semantics/popups/popup-manual-crash.tentative.html
new file mode 100644
index 0000000..b3430a4
--- /dev/null
+++ b/html/semantics/popups/popup-manual-crash.tentative.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<meta charset="utf-8" />
+<title>Popup=manual crash test</title>
+<link rel="author" href="mailto:masonf@chromium.org">
+<link rel=help href="https://open-ui.org/components/popup.research.explainer">
+
+<style>
+[popup] {top: 100px; bottom: auto;}
+[popup=""] {left: -300px}
+[popup=auto] {left: -100px; }
+[popup=hint] {left: 100px; }
+[popup=manual] {left: 300px; }
+</style>
+
+<p>This test passes if it does not crash.</p>
+<div popup>Blank
+  <div popup=auto>Auto</div>
+</div>
+<div popup=hint>Hint</div>
+<div popup=manual>Manual</div>
+<script>
+  document.querySelectorAll('[popup]').forEach(p => p.showPopUp());
+  const manual = document.querySelector('[popup=manual]');
+  manual.dispatchEvent(new Event('mousedown'));
+</script>