Sorting the attributes adds some more round-trip normalization, which again makes it harder to avoid dirty diffs.
I see a few options:
The DOM spec does not guaranteed the preservation of order, but in practice most implementations seem to keep the order intact. So I guess all three options are possible. I would favor simply not touching the order for now, as the only motivation we have for it right now is to get a parser test to pass. Easier to just whitelist that test IMO.
Concurred. This is now reverted in r111971 and whitelisted in r111972.