There's one more critical question for this feature. Instead of relying on our own system for positioning callouts, this takes advantage of xul popup alignment. But I'm not sure if that system includes any way to align popup center to anchor center. It doesn't seem to. Emilio, I thought you might be able to point us in the right direction. We need to basically recreate some of the logic from the old arrowpanels for these [messaging callouts](https://experimenter.info/messaging/messaging-surfaces/#feature-callouts), but with the option to have the arrow centered, as it is in the [screenshots](https://experimenter.info/messaging/messaging-surfaces/#feature-callouts). That is, the arrow's center is aligned to the callout's center, and the callout's center is aligned to the anchor's center. I think arrowpanels only supported e.g. aligning popup left to anchor center. And unless I'm misunderstanding something, [it looks like](https://searchfox.org/mozilla-central/rev/e9b8c73771d0038214c69f17c5934ba8ae049799/layout/xul/nsMenuPopupFrame.cpp#731-766) that's how the code works too. So I'm guessing this will require some additional C++ work to support these positions. It may not be urgent, since I think our planned uses so far will all involve standard popup positions. [My draft](https://phabricator.services.mozilla.com/D183074) includes a test message in FeatureCalloutMessages.sys.mjs that specifies `bottomcenter topright`. The outcome can be seen by just opening a tab and then closing it. Basically what we'd want is the ability to specify `bottomcenter topcenter` (as an example) and have it align center-to-center.
Bug 1842366 Comment 2 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
There's one more critical question for this feature. Instead of relying on our own system for positioning callouts, this new patch takes advantage of xul popup alignment, by rendering the callout in a `<panel>` element, and passing it a standard position/alignment string when showing it. But I'm not sure if that alignment system includes any way to align popup center to anchor center. It doesn't seem to. Emilio, I thought you might be able to point us in the right direction. We need to basically recreate some of the logic from the old arrowpanels for these [messaging callouts](https://experimenter.info/messaging/messaging-surfaces/#feature-callouts), but with the option to have the arrow centered, as it is in the [screenshots](https://experimenter.info/messaging/messaging-surfaces/#feature-callouts). That is, the arrow's center is aligned to the callout's center, and the callout's center is aligned to the anchor's center. I think arrowpanels only supported e.g. aligning popup left to anchor center. And unless I'm misunderstanding something, [it looks like](https://searchfox.org/mozilla-central/rev/e9b8c73771d0038214c69f17c5934ba8ae049799/layout/xul/nsMenuPopupFrame.cpp#731-766) that's how the code works too. So I'm guessing this will require some additional C++ work to support these positions. It may not be urgent, since I think our planned uses so far will all involve standard popup positions. [My draft](https://phabricator.services.mozilla.com/D183074) includes a test message in FeatureCalloutMessages.sys.mjs that specifies `bottomcenter topright`. The outcome can be seen by just opening a tab and then closing it. Basically what we'd want is the ability to specify `bottomcenter topcenter` (as an example) and have it align center-to-center.