It marks a political victory for Democratic governor Gavin Newsom, who cast the measure as an essential tool to fight back against Donald Trump.