Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

Modified Paths:
--------------
2361 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1262697 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/styles/StyleProxy.as
+++ frameworks/projects/framework/src/mx/styles/StyleProxy.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 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
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 23246
Author:   cframpto@adobe.com
Date:     2011-12-20T17:40:08.069454Z

Log Message:
-----------
Rollback 23243.  If comment followed header it was stripped as well.

Modified Paths:
--------------
2361 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1269713 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/mx/src/mx/skins/halo/ActivatorSkin.as
+++ frameworks/projects/mx/src/mx/skins/halo/ActivatorSkin.as
@@ -1,3 +1,13 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.skins.halo
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 5099
Author:   gauravj@adobe.com
Date:     2009-02-27T03:43:02.639229Z

Log Message:
-----------
Update action script files with asdoc version tags.

QE Notes: None.
Doc Notes: Please review and update as necessary.
tests: checkintests

Modified Paths:
--------------
147 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1274408 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/rpc/src/mx/rpc/soap/mxml/Operation.as
+++ frameworks/projects/rpc/src/mx/rpc/soap/mxml/Operation.as
@@ -38,6 +38,11 @@
 /**
 * An Operation used specifically by WebServices. An Operation is an individual method on a service. An Operation can be called either by invoking the function of the same name on the service or by accessing the Operation
 * as a property on the service and calling the send() method.
+*
+*  @langversion 3.0
+*  @playerversion Flash 9
+*  @playerversion AIR 1.1
+*  @productversion Flex 3
 */
 public class Operation extends mx.rpc.soap.Operation implements IMXMLSupport
 {
@@ -53,6 +58,11 @@
       * @param webService The web service upon which this Operation is invoked.
       *
       * @param name The name of this Operation.
+      *
+      *  @langversion 3.0
+      *  @playerversion Flash 9
+      *  @playerversion AIR 1.1
+      *  @productversion Flex 3
       */
    public function Operation(webService:mx.rpc.soap.WebService = null, name:String = null)
     {
@@ -83,6 +93,11 @@
     /**
      * The concurrency for this Operation.  If it has not been explicitly set the setting from the WebService
      * will be used.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function get concurrency():String
     {
@@ -115,6 +130,11 @@
      * Whether this operation should show the busy cursor while it is executing.
      * If it has not been explicitly set the setting from the WebService
      * will be used.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     public function get showBusyCursor():Boolean
     {
@@ -141,6 +161,11 @@

     /**
      * @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     override public function cancel(id:String = null) : AsyncToken
     {
@@ -199,6 +224,11 @@

     /*
      * Kill the busy cursor, find the matching call object and pass it back
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
      */
     override mx_internal function preHandle(event:MessageEvent):AsyncToken
     {


We can still initialize this statically, thanks Ray.

git-svn-id: a1a4b28b82a3276cc491891159dd9963a0a72fae@5071 542714f4-19e9-0310-aa3c-eee0fc999fb1

--- src/as/com/threerings/presents/dobj/DEvent.as
+++ src/as/com/threerings/presents/dobj/DEvent.as
@@ -32,10 +32,6 @@
 {
     public function DEvent (targetOid :int = 0)
     {
-        // TODO: Remove when https://bugzilla.mozilla.org/show_bug.cgi?id=433103 is fixed
-        if (UNSET_OLD_ENTRY == null) {
-            UNSET_OLD_ENTRY = new DummyEntry();
-        }
         _toid = targetOid;
     }

@@ -116,6 +112,13 @@
     /** The oid of the object that is the target of this event. */
     protected var _toid :int;

+    // TODO: Remove when https://bugzilla.mozilla.org/show_bug.cgi?id=433103 is fixed
+    private static function staticInit () :void
+    {
+        UNSET_OLD_ENTRY = new DummyEntry();
+    }
+    staticInit();
+
     protected static var UNSET_OLD_ENTRY :DSet_Entry;
 }
 }


Removed copyright

Removed copyright

--- _/dev/multipleytplayersas2/src/MultipleYouTubePlayers.as
+++ _/dev/multipleytplayersas2/src/MultipleYouTubePlayers.as
@@ -1,11 +1,3 @@
-/**
- * @author			Ahmed Nuaman (http://www.ahmednuaman.com)
- * @langversion		2
- *
- * This work is licenced under the Creative Commons Attribution-Share Alike 2.0 UK: England & Wales License.
- * To view a copy of this licence, visit http://creativecommons.org/licenses/by-sa/2.0/uk/ or send a letter
- * to Creative Commons, 171 Second Street, Suite 300, San Francisco, California 94105, USA.
-*/
 import com.tangozebra.youtube.TZYouTubePlayer;

 class MultipleYouTubePlayers


Transferred from the Adobe Open Source Subversion Repository

Revision: 7967
Author:   gosmith@adobe.com
Date:     2009-06-18T19:44:16.674676Z

Log Message:
-----------
PARB changes to TextGraphicElement/SimpleText/RichText and to text styles in general.

TextGraphicElement:

The 'truncation' property has been renamed to 'maxDisplayedLines'.

The isTruncated() method has become an 'isTruncated' read-only property.

RichText:

Since a TextFlow object is the fundamental representation for rich test in TLF, the RichText component now has a public textFlow:TextFlow property which you can get or set. To turn TLF markup -- in either String or XML form -- into a TextFlow, use the static importFromString() and importFromXML() methods in the TextFlowUtil class. These are bindable methods so that if the markup parameter changes they will re-evaluate. To turn the TextFlow back into markup, use TextFLowUtil.export(...) to produce XML.

The 'content' property is now intended only for use by the MXML compiler. It is set-only and only supports being set to what MXML markup produces: a String (which will be treated as the text of an implicit span in an implicit paragraph), a FlowElement, or an Array of Strings and FlowElements.

The 'text', 'textFlow', and 'content' properties are interacting properties. For example, you can set 'textFlow' and then get the 'text', and vice versa. In fact, you can now do this immediately, without waiting for the component to undergo a LayoutManager pass. Of these three properties, the last one set in ActionScript wins; if more than one is set in MXML the results are undefined since MXML does not guarantee the order in which properties are set. Setting any of them to null is equivalent to setting the 'text' to the empty String, which is the initial state of the component.

Styles:

The 'lineBreak' style is now non-inheriting, since in TLF it doesn't inherit from FlowElement to FlowElement.

The text styles are now divided into five buckets:

BasicInheritingTextStyles.as
BasicNonInheritingTextStyles.as
AdvancedInheritingTextStyles.as
AdvancedNonInheritingTextStyles.as
SelectionFormatTextStyles.as

Skinnable components like TextInput and TextArea no longer declare any on the noninheriting text styles, because the RichTextElement in the skin doesn't inherit them. You must set them directly on the RichTextElement in the component's skin, either with ActionScript or by reskinning.

The styleInitialized() method has been added to the IAdvancedStyleClient interface.

QE Notes: None
Doc Notes: None
Bugs: None
Reviewer: Carol

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/ButtonBarFirstButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/ButtonBarFirstButtonSkin.mxml</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/styles/metadata/BasicTextLayoutFormatStyles.as" copyfrom-rev="7910" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/styles/metadata/BasicInheritingTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/spark/skins/spark/SparkChromeWindowedApplicationSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/TextGraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/spark/skins/spark/WindowedApplicationSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ButtonBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/DefaultButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/ButtonBarLastButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/ButtonBarLastButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/DefaultButtonSkin.mxml</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/styles/metadata/AdvancedTextLayoutFormatStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleProxy.as</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/styles/metadata/BasicTextLayoutFormatStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/VideoPlayer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/utils/TextFlowUtil.as</path>
<path kind="file" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/styles/metadata/AdvancedNonInheritingTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/ButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/ButtonBarMiddleButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/ButtonBarMiddleButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/ButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/ToggleButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/ToggleButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/RichText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/SkinnableTextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/SkinnableDataContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/spark/skins/spark/windowChrome/TitleBarSkin.mxml</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/styles/metadata/NonInheritingTextLayoutFormatStyles.as" copyfrom-rev="7910" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/styles/metadata/BasicNonInheritingTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/SimpleText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/CheckBoxSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/CheckBoxSkin.mxml</path>
<path kind="file" action="D">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/styles/metadata/NonInheritingTextLayoutFormatStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/SkinnableContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/spark/RadioButtonSkin.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/IAdvancedStyleClient.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/wireframe/src/spark/skins/wireframe/RadioButtonSkin.mxml</path>
<path kind="file" copyfrom-path="/flex/sdk/trunk/frameworks/projects/flex4/src/spark/styles/metadata/AdvancedTextLayoutFormatStyles.as" copyfrom-rev="7910" action="A">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/styles/metadata/AdvancedInheritingTextStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/spark/skins/spark/windowChrome/MacTitleBarSkin.mxml</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1280359 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/components/RichText.as
+++ frameworks/projects/spark/src/spark/components/RichText.as
@@ -14,19 +14,15 @@

 import flash.display.DisplayObject;
 import flash.display.DisplayObjectContainer;
-import flash.display.Graphics;
-import flash.display.Sprite;
-import flash.geom.Rectangle;
 import flash.text.TextFormat;
 import flash.text.engine.FontLookup;

 import flashx.textLayout.compose.ITextLineCreator;
+import flashx.textLayout.conversion.ConversionType;
+import flashx.textLayout.conversion.ITextExporter;
 import flashx.textLayout.conversion.ITextImporter;
 import flashx.textLayout.conversion.TextFilter;
 import flashx.textLayout.elements.Configuration;
-import flashx.textLayout.elements.FlowElement;
-import flashx.textLayout.elements.ParagraphElement;
-import flashx.textLayout.elements.SpanElement;
 import flashx.textLayout.elements.TextFlow;
 import flashx.textLayout.events.DamageEvent;
 import flashx.textLayout.factory.StringTextLineFactory;
@@ -37,8 +33,6 @@
 import flashx.textLayout.formats.ITextLayoutFormat;
 import flashx.textLayout.formats.TextLayoutFormat;

-import mx.core.EmbeddedFont;
-import mx.core.EmbeddedFontRegistry;
 import mx.core.IEmbeddedFontRegistry;
 import mx.core.IFlexModuleFactory;
 import mx.core.IFontContextComponent;
@@ -49,7 +43,6 @@

 import spark.core.CSSTextLayoutFormat;
 import spark.primitives.supportClasses.TextGraphicElement;
-import spark.utils.TextUtil;

 use namespace mx_internal;

@@ -57,9 +50,10 @@
 //  Styles
 //--------------------------------------

-include "../styles/metadata/AdvancedTextLayoutFormatStyles.as"
-include "../styles/metadata/BasicTextLayoutFormatStyles.as"
-include "../styles/metadata/NonInheritingTextLayoutFormatStyles.as"
+include "../styles/metadata/BasicInheritingTextStyles.as"
+include "../styles/metadata/BasicNonInheritingTextStyles.as"
+include "../styles/metadata/AdvancedInheritingTextStyles.as"
+include "../styles/metadata/AdvancedNonInheritingTextStyles.as"

 //--------------------------------------
 //  Other metadata
@@ -108,80 +102,66 @@

     //--------------------------------------------------------------------------
     //
-    //  Class initialization
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  @private
-     */
-    private static function initClass():void
-    {
-        staticTextLayoutFormat = new TextLayoutFormat();
-		staticTextLayoutFormat.lineBreak = FormatValue.INHERIT;
-        staticTextLayoutFormat.paddingLeft = FormatValue.INHERIT;
-        staticTextLayoutFormat.paddingRight = FormatValue.INHERIT;
-        staticTextLayoutFormat.paddingTop = FormatValue.INHERIT;
-        staticTextLayoutFormat.paddingBottom = FormatValue.INHERIT;
-        staticTextLayoutFormat.verticalAlign = FormatValue.INHERIT;
-
-        // Create a single Configuration used by all RichText instances.
-        staticConfiguration = Configuration(
-        	StringTextLineFactory.defaultConfiguration).clone();
-        staticConfiguration.textFlowInitialFormat = staticTextLayoutFormat;
-
-        // Create the factory used to create TextLines from 'text'.
-        staticStringFactory = new StringTextLineFactory(staticConfiguration);
-        staticStringFactory.verticalScrollPolicy = "off";
-        staticStringFactory.horizontalScrollPolicy = "off";
-
-        // Create the factory used to create TextLines from 'content'.
-        staticTextFlowFactory = new TextFlowTextLineFactory();
-        staticTextFlowFactory.verticalScrollPolicy = "off";
-        staticTextFlowFactory.horizontalScrollPolicy = "off";
-
-        staticTextFormat = new TextFormat();
-     }
-
-    initClass();
-
-    //--------------------------------------------------------------------------
-    //
     //  Class variables
     //
     //--------------------------------------------------------------------------

     /**
      *  @private
-     *  Used for determining whitespace processing during import.
+     */
+    private static var classInitialized:Boolean = false;
+
+	/**
+	 *  @private
+	 *  This TLF object composes TextLines from a text String.
+	 *  We use it when the 'text' property is set to a String
+	 *  that doesn't contain linebreaks.
+	 */
+	private static var staticStringFactory:StringTextLineFactory;
+
+	/**
+	 *  @private
+	 *  This TLF object composes TextLines from a TextFlow.
+	 *  We use it when the 'textFlow' or 'content' property is set,
+	 *  and when the 'text' property is set to a String
+	 *  that contains linebreaks (and therefore is interpreted
+	 *  as multiple paragraphs).
+	 */
+	private static var staticTextFlowFactory:TextFlowTextLineFactory;
+
+	/**
+	 *  @private
+	 *  This TLF object is used to import a 'text' String
+	 *  containing linebreaks to create a multiparagraph TextFlow.
+	 */
+	private static var staticPlainTextImporter:ITextImporter;
+
+	/**
+	 *  @private
+	 *  This TLF object is used to export a TextFlow as plain 'text',
+	 *  by walking the leaf FlowElements in the TextFlow.
+	 */
+	private static var staticPlainTextExporter:ITextExporter;
+
+	/**
+     *  @private
+     *  Used for determining whitespace processing when setting 'content'.
      */
     private static var staticTextLayoutFormat:TextLayoutFormat;

     /**
      *  @private
-     *  Used for determining whitespace processing during import.
+     *  Used for determining whitespace processing when setting 'content'.
      */
     private static var staticConfiguration:Configuration;

     /**
      *  @private
-     *  To compose text lines using a text string.
-     */
-    private static var staticStringFactory:StringTextLineFactory;
-
-    /**
-     *  @private
-     *  To compose text lines using a text flow.
-     */
-    private static var staticTextFlowFactory:TextFlowTextLineFactory;
-
-    /**
-     *  @private
-     *  Used in getEmbeddedFontContext().
+     *  Used to call isFontFaceEmbedded() in getEmbeddedFontContext().
      */
     private static var staticTextFormat:TextFormat;
-
-    //--------------------------------------------------------------------------
+
+	//--------------------------------------------------------------------------
     //
     //  Class properties
     //
@@ -217,6 +197,56 @@
         return _embeddedFontRegistry;
     }

+	//--------------------------------------------------------------------------
+	//
+	//  Class methods
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 *  This method initializes the static vars of this class.
+	 *  Rather than calling it at static initialization time,
+	 *  we call it in the constructor to do the class initialization
+	 *  when the first instance is created.
+	 *  (It does an immediate return if it has already run.)
+	 *  By doing so, we avoid any static initialization issues
+	 *  related to whether this class or the TLF classes
+	 *  that it uses are initialized first.
+	 */
+	private static function initClass():void
+	{
+		if (classInitialized)
+			return;
+
+		staticTextLayoutFormat = new TextLayoutFormat();
+		staticTextLayoutFormat.lineBreak = FormatValue.INHERIT;
+		staticTextLayoutFormat.paddingLeft = FormatValue.INHERIT;
+		staticTextLayoutFormat.paddingRight = FormatValue.INHERIT;
+		staticTextLayoutFormat.paddingTop = FormatValue.INHERIT;
+		staticTextLayoutFormat.paddingBottom = FormatValue.INHERIT;
+		staticTextLayoutFormat.verticalAlign = FormatValue.INHERIT;
+
+		// Create a single Configuration used by all RichText instances.
+		staticConfiguration = Configuration(
+			StringTextLineFactory.defaultConfiguration).clone();
+		staticConfiguration.textFlowInitialFormat = staticTextLayoutFormat;
+
+		staticStringFactory = new StringTextLineFactory(staticConfiguration);
+
+		staticTextFlowFactory = new TextFlowTextLineFactory();
+
+		staticTextFormat = new TextFormat();
+
+		staticPlainTextImporter =
+			TextFilter.getImporter(TextFilter.PLAIN_TEXT_FORMAT);
+
+		staticPlainTextExporter =
+			TextFilter.getExporter(TextFilter.PLAIN_TEXT_FORMAT);
+
+		classInitialized = true;
+	}
+
     //--------------------------------------------------------------------------
     //
     //  Constructor
@@ -234,6 +264,10 @@
     public function RichText()
     {
         super();
+
+        initClass();
+
+        text = "";
     }

     //--------------------------------------------------------------------------
@@ -244,50 +278,30 @@

     /**
      *  @private
-     *  This object is determined by the CSS styles of the RichText
-     *  and is updated by createTextFlow() when the hostFormatsInvalid flag
-     *  is true.
+     *  This object determines the default text formatting used
+     *  by this component, based on its CSS styles.
+     *  It is set to null by stylesInitialized() and styleChanged(),
+     *  and recreated whenever necessary in commitProperties().
      */
     private var hostFormat:ITextLayoutFormat;

-    /**
-     *  @private
-     *  This flag indicates whether hostCharacterFormat, hostParagraphFormat,
-     *  and hostContainerFormat need to be recalculated from the CSS styles
-     *  of the RichText. It is set true by stylesInitialized() and also
-     *  when styleChanged() is called with a null argument, indicating that
-     *  multiple styles have changed.
-     */
-    private var hostFormatChanged:Boolean = true;
-
-    /**
-     *  @private
-     */
-    private var textFlow:TextFlow;
-
-    /**
-     *  @private
-     */
-    private var textChanged:Boolean = false;
-
-    /**
-     *  @private
-     */
-    private var contentChanged:Boolean = false;
-
-    /**
-     *  @private
-     *  This flag is set to true if the 'text' needs to be extracted
-     *  from the 'content'.
-     */
-    private var textInvalid:Boolean = false;
-
-    /**
+	/**
      *  @private
      *  Holds the last recorded value of the module factory
      *  used to create the font.
      */
     mx_internal var embeddedFontContext:IFlexModuleFactory;
+
+	/**
+	 *  @private
+	 *  Specifies whether the StringTextLineFactory
+	 *  or the TextFlowTextLineFactory is used to create the TextLines.
+	 *  A StringTextLineFactory is more efficient; it is used
+	 *  by default to render the default text ""
+	 *  and when 'text' is set to a string without linebreaks;
+	 *  otherwise, a TextFlowTextLineFactory is used.
+	 */
+	private var factory:TextLineFactoryBase;

     //--------------------------------------------------------------------------
     //
@@ -302,7 +316,14 @@
     // Compiler will strip leading and trailing whitespace from text string.
     [CollapseWhiteSpace]

-    /**
+    // The _text storage var is mx_internal in TextGraphicElement.
+
+	/**
+	 *  @private
+	 */
+	private var textChanged:Boolean = false;
+
+	/**
      *  @private
      */
     override public function get text():String
@@ -310,11 +331,20 @@
         // Extracting the plaintext from a TextFlow is somewhat expensive,
         // as it involves iterating over the leaf FlowElements in the TextFlow.
         // Therefore we do this extraction only when necessary, namely when
-        // you set the 'content' and then get the 'text'.
-        if (textInvalid)
+        // you first set the 'content' or the 'textFlow'
+        // (or mutate the TextFlow), and then get the 'text'.
+        if (_text == null)
         {
-            _text = TextUtil.extractText(textFlow);
-            textInvalid = false;
+        	// If 'content' was last set,
+        	// we have to first turn that into a TextFlow.
+        	if (_content != null)
+	        	_textFlow = createTextFlowFromContent(_content);
+
+            // Once we have a TextFlow, we can export its plain text.
+            _text = staticPlainTextExporter.export(
+            	_textFlow, ConversionType.STRING_TYPE) as String;
+			// Remove the trailing paragraph terminator.
+            _text = _text.substring(0, _text.length - 1);
         }

         return _text;
@@ -329,15 +359,40 @@
      */
     override public function set text(value:String):void
     {
-        // Setting 'text' temporarily causes 'content' to become null.
-        // Later, after the 'text' has been committed into the TextFlow,
-        // getting 'content' will return the TextFlow.
-        _content = null;
-        contentChanged = false;
-        textInvalid = false;
-
-        super.text = value;
-    }
+    	// Treat setting the 'text' to null
+    	// as if it were set to the empty String
+    	// (which is the default state).
+    	if (value == null)
+    		value = "";
+
+    	// Don't return early if value is the same as _text,
+    	// because _text might have been produced from setting
+    	// 'textFlow' or 'content'.
+    	// For example, if you set a TextFlow corresponding to
+    	// "Hello World"
+    	// and then get the 'text', it will be the String "Hello World"
+    	// But if you then set the 'text' to "Hello World"
+    	// this represents a change: the "World" should no longer be red.
+
+    	_text = value;
+    	textChanged = true;
+
+    	// If more than one of 'text', 'textFlow', and 'content' is set,
+    	// the last one set wins.
+    	textFlowChanged = false;
+    	contentChanged = false;
+
+		// The other two are now invalid and must be recalculated when needed.
+		_textFlow = null;
+    	_content = null;
+
+    	factory = staticStringFactory;
+
+		invalidateTextLines();
+		invalidateProperties();
+		invalidateSize();
+		invalidateDisplayList();
+	}

     //--------------------------------------------------------------------------
     //
@@ -382,9 +437,15 @@

     /**
      *  @private
+     *  Storage for the content property.
      */
     protected var _content:Object;

+	/**
+	 *  @private
+	 */
+	private var contentChanged:Boolean = false;
+
     /**
      *  @private
      *  This metadata tells the MXML compiler to disable some of its default
@@ -403,94 +464,222 @@
     [RichTextContent]

     /**
-     *  The text contained in the RichText element.
-     *
-     *
The contents of this property can be a sequence of characters, <p>, <br/> or <span> elements.
-     *  The <p> and <span> elements can be implied, depending on how you use the style properties.

-     *
-     *
If this property has text content and no explicit paragraph tag, a paragraph tag is automatically generated for the text.

-     *
-     *
The following table describes the tags that can be used in the content property:
-     *
-     *

-     *

-     *      <p>
-     *      Starts a new paragraph. A <p> can be a child of a RichText. Children are character sequences,
-     *          <br/> elements, or <span> elements. Every <p> has at least one <span> that can be implied.
-     *          Character sequences that are direct children of <p> are in an implied <span>.
-     *

-     *

-     *      <span>
-     *      All character sequences are contained in one or more <span> elements.
-     *          Explicit <span> elements can be used for formatting runs of characters within a paragraph.
-     *          Every <span> element is a child of a <p> element. A <span> can contain character
-     *          sequences and/or <br/> elements. A <span> element can be empty. Unlike in XHTML, <span> elements
-     *          must not be nested. The reason for this is the increased cost in number of objects required to represent the text.
-     *

-     *

-     *      <br/>
-     *      Behaves as a Unicode line separator character. It does not end the paragraph, it merely forces a line break at the
-     *          position where it appears. Always a child of <span> elements, though the
-     *          <span> element can be implied. The <br/> element must have no children (it must be an empty tag).
-     *

-     *

-     *

-     *
-     *  @langversion 3.0
-     *  @playerversion Flash 10
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function get content():Object
-    {
-        // If there isn't any content and there is text, create a one paragraph
-        // text flow from the text.
-        if (!_content && _text)
-            _content = convertTextToContent();
-
-        return _content;
+     *  This write-only property is for internal use by the MXML compiler.
+     *  Please use the textFlow property to set
+     *  rich text content.
+     */
+    public function set content(value:Object):void
+    {
+    	// Treat setting the 'content' to null
+    	// as if 'text' were being set to the empty String
+    	// (which is the default state).
+    	if (value == null)
+    	{
+    		text = "";
+    		return;
+    	}
+
+    	if (value == _content)
+    		return;
+
+        _content = value;
+        contentChanged = true;
+
+		// If more than one of 'text', 'textFlow', and 'content' is set,
+		// the last one set wins.
+		textChanged = false;
+        textFlowChanged = false;
+
+		// The other two are now invalid and must be recalculated when needed.
+		_text = null;
+		_textFlow = null;
+
+		factory = staticTextFlowFactory;
+
+		invalidateTextLines();
+		invalidateProperties();
+		invalidateSize();
+		invalidateDisplayList();
     }

-    /**
-     *  @private
-     *  Setting content uses the markup-importing process, so depending on
-     *  the style settings, whitespace may get collapsed and newlines may be
-     *  treated as paragraph separators so that you end up with multiple
-     *  paragraphs.
-     */
-    public function set content(value:Object):void
-    {
-        if (value != _content)
-        {
-            // Setting 'content' temporarily causes 'text' to become null.
-            // Later, after the 'content' has been committed into the TextFlow,
-            // getting 'text' will extract the text from the TextFlow.
-            _text = null;
-            textChanged = false;
-
-            _content = value;
-
-            invalidateTextLines("content");
-            invalidateSize();
-            invalidateDisplayList();
-        }
+	//----------------------------------
+	//  textFlow
+	//----------------------------------
+
+	/**
+	 *  @private
+	 *  Storage for the textFlow property.
+	 */
+	private var _textFlow:TextFlow;
+
+	/**
+	 *  @private
+	 */
+	private var textFlowChanged:Boolean = false;
+
+	/**
+	 *  The TextFlow displayed by this component.
+	 *
+	 *
A TextFlow is the most important class
+	 *  in the Text Layout Framework.
+	 *  It is the root of a tree of FlowElements
+	 *  representing rich text content.

+	 *
+	 *  @default
+	 */
+	public function get textFlow():TextFlow
+	{
+		// We might not have a valid _textFlow for two reasons:
+		// either because the 'text' was set (which is the state
+		// after construction) or because the 'content' was set.
+		if (!_textFlow)
+		{
+			if (_content != null)
+				_textFlow = createTextFlowFromContent(_content);
+			else
+				_textFlow = staticPlainTextImporter.importToFlow(_text);
+		}
+
+		return _textFlow;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set textFlow(value:TextFlow):void
+	{
+		// Treat setting the 'textFlow' to null
+		// as if 'text' were being set to the empty String
+		// (which is the default state).
+		if (value == null)
+		{
+			text = "";
+			return;
+		}
+
+		if (value == _textFlow)
+			return;
+
+		_textFlow = value;
+		textFlowChanged = true;
+
+		// If more than one of 'text', 'textFlow', and 'content' is set,
+		// the last one set wins.
+		textChanged = false;
+		contentChanged = false;
+
+		// The other two are now invalid and must be recalculated when needed.
+		_text = null
+		_content = null;
+
+		factory = staticTextFlowFactory;
+
+		invalidateTextLines();
+		invalidateProperties();
+		invalidateSize();
+		invalidateDisplayList();
+	}
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods: GraphicElement
+    //
+    //--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	override protected function commitProperties():void
+    {
+    	super.commitProperties();
+
+    	// Only one of textChanged, textFlowChanged, and contentChanged
+    	// will be true; the other two will be false because each setter
+    	// guarantees this.
+    	if (textChanged)
+    	{
+			// If the text has linebreaks (CR, LF, or CF+LF)
+			// create a multi-paragraph TextFlow from it
+			// and use the TextFlowTextLineFactory to render it.
+			// Otherwise the StringTextLineFactory will put
+			// all of the lines into a single paragraph
+			// and FTE performance will degrade on a large paragraph.
+			if (_text.indexOf("\n") != -1 || _text.indexOf("\r") != -1)
+			{
+				_textFlow = staticPlainTextImporter.importToFlow(_text);
+				factory = staticTextFlowFactory;
+			}
+			textChanged = false;
+    	}
+    	else if (textFlowChanged)
+    	{
+    		// Nothing to do at commitProperties() time.
+    		textFlowChanged = false;
+    	}
+    	else if (contentChanged)
+    	{
+			_textFlow = createTextFlowFromContent(_content);
+			contentChanged = false;
+    	}
+
+    	// At this point we know which TextLineFactory we're going to use
+    	// and we know the _text or _textFlow that it will compose.
+
+		var oldEmbeddedFontContext:IFlexModuleFactory = embeddedFontContext;
+
+		// If the CSS styles for this component specify an embedded font,
+		// embeddedFontContext will be set to the module factory that
+		// should create TextLines (since they must be created in the
+		// SWF where the embedded font is.)
+		// Otherwise, this will be null.
+		embeddedFontContext = getEmbeddedFontContext();
+
+		if (embeddedFontContext != oldEmbeddedFontContext)
+		{
+			staticTextFlowFactory.textLineCreator =
+				ITextLineCreator(embeddedFontContext)
+			staticStringFactory.textLineCreator =
+				ITextLineCreator(embeddedFontContext)
+		}
+
+		// If the styles have changed, hostFormat will have
+		// been set to null to indicate that it is invalid.
+		// In that case, create a new one.
+		if (!hostFormat)
+		{
+			hostFormat = new CSSTextLayoutFormat(this);
+			// Note: CSSTextLayoutFormat has special processing
+			// for the fontLookup style. If it is "auto",
+			// the fontLookup format is set to either
+			// "device" or "embedded" depending on whether
+			// embeddedFontContext is null or non-null.
+		}
+
+		if (_textFlow)
+		{
+			// We might have a new TextFlow, or a new hostFormat,
+			// so attach the latter to the former.
+			_textFlow.hostFormat = hostFormat;
+
+			if (_textFlow.flowComposer)
+			{
+				_textFlow.flowComposer.textLineCreator =
+					staticTextFlowFactory.textLineCreator;
+			}
+		}
+	}
+
+    /**
+     *  @private
+     */
+    override public function stylesInitialized():void
+    {
+        super.stylesInitialized();
+
+		// The old hostFormat is invalid
+		// and a new one must be created.
+		hostFormat = null;
     }
-
-    //--------------------------------------------------------------------------
-    //
-    //  Overridden methods: GraphicElement
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  @private
-     */
-    override public function stylesInitialized():void
-    {
-        super.stylesInitialized();
-
-        hostFormatChanged = true;
-    }

     /**
      *  @private
@@ -499,392 +688,151 @@
     {
         super.styleChanged(styleProp);

-        hostFormatChanged = true;
-    }
-
-    //--------------------------------------------------------------------------
-    //
-    //  Overridden methods: TextGraphicElement
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  @private
-     */
-    override mx_internal function invalidateTextLines(cause:String):void
-    {
-        super.invalidateTextLines(cause);
-
-        if (cause == "text")
-            textChanged = true;
-        else if (cause == "content")
-            contentChanged = true;
-    }
-
-    //--------------------------------------------------------------------------
-    //
-    //  Methods
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  @private
-     */
-    private function getEmbeddedFontContext():IFlexModuleFactory
-    {
-		var moduleFactory:IFlexModuleFactory;
-
-		var fontLookup:String = getStyle("fontLookup");
-		if (fontLookup != FontLookup.DEVICE)
-        {
-			var font:String = getStyle("fontFamily");
-			var bold:Boolean = getStyle("fontWeight") == "bold";
-			var italic:Boolean = getStyle("fontStyle") == "italic";
-
-            moduleFactory = embeddedFontRegistry.getAssociatedModuleFactory(
-            	font, bold,	italic,
-                this, fontContext);
-
-            // If we found the font, then it is embedded.
-            // But some fonts are not listed in info()
-            // and are therefore not in the above registry.
-            // So we call isFontFaceEmbedded() which gets the list
-            // of embedded fonts from the player.
-            if (!moduleFactory)
-            {
-                var sm:ISystemManager;
-                if (fontContext != null && fontContext is ISystemManager)
-                	sm = ISystemManager(fontContext);
-                else if (parent is IUIComponent)
-                	sm = IUIComponent(parent).systemManager;
-
-                staticTextFormat.font = font;
-                staticTextFormat.bold = bold;
-                staticTextFormat.italic = italic;
-
-                if (sm != null && sm.isFontFaceEmbedded(staticTextFormat))
-                    moduleFactory = sm;
-            }
-        }
-
-        if (!moduleFactory && fontLookup == FontLookup.EMBEDDED_CFF)
-        {
-            // if we couldn't find the font and somebody insists it is
-            // embedded, try the default fontContext
-            moduleFactory = fontContext;
-        }
-
-        return moduleFactory;
-    }
-
-    /**
-     *  @private
-     */
-    private function createEmptyTextFlow():TextFlow
-    {
-        var textFlow:TextFlow = new TextFlow();
-        var p:ParagraphElement = new ParagraphElement();
-        var span:SpanElement = new SpanElement();
-        textFlow.replaceChildren(0, 0, p);
-        p.replaceChildren(0, 0, span);
-        return textFlow;
-    }
-
-    /**
-     *  @private
-     *  Make 1 paragraph text flow.  We can not use the PLAIN_TEXT_FORMAT filter
-     *  because each newline starts a new paragraph.
-     */
-    private function convertTextToContent():TextFlow
-    {
-        textFlow = new TextFlow();
-
-        var p:ParagraphElement = new ParagraphElement();
-        textFlow.replaceChildren(0, 0, p);
-
-        var span:SpanElement = new SpanElement();
-        span.text = _text;
-        p.replaceChildren(0, 0, span);
-
-        // Set formats and textLineCreator.
-        textFlow = createTextFlow();
-
-        return textFlow;
-    }
-
-    /**
-     *  @private
-     */
-    private function createTextFlowFromMarkup(markup:Object):TextFlow
-    {
-        if (markup is XML || markup is String)
-        {
-	        // We need to wrap the markup in a <TextFlow> tag
-	        // unless it already has one.
-	        // Note that we avoid trying to convert it to XML
-	        // (in order to test whether the outer tag is <TextFlow>)
-	        // unless it contains the substring "TextFlow".
-            // And if we have to do the conversion, then
-            // we use the markup in XML form rather than
-            // having TLF reconvert it to XML.
-	        var wrap:Boolean = true;
-            if (markup is XML || markup.indexOf("TextFlow") != -1)
-            {
-                try
-                {
-                    var xmlMarkup:XML = XML(markup);
-                    if (xmlMarkup.localName() == "TextFlow")
-                    {
-                        wrap = false;
-                        markup = xmlMarkup;
-                    }
-                }
-                catch(e:Error)
-                {
-                }
-            }
-
-	        if (wrap)
-	        {
-	            if (markup is String)
-	            {
-                    markup =
-                        '<TextFlow xmlns="http://ns.adobe.com/textLayout/2008">' +
-                        markup +
-                        '</TextFlow>';
-                }
-                else
-                {
-                    // It is XML.  Create a root element and add the markup
-                    // as it's child.
-                    var ns:Namespace =
-                        new Namespace("http://ns.adobe.com/textLayout/2008");
-
-                    xmlMarkup = <TextFlow />;
-                    xmlMarkup.setNamespace(ns);
-                    xmlMarkup.setChildren(markup);
-
-                    // The namespace of the root node is not inherited by
-                    // the children so it needs to be explicitly set on
-                    // every element, at every level.  If this is not done
-                    // the import will fail with an "Unexpected namespace"
-                    // error.
-                    for each (var element:XML in xmlMarkup..*::*)
-                       element.setNamespace(ns);
-
-                    markup = xmlMarkup;
-                }
-	        }
-        }
-
-        return importToFlow(markup, TextFilter.TEXT_LAYOUT_FORMAT);
-    }
-
-    /**
-     *  @private
-     */
-    private function createTextFlowFromChildren(children:Array):TextFlow
-    {
-        var textFlow:TextFlow = new TextFlow();
-
-        // The whiteSpaceCollapse format determines how whitespace
-        // is processed when the children are set.
-        staticTextLayoutFormat.whiteSpaceCollapse =
-            getStyle("whiteSpaceCollapse");
-        textFlow.hostFormat = staticTextLayoutFormat;
-
-        textFlow.mxmlChildren = children;
-
-        return textFlow;
-    }
-
-    /**
-     *  @private
-     *  Keep this method in sync with the same method in RichEditableText.
-     */
-    private function createTextFlow():TextFlow
-    {
-        if (contentChanged)
-        {
-            if (_content is TextFlow)
-            {
-                textFlow = TextFlow(_content);
-            }
-            else if (_content is Array)
-            {
-                textFlow = createTextFlowFromChildren(_content as Array);
-            }
-            else if (_content is FlowElement)
-            {
-                textFlow = createTextFlowFromChildren([ _content ]);
-            }
-	        else if (_content is String || _content is XML)
-            {
-                textFlow = createTextFlowFromMarkup(_content);
-            }
-            else if (_content == null)
-            {
-                textFlow = createEmptyTextFlow();
-            }
-            else
-            {
-                textFlow = createTextFlowFromMarkup(_content.toString());
-            }
-            textInvalid = true;
-        }
-        else if (textChanged)
-        {
-            if (textHasLineBreaks())
-	            textFlow = createTextFlowFromText(_text);
-            else
-            	textFlow = null;
-        }
-
-        contentChanged = false;
-        textChanged = false;
-
-        var oldEmbeddedFontContext:IFlexModuleFactory = embeddedFontContext;
-
-        // If the CSS styles for this component specify an embedded font,
-        // embeddedFontContext will be set to the module factory that
-        // should create TextLines (since they must be created in the
-        // SWF where the embedded font is.)
-        // Otherwise, this will be null.
-        embeddedFontContext = getEmbeddedFontContext();
-
-        if (embeddedFontContext != oldEmbeddedFontContext)
-        {
-            staticTextFlowFactory.textLineCreator =
-                ITextLineCreator(embeddedFontContext)
-            staticStringFactory.textLineCreator =
-                ITextLineCreator(embeddedFontContext)
-        }
-
-        if (hostFormatChanged)
-        {
-        	hostFormat = new CSSTextLayoutFormat(this);
-        		// Note: CSSTextLayoutFormat has special processing
-        		// for the fontLookup style. If it is "auto",
-        		// the fontLookup format is set to either
-        		// "device" or "embedded" depending on whether
-        		// embeddedFontContext is null or non-null.
-
-        	hostFormatChanged = false;
-        }
-
-        if (textFlow)
-        {
-            textFlow.hostFormat = hostFormat;
-
-            // There should always be a composer but be safe.
-            if (textFlow.flowComposer)
-            {
-                textFlow.flowComposer.textLineCreator =
-                    staticTextFlowFactory.textLineCreator;
-            }
-        }
-
-        return textFlow;
-    }
-
-    /**
-     *  @private
-     */
-    private function textHasLineBreaks():Boolean
-    {
-    	return text.indexOf("\n") != -1 ||
-    		   text.indexOf("\r") != -1;
-    }
-
-    /**
-     *  @private
-	 *  Splits 'text' into paragraphs on \n, etc.
-     */
-    private function createTextFlowFromText(text:String):TextFlow
-    {
-    	var importer:ITextImporter =
-    		TextFilter.getImporter(TextFilter.PLAIN_TEXT_FORMAT);
-
-    	return importer.importToFlow(text);
-    }
-
-    /**
-     *  @private
-     *  This will throw on import error.
-     */
-    private function importToFlow(source:Object, format:String):TextFlow
-    {
-        // The whiteSpaceCollapse format determines how whitespace
-        // is processed when markup is imported.
-        staticTextLayoutFormat.whiteSpaceCollapse =
-            getStyle("whiteSpaceCollapse");
-
-        var importer:ITextImporter = TextFilter.getImporter(format,
-                                                            staticConfiguration);
-
-        // Throw import errors rather than return a null textFlow.
-        // Alternatively, the error strings are in the Vector, importer.errors.
-        importer.throwOnError = true;
-
-        return importer.importToFlow(source);
-    }
-
-    /**
-     *  @private
-     *  Returns true to indicate all lines were composed.
-     */
-    override mx_internal function composeTextLines(width:Number = NaN,
+        // The old hostFormat is invalid
+        // and a new one must be created.
+        hostFormat = null;
+
+		invalidateTextLines();
+		invalidateProperties();
+		invalidateSize();
+		invalidateDisplayList();
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Overridden methods: TextGraphicElement
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 *  Returns true to indicate all lines were composed.
+	 */
+	override mx_internal function composeTextLines(width:Number = NaN,
 												   height:Number = NaN):Boolean
-    {
-        super.composeTextLines(width, height);
-
-        // Don't want this handler firing when we're re-composing the text lines.
-        if (textFlow)
-        {
-            textFlow.removeEventListener(DamageEvent.DAMAGE,
-                                         textFlow_damageHandler);
-        }
-
-
-        textFlow = createTextFlow();
-        _content = textFlow;
-
+	{
+		super.composeTextLines(width, height);
+
+		// Don't want this handler firing when we're re-composing the text lines.
+		if (factory is TextFlowTextLineFactory && _textFlow != null)
+		{
+			_textFlow.removeEventListener(DamageEvent.DAMAGE,
+										  textFlow_damageHandler);
+		}
+
+
 		// Set the composition bounds to be used by createTextLines().
 		// If the width or height is NaN, it will be computed by this method
 		// by the time it returns.
 		// The bounds are then used by the addTextLines() method
 		// to determine the isOverset flag.
 		// The composition bounds are also reported by the measure() method.
-        bounds.x = 0;
-        bounds.y = 0;
-        bounds.width = isNaN(width) ? maxWidth : width;
-        bounds.height = height;
-
-        removeTextLines();
-        releaseTextLines();
-
-        createTextLines();
-
-        addTextLines(DisplayObjectContainer(drawnDisplayObject));
-
-        // Figure out if the text overruns the available space for composition.
-        isOverset = isTextOverset(width, height);
-
+		bounds.x = 0;
+		bounds.y = 0;
+		bounds.width = isNaN(width) ? maxWidth : width;
+		bounds.height = height;
+
+		removeTextLines();
+		releaseTextLines();
+
+		createTextLines();
+
+		addTextLines(DisplayObjectContainer(drawnDisplayObject));
+
+		// Figure out if the text overruns the available space for composition.
+		isOverset = isTextOverset(width, height);
+
 		// Just recomposed so reset.
-        invalidateCompose = false;
-
-        // Listen for "damage" events in case the textFlow is
-        // modified programatically.
-        if (textFlow)
-        {
-            textFlow.addEventListener(DamageEvent.DAMAGE,
-                                      textFlow_damageHandler);
-        }
-
-        // Created all lines.
-        return true;
+		invalidateCompose = false;
+
+		// Listen for "damage" events in case the textFlow is
+		// modified programatically.
+		if (factory is TextFlowTextLineFactory && _textFlow != null)
+		{
+			_textFlow.addEventListener(DamageEvent.DAMAGE,
+									   textFlow_damageHandler);
+		}
+
+		// Created all lines.
+		return true;
+	}
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private function createTextFlowFromContent(content:Object):TextFlow
+    {
+        var textFlow:TextFlow = new TextFlow();
+
+        // The whiteSpaceCollapse format determines how whitespace
+        // is processed when the children are set.
+        staticTextLayoutFormat.whiteSpaceCollapse =
+            getStyle("whiteSpaceCollapse");
+        textFlow.hostFormat = staticTextLayoutFormat;
+
+        textFlow.mxmlChildren = content is Array ?
+        						content as Array :
+        						[ content ];
+
+        return textFlow;
     }
-
+
+	/**
+	 *  @private
+	 */
+	private function getEmbeddedFontContext():IFlexModuleFactory
+	{
+		var moduleFactory:IFlexModuleFactory;
+
+		var fontLookup:String = getStyle("fontLookup");
+		if (fontLookup != FontLookup.DEVICE)
+		{
+			var font:String = getStyle("fontFamily");
+			var bold:Boolean = getStyle("fontWeight") == "bold";
+			var italic:Boolean = getStyle("fontStyle") == "italic";
+
+			moduleFactory = embeddedFontRegistry.getAssociatedModuleFactory(
+				font, bold,	italic,
+				this, fontContext);
+
+			// If we found the font, then it is embedded.
+			// But some fonts are not listed in info()
+			// and are therefore not in the above registry.
+			// So we call isFontFaceEmbedded() which gets the list
+			// of embedded fonts from the player.
+			if (!moduleFactory)
+			{
+				var sm:ISystemManager;
+				if (fontContext != null && fontContext is ISystemManager)
+					sm = ISystemManager(fontContext);
+				else if (parent is IUIComponent)
+					sm = IUIComponent(parent).systemManager;
+
+				staticTextFormat.font = font;
+				staticTextFormat.bold = bold;
+				staticTextFormat.italic = italic;
+
+				if (sm != null && sm.isFontFaceEmbedded(staticTextFormat))
+					moduleFactory = sm;
+			}
+		}
+
+		if (!moduleFactory && fontLookup == FontLookup.EMBEDDED_CFF)
+		{
+			// if we couldn't find the font and somebody insists it is
+			// embedded, try the default fontContext
+			moduleFactory = fontContext;
+		}
+
+		return moduleFactory;
+	}
+
 	/**
 	 *  @private
 	 *  Uses TextLineFactory to compose the textFlow
@@ -895,12 +843,6 @@
 		// Clear any previously generated TextLines from the textLines Array.
 		textLines.length = 0;

-		var factory:TextLineFactoryBase;
-		if (textFlow)
-            factory = staticTextFlowFactory;
-		else
-            factory = staticStringFactory;
-
 		// Note: Even if we have nothing to compose, we nevertheless
 		// use the StringTextLineFactory to compose an empty string.
 		// Since it appends the paragraph terminator "\u2029",
@@ -912,29 +854,29 @@

         // Set up the truncation options.
         var truncationOptions:TruncationOptions;
-        if (truncation != 0)
+        if (maxDisplayedLines != 0)
         {
             truncationOptions = new TruncationOptions();
-            truncationOptions.lineCountLimit = truncation;
+            truncationOptions.lineCountLimit = maxDisplayedLines;
             truncationOptions.truncationIndicator =
                 TextGraphicElement.truncationIndicatorResource;
         }
 		factory.truncationOptions = truncationOptions;

-        if (textFlow)
+        if (factory is StringTextLineFactory)
         {
-            staticTextFlowFactory.createTextLines(addTextLine, textFlow);
+			// We know text is non-null since it got this far.
+			staticStringFactory.text = _text;
+			staticStringFactory.textFlowFormat = hostFormat;
+			staticStringFactory.createTextLines(addTextLine);
+		}
+        else if (factory is TextFlowTextLineFactory)
+        {
+            staticTextFlowFactory.createTextLines(addTextLine, _textFlow);
         }
-        else
-        {
-            // We know text is non-null since it got this far.
-            staticStringFactory.text = _text;
-            staticStringFactory.textFlowFormat = hostFormat;
-            staticStringFactory.createTextLines(addTextLine);
-        }

         bounds = factory.contentBounds;
-        isTextTruncated = factory.isTruncated;
+        _isTruncated = factory.isTruncated;
     }

     /**
@@ -958,16 +900,23 @@
      *  to indicate it has been modified.  This could mean the styles changed
      *  or the content changed, or both changed.
      */
-    private function textFlow_damageHandler(
-                            event:DamageEvent):void
+    private function textFlow_damageHandler(event:DamageEvent):void
     {
         //trace("damageHandler", "damageStart", event.damageStart, "damageLength", event.damageLength);

-        // Invalidate text.
-        textInvalid = true;
+        // Invalidate _text and _content.
+        _text = null;
+        _content = null;
+
+        // After the TextFlow has been mutated,
+        // we must render it, not the 'text' String.
+        factory = staticTextFlowFactory;

         // Force recompose since text and/or styles may have changed.
-        invalidateCompose = true;
+        invalidateTextLines();
+
+        // We don't need to call invalidateProperties()
+        // because the hostFormat and the _textFlow are still valid.

         // This is smart enough not to remeasure if the explicit width/height
         // were specified.


Transferred from the Adobe Open Source Subversion Repository

Revision: 3341
Author:   rfrishbe@adobe.com
Date:     2008-09-24T23:10:20.245436Z

Log Message:
-----------
Changing the definition of some methods in SkinnableComponent.  So instead of:

protected function partAdded(partName:String, instance:*):void

We now have:

protected function partAdded(partName:String, instance:Object):void

Technically this just means we can't support the value of "undefined" anymore.  This change was made to partAdded(), partRemoved(), createPartInstance(), removePartInstance(), and getDyanamicPartAt().

As I was making these changes in all the files that override these methods, I noticed Slider should have a partRemoved() method, so I added it.

I also made a minor change in Selector where there was a bug in the dataProvider collectionChange eventHandler.  Basically we were doing remove code on replace rather than remove.

QE: Yes - This will break (as in, it won't compile) some tests in SkinnableComponent.  Joann will change them soon after I checkin.
Doc: Yes
Bugs: SDK-16640, SDK-16709
Reviewer: Hans

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/DataComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/Spinner.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TrackBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/core/SkinnableComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/Selector.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/ItemsComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/flex/component/Scroller.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1280408 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/components/Scroller.as
+++ frameworks/projects/spark/src/spark/components/Scroller.as
@@ -331,7 +331,7 @@
     /**
      *  @private
      */
-    override protected function partAdded(partName:String, instance:*):void
+    override protected function partAdded(partName:String, instance:Object):void
     {
         super.partAdded(partName, instance);

@@ -349,7 +349,7 @@
     /**
      *  @private
      */
-    override protected function partRemoved(partName:String, instance:*):void
+    override protected function partRemoved(partName:String, instance:Object):void
     {
         super.partRemoved(partName, instance);


Transferred from the Adobe Open Source Subversion Repository

Revision: 22692
Author:   eday@adobe.com
Date:     2011-09-22T21:56:30.262778Z

Log Message:
-----------
Fix for nested scroller problem

Allow interaction ownership to switch to a different scroller as long as scrolling is not in progress, rather than requiring that the scrollbars have completely faded out.  This makes nested scrolling much more responsive.

QE notes:
Doc notes:
Bugs: SDK-31537
Reviewer: Glenn
Tests run: checkintests, mobile List tests on Android, Cyclone server
Is noteworthy for integration: no

Modified Paths:
--------------
/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/Scroller.as

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1280551 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/components/Scroller.as
+++ frameworks/projects/spark/src/spark/components/Scroller.as
@@ -3130,7 +3130,7 @@
         // if it's someone else and we've started scrolling, cancel this event
         // if it's someone else and we haven't started scrolling, don't do anything
         // here yet. Worry about it in the touchInteractionStartHandler().
-        if (event.relatedObject != this && (horizontalScrollInProgress || verticalScrollInProgress))
+        if (event.relatedObject != this && inTouchInteraction)
         {
             event.preventDefault();
         }


Transferred from the Adobe Open Source Subversion Repository

Revision: 8486
Author:   smgilson@adobe.com
Date:     2009-07-09T18:42:45.734868Z

Log Message:
-----------
Third checkin to update the namespace in ASDoc MXML syntax descriptions for Spark components

QE Notes: None
Doc Notes: None
Bugs: -
Checkintests: passed

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DropDownList.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Group.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/PopUpAnchor.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ButtonBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DataRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/HGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RadioButtonGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/ToggleButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Spinner.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VideoPlayer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/CheckBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/TrackBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/HSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/HScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Panel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Application.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/SkinnableDataContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VSlider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/SkinnableContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/VScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/ItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/Range.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DataGroup.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1280885 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/components/TextArea.as
+++ frameworks/projects/spark/src/spark/components/TextArea.as
@@ -126,7 +126,7 @@
  *
  *  @mxml
  *
- *
The <TextArea> tag inherits all of the tag
+ *
The <s:TextArea> tag inherits all of the tag
  *  attributes of its superclass and adds the following tag attributes:

  *
  *


Transferred from the Adobe Open Source Subversion Repository

Revision: 6609
Author:   gruehle@adobe.com
Date:     2009-05-04T22:47:31.285324Z

Log Message:
-----------
Add theme attribute to theme-specific style metadata.

Example of a halo-specific style:
[Style(name="cornerRadius", type="Number", format="Length", inherit="no", theme="halo")]

Example of a spark-specific style:
[Style(name="baseColor", type="uint", format="Color", inherit="yes", theme="spark")]

Style metadata without a theme attribute is theme-agnostic, and works with either spark or halo.

Bugs: SDK-20606

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Scroller.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ProgressBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/FillStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateChooser.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ButtonBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Container.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/NumericStepper.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/SkinStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/Button.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ColorPicker.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/TextArea.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/BorderStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/Spinner.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DateField.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/BarColorStyle.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/CheckBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/Application.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/CheckBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/IconColorStyles.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/RadioButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/PopUpButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/scrollClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/containers/Panel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/metadata/SelectedFillColorsStyle.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/colorPickerClasses/SwatchPanel.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/TextInput.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/SkinnableDataContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/ComboBox.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/SkinnableContainer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/TextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DataGrid.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/ScrollControlBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/sliderClasses/Slider.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/GroupBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/SkinnableComponent.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1280863 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/components/TextArea.as
+++ frameworks/projects/spark/src/spark/components/TextArea.as
@@ -31,7 +31,7 @@
  *  @playerversion AIR 1.5
  *  @productversion Flex 4
  */
-[Style(name="symbolColor", type="uint", format="Color", inherit="yes")]
+[Style(name="symbolColor", type="uint", format="Color", inherit="yes", theme="spark")]

 [DefaultProperty("content")]


made the code easier to debug

made the code easier to debug

Change-Id: I4e02e4f03c5e1e7c535ad48e147e57576f01f5fe

--- WeaveData/src/weave/data/KeySets/SortedKeySet.as
+++ WeaveData/src/weave/data/KeySets/SortedKeySet.as
@@ -139,10 +139,9 @@
 					column = columns[i] as IAttributeColumn;
 					if (!column)
 						continue;
-					result = ObjectUtil.numericCompare(
-						column.getValueFromKey(key1, Number),
-						column.getValueFromKey(key2, Number)
-					);
+					var value1:* = column.getValueFromKey(key1, Number);
+					var value2:* = column.getValueFromKey(key2, Number);
+					result = ObjectUtil.numericCompare(value1, value2);
 					if (result != 0)
 					{
 						if (desc[i])


add stage3dId argument to Viewport constructor

--- src/aerys/minko/render/Viewport.as
+++ src/aerys/minko/render/Viewport.as
@@ -33,6 +33,7 @@
 		private var _stage3d			: Stage3D			= null;
 		private var _context3d			: Context3DResource	= null;

+		private var _stage3dId			: uint				= 0;
 		private var _width				: uint				= 0;
 		private var _height				: uint				= 0;
 		private var _autoResize			: Boolean			= false;
@@ -202,13 +203,13 @@
 		}

 		public function Viewport(antiAliasing	: uint	= 0,
+								 stage3dId		: uint	= 0,
 								 width			: uint 	= 0,
 								 height			: uint	= 0)
 		{
+			_stage3dId = stage3dId;
 			_antiAliasing = antiAliasing;
-
-			if (width == 0 && height == 0)
-				_autoResize = true;
+			_autoResize = width == 0 && height == 0;

 			_width = width;
 			_height = height;
@@ -232,7 +233,6 @@

 			stage.addEventListener(Event.ADDED_TO_STAGE, displayObjectAddedToStageHandler);
 			stage.addEventListener(Event.REMOVED_FROM_STAGE, displayObjectRemovedFromStageHandler);
-
 			stage.addEventListener(Event.RESIZE, stageResizedHandler);

 			setupOnStage(stage);
@@ -246,14 +246,13 @@

 			stage.removeEventListener(Event.ADDED_TO_STAGE, displayObjectAddedToStageHandler);
 			stage.removeEventListener(Event.REMOVED_FROM_STAGE, displayObjectRemovedFromStageHandler);
-
 			stage.removeEventListener(Event.RESIZE, stageResizedHandler);

 			if (_stage3d != null)
 				_stage3d.visible = false;
 		}

-		private function setupOnStage(stage : Stage, stage3dId : uint = 0) : void
+		private function setupOnStage(stage : Stage) : void
 		{
 			if (_autoResize)
 			{
@@ -263,7 +262,7 @@

 			if (!_stage3d)
 			{
-				_stage3d = stage.stage3Ds[stage3dId];
+				_stage3d = stage.stage3Ds[_stage3dId];
 				_stage3d.addEventListener(Event.CONTEXT3D_CREATE, context3dCreatedHandler);
 				_stage3d.requestContext3D();
 			}


Transferred from the Adobe Open Source Subversion Repository

Revision: 3630
Author:   chaase@adobe.com
Date:     2008-10-14T19:00:10.268869Z

Log Message:
-----------
Fix for sdk-17327. Change to automatically apply end state values when effects finished tripped up in ListBase because the List data effects had already cleaned up after themselves (nulling out some properties) by the time applyEndValues(0 was called. This ended up deref'ing one of these null values and RTE'ing.
The fix is to change when these end values are being applied. Instead of doing it at the end of Effect.effectEndHandler(), which is after the effect end event is dispatched to all listeners, we do it at the beginning of that function instead, while the effect is still in its active state.

reviewed by Jason
tests: checkintests, Mustella (tests/Effects, tests/gumbo/Effects, tests/ListDataEffects)

Modified Paths:
--------------
/flex/sdk/trunk/frameworks/projects/framework/src/mx/effects/Effect.as

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1260155 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/framework/src/mx/effects/Effect.as
+++ frameworks/projects/framework/src/mx/effects/Effect.as
@@ -1422,15 +1422,16 @@
      */
     protected function effectEndHandler(event:EffectEvent):void
     {
-        var instance:IEffectInstance = IEffectInstance(event.effectInstance);
-
-        deleteInstance(instance);
-
-        dispatchEvent(event);
-
         // Transitions should set the end values when done
         if (applyEndValuesWhenDone)
             applyEndValues(mx_internal::propertyChangesArray, targets);
+
+        var instance:IEffectInstance = IEffectInstance(event.effectInstance);
+
+        deleteInstance(instance);
+
+        dispatchEvent(event);
+
     }

 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 8
Author:   open-source-svn-admin@adobe.com
Date:     2007-12-15T01:49:31.087529Z

Log Message:
-----------
The beginning of the open-source Flex SDK.

Populated the flex/sdk/trunk directory with an open-source subset of files from //depot/flex/sdk/...@191097 in the Faramir Perforce server. This changelist is a bit past the 3.0rc0 build.

The Ant scripts will not successfully build yet. They need to be adapted to the open-source subset.

Modified Paths:
--------------
2532 paths were modified

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1274483 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/rpc/src/mx/rpc/wsdl/WSDLMessage.as
+++ frameworks/projects/rpc/src/mx/rpc/wsdl/WSDLMessage.as
@@ -0,0 +1,162 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2006-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.rpc.wsdl
+{
+
+[ExcludeClass]
+
+/**
+ * From the WSDL 1.1 specification:
+ *
+ * <blockquote>
+ * Messages consist of one or more logical parts. Each part is associated with
+ * a type from some type system using a message-typing attribute. The set of
+ * message-typing attributes is extensible.
+ * </blockquote>
+ *
+ * @private
+ */
+public class WSDLMessage
+{
+    public function WSDLMessage(name:String = null)
+    {
+        super();
+
+        this.name = name;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    // Variables
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * The SOAP encoding extensions for this message.
+     */
+    public var encoding:WSDLEncoding;
+
+    /**
+     * Whether this message is using .NET wrapped style for document literal
+     * requests.
+     */
+    public var isWrapped:Boolean;
+
+    /**
+     * The unique name of this message.
+     */
+    public var name:String;
+
+    /**
+     * An Array of message parts which describe the parameters of this
+     * message and the order in which they were specified. By default each of
+     * these parameters appear in a SOAP Envelope's Body section.
+     */
+    public var parts:Array;
+
+    /**
+     * The QName of the element wrapper if the message is to be encoded using
+     * .NET document-literal wrapped style.
+     */
+    public var wrappedQName:QName;
+
+
+    //--------------------------------------------------------------------------
+    //
+    // Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     * Add a part to this message. The parts Array tracks the order in which
+     * parts were added; an internal map allows a part to be located by name.
+     * @see #getPart(String)
+     */
+    public function addPart(part:WSDLMessagePart):void
+    {
+        if (_partsMap == null)
+            _partsMap = {};
+
+        if (parts == null)
+            parts = [];
+
+        _partsMap[part.name.localName] = part;
+        parts.push(part);
+    }
+
+    /**
+     * Locates a message part by name.
+     */
+    public function getPart(name:String):WSDLMessagePart
+    {
+        var part:WSDLMessagePart;
+
+        if (_partsMap != null)
+            part = _partsMap[name];
+
+        return part;
+    }
+
+    /**
+     * @private
+     */
+    public function addHeader(header:WSDLMessage):void
+    {
+        if (_headersMap == null)
+            _headersMap = {};
+
+        _headersMap[header.name] = header;
+    }
+
+    /**
+     * @private
+     */
+    public function getHeader(name:String):WSDLMessage
+    {
+        var header:WSDLMessage;
+
+        if (_headersMap != null)
+            header = _headersMap[name];
+
+        return header;
+    }
+
+    /**
+     * @private
+     */
+    public function addHeaderFault(headerFault:WSDLMessage):void
+    {
+        if (_headerFaultsMap == null)
+            _headerFaultsMap = {};
+
+        _headerFaultsMap[headerFault.name] = headerFault;
+    }
+
+    /**
+     * @private
+     */
+    public function getHeaderFault(name:String):WSDLMessage
+    {
+        var headerFault:WSDLMessage;
+
+        if (_headerFaultsMap != null)
+            headerFault = _headerFaultsMap[name];
+
+        return headerFault;
+    }
+
+    private var _partsMap:Object;
+    private var _headersMap:Object;
+    private var _headerFaultsMap:Object;
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 6006
Author:   dsubrama@adobe.com
Date:     2009-04-07T23:13:52.682149Z

Log Message:
-----------
-new property, labelText, added to IItemRenderer interface
-owning components always push the right text down to the renderer (ie: setting the labelText property)
-DataGroup, SkinnableDataContainer now implement IItemRendererOwner
-labelField/labelFunction work for ButtonBar

QA: Yes
Checkintests: Pass
Reviewer: Ryan

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/DataGroup.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/skins/default/DefaultItemRenderer.mxml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/List.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/ButtonBarButton.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/IItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ItemRenderer.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/ButtonBar.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/supportClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/components/SkinnableDataContainer.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1279570 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/components/List.as
+++ frameworks/projects/spark/src/spark/components/List.as
@@ -16,18 +16,17 @@
 import flash.geom.Point;
 import flash.ui.Keyboard;

-import spark.components.supportClasses.ListBase;
 import mx.core.ClassFactory;
+import mx.core.IVisualElement;
+import mx.events.FlexEvent;
+import mx.managers.IFocusManagerComponent;
+
 import spark.components.IItemRenderer;
-import spark.components.supportClasses.ItemRenderer;
-import mx.core.IVisualElement;
+import spark.components.supportClasses.ItemRenderer;
+import spark.components.supportClasses.ListBase;
 import spark.events.RendererExistenceEvent;
-import mx.events.FlexEvent;
 import spark.layout.HorizontalLayout;
 import spark.layout.VerticalLayout;
-import mx.managers.IFocusManagerComponent;
-import spark.skins.default.DefaultItemRenderer;
-

 /**
  *  @copy spark.components.supportClasses.GroupBase#alternatingItemColors
@@ -366,10 +365,9 @@

         var renderer:Object = dataGroup.getElementAt(index);

-        if (renderer)
-        {
-            if ("selected" in renderer)
-                renderer.selected = selected;
+        if (renderer is IItemRenderer)
+        {
+            IItemRenderer(renderer).selected = selected;
         }
     }

@@ -521,16 +519,10 @@
         if (renderer)
         {
         	renderer.addEventListener("click", item_clickHandler);
-        	renderer.addEventListener("dataChange", item_dataChangeHandler);
         	if (renderer is IVisualElement)
         		IVisualElement(renderer).owner = this;
-
-        	//If the labelElement part has been defined on the renderer,
-    		//push the right text in.
-        	if ((renderer is ItemRenderer) && (renderer.labelElement))
-        	{
-        		renderer.labelElement.text = itemToLabel(renderer.data);
-        	}
+            if (renderer is IItemRenderer)
+                IItemRenderer(renderer).labelText = itemToLabel(renderer.data);
         }

         if (isItemIndexSelected(index))
@@ -549,7 +541,6 @@
         if (renderer)
         {
             renderer.removeEventListener("click", item_clickHandler);
-            renderer.removeEventListener("dataChange", item_dataChangeHandler);
         }
     }

@@ -562,24 +553,6 @@
         // Multiple selection needs to be added here....

         selectedIndex = dataGroup.getElementIndex(event.currentTarget as IVisualElement);
-    }
-
-    /**
-     *  @private
-     *  Called when an item's data has changed.
-     */
-    private function item_dataChangeHandler(event:FlexEvent):void
-    {
-    	var renderer:Object = event.target;
-    	if (renderer)
-    	{
-    		//If the labelElement part has been defined on the renderer,
-    		//push the right text in based on the new data.
-        	if ((renderer is ItemRenderer) && (renderer.labelElement))
-        	{
-        		renderer.labelElement.text = itemToLabel(renderer.data);
-        	}
-     	}
     }

     /**


Transferred from the Adobe Open Source Subversion Repository

Revision: 19786
Author:   clucier@adobe.com
Date:     2011-01-17T21:50:08.259241Z

Log Message:
-----------
AnimateTransform based effects now overlay properly in parallel effects.

QE notes: None
Doc notes: None
Bugs: SDK-29032
Reviewer: Jason S.
Tests run: Cyclone Server
Is noteworthy for integration: None

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/effects/Move3D.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/effects/Scale3D.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/effects/Rotate3D.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/effects/Move.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/effects/Scale.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1283798 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/spark/src/spark/effects/Scale3D.as
+++ frameworks/projects/spark/src/spark/effects/Scale3D.as
@@ -322,18 +322,19 @@
      */
     override protected function initInstance(instance:IEffectInstance):void
     {
-        if (!applyChangesPostLayout)
-        {
-            addMotionPath("scaleX", scaleXFrom, scaleXTo, scaleXBy);
-            addMotionPath("scaleY", scaleYFrom, scaleYTo, scaleYBy);
-            addMotionPath("scaleZ", scaleZFrom, scaleZTo, scaleZBy);
-        }
-        else
-        {
-            addMotionPath("postLayoutScaleX", scaleXFrom, scaleXTo, scaleXBy);
-            addMotionPath("postLayoutScaleY", scaleYFrom, scaleYTo, scaleYBy);
-            addMotionPath("postLayoutScaleZ", scaleZFrom, scaleZTo, scaleZBy);
-        }
+        var xProp:String = applyChangesPostLayout ? "postLayoutScaleX" : "scaleX";
+        var yProp:String = applyChangesPostLayout ? "postLayoutScaleY" : "scaleY";
+        var zProp:String = applyChangesPostLayout ? "postLayoutScaleZ" : "scaleZ";
+
+        if (!(isNaN(scaleXFrom) && isNaN(scaleXTo) && isNaN(scaleXBy)))
+            addMotionPath(xProp, scaleXFrom, scaleXTo, scaleXBy);
+
+        if (!(isNaN(scaleYFrom) && isNaN(scaleYTo) && isNaN(scaleYBy)))
+            addMotionPath(yProp, scaleYFrom, scaleYTo, scaleYBy);
+
+        if (!(isNaN(scaleZFrom) && isNaN(scaleZTo) && isNaN(scaleZBy)))
+            addMotionPath(zProp, scaleZFrom, scaleZTo, scaleZBy);
+
         super.initInstance(instance);
     }


Fixed RTE in tests. It may be that the code in Divider box is incorrect and it confusing no dividers (= no of children-1) and number of children.

--- frameworks/projects/mx/src/mx/containers/DividedBox.as
+++ frameworks/projects/mx/src/mx/containers/DividedBox.as
@@ -538,7 +538,7 @@
            	if (!liveDragging && activeDivider)
            		return dividerLayer.numChildren-1;
            	else
-			return dividerLayer.numChildren;
+				return dividerLayer.numChildren;
 		else
 			return 0;
 	}
@@ -793,10 +793,10 @@
 	{
 		if (dividerLayer) {
 			// Check whether this is a valid divider index.
-			if (i < 0 || i >= numDividers)
+			if (i < 0 || i >= dividerLayer.numChildren)
 				return null;
-
-			return BoxDivider(dividerLayer.getChildAt(i));
+			else
+				return BoxDivider(dividerLayer.getChildAt(i));
 		}
 		else {
 			return null;


Transferred from the Adobe Open Source Subversion Repository

Revision: 3469
Author:   smgilson@adobe.com
Date:     2008-10-03T13:18:56.967661Z

Log Message:
-----------
Remove <blockquote> from ASDoc comments

Checkin Test Passed: Yes
QA: No
Bug:
Doc: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/rpc/src/mx/rpc/wsdl/WSDLMessage.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/PopUpMenuButton.as</path>

git-svn-id: 7146a936b37d36e51ea0d66f8acbe0b8281bc7b7@1274484 13f79535-47bb-0310-9956-ffa450edef68

--- frameworks/projects/rpc/src/mx/rpc/wsdl/WSDLMessage.as
+++ frameworks/projects/rpc/src/mx/rpc/wsdl/WSDLMessage.as
@@ -17,11 +17,9 @@
 /**
  * From the WSDL 1.1 specification:
  *
- * <blockquote>
  * Messages consist of one or more logical parts. Each part is associated with
  * a type from some type system using a message-typing attribute. The set of
  * message-typing attributes is extensible.
- * </blockquote>
  *
  * @private
  */