I didn't manage to reproduce on the Real-time WYSIWYG Editor from XWiki Platform:
one (% style="padding:3px; background-color:yellow; color:green; border:2px solid red" %)two(%%) three
and then editing in real-time; I didn't notice any problem; the styles end-up being sorted alphabetically by property name, it seems;