Gecko has historically painted the caret as regular in-flow content (both for purposes of z-sorting and clipping).
I've aligned it with WebKit-based browsers for compat in https://bugzilla.mozilla.org/show_bug.cgi?id=1663475, so that only clips from the containing block apply to it.
It'd be nice to have this defined somewhere. cc @MatsPalmgren