You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2016/02/13 01:14:23 UTC
[16/37] git commit: [flex-asjs] [refs/heads/spark] - copy of many
flex-sdk classes,
modified to try to compile on top of the FlexJS base classes. A COMPILE::LATER
flag is used to comment out features like multi-swf support and a few other
features that
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/CSSStyleDeclaration.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/CSSStyleDeclaration.as b/frameworks/projects/MX/src/main/flex/mx/styles/CSSStyleDeclaration.as
new file mode 100644
index 0000000..9095628
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/CSSStyleDeclaration.as
@@ -0,0 +1,1173 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.styles
+{
+
+COMPILE::AS3
+{
+ import flash.display.DisplayObject;
+}
+COMPILE::JS
+{
+ import flex.display.DisplayObject;
+}
+import org.apache.flex.events.EventDispatcher;
+
+import mx.core.Singleton;
+import mx.core.mx_internal;
+import mx.managers.ISystemManager;
+import mx.managers.SystemManagerGlobals;
+import mx.utils.ObjectUtil;
+
+use namespace mx_internal;
+
+/**
+ * The CSSStyleDeclaration class represents a set of CSS style rules.
+ * The MXML compiler automatically generates one CSSStyleDeclaration object
+ * for each selector in the CSS files associated with a Flex application.
+ *
+ * <p>A CSS rule such as
+ * <pre>
+ * Button { color: #FF0000 }
+ * </pre>
+ * affects every instance of the Button class;
+ * a selector like <code>Button</code> is called a type selector
+ * and must not start with a dot.</p>
+ *
+ * <p>A CSS rule such as
+ * <pre>
+ * .redButton { color: #FF0000 }
+ * </pre>
+ * affects only components whose <code>styleName</code> property
+ * is set to <code>"redButton"</code>;
+ * a selector like <code>.redButton</code> is called a class selector
+ * and must start with a dot.</p>
+ *
+ * <p>You can access the autogenerated CSSStyleDeclaration objects
+ * using the <code>StyleManager.getStyleDeclaration()</code> method,
+ * passing it either a type selector
+ * <pre>
+ * var buttonDeclaration:CSSStyleDeclaration =
+ * StyleManager.getStyleDeclaration("Button");
+ * </pre>
+ * or a class selector
+ * <pre>
+ * var redButtonStyleDeclaration:CSSStyleDeclaration =
+ * StyleManager.getStyleDeclaration(".redButton");
+ * </pre>
+ * </p>
+ *
+ * <p>You can use the <code>getStyle()</code>, <code>setStyle()</code>,
+ * and <code>clearStyle()</code> methods to get, set, and clear
+ * style properties on a CSSStyleDeclaration.</p>
+ *
+ * <p>You can also create and install a CSSStyleDeclaration at run time
+ * using the <code>StyleManager.setStyleDeclaration()</code> method:
+ * <pre>
+ * var newStyleDeclaration:CSSStyleDeclaration = new CSSStyleDeclaration(".bigMargins");
+ * newStyleDeclaration.defaultFactory = function():void
+ * {
+ * leftMargin = 50;
+ * rightMargin = 50;
+ * }
+ * StyleManager.setStyleDeclaration(".bigMargins", newStyleDeclaration, true);
+ * </pre>
+ * </p>
+ *
+ * @see mx.core.UIComponent
+ * @see mx.styles.StyleManager
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public class CSSStyleDeclaration extends EventDispatcher
+{
+ include "../core/Version.as";
+
+ //--------------------------------------------------------------------------
+ //
+ // Class constants
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ */
+ private static const NOT_A_COLOR:uint = 0xFFFFFFFF;
+
+ /**
+ * @private
+ */
+ private static const FILTERMAP_PROP:String = "__reserved__filterMap";
+
+ /**
+ * @private
+ */
+ private static var emptyObjectFactory:Function = function():void {};
+
+ //--------------------------------------------------------------------------
+ //
+ // Constructor
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Constructor.
+ *
+ * @param selector - If the selector is a CSSSelector then advanced
+ * CSS selectors are supported. If a String is used for the selector then
+ * only simple CSS selectors are supported. If the String starts with a
+ * dot it is interpreted as a universal class selector, otherwise it must
+ * represent a simple type selector. If not null, this CSSStyleDeclaration
+ * will be registered with StyleManager.
+ *
+ * @param styleManager - The style manager to set this declaration into. If the
+ * styleManager is null the top-level style manager will be used.
+ *
+ * @param autoRegisterWithStyleManager - If true set the selector in the styleManager. The selector
+ * will only be set if both <code>selector</code> and <code>styleManager</code> are
+ * both non-null.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function CSSStyleDeclaration(selector:Object=null, styleManager:IStyleManager2=null, autoRegisterWithStyleManager:Boolean = true)
+ {
+ super();
+
+ // Do not reference StyleManager directly because this is a bootstrap class
+ if (!styleManager)
+ styleManager = Singleton.getInstance("mx.styles::IStyleManager2") as IStyleManager2;
+
+ this.styleManager = styleManager;
+
+ if (selector)
+ {
+ if (selector is CSSSelector)
+ {
+ this.selector = selector as CSSSelector;
+ }
+ else
+ {
+ // Otherwise, a legacy Flex 3 String selector was provided
+ selectorString = selector.toString();
+ }
+
+ if (autoRegisterWithStyleManager)
+ styleManager.setStyleDeclaration(selectorString, this, false);
+ }
+
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Variables
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * This Dictionary keeps track of all the style name/value objects
+ * produced from this CSSStyleDeclaration and already inserted into
+ * prototype chains. Whenever this CSSStyleDeclaration's overrides object
+ * is updated by setStyle(), these clone objects must also be updated.
+ */
+ private var clones:CloneManager = new CloneManager();
+
+ /**
+ * @private
+ * The number of CSS selectors pointing to this CSSStyleDeclaration.
+ * It will be greater than 0 if this CSSStyleDeclaration has been
+ * installed in the StyleManager.styles table by
+ * StyleManager.setStyleDeclaration().
+ */
+ mx_internal var selectorRefCount:int = 0;
+
+ /**
+ * The order this CSSStyleDeclaration was added to its StyleManager.
+ * MatchStyleDeclarations has to return the declarations in the order
+ * they were declared
+ */
+ public var selectorIndex:int = 0;
+
+ /**
+ * @private
+ * Array that specifies the names of the events declared
+ * by this CSS style declaration.
+ * This Array is used by the <code>StyleProtoChain.initObject()</code>
+ * method to register the effect events with the Effect manager.
+ */
+ mx_internal var effects:Array;
+
+ /**
+ * @private
+ * reference to StyleManager
+ */
+ private var styleManager:IStyleManager2;
+
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // defaultFactory
+ //----------------------------------
+
+ private var _defaultFactory:Function;
+
+ [Inspectable(environment="none")]
+
+ /**
+ * This function, if it isn't <code>null</code>,
+ * is usually autogenerated by the MXML compiler.
+ * It produce copies of a plain Object, such as
+ * <code>{ leftMargin: 10, rightMargin: 10 }</code>,
+ * containing name/value pairs for style properties; the object is used
+ * to build a node of the prototype chain for looking up style properties.
+ *
+ * <p>If this CSSStyleDeclaration is owned by a UIComponent
+ * written in MXML, this function encodes the style attributes
+ * that were specified on the root tag of the component definition.</p>
+ *
+ * <p>If the UIComponent was written in ActionScript,
+ * this property is <code>null</code>.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get defaultFactory():Function
+ {
+ return _defaultFactory;
+ }
+
+ /**
+ * @private
+ */
+ public function set defaultFactory(f:Function):void
+ {
+ _defaultFactory = f;
+ }
+
+ //----------------------------------
+ // factory
+ //----------------------------------
+
+ private var _factory:Function;
+
+ [Inspectable(environment="none")]
+
+ /**
+ * This function, if it isn't <code>null</code>,
+ * is usually autogenerated by the MXML compiler.
+ * It produce copies of a plain Object, such as
+ * <code>{ leftMargin: 10, rightMargin: 10 }</code>,
+ * containing name/value pairs for style properties; the object is used
+ * to build a node of the prototype chain for looking up style properties.
+ *
+ * <p>If this CSSStyleDeclaration is owned by a UIComponent,
+ * this function encodes the style attributes that were specified in MXML
+ * for an instance of that component.</p>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get factory():Function
+ {
+ return _factory;
+ }
+
+ /**
+ * @private
+ */
+ public function set factory(f:Function):void
+ {
+ _factory = f;
+ }
+
+ //----------------------------------
+ // overrides
+ //----------------------------------
+
+ private var _overrides:Object;
+
+ /**
+ * If the <code>setStyle()</code> method is called on a UIComponent or CSSStyleDeclaration
+ * at run time, this object stores the name/value pairs that were set;
+ * they override the name/value pairs in the objects produced by
+ * the methods specified by the <code>defaultFactory</code> and
+ * <code>factory</code> properties.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function get overrides():Object
+ {
+ return _overrides;
+ }
+
+ /**
+ * @private
+ */
+ public function set overrides(o:Object):void
+ {
+ _overrides = o;
+ }
+
+ //----------------------------------
+ // selector
+ //----------------------------------
+
+ private var _selector:CSSSelector;
+
+ /**
+ * This property is the base selector of a potential chain of selectors
+ * and conditions that are used to match CSS style declarations to
+ * components.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get selector():CSSSelector
+ {
+ return _selector;
+ }
+
+ public function set selector(value:CSSSelector):void
+ {
+ _selector = value;
+ _selectorString = null;
+ }
+
+ //----------------------------------
+ // selectorString
+ //----------------------------------
+
+ private var _selectorString:String;
+
+ /**
+ * Legacy support for setting a Flex 3 styled selector string after
+ * the construction of a style declaration. Only universal class selectors
+ * or simple type selectors are supported. Note that this style declaration
+ * is not automatically registered with the StyleManager when using this
+ * API.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ mx_internal function get selectorString():String
+ {
+ if (_selectorString == null && _selector != null)
+ _selectorString = _selector.toString();
+
+ return _selectorString;
+ }
+
+ mx_internal function set selectorString(value:String):void
+ {
+ // For the legacy API, the first argument is either a simple
+ // type selector or a universal class selector
+ if (value.charAt(0) == ".")
+ {
+ var condition:CSSCondition = new CSSCondition(CSSConditionKind.CLASS, value.substr(1));
+ _selector = new CSSSelector("", [condition]);
+ }
+ else
+ {
+ _selector = new CSSSelector(value);
+ }
+
+ _selectorString = value;
+ }
+
+ //----------------------------------
+ // specificity
+ //----------------------------------
+
+ /**
+ * Determines the order of precedence when applying multiple style
+ * declarations to a component. If style declarations are of equal
+ * precedence, the last one wins.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get specificity():int
+ {
+ return _selector ? _selector.specificity : 0;
+ }
+
+ //----------------------------------
+ // subject
+ //----------------------------------
+
+ /**
+ * The subject describes the name of a component that may be a potential
+ * match for this style declaration. The subject is determined as right
+ * most simple type selector in a potential chain of selectors.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function get subject():String
+ {
+ if (_selector != null)
+ {
+ // Check for an implicit universal selector which omits *
+ // for the subject but includes conditions.
+ if (_selector.subject == "" && _selector.conditions)
+ return "*";
+ else
+ return _selector.subject;
+ }
+
+ return null;
+ }
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Determines whether the selector chain for this style declaration makes
+ * use of a pseudo condition.
+ */
+ mx_internal function getPseudoCondition():String
+ {
+ return (selector != null) ? selector.getPseudoCondition() : null;
+ }
+
+ /**
+ * @private
+ * Determines whether this style declaration has an advanced selector.
+ */
+ mx_internal function isAdvanced():Boolean
+ {
+ if (selector != null)
+ {
+ if (selector.ancestor)
+ {
+ return true;
+ }
+ else if (selector.conditions)
+ {
+ if (subject != "*" && subject != "global")
+ {
+ return true;
+ }
+
+ for each (var condition:CSSCondition in selector.conditions)
+ {
+ if (condition.kind != CSSConditionKind.CLASS)
+ {
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Determines whether this style declaration applies to the given component
+ * based on a match of the selector chain.
+ *
+ * @param object The component to match the style declaration against.
+ *
+ * @return true if this style declaration applies to the component,
+ * otherwise false.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ public function matchesStyleClient(object:IAdvancedStyleClient):Boolean
+ {
+ return (selector != null) ? selector.matchesStyleClient(object) : false;
+ }
+
+ /**
+ * Determine if the properties of this style declaration are the same as the the properties of a specified
+ * style declaration.
+ *
+ * @param styleDeclaration the style declaration to compare.
+ *
+ * @return true if the styleDeclaration is considered equal to this declaration.
+ */
+ mx_internal function equals(styleDeclaration:CSSStyleDeclaration):Boolean
+ {
+ if (styleDeclaration == null)
+ return false;
+
+ // test in order of most likey to be different.
+
+ var obj:Object; // loop variable
+
+ // overrides
+ if (ObjectUtil.compare(overrides, styleDeclaration.overrides) != 0)
+ return false;
+
+ // factory
+ if ((factory == null && styleDeclaration.factory != null) ||
+ (factory != null && styleDeclaration.factory == null))
+ return false;
+
+ if (factory != null)
+ {
+ if (ObjectUtil.compare(new factory(), new styleDeclaration.factory()) != 0)
+ return false;
+ }
+
+ // defaultFactory
+ if ((defaultFactory == null && styleDeclaration.defaultFactory != null) ||
+ (defaultFactory != null && styleDeclaration.defaultFactory == null))
+ return false;
+
+ if (defaultFactory != null)
+ {
+ if (ObjectUtil.compare(new defaultFactory(),
+ new styleDeclaration.defaultFactory()) != 0)
+ return false;
+ }
+
+ // effects
+ if (ObjectUtil.compare(effects, styleDeclaration.mx_internal::effects))
+ return false;
+
+ return true;
+ }
+
+
+ /**
+ * Gets the value for a specified style property,
+ * as determined solely by this CSSStyleDeclaration.
+ *
+ * <p>The returned value may be of any type.</p>
+ *
+ * <p>The values <code>null</code>, <code>""</code>, <code>false</code>,
+ * <code>NaN</code>, and <code>0</code> are all valid style values,
+ * but the value <code>undefined</code> is not; it indicates that
+ * the specified style is not set on this CSSStyleDeclaration.
+ * You can use the method <code>StyleManager.isValidStyleValue()</code>
+ * to test the value that is returned.</p>
+ *
+ * @param styleProp The name of the style property.
+ *
+ * @return The value of the specified style property if set,
+ * or <code>undefined</code> if not.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function getStyle(styleProp:String):*
+ {
+ var o:*;
+ var v:*;
+
+ // First look in the overrides, in case setStyle()
+ // has been called on this CSSStyleDeclaration.
+ if (overrides)
+ {
+ // If the property exists in our overrides, but
+ // has 'undefined' as its value, it has been
+ // cleared from this stylesheet so return
+ // undefined.
+ if (styleProp in overrides &&
+ overrides[styleProp] === undefined)
+ return undefined;
+
+ v = overrides[styleProp];
+ if (v !== undefined) // must use !==
+ return v;
+ }
+
+ // Next look in the style object that this CSSStyleDeclaration's
+ // factory function produces; it contains styles that
+ // were specified in an instance tag of an MXML component
+ // (if this CSSStyleDeclaration is attached to a UIComponent).
+ if (factory != null)
+ {
+ factory.prototype = {};
+ o = new factory();
+ v = o[styleProp];
+ if (v !== undefined) // must use !==
+ return v;
+ }
+
+ // Next look in the style object that this CSSStyleDeclaration's
+ // defaultFactory function produces; it contains styles that
+ // were specified on the root tag of an MXML component.
+ if (defaultFactory != null)
+ {
+ defaultFactory.prototype = {};
+ o = new defaultFactory();
+ v = o[styleProp];
+ if (v !== undefined) // must use !==
+ return v;
+ }
+
+ // Return undefined if the style isn't specified
+ // in any of these three places.
+ return undefined;
+ }
+
+ /**
+ * Sets a style property on this CSSStyleDeclaration.
+ *
+ * @param styleProp The name of the style property.
+ *
+ * @param newValue The value of the style property.
+ * The value may be of any type.
+ * The values <code>null</code>, <code>""</code>, <code>false</code>,
+ * <code>NaN</code>, and <code>0</code> are all valid style values,
+ * but the value <code>undefined</code> is not.
+ * Setting a style property to the value <code>undefined</code>
+ * is the same as calling the <code>clearStyle()</code> method.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function setStyle(styleProp:String, newValue:*):void
+ {
+ var oldValue:Object = getStyle(styleProp);
+ var regenerate:Boolean = false;
+
+ // If this CSSStyleDeclaration didn't previously have a factory,
+ // defaultFactory, or overrides object, then this CSSStyleDeclaration
+ // hasn't been added to anyone's proto chain. In that case, we
+ // need to regenerate everyone's proto chain.
+ if (selectorRefCount > 0 &&
+ factory == null &&
+ defaultFactory == null &&
+ !overrides &&
+ (oldValue !== newValue)) // must be !==
+ {
+ regenerate = true;
+ }
+
+ if (newValue !== undefined) // must be !==
+ {
+ setLocalStyle(styleProp, newValue);
+ }
+ else
+ {
+ if (newValue == oldValue)
+ return;
+ setLocalStyle(styleProp, newValue);
+ }
+
+ var sms:Array = SystemManagerGlobals.topLevelSystemManagers;
+ var n:int = sms.length;
+ var i:int;
+
+ // Type as Object to avoid dependency on SystemManager.
+ var sm:ISystemManager;
+ var cm:Object;
+
+ if (regenerate)
+ {
+ // Regenerate all the proto chains
+ // for all objects in the application.
+ for (i = 0; i < n; i++)
+ {
+ sm = sms[i];
+ cm = sm.getImplementation("mx.managers::ISystemManagerChildManager");
+ cm.regenerateStyleCache(true);
+ }
+ }
+
+ for (i = 0; i < n; i++)
+ {
+ sm = sms[i];
+ cm = sm.getImplementation("mx.managers::ISystemManagerChildManager");
+ cm.notifyStyleChangeInChildren(styleProp, true);
+ }
+ }
+
+ /**
+ * @private
+ * Sets a style property on this CSSStyleDeclaration.
+ *
+ * @param styleProp The name of the style property.
+ *
+ * @param newValue The value of the style property.
+ * The value may be of any type.
+ * The values <code>null</code>, <code>""</code>, <code>false</code>,
+ * <code>NaN</code>, and <code>0</code> are all valid style values,
+ * but the value <code>undefined</code> is not.
+ * Setting a style property to the value <code>undefined</code>
+ * is the same as calling <code>clearStyle()</code>.
+ */
+ mx_internal function setLocalStyle(styleProp:String, value:*):void
+ {
+ var oldValue:Object = getStyle(styleProp);
+
+ // If setting to undefined, clear the style attribute.
+ if (value === undefined) // must use ===
+ {
+ clearStyleAttr(styleProp);
+ return;
+ }
+
+ var o:Object;
+
+ // If the value is a String of the form "#FFFFFF" or "red",
+ // then convert it to a RGB color uint (e.g.: 0xFFFFFF).
+ if (value is String)
+ {
+ if (!styleManager)
+ styleManager = Singleton.getInstance("mx.styles::IStyleManager2") as IStyleManager2;
+ var colorNumber:Number = styleManager.getColorName(value);
+ if (colorNumber != NOT_A_COLOR)
+ value = colorNumber;
+ }
+
+ // If the new value for styleProp is different from the one returned
+ // from the defaultFactory function, then store the new value on the
+ // overrides object. That way, future clones will get the new value.
+ if (defaultFactory != null)
+ {
+ o = new defaultFactory();
+ if (o[styleProp] !== value) // must use !==
+ {
+ if (!overrides)
+ overrides = {};
+ overrides[styleProp] = value;
+ }
+ else if (overrides)
+ {
+ delete overrides[styleProp];
+ }
+ }
+
+ // If the new value for styleProp is different from the one returned
+ // from the factory function, then store the new value on the
+ // overrides object. That way, future clones will get the new value.
+ if (factory != null)
+ {
+ o = new factory();
+ if (o[styleProp] !== value) // must use !==
+ {
+ if (!overrides)
+ overrides = {};
+ overrides[styleProp] = value;
+ }
+ else if (overrides)
+ {
+ delete overrides[styleProp];
+ }
+ }
+
+ if (defaultFactory == null && factory == null)
+ {
+ if (!overrides)
+ overrides = {};
+ overrides[styleProp] = value;
+ }
+
+ // Update all clones of this style sheet.
+ updateClones(styleProp, value);
+
+ }
+
+ /**
+ * Clears a style property on this CSSStyleDeclaration.
+ *
+ * This is the same as setting the style value to <code>undefined</code>.
+ *
+ * @param styleProp The name of the style property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ public function clearStyle(styleProp:String):void
+ {
+ public::setStyle(styleProp, undefined);
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function createProtoChainRoot():Object
+ {
+ var root:Object = {};
+
+ // If there's a defaultFactory for this style sheet,
+ // then add the object it produces to the root.
+ if (defaultFactory != null)
+ {
+ defaultFactory.prototype = root;
+ root = new defaultFactory();
+ }
+
+ // If there's a factory for this style sheet,
+ // then add the object it produces to the root.
+ if (factory != null)
+ {
+ factory.prototype = root;
+ root = new factory();
+ }
+
+ clones.put(root);
+
+ return root;
+ }
+
+ /**
+ * @private
+ *
+ * The order of nodes in the prototype chain:
+ *
+ * 1. parent style default factories
+ * 2. this default factory
+ * 3. parent style factories
+ * 4. parent style overrides
+ * 5. this factory
+ * 6. this overrides
+ *
+ * Where a parent style is a style with the same selector as this
+ * style but in a parent style manager.
+ *
+ */
+ mx_internal function addStyleToProtoChain(chain:Object,
+ target:DisplayObject,
+ filterMap:Object = null):Object
+ {
+ var nodeAddedToChain:Boolean = false;
+ var originalChain:Object = chain;
+
+ // Get a list of parent style declarations for this selector.
+ var parentStyleDeclarations:Vector.<CSSStyleDeclaration> = new Vector.<CSSStyleDeclaration>();
+ var styleParent:IStyleManager2 = styleManager.parent;
+ while (styleParent)
+ {
+ var parentStyle:CSSStyleDeclaration = styleParent.getStyleDeclaration(selectorString);
+ if (parentStyle)
+ parentStyleDeclarations.unshift(parentStyle);
+
+ styleParent = styleParent.parent;
+ }
+
+ // #1. Add parent's default styles. Topmost parent is added to the chain first.
+ for each (var style:CSSStyleDeclaration in parentStyleDeclarations)
+ {
+ // If there's a defaultFactory for this style sheet,
+ // then add the object it produces to the chain.
+ if (style.defaultFactory != null)
+ chain = style.addDefaultStyleToProtoChain(chain, target, filterMap);
+ }
+
+ // #2. Add this style's defaultFactory to the proto chain.
+ if (defaultFactory != null)
+ chain = addDefaultStyleToProtoChain(chain, target, filterMap);
+
+ // #3 and #4. Add parent's factory styles and overrides.
+ var addedParentStyleToProtoChain:Boolean = false;
+ for each (style in parentStyleDeclarations)
+ {
+ if (style.factory != null || style.overrides != null)
+ {
+ chain = style.addFactoryAndOverrideStylesToProtoChain(chain, target, filterMap);
+ addedParentStyleToProtoChain = true;
+ }
+ }
+
+ // #5 and #6. Add this factory style and overrides.
+ var inChain:Object = chain;
+ if (factory != null || overrides != null)
+ {
+ chain = addFactoryAndOverrideStylesToProtoChain(chain, target, filterMap);
+ if (inChain != chain)
+ nodeAddedToChain = true;
+ }
+
+ // Here we check if we need to add an empty node to the chain for clone
+ // purposes. If there are parent nodes between this defaultFactory and
+ // this factory, then we can't use the defaultFactory node as the clone
+ // since overrides could get blocked by parent styles.
+ // First we check if we have a defaultFactory and we didn't add a factory
+ // or override node to the chain. If we have a factory or override node
+ // then we will just use that.
+ if (defaultFactory != null && !nodeAddedToChain)
+ {
+ // Now we know we have a default factory node and no factory or override
+ // nodes. We can use the default factory as a clone on the chain if there
+ // are no parent styles below it on the proto chain.
+ // Otherwise create an empty node so overrides and be added later.
+ if (addedParentStyleToProtoChain)
+ {
+ // There are parent styles so create an empty node.
+ emptyObjectFactory.prototype = chain;
+ chain = new emptyObjectFactory();
+ emptyObjectFactory.prototype = null;
+ }
+
+ nodeAddedToChain = true;
+ }
+
+ if (nodeAddedToChain)
+ clones.put(chain);
+
+ return chain;
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function addDefaultStyleToProtoChain(chain:Object,
+ target:DisplayObject,
+ filterMap:Object = null):Object
+ {
+ // If there's a defaultFactory for this style sheet,
+ // then add the object it produces to the chain.
+ if (defaultFactory != null)
+ {
+ var originalChain:Object = chain;
+ if (filterMap)
+ {
+ chain = {};
+ }
+
+ defaultFactory.prototype = chain;
+ chain = new defaultFactory();
+ defaultFactory.prototype = null;
+
+ if (filterMap)
+ chain = applyFilter(originalChain, chain, filterMap);
+ }
+
+ return chain;
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function addFactoryAndOverrideStylesToProtoChain(chain:Object,
+ target:DisplayObject,
+ filterMap:Object = null):Object
+ {
+ var originalChain:Object = chain;
+ if (filterMap)
+ {
+ chain = {};
+ }
+
+ // If there's a factory for this style sheet,
+ // then add the object it produces to the chain.
+ if (factory != null)
+ {
+ factory.prototype = chain;
+ chain = new factory();
+ factory.prototype = null;
+ }
+
+ // If someone has called setStyle() on this CSSStyleDeclaration,
+ // then some of the values returned from the factory are
+ // out-of-date. Overwrite them with the up-to-date values.
+ if (overrides)
+ {
+ // Before we add our overrides to the object at the head of
+ // the chain, make sure that we added an object at the head
+ // of the chain.
+ if (factory == null)
+ {
+ emptyObjectFactory.prototype = chain;
+ chain = new emptyObjectFactory();
+ emptyObjectFactory.prototype = null;
+ }
+
+ for (var p:String in overrides)
+ {
+ if (overrides[p] === undefined)
+ delete chain[p];
+ else
+ chain[p] = overrides[p];
+ }
+ }
+
+ if (filterMap)
+ {
+ if (factory != null || overrides)
+ chain = applyFilter(originalChain, chain, filterMap);
+ else
+ chain = originalChain;
+ }
+
+ if (factory != null || overrides)
+ clones.put(chain);
+
+ return chain;
+ }
+
+
+ /**
+ * @private
+ */
+ mx_internal function applyFilter(originalChain:Object, chain:Object, filterMap:Object):Object
+ {
+ var filteredChain:Object = {};
+ // Create an object on the head of the chain using the original chain
+ emptyObjectFactory.prototype = originalChain;
+ filteredChain = new emptyObjectFactory();
+ emptyObjectFactory.prototype = null;
+
+ for (var i:String in chain)
+ {
+ if (filterMap[i] != null)
+ {
+ filteredChain[filterMap[i]] = chain[i];
+ }
+ }
+
+ chain = filteredChain;
+ chain[FILTERMAP_PROP] = filterMap;
+
+ return chain;
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function clearOverride(styleProp:String):void
+ {
+ if (overrides && overrides[styleProp] !== undefined)
+ delete overrides[styleProp];
+ }
+
+ /**
+ * @private
+ */
+ private function clearStyleAttr(styleProp:String):void
+ {
+ // Put "undefined" into our overrides Array
+ if (!overrides)
+ overrides = {};
+ overrides[styleProp] = undefined;
+
+ // Remove the property from all our clones
+ for (var clone:* in clones.iterator)
+ {
+ delete clone[styleProp];
+ }
+ }
+
+ /**
+ * @private
+ */
+ mx_internal function updateClones(styleProp:String, value:*):void
+ {
+ // Update all clones of this style sheet.
+ for (var clone:* in clones.iterator)
+ {
+ var cloneFilter:Object = clone[FILTERMAP_PROP];
+ if (cloneFilter)
+ {
+ if (cloneFilter[styleProp] != null)
+ {
+ clone[cloneFilter[styleProp]] = value;
+ }
+ }
+ else
+ {
+ clone[styleProp] = value;
+ }
+ }
+ }
+
+}
+
+}
+import flash.utils.Dictionary;
+
+COMPILE::AS3
+{
+ import flash.utils.Dictionary;
+}
+
+class CloneManager
+{
+ COMPILE::AS3
+ private var clones:Dictionary = new Dictionary(true);
+
+ COMPILE::JS
+ private var array:Array = [];
+
+ public function CloneManager()
+ {
+
+ }
+
+ public function put(o:Object):void
+ {
+ COMPILE::AS3
+ {
+ clones[o] = 1;
+ }
+ COMPILE::JS
+ {
+ // leaks memory.
+ // Need to track references
+ // so we can clean up
+ array.push(o);
+ }
+ }
+
+ public function get iterator():Object
+ {
+ COMPILE::AS3
+ {
+ return clones;
+ }
+ COMPILE::JS
+ {
+ return array;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/IAdvancedStyleClient.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/IAdvancedStyleClient.as b/frameworks/projects/MX/src/main/flex/mx/styles/IAdvancedStyleClient.as
new file mode 100644
index 0000000..2b4ae88
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/IAdvancedStyleClient.as
@@ -0,0 +1,161 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.styles
+{
+
+/**
+ * This interface describes the advanced properties that a component must
+ * implement to fully participate in the advanced style subsystem.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+public interface IAdvancedStyleClient extends IStyleClient
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // id
+ //----------------------------------
+
+ /**
+ * The identity of the component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get id():String;
+
+ //----------------------------------
+ // styleParent
+ //----------------------------------
+
+ /**
+ * The parent of this <code>IAdvancedStyleClient</code>..
+ *
+ * Typically, you do not assign this property directly.
+ * It is set by the <code>addChild, addChildAt, removeChild, and
+ * removeChildAt</code> methods of the
+ * <code>flash.display.DisplayObjectContainer</code> and the
+ * <code>mx.core.UIComponent.addStyleClient()</code> and
+ * the <code>mx.core.UIComponent.removeStyleClient()</code> methods.
+ *
+ * If it is assigned a value directly, without calling one of the
+ * above mentioned methods the instance of the class that implements this
+ * interface will not inherit styles from the UIComponent or DisplayObject.
+ * Also if assigned a value directly without, first removing the
+ * object from the current parent with the remove methods listed above,
+ * a memory leak could occur.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function get styleParent():IAdvancedStyleClient;
+ function set styleParent(parent:IAdvancedStyleClient):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Flex calls the <code>stylesInitialized()</code> method when
+ * the styles for a component are first initialized.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function stylesInitialized():void
+
+ /**
+ * Returns <code>true</code> if <code>cssState</code> matches <code>currentCSSState</code>.
+ * Typically, you do not call this method directly.
+ * It is called by the <code>mx.styles.CSSCondition.matchesStyleClient()</code> method.
+ *
+ * <p>Note Spark components use their skin state as the pseudo state.
+ * Halo components use the <code>currentState</code> property.</p>
+ *
+ * @param cssState A possible value of <code>CSSCondition.value</code>.
+ * It represents the current state of this component used to match CSS pseudo-selectors.
+ *
+ * @return <code>true</code> if <code>cssState</code> matches <code>currentCSSState</code>.
+ * By default, <code>currentCSSState</code> is the same as <code>currentState</code>.
+ * If no state exists, return null.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function matchesCSSState(cssState:String):Boolean;
+
+ /**
+ * Determines whether this instance is the same as, or is a subclass of,
+ * the given type.
+ * Typically, you do not call this method directly.
+ * It is called by the <code>mx.styles.CSSCondition.matchesStyleClient()</code> method.
+ *
+ * @param cssType A CSSSelector object.
+ *
+ * @return <code>true</code> if <code>cssType</code> is in the hierarchy of qualified type selectors.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function matchesCSSType(cssType:String):Boolean;
+
+
+ /**
+ * Returns <code>true</code> if <code>currentCSSState</code> is not <code>null</code>.
+ * Typically, you do not call this method directly.
+ * It is called by the <code>mx.styles.CSSCondition.matchesStyleClient()</code> method.
+ *
+ * <p>Note Spark components use their skin state as the pseudo state.
+ * Halo components use the <code>currentState</code> property.</p>
+ *
+ * @return <code>true</code> if <code>currentCSSState</code> is not <code>null</code>.
+ * By default, <code>currentCSSState</code> is the same as <code>currentState</code>.
+ * If no state exists, return false.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 2.5
+ * @productversion Flex 4.6
+ */
+ function hasCSSState():Boolean;
+
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/ISimpleStyleClient.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/ISimpleStyleClient.as b/frameworks/projects/MX/src/main/flex/mx/styles/ISimpleStyleClient.as
new file mode 100644
index 0000000..ed61e82
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/ISimpleStyleClient.as
@@ -0,0 +1,94 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.styles
+{
+
+/**
+ * This interface describes the properties and methods that an object
+ * must implement so that it can participate in the style subsystem.
+ * This interface is intended to be used by classes that obtain their
+ * style values from other objects rather than through locally set values
+ * and type selectors.
+ * This interface is implemented by ProgrammaticSkin.
+ *
+ * @see mx.styles.IStyleClient
+ * @see mx.styles.CSSStyleDeclaration
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface ISimpleStyleClient
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // styleName
+ //----------------------------------
+
+ /**
+ * The source of this object's style values.
+ * The value of the <code>styleName</code> property can be one of three possible types:
+ *
+ * <ul>
+ * <li>String, such as "headerStyle". The String names a class selector that is defined in a CSS style sheet.</li>
+ *
+ * <li>CSSStyleDeclaration, such as <code>StyleManager.getStyleDeclaration(".headerStyle")</code>.</li>
+ *
+ * <li>UIComponent. The object that implements this interface inherits all the style values from the referenced UIComponent.</li>
+ * </ul>
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get styleName():Object
+
+ /**
+ * @private
+ */
+ function set styleName(value:Object):void
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Called when the value of a style property is changed.
+ *
+ * @param styleProp The name of the style property that changed.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function styleChanged(styleProp:String):void;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/IStyleClient.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/IStyleClient.as b/frameworks/projects/MX/src/main/flex/mx/styles/IStyleClient.as
new file mode 100644
index 0000000..91e859e
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/IStyleClient.as
@@ -0,0 +1,268 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.styles
+{
+
+import mx.styles.CSSStyleDeclaration;
+import mx.styles.ISimpleStyleClient;
+
+/**
+ * This interface describes the properties and methods that an object
+ * must implement so that it can fully participate in the style subsystem.
+ * This interface is implemented by UIComponent.
+ *
+ * <p>If the object does not need to store style values locally, it can
+ * implement the <code>ISimpleStyleClient</code> interface instead.</p>
+ *
+ * @see mx.styles.ISimpleStyleClient
+ * @see mx.styles.CSSStyleDeclaration
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+public interface IStyleClient extends ISimpleStyleClient
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // className
+ //----------------------------------
+
+ /**
+ * The name of the component class.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get className():String;
+
+ //----------------------------------
+ // inheritingStyles
+ //----------------------------------
+
+ /**
+ * An object containing the inheritable styles for this component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get inheritingStyles():Object;
+
+ /**
+ * @private
+ */
+ function set inheritingStyles(value:Object):void;
+
+ //----------------------------------
+ // nonInheritingStyles
+ //----------------------------------
+
+ /**
+ * An object containing the noninheritable styles for this component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get nonInheritingStyles():Object;
+
+ /**
+ * @private
+ */
+ function set nonInheritingStyles(value:Object):void;
+
+ //----------------------------------
+ // styleDeclaration
+ //----------------------------------
+
+ /**
+ * The style declaration that holds the inline styles declared by this
+ * object.
+ *
+ * @see mx.styles.CSSStyleDeclaration
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get styleDeclaration():CSSStyleDeclaration;
+
+ /**
+ * @private
+ */
+ function set styleDeclaration(value:CSSStyleDeclaration):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Gets a style property that has been set anywhere in this
+ * component's style lookup chain.
+ *
+ * <p>This same method is used to get any kind of style property,
+ * so the value returned may be a Boolean, String, Number, int,
+ * uint (for an RGB color), Class (for a skin), or any kind of object.
+ * Therefore the return type is specified as ~~.</p>
+ *
+ * <p>If you are getting a particular style property, you will
+ * know its type and will often want to store the result in a
+ * variable of that type. You can use either the <code>as</code>
+ * operator or coercion to do this. For example:</p>
+ *
+ * <pre>
+ * var backgroundColor:uint = getStyle("backgroundColor") as int;
+ *
+ * or
+ *
+ * var backgroundColor:uint = int(getStyle("backgroundColor"));
+ * </pre>
+ *
+ * <p>If the style property has not been set anywhere in the
+ * style lookup chain, the value returned by the <code>getStyle()</code> method
+ * is <code>undefined</code>.
+ * Note that <code>undefined</code> is a special value that is
+ * not the same as <code>false</code>, the empty String (<code>""</code>),
+ * <code>NaN</code>, 0, or <code>null</code>.
+ * No valid style value is ever <code>undefined</code>.
+ * You can use the static method
+ * <code>StyleManager.isValidStyleValue()</code>
+ * to test whether the value was set.</p>
+ *
+ * @param styleProp Name of the style property.
+ *
+ * @return Style value.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getStyle(styleProp:String):*;
+
+ /**
+ * Sets a style property on this component instance.
+ *
+ * <p>This may override a style that was set globally.</p>
+ *
+ * <p>Calling the <code>setStyle()</code> method can result in decreased performance.
+ * Use it only when necessary.</p>
+ *
+ * @param styleProp Name of the style property.
+ *
+ * @param newValue New value for the style.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function setStyle(styleProp:String, newValue:*):void
+
+ /**
+ * Deletes a style property from this component instance.
+ *
+ * <p>This does not necessarily cause the <code>getStyle()</code> method to return
+ * <code>undefined</code>.</p>
+ *
+ * @param styleProp Name of the style property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function clearStyle(styleProp:String):void;
+
+ /**
+ * Returns an Array of CSSStyleDeclaration objects for the type selector
+ * that applies to this component, or <code>null</code> if none exist.
+ *
+ * <p>For example, suppose that component MyButton extends Button.
+ * This method first looks for a MyButton selector; then, it looks for a Button type selector;
+ * finally, it looks for a UIComponent type selector.</p>
+ *
+ * @return Array of CSSStyleDeclaration objects.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getClassStyleDeclarations():Array; // of CSSStyleDeclaration;
+
+ /**
+ * Propagates style changes to the children of this component.
+ *
+ * @param styleProp Name of the style property.
+ *
+ * @param recursive Whether to propagate the style changes to the children's children.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function notifyStyleChangeInChildren(styleProp:String,
+ recursive:Boolean):void;
+
+ /**
+ * Sets up the internal style cache values so that the <code>getStyle()</code>
+ * method functions.
+ * If this object already has children, then reinitialize the children's
+ * style caches.
+ *
+ * @param recursive Regenerate the proto chains of the children.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function regenerateStyleCache(recursive:Boolean):void;
+
+ /**
+ * Registers the EffectManager as one of the event listeners for each effect event.
+ *
+ * @param effects An Array of Strings of effect names.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function registerEffects(effects:Array /* of String */):void
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/IStyleManager.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/IStyleManager.as b/frameworks/projects/MX/src/main/flex/mx/styles/IStyleManager.as
new file mode 100644
index 0000000..44690f4
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/IStyleManager.as
@@ -0,0 +1,572 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.styles
+{
+
+COMPILE::LATER
+{
+ import flash.events.IEventDispatcher;
+ import flash.system.ApplicationDomain;
+ import flash.system.SecurityDomain;
+}
+
+/**
+ * The IStyleManager class manages the following:
+ * <ul>
+ * <li>Which CSS style properties the class inherits</li>
+ * <li>Which style properties are colors, and therefore get special handling</li>
+ * <li>A list of strings that are aliases for color values</li>
+ * </ul>
+ *
+ * This interface was used by Flex 2.0.1.
+ * Flex 3 now uses IStyleManager2 instead.
+ *
+ * @see mx.styles.CSSStyleDeclaration
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 2.0.1
+ *
+ */
+public interface IStyleManager
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ //----------------------------------
+ // inheritingStyles
+ //----------------------------------
+
+ /**
+ * @private
+ * Set of inheriting non-color styles.
+ * This is not the complete set from CSS.
+ * Some of the omitted we don't support at all,
+ * others may be added later as needed.
+ * The method registerInheritingStyle() adds to this set
+ * and isInheritingStyle() queries this set.
+ */
+ function get inheritingStyles():Object;
+
+ /**
+ * @private
+ */
+ function set inheritingStyles(value:Object):void;
+
+ //----------------------------------
+ // stylesRoot
+ //----------------------------------
+
+ /**
+ * @private
+ * The root of all proto chains used for looking up styles.
+ * This object is initialized once by initProtoChainRoots() and
+ * then updated by calls to setStyle() on the global CSSStyleDeclaration.
+ * It is accessed by code that needs to construct proto chains,
+ * such as the initProtoChain() method of UIComponent.
+ */
+ function get stylesRoot():Object;
+
+ /**
+ * @private
+ */
+ function set stylesRoot(value:Object):void;
+
+ //----------------------------------
+ // typeSelectorCache
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ function get typeSelectorCache():Object;
+
+ /**
+ * @private
+ */
+ function set typeSelectorCache(value:Object):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * Gets the CSSStyleDeclaration object that stores the rules
+ * for the specified CSS selector.
+ *
+ * <p>If the <code>selector</code> parameter starts with a period (.),
+ * the returned CSSStyleDeclaration is a class selector and applies only to those instances
+ * whose <code>styleName</code> property specifies that selector
+ * (not including the period).
+ * For example, the class selector <code>".bigMargins"</code>
+ * applies to any UIComponent whose <code>styleName</code>
+ * is <code>"bigMargins"</code>.</p>
+ *
+ * <p>If the <code>selector</code> parameter does not start with a period,
+ * the returned CSSStyleDeclaration is a type selector and applies to all instances
+ * of that type.
+ * For example, the type selector <code>"Button"</code>
+ * applies to all instances of Button and its subclasses.</p>
+ *
+ * <p>The <code>global</code> selector is similar to a type selector
+ * and does not start with a period.</p>
+ *
+ * @param selector The name of the CSS selector.
+ *
+ * @return The style declaration whose name matches the <code>selector</code> property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getStyleDeclaration(selector:String):CSSStyleDeclaration;
+
+ /**
+ * Sets the CSSStyleDeclaration object that stores the rules
+ * for the specified CSS selector.
+ *
+ * <p>If the <code>selector</code> parameter starts with a period (.),
+ * the specified selector is a "class selector" and applies only to those instances
+ * whose <code>styleName</code> property specifies that selector
+ * (not including the period).
+ * For example, the class selector <code>".bigMargins"</code>
+ * applies to any UIComponent whose <code>styleName</code>
+ * is <code>"bigMargins"</code>.</p>
+ *
+ * <p>If the <code>selector</code> parameter does not start with a period,
+ * the specified selector is a "type selector" and applies to all instances
+ * of that type.
+ * For example, the type selector <code>"Button"</code>
+ * applies to all instances of Button and its subclasses.</p>
+ *
+ * <p>The <code>global</code> selector is similar to a type selector
+ * and does not start with a period.</p>
+ *
+ * @param selector The name of the CSS selector.
+ * @param styleDeclaration The new style declaration.
+ * @param update Set to <code>true</code> to force an immediate update of the styles; internally, Flex
+ * calls the <code>styleChanged()</code> method of UIComponent.
+ * Set to <code>false</code> to avoid an immediate update of the styles in the application.
+ *
+ * <p>The styles will be updated the next time one of the following methods is called with
+ * the <code>update</code> property set to <code>true</code>:
+ * <ul>
+ * <li><code>clearStyleDeclaration()</code></li>
+ * <li><code>loadStyleDeclarations()</code></li>
+ * <li><code>setStyleDeclaration()</code></li>
+ * <li><code>unloadStyleDeclarations()</code></li>
+ * </ul>
+ * </p>
+ *
+ * <p>Typically, if you call the one of these methods multiple times,
+ * you set this property to <code>true</code> only on the last call,
+ * so that Flex does not call the <code>styleChanged()</code> method multiple times.</p>
+ *
+ * <p>If you call the <code>getStyle()</code> method, Flex returns the style value
+ * that was last applied to the UIComponent through a call to the <code>styleChanged()</code> method.
+ * The component's appearance might not reflect the value returned by the <code>getStyle()</code> method. This occurs
+ * because one of these style declaration methods might not yet have been called with the
+ * <code>update</code> property set to <code>true</code>.</p>
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function setStyleDeclaration(selector:String,
+ styleDeclaration:CSSStyleDeclaration,
+ update:Boolean):void;
+
+ /**
+ * Clears the CSSStyleDeclaration object that stores the rules
+ * for the specified CSS selector.
+ *
+ * <p>If the specified selector is a class selector (for example, ".bigMargins" or ".myStyle"),
+ * you must be sure to start the
+ * <code>selector</code> property with a period (.).</p>
+ *
+ * <p>If the specified selector is a type selector (for example, "Button"), do not start the
+ * <code>selector</code> property with a period.</p>
+ *
+ * <p>The <code>global</code> selector is similar to a type selector
+ * and does not start with a period.</p>
+ *
+ * @param selector The name of the CSS selector to clear.
+ * @param update Set to <code>true</code> to force an immediate update of the styles.
+ * Set to <code>false</code> to avoid an immediate update of the styles in the application.
+ * For more information about this method, see the description in the <code>setStyleDeclaration()</code>
+ * method.
+ *
+ * @see #setStyleDeclaration()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function clearStyleDeclaration(selector:String, update:Boolean):void;
+
+ /**
+ * Adds to the list of styles that can inherit values
+ * from their parents.
+ *
+ * <p><b>Note:</b> Ensure that you avoid using duplicate style names, as name
+ * collisions can result in decreased performance if a style that is
+ * already used becomes inheriting.</p>
+ *
+ * @param styleName The name of the style that is added to the list of styles that can inherit values.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function registerInheritingStyle(styleName:String):void;
+
+ /**
+ * Tests to see if a style is inheriting.
+ *
+ * @param styleName The name of the style that you test to see if it is inheriting.
+ *
+ * @return Returns <code>true</code> if the specified style is inheriting.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function isInheritingStyle(styleName:String):Boolean;
+
+ /**
+ * Test to see if a TextFormat style is inheriting.
+ *
+ * @param styleName The name of the style that you test to see if it is inheriting.
+ *
+ * @return Returns <code>true</code> if the specified TextFormat style
+ * is inheriting.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function isInheritingTextFormatStyle(styleName:String):Boolean;
+
+ /**
+ * Adds to the list of styles which may affect the measured size
+ * of the component.
+ * When one of these styles is set with <code>setStyle()</code>,
+ * the <code>invalidateSize()</code> method is automatically called on the component
+ * to make its measured size get recalculated later.
+ *
+ * @param styleName The name of the style that you add to the list.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function registerSizeInvalidatingStyle(styleName:String):void;
+
+ /**
+ * Tests to see if a style changes the size of a component.
+ *
+ * <p>When one of these styles is set with the <code>setStyle()</code> method,
+ * the <code>invalidateSize()</code> method is automatically called on the component
+ * to make its measured size get recalculated later.</p>
+ *
+ * @param styleName The name of the style to test.
+ *
+ * @return Returns <code>true</code> if the specified style is one
+ * which may affect the measured size of the component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function isSizeInvalidatingStyle(styleName:String):Boolean;
+
+ /**
+ * Adds to the list of styles which may affect the measured size
+ * of the component's parent container.
+ * <p>When one of these styles is set with <code>setStyle()</code>,
+ * the <code>invalidateSize()</code> method is automatically called on the component's
+ * parent container to make its measured size get recalculated
+ * later.</p>
+ *
+ * @param styleName The name of the style to register.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function registerParentSizeInvalidatingStyle(styleName:String):void;
+
+ /**
+ * Tests to see if the style changes the size of the component's parent container.
+ *
+ * <p>When one of these styles is set with <code>setStyle()</code>,
+ * the <code>invalidateSize()</code> method is automatically called on the component's
+ * parent container to make its measured size get recalculated
+ * later.</p>
+ *
+ * @param styleName The name of the style to test.
+ *
+ * @return Returns <code>true</code> if the specified style is one
+ * which may affect the measured size of the component's
+ * parent container.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function isParentSizeInvalidatingStyle(styleName:String):Boolean;
+
+ /**
+ * Adds to the list of styles which may affect the appearance
+ * or layout of the component's parent container.
+ * When one of these styles is set with <code>setStyle()</code>,
+ * the <code>invalidateDisplayList()</code> method is auomatically called on the component's
+ * parent container to make it redraw and/or relayout its children.
+ *
+ * @param styleName The name of the style to register.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function registerParentDisplayListInvalidatingStyle(styleName:String):void;
+
+ /**
+ * Tests to see if this style affects the component's parent container in
+ * such a way as to require that the parent container redraws itself when this style changes.
+ *
+ * <p>When one of these styles is set with <code>setStyle()</code>,
+ * the <code>invalidateDisplayList()</code> method is auomatically called on the component's
+ * parent container to make it redraw and/or relayout its children.</p>
+ *
+ * @param styleName The name of the style to test.
+ *
+ * @return Returns <code>true</code> if the specified style is one
+ * which may affect the appearance or layout of the component's
+ * parent container.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function isParentDisplayListInvalidatingStyle(styleName:String):Boolean;
+
+ /**
+ * Adds a color name to the list of aliases for colors.
+ *
+ * @param colorName The name of the color to add to the list; for example, "blue".
+ * If you later access this color name, the value is not case-sensitive.
+ *
+ * @param colorValue Color value, for example, 0x0000FF.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function registerColorName(colorName:String, colorValue:uint):void;
+
+ /**
+ * Tests to see if the given String is an alias for a color value. For example,
+ * by default, the String "blue" is an alias for 0x0000FF.
+ *
+ * @param colorName The color name to test. This parameter is not case-sensitive.
+ *
+ * @return Returns <code>true</code> if <code>colorName</code> is an alias
+ * for a color.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function isColorName(colorName:String):Boolean;
+
+ /**
+ * Returns the numeric RGB color value that corresponds to the
+ * specified color string.
+ * The color string can be either a case-insensitive color name
+ * such as <code>"red"</code>, <code>"Blue"</code>, or
+ * <code>"haloGreen"</code>, a hexadecimal value such as 0xFF0000, or a #-hexadecimal String
+ * such as <code>"#FF0000"</code>.
+ *
+ * <p>This method returns a uint, such as 4521830, that represents a color. You can convert
+ * this uint to a hexadecimal value by passing the numeric base (in this case, 16), to
+ * the uint class's <code>toString()</code> method, as the following example shows:</p>
+ * <pre>
+ * import mx.styles.StyleManager;
+ * private function getNewColorName():void {
+ * StyleManager.registerColorName("soylentGreen",0x44FF66);
+ * trace(StyleManager.getColorName("soylentGreen").toString(16));
+ * }
+ * </pre>
+ *
+ * @param colorName The color name.
+ *
+ * @return Returns a uint that represents the color value or <code>NOT_A_COLOR</code>
+ * if the value of the <code>colorName</code> property is not an alias for a color.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getColorName(colorName:Object):uint;
+
+ /**
+ * Converts each element of the colors Array from a color name
+ * to a numeric RGB color value.
+ * Each color String can be either a case-insensitive color name
+ * such as <code>"red"</code>, <code>"Blue"</code>, or
+ * <code>"haloGreen"</code>, a hexadecimal value such as 0xFF0000, or a #-hexadecimal String
+ * such as <code>"#FF0000"</code>..
+ *
+ * @param colors An Array of color names.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function getColorNames(colors:Array /* of Number or String */):void;
+
+ /**
+ * Determines if a specified parameter is a valid style property. For example:
+ *
+ * <pre>
+ * trace(StyleManager.isValidStyleValue(myButton.getStyle("color")).toString());
+ * </pre>
+ *
+ * <p>This can be useful because some styles can be set to values
+ * such as 0, <code>NaN</code>,
+ * the empty String (<code>""</code>), or <code>null</code>, which can
+ * cause an <code>if (value)</code> test to fail.</p>
+ *
+ * @param value The style property to test.
+ *
+ * @return If you pass the value returned by a <code>getStyle()</code> method call
+ * to this method, it returns <code>true</code> if the style
+ * was set and <code>false</code> if it was not set.
+ *
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function isValidStyleValue(value:*):Boolean;
+
+ /**
+ * Loads a style SWF.
+ *
+ * @param url Location of the style SWF.
+ *
+ * @param update Set to <code>true</code> to force
+ * an immediate update of the styles.
+ * Set to <code>false</code> to avoid an immediate update
+ * of the styles in the application.
+ * This parameter is optional and defaults to <code>true</code>
+ * For more information about this parameter, see the description
+ * in the <code>setStyleDeclaration()</code> method.
+ *
+ * @param trustContent Obsolete, no longer used.
+ * This parameter is optional and defaults to <code>false</code>.
+ *
+ * @param applicationDomain The ApplicationDomain passed to the
+ * <code>load()</code> method of the IModuleInfo that loads the style SWF.
+ * This parameter is optional and defaults to <code>null</code>.
+ *
+ * @param securityDomain The SecurityDomain passed to the
+ * <code>load()</code> method of the IModuleInfo that loads the style SWF.
+ * This parameter is optional and defaults to <code>null</code>.
+ *
+ * @return An IEventDispatcher implementation that supports
+ * StyleEvent.PROGRESS, StyleEvent.COMPLETE, and
+ * StyleEvent.ERROR.
+ *
+ * @see #setStyleDeclaration()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 4
+ */
+ COMPILE::LATER
+ function loadStyleDeclarations(
+ url:String, update:Boolean = true,
+ trustContent:Boolean = false,
+ applicationDomain:ApplicationDomain = null,
+ securityDomain:SecurityDomain = null):IEventDispatcher;
+
+ /**
+ * Unloads a style SWF.
+ *
+ * @param url Location of the style SWF.
+ * @param update Set to <code>true</code> to force an immediate update of the styles.
+ * Set to <code>false</code> to avoid an immediate update of the styles in the application.
+ * For more information about this method, see the description in the <code>setStyleDeclaration()</code>
+ * method.
+ *
+ * @see #setStyleDeclaration()
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ COMPILE::LATER
+ function unloadStyleDeclarations(
+ url:String, update:Boolean = true):void;
+
+ /**
+ * @private
+ * This method is called by code autogenerated by the MXML compiler,
+ * after StyleManager.styles is popuplated with CSSStyleDeclarations.
+ */
+ function initProtoChainRoots():void;
+
+ /**
+ * @private
+ * After an entire selector is added, replaced, or removed,
+ * this method updates all the DisplayList trees.
+ */
+ function styleDeclarationsChanged():void;
+}
+
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1f6418c4/frameworks/projects/MX/src/main/flex/mx/styles/IStyleManager2.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MX/src/main/flex/mx/styles/IStyleManager2.as b/frameworks/projects/MX/src/main/flex/mx/styles/IStyleManager2.as
new file mode 100644
index 0000000..6a59470
--- /dev/null
+++ b/frameworks/projects/MX/src/main/flex/mx/styles/IStyleManager2.as
@@ -0,0 +1,220 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.styles
+{
+
+COMPILE::LATER
+{
+ import flash.events.IEventDispatcher;
+ import flash.system.ApplicationDomain;
+ import flash.system.SecurityDomain;
+}
+
+/**
+ * The IStyleManager2 class manages the following:
+ * <ul>
+ * <li>Which CSS style properties the class inherits</li>
+ * <li>Which style properties are colors, and therefore get special handling</li>
+ * <li>A list of strings that are aliases for color values</li>
+ * </ul>
+ *
+ * @see mx.styles.CSSStyleDeclaration
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ *
+ */
+public interface IStyleManager2 extends IStyleManager
+{
+ //--------------------------------------------------------------------------
+ //
+ // Properties
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * The style manager that is the parent of this StyleManager.
+ *
+ * @return the parent StyleManager or null if this is the top-level StyleManager.
+ */
+ function get parent():IStyleManager2;
+
+ //----------------------------------
+ // qualifiedTypeSelectors
+ //----------------------------------
+
+ /**
+ * @private
+ * Qualified type selectors were added in Flex 4 to support styling
+ * components with the same local name, e.g. 'spark.components.Button'.
+ * Prior to this type selectors were always unqualified class names e.g.
+ * 'Button'. To ease migration of Flex 3 application, this property can
+ * control whether CSS type selectors must be fully qualified class names
+ * when the compatibility version is 4 or later.
+ */
+ function get qualifiedTypeSelectors():Boolean;
+
+ /**
+ * @private
+ */
+ function set qualifiedTypeSelectors(value:Boolean):void;
+
+ //----------------------------------
+ // selectors
+ //----------------------------------
+
+ /**
+ * Returns an Array of all the CSS selectors that are registered with the StyleManager.
+ * You can pass items in this Array to the <code>getStyleDeclaration()</code> method to get the corresponding CSSStyleDeclaration object.
+ * Class selectors are prepended with a period.
+ *
+ * @return An Array of all of the selectors
+ *
+ * @langversion 3.0
+ * @playerversion Flash 9
+ * @playerversion AIR 1.1
+ * @productversion Flex 3
+ */
+ function get selectors():Array;
+
+ //----------------------------------
+ // typeHierarchyCache
+ //----------------------------------
+
+ /**
+ * @private
+ */
+ function get typeHierarchyCache():Object;
+
+ /**
+ * @private
+ */
+ function set typeHierarchyCache(value:Object):void;
+
+ //--------------------------------------------------------------------------
+ //
+ // Methods
+ //
+ //--------------------------------------------------------------------------
+
+ /**
+ * @private
+ * Gets the list of style declarations for the given subject. The subject
+ * is the right most simple type selector in a potential selector chain.
+ *
+ * @param subject The style subject.
+ * @return Object map of StyleDeclarations for this subject. The object
+ * has four properties: class for class selectors,
+ * id for id selectors, pseudo for pseudo selectors and unconditional
+ * for selectors without conditions
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4.6
+ */
+ function getStyleDeclarations(subject:String):Object;
+
+ /**
+ * Gets a CSSStyleDeclaration object that stores the rules
+ * for the specified CSS selector. The CSSStyleDeclaration object is
+ * created by merging the properties of the specified CSS selector in
+ * this style manager with the properties of any parent style managers.
+ *
+ * <p>If the <code>selector</code> parameter starts with a period (.),
+ * the returned CSSStyleDeclaration is a class selector and applies only to those instances
+ * whose <code>styleName</code> property specifies that selector
+ * (not including the period).
+ * For example, the class selector <code>".bigMargins"</code>
+ * applies to any UIComponent whose <code>styleName</code>
+ * is <code>"bigMargins"</code>.</p>
+ *
+ * <p>If the <code>selector</code> parameter does not start with a period,
+ * the returned CSSStyleDeclaration is a type selector and applies to all instances
+ * of that type.
+ * For example, the type selector <code>"Button"</code>
+ * applies to all instances of Button and its subclasses.</p>
+ *
+ * <p>The <code>global</code> selector is similar to a type selector
+ * and does not start with a period.</p>
+ *
+ * @param selector The name of the CSS selector.
+ *
+ * @return The style declaration whose name matches the <code>selector</code> property.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function getMergedStyleDeclaration(selector:String):CSSStyleDeclaration;
+
+ /**
+ * @private
+ * Determines whether any of the selectors declared a pseudo selector
+ * for the given state. This is used to avoid unnecessary style
+ * regeneration between state changes.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function hasPseudoCondition(value:String):Boolean;
+
+ /**
+ * @private
+ * Determines whether any of the selectors registered with the style
+ * manager have been advanced selectors (descendant selector, id selector,
+ * non-global class selector, or pseudo selector).
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10
+ * @playerversion AIR 1.5
+ * @productversion Flex 4
+ */
+ function hasAdvancedSelectors():Boolean;
+
+ /**
+ * @private
+ * In Flex 2, the static method StyleManager.loadStyleDeclarations()
+ * had three parameters and called loadStyleDeclarations()
+ * on IStyleManager.
+ * In Flex 3, the static method has four parameters and calls
+ * this method.
+ */
+ COMPILE::LATER
+ function loadStyleDeclarations2(
+ url:String, update:Boolean = true,
+ applicationDomain:ApplicationDomain = null,
+ securityDomain:SecurityDomain = null):IEventDispatcher;
+
+ /**
+ * @private
+ * Used in media query handling.
+ * @param value normalized media query string
+ * @returns true if valid media
+ */
+ function acceptMediaList(value:String):Boolean;
+}
+
+}