     	var theSelectors:Array = [];
     	for (var i:String in _selectors)
     		theSelectors.push(i);
-    		
+
     	return theSelectors;
+    }
+
+    /**
+     * @private
+     * Determines whether at least one pseudo-selector has been specified for
+     * the given subject.
+     */ 
+    public function hasPseudoSelector(subject:String):Boolean
+    {
+        return _pseudoSubjects != null && _pseudoSubjects[subject] != null;
+    }
+
+    /**
+     *  Adds this style declaration to a collection of declarations for the
+     *  associated subject.
+     *
+     *  @param styleDeclaration The style declaration to add.
+     *  @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.
+     */
+    public function addStyleDeclaration(styleDeclaration:CSSStyleDeclaration,
+            update:Boolean=false):void
+    {
+
+        // We index by subject to help match advanced selectors
+        var subject:String = styleDeclaration.subject;
+        var selectorKey:String = styleDeclaration.selectorString;
+        if (subject != null)
+        {
+            var declarations:OrderedObject = _subjects[subject];
+            if (declarations == null)
+            {
+                declarations = new OrderedObject();
+                declarations[selectorKey] = styleDeclaration;
+                _subjects[subject] = declarations;
+            }
+            else
+            {
+                declarations[selectorKey] = styleDeclaration;
+            }
+        }
+
+        // Populate the legacy selectors Array for this style declaration
+        styleDeclaration.selectorRefCount++;
+        _selectors[selectorKey] = styleDeclaration;
+
+        // Also remember subjects that have pseudo-selectors to optimize
+        // styles during component state changes.
+        if (styleDeclaration.isPseudoSelector())
+        {
+            if (_pseudoSubjects == null)
+                _pseudoSubjects = {};
+
+            _pseudoSubjects[subject] = true;
+        }
+
+        // Flush cache and start over.
+        if (_typeSelectorCache)
+            _typeSelectorCache = {};
+
+        if (update)
+            styleDeclarationsChanged();
+    }
+
+    /**
+     *  Retrieve all style declarations applicable to this subject. The subject
+     *  is the right most simple type selector in a selector chain.
+     * 
+     *  @param subject The subject of the style declarations.
+     */ 
+    public function getStyleDeclarations(subject:String):Object // Map of selector String, CSSStyleDeclaration
+    {
+        // If we were passed a subject with a package name,
+        // such as "mx.controls.Button", strip off the package name
+        // leaving just "Button" and look for that subject.
+        if (subject.charAt(0) != ".")
+        {
+            var index:int = subject.lastIndexOf(".");
+            if (index != -1)
+                subject = subject.substr(index + 1);
+        }
+
+        return _subjects[subject];
     }
 
     /**

            styleDeclaration.selectorRefCount--;

        delete _selectors[selector];

        if (update)
            styleDeclarationsChanged();

			delete _inheritingStyles["textDecoration"];
			delete _inheritingStyles["leading"];
		}

		if (!stylesRoot)
		{
			if (_selectors["global"] != null)
			{
			    stylesRoot = _selectors["global"].addStyleToProtoChain({}, null);
			}
		}
    }
    
    /**
