changeset 5293:78d4d74d1100

RT-33383: background-position: 50% does not center the image Reviewed-by: dgrieve
author rbair
date Mon, 07 Oct 2013 16:23:57 -0700
parents ab3b347eb645
children 94d55039bc0d
files modules/graphics/src/main/java/com/sun/javafx/css/parser/CSSParser.java
diffstat 1 files changed, 23 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/javafx/css/parser/CSSParser.java	Mon Oct 07 12:01:51 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/css/parser/CSSParser.java	Mon Oct 07 16:23:57 2013 -0700
@@ -25,7 +25,6 @@
 
 package com.sun.javafx.css.parser;
 
-import javafx.css.ParsedValue;
 import javafx.css.Styleable;
 import javafx.geometry.Insets;
 import javafx.scene.effect.BlurType;
@@ -45,28 +44,13 @@
 import javafx.scene.text.Font;
 import javafx.scene.text.FontPosture;
 import javafx.scene.text.FontWeight;
-import java.io.BufferedReader;
-import java.io.CharArrayReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
 import com.sun.javafx.Utils;
 import com.sun.javafx.css.Combinator;
 import com.sun.javafx.css.CompoundSelector;
 import com.sun.javafx.css.CssError;
 import com.sun.javafx.css.Declaration;
 import com.sun.javafx.css.FontFace;
+import javafx.css.ParsedValue;
 import com.sun.javafx.css.ParsedValueImpl;
 import com.sun.javafx.css.Rule;
 import com.sun.javafx.css.Selector;
@@ -74,6 +58,7 @@
 import com.sun.javafx.css.Size;
 import com.sun.javafx.css.SizeUnits;
 import com.sun.javafx.css.StyleManager;
+import javafx.css.Styleable;
 import com.sun.javafx.css.Stylesheet;
 import com.sun.javafx.css.converters.BooleanConverter;
 import com.sun.javafx.css.converters.EffectConverter;
@@ -85,6 +70,8 @@
 import com.sun.javafx.css.converters.SizeConverter.SequenceConverter;
 import com.sun.javafx.css.converters.StringConverter;
 import com.sun.javafx.css.converters.URLConverter;
+import sun.util.logging.PlatformLogger;
+import sun.util.logging.PlatformLogger.Level;
 import com.sun.javafx.scene.layout.region.BackgroundPositionConverter;
 import com.sun.javafx.scene.layout.region.BackgroundSizeConverter;
 import com.sun.javafx.scene.layout.region.BorderImageSliceConverter;
@@ -102,8 +89,22 @@
 import com.sun.javafx.scene.layout.region.RepeatStructConverter;
 import com.sun.javafx.scene.layout.region.SliceSequenceConverter;
 import com.sun.javafx.scene.layout.region.StrokeBorderPaintConverter;
-import sun.util.logging.PlatformLogger;
-import sun.util.logging.PlatformLogger.Level;
+import java.io.BufferedReader;
+import java.io.CharArrayReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
 
 final public class CSSParser {
 
@@ -2541,7 +2542,7 @@
                 } else {
                     left = parseSize(termOne);
                     right = ZERO_PERCENT;
-                    top = ZERO_PERCENT;
+                    top = FIFTY_PERCENT;
                     bottom = ZERO_PERCENT;
                 }
             } else if( valueOne != null && valueTwo != null && valueThree == null && valueFour == null ) {
@@ -3700,7 +3701,7 @@
                     final int pos = currentToken != null ? currentToken.getOffset() : -1;
                     final String msg =
                         MessageFormat.format("Expected LBRACE at [{0,number,#},{1,number,#}]",
-                        line,pos);
+                                line, pos);
                     CssError error = createError(msg);
                     if (LOGGER.isLoggable(Level.WARNING)) {
                         LOGGER.warning(error.toString());
@@ -3998,7 +3999,7 @@
 
         String esel = "*"; // element selector. default to universal
         String isel = ""; // id selector
-        List<String>  csels = null; // class selector
+        List<String> csels = null; // class selector
         List<String> pclasses = null; // pseudoclasses
 
         while (true) {