<!DOCTYPE html>
<title>Anchor queries in sticky positioning is invalid</title>
<link rel="author" href="mailto:xiaochengh@chromium.org">
<link rel="help" href="https://drafts.csswg.org/css-anchor-1/#queries">
<link rel="match" href="reference/sticky-anchor-position-invalid-ref.html">
<style>
#scroll-container {
  width: 200px;
  height: 200px;
  overflow-y: scroll;
}

#scroller {
  height: 400px;
}

#sticky {
  position: sticky;
  height: 150px;
  background: green;
  top: anchor(--invalid top); /* should be invalid and treated as auto */
}
</style>
<div id="scroll-container">
  <div id="scroller">
    <div id="sticky">
    </div>
  </div>
</div>
<script>
document.getElementById("scroll-container").scrollTop = 50;
</script>
