You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2017/05/09 17:59:59 UTC

[1/6] git commit: [flex-asjs] [refs/heads/tlf] - implement a few more things needed for backspace

Repository: flex-asjs
Updated Branches:
  refs/heads/tlf ccfe255e1 -> 4ab06d52c


implement a few more things needed for backspace


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

Branch: refs/heads/tlf
Commit: 3413a1e2a24921ca6da8fc25444df3da3f04a332
Parents: 95c47d3
Author: Alex Harui <ah...@apache.org>
Authored: Tue May 9 08:10:52 2017 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue May 9 08:14:03 2017 -0700

----------------------------------------------------------------------
 .../flex/org/apache/flex/text/html/TextBlock.as | 23 +++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3413a1e2/frameworks/projects/Text/src/main/flex/org/apache/flex/text/html/TextBlock.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Text/src/main/flex/org/apache/flex/text/html/TextBlock.as b/frameworks/projects/Text/src/main/flex/org/apache/flex/text/html/TextBlock.as
index 934b8e5..cb9cd5d 100644
--- a/frameworks/projects/Text/src/main/flex/org/apache/flex/text/html/TextBlock.as
+++ b/frameworks/projects/Text/src/main/flex/org/apache/flex/text/html/TextBlock.as
@@ -219,6 +219,7 @@ package org.apache.flex.text.html
 				span.text = textElem.text;
 				//span.element.style.display = "block";
 				tl.addElement(span);
+				lines.push(tl);
 			}
 			if (previousLine == null)
 				_firstLine = tl;
@@ -230,8 +231,7 @@ package org.apache.flex.text.html
 		}
 		public function findNextAtomBoundary(afterCharIndex:int):int
 		{
-			trace("findNextAtomBoundary not implemented");
-			return 0;
+			return afterCharIndex + 1;
 		}
 		public function findNextWordBoundary(afterCharIndex:int):int
 		{
@@ -240,8 +240,7 @@ package org.apache.flex.text.html
 		}
 		public function findPreviousAtomBoundary(beforeCharIndex:int):int
 		{
-			trace("findPreviousAtomBoundary not implemented");
-			return 0;
+			return beforeCharIndex - 1;
 		}
 		public function findPreviousWordBoundary(beforeCharIndex:int):int
 		{
@@ -250,7 +249,21 @@ package org.apache.flex.text.html
 		}
 		public function getTextLineAtCharIndex(charIndex:int):ITextLine
 		{
-			trace("getTextLineAtCharIndex not implemented");
+			var lineIndex:int = 0;
+			for each (var line:TextLine in lines)
+			{
+				COMPILE::SWF
+				{
+				lineIndex += line.textField.text.length;
+				}
+				COMPILE::JS
+				{
+				lineIndex += line.element.firstChild.textContent.length;
+				}
+				if (lineIndex > charIndex)
+				  	return line;
+				
+			}
 			return null;
 		}
 		public function recreateTextLine(textLine:ITextLine, previousLine:ITextLine = null, width:Number = 1000000, lineOffset:Number = 0.0, fitSomething:Boolean = false):ITextLine


[2/6] git commit: [flex-asjs] [refs/heads/tlf] - handle Safari 9 keyboard events

Posted by ah...@apache.org.
handle Safari 9 keyboard events


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

Branch: refs/heads/tlf
Commit: fa7122215cb570255bc346ea3a350b8dbf628fa7
Parents: ccfe255
Author: Alex Harui <ah...@apache.org>
Authored: Tue May 9 08:09:39 2017 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue May 9 08:14:03 2017 -0700

----------------------------------------------------------------------
 .../main/flex/org/apache/flex/events/utils/KeyConverter.as   | 1 -
 .../org/apache/flex/events/utils/KeyboardEventConverter.as   | 8 +++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fa712221/frameworks/projects/Core/src/main/flex/org/apache/flex/events/utils/KeyConverter.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/utils/KeyConverter.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/utils/KeyConverter.as
index 95056c2..113e161 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/utils/KeyConverter.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/utils/KeyConverter.as
@@ -78,7 +78,6 @@ package org.apache.flex.events.utils
          *  @playerversion AIR 2.6
          *  @productversion FlexJS 0.8
          */
-         COMPILE::SWF
          public static function convertKeyCode(code:uint):String
          {
              // A to Z

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/fa712221/frameworks/projects/Core/src/main/flex/org/apache/flex/events/utils/KeyboardEventConverter.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/utils/KeyboardEventConverter.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/utils/KeyboardEventConverter.as
index 83b9ff9..fc8a630 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/events/utils/KeyboardEventConverter.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/events/utils/KeyboardEventConverter.as
@@ -71,7 +71,13 @@ package org.apache.flex.events.utils
 		public static function convert(oldEvent:KeyboardEvent):org.apache.flex.events.KeyboardEvent
 		{
 			var type:String = oldEvent.type == "keydown" ? "key_down" : "key_up"; 
-			var newEvent:org.apache.flex.events.KeyboardEvent = new org.apache.flex.events.KeyboardEvent(type, oldEvent.key, oldEvent.code);
+			var key:String = oldEvent.key;
+			if (key == null)
+				key = KeyConverter.convertCharCode(oldEvent['charCode']);
+			var code:String = oldEvent.code;
+			if (code == null)
+				code = KeyConverter.convertKeyCode(oldEvent['keyCode']);
+			var newEvent:org.apache.flex.events.KeyboardEvent = new org.apache.flex.events.KeyboardEvent(type, key, code);
 			newEvent.altKey = oldEvent.altKey;
 			newEvent.ctrlKey = oldEvent.ctrlKey;
 			newEvent.metaKey = oldEvent.metaKey;


[6/6] git commit: [flex-asjs] [refs/heads/tlf] - test bed for TLF Editing

Posted by ah...@apache.org.
test bed for TLF Editing


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

Branch: refs/heads/tlf
Commit: 4ab06d52c3beaae14a4a9510a332c411ec75f8f9
Parents: 1ea5cd2
Author: Alex Harui <ah...@apache.org>
Authored: Tue May 9 10:58:17 2017 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue May 9 10:58:17 2017 -0700

----------------------------------------------------------------------
 manualtests/TLFEditTestFlexJS/build.xml         |  71 ++++
 .../src/TLFEditTestFlexJS.mxml                  |  45 +++
 manualtests/TLFEditTestFlexJS/src/TLFEditor.as  | 326 +++++++++++++++++++
 manualtests/build_example.xml                   |  15 +
 4 files changed, 457 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4ab06d52/manualtests/TLFEditTestFlexJS/build.xml
----------------------------------------------------------------------
diff --git a/manualtests/TLFEditTestFlexJS/build.xml b/manualtests/TLFEditTestFlexJS/build.xml
new file mode 100644
index 0000000..fc99fec
--- /dev/null
+++ b/manualtests/TLFEditTestFlexJS/build.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0"?>
+<!--
+
+  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
+
+      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.
+
+-->
+
+
+<project name="TLFEditTestFlexJS" default="main" basedir=".">
+    <property name="FLEXJS_HOME" location="../.."/>
+    <property name="example" value="TLFEditTestFlexJS" />
+    
+    <property file="${FLEXJS_HOME}/env.properties"/>
+    <property environment="env"/>
+    <property file="${FLEXJS_HOME}/build.properties"/>
+    <property name="FLEX_HOME" value="${FLEXJS_HOME}"/>
+    <available file="${env.FALCON_HOME}/lib/falcon-mxmlc.jar"
+    type="file"
+    property="FALCON_HOME"
+    value="${env.FALCON_HOME}"/>
+    
+    <available file="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk/lib/falcon-mxmlc.jar"
+    type="file"
+    property="FALCON_HOME"
+    value="${FLEXJS_HOME}/../flex-falcon/compiler/generated/dist/sdk"/>
+    
+    <available file="${env.FALCONJX_HOME}/lib/jsc.jar"
+    type="file"
+    property="FALCONJX_HOME"
+    value="${env.FALCONJX_HOME}"/>
+    
+    <available file="${FLEXJS_HOME}/../flex-falcon/compiler.jx/lib/jsc.jar"
+    type="file"
+    property="FALCONJX_HOME"
+    value="${FLEXJS_HOME}/../flex-falcon/compiler.jx"/>
+    
+    <available file="${env.GOOG_HOME}/closure/goog/base.js"
+    type="file"
+    property="GOOG_HOME"
+    value="${env.GOOG_HOME}"/>
+    
+    <available file="${FLEXJS_HOME}/js/lib/google/closure-library/closure/goog/base.js"
+    type="file"
+    property="GOOG_HOME"
+    value="${FLEXJS_HOME}/js/lib/google/closure-library"/>
+    
+    <include file="${basedir}/../build_example.xml" />
+
+    <target name="main" depends="clean,build_example.compile,build_example.compilejs" description="Clean build of ${example}">
+    </target>
+    
+    <target name="clean">
+        <delete dir="${basedir}/bin" failonerror="false" />
+        <delete dir="${basedir}/bin-debug" failonerror="false" />
+        <delete dir="${basedir}/bin-release" failonerror="false" />
+    </target>
+
+</project>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4ab06d52/manualtests/TLFEditTestFlexJS/src/TLFEditTestFlexJS.mxml
----------------------------------------------------------------------
diff --git a/manualtests/TLFEditTestFlexJS/src/TLFEditTestFlexJS.mxml b/manualtests/TLFEditTestFlexJS/src/TLFEditTestFlexJS.mxml
new file mode 100644
index 0000000..8bc8510
--- /dev/null
+++ b/manualtests/TLFEditTestFlexJS/src/TLFEditTestFlexJS.mxml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
+               xmlns:js="library://ns.apache.org/flexjs/basic"
+               xmlns:local="*" 
+               width="955" height="600"
+               applicationComplete="setupEditor()">
+    
+    <fx:Script>
+        <![CDATA[
+        	
+            protected function setupEditor():void
+            {
+            }                
+        ]]>
+    </fx:Script>
+    <fx:Style>
+    	@namespace "*";
+    
+	    TLFEditor
+		{
+		  border: 1px solid #808080;
+		  backgroundColor: #00FFFF;
+		  border-radius: 2px;
+		  padding: 4px;
+		  margin: 0px;
+		}
+    </fx:Style>
+    
+    <js:valuesImpl>
+        <js:SimpleCSSValuesImpl/>
+    </js:valuesImpl>
+    
+    <js:beads>
+        <js:VerticalLayout/>
+    </js:beads>
+
+	<js:initialView>
+	  <js:View>
+    	<js:Container style="borderStyle:solid" width="300" height="200" >
+    	  <local:TLFEditor id="tlfEditor" width="100%" height="100%" />
+    	</js:Container>
+	  </js:View>
+	</js:initialView>
+    
+</js:Application>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4ab06d52/manualtests/TLFEditTestFlexJS/src/TLFEditor.as
----------------------------------------------------------------------
diff --git a/manualtests/TLFEditTestFlexJS/src/TLFEditor.as b/manualtests/TLFEditTestFlexJS/src/TLFEditor.as
new file mode 100644
index 0000000..1e99f93
--- /dev/null
+++ b/manualtests/TLFEditTestFlexJS/src/TLFEditor.as
@@ -0,0 +1,326 @@
+/*
+ *
+ *  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
+ *
+ *      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.
+ *
+ */
+
+package
+{
+
+COMPILE::SWF
+{
+import flash.display.BlendMode;
+import flash.display.Sprite;
+import flash.events.FocusEvent;
+import flash.utils.setTimeout;
+}
+
+import org.apache.flex.textLayout.beads.DispatchTLFKeyboardEventBead;
+import org.apache.flex.textLayout.container.TextContainerManager;
+import org.apache.flex.textLayout.edit.EditingMode;
+import org.apache.flex.textLayout.edit.ISelectionManager;
+import org.apache.flex.textLayout.edit.SelectionFormat;
+import org.apache.flex.textLayout.events.CompositionCompleteEvent;
+import org.apache.flex.textLayout.events.DamageEvent;
+
+import org.apache.flex.core.UIBase;
+import org.apache.flex.events.Event;
+COMPILE::SWF
+{
+import org.apache.flex.html.beads.SingleLineBorderBead;
+import org.apache.flex.html.beads.SolidBackgroundBead;
+}
+COMPILE::JS
+{
+import org.apache.flex.textLayout.events.FocusEvent;
+}
+
+//import flashx.textLayout.tlf_internal;
+//use namespace tlf_internal;
+
+public class TLFEditor extends UIBase
+{
+	public var multiline:Boolean = true;
+	
+	public function TLFEditor()
+	{
+		addEventListener(FocusEvent.FOCUS_IN, onSetFocus);
+		addEventListener(FocusEvent.FOCUS_OUT, onLoseFocus);
+		COMPILE::SWF
+		{
+		addEventListener(FocusEvent.MOUSE_FOCUS_CHANGE, onMouseFocusChange);
+		Sprite($displayObject).tabEnabled = true;
+		Sprite($displayObject).mouseChildren = false;
+		}
+		
+		// Create the TLF TextContainerManager, using this component
+		// as the DisplayObjectContainer for its TextLines.
+		// This TextContainerManager instance persists for the lifetime
+		// of the component.
+		_textContainerManager = new TextContainerManager(this);
+
+		_textContainerManager.addEventListener(
+			CompositionCompleteEvent.COMPOSITION_COMPLETE,
+			textContainerManager_compositionCompleteHandler);
+		
+		_textContainerManager.addEventListener(
+			DamageEvent.DAMAGE, textContainerManager_damageHandler);
+		
+		COMPILE::SWF
+		{
+			// todo, see if this can be done in same place as for JS
+        var selectionManager:ISelectionManager = _textContainerManager.beginInteraction();
+		selectionManager.focusedSelectionFormat = new SelectionFormat(
+            0x000000, 1.0, "normal" /*BlendMode.NORMAL*/, 
+            0x000000, 1.0, "invert" /*BlendMode.INVERT*/);
+		}
+		/*
+		_textContainerManager.addEventListener(
+			Event.SCROLL, textContainerManager_scrollHandler);
+		
+		_textContainerManager.addEventListener(
+			SelectionEvent.SELECTION_CHANGE,
+			textContainerManager_selectionChangeHandler);
+		
+		_textContainerManager.addEventListener(
+			FlowOperationEvent.FLOW_OPERATION_BEGIN,
+			textContainerManager_flowOperationBeginHandler);
+		
+		_textContainerManager.addEventListener(
+			FlowOperationEvent.FLOW_OPERATION_END,
+			textContainerManager_flowOperationEndHandler);
+		
+		_textContainerManager.addEventListener(
+			FlowOperationEvent.FLOW_OPERATION_COMPLETE,
+			textContainerManager_flowOperationCompleteHandler);
+		
+		_textContainerManager.addEventListener(
+			StatusChangeEvent.INLINE_GRAPHIC_STATUS_CHANGE, 
+			textContainerManager_inlineGraphicStatusChangeHandler);
+		*/
+	}
+
+	override public function addedToParent():void
+	{
+		super.addedToParent();
+	
+		COMPILE::SWF
+		{
+			addBead(new SingleLineBorderBead());
+			addBead(new SolidBackgroundBead());
+		}
+		COMPILE::JS
+		{
+			if (element['tabIndex'] == -1)
+				element['tabIndex'] = 0;
+		}
+		addBead(new DispatchTLFKeyboardEventBead());
+		
+		COMPILE::JS
+		{
+		trace("begin interaction");
+		var selectionManager:ISelectionManager = _textContainerManager.beginInteraction();
+		selectionManager.focusedSelectionFormat = new SelectionFormat(
+            0x000000, 1.0, "normal" /*BlendMode.NORMAL*/, 
+            0x000000, 1.0, "invert" /*BlendMode.INVERT*/);
+		if (multiline)
+		{
+			if (!selectionManager.hasSelection())
+				 selectionManager.selectRange(0, 0);
+		} 
+		else
+		{
+			selectionManager.selectAll();
+		}
+
+		selectionManager.refreshSelection();
+		trace("end interaction");
+		_textContainerManager.endInteraction();
+		}
+
+	}
+	
+        //----------------------------------
+        //  textContainerManager
+        //----------------------------------
+        
+        /**
+         *  @private
+         */
+        private var _textContainerManager:TextContainerManager;
+        
+        
+        /**
+         *  @private
+         */
+        public function onSetFocus(event:Event):void
+        {            
+			trace("set focus");
+			
+            // We are about to set focus on this component.  If it is due to
+            // a programmatic focus change we have to programatically do what the
+            // mouseOverHandler and the mouseDownHandler do so that the user can 
+            // type in this component without using the mouse first.  We need to
+            // put a textFlow with a composer in place.
+            if (/*editingMode != EditingMode.READ_ONLY &&*/
+                _textContainerManager.composeState != 
+                TextContainerManager.COMPOSE_COMPOSER)   
+            {
+				trace("begin interaction");
+                var selectionManager:ISelectionManager = _textContainerManager.beginInteraction();
+				if (multiline)
+                {
+                    if (!selectionManager.hasSelection())
+                         selectionManager.selectRange(0, 0);
+                } 
+                else
+                {
+                    selectionManager.selectAll();
+                }
+    
+                selectionManager.refreshSelection();
+				trace("end interaction");
+                _textContainerManager.endInteraction();
+            }
+        }
+		
+        /**
+         *  @private
+         */
+        public function onLoseFocus(event:Event):void
+        {            
+			trace("lose focus");
+		}
+        
+        /**
+         *  @private
+         */
+        public function onMouseFocusChange(event:Event):void
+        {            
+			trace("mouse focus change");
+		}
+        
+        /**
+         *  @private
+         *  Called when the TextContainerManager dispatches a 'compositionComplete'
+         *  event when it has recomposed the text into TextLines.
+         */
+        private function textContainerManager_compositionCompleteHandler(
+            event:CompositionCompleteEvent):void
+        {
+			/*
+            //trace("compositionComplete");
+            
+            var oldContentWidth:Number = _contentWidth;
+            var oldContentHeight:Number = _contentHeight;
+            
+            var newContentBounds:Rectangle = 
+                _textContainerManager.getContentBounds();
+            
+            // If x and/or y are not 0, adjust for what is visible.  For example, if there is an 
+            // image which is wider than the composeWidth and float="right", x will be negative
+            // and the part of the image between x and 0 will not be visible so it should
+            // not be included in the reported width.  This will avoid a scrollbar that does
+            // nothing.
+            newContentBounds.width += newContentBounds.x;
+            newContentBounds.height += newContentBounds.y;
+            
+            // Try to prevent the scroller from getting into a loop while
+            // adding/removing scroll bars.
+            if (_textFlow && clipAndEnableScrolling)
+                adjustContentBoundsForScroller(newContentBounds);
+            
+            var newContentWidth:Number = newContentBounds.width;        
+            var newContentHeight:Number = newContentBounds.height;
+            
+            // TODO:(cframpto) handle blockProgression == RL
+            
+            if (newContentWidth != oldContentWidth)
+            {
+                _contentWidth = newContentWidth;
+                
+                //trace("composeWidth", _textContainerManager.compositionWidth, "contentWidth", oldContentWidth, newContentWidth);
+                
+                // If there is a scroller, this triggers the scroller layout.
+                dispatchPropertyChangeEvent(
+                    "contentWidth", oldContentWidth, newContentWidth);
+            }
+            
+            if (newContentHeight != oldContentHeight)
+            {
+                _contentHeight = newContentHeight;
+                
+                //trace("composeHeight", _textContainerManager.compositionHeight, "contentHeight", oldContentHeight, newContentHeight);
+                
+                // If there is a scroller, this triggers the scroller layout.
+                dispatchPropertyChangeEvent(
+                    "contentHeight", oldContentHeight, newContentHeight);
+            }
+			*/
+        }
+		
+        /**
+         *  @private
+         *  Called when the TextContainerManager dispatches a 'damage' event.
+         *  The TextFlow could have been modified interactively or programatically.
+         */
+        private function textContainerManager_damageHandler(event:DamageEvent):void
+        {
+            if (event.damageLength == 0)
+                return;
+            
+            //trace("damageHandler", "generation", _textFlow ? _textFlow.generation : -1, "lastGeneration", lastGeneration);
+            
+            // The following textContainerManager functions can trigger a damage
+            // event:
+            //    setText/setTextFlow
+            //    set hostFormat
+            //    set compositionWidth/compositionHeight
+            //    set horizontalScrollPosition/veriticalScrollPosition
+            //    set swfContext
+            //    updateContainer or compose: always if TextFlowFactory, sometimes 
+            //        if flowComposer
+            // or the textFlow can be modified directly.
+            
+            // If no changes, don't recompose/update.  The TextFlowFactory 
+            // createTextLines dispatches damage events every time the textFlow
+            // is composed, even if there are no changes. 
+            //if (_textFlow && _textFlow.generation == lastGeneration)
+            //    return;
+            
+            // If there are pending changes, don't wipe them out.  We have
+            // not gotten to commitProperties() yet.
+            //if (textChanged || textFlowChanged || contentChanged)
+            //    return;
+            
+            //_content = null;        
+            //_textFlow = _textContainerManager.getTextFlow();
+                        
+            //lastGeneration = _textFlow.generation;
+            
+			setTimeout(compose_callback, 0);            
+			
+        }
+		
+		public function compose_callback():void
+		{
+			// Compose only.  The display should not be updated.
+            _textContainerManager.compose();
+
+		}
+
+}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4ab06d52/manualtests/build_example.xml
----------------------------------------------------------------------
diff --git a/manualtests/build_example.xml b/manualtests/build_example.xml
index 0001365..551f840 100644
--- a/manualtests/build_example.xml
+++ b/manualtests/build_example.xml
@@ -50,6 +50,8 @@
             <arg value="-compiler.binding-event-handler-event=org.apache.flex.events.Event" />
             <arg value="+playerglobal.version=${playerglobal.version}" />
             <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
+            <arg value="-define=COMPILE::SWF,true" />
+            <arg value="-define=COMPILE::JS,false" />
         </mxmlc>
         
         <html-wrapper 
@@ -102,6 +104,8 @@
             <arg value="-compiler.binding-event-handler-event=org.apache.flex.events.Event" />
             <arg value="+playerglobal.version=${playerglobal.version}" />
             <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
+            <arg value="-define=COMPILE::SWF,true" />
+            <arg value="-define=COMPILE::JS,false" />
         </mxmlc>
         
         <copy todir="${basedir}/bin-debug">
@@ -142,6 +146,8 @@
             <arg value="-compiler.binding-event-handler-event=org.apache.flex.events.Event" />
             <arg value="+playerglobal.version=${playerglobal.version}" />
             <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
+            <arg value="-define=COMPILE::SWF,true" />
+            <arg value="-define=COMPILE::JS,false" />
         </mxmlc>
         
         <html-wrapper 
@@ -180,8 +186,11 @@
             <arg value="-compiler.binding-event-handler-event=org.apache.flex.events.Event" />
             <arg value="+playerglobal.version=${playerglobal.version}" />
             <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
+            <arg value="-external-library-path=${FLEXJS_HOME}/js/libs/js.swc" />
             <arg value="${extlib_arg}" />
             <arg value="-remove-circulars" />
+            <arg value="-define=COMPILE::SWF,false" />
+            <arg value="-define=COMPILE::JS,true" />
             <arg value="-js-output-type=FLEXJS" />
             <arg value="-closure-lib=${GOOG_HOME}" />
             <arg value="-sdk-js-lib=${FLEXJS_HOME}/frameworks/js/FlexJS/libs" />
@@ -224,8 +233,11 @@
             <arg value="-compiler.binding-event-handler-event=org.apache.flex.events.Event" />
             <arg value="+playerglobal.version=${playerglobal.version}" />
             <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
+            <arg value="-external-library-path=${FLEXJS_HOME}/js/libs/js.swc" />
             <arg value="${extlib_arg}" />
             <arg value="-remove-circulars" />
+            <arg value="-define=COMPILE::SWF,false" />
+            <arg value="-define=COMPILE::JS,true" />
             <arg value="-js-output-type=FLEXJS" />
             <arg value="-closure-lib=${GOOG_HOME}" />
             <arg value="-sdk-js-lib=${FLEXJS_HOME}/frameworks/js/FlexJS/libs" />
@@ -269,8 +281,11 @@
             <arg value="-compiler.binding-event-handler-event=org.apache.flex.events.Event" />
             <arg value="+playerglobal.version=${playerglobal.version}" />
             <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
+            <arg value="-external-library-path=${FLEXJS_HOME}/js/libs/js.swc" />
             <arg value="${extlib_arg}" />
             <arg value="-remove-circulars" />
+            <arg value="-define=COMPILE::SWF,false" />
+            <arg value="-define=COMPILE::JS,true" />
             <arg value="-js-output-type=FLEXJS" />
             <arg value="-closure-lib=${GOOG_HOME}" />
             <arg value="-sdk-js-lib=${FLEXJS_HOME}/frameworks/js/FlexJS/libs" />


[4/6] git commit: [flex-asjs] [refs/heads/tlf] - fix cursor blinking on FireFox. Timer interval was duplicated

Posted by ah...@apache.org.
fix cursor blinking on FireFox.  Timer interval was duplicated


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

Branch: refs/heads/tlf
Commit: 85f5ffa2ee2d1be1dbfb0e772ca0afc79855586d
Parents: 3413a1e
Author: Alex Harui <ah...@apache.org>
Authored: Tue May 9 10:25:05 2017 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue May 9 10:25:05 2017 -0700

----------------------------------------------------------------------
 .../projects/Core/src/main/flex/org/apache/flex/utils/Timer.as   | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/85f5ffa2/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Timer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Timer.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Timer.as
index 5372bdc..ef8fca0 100644
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Timer.as
+++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/Timer.as
@@ -152,6 +152,10 @@ public class Timer extends EventDispatcher
     
     public function start():void
     {
+		// bail if already running.  Is less code than an
+		// isRunning flag?
+		if (timerInterval != -1) return; 
+		
         timerInterval =
             setInterval(timerHandler, delay);
     }


[5/6] git commit: [flex-asjs] [refs/heads/tlf] - keyboard for firefox and chrome

Posted by ah...@apache.org.
keyboard for firefox and chrome


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

Branch: refs/heads/tlf
Commit: 1ea5cd21c26bca2255828b3302dfde5245022ec2
Parents: 85f5ffa
Author: Alex Harui <ah...@apache.org>
Authored: Tue May 9 10:47:35 2017 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue May 9 10:47:35 2017 -0700

----------------------------------------------------------------------
 .../apache/flex/textLayout/beads/DispatchTLFKeyboardEventBead.as   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/1ea5cd21/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/beads/DispatchTLFKeyboardEventBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/beads/DispatchTLFKeyboardEventBead.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/beads/DispatchTLFKeyboardEventBead.as
index 4a9855a..495532c 100644
--- a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/beads/DispatchTLFKeyboardEventBead.as
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/beads/DispatchTLFKeyboardEventBead.as
@@ -213,7 +213,7 @@ package org.apache.flex.textLayout.beads
 			{
 				var textEvent:org.apache.flex.text.events.TextEvent = new org.apache.flex.text.events.TextEvent(TextEvent.TEXT_INPUT);
 				if (event.key != null)
-					textEvent.text = String.fromCharCode(event.key);
+					textEvent.text = event.key;
 				else if (event['which'] != null)
 					textEvent.text = String.fromCharCode(event['which']);				  
 				else


[3/6] git commit: [flex-asjs] [refs/heads/tlf] - Backspace key wants to do shallow copy

Posted by ah...@apache.org.
Backspace key wants to do shallow copy


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

Branch: refs/heads/tlf
Commit: 95c47d3a03261b0b4977bd4285bcad8705f0c8a5
Parents: fa71222
Author: Alex Harui <ah...@apache.org>
Authored: Tue May 9 08:09:53 2017 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue May 9 08:14:03 2017 -0700

----------------------------------------------------------------------
 .../src/main/flex/org/apache/flex/textLayout/elements/TextFlow.as | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/95c47d3a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/elements/TextFlow.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/elements/TextFlow.as b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/elements/TextFlow.as
index c823f34..a36fe4b 100644
--- a/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/elements/TextFlow.as
+++ b/frameworks/projects/TLF/src/main/flex/org/apache/flex/textLayout/elements/TextFlow.as
@@ -305,7 +305,7 @@ package org.apache.flex.textLayout.elements
 		 * 
 		 */
 		 
-		public function TextFlow(tlfFactory:ITLFFactory,config:IConfiguration = null)
+		public function TextFlow(tlfFactory:ITLFFactory = null,config:IConfiguration = null)
 		{
 			_tlfFactory = tlfFactory;
 			super();
@@ -344,6 +344,7 @@ package org.apache.flex.textLayout.elements
 		public override function shallowCopy(startPos:int = 0, endPos:int = -1):IFlowElement
 		{		
 			var retFlow:TextFlow = super.shallowCopy(startPos, endPos) as TextFlow;
+			retFlow._tlfFactory = _tlfFactory;
 			retFlow._configuration = _configuration;
 			retFlow._generation = _nextGeneration++;
 			if (formatResolver)