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 695b1e7783 background styles
695b1e7783 is described below

commit 695b1e77838a0b50884c227f63e3a2a9ae6eb3c2
Author: Harbs <[email protected]>
AuthorDate: Tue Feb 24 16:18:04 2026 +0200

    background styles
---
 .../royale/style/stylebeads/SingleStyleBase.as     |  4 +-
 .../stylebeads/background/BackgroundAttachment.as  | 36 +++++++++++++++
 .../style/stylebeads/background/BackgroundClip.as  | 44 ++++++++++++++++++
 .../style/stylebeads/background/BackgroundColor.as | 41 +++++++++++++++++
 .../style/stylebeads/background/BackgroundImage.as | 39 ++++++++++++++++
 .../stylebeads/background/BackgroundOrigin.as      | 37 +++++++++++++++
 .../stylebeads/background/BackgroundPosition.as    | 36 +++++++++++++++
 .../stylebeads/background/BackgroundRepeat.as      | 53 ++++++++++++++++++++++
 .../style/stylebeads/background/BackgroundSize.as  | 48 ++++++++++++++++++++
 9 files changed, 336 insertions(+), 2 deletions(-)

diff --git 
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/SingleStyleBase.as
 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/SingleStyleBase.as
index 2593a9f1ca..85e9cf210b 100644
--- 
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/SingleStyleBase.as
+++ 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/SingleStyleBase.as
@@ -87,9 +87,9 @@ package org.apache.royale.style.stylebeads
                        if(strVal == "100%")
                                return "full";
                        if(strVal.indexOf("%") >= 0)
-                               return "p" + strVal.replace(/%/g, "");
+                               strVal = strVal.replace(/%/g, "p");
                        
-                       return value.replace(/[\.\s]/g, "-");
+                       return strVal.replace(/[\.\s]/g, "-");
                }
 
        }
diff --git 
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/background/BackgroundAttachment.as
 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/background/BackgroundAttachment.as
new file mode 100644
index 0000000000..130713b84a
--- /dev/null
+++ 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/background/BackgroundAttachment.as
@@ -0,0 +1,36 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 org.apache.royale.style.stylebeads.background
+{
+       import org.apache.royale.style.stylebeads.SingleStyleBase;
+       import org.apache.royale.debugging.assert;
+
+       public class BackgroundAttachment extends SingleStyleBase
+       {
+               public function BackgroundAttachment()
+               {
+                       super("bg", "background-attachment");
+               }
+               override public function set value(value:*):void
+               {
+                       assert(["scroll","fixed","local"].indexOf(value) >= 0, 
"Invalid value for background-attachment: " + value);
+                       calculatedRuleValue = calculatedSelector = _value = 
value;
+               }
+       }
+}
\ No newline at end of file
diff --git 
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/background/BackgroundClip.as
 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/background/BackgroundClip.as
new file mode 100644
index 0000000000..2d88d02340
--- /dev/null
+++ 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/background/BackgroundClip.as
@@ -0,0 +1,44 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 org.apache.royale.style.stylebeads.background
+{
+       import org.apache.royale.style.stylebeads.SingleStyleBase;
+       import org.apache.royale.debugging.assert;
+
+       public class BackgroundClip extends SingleStyleBase
+       {
+               public function BackgroundClip()
+               {
+                       super("bg-clip", "background-clip");
+               }
+               private function getBeforeDash(value:String):String
+               {
+                       var dashIndex:int = value.indexOf("-");
+                       if(dashIndex >= 0)
+                               return value.substring(0, dashIndex);
+                       return value;
+               }
+               override public function set value(value:*):void
+               {
+                       
assert(["border-box","padding-box","content-box","text"].indexOf(value) >= 0, 
"Invalid value for background-clip: " + value);
+                       calculatedRuleValue = _value = value;
+                       calculatedSelector = getBeforeDash(value);
+               }
+       }
+}
\ No newline at end of file
diff --git 
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/background/BackgroundColor.as
 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/background/BackgroundColor.as
new file mode 100644
index 0000000000..c12cd2dae2
--- /dev/null
+++ 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/background/BackgroundColor.as
@@ -0,0 +1,41 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 org.apache.royale.style.stylebeads.background
+{
+       import org.apache.royale.style.stylebeads.SingleStyleBase;
+       import org.apache.royale.debugging.assert;
+
+       public class BackgroundColor extends SingleStyleBase
+       {
+               public function BackgroundColor()
+               {
+                       super("bg", "background-color");
+               }
+               private function toSelector(value:String):String
+               {
+                       return value.replace(" ", "-");
+               }
+               override public function set value(value:*):void
+               {
+                       assert(["scroll","fixed","local"].indexOf(value) >= 0, 
"Invalid value for background-attachment: " + value);
+                       calculatedRuleValue = _value = value;
+                       calculatedSelector = sanitizeSelector(value);
+               }
+       }
+}
\ No newline at end of file
diff --git 
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/background/BackgroundImage.as
 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/background/BackgroundImage.as
new file mode 100644
index 0000000000..597ba95101
--- /dev/null
+++ 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/background/BackgroundImage.as
@@ -0,0 +1,39 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 org.apache.royale.style.stylebeads.background
+{
+       import org.apache.royale.style.stylebeads.SingleStyleBase;
+       import org.apache.royale.debugging.assert;
+
+       public class BackgroundImage extends SingleStyleBase
+       {
+               public function BackgroundImage()
+               {
+                       super("bg", "background-image");
+               }
+               /**
+                * TODO add support for gradients and other non-url values
+                */
+               override public function set value(value:*):void
+               {
+                       calculatedRuleValue = _value = value;
+                       calculatedSelector = sanitizeSelector(value);
+               }
+       }
+}
\ No newline at end of file
diff --git 
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/background/BackgroundOrigin.as
 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/background/BackgroundOrigin.as
new file mode 100644
index 0000000000..29937962b0
--- /dev/null
+++ 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/background/BackgroundOrigin.as
@@ -0,0 +1,37 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 org.apache.royale.style.stylebeads.background
+{
+       import org.apache.royale.style.stylebeads.SingleStyleBase;
+       import org.apache.royale.debugging.assert;
+
+       public class BackgroundOrigin extends SingleStyleBase
+       {
+               public function BackgroundOrigin()
+               {
+                       super("bg-origin", "background-origin");
+               }
+               override public function set value(value:*):void
+               {
+                       
assert(["border-box","padding-box","content-box"].indexOf(value) >= 0, "Invalid 
value for background-origin: " + value);
+                       calculatedRuleValue = _value = value;
+                       calculatedSelector = value.slice(0,-4);
+               }
+       }
+}
\ No newline at end of file
diff --git 
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/background/BackgroundPosition.as
 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/background/BackgroundPosition.as
new file mode 100644
index 0000000000..cf63a6cd22
--- /dev/null
+++ 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/background/BackgroundPosition.as
@@ -0,0 +1,36 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 org.apache.royale.style.stylebeads.background
+{
+       import org.apache.royale.style.stylebeads.SingleStyleBase;
+       import org.apache.royale.debugging.assert;
+
+       public class BackgroundPosition extends SingleStyleBase
+       {
+               public function BackgroundPosition()
+               {
+                       super("bg", "background-position");
+               }
+               override public function set value(value:*):void
+               {
+                       calculatedRuleValue = _value = value;
+                       calculatedSelector = sanitizeSelector(value);
+               }
+       }
+}
\ No newline at end of file
diff --git 
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/background/BackgroundRepeat.as
 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/background/BackgroundRepeat.as
new file mode 100644
index 0000000000..61241811d5
--- /dev/null
+++ 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/background/BackgroundRepeat.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 org.apache.royale.style.stylebeads.background
+{
+       import org.apache.royale.style.stylebeads.SingleStyleBase;
+       import org.apache.royale.debugging.assert;
+
+       public class BackgroundRepeat extends SingleStyleBase
+       {
+               public function BackgroundRepeat()
+               {
+                       super("bg", "background-repeat");
+               }
+               override public function set value(value:*):void
+               {
+                       
assert(["repeat","repeat-x","x","repeat-y","y","space","round","no-repeat"].indexOf(value)
 >= 0, "Invalid value for background-attachment: " + value);
+                       var ruleValue:String = value;
+                       var selectorValue:String = value;
+                       switch(value)
+                       {
+                               case "x":
+                                       selectorValue = ruleValue = "repeat-x";
+                                       break;
+                               case "y":
+                                       selectorValue = ruleValue = "repeat-y";
+                                       break;
+                               case "space":
+                               case "round":
+                                       selectorValue = "repeat-" + value;
+                                       break;
+                       }
+                       calculatedRuleValue = ruleValue;
+                       calculatedSelector = selectorValue;
+                       _value = value;
+               }
+       }
+}
\ No newline at end of file
diff --git 
a/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/background/BackgroundSize.as
 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/background/BackgroundSize.as
new file mode 100644
index 0000000000..caa85a405b
--- /dev/null
+++ 
b/frameworks/projects/Style/src/main/royale/org/apache/royale/style/stylebeads/background/BackgroundSize.as
@@ -0,0 +1,48 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 org.apache.royale.style.stylebeads.background
+{
+       import org.apache.royale.style.stylebeads.SingleStyleBase;
+       import org.apache.royale.debugging.assert;
+
+       public class BackgroundSize extends SingleStyleBase
+       {
+               public function BackgroundSize()
+               {
+                       super("bg", "background-size");
+               }
+               override public function set value(value:*):void
+               {
+                       var selectorValue:String = value;
+                       switch(value)
+                       {
+                               case "auto":
+                               case "cover":
+                               case "contain":
+                                       // nothing to change
+                                       break;
+                               default:
+                                       selectorValue = "size-" + 
sanitizeSelector(value);
+                                       break;
+                       }
+                       calculatedRuleValue = _value = value;
+                       calculatedSelector = selectorValue;
+               }
+       }
+}
\ No newline at end of file

Reply via email to