OK, let's look at this closer...
What exactly is "in battery" when it comes to firearms? This term is used to indicate that the breech (the rear end of the chamber) and breech face (or breech block) are locked in place. For a gun using a tilt barrel design, this is when the barrel and slide are locked together. This has nothing to do with the position of the slide, though it may seem like it.
So, for the M&P and other guns like it, as long a the barrel is fully up and locked to the slide, it is in battery. The very instant it is not FULLY up and locked with the slide, it is out of battery.
The M&P and most other semi-auto pistols have a little movement of the slide before the barrel starts to unlock (move down) from the slide. When I say a little, it's really a small amount. My M&P45 will move about 1/32"-1/16" before the barrel starts to drop.
I have tested my gun many times. The gun will fire (of course I'm doing this with an empty gun) when the barrel/slide has moved backward, but the barrel is still fully up in the slide. It will not fire the very instant the barrel starts to move down away from the slide. This is how the gun is supposed to work.
As long as the barrel is up, the cartridge is fully seated in the chamber and firing the gun is OK. The breech does not separate from the breech face until the barrel has begun to tilt. You can verify this with your own gun.