There is a start date on I-20, your H1 has to be valid until that date so the H1 to F1 COS pending can be considered as authorized stay.
Let say some one file FY2010 cap H1 in April, 2009 while in F1 student status but non-OPT, thus no cap-gap status protection. The F1 cannot quit school in May because this april 2009 filed I-129 has a start date no earlier than Oct 2009. The period between drop-out and Oct 1 can be determined as out-of-status when the person will be examined during AOS in the future. But say if this person filed in April a cap-exempt H1 with a Start date in May 1, 2009. He can quit school in May and the period of H1 pending from May to H1 approval is considered authorized stay when this h1 is approved.