Black and white wires crossed in the ceiling
It looks like an inline switch to me, which is usually indicated by a mark on the wire. Are there any black markings (Eg sharpie or electrical tape) on the white wire? You should be able to wire in your fixture to the old wires exactly as is.