 Complete the following phrase:  When Stjepan II died in 1091, ending the Trpimirović dynasty rule in the medieval kingdom of Croatia, Ladislaus I of Hungary claimed the Croatian crown. Opposition to the claim led to a war and the personal union of Croatia and Hungary in 1102, ruled by Coloman. For the next four centuries, Croatia was ruled by the Sabor parliament and a Ban of Croatia viceroy appointed by the king. This period saw an increasing threat of Ottoman conquest and a struggle against the Republic of Venice for control of coastal areas. The Venetians gained control over most of Dalmatia by 1428 except for the city-state of Dubrovnik, which became independent. 