You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by mi...@apache.org on 2014/09/03 13:25:56 UTC

[1/2] git commit: [flex-sdk] [refs/heads/develop] - FLEX-28291 Removing unused imports.

Repository: flex-sdk
Updated Branches:
  refs/heads/develop f25593ed3 -> b0ab95383


FLEX-28291 Removing unused imports.


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/91575228
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/91575228
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/91575228

Branch: refs/heads/develop
Commit: 9157522834584e262033e5bd488ed84f864c3e0d
Parents: f25593e
Author: Mihai C <mi...@apache.org>
Authored: Wed Sep 3 12:04:10 2014 +0100
Committer: Mihai C <mi...@apache.org>
Committed: Wed Sep 3 12:04:10 2014 +0100

----------------------------------------------------------------------
 frameworks/projects/spark/src/spark/components/ComboBox.as     | 6 ------
 frameworks/projects/spark/src/spark/components/DataGroup.as    | 3 ---
 .../projects/spark/src/spark/layouts/HorizontalLayout.as       | 1 -
 frameworks/projects/spark/src/spark/layouts/VerticalLayout.as  | 1 -
 4 files changed, 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/91575228/frameworks/projects/spark/src/spark/components/ComboBox.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/components/ComboBox.as b/frameworks/projects/spark/src/spark/components/ComboBox.as
index 6ef3125..4c92211 100644
--- a/frameworks/projects/spark/src/spark/components/ComboBox.as
+++ b/frameworks/projects/spark/src/spark/components/ComboBox.as
@@ -19,31 +19,25 @@
 
 package spark.components
 {
-import adobe.utils.CustomActions;
-
 import flash.display.DisplayObject;
 import flash.display.InteractiveObject;
 import flash.events.Event;
 import flash.events.FocusEvent;
 import flash.events.KeyboardEvent;
-import flash.events.MouseEvent;
 import flash.ui.Keyboard;
 
 import flashx.textLayout.operations.CompositeOperation;
 import flashx.textLayout.operations.CutOperation;
 import flashx.textLayout.operations.DeleteTextOperation;
 import flashx.textLayout.operations.FlowOperation;
-import flashx.textLayout.operations.InsertTextOperation;
 
 import mx.collections.IList;
 import mx.core.IIMESupport;
 import mx.core.mx_internal;
 import mx.events.FlexEvent;
-import mx.styles.StyleProxy;
 
 import spark.components.supportClasses.DropDownListBase;
 import spark.components.supportClasses.ListBase;
-import spark.core.NavigationUnit;
 import spark.events.DropDownEvent;
 import spark.events.TextOperationEvent;
 import spark.utils.LabelUtil;

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/91575228/frameworks/projects/spark/src/spark/components/DataGroup.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/components/DataGroup.as b/frameworks/projects/spark/src/spark/components/DataGroup.as
index 6004a92..be4f51d 100644
--- a/frameworks/projects/spark/src/spark/components/DataGroup.as
+++ b/frameworks/projects/spark/src/spark/components/DataGroup.as
@@ -32,7 +32,6 @@ import mx.core.IFactory;
 import mx.core.IInvalidating;
 import mx.core.ILayoutElement;
 import mx.core.IVisualElement;
-import mx.core.UIComponentGlobals;
 import mx.core.mx_internal;
 import mx.events.CollectionEvent;
 import mx.events.CollectionEventKind;
@@ -43,8 +42,6 @@ import mx.utils.MatrixUtil;
 
 import spark.components.supportClasses.GroupBase;
 import spark.events.RendererExistenceEvent;
-import spark.layouts.HorizontalAlign;
-import spark.layouts.VerticalLayout;
 import spark.layouts.supportClasses.LayoutBase;
 
 use namespace mx_internal;  // for mx_internal property contentChangeDelta

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/91575228/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as b/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as
index 57cac28..d9b5976 100644
--- a/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as
+++ b/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as
@@ -27,7 +27,6 @@ import mx.containers.utilityClasses.Flex;
 import mx.core.FlexVersion;
 import mx.core.ILayoutElement;
 import mx.core.IVisualElement;
-import mx.core.UIComponentGlobals;
 import mx.core.mx_internal;
 import mx.events.PropertyChangeEvent;
 

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/91575228/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as b/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
index 151c327..6094373 100644
--- a/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
+++ b/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
@@ -27,7 +27,6 @@ import mx.containers.utilityClasses.Flex;
 import mx.core.FlexVersion;
 import mx.core.ILayoutElement;
 import mx.core.IVisualElement;
-import mx.core.UIComponentGlobals;
 import mx.core.mx_internal;
 import mx.events.PropertyChangeEvent;
 


[2/2] git commit: [flex-sdk] [refs/heads/develop] - FLEX-28291 CAUSE: Please see the fxp attached to the ticket for a way to reproduce this bug. From the Flex Jira bugs and the bug reports in our application I'm sure there are many other ways, but that's

Posted by mi...@apache.org.
FLEX-28291
CAUSE:
Please see the fxp attached to the ticket for a way to reproduce this bug. From the Flex Jira bugs and the bug reports in our application I'm sure there are many other ways, but that's the one I could find.

There are ways to time the call to getMajorSize() on LinearLayoutVector in such a way that at that particular moment it's not yet synchronised with the DataGroup's current dataProvider, but instead with the previous one. (This applies for a snapshot before and after it's refresh()ed, as the items can vary wildly, as in the attachment). But getMajorSize() assumes that its blockTable is an accurate mapping of the current dataProvider length (disguised as DataGroup.numElements), and that therefore the index it receives as a parameter will exist (after the 'index >> BLOCK_SHIFT' mapping) in its blockTable Vector. Indeed, its assumption is correct, because it's the responsibility of VerticalLayout and HorizontaLayout to keep it in sync with the changed dataProvider.

This possibility is opened by List.dataProviderRefreshed(), which waits for the validation cycle to finish before asking the list to ensureCaretVisibility() for an index it computed before the validation cycle. However, if the dataProvider somehow changes after the validation cycle and before UPDATE_COMPLETE, we're in trouble.

SOLUTION:
Get VerticalLayout and HorizontaLayout to call updateLLV(g) before calling getBounds() on their LinearLayoutVector. This way, at least, the blockTable Vector in LinearLayoutVector has the correct length, if incorrect (empty) data.

NOTES:
-As alluded to above, while this fix does remove the fatal, it does not actually make the list scroll to the previously selected index. To achieve that we would need to call updateDisplayListVirtual() instead of updateLLV, but that's impossible because it will fail with another fatal (Error #1009 in VerticalLayout/calculateElementWidth():1721). That's because now the DataGroup will return null for getVirtualElementAt(), as its 'virtualLayoutUnderway' is false, since the validation cycle has completed. To get around this we'd need to either call validateNow whenever the DataGroup's dataProvider is reset, refreshed or replaced, or instead remove the virtualLayoutUnderway conditional from getVirtualElementAt(), but both of these are major changes with many potential side effects. If anyone wants to investigate them, they are most welcome.
-From what I can tell, the only reason List.dataProviderRefreshed() exists is that when it redraws, the list does not keep the current scroll position, but instead starts from the top/left. If we could make it redraw directly on the current scroll position (or the maximum the new items can occupy), we would remove the need for List.dataProviderRefreshed(), thus removing the potential for this bug.


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/b0ab9538
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/b0ab9538
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/b0ab9538

Branch: refs/heads/develop
Commit: b0ab9538362fbb7200c7768eb24f342097bc4bdb
Parents: 9157522
Author: Mihai C <mi...@apache.org>
Authored: Wed Sep 3 12:05:40 2014 +0100
Committer: Mihai C <mi...@apache.org>
Committed: Wed Sep 3 12:05:40 2014 +0100

----------------------------------------------------------------------
 frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as | 3 +++
 frameworks/projects/spark/src/spark/layouts/VerticalLayout.as   | 3 +++
 2 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b0ab9538/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as b/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as
index d9b5976..b526294 100644
--- a/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as
+++ b/frameworks/projects/spark/src/spark/layouts/HorizontalLayout.as
@@ -960,6 +960,9 @@ public class HorizontalLayout extends LayoutBase
         if (!g || (index < 0) || (index >= g.numElements) || !llv) 
             return null;
 
+		// We need a valid LLV for this function
+		updateLLV(g);
+		
         return llv.getBounds(index);
     }    
     

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b0ab9538/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as b/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
index 6094373..5dd34e1 100644
--- a/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
+++ b/frameworks/projects/spark/src/spark/layouts/VerticalLayout.as
@@ -911,6 +911,9 @@ public class VerticalLayout extends LayoutBase
         if (!g || (index < 0) || (index >= g.numElements) || !llv) 
             return null;
 
+		// We need a valid LLV for this function
+		updateLLV(g);
+		
         return llv.getBounds(index);
     }