Parent: #21367 (Dialogs & Overlays: the popover's defect is fixed before its card is renewed). Promotes defect-note 0bd1ec00.
Context
In examples/popover, a click on "Click Me" opens the popover clipped into the window's top-left corner, not at the button (defect-note 0bd1ec00). Re-measured on dev 267eb2336f at 1024 × 768 in Chromium: the button spans x 217–417, y 407–431; the open popover spans x −135–135, y 8–72, so half of it is off the left edge. The popover element carries anchor="neo-button-1". The browser reports position-anchor, position-area and position-try-fallbacks as supported (CSS.supports), and 'anchorElement' in HTMLElement.prototype as false.
Live latest-open + closed sweep: checked the latest 20 open plus open and closed search ("popover") at 2026-11-19T02:35Z and again at 02:47Z; the one closed hit, #19933, fixed a load error and leaves placement alone. 75 open, red band: folds under #21367.
A2A in-flight sweep: latest 12 messages in all read-states at 02:35Z and 6 at 02:47Z; no claim on the popover.
MC sweep: "popover opens in the top-left corner instead of aligned to its target", 5 results, none about this plugin.
Own-assignment sweep: 8 open, none overlapping (#21415 is the dialog leaf).
The Problem
Neo.plugin.Popover was written against the 2023 draft of CSS anchor positioning:
- it ties the popover to its target with the HTML
anchor attribute (src/plugin/Popover.mjs, vdom: {anchor: owner.id}), which no shipping browser implements;
- its placements are
@position-fallback rules with anchor() insets, an at-rule the specification renamed to @position-try before any browser shipped it;
- those rules live in
resources/css/src/examples/popover/MainContainer.css, so the engine's plugin has no placement of its own, and no theme gives the popover colours.
With no anchor, the UA's [popover] style and the example's inset: unset leave the popover at the top-left of the viewport.
The Architectural Reality
Design authority: "Defaults to bottom center of popover is aligned to top center of owner" — Neo.plugin.Popover#align (src/plugin/Popover.mjs:53), whose valid values are alignValues (bc-tc, tc-bc, tl-tr, tr-tl, cl-cr, cr-cl).
- The plugin adds a
Neo.container.Base with vdom.popover: 'auto' next to its owner, and stamps popovertarget on the owner (the native invoker toggles it on click); Neo.main.addon.Popover shows and hides it on hover.
- Vdom
style keys reach the DOM through style.setProperty(Neo.decamel(key)) (src/main/DeltaUpdates.mjs:945), so anchorName and positionAnchor arrive as anchor-name and position-anchor.
- Plugin styles live in
resources/css/src/plugin/ (Resizable.css, PrefixField.css).
The Fix
Neo.plugin.Popover: the owner gets style.anchorName: '--<popoverId>', the popover style.positionAnchor with the same name; the anchor attribute goes.
resources/css/src/plugin/Popover.css: one rule per align value with position-area (bc-tc → top, tc-bc → bottom, tl-tr → right span-bottom, tr-tl → left span-bottom, cl-cr → right, cr-cl → left) and position-try-fallbacks (flip-block above and below, flip-inline beside), plus the margin, radius and shadow; colours from theme tokens in every theme.
examples/popover: its stylesheet keeps only what the example itself needs; the stage title stops reading Neo.container.Base.
Acceptance Criteria
Out of Scope
- Browsers without CSS anchor positioning: they show the popover where the UA puts it, as today.
- The popover card's cover and the Dialogs & Overlays renewal (#21367's renewal leaf).
- The dialog's mask and focus (#21415).
Avoided Traps
- Aligning in JS with
Neo.main.DomAccess#align: the plugin is built on the native popover, and the browser already places it against a named anchor without a round trip per scroll.
- Porting
@position-fallback to @position-try one to one: position-area and the flip-* keywords say the same in a line each.
Related
#21367 · defect-note 0bd1ec00 · #21415.
Parent: #21367 (Dialogs & Overlays: the popover's defect is fixed before its card is renewed). Promotes defect-note
0bd1ec00.Context
In
examples/popover, a click on "Click Me" opens the popover clipped into the window's top-left corner, not at the button (defect-note0bd1ec00). Re-measured ondev267eb2336fat 1024 × 768 in Chromium: the button spans x 217–417, y 407–431; the open popover spans x −135–135, y 8–72, so half of it is off the left edge. The popover element carriesanchor="neo-button-1". The browser reportsposition-anchor,position-areaandposition-try-fallbacksas supported (CSS.supports), and'anchorElement' in HTMLElement.prototypeasfalse.Live latest-open + closed sweep: checked the latest 20 open plus open and closed search ("popover") at 2026-11-19T02:35Z and again at 02:47Z; the one closed hit, #19933, fixed a load error and leaves placement alone. 75 open, red band: folds under #21367. A2A in-flight sweep: latest 12 messages in all read-states at 02:35Z and 6 at 02:47Z; no claim on the popover. MC sweep: "popover opens in the top-left corner instead of aligned to its target", 5 results, none about this plugin. Own-assignment sweep: 8 open, none overlapping (#21415 is the dialog leaf).
The Problem
Neo.plugin.Popoverwas written against the 2023 draft of CSS anchor positioning:anchorattribute (src/plugin/Popover.mjs,vdom: {anchor: owner.id}), which no shipping browser implements;@position-fallbackrules withanchor()insets, an at-rule the specification renamed to@position-trybefore any browser shipped it;resources/css/src/examples/popover/MainContainer.css, so the engine's plugin has no placement of its own, and no theme gives the popover colours.With no anchor, the UA's
[popover]style and the example'sinset: unsetleave the popover at the top-left of the viewport.The Architectural Reality
Design authority: "Defaults to bottom center of popover is aligned to top center of owner" —
Neo.plugin.Popover#align(src/plugin/Popover.mjs:53), whose valid values arealignValues(bc-tc,tc-bc,tl-tr,tr-tl,cl-cr,cr-cl).Neo.container.Basewithvdom.popover: 'auto'next to its owner, and stampspopovertargeton the owner (the native invoker toggles it on click);Neo.main.addon.Popovershows and hides it on hover.stylekeys reach the DOM throughstyle.setProperty(Neo.decamel(key))(src/main/DeltaUpdates.mjs:945), soanchorNameandpositionAnchorarrive asanchor-nameandposition-anchor.resources/css/src/plugin/(Resizable.css,PrefixField.css).The Fix
Neo.plugin.Popover: the owner getsstyle.anchorName: '--<popoverId>', the popoverstyle.positionAnchorwith the same name; theanchorattribute goes.resources/css/src/plugin/Popover.css: one rule peralignvalue withposition-area(bc-tc→top,tc-bc→bottom,tl-tr→right span-bottom,tr-tl→left span-bottom,cl-cr→right,cr-cl→left) andposition-try-fallbacks(flip-blockabove and below,flip-inlinebeside), plus the margin, radius and shadow; colours from theme tokens in every theme.examples/popover: its stylesheet keeps only what the example itself needs; the stage title stops readingNeo.container.Base.Acceptance Criteria
examples/popover, "Click Me" opens the popover centred above the button, and eachalignvalue places it on its side of the target. An e2e spec measures the popover's rect against the button's.Out of Scope
Avoided Traps
Neo.main.DomAccess#align: the plugin is built on the native popover, and the browser already places it against a named anchor without a round trip per scroll.@position-fallbackto@position-tryone to one:position-areaand theflip-*keywords say the same in a line each.Related
#21367 · defect-note
0bd1ec00· #21415.