Making sense of wire colors and connections
What you have is a switch leg.  In the past it was a best practice to wire the white hot so it was not confused as a neutral the white was supposed to be marked with a different color than white or green with tape or paint marker,  but that step was not always done in the past by pro's and rarely by DIY folks, I usually carried a black marker and marked them but not always to tell the truth. With white being hot the power is being fed from the fixture on the white to the switch and then with the switch in the on position you will find it is also hot allowing the power to flow to the fixture.