Fix: problems with :after :before elements in refresh_styles
children must be processed after removing and before adding :after :before elements