Fixes bug when testing animation events, which occurred when trying to insert an animation rule into a stylesheet that started with @charset.   Instead the rule will be inserted at the end of the stylesheet and the cleanup code will start at the end and go backwards to find it.