We simulate the dynamical and chemical evolution of a forming galaxy embedded in a dark matter halo, using a three-dimensional N-body / hydrodynamic simulation code combined with stellar population synthesis. We find that a sparkling phase with multitudinous SN explosions at less than 3×10 8 years exhibits intense Lyman aemission from cooling shocks and well resembles Lyman a emitters (LAEs) that have been discovered at redshifts greater than three. Subsequently, the galaxy shifts to a stellar continuum radiation-dominated phase within 109 years, which appears like Lyman break galaxies (LBGs). At the LAE phase the abundance of heavy elements is subsolar and shows strong spatial variance, but it convergently reaches a level of solar abundance at the LBG phase. Hence, it turns out that LAEs and LBGs are the on-going and major phases of chemical enrichment in a galaxy. Moreover, in order to assess the contribution of LBGs and LAEs at redshifts 3 < z < 7 to the ionization of intergalactic medium (IGM), we investigate the escape fractions of ionizing photons from supernova-dominated galaxies by solving the three-dimensional radiative transfer. According to the chemical enrichment, we incorporate the effect of dust extinction. As a result, it is found that, in contrast to the previous theoretical predictions, a larger fraction of ionizing photons can escape from primordial galaxies. The resultant escape fractions are as large as 46% at z = 7 to 17% at z = 3.7, which nicely match the recent estimations derived from the flux ratio at 1500 Åto 900 Åof LAEs and LBGs.