<commit_before>////////////////////////////////////////////////////////////////////////////////
//
//  ADOBE SYSTEMS INCORPORATED
//  Copyright 2003-2007 Adobe Systems Incorporated
//  All Rights Reserved.
//
//  NOTICE: Adobe permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////

package mx.styles
{

import flash.events.IEventDispatcher;
import flash.system.ApplicationDomain;
import flash.system.SecurityDomain;

import mx.core.Singleton;

/**
 *  The StyleManager 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 class StyleManager
{
    include "../core/Version.as";

    //--------------------------------------------------------------------------
    //
    //  Class constants
    //
    //--------------------------------------------------------------------------

    /**
     *  The <code>getColorName()</code> method returns this value if the passed-in
     *  String is not a legitimate color name.
     *  
     *  @langversion 3.0
     *  @playerversion Flash 9
     *  @playerversion AIR 1.1
     *  @productversion Flex 3
     */
    public static const NOT_A_COLOR:uint = 0xFFFFFFFF;

    //--------------------------------------------------------------------------
    //
    //  Class variables
    //
    //--------------------------------------------------------------------------

    /**
     *  @private
     *  Linker dependency on implementation class.
     */
    private static var implClassDependency:StyleManagerImpl;

    /**
     *  @private
     *  Storage for the impl getter.
     *  This gets initialized on first access,
     *  not at static initialization time, in order to ensure
     *  that the Singleton registry has already been initialized.
     */
    private static var _impl:IStyleManager2;

    /**
     *  @private
     *  The singleton instance of StyleManagerImpl which was
     *  registered as implementing the IStyleManager2 interface.
     */
    private static function get impl():IStyleManager2
    {
        if (!_impl)
        {
            // TODO: Do we need to check compatibility first?

            _impl = IStyleManager2(
                Singleton.getInstance("mx.styles::IStyleManager2"));
        }

        return _impl;
    }

    //--------------------------------------------------------------------------
    //
    //  Class methods
    //
    //--------------------------------------------------------------------------

    /**
     *  @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.
     */
    mx_internal static function get stylesRoot():Object
    {
        return impl.stylesRoot;
    }
    mx_internal static function set stylesRoot(value:Object):void
    {
        impl.stylesRoot = value;
    }

    /**
     *  @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.
     */
    mx_internal static function get inheritingStyles():Object
    {
        return impl.inheritingStyles;
    }
    mx_internal static function set inheritingStyles(value:Object):void
    {
        impl.inheritingStyles = value;
    }

    /**
     *  @private
     */
    mx_internal static function get typeHierarchyCache():Object
    {
        return impl.typeHierarchyCache;
    }
    mx_internal static function set typeHierarchyCache(value:Object):void
    {
        impl.typeHierarchyCache = value;
    }<commit_msg>Transferred from the Adobe Open Source Subversion Repository<commit_after>////////////////////////////////////////////////////////////////////////////////
//
//  ADOBE SYSTEMS INCORPORATED
//  Copyright 2003-2007 Adobe Systems Incorporated
//  All Rights Reserved.
//
//  NOTICE: Adobe permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////

package mx.styles
{

import flash.events.IEventDispatcher;
import flash.system.ApplicationDomain;
import flash.system.SecurityDomain;

import mx.core.FlexVersion;
import mx.core.mx_internal;
import mx.core.Singleton;

/**
 *  The StyleManager 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 class StyleManager
{
    include "../core/Version.as";

    //--------------------------------------------------------------------------
    //
    //  Class constants
    //
    //--------------------------------------------------------------------------

    /**
     *  The <code>getColorName()</code> method returns this value if the passed-in
     *  String is not a legitimate color name.
     *  
     *  @langversion 3.0
     *  @playerversion Flash 9
     *  @playerversion AIR 1.1
     *  @productversion Flex 3
     */
    public static const NOT_A_COLOR:uint = 0xFFFFFFFF;

    //--------------------------------------------------------------------------
    //
    //  Class variables
    //
    //--------------------------------------------------------------------------

    /**
     *  @private
     *  Linker dependency on implementation class.
     */
    private static var implClassDependency:StyleManagerImpl;

    /**
     *  @private
     *  Storage for the impl getter.
     *  This gets initialized on first access,
     *  not at static initialization time, in order to ensure
     *  that the Singleton registry has already been initialized.
     */
    private static var _impl:IStyleManager2;

    /**
     *  @private
     *  The singleton instance of StyleManagerImpl which was
     *  registered as implementing the IStyleManager2 interface.
     */
    private static function get impl():IStyleManager2
    {
        if (!_impl)
        {
            // TODO: Do we need to check compatibility first?

            _impl = IStyleManager2(
                Singleton.getInstance("mx.styles::IStyleManager2"));
        }

        return _impl;
    }

    //--------------------------------------------------------------------------
    //
    //  Class methods
    //
    //--------------------------------------------------------------------------

    /**
     *  @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.
     */
    mx_internal static function get stylesRoot():Object
    {
        return impl.stylesRoot;
    }
    mx_internal static function set stylesRoot(value:Object):void
    {
        impl.stylesRoot = value;
    }

    /**
     *  @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.
     */
    mx_internal static function get inheritingStyles():Object
    {
        return impl.inheritingStyles;
    }
    mx_internal static function set inheritingStyles(value:Object):void
    {
        impl.inheritingStyles = value;
    }

    /**
     *  @private
     */
    private static var _qualifiedTypeSelectors:Boolean = true;

    /**
     *  @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.
     */
    mx_internal static function get qualifiedTypeSelectors():Boolean
    {
        if (FlexVersion.compatibilityVersion < FlexVersion.VERSION_4_0)
            return false;
        else
            return _qualifiedTypeSelectors; 
    }
    mx_internal static function set qualifiedTypeSelectors(value:Boolean):void
    {
        _qualifiedTypeSelectors = value;
    }

    /**
     *  @private
     */
    mx_internal static function get typeHierarchyCache():Object
    {
        return impl.typeHierarchyCache;
    }
    mx_internal static function set typeHierarchyCache(value:Object):void
    {
        impl.typeHierarchyCache = value;
    }
{'fraction_non_alphanumeric': 0.19599427753934193, 'fraction_numerical': 0.005824647455548743, 'mean_word_length': 1.5775612325520147, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7657945', 'n_tokens_mistral': 2495, 'n_tokens_neox': 2401, 'n_words': 788}