Pull out style diffing logic

This generalizes the `style` attribute's diffing logic. In preparation for #1259 in the near future since `dataSet` likely share the same logic.