If you're putting on a name-brand fabric top they should have information included with the top on how to care for it and whether it's been pretreated.
Regardless though - the material of the outer shell on a fabric top isn't actually waterproof. The fibers of the fabric will absorb moisture and liquids, and like any fabric can stain and become saturated with dirt, etc. A properly treated fabric will bead water.
Once or twice a year I treat my Miata with either 303 Fabric Guard or
RaggTopp; Raggtopp is the better of the two I've found.
My procedure is to clean the top really well, brushing out any dirt or stains with a nylon finger-nail brush (2"x6" roughly) while using convertible top cleaner. Really bad stains (I have a light colored top) are sprayed with diluted bleach (about a capful to a full spray bottle of water) and brushed until they fade. Everything is rinsed down really well then allowed to dry overnight.
When applying the RaggTopp (etc) I use painter's tape to mask out the edges of the rear-window, then use brown paper to cover the rest of the window. I pop the top and drape a large sheet over the top of the windshield then stretch it from the back of the side windows to the front of the car - then close the top the best I can. I cover up the back of the car as much as possible too.
You <span style="font-style: italic">can</span> skip the "covering up" step - but it's I find it a lot easier than cleaning up overspray.
RaggTopp comes in a spray can, 303 comes in a pump bottle. With either I put a light coat as evenly as possible across all the fabric, let it set up then do another light coat. The instructions will detail how much to use and what the dry time is. You should plan to keep the top away from water and moisture for the next day or so.
When the job is done water will bead on the fabric surface and roll off like a freshly waxed paint job. Inevitably it might soak in, but the treatment should last several months - depending on what conditions you use and store it in.