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 d98643fcf8 outline accepts three optional arguments
d98643fcf8 is described below

commit d98643fcf8ca3a3d0e26031fd62045dac4df1d1c
Author: Harbs <[email protected]>
AuthorDate: Wed Jun 17 14:35:22 2026 +0300

    outline accepts three optional arguments
---
 .../royale/style/stylebeads/border/Outline.as      |  8 +++-
 .../src/test/royale/FlexUnitRoyaleApplication.mxml |  3 +-
 .../src/test/royale/flexUnitTests/OutlineTest.as   | 53 ++++++++++++++++++++++
 3 files changed, 62 insertions(+), 2 deletions(-)

diff --git 
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/Outline.as
 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/Outline.as
index d98d0e0303..43bcf31bac 100644
--- 
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/Outline.as
+++ 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/border/Outline.as
@@ -27,10 +27,16 @@ package org.apache.royale.style.stylebeads.border
         */
        public class Outline extends CompositeStyle
        {
-               public function Outline()
+               public function Outline(width:*=null, style:*=null, 
color:*=null)
                {
                        super();
                        styles = [];
+                       if (width != null)
+                               this.width = width;
+                       if (style != null)
+                               this.style = style;
+                       if (color != null)
+                               this.color = color;
                }
                private var _color:String;
 
diff --git 
a/frameworks/projects/Style/src/test/royale/FlexUnitRoyaleApplication.mxml 
b/frameworks/projects/Style/src/test/royale/FlexUnitRoyaleApplication.mxml
index 310ba07fa3..637eaf85f0 100644
--- a/frameworks/projects/Style/src/test/royale/FlexUnitRoyaleApplication.mxml
+++ b/frameworks/projects/Style/src/test/royale/FlexUnitRoyaleApplication.mxml
@@ -37,6 +37,7 @@ limitations under the License.
             import flexUnitTests.StyleManagerTest;
             import flexUnitTests.PaddingTest;
             import flexUnitTests.MarginTest;
+            import flexUnitTests.OutlineTest;
             import flexUnitTests.ColorUtilsContrastTest;
             import flexUnitTests.ColorUtilsContrastFunctionTest;
             import flexUnitTests.ThemeColorSetTest;
@@ -96,7 +97,7 @@ limitations under the License.
                 {
                     core.addEventListener(Event.COMPLETE, 
core_completeHandler);
                     // Insert test classes here. For example:
-                    
core.runClasses(StyleManagerTest,PaddingTest,MarginTest,ColorUtilsContrastFunctionTest,ColorUtilsContrastTest,ThemeColorSetTest);
+                    
core.runClasses(StyleManagerTest,PaddingTest,MarginTest,OutlineTest,ColorUtilsContrastFunctionTest,ColorUtilsContrastTest,ThemeColorSetTest);
                 }
             }
 
diff --git 
a/frameworks/projects/Style/src/test/royale/flexUnitTests/OutlineTest.as 
b/frameworks/projects/Style/src/test/royale/flexUnitTests/OutlineTest.as
new file mode 100644
index 0000000000..2e4693e3c3
--- /dev/null
+++ b/frameworks/projects/Style/src/test/royale/flexUnitTests/OutlineTest.as
@@ -0,0 +1,53 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 flexUnitTests
+{
+       import org.apache.royale.style.stylebeads.ILeafStyleBead;
+       import org.apache.royale.style.stylebeads.border.Outline;
+       import org.apache.royale.test.asserts.*;
+
+       public class OutlineTest
+       {
+               [Test]
+               public function testConstructorSetsOptionalArguments():void
+               {
+                       var outline:Outline = new Outline("2px", "solid", 
"red");
+                       var leaves:Array = outline.getLeaves();
+
+                       assertEquals("2px", outline.width);
+                       assertEquals("solid", outline.style);
+                       assertEquals("red", outline.color);
+                       assertEquals(3, leaves.length);
+                       assertEquals("outline-width:2px;", 
ILeafStyleBead(leaves[0]).getRule());
+                       assertEquals("outline-style:solid;", 
ILeafStyleBead(leaves[1]).getRule());
+                       assertEquals("outline-color:red;", 
ILeafStyleBead(leaves[2]).getRule());
+               }
+
+               [Test]
+               public function testConstructorSkipsNullOptionalArguments():void
+               {
+                       var outline:Outline = new Outline(null, "dashed");
+
+                       assertNull(outline.width);
+                       assertEquals("dashed", outline.style);
+                       assertNull(outline.color);
+                       assertEquals(1, outline.getLeaves().length);
+               }
+       }
+}
\ No newline at end of file

Reply via email to