Signaling a shift that will reverberate nationwide, the Supreme Court ruled 6 to 3 to limit the ability of state and local governments to restrict guns outside the home. Hours later, the Senate advanced a bipartisan gun safety bill that responded to a spate of mass shootings.