This is an automated email from the ASF dual-hosted git repository.

harbs pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 23f48a4751 performance improvements
23f48a4751 is described below

commit 23f48a475140c8c08a9997585a29a71940652f3a
Author: Harbs <[email protected]>
AuthorDate: Thu Mar 19 19:20:58 2026 +0200

    performance improvements
---
 .../org/apache/royale/style/stylebeads/LeafStyleBase.as   | 15 ++++++++-------
 .../royale/style/stylebeads/states/FocusVisibleState.as   |  3 ++-
 .../apache/royale/style/stylebeads/states/PeerPseudo.as   |  5 +++--
 3 files changed, 13 insertions(+), 10 deletions(-)

diff --git 
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/LeafStyleBase.as
 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/LeafStyleBase.as
index 9db0c0ec76..b5ac99f5a2 100644
--- 
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/LeafStyleBase.as
+++ 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/LeafStyleBase.as
@@ -199,17 +199,18 @@ package org.apache.royale.style.stylebeads
                                return "";
                        return ruleBase + ":" + calculatedRuleValue + ";";
                }
+               private static const SPACE_DOT_REGEX:RegExp = /[\s\.]/g;
+               private static const PERCENT_REGEX:RegExp = /%/g;
                protected function sanitizeSelector(value:String):String
                {
-                       var strVal:String = "" + value;
-                       if(strVal.indexOf("-") == 0)
-                               strVal = strVal.substring(1);
-                       if(strVal == "100%")
+                       if(value.indexOf("-") == 0)
+                               value = value.substring(1);
+                       if(value == "100%")
                                return "full";
-                       if(strVal.indexOf("%") >= 0)
-                               strVal = strVal.replace(/%/g, "p");
+                       if(value.indexOf("%") >= 0)
+                               value = value.replace(PERCENT_REGEX, "p");
                        
-                       return strVal.replace(/[\.\s]/g, "-");
+                       return value.replace(SPACE_DOT_REGEX, "-");
                }
                protected function acceptVar(value:String):String
                {
diff --git 
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/FocusVisibleState.as
 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/FocusVisibleState.as
index f63c694520..3c20783213 100644
--- 
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/FocusVisibleState.as
+++ 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/FocusVisibleState.as
@@ -20,11 +20,12 @@ package org.apache.royale.style.stylebeads.states
 {
        public class FocusVisibleState extends LeafDecorator
        {
-               public function FocusVisibleState()
+               public function FocusVisibleState(styles:Array = null)
                {
                        super();
                        selectorDecorator = "focus-visible:";
                        ruleDecorator = ":focus-visible";
+                       this.styles = styles;
                }
        }
 }
\ No newline at end of file
diff --git 
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/PeerPseudo.as
 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/PeerPseudo.as
index 7e26899251..bee03edbb5 100644
--- 
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/PeerPseudo.as
+++ 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/states/PeerPseudo.as
@@ -39,9 +39,10 @@ package org.apache.royale.style.stylebeads.states
 
                        //TODO figure out more complex combinations. For now, 
just handle limited nesting.
                        var decorationStr:String = ""
-                       for each(var decoration:StyleDecoration in decorations)
+                       var len:int = decorations.length;
+                       for(var i:int = 0; i < len; i++)
                        {
-                               decorationStr += decoration.decoration;
+                               decorationStr += decorations[i].decoration;     
                        
                        }
                        
                        decorations.push(new StyleDecoration(decoratorType, 
ruleDecorator));

Reply via email to