     @
 
   addClass: (items...) ->
-    if !@className
-      @className = classFn(items)
+    @className.extend(items)
+    if @className.needUpdate
       @activePropertiesCount++
-      container = @
-      while container.isBaseComponent
-        container.isNoop = false
-    else
-      needUpdate = @className.needUpdate
-      @className.extend(items)
-      if !needUpdate and @className.needUpdate
-        @activePropertiesCount++
-        container = @
-        while container.isBaseComponent
-          container.isNoop = false
-      #if baseComponent=@baseComponent then baseComponent.isNoop = baseComponent.isPlaceHolder = false
+      @enableContainerComponent()
     this
 
-  removeClass: (classes...) ->
-    if !@className then return this
-    needUpdate = @className.needUpdate
-    @className.removeClass(classes...)
-    if !needUpdate and @className.needUpdate
+  removeClass: (items...) ->
+    @className.removeClass(items...)
+    if @className.needUpdate
       @activePropertiesCount++
-      container = @
-      while container.isBaseComponent
-        container.isNoop = false
-      if baseComponent=@baseComponent then baseComponent.isNoop = baseComponent.isPlaceHolder = false
+      @enableContainerComponent()
     this
 
-  show: (test, display) ->
-    @showHide(true, test, display)
+  show: (test, display) -> @showHide(true, test, display)
 
   hide: (test, display) ->
     @showHide(false, test, display)

    return

  clone: (options=@options) ->
    result = new Tag(@tagName, Object.create(null), @children.clone(), options or @options)
    result.attrs = cloneObject(@attrs)
    result.copyLifeCallback(@)

  toString: (indent=0, noNewLine) ->

    super(options)
    @tagName = tagName = tagName.toLowerCase()
    @namespace = attrs.namespace
    if !@namespace
      if tagName=='svg' then @namespace = "http://www.w3.org/2000/svg"
      else if tagName=='math' then @namespace = "http://www.w3.org/1998/Math/MathML"
