 			@setAttr name, val
 		return
 
-	revert: ->
+	revert: do ->
+		list = []
+		lastDate = 0
+
+		class DocumentHideEvent
+			constructor: ->
+				@delay = 0
+
+		event = new DocumentHideEvent
+
+		revertItemWhenPossible = (style) ->
+			if list.length is 0
+				lastDate = Date.now()
+				requestAnimationFrame sync
+
+			style.waiting = true
+			list.push style
+			return
+
+		sync = ->
+			now = Date.now()
+			diff = now - lastDate
+			lastDate = now
+
+			animationsPending = false
+
+			for style in list
+				for extension in style.item._extensions
+					if extension instanceof Renderer.PropertyAnimation and extension.running and not extension.loop
+						animationsPending = true
+						break
+				if animationsPending
+					break
+
+			if not animationsPending and (event.delay -= diff) <= 0
+				event.delay = 0
+
+				for style in list
+					style.waiting = false
+					style.revertItem()
+					style.file.readyToUse = true
+					assert.notOk style.file.isRendered
+
+				utils.clear list
+			else
+				requestAnimationFrame sync
+
+			return
+
+		->
+			if @waiting or not @item
+				return
+
+			# parent
+			if @isAutoParent and @isScope
+				@item.document.onHide.emit event
+			@item.document.visible = false
+
+			@file.readyToUse = false
+			revertItemWhenPossible @
+
+			for child in @children
+				child.revert()
+			return
+
+	revertItem: ->
 		unless @item
 			return
 
 		# parent
 		if @isAutoParent
-			if @isScope
-				@item.document.onHide.emit()
 			@lastItemParent = null
 			if !@parentSet
 				@lastItemParent = @item.parent
 			@item.parent = null
+
 		itemDocumentNode = @item.document.node
 		@item.document.node = null
 

			item.label

	updateText: ->
		obj = @getTextObject()
		node = @node
		if node.children.length is 1 and node.children[0].name is 'a'

		return

	updateVisibility: ->
		if @waiting or not @item
			return

		visible = true
