changeset 706:e1dc3a64d8c9

branch merge
author David Grieve<david.grieve@oracle.com>
date Fri, 23 Mar 2012 13:39:47 -0400
parents 4703f60525c5 3f8024091f63
children cabf09d667e8
files
diffstat 2 files changed, 38 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-common/src/com/sun/javafx/css/StyleHelper.java	Fri Mar 23 13:39:34 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/css/StyleHelper.java	Fri Mar 23 13:39:47 2012 -0400
@@ -1165,20 +1165,6 @@
             Map<String,CascadingStyle> userStyles, 
             Node originatingNode, CacheEntry cacheEntry, List<Style> styleList) {
         
-        //
-        // RT-20145 - if node has the property, use the property value instead
-        // of looking for matching styles. If the property was styled, then 
-        // we are getting the right value since the parent is styled before the
-        // child. If the property was not styled, then we're still getting the
-        // right value - either the default value or some user set value.
-        //
-
-        WritableValue prop = styleable.getWritableValue(node);
-        if (prop != null) {
-            final Stylesheet.Origin origin = StyleableProperty.getOrigin(prop);
-            return new CalculatedValue(prop.getValue(), origin, true);
-        }
-        
         // Locate the first parentStyleHelper in the hierarchy
         Node parent = node.getParent();        
         StyleHelper parentStyleHelper = parent == null ? null : parent.impl_getStyleHelper();
--- a/javafx-ui-common/test/unit/com/sun/javafx/css/HonorDeveloperSettingsTest.java	Fri Mar 23 13:39:34 2012 -0400
+++ b/javafx-ui-common/test/unit/com/sun/javafx/css/HonorDeveloperSettingsTest.java	Fri Mar 23 13:39:47 2012 -0400
@@ -260,4 +260,42 @@
         assertEquals(14, text.getStrokeWidth(), 0.00001);
         
     }
+    
+    @Test
+    public void testInlineStyleInheritedFromParentApplies() {
+        
+        // must remove the id so we don't pick up the ua style
+        text.setId(null);
+        text.setStyle("-fx-stroke-width: 1em;");
+        
+        scene.getRoot().setStyle("-fx-font: 18 Amble;");
+        
+        Toolkit.getToolkit().firePulse();
+        
+        //
+        // If RT-20513 is not working, then the code will _not_ 
+        // pick up the inline style
+        //        
+        assertEquals(18, text.getStrokeWidth(), 0.00001);
+        
+    }
+    
+    @Test
+    public void testInlineStyleNotInheritedFromParentWhenUserSetsFont() {
+        
+        // must remove the id so we don't pick up the ua style
+        text.setId(null);
+        text.setStyle("-fx-stroke-width: 1em;");
+        
+        Font font = Font.font("Amble", 14);
+        text.setFont(font);
+        
+        scene.getRoot().setStyle("-fx-font: 18 Amble;");
+        
+        Toolkit.getToolkit().firePulse();
+                
+        assertEquals(14, text.getStrokeWidth(), 0.00001);
+        
+    }
+    
 }