/**
 * Generated by Apache Royale Compiler from org\apache\royale\html\beads\StyleInheritanceWithObserverBead.as
 * org.apache.royale.html.beads.StyleInheritanceWithObserverBead
 *
 * @fileoverview
 *
 * @suppress {checkTypes|accessControls}
 */

goog.provide('org.apache.royale.html.beads.StyleInheritanceWithObserverBead');

goog.require('org.apache.royale.core.IStrand');
goog.require('org.apache.royale.core.WrappedHTMLElement');
goog.require('org.apache.royale.html.beads.StyleInheritanceBead');
goog.require('org.apache.royale.utils.Language');



/**
 *  constructor.
 *
 *  @langversion 3.0
 *  @playerversion Flash 10.2
 *  @playerversion AIR 2.6
 *  @productversion Royale 9.3
 * @constructor
 * @extends {org.apache.royale.html.beads.StyleInheritanceBead}
 */
org.apache.royale.html.beads.StyleInheritanceWithObserverBead = function() {
  org.apache.royale.html.beads.StyleInheritanceWithObserverBead.base(this, 'constructor');
};
goog.inherits(org.apache.royale.html.beads.StyleInheritanceWithObserverBead, org.apache.royale.html.beads.StyleInheritanceBead);


/**
 * Prevent renaming of class. Needed for reflection.
 */
goog.exportSymbol('org.apache.royale.html.beads.StyleInheritanceWithObserverBead', org.apache.royale.html.beads.StyleInheritanceWithObserverBead);


/**
 *  @royaleignorecoercion org.apache.royale.core.WrappedHTMLElement
 * @private
 * @param {Array} mutationsList
 */
org.apache.royale.html.beads.StyleInheritanceWithObserverBead.prototype.org_apache_royale_html_beads_StyleInheritanceWithObserverBead_mutationDetected = function(mutationsList) {
  for (var /** @type {number} */ j = 0; j < mutationsList.length; j++) {
    var /** @type {MutationRecord} */ mutationRecord = org.apache.royale.utils.Language.as(mutationsList[j], MutationRecord);
    var /** @type {NodeList} */ addedElements = org.apache.royale.utils.Language.as(mutationRecord.addedNodes, NodeList);
    for (var /** @type {number} */ i = 0; i < addedElements.length; i++) {
      var /** @type {Object} */ addedElement = addedElements[i];
      addedElement.style[this.styleName] = 'inherit';
    }
  }
};


org.apache.royale.html.beads.StyleInheritanceWithObserverBead.prototype.set__strand = function(value) {
  org.apache.royale.html.beads.StyleInheritanceWithObserverBead.superClass_.set__strand.apply(this, [ value] );
  var /** @type {MutationObserver} */ observer = new MutationObserver(org.apache.royale.utils.Language.closure(this.org_apache_royale_html_beads_StyleInheritanceWithObserverBead_mutationDetected, this, 'mutationDetected'));
  observer.observe(this.hostElement, {'childList':true, 'subtree':true});
};


Object.defineProperties(org.apache.royale.html.beads.StyleInheritanceWithObserverBead.prototype, /** @lends {org.apache.royale.html.beads.StyleInheritanceWithObserverBead.prototype} */ {
/**
  * @export
  * @type {org.apache.royale.core.IStrand} */
strand: {
set: org.apache.royale.html.beads.StyleInheritanceWithObserverBead.prototype.set__strand}}
);


/**
 * Metadata
 *
 * @type {Object.<string, Array.<Object>>}
 */
org.apache.royale.html.beads.StyleInheritanceWithObserverBead.prototype.ROYALE_CLASS_INFO = { names: [{ name: 'StyleInheritanceWithObserverBead', qName: 'org.apache.royale.html.beads.StyleInheritanceWithObserverBead', kind: 'class' }] };



/**
 * Reflection
 *
 * @return {Object.<string, Function>}
 */
org.apache.royale.html.beads.StyleInheritanceWithObserverBead.prototype.ROYALE_REFLECTION_INFO = function () {
  return {
    variables: function () {return {};},
    accessors: function () {
      return {
        'strand': { type: 'org.apache.royale.core.IStrand', access: 'writeonly', declaredBy: 'org.apache.royale.html.beads.StyleInheritanceWithObserverBead'}
      };
    },
    methods: function () {
      return {
        'StyleInheritanceWithObserverBead': { type: '', declaredBy: 'org.apache.royale.html.beads.StyleInheritanceWithObserverBead'}
      };
    }
  };
};