You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2018/02/22 01:27:57 UTC

[royale-asjs] 01/10: remove * selector and use global as the 'browser defaults' for SWF side. Set default font-size to 16 and use serif font to match FireFox, Safari and Chrome. Set default control font size to 11px Arial to match browsers as well

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

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

commit e1398bba9cb45aa4b368d231e74b82ac7df03189
Author: Alex Harui <ah...@apache.org>
AuthorDate: Wed Feb 21 13:00:02 2018 -0800

    remove * selector and use global as the 'browser defaults' for SWF side.  Set default font-size to 16 and use serif font to match FireFox, Safari and Chrome.  Set default control font size to 11px Arial to match browsers as well
---
 .../projects/Basic/src/main/resources/defaults.css | 38 +++++++++++++++++-----
 .../apache/royale/html/beads/DropDownListView.as   |  3 ++
 .../org/apache/royale/core/SimpleCSSValuesImpl.as  | 24 ++++++++------
 3 files changed, 47 insertions(+), 18 deletions(-)

diff --git a/frameworks/projects/Basic/src/main/resources/defaults.css b/frameworks/projects/Basic/src/main/resources/defaults.css
index c3f05d4..2f67fa3 100644
--- a/frameworks/projects/Basic/src/main/resources/defaults.css
+++ b/frameworks/projects/Basic/src/main/resources/defaults.css
@@ -20,14 +20,6 @@
 @namespace "library://ns.apache.org/royale/basic";
 @namespace svg "library://ns.apache.org/royale/svg";
 
-/* Global style declaration */
-*
-{
-	font-family: "Arial";
-	font-size: 12px;
-	border-width: 1px;
-}
-
 .Application *, .royale *, . royale *:before, . royale *:after {
 	-moz-box-sizing: border-box;
 	-webkit-box-sizing: border-box;
@@ -746,6 +738,14 @@ global
 
 @media -royale-swf
 {
+	/* Global style declaration for Flash only.  This will effectively be the same
+	   as the browser defaults */
+	global
+	{
+		font-size: 16px;
+		border-width: 1px;
+	}
+
 	Accordion {
 		IContentView: ClassReference("org.apache.royale.html.supportClasses.DataGroup");
 	}
@@ -779,12 +779,16 @@ global
 	{
 		IBeadModel: ClassReference("org.apache.royale.html.beads.models.ToggleButtonModel");
 		IBeadView:  ClassReference("org.apache.royale.html.beads.CheckBoxView");			
+		font-size: 11px;
+		font-family: Arial;
 	}
 	
 	CSSCheckBox
 	{
 		IBeadModel: ClassReference("org.apache.royale.html.beads.models.ToggleButtonModel");
 		IBeadView:  ClassReference("org.apache.royale.html.beads.CheckBoxView");			
+		font-size: 11px;
+		font-family: Arial;
 	}
 	
 	CloseButton
@@ -814,12 +818,16 @@ global
 	DataGrid {
 		IBackgroundBead: ClassReference("org.apache.royale.html.beads.SolidBackgroundBead");
 		IBorderBead: ClassReference("org.apache.royale.html.beads.SingleLineBorderBead");
+		font-size: 11px;
+		font-family: Arial;
 	}
 	
 	DataContainer {
 		IBackgroundBead: ClassReference("org.apache.royale.html.beads.SolidBackgroundBead");
 		IBorderBead: ClassReference("org.apache.royale.html.beads.SingleLineBorderBead");
 		IContentView: ClassReference("org.apache.royale.html.supportClasses.DataGroup");
+		font-size: 11px;
+		font-family: Arial;
 	}
 	
 	DataGridButtonBar {
@@ -859,6 +867,8 @@ global
 		IBeadView: ClassReference("org.apache.royale.html.beads.DropDownListView");
 		IBeadController: ClassReference("org.apache.royale.html.beads.controllers.DropDownListController");
 		IPopUp: ClassReference("org.apache.royale.html.supportClasses.DropDownListList");
+		font-size: 11px;
+		font-family: Arial;
 	}
 	
 	DropDownListList
@@ -875,6 +885,8 @@ global
 		border-color: #333333;
 		border-width: 1px;
 		background-color: #FFFFFF;
+		font-size: 11px;
+		font-family: Arial;
 	}
 	
 	Group
@@ -912,6 +924,8 @@ global
 		iBorderBead: ClassReference('org.apache.royale.html.beads.SingleLineBorderBead');
 		iBorderModel: ClassReference('org.apache.royale.html.beads.models.SingleLineBorderModel');
 		IContentView: ClassReference("org.apache.royale.html.supportClasses.DataGroup");
+		font-size: 11px;
+		font-family: Arial;
 	}
 	
 	MenuItemRenderer
@@ -951,6 +965,8 @@ global
 	{
 		IBeadModel: ClassReference("org.apache.royale.html.beads.models.ValueToggleButtonModel");
 		IBeadView:  ClassReference("org.apache.royale.html.beads.RadioButtonView");			
+		font-size: 11px;
+		font-family: Arial;
 	}
 	
 	VScrollBar
@@ -1024,6 +1040,8 @@ global
 		border-color: #000000;
 		border-width: 1px;
 		background-color: #FFFFFF;
+		font-size: 11px;
+		font-family: Arial;
 	}
 	
 	TextButton
@@ -1031,6 +1049,8 @@ global
 		IBeadModel: ClassReference("org.apache.royale.html.beads.models.TextModel");
 		IBeadView: ClassReference("org.apache.royale.html.beads.CSSTextButtonView");
 		iMeasurementBead: ClassReference("org.apache.royale.html.beads.TextButtonMeasurementBead");
+		font-size: 11px;
+		font-family: Arial;
 	}
 	
 	Tree {
@@ -1056,6 +1076,8 @@ global
 		border-color: #000000;
 		border-width: 1px;
 		background-color: #FFFFFF;
+		font-size: 11px;
+		font-family: Arial;
 	}
 	
 	TitleBar
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/DropDownListView.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/DropDownListView.as
index 7ce266a..285ddd5 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/DropDownListView.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/DropDownListView.as
@@ -122,6 +122,9 @@ package org.apache.royale.html.beads
 			shape.graphics.beginFill(0xCCCCCC);
 			shape.graphics.drawRect(0, 0, 10, 10);
 			shape.graphics.endFill();
+            upTextField.styleParent = _strand;
+            downTextField.styleParent = _strand;
+            overTextField.styleParent = _strand;
             var button:SimpleButton = value as SimpleButton;
 			button.upState = upSprite;
             button.downState = downSprite;
diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/SimpleCSSValuesImpl.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/SimpleCSSValuesImpl.as
index c3560bf..751af9d 100644
--- a/frameworks/projects/Core/src/main/royale/org/apache/royale/core/SimpleCSSValuesImpl.as
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/core/SimpleCSSValuesImpl.as
@@ -408,6 +408,12 @@ package org.apache.royale.core
                 }
 			}
 			
+            o = values["*"];			
+            if (o !== undefined)
+            {
+                return o[valueName];
+            }
+            
             COMPILE::SWF
             {
     			className = getQualifiedClassName(thisObject);
@@ -466,18 +472,16 @@ package org.apache.royale.core
                     return getValue(parentObject, valueName, state, attrs);
             }
             
-            o = values["global"];
-            if (o !== undefined)
+            COMPILE::SWF
             {
-    			value = o[valueName];
-    			if (value !== undefined)
-    				return value;
+                o = values["global"];
+                if (o !== undefined)
+                {
+                    value = o[valueName];
+                    if (value !== undefined)
+                        return value;
+                }
             }
-			o = values["*"];			
-			if (o !== undefined)
-			{
-				return o[valueName];
-			}
 			return undefined;
 		}
 		

-- 
To stop receiving notification emails like this one, please contact
aharui@apache.org.