Transferred from the Adobe Open Source Subversion Repository

Revision: 13175
Author:   sameer@adobe.com
Date:     2009-12-23T05:47:48.947634Z

Log Message:
-----------
Updating data formats in AdvancedDataGrid as the drag and drop data format descriptors were renamed from "orderedItems" and "orderedItemsCaretIndex" to "itemsByIndex" and "caretIndex" respectively.

QE notes: verify drag-drop between AdvancedDataGrid and Spark List
Doc notes: None
Bugs: None
Reviewer: Sreeni
Tests run: None
Is noteworthy for integration: No

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/datavisualization/src/mx/controls/AdvancedDataGrid.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/datavisualization/src/mx/controls/listClasses/AdvancedListBase.as</path>

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

--- frameworks/projects/advancedgrids/src/mx/controls/listClasses/AdvancedListBase.as
+++ frameworks/projects/advancedgrids/src/mx/controls/listClasses/AdvancedListBase.as
@@ -6902,10 +6902,10 @@
 		dragSource.addHandler(copySelectedItems, "items");

 		// The Spark drag drop data format
-		dragSource.addHandler(copySelectedItemsForDragDrop, "orderedItems");
+		dragSource.addHandler(copySelectedItemsForDragDrop, "itemsByIndex");

 		// Calculate the index of the focus item within the vector
-		// of ordered items returned for the "orderedItems" format.
+		// of ordered items returned for the "itemsByIndex" format.
 		var caretIndex:int = 0;
 		var draggedIndices:Array = selectedIndices;
 		var count:int = draggedIndices.length;
@@ -6914,7 +6914,7 @@
 			if (mouseDownIndex > draggedIndices[i])
 				caretIndex++;
 		}
-		dragSource.addData(caretIndex, "orderedItemsCaretIndex");
+		dragSource.addData(caretIndex, "caretIndex");
     }

     /**
@@ -7133,15 +7133,15 @@

 	/**
 	 *  @private
-	 *  Insert for drag and drop, handles the Spark "orderedItems" data format.
+	 *  Insert for drag and drop, handles the Spark "itemsByIndex" data format.
 	 */
-	private function insertOrderedItems(dropIndex:int, dragSource:DragSource, event:DragEvent):void
+	private function insertItemsByIndex(dropIndex:int, dragSource:DragSource, event:DragEvent):void
 	{
-		var items:Vector.<Object> = dragSource.dataForFormat("orderedItems") as Vector.<Object>;
+		var items:Vector.<Object> = dragSource.dataForFormat("itemsByIndex") as Vector.<Object>;

 		// Copy or move the items. No need to check whether the operation is
 		// reorder within this list, as ListBase never creates the
-		// "orderedItems" data format. This is a new data format from Spark List only.
+		// "itemsByIndex" data format. This is a new data format from Spark List only.
 		collectionIterator.seek(CursorBookmark.FIRST, dropIndex);
 		var count:int = items.length;
 		for (var i:int = 0; i < count; i++)
@@ -9635,7 +9635,7 @@
 		lastDragEvent = event;

         if (enabled && iteratorValid &&
-			(event.dragSource.hasFormat("items")  || event.dragSource.hasFormat("orderedItems")))
+			(event.dragSource.hasFormat("items")  || event.dragSource.hasFormat("itemsByIndex")))
         {
             DragManager.acceptDragDrop(this);
             DragManager.showFeedback(event.ctrlKey ? DragManager.COPY : DragManager.MOVE);
@@ -9668,7 +9668,7 @@
 		lastDragEvent = event;

         if (enabled && iteratorValid &&
-			(event.dragSource.hasFormat("items") || event.dragSource.hasFormat("orderedItems")))
+			(event.dragSource.hasFormat("items") || event.dragSource.hasFormat("itemsByIndex")))
         {
             DragManager.showFeedback(event.ctrlKey ? DragManager.COPY : DragManager.MOVE);
             showDropFeedback(event);
@@ -9729,7 +9729,7 @@
 			return;

 		var dragSource:DragSource = event.dragSource;
-		if (!dragSource.hasFormat("items") && !dragSource.hasFormat("orderedItems"))
+		if (!dragSource.hasFormat("items") && !dragSource.hasFormat("itemsByIndex"))
 			return;

         if (!dataProvider)
@@ -9741,7 +9741,7 @@
 		if (dragSource.hasFormat("items"))
 			insertItems(dropIndex, dragSource, event);
 		else
-			insertOrderedItems(dropIndex, dragSource, event);
+			insertItemsByIndex(dropIndex, dragSource, event);

 		lastDragEvent = null;
     }
@@ -9769,6 +9769,10 @@
             if (event.relatedObject != this)
             {
                 var indices:Array = selectedIndices;
+
+				// clear the selection, otherwise we'll be adjusting it on every element being removed
+				clearSelected(false);
+
                 indices.sort(Array.NUMERIC);
                 var n:int = indices.length;
                 for (var i:int = n - 1; i >= 0; i--)


Transferred from the Adobe Open Source Subversion Repository

Revision: 7306
Author:   aharui@adobe.com
Date:     2009-05-27T14:54:00.080376Z

Log Message:
-----------
Fix another pair of mustella failures from the frame1 cleanup

QE Notes: None
Doc Notes: None
Bugs: SDK-21386
Reviewer: corey
tests: checkintests mustella/MarshallPlan

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/systemClasses/ActiveWindowManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/systemClasses/ChildManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/managers/systemClasses/MarshallPlan.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/StyleManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/styles/CSSStyleDeclaration.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/SWFLoader.as</path>

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

--- frameworks/projects/framework/src/mx/managers/systemClasses/MarshallingSupport.as
+++ frameworks/projects/framework/src/mx/managers/systemClasses/MarshallingSupport.as
@@ -35,6 +35,7 @@
 import mx.events.SWFBridgeRequest;
 import mx.core.EventPriority;
 import mx.core.IChildList;
+import mx.core.IFlexDisplayObject;
 import mx.core.IFlexModuleFactory;
 import mx.core.IRawChildrenContainer;
 import mx.core.ISWFBridgeGroup;
@@ -48,7 +49,8 @@
 import mx.managers.IFocusManagerContainer;
 import mx.managers.IMarshalSystemManager;
 import mx.managers.PopUpManagerChildList;
-import mx.managers.SystemManager;
+import mx.managers.ISystemManager;
+import mx.managers.ISystemManagerChildManager;
 import mx.managers.SystemManagerGlobals;
 import mx.managers.SystemManagerProxy;
 import mx.utils.EventUtil;
@@ -89,7 +91,7 @@
          *  Flash Player instantiates an instance of this class,
 	 *  causing this constructor to be called.</p>
 	 */
-	public function MarshallPlan(systemManager:SystemManager = null)
+	public function MarshallPlan(systemManager:ISystemManager = null)
 	{
 		super();

@@ -115,6 +117,9 @@
 		awm.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);

+		childManager =
+			ISystemManagerChildManager(systemManager.getImplementation("mx.managers::ISystemManagerChildManager"));
+
 		if (useSWFBridge())
 		{
 			// create a bridge so we can talk to our parent.
@@ -169,7 +174,12 @@
 	/**
 	 *  @private
 	 */
-	private var systemManager:SystemManager;
+	private var systemManager:ISystemManager;
+
+	/**
+	 *  @private
+	 */
+	private var childManager:ISystemManagerChildManager;

 	//----------------------------------
@@ -197,11 +207,11 @@
      */
     mx_internal function get bridgeToFocusManager():Dictionary
     {
-        if (systemManager.topLevel)
+        if (Object(systemManager).mx_internal::topLevel)
             return _bridgeToFocusManager;
         else if (systemManager.topLevelSystemManager)
         {
-            var topMP:MarshallPlan = MarshallPlan(SystemManager(systemManager.topLevelSystemManager).
+            var topMP:MarshallPlan = MarshallPlan(systemManager.topLevelSystemManager.
                         getImplementation("mx.managers::IMarshalSystemManager"));
             return topMP.bridgeToFocusManager;
         }
@@ -210,11 +220,11 @@

     mx_internal function set bridgeToFocusManager(bridgeToFMDictionary:Dictionary):void
     {
-        if (systemManager.topLevel)
+        if (Object(systemManager).mx_internal::topLevel)
             _bridgeToFocusManager = bridgeToFMDictionary;
         else if (systemManager.topLevelSystemManager)
         {
-            var topMP:MarshallPlan = MarshallPlan(SystemManager(systemManager.topLevelSystemManager).
+            var topMP:MarshallPlan = MarshallPlan(systemManager.topLevelSystemManager.
                         getImplementation("mx.managers::IMarshalSystemManager"));
             topMP.bridgeToFocusManager = bridgeToFMDictionary;
         }
@@ -386,19 +396,19 @@
 				}
 				else
 				{
-					systemManager.$addEventListener(MouseEvent.MOUSE_MOVE, resetMouseCursorTracking, true, EventPriority.CURSOR_MANAGEMENT + 1, true);
+                    Object(systemManager).mx_internal::$addEventListener(MouseEvent.MOUSE_MOVE, resetMouseCursorTracking, true, EventPriority.CURSOR_MANAGEMENT + 1, true);
 				}

 				addEventListenerToSandboxes(type, sandboxMouseListener, useCapture, priority, useWeakReference);
 				if (!SystemManagerGlobals.changingListenersInOtherSystemManagers)
 					addEventListenerToOtherSystemManagers(type, otherSystemManagerMouseListener, useCapture, priority, useWeakReference)
 				if (systemManager.getSandboxRoot() == systemManager)
-                    systemManager.$addEventListener(actualType, eventProxy.marshalListener,
+                    Object(systemManager).mx_internal::$addEventListener(actualType, eventProxy.marshalListener,
                             useCapture, priority, useWeakReference);

 				// Set useCapture to false because we will never see an event
 				// marshalled in the capture phase.
-                systemManager.$addEventListener(type, listener, false, priority, useWeakReference);
+                Object(systemManager).mx_internal::$addEventListener(type, listener, false, priority, useWeakReference);
                 return false;
 			}
 		}
@@ -454,12 +464,12 @@
 			if (actualType)
 			{
                 if (systemManager.getSandboxRoot() == systemManager && eventProxy)
-                    systemManager.$removeEventListener(actualType, eventProxy.marshalListener,
+                    Object(systemManager).mx_internal::$removeEventListener(actualType, eventProxy.marshalListener,
                             useCapture);
 				if (!SystemManagerGlobals.changingListenersInOtherSystemManagers)
 					removeEventListenerFromOtherSystemManagers(type, otherSystemManagerMouseListener, useCapture);
 				removeEventListenerFromSandboxes(type, sandboxMouseListener, useCapture);
-				systemManager.$removeEventListener(type, listener, false);
+                Object(systemManager).mx_internal::$removeEventListener(type, listener, false);
 				return false;
 			}
 		}
@@ -1441,7 +1451,7 @@
 	private function setActualSizeRequestHandler(event:Event):void
 	{
 		var eObj:Object = Object(event);
-		systemManager.setActualSize(eObj.data.width, eObj.data.height);
+		IFlexDisplayObject(systemManager).setActualSize(eObj.data.width, eObj.data.height);
 	}

 	/**
@@ -1453,7 +1463,7 @@
 	private function getSizeRequestHandler(event:Event):void
 	{
 		var eObj:Object = Object(event);
-		eObj.data = { width: systemManager.measuredWidth, height: systemManager.measuredHeight};
+		eObj.data = { width: IFlexDisplayObject(systemManager).measuredWidth, height: IFlexDisplayObject(systemManager).measuredHeight};
 	}

 	/**
@@ -1785,12 +1795,12 @@
 		}
 		else
 		{
-			systemManager.childManager.addingChild(child);
+			childManager.addingChild(child);
 			var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST);
 			me.name = layer + ".addChild";
 			me.value = child;
 			systemManager.getSandboxRoot().dispatchEvent(me);
-			systemManager.childManager.childAdded(child);
+			childManager.childAdded(child);
 		}
 	}

@@ -1811,12 +1821,12 @@
 		}
 		else
 		{
-			systemManager.childManager.removingChild(child);
+			childManager.removingChild(child);
 			var me:InterManagerRequest = new InterManagerRequest(InterManagerRequest.SYSTEM_MANAGER_REQUEST);
 			me.name = layer + ".removeChild";
 			me.value = child;
 			systemManager.getSandboxRoot().dispatchEvent(me);
-			systemManager.childManager.childRemoved(child);
+			childManager.childRemoved(child);
 		}
 	}

@@ -1869,7 +1879,7 @@
 			event["value"] = systemManager.screen;
 			break;
 		case "application":
-		    event["value"] = systemManager.application;
+		    event["value"] = systemManager.document;
 		    break;
 		case "isTopLevelRoot":
 		    event["value"] = systemManager.isTopLevelRoot();
@@ -1907,7 +1917,7 @@
     	if (sandboxRoot == systemManager)
     		// we don't have access the stage so use the width and
     		// height of the application.
-   			sandboxScreen = new Rectangle(0, 0, systemManager.width, systemManager.height);
+   			sandboxScreen = new Rectangle(0, 0, IFlexDisplayObject(systemManager).width, IFlexDisplayObject(systemManager).height);
     	else if (sandboxRoot == systemManager.topLevelSystemManager)
     	{
     		var sm:DisplayObject = DisplayObject(systemManager.topLevelSystemManager);
@@ -2708,7 +2718,7 @@
 				}
 				else
 				{
-					systemManager.$addEventListener(MouseEvent.MOUSE_MOVE, resetMouseCursorTracking, true, EventPriority.CURSOR_MANAGEMENT + 1, true);
+                    Object(systemManager).mx_internal::$addEventListener(MouseEvent.MOUSE_MOVE, resetMouseCursorTracking, true, EventPriority.CURSOR_MANAGEMENT + 1, true);
 				}

                 // add listeners in other sandboxes in capture mode so we don't miss anything
@@ -2725,7 +2735,7 @@
                             false, request.priority, request.useWeakReference);
 				    }

-                    systemManager.$addEventListener(actualType, eventProxy.marshalListener,
+                    Object(systemManager).mx_internal::$addEventListener(actualType, eventProxy.marshalListener,
                         true, request.priority, request.useWeakReference);
                 }
 			}
@@ -2746,7 +2756,7 @@
                         systemManager.stage.removeEventListener(actualType, eventProxy.marshalListener);
                     }

-                    systemManager.$removeEventListener(actualType, eventProxy.marshalListener, true);
+                    Object(systemManager).mx_internal::$removeEventListener(actualType, eventProxy.marshalListener, true);
                 }
             }
         }
@@ -2755,10 +2765,10 @@
 	private function Stage_resizeHandler(event:Event = null):void
 	{
        	var sandboxScreen:Rectangle = getSandboxScreen();
-		if (!systemManager._screen)
-			systemManager._screen = new Rectangle();
-       	systemManager._screen.width = sandboxScreen.width;
-       	systemManager._screen.height = sandboxScreen.height;
+        if (!Object(systemManager).mx_internal::_screen)
+            Object(systemManager).mx_internal::_screen = new Rectangle();
+       	Object(systemManager).mx_internal::_screen.width = sandboxScreen.width;
+       	Object(systemManager).mx_internal::_screen.height = sandboxScreen.height;
 	}

  	/**


Transferred from the Adobe Open Source Subversion Repository

Revision: 22584
Author:   mhorn@adobe.com
Date:     2011-09-15T20:31:21.235617Z

Log Message:
-----------
asdoc updates

Modified Paths:
--------------
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobiletheme/src/spark/skins/mobile/DateSpinnerSkin.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/calendarClasses/DateSpinnerItemRenderer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/SpinnerList.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/mobilecomponents/src/spark/components/SpinnerListContainer.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/4.y/frameworks/projects/spark/src/spark/components/calendarClasses/DateSelectorDisplayMode.as</path>

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

--- frameworks/projects/mobilecomponents/src/spark/components/SpinnerListContainer.as
+++ frameworks/projects/mobilecomponents/src/spark/components/SpinnerListContainer.as
@@ -11,9 +11,11 @@
 package spark.components
 {
 /**
- *  Container for one or more SpinnerLists. The SpinnerLists are laid out horizontally.
+ *  Container for one or more SpinnerList controls. The SpinnerLists are laid out horizontally.
  *  The SpinnerListContainerSkin displays a frame, shadow gradients and a selection indicator.
- *
+ *
+ * @see spark.components.SpinnerList
+ *
  *  @includeExample examples/SpinnerListExample.mxml -noswf
  *  @includeExample examples/SpinnerListContainerExample.mxml -noswf
  *
@@ -27,16 +29,16 @@

 public class SpinnerListContainer extends SkinnableContainer
 {
-	/**
-	 *  Constructor.
-	 *
-	 *  @langversion 3.0
-	 *  @playerversion AIR 3
-	 *  @productversion Flex 4.6
-	 */
-	public function SpinnerListContainer()
-	{
-		super();
-	}
+    /**
+     *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 3
+     *  @productversion Flex 4.6
+     */
+    public function SpinnerListContainer()
+    {
+        super();
+    }
 }
 }


Transferred from the Adobe Open Source Subversion Repository

Revision: 21036
Author:   chiedozi@adobe.com
Date:     2011-04-07T00:09:17.862320Z

Log Message:
-----------
Fixed an issue in SlideViewTransition where includeInLayout wasn't properly restored on the initial view.

QE notes:
Doc notes:
Bugs: SDK-30128
Reviewer: Tom
Tests run: checkintests-mobile
Is noteworthy for integration:

Modified Paths:
--------------
/private/flex/sdk/trunk/frameworks/projects/mobilecomponents/src/spark/transitions/SlideViewTransition.as

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

--- frameworks/projects/mobilecomponents/src/spark/transitions/SlideViewTransition.as
+++ frameworks/projects/mobilecomponents/src/spark/transitions/SlideViewTransition.as
@@ -304,8 +304,11 @@

         if (startView)
         {
+            startViewProps = {  includeInLayout: startView.includeInLayout,
+                                visible: startView.visible,
+                                cacheAsBitmap: startView.cacheAsBitmap };
+
             cachedStartViewGlobalPosition = getTargetNavigatorCoordinates(startView);
-            navigatorProps.startViewIncludeInLayout = startView.includeInLayout;
             startView.includeInLayout = false;
         }
     }
@@ -330,12 +333,11 @@

         if (startView)
         {
-            startViewProps = { includeInLayout:startView.includeInLayout,
-                               cacheAsBitmap:startView.cacheAsBitmap,
-                               x:startView.x,
-                               y:startView.y};
-
-            startView.includeInLayout = false;
+            // Store the original x and y position of the view so that we can restore
+            // it after the animation
+            startViewProps.x = startView.x,
+            startViewProps.y = startView.y;
+
             startView.cacheAsBitmap = true;

             if (startView.contentGroup)
@@ -692,13 +694,18 @@
      */
     override protected function cleanUp():void
     {
+        if (startView)
+        {
+            startView.includeInLayout = startViewProps.includeInLayout;
+            startView.visible = startViewProps.visible;
+            startView.cacheAsBitmap = startViewProps.cacheAsBitmap;
+        }
+
         // Restore original saved properties for includeInLayout and cacheAsBitmap.
         if (!consolidatedTransition)
         {
             if (startView)
             {
-                startView.includeInLayout = startViewProps.includeInLayout;
-                startView.cacheAsBitmap = startViewProps.cacheAsBitmap;
                 startView.x = startViewProps.x;
                 startView.y = startViewProps.y;

@@ -707,7 +714,6 @@
                     startView.contentGroup.includeInLayout = startViewProps.cgIncludeInLayout;
                     startView.contentGroup.cacheAsBitmap = startViewProps.cgCacheAsBitmap;
                 }
-                startViewProps = null;
             }

             if (endView)
@@ -727,12 +733,6 @@
         }
         else
         {
-
-            if (startView && mode == SlideViewTransitionMode.COVER)
-            {
-                startView.visible = startViewProps.visible;
-            }
-
             if (tabBar)
             {
                 tabBar.includeInLayout = navigatorProps.tabBarIncludeInLayout;
@@ -747,7 +747,6 @@

             if (startView)
             {
-                startView.includeInLayout = navigatorProps.startViewIncludeInLayout;
                 startView.contentGroup.cacheAsBitmap = navigatorProps.startViewCacheAsBitmap;
                 startView.setLayoutBoundsPosition(navigatorProps.startViewX, navigatorProps.startViewY);
             }
@@ -786,6 +785,7 @@
         cachedNavigator = null;
         cachedActionBar = null;
         cachedTabBar = null;
+        startViewProps = null;

         super.cleanUp();
     }


build

build

--- testSrc/TestStream.as
+++ testSrc/TestStream.as
@@ -103,14 +103,14 @@
             assertEquals(primitiveClone[0], 1);
             assertEquals(primitiveClone[1], 2);
             assertEquals(primitiveClone[2], 3);
-            assertFalse(primitiveClone == primitive);
+            assertFalse(primitiveClone === primitive);

             var primitiveCloneDeep:Stream = primitive.clone(true);
             assertEquals(primitiveCloneDeep.length, 3);
             assertEquals(primitiveCloneDeep[0], 1);
             assertEquals(primitiveCloneDeep[1], 2);
             assertEquals(primitiveCloneDeep[2], 3);
-            assertFalse(primitiveCloneDeep == primitive);
+            assertFalse(primitiveCloneDeep === primitive);
         }

         [Test]
@@ -124,26 +124,34 @@
             var objectClone:Stream = object.clone();
             assertEquals(objectClone.length, 2);

-            assertEquals(Item(objectClone[0]), item1);
+            assertTrue(Item(objectClone[0]) === item1);
             assertEquals(Item(objectClone[0]).name, item1.name);
             assertEquals(Item(objectClone[0]).price, item1.price);
             assertEquals(Item(objectClone[0]).vat, item1.vat);

-            assertEquals(Item(objectClone[1]), item2);
+            assertTrue(Item(objectClone[0]) === item1);
             assertEquals(Item(objectClone[1]).name, item2.name);
             assertEquals(Item(objectClone[1]).price, item2.price);
             assertEquals(Item(objectClone[1]).vat, item2.vat);

+            assertFalse(objectClone === object);
+            assertFalse(objectClone.source === object.source);
+
             var objectCloneDeep:Stream = object.clone(true);
             assertEquals(objectCloneDeep.length, 2);

+            assertFalse(Item(objectCloneDeep[0]) === item1);
             assertEquals(Item(objectCloneDeep[0]).name, item1.name);
             assertEquals(Item(objectCloneDeep[0]).price, item1.price);
             assertEquals(Item(objectCloneDeep[0]).vat, item1.vat);

+            assertFalse(Item(objectCloneDeep[0]) === item1);
             assertEquals(Item(objectCloneDeep[1]).name, item2.name);
             assertEquals(Item(objectCloneDeep[1]).price, item2.price);
             assertEquals(Item(objectCloneDeep[1]).vat, item2.vat);
+
+            assertFalse(objectCloneDeep === object);
+            assertFalse(objectCloneDeep.source === object.source);
         }

         [Test]


Transferred from the Adobe Open Source Subversion Repository

Revision: 12796
Author:   cframpto@adobe.com
Date:     2009-12-10T18:05:16.265768Z

Log Message:
-----------
Because TLF does not have the concept of "auto" fontLookup like we have at the Flex-level, we have had to rework the meaning of the fontLookup attribute so it is possible to have spans with device text in a component whose fontLookup is "embeddedCFF" without requiring fontLookup "device" to be explicitly specified for those spans.

For Spark text components, the default fontLookup has been changed from "auto" to "embeddedCFF".  The default fontFamily is "Arial".

If the component level fontLookup either defaults to "embeddedCFF" or is explicitly set to "embeddedCFF", for each element that is not explicitly set to fontLookup "device", it will first look for the embedded font, and failing that, will fail back to the device font.  All fonts for a given text component must be in the same swf context.

If the component-level fontLookup is "device" or the component-level fontFamily is not found in the swf context, the font lookup for all elements in the component will revert to "device".

If the player doesn't find the device font it will fallback to one of the builtin default fonts.

QE notes: probably need some new mustella tests to cover all the cases - 5 RichText truncation tests fail but I'm not sure this change has anything to do with that
Doc notes:
Bugs: SDK-24470
Reviewer: Gordon
Tests run: checkintests, TextArea, Label, RichText
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/supportClasses/TextBase.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/RichText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/EmbeddedFontRegistry.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/utils/TextUtil.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Label.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/spark/defaults.css</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/spark/src/spark/components/RichEditableText.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/IEmbeddedFontRegistry.as</path>

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

--- frameworks/projects/framework/src/mx/core/UIComponent.as
+++ frameworks/projects/framework/src/mx/core/UIComponent.as
@@ -1343,7 +1343,7 @@
      *  Single registry in the system.
      *  Used to look up the moduleFactory of a font.
      */
-    private static function get embeddedFontRegistry():IEmbeddedFontRegistry
+    mx_internal static function get embeddedFontRegistry():IEmbeddedFontRegistry
     {
         if (!_embeddedFontRegistry && !noEmbeddedFonts)
         {


Transferred from the Adobe Open Source Subversion Repository

Revision: 23243
Author:   cframpto@adobe.com
Date:     2011-12-20T00:59:57.384047Z

Log Message:
-----------
In frameworks, remove Adobe headers from all files except xml/mxml file types.  There are also a few .txt files that are license files that I didn't touch yet.

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

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

--- frameworks/projects/spark/src/spark/components/HGroup.as
+++ frameworks/projects/spark/src/spark/components/HGroup.as
@@ -1,13 +1,3 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2008 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 spark.components
 {


Transferred from the Adobe Open Source Subversion Repository

Revision: 23247
Author:   cframpto@adobe.com
Date:     2011-12-20T19:21:13.134833Z

Log Message:
-----------
Remove ADOBE SYSTEMS license and replace with Apache license in headers - frameworks.  A 2nd pass will be needed to get the files not handled up by the scripts.

Modified Paths:
--------------
4959 paths were modified

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

--- frameworks/projects/spark/src/spark/components/TabBar.as
+++ frameworks/projects/spark/src/spark/components/TabBar.as
@@ -1,11 +1,19 @@
 ////////////////////////////////////////////////////////////////////////////////
 //
-//  ADOBE SYSTEMS INCORPORATED
-//  Copyright 2008 Adobe Systems Incorporated
-//  All Rights Reserved.
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
 //
-//  NOTICE: Adobe permits you to use, modify, and distribute this file
-//  in accordance with the terms of the license agreement accompanying it.
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////


fix for report service

fix for report service

git-svn-id: 8a2ccb88241e16c78017770bc38d91d6d5396a5a@60459 6b8eccd3-e8c5-4e7d-8186-e12b5326b719

--- generator/sources/as3/delegates/QueuedRequestDelegate.as
+++ generator/sources/as3/delegates/QueuedRequestDelegate.as
@@ -55,7 +55,7 @@
 					resInd+= nActions;
 				}
 				else {
-					xml += result.result.item[resInd].children().toString();
+					xml += result.result.item[resInd].children().toXMLString();
 					resInd++;
 				}
 				xml +="</result></result>";


Transferred from the Adobe Open Source Subversion Repository

Revision: 2957
Author:   aharui@adobe.com
Date:     2008-08-22T09:01:31.559126Z

Log Message:
-----------
Changes from API Review

Highlights:

MarshalEvent -> SandboxRootRequest
MarshalMouseEvent -> SandboxRootMouseEvent
MarshalDragEvet -> SandboxRootDragEvent
SandboxBridgeEvent -> SWFBridgeEvent
SandboxBridgeRequest -> SWFBridgeRequest

Checkintests passed.  Mustella for Marshall Plan will certainly fail until tests updated to new APIs
Probably ok to merge to trunk.

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/events/EventListenerRequest.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/controls/Menu.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/managers/dragClasses/DragProxy.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/controls/Alert.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/managers/PopUpManagerImpl.as</path>
<path kind="file" action="D">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/managers/FocusDirection.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/controls/Button.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/controls/ColorPicker.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/events/PopUpRequest.as</path>
<path kind="file" action="D">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/events/SandboxBridgeEvent.as</path>
<path kind="file" action="A">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/events/SWFBridgeEvent.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/managers/systemClasses/EventProxy.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/controls/DateField.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/managers/ISystemManager.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/tools/dependencychecker/flex/tools/dependencychecker/FrameworkSwcDependencyRules.java</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/managers/DragManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/events/SizeRequest.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/controls/SWFLoader.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/airframework/src/mx/managers/NativeDragManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/events/FocusRequest.as</path>
<path kind="file" action="A">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/events/FocusRequestDirection.as</path>
<path kind="file" action="D">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/events/MarshalEvent.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/controls/scrollClasses/ScrollBar.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/controls/listClasses/ListBase.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/controls/PopUpButton.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/managers/ToolTipManagerImpl.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/containers/Panel.as</path>
<path kind="file" action="A">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/events/SandboxRootDragEvent.as</path>
<path kind="file" action="D">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/events/MarshalMouseEvent.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/managers/FocusManager.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/controls/ComboBox.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/managers/SystemManager.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/controls/scrollClasses/ScrollThumb.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/managers/SystemManagerProxy.as</path>
<path kind="file" action="A">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/events/SandboxRootRequest.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/utils/EventUtil.as</path>
<path kind="file" action="A">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/events/SandboxRootMouseEvent.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/managers/CursorManagerImpl.as</path>
<path kind="file" action="A">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/events/InvalidateRequestData.as</path>
<path kind="file" action="D">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/events/SandboxBridgeRequest.as</path>
<path kind="file" action="A">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/events/SWFBridgeRequest.as</path>
<path kind="file" action="D">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/events/MarshalDragEvent.as</path>
<path kind="file" action="M">/flex/sdk/branches/3.0.x/frameworks/projects/framework/src/mx/events/ModalWindowRequest.as</path>

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

--- frameworks/projects/framework/src/mx/events/InvalidateRequestData.as
+++ frameworks/projects/framework/src/mx/events/InvalidateRequestData.as
@@ -0,0 +1,51 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Copyright (C) 2003-2006 Adobe Macromedia Software LLC and its licensors.
+//  All Rights Reserved. The following is Source Code and is subject to all
+//  restrictions on such code as contained in the End User License Agreement
+//  accompanying this product.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package mx.events
+{
+
+/**
+ *  The InvalidateRequestData class defines constants for the values
+ *  of the data property of a SWFBridgeRequest object when
+ *
+ */
+public final class InvalidateRequestData
+{
+	include "../core/Version.as";
+
+	//--------------------------------------------------------------------------
+	//
+	//  Class constants
+	//
+	//--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  INVALIDATE request bits
+    //----------------------------------
+
+    /**
+     *  Bit to indicate the request handler should invalidate
+     *  their properties.
+     */
+    public static const PROPERTIES:uint = 0x0002;
+
+    /**
+     *  Bit to indicate the request handler should invalidate
+     *  their size.
+     */
+    public static const SIZE:uint = 0x0004;
+
+    /**
+     *  Bit to indicate the request handler should invalidate
+     *  their display list.
+     */
+    public static const DISPLAY_LIST:uint = 0x0001;
+}
+
+}


Transferred from the Adobe Open Source Subversion Repository

Revision: 18013
Author:   doug.lee@ssbbartgroup.com
Date:     2010-10-05T01:14:19.433978Z

Log Message:
-----------
Numerous dataGridAccImpl updates:
General:
	  Line endings fixed and locked to native.
	  Spacing issues fixed.
	  Several logical functions more centralized to avoid duplication.
	  Framework added for handling undisplayable rows/columns.
get_accState():
      Sets STATE_SYSTEM_SELECTABLE correctly again.  It was broken when the dgAccInfo object became a static instead of having one instance per DataGridAccImpl method invocation.  The fix, hackish though it may be, is to rerun dgAccInfo.setup() after every internal method call that resets its contents for a different childID.  There was one in get_accState() that caused this problem.
	  Sets STATE_SYSTEM_MULTISELECTABLE and STATE_SYSTEM_OFFSCREEN correctly.
      Returns accState instead of null when there are no columns, consistent with return behavior for other edge cases.
get_accDefaultAction:
      Header cell AccDefaultAction is now Click instead of Double Click, consistent with similar controls.
accSelect:
	  Much more completely implemented.
Events, get_accFocus, etc.:
	  GridSelectionEvents are translated more precisely into their corresponding MSAA events.
	  GridSelectionEvents are caught via SELECTION_CHANGE rather than SELECTIN=ON_CHANGING so they (1) don't happen too soon and (2) don't fire if the selection operation is blocked.
      Focus is now obtained directly from dataGrid.grid.caretRow/ColumnIndex instead of being tracked by a local instance structure.

QE notes:
Doc notes:
Bugs:
Reviewer: Gordon
Tests run: checkintests
Is noteworthy for integration: no

Modified Paths:
--------------
<path kind="dir" action="M">/private/flex/sdk/branches/hero_private</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/spark/src/spark/accessibility/DataGridAccImpl.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/src/mx/accessibility/AccImpl.as</path>
<path kind="file" action="M">/private/flex/sdk/branches/hero_private/frameworks/projects/framework/bundles/en_US/controls.properties</path>

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

--- frameworks/projects/spark/src/spark/accessibility/DataGridAccImpl.as
+++ frameworks/projects/spark/src/spark/accessibility/DataGridAccImpl.as
@@ -21,12 +21,13 @@
 import mx.resources.ResourceManager;
 import mx.resources.IResourceManager;
 import spark.components.DataGrid;
-import spark.components.Grid;
+import spark.components.Grid;
 import spark.components.supportClasses.GridSelectionMode;
 import spark.components.supportClasses.CellPosition;
 import spark.events.GridEvent;
 import spark.events.GridCaretEvent;
 import spark.events.GridSelectionEvent;
+import spark.events.GridSelectionEventKind;
 import spark.skins.spark.DefaultGridItemRenderer;

 use namespace mx_internal;
@@ -34,7 +35,7 @@
 /**
  *  DataGridAccImpl is a subclass of AccessibilityImplementation
  *  which implements accessibility for the DataGrid class.
- *
+ *
  *  @langversion 3.0
  *  @playerversion Flash 10
  *  @playerversion AIR 1.5
@@ -44,443 +45,555 @@
 {
     include "../core/Version.as";

-    private var focusedCell:CellPosition = new CellPosition();
-	// See the DataGridAccImpl constructor for why this is not initialized here.
-	private static var dgAccInfo:ItemAccInfo; // = new ItemAccInfo();
-
-	//--------------------------------------------------------------------------
-	//
-	//  Class methods
-	//
-	//--------------------------------------------------------------------------
-
-	/**
-	 *  Enables accessibility in the DataGrid class.
-	 *
-	 *
This method is called by application startup code
-	 *  that is autogenerated by the MXML compiler.
-	 *  Afterwards, when instances of DataGrid are initialized,
-	 *  their accessibilityImplementation property
-	 *  will be set to an instance of this class.

-	 *
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10
-	 *  @playerversion AIR 1.5
-	 *  @productversion Flex 4
-	 */
-	public static function enableAccessibility():void
-	{
-		DataGrid.createAccessibilityImplementation =
-			createAccessibilityImplementation;
-	}
-
-	/**
-	 *  @private
-	 *  Creates a DataGrid's AccessibilityImplementation object.
-	 *  This method is called from UIComponent's
-	 *  initializeAccessibility() method.
-	 */
-	mx_internal static function createAccessibilityImplementation(
-								component:UIComponent):void
-	{
-		component.accessibilityImplementation =
-			new DataGridAccImpl(component);
-	}
-
-	//--------------------------------------------------------------------------
-	//
-	//  Constructor
-	//
-	//--------------------------------------------------------------------------
-
-	/**
-	 *  Constructor.
-	 *
-	 *  @param master The UIComponent instance that this AccImpl instance
-	 *  is making accessible.
-	 *
-	 *  @langversion 3.0
-	 *  @playerversion Flash 10
-	 *  @playerversion AIR 1.5
-	 *  @productversion Flex 4
-	 */
-	public function DataGridAccImpl(master:UIComponent)
-	{
-		super(master);
-		// Normally this would not be done here, but at this writing,
-		// initializing dgAccInfo from its declaration line causes an RTE,
-		// apparently because the AS compiler does not yet detect a forward-ref
-		// problem that results in an incorrect initialization at run time.
-		// [DGL, 2010-09-07]
-		if (!dgAccInfo)
-			dgAccInfo = new ItemAccInfo();
-	}
-
-	//--------------------------------------------------------------------------
-	//
-	//  Overridden properties: AccImpl
-	//
-	//--------------------------------------------------------------------------
-
-	//----------------------------------
-	//  eventsToHandle
-	//----------------------------------
-
-	/**
-	 *  @private
-	 *	Array of events that we should listen for from the master component.
-	 */
-	override protected function get eventsToHandle():Array
-	{
-        return super.eventsToHandle.concat([GridSelectionEvent.SELECTION_CHANGING]);
-	}
-
-	//--------------------------------------------------------------------------
-	//
-	//  Overridden methods: AccessibilityImplementation
-	//
-	//--------------------------------------------------------------------------
-
-	/**
-	 *  @private
-	 *  Gets the role for the component.
-	 *
-	 *  @param childID Children of the component
-	 */
-	override public function get_accRole(childID:uint):uint
-	{
-		if (childID == 0)
-			// Get this out of the way quick; it's often requested by AT.
-			return role;
-		var dataGrid:DataGrid = DataGrid(master);
-        if (!dataGrid.columns)
-            return null;
-
-		if (childID <= dataGrid.columns.length && dataGrid.columnHeaderBar)
-			return AccConst.ROLE_SYSTEM_COLUMNHEADER;
-		else
-			// Same role for all childIDs regardless of mode (row or cell).
-			// Valid and invalid childIDs return this;
-			// this behavior is common to most list-based controls we've seen.
-			// [DGL, 2010-08-10]
-			return AccConst.ROLE_SYSTEM_LISTITEM;
-	}
-
-	/**
-	 *  @private
-	 *  IAccessible method for returning the state of the GridItem.
-	 *  States are predefined for all the components in MSAA.
-	 *  Values are assigned to each state.
-	 *  Depending upon the GridItem being Selected, Selectable, Invisible,
-	 *  Offscreen, a value is returned.
-	 *
-	 *  @param childID uint
-	 *
-	 *  @return State uint
-	 */
-	override public function get_accState(childID:uint):uint
-	{
-		var accState:uint = getState(childID);
-		if (childID <= 0)
-			return accState;
-
-		dgAccInfo.setup(master, childID);
+    // See the DataGridAccImpl constructor for why this is not initialized here.
+    private static var dgAccInfo:ItemAccInfo; // = new ItemAccInfo();
+
+    //--------------------------------------------------------------------------
+    //
+    //  Class methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Enables accessibility in the DataGrid class.
+     *
+     *
This method is called by application startup code
+     *  that is autogenerated by the MXML compiler.
+     *  Afterwards, when instances of DataGrid are initialized,
+     *  their accessibilityImplementation property
+     *  will be set to an instance of this class.

+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public static function enableAccessibility():void
+    {
+        DataGrid.createAccessibilityImplementation =
+            createAccessibilityImplementation;
+    }
+
+    /**
+     *  @private
+     *  Creates a DataGrid's AccessibilityImplementation object.
+     *  This method is called from UIComponent's
+     *  initializeAccessibility() method.
+     */
+    mx_internal static function createAccessibilityImplementation(
+                                component:UIComponent):void
+    {
+        component.accessibilityImplementation =
+            new DataGridAccImpl(component);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @param master The UIComponent instance that this AccImpl instance
+     *  is making accessible.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function DataGridAccImpl(master:UIComponent)
+    {
+        super(master);
+        // Normally this would not be done here, but at this writing,
+        // initializing dgAccInfo from its declaration line causes an RTE,
+        // apparently because the AS compiler does not yet detect a forward-ref
+        // problem that results in an incorrect initialization at run time.
+        // [DGL, 2010-09-07]
+        if (!dgAccInfo)
+            dgAccInfo = new ItemAccInfo();
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden properties: AccImpl
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  eventsToHandle
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Array of events that we should listen for from the master component.
+     */
+    override protected function get eventsToHandle():Array
+    {
+        return super.eventsToHandle.concat([GridSelectionEvent.SELECTION_CHANGE]);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods: AccessibilityImplementation
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Gets the role for the component.
+     *
+     *  @param childID Children of the component
+     */
+    override public function get_accRole(childID:uint):uint
+    {
+        if (childID == 0)
+            // Get this out of the way quick; it's often requested by AT.
+            return role;
+        dgAccInfo.setup(master, childID);
+        if (dgAccInfo.isInvalid || !dgAccInfo.dataGrid.columns)
+            return null;
+
+        if (dgAccInfo.isColumnHeader)
+            return AccConst.ROLE_SYSTEM_COLUMNHEADER;
+        else
+            // Same role for all childIDs regardless of mode (row or cell).
+            // Valid and invalid childIDs return this;
+            // this behavior is common to most list-based controls we've seen.
+            // [DGL, 2010-08-10]
+            return AccConst.ROLE_SYSTEM_LISTITEM;
+    }
+
+    /**
+     *  @private
+     *  IAccessible method for returning the state of the GridItem.
+     *  States are predefined for all the components in MSAA.
+     *  Values are assigned to each state.
+     *  Depending upon the GridItem being Selected, Selectable, Invisible,
+     *  Offscreen, a value is returned.
+     *
+     *  @param childID uint
+     *
+     *  @return State uint
+     */
+    override public function get_accState(childID:uint):uint
+    {
+        var accState:uint = getState(childID);
+        if (int(childID) <= 0)
+            return accState;
+
+        dgAccInfo.setup(master, childID);
         if (!dgAccInfo.dataGrid.columns)
-            return null;
-		if (dgAccInfo.isInvalid)
-			// Child ID out of bounds most likely.
-			return accState;
-		if (dgAccInfo.isColumnHeader)
-			// There are some states we don't allow for these.
-			return accState & ~(
-				AccConst.STATE_SYSTEM_FOCUSABLE
-				| AccConst.STATE_SYSTEM_SELECTABLE
-				| AccConst.STATE_SYSTEM_FOCUSED
-				| AccConst.STATE_SYSTEM_SELECTED
-			);
-
-		// We now have only rows and data cells to consider.
-
-		// Determine if this item is focused.
-		if (childID == get_accFocus())
-			accState |= AccConst.STATE_SYSTEM_FOCUSED;
-
-		// Anything (row or cell) is selectable unless selection is not allowed at all.
-		if (dgAccInfo.dataGrid.selectionMode != GridSelectionMode.NONE)
-			accState |= AccConst.STATE_SYSTEM_SELECTABLE;
-
-		// Figure out visibility and selectedness.
-
-		if (dgAccInfo.isCellMode)
-		{
-			var renderer:DefaultGridItemRenderer = DefaultGridItemRenderer(
-				dgAccInfo.dataGrid.grid.getItemRendererAt(dgAccInfo.rowIndex, dgAccInfo.columnIndex)
-			);
-			if (renderer && renderer.selected)
-				accState |= AccConst.STATE_SYSTEM_SELECTED;
-		}
-		else  // row mode
-		{
-			var items:Vector.<int> = dgAccInfo.dataGrid.selectedIndices;
-			if (items.indexOf(dgAccInfo.rowIndex) >= 0)
-				accState |= AccConst.STATE_SYSTEM_SELECTED;
-		}  // cell or row mode
-
-		return accState;
-	}
-
-	/**
-	 *  @private
-	 *  IAccessible method for executing the Default Action.
-	 *
-	 *  @param childID uint
-	 */
-	override public function accDoDefaultAction(childID:uint):void
-	{
-		dgAccInfo.setup(master, childID);
-		if (!dgAccInfo.dataGrid.columns || dgAccInfo.isInvalid)
-			return;
-
-		if (dgAccInfo.isColumnHeader)
-		{
-        	// TODO: Allow doDefaultAction to sort columns
-			return;
-		}
-
-		if (dgAccInfo.isCellMode)
-		{
-        	// TODO: Allow doDefaultAction to go into edit mode if editable
-            var cp:CellPosition = new CellPosition();
-            cp.columnIndex = dgAccInfo.columnIndex;
-            cp.rowIndex = dgAccInfo.rowIndex;
-            dgAccInfo.dataGrid.selectedCell = cp;
-			return;
-		}
-		else
-		{
-    		dgAccInfo.dataGrid.selectedIndex = dgAccInfo.itemIndex;
-			return;
-		}
-	}
-
-	/**
-	 *  @private
-	 *  Method to return an array of childIDs.
-	 *
-	 *  @return Array
-	 */
-	override public function getChildIDArray():Array
-	{
-		dgAccInfo.setup(master, 0);
+            return accState;
+        if (dgAccInfo.isInvalid)
+            // Child ID out of bounds most likely.
+            return accState;
+        if (dgAccInfo.isColumnHeader)
+        {
+            // isColumnHeader implies columnHeaderBar.visible is true.
+            // The below code remains in case it is ever decided to
+            // make invisible but present headerBars show up with childIDs.
+            /*
+            if (dgAccInfo.dataGrid.columnHeaderBar
+            && !dgAccInfo.dataGrid.columnHeaderBar.visible)
+                accState |= AccConst.STATE_SYSTEM_INVISIBLE;
+            */
+            if (dgAccInfo.dataGrid.columnHeaderBar
+            && !dgAccInfo.dataGrid.columnHeaderBar.getHeaderRendererAt(childID-1).visible)
+                accState |= AccConst.STATE_SYSTEM_OFFSCREEN;
+            // There are some states we don't allow for these.
+            return accState & ~(
+                AccConst.STATE_SYSTEM_FOCUSABLE
+                | AccConst.STATE_SYSTEM_SELECTABLE
+                | AccConst.STATE_SYSTEM_FOCUSED
+                | AccConst.STATE_SYSTEM_SELECTED
+            );
+        }
+
+        // We now have only rows and data cells to consider.
+
+        // Determine if this item is focused.
+        if (childID == get_accFocus())
+            accState |= AccConst.STATE_SYSTEM_FOCUSED;
+
+        // Must recalculate dgAccInfo here because get_accFocus() changed it.
+        dgAccInfo.setup(master, childID);
+
+        // Anything (row or cell) is selectable unless selection is not allowed at all.
+        var mode:String = dgAccInfo.dataGrid.selectionMode;
+        if (mode != GridSelectionMode.NONE)
+        {
+            accState |= AccConst.STATE_SYSTEM_SELECTABLE;
+            if (dgAccInfo.isMultiSelect)
+            {
+                accState |= AccConst.STATE_SYSTEM_MULTISELECTABLE;
+            }
+        }
+
+        // Figure out selectedness.
+        var isSelected:Boolean;
+        if (dgAccInfo.isCellMode)
+            isSelected = dgAccInfo.dataGrid.selectionContainsCell(
+                dgAccInfo.rowIndex,
+                dgAccInfo.columnIndex
+            );
+        else
+            isSelected = dgAccInfo.dataGrid.selectionContainsIndex(
+                dgAccInfo.rowIndex
+            );
+        if (isSelected)
+            accState |= AccConst.STATE_SYSTEM_SELECTED;
+
+        // Figure out visibility and offscreenness.
+        var rowIndex:int = dgAccInfo.rowIndex;
+        var columnIndex:int = dgAccInfo.columnIndex;
+        if (!dgAccInfo.isCellMode)
+            columnIndex = -1;
+        if (!dgAccInfo.dataGrid.grid.isCellVisible(rowIndex, columnIndex))
+            accState |= AccConst.STATE_SYSTEM_OFFSCREEN
+
+        return accState;
+    }
+
+    /**
+     *  @private
+     *  IAccessible method for returning the Default Action.
+     *
+     *  @param childID uint
+     *
+     *  @return DefaultAction String
+     */
+    override public function get_accDefaultAction(childID:uint):String
+    {
+        if (get_accRole(childID) == AccConst.ROLE_SYSTEM_COLUMNHEADER)
+            return "Click";;
+        return super.get_accDefaultAction(childID);
+    }
+
+    /**
+     *  @private
+     *  IAccessible method for executing the Default Action.
+     *
+     *  @param childID uint
+     */
+    override public function accDoDefaultAction(childID:uint):void
+    {
+        dgAccInfo.setup(master, childID);
+        if (!dgAccInfo.dataGrid.columns || dgAccInfo.isInvalid)
+            return;
+
+        if (dgAccInfo.isColumnHeader)
+        {
+            // TODO: Allow doDefaultAction to sort columns
+            return;
+        }
+
+        // TODO: Allow doDefaultAction to go into edit mode if editable
+        accSelect(AccConst.SELFLAG_TAKESELECTION | AccConst.SELFLAG_TAKEFOCUS, childID);
+    }
+
+    /**
+     *  @private
+     *  Method to return an array of childIDs.
+     *
+     *  @return Array
+     */
+    override public function getChildIDArray():Array
+    {
+        dgAccInfo.setup(master, 0);
         if (!dgAccInfo.dataGrid.columns)
             return null;
-		return createChildIDArray(dgAccInfo.maxChildID);
-	}
-
-	/**
-	 *  @private
-	 *  IAccessible method for returning the bounding box of the GridItem.
-	 *
-	 *  @param childID uint
-	 *
-	 *  @return Location Object
-	 */
-	override public function accLocation(childID:uint):*
-	{
-		dgAccInfo.setup(master, childID);
+        return createChildIDArray(dgAccInfo.maxChildID);
+    }
+
+    /**
+     *  @private
+     *  IAccessible method for returning the bounding box of the GridItem.
+     *
+     *  @param childID uint
+     *
+     *  @return Location Object
+     */
+    override public function accLocation(childID:uint):*
+    {
+        dgAccInfo.setup(master, childID);
         if (!dgAccInfo.dataGrid.columns)
             return null;
-        //var addHeader:int = dgAccInfo.dataGrid.columnHeaderBar.visible ? 1 : 0;
-		var row:int = dgAccInfo.rowIndex;
-
-        //row = index + addHeader;
-
-        //TODO: Fix location if off-screen, may be ok to actually expose location
-        //according to docs
-        /*if (row < dgAccInfo.dataGrid.scroller.viewport.verticalScrollPosition ||
-            row >= dgAccInfo.dataGrid.scroller.viewport.verticalScrollPosition + dgAccInfo.rowCount)
-        {
-            return null;
-        } */
-
         if (dgAccInfo.isInvalid)
             return null;
-
+        return dgAccInfo.boundingRect();
+    }
+
+    /**
+     *  @private
+     *  IAccessible method for returning the childFocus of the DataGrid.
+     *
+     *  @param childID uint
+     *
+     *  @return focused childID.
+     */
+    override public function get_accFocus():uint
+    {
+        dgAccInfo.setup(master, 0);
+        if (!dgAccInfo.dataGrid.columns || !dgAccInfo.dataGrid.dataProvider)
+            return null;
+
+        // TODO: handle editable
+
+        return dgAccInfo.childIDFromRowAndColumn(
+            dgAccInfo.dataGrid.grid.caretRowIndex,
+            dgAccInfo.dataGrid.grid.caretColumnIndex
+        );
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods: AccImpl
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  method for returning the name of the ListItem/DataGrid
+     *  which is spoken out by the screen reader
+     *  The ListItem should return the label as the name with m of n string and
+     *  DataGrid should return the name specified in the AccessibilityProperties.
+     *
+     *  @param childID uint
+     *
+     *  @return Name String
+     */
+    override protected function getName(childID:uint):String
+    {
+        if (int(childID) <= 0)
+            return null;
+        dgAccInfo.setup(master, childID);
+        if (dgAccInfo.isInvalid || !dgAccInfo.dataGrid.columns)
+            return null;
         if (dgAccInfo.isColumnHeader)
-            return dgAccInfo.dataGrid.columnHeaderBar.getElementAt(childID-1);
-
-        // TODO: return correct height for rows and cells as incorrect height
-        // is being returned
-        var renderer:Object;
-        renderer = dgAccInfo.dataGrid.grid.getItemRendererAt(dgAccInfo.rowIndex, dgAccInfo.columnIndex);
-        return renderer ? renderer : null;
-	}
-
-	/**
-	 *  @private
-	 *  IAccessible method for returning the childFocus of the DataGrid.
-	 *
-	 *  @param childID uint
-	 *
-	 *  @return focused childID.
-	 */
-	override public function get_accFocus():uint
-	{
-		dgAccInfo.setup(master, 0);
-        if (!dgAccInfo.dataGrid.columns || !dgAccInfo.dataGrid.dataProvider)
-            return null;
-
-        // TODO: handle editable
-
-		var index:int;
+            return dgAccInfo.dataGrid.columns.getItemAt(childID-1).headerText;
+        if (!dgAccInfo.dataGrid.dataProvider)
+            return null;
+
+        // We now have only rows and data cells to consider.
+
+        // String representation of row position.
+        var rowString:String = "";
+        if ((dgAccInfo.isCellMode && dgAccInfo.columnIndex == 0) || !dgAccInfo.isCellMode)
+        {
+            var resourceManager:IResourceManager = ResourceManager.getInstance();
+            rowString = resourceManager.getString("components", "rowMofN");
+            rowString = rowString.replace("%1", dgAccInfo.rowIndex + 1).replace("%2", dgAccInfo.rowCount);
+        }
+
+        // Construct the name to return.
+        var name:String = "";
+        // TODO: Should the types of these be more specific?
+        var rowObject:Object = dgAccInfo.dataGrid.dataProvider.getItemAt(dgAccInfo.rowIndex);
+        var columns:IList = dgAccInfo.dataGrid.columns;
         if (dgAccInfo.isCellMode)
         {
-            // TODO: consider handling case where no cell is select and only cell
-            // is focused and we don't have the focused cell because no caret
-            // change occurred.  Doesn't seem to cause an issue not to fix,
-            // returns list 0
-            if (focusedCell.columnIndex && focusedCell.rowIndex)
-			{
-                index = focusedCell.rowIndex*dgAccInfo.columnCount+focusedCell.columnIndex;
-			}
-            else  // no focused cell so use selection
-			{
-				var selectedCell:CellPosition = dgAccInfo.dataGrid.selectedCell;
-				if (!selectedCell)
-					return 0;
-	            index = selectedCell.rowIndex * dgAccInfo.columnCount +selectedCell.columnIndex;
-			}
-        }
-        else
-        {
-            index = (dgAccInfo.dataGrid.selectedIndex != -1) ? dgAccInfo.dataGrid.selectedIndex : 0;
-        }
-
-		return index >= 0 ? index + 1 + dgAccInfo.headerCount : 0;
-	}
-
-	//--------------------------------------------------------------------------
-	//
-	//  Overridden methods: AccImpl
-	//
-	//--------------------------------------------------------------------------
-
-	/**
-	 *  @private
-	 *  method for returning the name of the ListItem/DataGrid
-	 *  which is spoken out by the screen reader
-	 *  The ListItem should return the label as the name with m of n string and
-	 *  DataGrid should return the name specified in the AccessibilityProperties.
-	 *
-	 *  @param childID uint
-	 *
-	 *  @return Name String
-	 */
-	override protected function getName(childID:uint):String
-	{
-		if (int(childID) <= 0)
-			return null;
-		dgAccInfo.setup(master, childID);
-		if (dgAccInfo.isInvalid || !dgAccInfo.dataGrid.columns)
-			return null;
-		if (dgAccInfo.isColumnHeader)
-			return dgAccInfo.dataGrid.columns.getItemAt(childID-1).headerText;
-
-		// We now have only rows and data cells to consider.
-        if (!dgAccInfo.dataGrid.dataProvider || !dgAccInfo.dataGrid.columns)
-            return null;
-
-		// String representation of row position.
-		// TODO: Localize this.
-		var rowString:String = "";
-		if ((dgAccInfo.isCellMode && dgAccInfo.columnIndex == 0) || !dgAccInfo.isCellMode)
-		{
-			var resourceManager:IResourceManager = ResourceManager.getInstance();
-			rowString = resourceManager.getString("components", "rowMofN");
-			rowString = rowString.replace("%1", dgAccInfo.rowIndex + 1).replace("%2", dgAccInfo.rowCount);
-		}
-
-		// Construct the name to return.
-		var name:String = "";
-		// TODO: Should the types of these be more specific?
-		var rowObject:Object = dgAccInfo.dataGrid.dataProvider.getItemAt(dgAccInfo.rowIndex);
-        var columns:IList = dgAccInfo.dataGrid.columns;
-		if (dgAccInfo.isCellMode)
-		{
-            name = columns.getItemAt(dgAccInfo.columnIndex).headerText + ": "
-            + cellName(rowObject, dgAccInfo.columnIndex);
-		}
-		else if (rowObject)  // row mode
-		{
-			for (var c:int = 0; c < dgAccInfo.columnCount; c++)
-			{
-                //TODO: remove header text if there is no columnHeaderBar
-				if (c > 0)
-					name += ",";
-				name += " "
-				+ columns.getItemAt(c).headerText
-				+ ": "
-				+ columns.getItemAt(c).itemToLabel(rowObject);
-			}
-		}  // cell or row mode
-		if (rowString)
-			name += ", " +rowString;
-
-		return name;
-	}
-
-    /**
-     *  @private
-     *  IAccessible method for selecting an item.
+            if (dgAccInfo.headerCount > 0)
+                name = columns.getItemAt(dgAccInfo.columnIndex).headerText + ": "
+            name += cellName(rowObject, dgAccInfo.columnIndex);
+        }
+        else if (rowObject)  // row mode
+        {
+            for (var c:int = 0; c < dgAccInfo.columnCount; c++)
+            {
+                if (c > 0)
+                    name += ", ";
+                if (dgAccInfo.headerCount > 0)
+                    name += columns.getItemAt(c).headerText + ": ";
+                name += columns.getItemAt(c).itemToLabel(rowObject);
+            }
+        }  // cell or row mode
+        if (rowString)
+            name += ", " +rowString;
+
+        return name;
+    }
+
+    /**
+     *  @private
+     *  IAccessible method for focusing an item or altering selection.
+     * This is a full implementation based on the Microsoft Active Accessibility
+     * (MSAA) specification.
+     *
+     * @param selFlag:uint A combination of flags indicating what to do.
+     * Flags may be combined as indicated below:
+     *

+     *
SELFLAG_TAKEFOCUS
+     *
Set focus to the childID given.
+     * May be combined with the below flags.
+     *
SELFLAG_TAKESELECTION
+     *
Select the given child and unselect any other selected ones.
+     * Combining this with SELFLAG_TAKEFOCUS
+     * emulates a single mouse click.
+     *
SELFLAG_ADDSELECTION
+     *
Add the given child to those that are selected.
+     * Combining this with SELFLAG_TAKEFOCUS
+     * emulates a mouse click on an unselected item with the Ctrl key down.
+     *
SELFLAG_REMOVESELECTION
+     *
Remove the given child from those that are selected.
+     * Combining this with SELFLAG_TAKEFOCUS
+     * emulates a mouse click on a selected item with the Ctrl key down.
+     *
SELFLAG_ADDSELECTION | SELFLAG_EXTENDSELECTION
+     *
Select all children from the current focus to the given child.
+     *
SELFLAG_REMOVESELECTION | SELFLAG_EXTENDSELECTION
+     *
Unselect all children from the current focus to the given child.
+     *
SELFLAG_EXTENDSELECTION
+     *
Duplicate the selected/unselected state of the currently focused child,
+     * for all children through the given child.
+     * Combining this with SELFLAG_TAKEFOCUS
+     * emulates a mouse click with the Shift key down.
+     *

+     *  @param childID uint The ID of the child to use.
+     * For extending selection or unselection, this is the endpoint,
+     * and current focus is the anchor.
+     */
+    override public function accSelect(selFlag:uint, childID:uint):void
+    {
+        dgAccInfo.setup(master, childID);
+        if (dgAccInfo.isColumnHeader || dgAccInfo.isInvalid)
+            return;
+
+        // TODO: Adjust for there being no apparent way to just set focus
+        // without altering selection:  For now, treate SELFLAG_TAKEFOCUS like
+        // SELFLAG_TAKESELECTION, and remove the TAKEFOCUS bit from
+        // all other requests, thus letting other selection calls also
+        // handle focus changes.
+        // Code for handling focus properly remains below in case a
+        // way is found to make the code at the end of this function
+        // actually set focus independent of selection.
+        if (selFlag == AccConst.SELFLAG_TAKEFOCUS)
+            selFlag = AccConst.SELFLAG_TAKESELECTION
+        else if (selFlag & AccConst.SELFLAG_TAKEFOCUS)
+            selFlag -= AccConst.SELFLAG_TAKEFOCUS
+
+        var settingFocus:Boolean = Boolean(selFlag & AccConst.SELFLAG_TAKEFOCUS);
+        if (settingFocus)
+            selFlag -= AccConst.SELFLAG_TAKEFOCUS;
+
+        var rowIndex:int = dgAccInfo.rowIndex;
+        var columnIndex:int = dgAccInfo.columnIndex;
+        if (!dgAccInfo.isCellMode)
+            columnIndex = -1;
+        var grid:DataGrid = dgAccInfo.dataGrid;
+        grid.ensureCellIsVisible(rowIndex, columnIndex);
+
+        // First selection, then focus if requested.
+        // Caveat: Invalid selection flags will cause no changes to be made,
+        // including a focus change if one was requested.
+
+        if (selFlag == AccConst.SELFLAG_TAKESELECTION)
+        {
+            if (columnIndex == -1)
+                grid.setSelectedIndex(rowIndex);
+            else
+                grid.setSelectedCell(rowIndex, columnIndex);
+        }
+        else if (selFlag == AccConst.SELFLAG_ADDSELECTION)
+        {
+            if (columnIndex == -1)
+                grid.addSelectedIndex(rowIndex);
+            else
+                grid.addSelectedCell(rowIndex, columnIndex);
+        }
+        else if (selFlag == AccConst.SELFLAG_REMOVESELECTION)
+        {
+            if (columnIndex == -1)
+                grid.removeSelectedIndex(rowIndex);
+            else
+                grid.removeSelectedCell(rowIndex, columnIndex);
+        }
+        else if (Boolean(selFlag & AccConst.SELFLAG_EXTENDSELECTION))
+        {
+            if (Boolean(selFlag & AccConst.SELFLAG_ADDSELECTION)
+            && Boolean(selFlag & AccConst.SELFLAG_REMOVESELECTION))
+                return;
+            var focusedID:uint = get_accFocus();
+            if (!focusedID)
+            {
+                // This could be assumed to be 1, but this is probably safer.
+                return;
+            }
+            // We have to recalculate dgAccInfo for the anchor,
+            // but we already have row/column indices for the requested item,
+            // so we can do that without needing to reset it again afterward.
+            dgAccInfo.setup(master, focusedID);
+            if (dgAccInfo.isColumnHeader || dgAccInfo.isInvalid)
+                return;
+            var anchorRowIndex:int = dgAccInfo.rowIndex;
+            var anchorColumnIndex:int = dgAccInfo.columnIndex;
+            var adding:Boolean;
+            if (Boolean(selFlag & AccConst.SELFLAG_ADDSELECTION))
+                adding = true;
+            else if (Boolean(selFlag & AccConst.SELFLAG_REMOVESELECTION))
+                adding = false;
+            else
+            {
+                // MSAA docs say use selection state of anchor here.
+                // This method of figuring that out is a bit more
+                // intensive than necessary (other states calculated also),
+                // but selection extension without ADD/REMOVE being specified
+                // should be a very infrequent occurrence, and this method
+                // centralizes the logic for figuring out what is selected.
+                adding = Boolean(get_accState(focusedID) & AccConst.STATE_SYSTEM_SELECTED);
+            }
+            if (columnIndex == -1)
+                grid.selectIndices(
+                    Math.min(anchorRowIndex, rowIndex),
+                    Math.abs(rowIndex - anchorRowIndex) + 1
+                );
+            else
+                grid.selectCellRegion(
+                    Math.min(anchorRowIndex, rowIndex),
+                    Math.min(anchorColumnIndex, columnIndex),
+                    Math.abs(rowIndex - anchorRowIndex) + 1,
+                    Math.abs(columnIndex - anchorColumnIndex) + 1
+                );
+        }
+
+        // Now handle the focus change request if there was one
+        // (and if invalid flags didn't cause a return above).
+        // TODO:  This approach does not work properly, and to date,
+        // no approach that does has been found.
+        // Code at the top of this function effectively makes the
+        // below "if" never true.
+        if (settingFocus)
+            grid.grid.caretRowIndex = rowIndex;
+            grid.grid.caretColumnIndex = columnIndex;
+    }
+
+    /**
+     *  @private
+     *  IAccessible method for returning the child Selections in the List.
      *
      *  @param childID uint
-     */
-    override public function accSelect(selFlag:uint, childID:uint):void
-    {
-		dgAccInfo.setup(master, childID);
-
-        if (selFlag == AccConst.SELFLAG_TAKEFOCUS && !dgAccInfo.isColumnHeader && !dgAccInfo.isInvalid)
-        {
-            if (dgAccInfo.isCellMode)
-            {
-                var cellPosition:CellPosition = new CellPosition();
-                cellPosition.columnIndex = dgAccInfo.columnIndex;
-                cellPosition.rowIndex = dgAccInfo.rowIndex;
-                dgAccInfo.dataGrid.selectedCell = cellPosition;
-            }
-            else
-			{
-                dgAccInfo.dataGrid.selectedIndex = dgAccInfo.rowIndex;
-			}
-        }
-    }
-
-    /**
-     *  @private
-     *  IAccessible method for returning the child Selections in the List.
-     *
-     *  @param childID uint
      *
      *  @return focused childID.
      */
     override public function get_accSelection():Array
     {
         var accSelection:Array = [];
-		dgAccInfo.setup(master, 0);
+        dgAccInfo.setup(master, 0);
         if (!dgAccInfo.dataGrid.columns)
             return null;
-		var i:int
-		var n:int
-		var items:Object;
-
+        var i:int
+        var n:int
+        var items:Object;
+
         if (dgAccInfo.isCellMode)
         {
-			items = dgAccInfo.dataGrid.selectedCells;
-			n = items.length;
+            items = dgAccInfo.dataGrid.selectedCells;
+            n = items.length;
             for (i = 0; i < n; i++)
             {
-				// The selected childID is effectively the 1-based cell index.
-				// This is row*colCount + columnInRow +columnHeaderCount +1.
+                // The selected childID is effectively the 1-based cell index.
+                // This is row*colCount + columnInRow +columnHeaderCount +1.
                 accSelection[i] = items[i].rowIndex * dgAccInfo.columnCount
                 + items[i].columnIndex
                 + dgAccInfo.headerCount + 1;
@@ -488,124 +601,108 @@
         }
         else // row mode
         {
-			items = dgAccInfo.dataGrid.selectedIndices;
-			n = items.length;
+            items = dgAccInfo.dataGrid.selectedIndices;
+            n = items.length;
             for (i = 0; i < n; i++)
             {
-				// This time we just need rowIndex (0-based) + headerCount + 1.
+                // This time we just need rowIndex (0-based) + headerCount + 1.
                 accSelection[i] = items[i] + dgAccInfo.headerCount + 1;
             }
-
+
         }

         return accSelection;

     }

-	//--------------------------------------------------------------------------
-	//
-	//  Overridden event handlers: AccImpl
-	//
-	//--------------------------------------------------------------------------
-
-	/**
-	 *  @private
-	 *  Override the generic event handler.
-	 *  All AccImpl must implement this to listen
-	 *  for events from its master component.
-	 */
-	override protected function eventHandler(event:Event):void
-	{
-		// Let AccImpl class handle the events
-		// that all accessible UIComponents understand.
-		$eventHandler(event);
-
-		dgAccInfo.setup(master, 0);
-		if (!dgAccInfo.dataGrid.columns)
-			return;
-
-		var childID:uint;
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden event handlers: AccImpl
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Override the generic event handler.
+     *  All AccImpl must implement this to listen
+     *  for events from its master component.
+     */
+    override protected function eventHandler(event:Event):void
+    {
+        // Let AccImpl class handle the events
+        // that all accessible UIComponents understand.
+        $eventHandler(event);
+
+        dgAccInfo.setup(master, 0);
+        if (!dgAccInfo.dataGrid.columns)
+            return;
+
+        var childID:uint;
         switch (event.type)
         {
             case GridCaretEvent.CARET_CHANGE:
             {
-                var index:int;
-                if (dgAccInfo.isCellMode)
-                {
-                    index = int(GridCaretEvent(event).newRowIndex)
-                    * dgAccInfo.columnCount+int(GridCaretEvent(event).newColumnIndex);
-                    focusedCell.rowIndex = GridCaretEvent(event).newRowIndex;
-                    focusedCell.columnIndex = GridCaretEvent(event).newColumnIndex;
-                }
-                else // row mode
-                {
-                    focusedCell.rowIndex = GridCaretEvent(event).newRowIndex;
-                    index = focusedCell.rowIndex;
-                }
-                if (index >= 0)
-                {
-                    childID = index + 1 + dgAccInfo.headerCount;
-
-                    Accessibility.sendEvent(dgAccInfo.dataGrid, childID,
-                                            AccConst.EVENT_OBJECT_FOCUS);
-                }
+                childID = dgAccInfo.childIDFromRowAndColumn(
+                    int(GridCaretEvent(event).newRowIndex),
+                    int(GridCaretEvent(event).newColumnIndex)
+                );
+                if (int(childID) > 0)
+                    Accessibility.sendEvent(dgAccInfo.dataGrid, childID, AccConst.EVENT_OBJECT_FOCUS);
                 break;
             }
-            case GridSelectionEvent.SELECTION_CHANGING:
+            case GridSelectionEvent.SELECTION_CHANGE:
             {
-                if (dgAccInfo.isCellMode)
-                    index = GridSelectionEvent(event).selectionChange.rowIndex*dgAccInfo.columnCount + GridSelectionEvent(event).selectionChange.columnIndex;
-                else
-                    index = GridSelectionEvent(event).selectionChange.rowIndex;
-
-                if (index >= 0)
-                {
-                    childID = index + 1 + dgAccInfo.headerCount;
-                    Accessibility.sendEvent(dgAccInfo.dataGrid, childID,
-                                            AccConst.EVENT_OBJECT_SELECTION);
-                }
+                var gridSelectionEvent:GridSelectionEvent = GridSelectionEvent(event);
+                childID = dgAccInfo.childIDFromRowAndColumn(
+                    gridSelectionEvent.selectionChange.rowIndex,
+                    gridSelectionEvent.selectionChange.columnIndex
+                );
+                if (int(childID) <= 0)
+                    return;
+
+                var eventID:int = AccConst.EVENT_OBJECT_SELECTION;
+                var kind:String = gridSelectionEvent.kind;
+                if (kind == GridSelectionEventKind.ADD_CELL
+                || kind == GridSelectionEventKind.ADD_ROW)
+                    eventID = AccConst.EVENT_OBJECT_SELECTIONADD;
+                else if (kind == GridSelectionEventKind.REMOVE_CELL
+                || kind == GridSelectionEventKind.REMOVE_ROW)
+                    eventID = AccConst.EVENT_OBJECT_SELECTIONREMOVE;
+                else if (kind == GridSelectionEventKind.CLEAR_SELECTION
+                || kind == GridSelectionEventKind.SELECT_ALL
+                || kind == GridSelectionEventKind.SET_CELL_REGION
+                || kind == GridSelectionEventKind.SET_ROWS)
+                    eventID = AccConst.EVENT_OBJECT_SELECTIONWITHIN;
+
+                Accessibility.sendEvent(dgAccInfo.dataGrid, childID, eventID);
                 break;
             }
         }
-	}
-
-	//--------------------------------------------------------------------------
-	//
-	//  Methods
-	//
-	//--------------------------------------------------------------------------
-
-	/**
-	 *  @private
-	 */
-	private function cellName(rowObject:Object, columnIndex:int):String
-	{
-		var item:Object = rowObject;
-		if (item is String)
-			return "" + item;
-		var dataGrid:DataGrid = DataGrid(master);
-		var columns:IList = dataGrid.columns;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private function cellName(rowObject:Object, columnIndex:int):String
+    {
+        var item:Object = rowObject;
+        if (item is String)
+            return "" + item;
+        var dataGrid:DataGrid = DataGrid(master);
+        var columns:IList = dataGrid.columns;
         if (!columns)
-			return null;
-		var column:Object = columns.getItemAt(columnIndex);
-		if (!column)
-			return null;
-		return column.itemToLabel(rowObject);
-	}
-
-    /**
-     *  @private
-     *  Returns true if the given row is above or below the viewable area.
-     */
-    private function rowIndexIsScrolledOffScreen(rowIndex: int): Boolean
-	{
-		var dataGrid:DataGrid = DataGrid(master);
-		var vpos:int = dataGrid.scroller.viewport.verticalScrollPosition;
-        if (rowIndex < vpos
-		|| rowIndex >= vpos + dataGrid.dataProvider.length)
-			return true;
-		return false;
-	}
+            return null;
+        var column:Object = columns.getItemAt(columnIndex);
+        if (!column)
+            return null;
+        return column.itemToLabel(rowObject);
+    }

 }

@@ -613,126 +710,256 @@

 internal class ItemAccInfo
 {
-	import mx.core.UIComponent;
-	import spark.components.DataGrid;
-	import spark.components.Grid;
-	import spark.components.supportClasses.GridSelectionMode;
-	import spark.components.supportClasses.CellPosition;
-
-	/**
-	 *  Constructor.
-	 */
-	public function ItemAccInfo()
-	{
-		super();
-	}
-
-	/**
-	 *
-	 *  @param master The UIComponent instance that this AccImpl instance
-	 *  is making accessible.
-	 *  @param childID The childID of the item of interest.
-	 */
-	public function setup(master:UIComponent, childID:uint):void
-	{
-		this.master = master;
-		this.childID = childID;
-		dataGrid = DataGrid(master);
-		if (dataGrid.columns)
-			columnCount = dataGrid.columns.length;
-		else
-			columnCount = 0;
-		if (dataGrid.dataProvider)
-			rowCount = dataGrid.dataProvider.length;
-		else
-			rowCount = 0;
-		itemIndex = childID - 1;
-		if (dataGrid.columnHeaderBar)
-		{
-			// There are column headers, and their childIDs come first.
-			itemIndex -= columnCount;
-			headerCount = columnCount;
-		}
-		else
-		{
-			headerCount = 0;
-		}
-		var mode:String = dataGrid.selectionMode;
-		isCellMode = (
-			mode == GridSelectionMode.SINGLE_CELL
-			|| mode == GridSelectionMode.MULTIPLE_CELLS
-		);
-		maxChildID = 0;
-		// Account for headers.
-		maxChildID += headerCount;
-		// Then for cells or rows as appropriate.
+    import mx.core.UIComponent;
+    import spark.components.DataGrid;
+    import spark.components.Grid;
+    import spark.components.supportClasses.GridSelectionMode;
+    import spark.components.supportClasses.CellPosition;
+    import flash.geom.Rectangle;
+    import flash.geom.Point;
+
+    /**
+     *  Constructor.
+     */
+    public function ItemAccInfo()
+    {
+        super();
+    }
+
+    /**
+     *
+     *  @param master The UIComponent instance that this AccImpl instance
+     *  is making accessible.
+     *  @param childID The childID of the item of interest.
+     */
+    public function setup(master:UIComponent, childID:uint):void
+    {
+        this.master = master;
+        this.childID = childID;
+        dataGrid = DataGrid(master);
+        visibleRowIndices = null;
+        visibleColumnIndices = null;
+        if (dataGrid.columns)
+        {
+            columnCount = dataGrid.columns.length;
+            visibleColumnCount = visibleColumnIndices == null ?
+                columnCount : visibleColumnIndices.length;
+        }
+        else
+        {
+            columnCount = 0;
+            visibleColumnCount = 0;
+        }
+        if (dataGrid.dataProvider)
+        {
+          rowCount = dataGrid.dataProvider.length;
+            visibleRowCount = visibleRowIndices == null ?
+                rowCount : visibleRowIndices.length;
+        }
+        else
+        {
+            rowCount = 0;
+            visibleRowCount = 0;
+        }
+        headerCount = 0;
+        visibleHeaderCount = 0;
+        maxChildID = 0;
+        isCellMode = false;
+        isMultiSelect = false;
+        isInvalid = false;
+        isColumnHeader = false;
+        rowIndex = 0;
+        columnIndex = 0;
+        visibleRowIndex = 0;
+        visibleColumnIndex = 0;
+
+        var itemIndex:int = childID - 1;
+        if (dataGrid.columnHeaderBar && dataGrid.columnHeaderBar.visible)
+        {
+            // There are visible column headers, so their childIDs come first.
+            itemIndex -= visibleColumnCount;
+            headerCount = columnCount;
+            visibleHeaderCount = visibleColumnCount;
+        }
+        else
+        {
+            // No header bar or it's invisible,
+            // so we should not try to expose any data within it.
+            headerCount = 0;
+            visibleHeaderCount = 0;
+        }
+        var mode:String = dataGrid.selectionMode;
+        isCellMode = (
+            mode == GridSelectionMode.SINGLE_CELL
+            || mode == GridSelectionMode.MULTIPLE_CELLS
+        );
+        isMultiSelect = (
+            mode == GridSelectionMode.MULTIPLE_CELLS
+            || mode == GridSelectionMode.MULTIPLE_ROWS
+        );
+        maxChildID = 0;
+        // Account for visible headers.
+        maxChildID += visibleHeaderCount;
+        // Then for visible cells or rows as appropriate.
         if (isCellMode)
-			maxChildID += rowCount * columnCount;
+            maxChildID += visibleRowCount * visibleColumnCount;
         else
-			maxChildID += rowCount;
-		isColumnHeader = false;
-		isInvalid = false;
-		if (childIDOutOfBounds(childID))
-		{
-			isInvalid = true;
-			columnIndex = -1;
-			rowIndex = -1;
-			itemIndex = -1;
-		}
-		else if (itemIndex < 0)
-		{
-			// This childID refers to a header, not a data row or cell.
-			isColumnHeader = true;
-			columnIndex = itemIndex + columnCount;
-			rowIndex = -1;
-			itemIndex = -1;
-		}
-		else if (isCellMode)
-		{
-			rowIndex = Math.floor(itemIndex / columnCount);
-			columnIndex = itemIndex % columnCount;
-		}
-		else
-		{
-			rowIndex = itemIndex;
-			// Using 0 here so, for example, getItemRendererAt() calls still work for a row.
-			columnIndex = 0;
-		}
-	}
-
-	public var master:UIComponent;
-	public var childID:uint;
-	public var dataGrid:DataGrid;
-	public var columnCount:int;
-	public var headerCount:int;
-	public var rowCount:int;
-	public var maxChildID:int;
-	public var itemIndex:int;
-	public var isCellMode:Boolean;
-	public var isInvalid:Boolean;
-	public var isColumnHeader:Boolean;
-	public var columnIndex:int;
-	public var rowIndex:int;
-
-	public function childIDFromRowAndColumn(rowIndex:int, columnIndex:int):uint
-	{
-		var childID:int = headerCount + 1;
-		if (isCellMode)
-			childID += rowIndex * columnCount + columnIndex;
-		else
-			childID += rowIndex;
-		return uint(childID);
-	}
-
-    private function childIDOutOfBounds(childID: int): Boolean
-    {
-		if (int(childID) <= 0)
-			return true;
+            maxChildID += visibleRowCount;
+        isColumnHeader = false;
+        isInvalid = false;
+        if (childIDOutOfBounds(childID))
+        {
+            isInvalid = true;
+            visibleColumnIndex = -1;
+            visibleRowIndex = -1;
+            itemIndex = -1;
+        }
+        else if (itemIndex < 0)
+        {
+            // This childID refers to a header, not a data row or cell.
+            isColumnHeader = true;
+            visibleColumnIndex = itemIndex + visibleColumnCount;
+            visibleRowIndex = -1;
+            itemIndex = -1;
+        }
+        else if (isCellMode)
+        {
+            visibleRowIndex = Math.floor(itemIndex / visibleColumnCount);
+            visibleColumnIndex = itemIndex % visibleColumnCount;
+        }
+        else
+        {
+            visibleRowIndex = itemIndex;
+            // Using 0 here so, for example, getItemRendererAt() calls still work for a row.
+            visibleColumnIndex = 0;
+        }
+        rowIndex = visibleRowIndex;
+        columnIndex = visibleColumnIndex;
+        if (visibleRowIndex >= 0 && visibleRowIndices != null)
+            rowIndex = visibleRowIndices[visibleRowIndex];
+        if (visibleColumnIndex >= 0 && visibleColumnIndices != null)
+            columnIndex = visibleColumnIndices[visibleColumnIndex];
+    }
+
+    // The master component reference for which this AccImpl is instantiated.
+    public var master:UIComponent;
+    // The childID within that component for which this accInfo is calculated.
+    public var childID:uint;
+    // The DataGrid reference for this instance.
+    public var dataGrid:DataGrid;
+    // Number of columns, headers, and rows overall.
+    public var columnCount:int;
+    public var headerCount:int;
+    public var rowCount:int;
+    // Number of columns, headers, and rows that are visible.
+    // ("Visible" means not marked invisible by programmer or user.)
+    public var visibleColumnCount:int;
+    public var visibleHeaderCount:int;
+    public var visibleRowCount:int;
+    // Indices of visible rows and columns.
+    // These are null when nothing is filtered, for performance reasons.
+    protected var visibleRowIndices:Vector.<int>;
+    protected var visibleColumnIndices:Vector.<int>;
+    // The highest valid childID.
+    public var maxChildID:int;
+    // True if we are in cell navigation mode (single or multiple selection).
+    public var isCellMode:Boolean;
+    // True if we are in a multiple selection mode (row or cell).
+    public var isMultiSelect:Boolean;
+    // True if the data in this object is invalid for some reason.
+    // Usually this means an invalid childID was passed to setup().
+    public var isInvalid:Boolean;
+    // True if the given childID represents a column header cell.
+    public var isColumnHeader:Boolean;
+    // 0-based indices of row and column in the sets of visible ones.
+    public var visibleColumnIndex:int;
+    public var visibleRowIndex:int;
+    // 0-based indices of row and column in the set of all of each.
+    public var columnIndex:int;
+    public var rowIndex:int;
+
+    private function childIDFromVisibleRowAndColumn(visibleRowIndex:int, visibleColumnIndex:int):uint
+    {
+        var childID:int = visibleHeaderCount + 1;
+        if (visibleRowIndex < 0)
+            childID = 0;
+        else if (isCellMode)
+            if (visibleColumnIndex < 0)
+                childID = 0;
+            else
+                childID += visibleRowIndex * visibleColumnCount + visibleColumnIndex;
+        else
+            childID += visibleRowIndex;
+        return uint(childID);
+    }
+
+    public function childIDFromRowAndColumn(rowIndex:int, columnIndex:int):uint
+    {
+        return childIDFromVisibleRowAndColumn(
+            visibleRowIndices == null ? rowIndex : visibleRowIndices.indexOf(rowIndex),
+            visibleColumnIndices == null ? columnIndex : visibleColumnIndices.indexOf(columnIndex)
+        );
+    }
+
+    private function childIDOutOfBounds(childID: int):Boolean
+    {
+        if (int(childID) <= 0)
+            return true;
         if (!dataGrid.dataProvider || !dataGrid.columns)
             return true
-		if (childID > maxChildID)
-			return true;
-		return false;
+        if (childID > maxChildID)
+            return true;
+        return false;
+    }
+
+    public function boundingRect():Object
+    {
+        // First see if this item is on screen.
+        // We could skip this, but we'd run the risk of having
+        // assistive technology create huge numbers of itemRenderers below
+        // by quickly scanning an entire grid.
+        if (!isColumnHeader && (rowIndex < 0 || rowIndex >= rowCount))
+            // Also covers rowCount == 0 effectively.
+            return null;
+        if (isCellMode && (columnIndex < 0 || columnIndex >= columnCount))
+            return null;
+        var vri:Vector.<int> = dataGrid.grid.getVisibleRowIndices();
+        var vci:Vector.<int> = dataGrid.grid.getVisibleColumnIndices();
+        if (isColumnHeader && vci.indexOf(columnIndex) < 0)
+            return null;
+        if ((!isColumnHeader && vri.indexOf(rowIndex) < 0)
+        || (isCellMode && vci.indexOf(columnIndex) < 0))
+            return null;
+
+        var result:Object;
+        if (isColumnHeader)
+        {
+            result = dataGrid.columnHeaderBar.getHeaderRendererAt(columnIndex);
+        }
+        else if (isCellMode)
+        {
+            result = dataGrid.grid.getItemRendererAt(rowIndex, columnIndex);
+        }
+        else  // row mode
+        {
+            // Use the item renderers at both ends of this row
+            // to calculate the width.
+            // We assume here that top and bottom of all renderers for one row are equal.
+            var r1:Object = dataGrid.grid.getItemRendererAt(rowIndex, vci[0]);
+            var r2:Object = dataGrid.grid.getItemRendererAt(rowIndex, vci[vci.length-1]);
+            var xy:Point = new Point(
+                r1.getLayoutBoundsX(),
+                r1.getLayoutBoundsY()
+            );
+            xy = dataGrid.grid.localToGlobal(xy);
+            xy = dataGrid.globalToLocal(xy);
+            result = new Rectangle(
+                xy.x, xy.y,
+                r2.getLayoutBoundsX() + r2.getLayoutBoundsWidth() - r1.getLayoutBoundsX(),
+                r1.getLayoutBoundsHeight()
+            );
+        }
+        return result;
     }

 }