- 🇦🇺Australia acbramley
Triaged as part of bug smash. It doesn't seem like this is a bug and I'm not actually sure if it'd be possible (or beneficial) to combine the 2.
Element::isVisibleElement is a static function so doing anything with access_callback would be tricky, and it may be intentional that this code doesn't try to process that callback. That would mean isAccessibleElement would just be checking something like
($element['#access'] instanceof AccessResultInterface && $element['#access']->isAllowed()) || ($element['#access'] === TRUE)
but then ::doRender needs to do those checks anyway so it can add the cacheable dependency, etc.With that in mind, I'm not sure if this is something we need to do?