This bug involves the reorganization of elements without the user's knowledge or permission. We start with:
<form action="#" method="get" name="testform">
<button type="button" name="theButton"><div class="black">This
button should be black on a white background</div></button>
</form>
But after saving a document change, we get
<form action="#" method="get" name="testform">
<div class="black">
<button type="button" name="theButton">This button should be black on
a white background</button>
</div>
</form>
Here's the real thing, for verification purposes:
If the rendering gives any clue, it seems that Amaya is changing the order of elements in the XML tree prior to rendering them on the screen. The order of the elements is, however, preserved if one clicks "Save" whilst editing in the source view.
Good luck with fixing it!