> emulate the ITextFieldFactory subsystem

Looking at UITextFormat it looks like only SWF tries to use an 
ITextFieldFactory.

Is there an easy way to do that in swf?

From: Alex Harui<mailto:aha...@adobe.com.INVALID>
Sent: Sunday, November 7, 2021 8:11 AM
To: dev@royale.apache.org<mailto:dev@royale.apache.org>
Subject: Re: mxtests failing

I had misinterpreted Yishay's response to Josh.  I see that change is now in 
the develop branch and am seeing the ITextFieldFactory exception.  IMO, giving 
DG and other componets in the tests a fixed size isn't a recommended approach.  
I think it is best to keep trying to emulate how Flex sized-to-content.

The ITextFieldFactory exception appears to be a byproduct of the child resize 
handling.  The resize handlers correctly try to layout the 
DataGridHeaderRenderer, which exposes the fact that I don't think Royale has an 
emulation for ITextFieldFactory.

IMO, there at least two approaches possible.  One is to emulate the 
ITextFieldFactory subsystem.   Or at least a simplified version.  The 
ITextFieldFactory subsystem was designed to deal with how Flash handles 
embedded fonts in module SWFs.  I think the emulation becomes pretty simple if 
you assume no embedded fonts in module SWFs.

The second approach is to modify DataGridHeaderRenderer to not call measureText 
which uses the ITextFieldFactory subsystem and just do a simple measurement 
instead.  The label's view has a textField that appears to have the correct 
measurements.

HTH,
-Alex

On 11/6/21, 1:11 PM, "Yishay Weiss" <yishayj...@hotmail.com> wrote:

    I assume it’s something to so with measurement of DG now depending on 
number of rows in dp, and measurement throwing an exception when dg is null. 
I’ll see if I can find a quick fix for that later this week unless someone 
beats me to it.

    From: Yishay Weiss<mailto:yishayj...@hotmail.com>
    Sent: Saturday, November 6, 2021 10:05 PM
    To: dev@royale.apache.org<mailto:dev@royale.apache.org>
    Subject: RE: mxtests failing

    Yes, correct. I just pushed a fix for that. ListAndDataGridTest is also 
failing [1]. Giving DataGrid a fixed size (it used to be forced to 200x200) 
fixes it for some reason but I haven’t gotten further than that so far.

    [1]
    RESULT: 
scriptName=halo.scripts::ListAndDataGridTestScript&id=SetupListAndDataGridTest&result=fail&elapsed=260&phase=body&started=1636229005448&extraInfo=&msg=TypeError:
 Error #1009: Cannot access a property or method of a null object reference.^   
at mx.controls.listClasses::DataGridListBase/set 
dataProvider()[/org/apache/royale/0.9.9/mx/controls/listClasses/DataGridListBase.as:608]^
        at 
halo.views::ListAndDataGridTests/initListComponents()[C:/dev/full_royale_sdk/royale-asjs/mustella/tests/mxtests/basicTests/halo/views/ListAndDataGridTests.mxml:57]^
 at 
halo.views::ListAndDataGridTests/>0()[C:/dev/full_royale_sdk/royale-asjs/mustella/tests/mxtests/basicTests/halo/views/ListAndDataGridTests.mxml:24]^
 at flash.events::EventDispatcher/dispatchEventFunction()^   at 
flash.events::EventDispatcher/dispatchEvent()^  at 
org.apache.royale.core::UIBase/dispatchEvent()[/org/apache/royale/0.9.9/org/apache/royale/core/UIBase.as:1577]^
      at 
mx.core::UIComponent/initializationComplete()[/org/apache/royale/0.9.9/mx/core/UIComponent.as:4175]^
 at 
mx.core::UIComponent/initialize()[/org/apache/royale/0.9.9/mx/core/UIComponent.as:4154]^
   at 
mx.core::UIComponent/addedToParent()[/org/apache/royale/0.9.9/mx/core/UIComponent.as:2419]^
 at 
mx.core::Container/addedToParent()[/org/apache/royale/0.9.9/mx/core/Container.as:1090]^
     at 
mx.containers::Box/addedToParent()[/org/apache/royale/0.9.9/mx/containers/Box.as:229]^
        at 
org.apache.royale.core::UIBase/addElementAt()[/org/apache/royale/0.9.9/org/apache/royale/core/UIBase.as:1209]^
      at 
mx.core::Container/addElementAt()[/org/apache/royale/0.9.9/mx/core/Container.as:1442]^
       at 
org.apache.royale.core::StatesWithTransitionsImpl/apply()[/org/apache/royale/0.9.9/org/apache/royale/core/StatesWithTransitionsImpl.as:361]^
        at 
org.apache.royale.core::StatesWithTransitionsImpl/stateChangeHandler()[/org/apache/royale/0.9.9/org/apache/royale/core/StatesWithTransitionsImpl.as:162]^
   at flash.events::EventDispatcher/dispatchEventFunction()^   at 
flash.events::EventDispatcher/dispatchEvent()^  at 
org.apache.royale.core::UIBase/dispatchEvent()[/org/apache/royale/0.9.9/org/apache/royale/core/UIBase.as:1577]^
      at mx.core::UIComponent/set 
currentState()[/org/apache/royale/0.9.9/mx/core/UIComponent.as:3587]^           
at 
SetProperty/doStep()[C:/dev/full_royale_sdk/royale-asjs/mustella/src/main/royale/SetProperty.as:90]^
       at 
TestStep/execute()[C:/dev/full_royale_sdk/royale-asjs/mustella/src/main/royale/TestStep.as:75]^
  at 
SetProperty/execute()[C:/dev/full_royale_sdk/royale-asjs/mustella/src/main/royale/SetProperty.as:52]^
       at 
TestCase/runSteps()[C:/dev/full_royale_sdk/royale-asjs/mustella/src/main/royale/TestCase.as:443]^
          at 
TestCase/runBody()[C:/dev/full_royale_sdk/royale-asjs/mustella/src/main/royale/TestCase.as:318]^
          at 
TestCase/runSetup()[C:/dev/full_royale_sdk/royale-asjs/mustella/src/main/royale/TestCase.as:296]^
          at 
TestCase/runTest()[C:/dev/full_royale_sdk/royale-asjs/mustella/src/main/royale/TestCase.as:264]^
          at 
UnitTester/runTests()[C:/dev/full_royale_sdk/royale-asjs/mustella/src/main/royale/UnitTester.as:2113]^
     at 
UnitTester/startTests()[C:/dev/full_royale_sdk/royale-asjs/mustella/src/main/royale/UnitTester.as:2046]^
     at 
ScriptRunner/runScripts()[C:/dev/full_royale_sdk/royale-asjs/mustella/src/main/royale/ScriptRunner.as:41]^
     at 
UnitTester$/enterFrameHandler()[C:/dev/full_royale_sdk/royale-asjs/mustella/src/main/royale/UnitTester.as:1253]

    From: Greg Dove<mailto:greg.d...@gmail.com>
    Sent: Saturday, November 6, 2021 7:44 AM
    To: Apache Royale Development<mailto:dev@royale.apache.org>
    Subject: Re: mxtests failing

    Alex, I think Josh already pointed out a likely cause and possible fix in
    another thread. There was an override in the child resize branch that was
    calling its super method for js but not for swf, iirc.

    On Sat, 6 Nov 2021, 5:09 pm Alex Harui, <aha...@adobe.com.invalid> wrote:

    > I took a quick look today.  I think there is an earlier issue that need to
    > be resolved.  The BasicTests "app" has a width of 0, so you never see
    > anything on screen.  Looks like that is due to some sizedToContent issues.
    > I'd recommend fixing that before looking at the stage-is-null issue.
    >
    > The mxtests use states to add children.  So it is fair for the app to
    > start at width 0, but as soon as the first test adds a child, it should
    > invalidate that size and recalculate it.
    >
    > Putting a Label in the app probably gives it size, but it is probably best
    > to resolve the root issue.  If the stage is null, it means that the
    > component is not in the Flash DOM.  It looks like that component is the
    > ComboBox dropdown list, but if the app is clipping things so they can't be
    > clicked on, then maybe the dropdown never got put in the DOM.
    >
    > I might have time to look further this weekend, but I can't guarantee it.
    >
    > HTH,
    > -Alex
    >
    > On 11/2/21, 10:38 AM, "Yishay Weiss" <yish...@apache.org> wrote:
    >
    >     fdb shows this line
    >
    >     =121                    var targets:Array =
    > actualTarget.stage.getObjectsUnderPoint(stagePt);
    >
    >     in DispatchMouseEvent fails because actualTarget.stage in null
    > (actualTarget is ComboBoxList)
    >
    >     This rings familiar, so if anyone has a recollection, please share.
    > Otherwise, I'll continue to search the offending commit.
    >
    >     On 2021/11/02 12:42:51, Yishay Weiss <yish...@apache.org> wrote:
    >     > Could be the ChildResize merge (CI shows it started failing after
    > that). I'll have a look.Thanks.
    >     >
    >     > On 2021/11/02 05:26:09, Edward Stangler <estang...@bradmark.com>
    > wrote:
    >     > > Anyone else having problems with:  ant mxtests
    >     > >
    >     > > Flash Debug Player comes up, but nothing happens.  It's a recent
    >     > > change;  it was working not too long ago.  Other tests run fine.
    >     > >
    >     > > flashlog.txt:
    >     > >
    >     > > TestCase Start: ComboBoxTestScript$SetupComboBoxTest
    >     > > RESULT:
    >     > >
    > 
scriptName=halo.scripts::ComboBoxTestScript&id=SetupComboBoxTest&result=pass&elapsed=108&phase=body&started=1635825506757&extraInfo=&msg=
    >     > > TestCase Start: ComboBoxTestScript$ComboBoxTest1
    >     > > RESULT:
    >     > >
    > 
scriptName=halo.scripts::ComboBoxTestScript&id=ComboBoxTest1&result=fail&elapsed=2&phase=body&started=1635825506894&extraInfo=null&msg=AssertPropertyValue(body:step
    >     > > 3)  haloComboBoxTests.testCombo.dropdown.visible false != true
    >     > > TestCase Start: ComboBoxTestScript$ComboBoxTest2
    >     > > runid.properties ERROR handler with: [SecurityErrorEvent
    >     > > type="securityError" bubbles=false cancelable=false eventPhase=2
    >     > > text="Error #2048: Security sandbox violation:
    >     > >
    > 
file:///C|/somewhere/royale%2Dasjs/mustella/tests/mxtests/basicTests/BasicTests.swf<file:///C:/somewhere/royale%2Dasjs/mustella/tests/mxtests/basicTests/BasicTests.swf><file:///C:/somewhere/royale%2Dasjs/mustella/tests/mxtests/basicTests/BasicTests.swf%3cfile:/C:/somewhere/royale%2Dasjs/mustella/tests/mxtests/basicTests/BasicTests.swf%3e><file:///C:/somewhere/royale%2Dasjs/mustella/tests/mxtests/basicTests/BasicTests.swf%3cfile:/C:/somewhere/royale%2Dasjs/mustella/tests/mxtests/basicTests/BasicTests.swf%3e%3cfile:/C:/somewhere/royale%2Dasjs/mustella/tests/mxtests/basicTests/BasicTests.swf%3cfile:/C:/somewhere/royale%2Dasjs/mustella/tests/mxtests/basicTests/BasicTests.swf%3e%3e>
    >     > > cannot load data from
    >     > >
    > 
http://localhost:80/runid.properties?0.94145911047235131635825506356.";]<http://localhost:80/runid.properties?0.94145911047235131635825506356.%22%5d><http://localhost:80/runid.properties?0.94145911047235131635825506356.%22%5d%3chttp://localhost:80/runid.properties?0.94145911047235131635825506356.%22%5d%3e><http://localhost:80/runid.properties?0.94145911047235131635825506356.%22%5d%3chttp://localhost:80/runid.properties?0.94145911047235131635825506356.%22%5d%3e%3chttp://localhost:80/runid.properties?0.94145911047235131635825506356.%22%5d%3chttp://localhost:80/runid.properties?0.94145911047235131635825506356.%22%5d%3e%3e>
    >     > >
    >     > >
    >     > >
    >     >
    >
    >


Reply via email to