changeset 1758:26cfaf711edb

branch merge
author David Grieve<david.grieve@oracle.com>
date Tue, 11 Sep 2012 20:39:23 -0400
parents 222bae9d4cd9 c6023f02a0ec
children c5c10c94fa3c
files javafx-ui-common/src/com/sun/javafx/css/CompoundSelector.java javafx-ui-common/src/com/sun/javafx/css/ParentStyleManager.java javafx-ui-common/src/com/sun/javafx/css/Rule.java javafx-ui-common/src/com/sun/javafx/css/SceneStyleManager.java javafx-ui-common/src/com/sun/javafx/css/Selector.java javafx-ui-common/src/com/sun/javafx/css/SimpleSelector.java javafx-ui-common/src/com/sun/javafx/css/StyleHelper.java javafx-ui-common/src/com/sun/javafx/css/StyleManager.java javafx-ui-common/src/com/sun/javafx/css/Stylesheet.java javafx-ui-common/src/com/sun/javafx/scene/layout/region/BackgroundFill.java javafx-ui-common/src/com/sun/javafx/scene/layout/region/BackgroundFillConverter.java javafx-ui-common/src/com/sun/javafx/scene/layout/region/BackgroundImage.java javafx-ui-common/src/com/sun/javafx/scene/layout/region/BackgroundImageConverter.java javafx-ui-common/src/com/sun/javafx/scene/layout/region/Border.java javafx-ui-common/src/com/sun/javafx/scene/layout/region/BorderImage.java javafx-ui-common/src/com/sun/javafx/scene/layout/region/BorderImageConverter.java javafx-ui-common/src/com/sun/javafx/scene/layout/region/BorderStyle.java javafx-ui-common/src/com/sun/javafx/scene/layout/region/Repeat.java javafx-ui-common/src/com/sun/javafx/scene/layout/region/ShapeChangeListener.java javafx-ui-common/src/com/sun/javafx/scene/layout/region/StrokeBorder.java javafx-ui-common/src/com/sun/javafx/scene/layout/region/StrokeBorderConverter.java javafx-ui-common/src/com/sun/javafx/scene/text/FontManager.java javafx-ui-common/test/unit/com/sun/javafx/css/StyleConverterTest.java javafx-ui-common/test/unit/com/sun/javafx/css/StyleablePropertyTest.java javafx-ui-common/test/unit/com/sun/javafx/scene/text/FontManagerTest.java javafx-ui-common/test/unit/com/sun/javafx/scene/text/fonts.mf javafx-ui-controls/src/com/sun/javafx/scene/control/Keystroke.java javafx-ui-controls/src/javafx/scene/control/Control.java
diffstat 201 files changed, 15844 insertions(+), 6412 deletions(-) [+]
line wrap: on
line diff
--- a/.classpath	Tue Sep 11 20:35:27 2012 -0400
+++ b/.classpath	Tue Sep 11 20:39:23 2012 -0400
@@ -4,11 +4,11 @@
 	<classpathentry kind="src" path="javafx-ui-controls/test"/>
 	<classpathentry kind="src" path="javafx-ui-controls/build/builders"/>
 	<classpathentry kind="src" path="javafx-ui-common/src"/>
+	<classpathentry kind="src" path="javafx-ui-common/test/unit"/>
 	<classpathentry kind="src" path="javafx-ui-common/build/builders"/>
 	<classpathentry kind="src" path="javafx-ui-charts/src"/>
 	<classpathentry kind="src" path="javafx-ui-charts/build/builders"/>
 	<!--
-	<classpathentry kind="src" path="javafx-ui-common/test/unit"/>
 	<classpathentry kind="src" path="javafx-designtime/test"/>
 	-->
 	<classpathentry kind="src" path="javafx-concurrent/src"/>
--- a/.hgtags	Tue Sep 11 20:35:27 2012 -0400
+++ b/.hgtags	Tue Sep 11 20:39:23 2012 -0400
@@ -39,3 +39,7 @@
 1d8c6251f243b772ba6c65417fc4b1b6d4e7f6fb 2.2-b17
 7839d55ac4c00abf3cfa12cc16092cd1c93d20ff 2.2-b18
 76eefd67ced549367ac22d14456d683dcba52343 2.2-b19
+3edd0328371a7a7fd75b76321fb8d26ad6993bcb 8.0-b52
+077bf884c38c11f4f669de3c75e24c771ca02dcf 8.0-b53
+7a0b0ca81d0b89f1420c769631acbaae8816f5cf 8.0-b54
+ce8b04d29bbab5098be528ac15620af0f2ec16cf 8.0-b55
--- a/javafx-concurrent/src/javafx/concurrent/Service.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-concurrent/src/javafx/concurrent/Service.java	Tue Sep 11 20:39:23 2012 -0400
@@ -158,39 +158,39 @@
         EXECUTOR.allowCoreThreadTimeOut(true);
     }
 
-    private ObjectProperty<State> state = new SimpleObjectProperty<State>(this, "state", State.READY);
+    private final ObjectProperty<State> state = new SimpleObjectProperty<State>(this, "state", State.READY);
     @Override public final State getState() { checkThread(); return state.get(); }
     @Override public final ReadOnlyObjectProperty<State> stateProperty() { checkThread(); return state; }
 
-    private ObjectProperty<V> value = new SimpleObjectProperty<V>(this, "value");
+    private final ObjectProperty<V> value = new SimpleObjectProperty<V>(this, "value");
     @Override public final V getValue() { checkThread(); return value.get(); }
     @Override public final ReadOnlyObjectProperty<V> valueProperty() { checkThread(); return value; }
 
-    private ObjectProperty<Throwable> exception = new SimpleObjectProperty<Throwable>(this, "exception");
+    private final ObjectProperty<Throwable> exception = new SimpleObjectProperty<Throwable>(this, "exception");
     @Override public final Throwable getException() { checkThread(); return exception.get(); }
     @Override public final ReadOnlyObjectProperty<Throwable> exceptionProperty() { checkThread(); return exception; }
 
-    private DoubleProperty workDone = new SimpleDoubleProperty(this, "workDone", -1);
+    private final DoubleProperty workDone = new SimpleDoubleProperty(this, "workDone", -1);
     @Override public final double getWorkDone() { checkThread(); return workDone.get(); }
     @Override public final ReadOnlyDoubleProperty workDoneProperty() { checkThread(); return workDone; }
 
-    private DoubleProperty totalWorkToBeDone = new SimpleDoubleProperty(this, "totalWork", -1);
+    private final DoubleProperty totalWorkToBeDone = new SimpleDoubleProperty(this, "totalWork", -1);
     @Override public final double getTotalWork() { checkThread(); return totalWorkToBeDone.get(); }
     @Override public final ReadOnlyDoubleProperty totalWorkProperty() { checkThread(); return totalWorkToBeDone; }
 
-    private DoubleProperty progress = new SimpleDoubleProperty(this, "progress", -1);
+    private final DoubleProperty progress = new SimpleDoubleProperty(this, "progress", -1);
     @Override public final double getProgress() { checkThread(); return progress.get(); }
     @Override public final ReadOnlyDoubleProperty progressProperty() { checkThread(); return progress; }
 
-    private BooleanProperty running = new SimpleBooleanProperty(this, "running", false);
+    private final BooleanProperty running = new SimpleBooleanProperty(this, "running", false);
     @Override public final boolean isRunning() { checkThread(); return running.get(); }
     @Override public final ReadOnlyBooleanProperty runningProperty() { checkThread(); return running; }
 
-    private StringProperty message = new SimpleStringProperty(this, "message", "");
+    private final StringProperty message = new SimpleStringProperty(this, "message", "");
     @Override public final String getMessage() { return message.get(); }
     @Override public final ReadOnlyStringProperty messageProperty() { return message; }
 
-    private StringProperty title = new SimpleStringProperty(this, "title", "");
+    private final StringProperty title = new SimpleStringProperty(this, "title", "");
     @Override public final String getTitle() { return title.get(); }
     @Override public final ReadOnlyStringProperty titleProperty() { return title; }
 
@@ -199,7 +199,7 @@
      * a new daemon thread will be created and used for running the Service using some
      * default executor.
      */
-    private ObjectProperty<Executor> executor = new SimpleObjectProperty<Executor>(this, "executor");
+    private final ObjectProperty<Executor> executor = new SimpleObjectProperty<Executor>(this, "executor");
     public final void setExecutor(Executor value) { checkThread(); executor.set(value); }
     public final Executor getExecutor() { checkThread(); return executor.get(); }
     public final ObjectProperty<Executor> executorProperty() { return executor; }
--- a/javafx-concurrent/src/javafx/concurrent/Task.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-concurrent/src/javafx/concurrent/Task.java	Tue Sep 11 20:39:23 2012 -0400
@@ -840,41 +840,41 @@
      */
     protected void failed() { }
 
-    private ObjectProperty<V> value = new SimpleObjectProperty<V>(this, "value");
+    private final ObjectProperty<V> value = new SimpleObjectProperty<V>(this, "value");
     private void setValue(V v) { checkThread(); value.set(v); }
     @Override public final V getValue() { checkThread(); return value.get(); }
     @Override public final ReadOnlyObjectProperty<V> valueProperty() { checkThread(); return value; }
 
-    private ObjectProperty<Throwable> exception = new SimpleObjectProperty<Throwable>(this, "exception");
+    private final ObjectProperty<Throwable> exception = new SimpleObjectProperty<Throwable>(this, "exception");
     private void _setException(Throwable value) { checkThread(); exception.set(value); }
     @Override public final Throwable getException() { checkThread(); return exception.get(); }
     @Override public final ReadOnlyObjectProperty<Throwable> exceptionProperty() { checkThread(); return exception; }
 
-    private DoubleProperty workDone = new SimpleDoubleProperty(this, "workDone", -1);
+    private final DoubleProperty workDone = new SimpleDoubleProperty(this, "workDone", -1);
     private void setWorkDone(double value) { checkThread(); workDone.set(value); }
     @Override public final double getWorkDone() { checkThread(); return workDone.get(); }
     @Override public final ReadOnlyDoubleProperty workDoneProperty() { checkThread(); return workDone; }
 
-    private DoubleProperty totalWork = new SimpleDoubleProperty(this, "totalWork", -1);
+    private final DoubleProperty totalWork = new SimpleDoubleProperty(this, "totalWork", -1);
     private void setTotalWork(double value) { checkThread(); totalWork.set(value); }
     @Override public final double getTotalWork() { checkThread(); return totalWork.get(); }
     @Override public final ReadOnlyDoubleProperty totalWorkProperty() { checkThread(); return totalWork; }
 
-    private DoubleProperty progress = new SimpleDoubleProperty(this, "progress", -1);
+    private final DoubleProperty progress = new SimpleDoubleProperty(this, "progress", -1);
     private void setProgress(double value) { checkThread(); progress.set(value); }
     @Override public final double getProgress() { checkThread(); return progress.get(); }
     @Override public final ReadOnlyDoubleProperty progressProperty() { checkThread(); return progress; }
 
-    private BooleanProperty running = new SimpleBooleanProperty(this, "running", false);
+    private final BooleanProperty running = new SimpleBooleanProperty(this, "running", false);
     private void setRunning(boolean value) { checkThread(); running.set(value); }
     @Override public final boolean isRunning() { checkThread(); return running.get(); }
     @Override public final ReadOnlyBooleanProperty runningProperty() { checkThread(); return running; }
 
-    private StringProperty message = new SimpleStringProperty(this, "message", "");
+    private final StringProperty message = new SimpleStringProperty(this, "message", "");
     @Override public final String getMessage() { return message.get(); }
     @Override public final ReadOnlyStringProperty messageProperty() { return message; }
 
-    private StringProperty title = new SimpleStringProperty(this, "title", "");
+    private final StringProperty title = new SimpleStringProperty(this, "title", "");
     @Override public final String getTitle() { return title.get(); }
     @Override public final ReadOnlyStringProperty titleProperty() { return title; }
 
@@ -1205,8 +1205,8 @@
      * atomically. If it was not null, then we simply update it.
      */
     private static final class ProgressUpdate {
-        private double workDone;
-        private double totalWork;
+        private final double workDone;
+        private final double totalWork;
 
         private ProgressUpdate(double p, double m) {
             this.workDone = p;
--- a/javafx-concurrent/src/javafx/concurrent/Worker.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-concurrent/src/javafx/concurrent/Worker.java	Tue Sep 11 20:39:23 2012 -0400
@@ -210,7 +210,7 @@
 
     /**
      * Indicates the current amount of work that has been completed. Zero or a
-     * positive value indicate progress toward completion. This variable's value
+     * positive value indicate progress toward completion. This variables value
      * may or may not change from its default value depending on the specific
      * Worker implementation. A value of -1 means that the current amount of work
      * done cannot be determined (ie: it is indeterminate). The value of
--- a/javafx-ui-charts/src/javafx/scene/chart/BubbleChart.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-charts/src/javafx/scene/chart/BubbleChart.java	Tue Sep 11 20:39:23 2012 -0400
@@ -106,11 +106,11 @@
                 if (bubble != null) {
                     if (bubble instanceof StackPane) {
                         StackPane region = (StackPane)item.getNode();
-                        if (region.impl_getShape() == null) {
+                        if (region.getShape() == null) {
                             ellipse = new Ellipse(getDoubleValue(item.getExtraValue(), 1), getDoubleValue(item.getExtraValue(), 1));
-                            region.impl_setShape(ellipse);
-                        } else if (region.impl_getShape() instanceof Ellipse) {
-                            ellipse = (Ellipse)region.impl_getShape();
+                            region.setShape(ellipse);
+                        } else if (region.getShape() instanceof Ellipse) {
+                            ellipse = (Ellipse)region.getShape();
                         } else {
                             return;
                         }
@@ -119,10 +119,10 @@
                         // Note: workaround for RT-7689 - saw this in ProgressControlSkin
                         // The region doesn't update itself when the shape is mutated in place, so we
                         // null out and then restore the shape in order to force invalidation.
-                        region.impl_setShape(null);
-                        region.impl_setShape(ellipse);
-                        region.impl_setScaleShape(false);
-                        region.impl_setPositionShape(false);
+                        region.setShape(null);
+                        region.setShape(ellipse);
+                        region.setScaleShape(false);
+                        region.setCenterShape(false);
                         // position the bubble
                         bubble.setLayoutX(x);
                         bubble.setLayoutY(y);
--- a/javafx-ui-charts/src/javafx/scene/chart/LineChart.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-charts/src/javafx/scene/chart/LineChart.java	Tue Sep 11 20:39:23 2012 -0400
@@ -369,7 +369,10 @@
             // create list of all nodes we need to fade out
             final List<Node> nodes = new ArrayList<Node>();
             nodes.add(series.getNode());
-            for (Data d: series.getData()) nodes.add(d.getNode());
+            if (getCreateSymbols()) { // RT-22124 
+                // done need to fade the symbols if createSymbols is false
+                for (Data d: series.getData()) nodes.add(d.getNode());
+            }
             // fade out old and symbols
             KeyValue[] startValues = new KeyValue[nodes.size()];
             KeyValue[] endValues = new KeyValue[nodes.size()];
--- a/javafx-ui-charts/src/javafx/scene/chart/PieChart.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-charts/src/javafx/scene/chart/PieChart.java	Tue Sep 11 20:39:23 2012 -0400
@@ -24,7 +24,6 @@
  */
 package javafx.scene.chart;
 
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
@@ -46,14 +45,12 @@
 import javafx.beans.value.WritableValue;
 import javafx.collections.FXCollections;
 import javafx.collections.ListChangeListener;
-import javafx.collections.ListChangeListener.Change;
 import javafx.collections.ObservableList;
 import javafx.event.ActionEvent;
 import javafx.event.EventHandler;
 import javafx.geometry.Side;
 import javafx.scene.Node;
 import javafx.scene.layout.Region;
-import javafx.scene.paint.Color;
 import javafx.scene.shape.*;
 import javafx.scene.text.Text;
 import javafx.scene.transform.Scale;
@@ -590,16 +587,16 @@
                  if (node != null) {
                     if (node instanceof Region) {
                         Region arcRegion = (Region)node;
-                        if( arcRegion.impl_getShape() == null) {
+                        if( arcRegion.getShape() == null) {
                             arc = new Arc();
-                            arcRegion.impl_setShape(arc);
+                            arcRegion.setShape(arc);
                         } else {
-                            arc = (Arc)arcRegion.impl_getShape();
+                            arc = (Arc)arcRegion.getShape();
                         }
-                        arcRegion.impl_setShape(null);
-                        arcRegion.impl_setShape(arc);
-                        arcRegion.impl_setScaleShape(false);
-                        arcRegion.impl_setPositionShape(false);
+                        arcRegion.setShape(null);
+                        arcRegion.setShape(arc);
+                        arcRegion.setScaleShape(false);
+                        arcRegion.setCenterShape(false);
                     }
                 }
                 double size = (isClockwise()) ? (-scale * Math.abs(item.getCurrentPieValue())) : (scale * Math.abs(item.getCurrentPieValue()));
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-charts/test/javafx/scene/chart/LineChartTest.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,79 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package javafx.scene.chart;
+
+/**
+ *
+ * @author paru
+ */
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import javafx.collections.*;
+
+import com.sun.javafx.pgstub.StubToolkit;
+import com.sun.javafx.tk.Toolkit;
+
+import javafx.scene.Node;
+import javafx.scene.Scene;
+import javafx.scene.Group;
+import javafx.stage.Stage;
+import javafx.scene.shape.*;
+
+import org.junit.Ignore;
+
+
+public class LineChartTest extends ChartTestBase {
+
+    private Scene scene;
+    private StubToolkit toolkit;
+    private Stage stage;
+    LineChart<Number,Number> lineChart;
+    final XYChart.Series<Number, Number> series1 = new XYChart.Series<Number, Number>();
+    
+    @Override protected Chart createChart() {
+        final NumberAxis xAxis = new NumberAxis();
+        final NumberAxis yAxis = new NumberAxis();
+        lineChart = new LineChart<Number,Number>(xAxis,yAxis);
+        xAxis.setLabel("X Axis");
+        yAxis.setLabel("Y Axis");
+        lineChart.setTitle("HelloLineChart");
+        // add starting data
+        ObservableList<XYChart.Data> data = FXCollections.observableArrayList();
+        series1.getData().add(new XYChart.Data(10d, 10d));
+        series1.getData().add(new XYChart.Data(25d, 20d));
+        series1.getData().add(new XYChart.Data(30d, 15d));
+        series1.getData().add(new XYChart.Data(50d, 15d));
+        series1.getData().add(new XYChart.Data(80d, 10d));
+        return lineChart;
+    }
+    
+    private StringBuffer getSeriesLineFromPlot() {
+        ObservableList<Node> childrenList = lineChart.getPlotChildren();
+        StringBuffer sb = new StringBuffer();
+        for (Node n : childrenList) {
+            if (n instanceof Path && "chart-series-line".equals(n.getStyleClass().get(0))) {
+                Path line = (Path)n;
+                sb = computeSVGPath(line);
+                return sb;
+            }
+        }
+        return sb;
+    }
+    
+     @Test
+    public void testSeriesRemoveWithCreateSymbolsFalse() {
+        startApp();
+        lineChart.getData().addAll(series1);
+        pulse();
+        lineChart.setCreateSymbols(false);
+        System.out.println("Line Path = "+getSeriesLineFromPlot());
+        if (!lineChart.getData().isEmpty()) {
+            lineChart.getData().remove(0);
+            pulse();
+            StringBuffer sb = getSeriesLineFromPlot();
+            assertEquals(sb.toString(), "");
+        }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-charts/test/javafx/scene/chart/PieChartTest.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,41 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package javafx.scene.chart;
+
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+
+/**
+ *
+ * @author paru
+ */
+public class PieChartTest extends ChartTestBase {
+
+    ObservableList<PieChart.Data> data;
+    PieChart pc;
+    
+    @Override
+    protected Chart createChart() {
+        data = FXCollections.observableArrayList();
+        pc = new PieChart();
+        return pc;
+    }
+    
+    @Test
+    public void testLabelsVisibleFalse_RT24106() {
+        data.add(new PieChart.Data("Sun", 20));
+        data.add(new PieChart.Data("IBM", 12));
+        data.add(new PieChart.Data("HP", 25));
+        data.add(new PieChart.Data("Dell", 22));
+        data.add(new PieChart.Data("Apple", 30));
+        pc.setLabelsVisible(false);
+        pc.getData().addAll(data);
+        assertEquals(false, pc.getLabelsVisible());
+    }
+    
+    
+}
--- a/javafx-ui-common/build-common.xml	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/build-common.xml	Tue Sep 11 20:39:23 2012 -0400
@@ -7,10 +7,12 @@
          the unit test workspace. This is necessary so that the
          FontManagerTest unit test can check that the embedded font logic
          works -->
+    <!--
     <mkdir dir="${build.test.classes.dir}/META-INF" />
     <copy todir="${build.test.classes.dir}/META-INF"
           file="test/unit/com/sun/javafx/scene/text/fonts.mf" />
     <unzip src="${jfx.amble-fonts.jar}" dest="${build.test.classes.dir}" />
+    -->
     <test-project />
   </target>
 
@@ -19,9 +21,11 @@
            the unit test workspace. This is necessary so that the
            FontManagerTest unit test can check that the embedded font logic
            works -->
+  	<!--
     <mkdir dir="${build.test.classes.dir}/META-INF" />
     <copy todir="${build.test.classes.dir}/META-INF"
           file="test/unit/com/sun/javafx/scene/text/fonts.mf" />
+     -->
   </target>
 
   <target name="debug-test-file" depends="jar">
--- a/javafx-ui-common/src/com/sun/javafx/Utils.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/Utils.java	Tue Sep 11 20:39:23 2012 -0400
@@ -1084,90 +1084,74 @@
      *                                                                         *
      **************************************************************************/
 
-    private static UnicodeProcessor unicodeProcessor = new UnicodeProcessor();
     public static String convertUnicode(String src) {
-        return unicodeProcessor.process(src);
-    }
-
-    private static final class UnicodeProcessor {
         /** The input buffer, index of next character to be read,
          *  index of one past last character in buffer.
          */
-        private char[] buf;
-        private int bp;
-        private int buflen;
+        char[] buf;
+        int bp;
+        int buflen;
 
         /** The current character.
          */
-        private char ch;
+        char ch;
 
         /** The buffer index of the last converted unicode character
          */
-        private int unicodeConversionBp = -1;
+        int unicodeConversionBp = -1;
+        
+        buf = src.toCharArray();
+        buflen = buf.length;
+        bp = -1;
 
-        public String process(String src) {
-            buf = src.toCharArray();
-            buflen = buf.length;
-            bp = -1;
+        char[] dst = new char[buflen];
+        int dstIndex = 0;
 
-            char[] dst = new char[buflen];
-            int dstIndex = 0;
-
-            while (bp < buflen - 1) {
-                ch = buf[++bp];
-                if (ch == '\\') {
-                    convertUnicode();
-                }
-                dst[dstIndex++] = ch;
-            }
-
-            return new String(dst, 0, dstIndex);
-        }
-
-        /** Convert unicode escape; bp points to initial '\' character
-         *  (Spec 3.3).
-         */
-        private void convertUnicode() {
-            if (ch == '\\' && unicodeConversionBp != bp) {
-                bp++; ch = buf[bp];
-                if (ch == 'u') {
-                    do {
-                        bp++; ch = buf[bp];
-                    } while (ch == 'u');
-                    int limit = bp + 3;
-                    if (limit < buflen) {
-                        int d = digit(16);
-                        int code = d;
-                        while (bp < limit && d >= 0) {
+        while (bp < buflen - 1) {
+            ch = buf[++bp];
+            if (ch == '\\') {
+                if (unicodeConversionBp != bp) {
+                    bp++; ch = buf[bp];
+                    if (ch == 'u') {
+                        do {
                             bp++; ch = buf[bp];
-                            d = digit(16);
-                            code = (code << 4) + d;
+                        } while (ch == 'u');
+                        int limit = bp + 3;
+                        if (limit < buflen) {
+                            char c = ch;
+                            int result = Character.digit(c, 16);
+                            if (result >= 0 && c > 0x7f) {
+                                //lexError(pos+1, "illegal.nonascii.digit");
+                                ch = "0123456789abcdef".charAt(result);
+                            }
+                            int d = result;
+                            int code = d;
+                            while (bp < limit && d >= 0) {
+                                bp++; ch = buf[bp];
+                                char c1 = ch;
+                                int result1 = Character.digit(c1, 16);
+                                if (result1 >= 0 && c1 > 0x7f) {
+                                    //lexError(pos+1, "illegal.nonascii.digit");
+                                    ch = "0123456789abcdef".charAt(result1);
+                                }
+                                d = result1;
+                                code = (code << 4) + d;
+                            }
+                            if (d >= 0) {
+                                ch = (char)code;
+                                unicodeConversionBp = bp;
+                            }
                         }
-                        if (d >= 0) {
-                            ch = (char)code;
-                            unicodeConversionBp = bp;
-                            return;
-                        }
+                        //lexError(bp, "illegal.unicode.esc");
+                    } else {
+                        bp--;
+                        ch = '\\';
                     }
-                    //lexError(bp, "illegal.unicode.esc");
-                } else {
-                    bp--;
-                    ch = '\\';
                 }
             }
+            dst[dstIndex++] = ch;
         }
-
-        /** Convert an ASCII digit from its base (8, 10, or 16)
-         *  to its value.
-         */
-        private int digit(int base) {
-            char c = ch;
-            int result = Character.digit(c, base);
-            if (result >= 0 && c > 0x7f) {
-                //lexError(pos+1, "illegal.nonascii.digit");
-                ch = "0123456789abcdef".charAt(result);
-            }
-            return result;
-        }
+        
+        return new String(dst, 0, dstIndex);
     }
 }
--- a/javafx-ui-common/src/com/sun/javafx/application/LauncherImpl.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/application/LauncherImpl.java	Tue Sep 11 20:39:23 2012 -0400
@@ -347,33 +347,6 @@
                 });
             }
 
-            // RT-19600: workaround for Mac crash on exit with J2D pipeline
-            boolean isMac = PlatformUtil.isMac();
-            if (isMac) {
-                // Exit if using the J2D pipeline. Note that currently SCENE3D
-                // is false only if we are running the J2D pipeline.
-                boolean exitOnClose = !PlatformImpl.isSupported(ConditionalFeature.SCENE3D);
-                boolean keepAlive = AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
-                    @Override public Boolean run() {
-                        return Boolean.getBoolean("javafx.keepalive");
-                    }
-                });
-                if (exitOnClose && !keepAlive) {
-                    if (constructorError != null) {
-                        constructorError.printStackTrace();
-                    } else if (initError != null) {
-                        initError.printStackTrace();
-                    } else if(startError != null) {
-                        startError.printStackTrace();
-                    } else if (stopError != null) {
-                        stopError.printStackTrace();
-                    }
-                    System.err.println("JavaFX application launcher: calling System.exit");
-                    System.exit(0);
-                }
-            }
-            // END OF WORKAROUND
-
             if (error) {
                 if (pConstructorError != null) {
                     throw new RuntimeException("Unable to construct Preloader instance: "
--- a/javafx-ui-common/src/com/sun/javafx/application/PlatformImpl.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/application/PlatformImpl.java	Tue Sep 11 20:39:23 2012 -0400
@@ -171,11 +171,12 @@
                 @Override public void run() {
                     try {
                         r.run();
-                        pendingRunnables.decrementAndGet();
-                        checkIdle();
                     } catch (Throwable t) {
                         System.err.println("Exception in runnable");
                         t.printStackTrace();
+                    } finally {
+                        pendingRunnables.decrementAndGet();
+                        checkIdle();
                     }
                 }
             });
--- a/javafx-ui-common/src/com/sun/javafx/css/CompoundSelector.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/css/CompoundSelector.java	Tue Sep 11 20:39:23 2012 -0400
@@ -336,5 +336,61 @@
         }
         return new CompoundSelector(selectors, relationships);
     }
+    
+    @Override public String writeJava() {
+        final String NEW_LINE = Rule.NEW_LINE;
+        final String INDENT = Rule.INDENT;
+        final String TWO_INDENT = Rule.TWO_INDENT;
+        final String FIVE_INDENT = TWO_INDENT + TWO_INDENT + INDENT;
+        
+        StringBuilder sb = new StringBuilder();
+        sb.append(NEW_LINE);
+        sb.append(TWO_INDENT);
+        sb.append(TWO_INDENT);
+        sb.append("new CompoundSelector(");
+        sb.append(NEW_LINE);
+        
+        sb.append(FIVE_INDENT);
+        sb.append("Arrays.<SimpleSelector>asList(");
+        sb.append(NEW_LINE);
+        
+        for (int i = 0; i < selectors.size(); i++) {
+            Selector sel = selectors.get(i);
+            
+            sb.append(INDENT);
+            sb.append(FIVE_INDENT);
+            sb.append(sel.writeJava());
+            
+            if (i < (selectors.size() - 1)) {
+                sb.append(", ");
+                sb.append(NEW_LINE);
+            }
+        }
+        
+        sb.append("), ");
+        
+        sb.append(NEW_LINE);
+        sb.append(FIVE_INDENT);
+        sb.append("Arrays.<Combinator>asList(");
+        sb.append(NEW_LINE);
+        
+        for (int i = 0; i < relationships.size(); i++) {
+            Combinator com = relationships.get(i);
+            
+            sb.append(INDENT);
+            sb.append(FIVE_INDENT);
+            sb.append("Combinator.");
+            sb.append(com.name());
+            
+            if (i < (relationships.size() - 1)) {
+                sb.append(", ");
+                sb.append(NEW_LINE);
+            }
+        }
+        
+        sb.append("))");
+        
+        return sb.toString();
+    }
 }
 
--- a/javafx-ui-common/src/com/sun/javafx/css/Declaration.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/css/Declaration.java	Tue Sep 11 20:39:23 2012 -0400
@@ -124,5 +124,18 @@
         final boolean important = is.readBoolean();
         return new Declaration(propertyName, parsedValue, important);
     }
+    
+    public String writeJava() {
+        StringBuilder sb = new StringBuilder();
+        sb.append("new Declaration(\"");
+        sb.append(getProperty());
+        sb.append("\", ");
+        sb.append(getParsedValue().writeJava());
+        sb.append(", ");
+        sb.append(isImportant());
+        sb.append(")"); 
+        
+        return sb.toString();
+    }
 }
 
--- a/javafx-ui-common/src/com/sun/javafx/css/ParentStyleManager.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/css/ParentStyleManager.java	Tue Sep 11 20:39:23 2012 -0400
@@ -98,8 +98,8 @@
                 // If an exception occurred while loading one of the stylesheets
                 // then we will simply print warning into system.err and skip the
                 // stylesheet, allowing other stylesheets to attempt to load
-                if (LOGGER.isLoggable(PlatformLogger.WARNING)) {
-                    LOGGER.warning("Cannot add stylesheet. %s\n", e.getLocalizedMessage());
+                if (getLogger().isLoggable(PlatformLogger.WARNING)) {
+                    getLogger().warning("Cannot add stylesheet. %s\n", e.getLocalizedMessage());
                 }
 
             }
--- a/javafx-ui-common/src/com/sun/javafx/css/ParsedValue.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/css/ParsedValue.java	Tue Sep 11 20:39:23 2012 -0400
@@ -698,4 +698,117 @@
         }
     }
 
+    public String writeJava() {
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append("new ParsedValue("); 
+
+        // ---- Value
+        if (value instanceof ParsedValue) {
+            sb.append(((ParsedValue)value).writeJava());
+        } else if (value instanceof ParsedValue[]) {
+            final ParsedValue[] values = (ParsedValue[])value;
+            sb.append("new ParsedValue[] {");
+            
+            for (int v=0; v<values.length; v++) {
+                if (values[v] != null) {
+                    sb.append(((ParsedValue)values[v]).writeJava());
+                } else {
+                    sb.append("null");
+                }
+                
+                if (v < (values.length - 1)) {
+                    sb.append(", ");
+                }
+            }
+            
+            sb.append("}");
+        } else if (value instanceof ParsedValue[][]) {
+            final ParsedValue[][] layers = (ParsedValue[][])value;
+            sb.append("new ParsedValue[][] {");
+            
+            for (int l=0; l<layers.length; l++) {
+                final ParsedValue[] values = layers[l];
+                sb.append("new ParsedValue[] {");
+                
+                for (int v=0; v<values.length; v++) {
+                    if (values[v] != null) {
+                        sb.append(((ParsedValue)values[v]).writeJava());
+                    } else {
+                        sb.append("null");
+                    }
+                    
+                    if (v < (values.length - 1)) {
+                        sb.append(", ");
+                    }
+                }
+                
+                sb.append("}");
+            }
+            
+            sb.append("}");
+        } else if (value instanceof Color) {
+            final Color c = (Color)value;
+            sb.append("new Color(");
+            sb.append(c.getRed());
+            sb.append(", ");
+            sb.append(c.getGreen());
+            sb.append(", ");
+            sb.append(c.getBlue());
+            sb.append(", ");
+            sb.append(c.getOpacity());
+            sb.append(")");
+        } else if (value instanceof Enum) {
+            final Enum e = (Enum)value;
+            sb.append(e.getClass().getName());
+            sb.append(".");
+            sb.append(e);
+        } else if (value instanceof Boolean) {
+            final Boolean b = (Boolean)value;
+            sb.append(b);
+        } else if (value instanceof Size) {
+            final Size size = (Size)value;
+            final double sz = size.getValue();
+            sb.append("new Size(");
+            sb.append(sz);
+            sb.append(", SizeUnits.");
+            sb.append(size.getUnits().name());
+            sb.append(")");
+        } else if (value instanceof String) {
+            String str = (String)value;
+            if (! str.startsWith("\"")) sb.append("\"");
+            sb.append(str);
+            if (! str.endsWith("\"")) sb.append("\"");
+        } else if (value instanceof URL) {
+            URL url = (URL)value;
+            String urlString = url.toString();
+            
+            // convert all escaped slashes (\\) into \, and then convert all
+            // backslashes into escaped versions.
+            urlString = urlString.replace("\\\\", "\\");
+            urlString = urlString.replace("\\", "\\\\");
+            
+            sb.append("\"");
+            sb.append(urlString);
+            sb.append("\"");
+        } else if (value == null) {
+            sb.append("null");
+        } else {
+            throw new InternalError("cannot writeJava " + this);
+        }
+        
+        // --- Style Converter
+        sb.append(", ");
+        String styleConverterString = getConverter() == null ? "null" : getConverter().writeJava();
+        sb.append(styleConverterString);
+        
+        // --- IsLookup
+        sb.append(", ");
+        sb.append(isLookup());
+        
+        // close ParsedValue constructor
+        sb.append(")"); 
+        
+        return sb.toString();
+    }
 }
--- a/javafx-ui-common/src/com/sun/javafx/css/Rule.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/css/Rule.java	Tue Sep 11 20:39:23 2012 -0400
@@ -29,6 +29,7 @@
 import java.io.DataOutputStream;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import javafx.collections.ListChangeListener.Change;
 import javafx.collections.ObservableList;
@@ -53,11 +54,17 @@
         protected void onChanged(Change<Declaration> c) {
             while (c.next()) {
                 if (c.wasAdded()) {
-                    for(Declaration decl : c.getAddedSubList()) {
+                    List<Declaration> added = c.getAddedSubList();
+                    for(int i = 0, max = added.size(); i < max; i++) {
+                        Declaration decl = added.get(i);
                         decl.rule = Rule.this;
                     }
-                } else if (c.wasRemoved()) {
-                    for(Declaration decl : c.getRemoved()) {
+                }
+                
+                if (c.wasRemoved()) {
+                    List<Declaration> removed = c.getRemoved();
+                    for(int i = 0, max = removed.size(); i < max; i++) {
+                        Declaration decl = removed.get(i);
                         if (decl.rule == Rule.this) decl.rule = null;
                     }
                 }
@@ -191,4 +198,48 @@
         return new Rule(selectors, declarations);
     }
 
+    public static final String NEW_LINE = "\r\n";
+    public static final String INDENT = "    ";
+    public static final String TWO_INDENT = "        ";
+    
+    String writeJava() throws IOException {
+        final String THREE_INDENT = INDENT + TWO_INDENT;
+        final String FOUR_INDENT = TWO_INDENT + TWO_INDENT;
+        
+        StringBuilder sb = new StringBuilder();
+        sb.append("new Rule(");
+        sb.append(NEW_LINE);
+        
+        // selectors
+        sb.append(THREE_INDENT);
+        sb.append("Arrays.<Selector>asList(");
+        for (int i = 0; i < selectors.size(); i++) {
+            Selector sel = selectors.get(i);
+            sb.append(sel.writeJava());
+            
+            if (i < (selectors.size() - 1)) {
+                sb.append(", ");
+            }
+        }
+        sb.append("), ");
+        
+        // declarations
+        sb.append(NEW_LINE);
+        sb.append(THREE_INDENT);
+        sb.append("Arrays.<Declaration>asList(");
+        for (int i = 0; i < declarations.size(); i++) {
+            Declaration decl = declarations.get(i);
+            
+            sb.append(NEW_LINE);
+            sb.append(FOUR_INDENT);
+            sb.append(decl.writeJava());
+            
+            if (i < (declarations.size() - 1)) {
+                sb.append(", ");
+            }
+        }
+        sb.append("))");
+        
+        return sb.toString();
+    }
 }
--- a/javafx-ui-common/src/com/sun/javafx/css/SceneStyleManager.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/css/SceneStyleManager.java	Tue Sep 11 20:39:23 2012 -0400
@@ -209,8 +209,8 @@
                     // If an exception occurred while loading one of the stylesheets
                     // then we will simply print warning into system.err and skip the
                     // stylesheet, allowing other stylesheets to attempt to load
-                    if (LOGGER.isLoggable(PlatformLogger.WARNING)) {
-                        LOGGER.warning("Cannot add stylesheet. %s\n", e.getLocalizedMessage());
+                    if (getLogger().isLoggable(PlatformLogger.WARNING)) {
+                        getLogger().warning("Cannot add stylesheet. %s\n", e.getLocalizedMessage());
                     }
                     // no telling what condition stylesheet is in. make it null
                     stylesheet = null;
--- a/javafx-ui-common/src/com/sun/javafx/css/Selector.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/css/Selector.java	Tue Sep 11 20:39:23 2012 -0400
@@ -93,6 +93,8 @@
         else
             return CompoundSelector.readBinary(is,strings);
     }
+    
+    protected abstract String writeJava();
 
     public static Selector createSelector(final String cssSelector) {
         if (cssSelector == null || cssSelector.length() == 0) {
--- a/javafx-ui-common/src/com/sun/javafx/css/SimpleSelector.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/css/SimpleSelector.java	Tue Sep 11 20:39:23 2012 -0400
@@ -484,4 +484,53 @@
         }
         return new SimpleSelector(name, styleClasses, pseudoclasses, id);
     }
+
+    @Override public String writeJava() {
+        StringBuilder sb = new StringBuilder();
+        sb.append("new SimpleSelector(\"");
+        sb.append(getName());
+        sb.append("\", ");
+        
+        // styleclasses
+        if (getStyleClasses().isEmpty()) {
+            sb.append("null");
+        } else {
+            sb.append("Arrays.<String>asList(");
+            for (int i = 0, max = getStyleClasses().size(); i < max; i++) {
+                sb.append("\"");
+                sb.append(getStyleClasses().get(i));
+                sb.append("\"");
+
+                if (i < (max - 1)) {
+                    sb.append(", ");
+                }
+            }
+            sb.append(")");
+        }
+        
+        sb.append(", ");
+        
+        // pseudoclasses
+        if (getPseudoclasses().isEmpty()) {
+            sb.append("null");
+        } else {
+            sb.append("Arrays.<String>asList(");
+            for (int i = 0, max = getPseudoclasses().size(); i < max; i++) {
+                sb.append("\"");
+                sb.append(getPseudoclasses().get(i));
+                sb.append("\"");
+
+                if (i < (max - 1)) {
+                    sb.append(", ");
+                }
+            }
+            sb.append(")");
+        }
+        
+        sb.append(", \"");
+        sb.append(getId());
+        sb.append("\")");
+        
+        return sb.toString();
+    }
 }
--- a/javafx-ui-common/src/com/sun/javafx/css/StyleConverter.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/css/StyleConverter.java	Tue Sep 11 20:39:23 2012 -0400
@@ -28,13 +28,11 @@
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
 import java.io.IOException;
+import java.lang.reflect.Method;
 import java.util.HashMap;
 import java.util.Map;
-
 import javafx.scene.text.Font;
-
 import com.sun.javafx.css.converters.EnumConverter;
-import java.util.List;
 
 /**
  * Converter converts ParsedValue&lt;F,T&gt; from type F to type T.
@@ -68,18 +66,14 @@
         return null;
     }
 
-    private static class Holder {
-        private static StyleConverter CONVERTER = new StyleConverter();
-    }
+    private static StyleConverter CONVERTER = new StyleConverter();
 
     /** This converter simply returns value.getValue() */
     public static StyleConverter getInstance() {
-        return Holder.CONVERTER;
+        return CONVERTER;
     }
 
-    protected StyleConverter() {
-    }
-
+    protected StyleConverter() { }
 
     public void writeBinary(DataOutputStream os, StringStore sstore)
             throws IOException {
@@ -90,7 +84,7 @@
     }
 
     // map of StyleConverter class name to StyleConverter
-    static Map<String,StyleConverter> tmap;
+    private static Map<String,StyleConverter> tmap;
 
     public static StyleConverter readBinary(DataInputStream is, String[] strings)
             throws IOException {
@@ -107,11 +101,15 @@
                 if (EnumConverter.class.isAssignableFrom(cl)) {
                     converter = new EnumConverter(is, strings);
                 } else {
-                    converter = getInstance(cl);
+                    Method getInstanceMethod = cl.getMethod("getInstance");
+                    converter = (StyleConverter) getInstanceMethod.invoke(null);
                 }
             } catch (ClassNotFoundException cnfe) {
                 // Class.forName failed
                 System.err.println(cnfe.toString());
+            } catch (Exception nsme) {
+                // Class.forName failed
+                System.err.println(nsme.toString());
             }
             if (converter == null) {
                 System.err.println("could not deserialize " + cname);
@@ -122,128 +120,9 @@
         }
         return tmap.get(cname);
     }
-
-
-    // package for unit test purposes
-    static StyleConverter getInstance(final Class converterClass) {
-
-        StyleConverter styleConverter = null;
-        // TODO: giant if-then-else block
-        if (com.sun.javafx.css.StyleConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.StyleConverter.getInstance();
-
-        } else if (com.sun.javafx.css.converters.BooleanConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.converters.BooleanConverter.getInstance();
-
-        } else if (com.sun.javafx.css.converters.ColorConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.converters.ColorConverter.getInstance();
-
-        } else if (com.sun.javafx.css.converters.CursorConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.converters.CursorConverter.getInstance();
-
-        } else if (com.sun.javafx.css.converters.EffectConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.converters.EffectConverter.getInstance();
-        } else if (com.sun.javafx.css.converters.EffectConverter.DropShadowConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.converters.EffectConverter.DropShadowConverter.getInstance();
-        } else if (com.sun.javafx.css.converters.EffectConverter.InnerShadowConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.converters.EffectConverter.InnerShadowConverter.getInstance();
-
-        // enum is handled differently
-
-        } else if (com.sun.javafx.css.converters.FontConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.converters.FontConverter.getInstance();
-        } else if (com.sun.javafx.css.converters.FontConverter.StyleConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.converters.FontConverter.StyleConverter.getInstance();
-        } else if (com.sun.javafx.css.converters.FontConverter.WeightConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.converters.FontConverter.WeightConverter.getInstance();
-        } else if (com.sun.javafx.css.converters.FontConverter.SizeConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.converters.FontConverter.SizeConverter.getInstance();
-
-        }  else if (com.sun.javafx.css.converters.InsetsConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.converters.InsetsConverter.getInstance();
-        }  else if (com.sun.javafx.css.converters.InsetsConverter.SequenceConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.converters.InsetsConverter.SequenceConverter.getInstance();
-
-        }  else if (com.sun.javafx.css.converters.PaintConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.converters.PaintConverter.getInstance();
-        }  else if (com.sun.javafx.css.converters.PaintConverter.SequenceConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.converters.PaintConverter.SequenceConverter.getInstance();
-        }  else if (com.sun.javafx.css.converters.PaintConverter.LinearGradientConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.converters.PaintConverter.LinearGradientConverter.getInstance();
-        }  else if (com.sun.javafx.css.converters.PaintConverter.RadialGradientConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.converters.PaintConverter.RadialGradientConverter.getInstance();
-
-        }  else if (com.sun.javafx.css.converters.SizeConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.converters.SizeConverter.getInstance();
-        }  else if (com.sun.javafx.css.converters.SizeConverter.SequenceConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.converters.SizeConverter.SequenceConverter.getInstance();
-
-        }  else if (com.sun.javafx.css.converters.StringConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.converters.StringConverter.getInstance();
-        }  else if (com.sun.javafx.css.converters.StringConverter.SequenceConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.converters.StringConverter.SequenceConverter.getInstance();
-
-        }  else if (com.sun.javafx.css.converters.URLConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.converters.URLConverter.getInstance();
-        }  else if (com.sun.javafx.css.converters.URLConverter.SequenceConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.converters.URLConverter.SequenceConverter.getInstance();
-
-        // Region stuff
-        }  else if (com.sun.javafx.scene.layout.region.BackgroundFillConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.scene.layout.region.BackgroundFillConverter.getInstance();
-
-        }  else if (com.sun.javafx.scene.layout.region.BackgroundImageConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.scene.layout.region.BackgroundImageConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.BackgroundImage.BackgroundPositionConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.scene.layout.region.BackgroundImage.BackgroundPositionConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.BackgroundImage.BackgroundRepeatConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.scene.layout.region.BackgroundImage.BackgroundRepeatConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.BackgroundImage.BackgroundSizeConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.scene.layout.region.BackgroundImage.BackgroundSizeConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.BackgroundImage.LayeredBackgroundPositionConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.scene.layout.region.BackgroundImage.LayeredBackgroundPositionConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.BackgroundImage.LayeredBackgroundSizeConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.scene.layout.region.BackgroundImage.LayeredBackgroundSizeConverter.getInstance();
-
-        }  else if (com.sun.javafx.scene.layout.region.BorderImageConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.scene.layout.region.BorderImageConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.BorderImage.RepeatConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.scene.layout.region.BorderImage.RepeatConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.BorderImage.SliceConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.scene.layout.region.BorderImage.SliceConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.BorderImage.SliceSequenceConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.scene.layout.region.BorderImage.SliceSequenceConverter.getInstance();
-
-        }  else if (com.sun.javafx.scene.layout.region.StrokeBorderConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.scene.layout.region.StrokeBorderConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.StrokeBorder.BorderPaintConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.scene.layout.region.StrokeBorder.BorderPaintConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.StrokeBorder.BorderStyleConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.scene.layout.region.StrokeBorder.BorderStyleConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.StrokeBorder.BorderStyleSequenceConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.scene.layout.region.StrokeBorder.BorderStyleSequenceConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.StrokeBorder.LayeredBorderPaintConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.scene.layout.region.StrokeBorder.LayeredBorderPaintConverter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.StrokeBorder.LayeredBorderStyleConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.scene.layout.region.StrokeBorder.LayeredBorderStyleConverter.getInstance();
-
-        }  else if (com.sun.javafx.scene.layout.region.Margins.Converter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.scene.layout.region.Margins.Converter.getInstance();
-        }  else if (com.sun.javafx.scene.layout.region.Margins.SequenceConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.scene.layout.region.Margins.SequenceConverter.getInstance();
-
-        // parser stuff
-        }  else if (com.sun.javafx.css.parser.DeriveColorConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.parser.DeriveColorConverter.getInstance();
-        }  else if (com.sun.javafx.css.parser.DeriveSizeConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.parser.DeriveSizeConverter.getInstance();
-        }  else if (com.sun.javafx.css.parser.LadderConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.parser.LadderConverter.getInstance();
-        }  else if (com.sun.javafx.css.parser.StopConverter.class.equals(converterClass)) {
-            styleConverter = com.sun.javafx.css.parser.StopConverter.getInstance();
-        }
-
-        return styleConverter;
+    
+    public String writeJava() {
+        return getClass().getCanonicalName() + ".getInstance()";
     }
 
 }
--- a/javafx-ui-common/src/com/sun/javafx/css/StyleHelper.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/css/StyleHelper.java	Tue Sep 11 20:39:23 2012 -0400
@@ -24,30 +24,28 @@
  */
 package com.sun.javafx.css;
 
-import com.sun.javafx.Logging;
-import com.sun.javafx.Utils;
+import java.lang.ref.Reference;
+import java.lang.ref.WeakReference;
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Arrays;
-
+import java.util.Map.Entry;
+import javafx.beans.value.WritableValue;
 import javafx.scene.Node;
+import javafx.scene.Parent;
 import javafx.scene.Scene;
 import javafx.scene.text.Font;
-
+import javafx.scene.text.FontPosture;
+import javafx.scene.text.FontWeight;
+import com.sun.javafx.Logging;
+import com.sun.javafx.Utils;
 import com.sun.javafx.css.Stylesheet.Origin;
 import com.sun.javafx.css.converters.FontConverter;
 import com.sun.javafx.css.parser.CSSParser;
 import com.sun.javafx.logging.PlatformLogger;
-import java.lang.ref.Reference;
-import java.lang.ref.WeakReference;
-import java.util.*;
-import java.util.Map.Entry;
-import javafx.beans.value.WritableValue;
-import javafx.scene.Parent;
-import javafx.scene.text.FontPosture;
-import javafx.scene.text.FontWeight;
 
 /**
  * The StyleHelper is a helper class used for applying CSS information to Nodes.
--- a/javafx-ui-common/src/com/sun/javafx/css/StyleManager.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/css/StyleManager.java	Tue Sep 11 20:39:23 2012 -0400
@@ -106,7 +106,13 @@
 
 abstract public class StyleManager<T> {
 
-    protected final static PlatformLogger LOGGER = com.sun.javafx.Logging.getCSSLogger();
+    private static PlatformLogger LOGGER;
+    protected static PlatformLogger getLogger() {
+        if (LOGGER == null) {
+            LOGGER = com.sun.javafx.Logging.getCSSLogger();
+        }
+        return LOGGER;
+    }
 
     /**
      * Return the StyleManager for the given Scene, or null if the scene
@@ -376,8 +382,8 @@
         try {
             return loadStylesheetUnPrivileged(fname);
         } catch (java.security.AccessControlException ace) {
-            if (LOGGER.isLoggable(PlatformLogger.INFO)) {
-                LOGGER.info("Could not load the stylesheet, trying with FilePermissions : " + fname);
+            if (getLogger().isLoggable(PlatformLogger.INFO)) {
+                getLogger().info("Could not load the stylesheet, trying with FilePermissions : " + fname);
             }
 
             /*
@@ -559,8 +565,8 @@
                         );
                     errors.add(error);
                 }
-                if (LOGGER.isLoggable(PlatformLogger.WARNING)) {
-                    LOGGER.warning(
+                if (getLogger().isLoggable(PlatformLogger.WARNING)) {
+                    getLogger().warning(
                         String.format("Resource \"%s\" not found.", fname)
                     );
                 }
@@ -575,8 +581,8 @@
                     );
                 errors.add(error);
             }
-            if (LOGGER.isLoggable(PlatformLogger.INFO)) {
-                LOGGER.info("Could not find stylesheet: " + fname);//, fnfe);
+            if (getLogger().isLoggable(PlatformLogger.INFO)) {
+                getLogger().info("Could not find stylesheet: " + fname);//, fnfe);
             }
         } catch (IOException ioe) {
                 if (errors != null) {
@@ -586,8 +592,8 @@
                         );
                     errors.add(error);
                 }
-            if (LOGGER.isLoggable(PlatformLogger.INFO)) {
-                LOGGER.info("Could not load stylesheet: " + fname);//, ioe);
+            if (getLogger().isLoggable(PlatformLogger.INFO)) {
+                getLogger().info("Could not load stylesheet: " + fname);//, ioe);
             }
         }
         return null;
--- a/javafx-ui-common/src/com/sun/javafx/css/Stylesheet.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/css/Stylesheet.java	Tue Sep 11 20:39:23 2012 -0400
@@ -26,12 +26,7 @@
 package com.sun.javafx.css;
 
 import com.sun.javafx.collections.TrackableObservableList;
-import java.io.BufferedInputStream;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
+import java.io.*;
 import java.net.URI;
 import java.net.URL;
 import java.util.ArrayList;
@@ -53,7 +48,7 @@
  * {@link #reapply}.
  *
  */
-final public class Stylesheet {
+public class Stylesheet {
 
     public enum Origin {
         USER_AGENT,
@@ -190,7 +185,7 @@
         os.writeShort(rules.size());
         for (Rule r : rules) r.writeBinary(os,stringStore);
     }
-
+    
     // protected for unit testing 
     /** @treatAsPrivate public to allow unit testing */
     public void readBinary(DataInputStream is, String[] strings)
@@ -256,7 +251,93 @@
         // return stylesheet
         return stylesheet;
     }
+    
+    public void writeJava(final PrintWriter writer, String className) throws IOException {
+        final String NEW_LINE = Rule.NEW_LINE;
+        final String INDENT = Rule.INDENT;
+        final String TWO_INDENT = Rule.TWO_INDENT;
+        
+        final int RULES_PER_METHOD = 50;
+        final int NUMBER_OF_METHODS = (rules.size() / RULES_PER_METHOD);
+
+        writer.write("import com.sun.javafx.css.*;" + NEW_LINE);
+        writer.write("import com.sun.javafx.css.parser.*;" + NEW_LINE);
+        writer.write("import java.util.*;" + NEW_LINE);
+        writer.write("import javafx.scene.paint.*;" + NEW_LINE);
+        
+        writer.write(NEW_LINE);
+        writer.write("public class " + className + " extends Stylesheet {");
+        writer.write(NEW_LINE);
+        writer.write(NEW_LINE);
+        
+        writer.write(INDENT);
+        writer.write("public ");
+        writer.write(className);
+        writer.write("() {");
+        writer.write(NEW_LINE);
+        
+        writer.write(TWO_INDENT);
+        writer.write("final List<Rule> rules = getRules();");
+        writer.write(NEW_LINE);
+        
+        for (int i = 0, max = NUMBER_OF_METHODS; i <= max; i++) {
+            writer.write(TWO_INDENT);
+            writer.write("loadRules");
+            writer.write(i+"");
+            writer.write("(rules);");
+            writer.write(NEW_LINE);
+        }
+        
+        // close the constructor
+        writer.write(INDENT);
+        writer.write("}");
+        writer.write(NEW_LINE);
+        writer.write(NEW_LINE);
+        
+        // get all the rules strings
+        String[] rulesStrings = new String[rules.size()];
+        for (int j = 0; j < rules.size(); j++) {
+            Rule r = rules.get(j);
+            rulesStrings[j] = r.writeJava();
+        }
+        
+        // write out methods
+        for (int i = 0; i <= NUMBER_OF_METHODS; i++) {
+            writer.write(INDENT);
+            writer.write("private final void loadRules");
+            writer.write(i+"");
+            writer.write("(final List<Rule> rules) {");
+            writer.write(NEW_LINE);
+            
+            writer.write(TWO_INDENT);
+            writer.write("Collections.addAll(rules, ");
+            writer.write(NEW_LINE);
+            
+            for (int j = 0; j < RULES_PER_METHOD; j++) {
+                int pos = i * RULES_PER_METHOD + j;
+                if (pos == rulesStrings.length) break;
+                
+                writer.write(TWO_INDENT);
+                writer.write(rulesStrings[pos]);
+                
+                if ((j < RULES_PER_METHOD - 1) && (pos < (rulesStrings.length - 1))) {
+                    writer.write(", ");
+                    writer.write(NEW_LINE);
+                }
+            }
+            
+            writer.write(NEW_LINE);
+            writer.write(TWO_INDENT);
+            writer.write(");");
+            
+            writer.write(NEW_LINE);
+            writer.write(INDENT);
+            writer.write("}");
+            writer.write(NEW_LINE);
+            writer.write(NEW_LINE);
+        }
+        
+        // close class
+        writer.write("}");
+    }
 }
-
-
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/com/sun/javafx/css/SubStyleableProperty.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.sun.javafx.css;
+
+import javafx.beans.value.WritableValue;
+import javafx.scene.Node;
+
+/**
+ * A StyleableProperty which is used for sub-properties, such as -fx-background-color, etc.
+ */
+public class SubStyleableProperty<T> extends StyleableProperty<Node,T> {
+    public SubStyleableProperty(String property, StyleConverter converter, T initialValue) {
+        super(property, converter, initialValue);
+    }
+
+    public SubStyleableProperty(String property, StyleConverter converter) {
+        super(property, converter);
+    }
+
+    @Override public boolean isSettable(Node node) { return false; }
+    @Override public WritableValue<T> getWritableValue(Node node) { return null; }
+}
--- a/javafx-ui-common/src/com/sun/javafx/css/converters/PaintConverter.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/css/converters/PaintConverter.java	Tue Sep 11 20:39:23 2012 -0400
@@ -24,7 +24,9 @@
  */
 package com.sun.javafx.css.converters;
 
+import javafx.scene.image.Image;
 import javafx.scene.paint.CycleMethod;
+import javafx.scene.paint.ImagePattern;
 import javafx.scene.paint.LinearGradient;
 import javafx.scene.paint.Paint;
 import javafx.scene.paint.RadialGradient;
@@ -44,6 +46,8 @@
         static PaintConverter INSTANCE = new PaintConverter();
         static SequenceConverter SEQUENCE_INSTANCE = new SequenceConverter();
         static LinearGradientConverter LINEAR_GRADIENT_INSTANCE = new LinearGradientConverter();
+        static ImagePatternConverter IMAGE_PATTERN_INSTANCE = new ImagePatternConverter();
+        static RepeatingImagePatternConverter REPEATING_IMAGE_PATTERN_INSTANCE = new RepeatingImagePatternConverter();
         static RadialGradientConverter RADIAL_GRADIENT_INSTANCE = new RadialGradientConverter();
     }
 
@@ -98,7 +102,6 @@
         }
     }
 
-
     public static final class LinearGradientConverter extends StyleConverter<ParsedValue[], Paint> {
 
         public static LinearGradientConverter getInstance() {
@@ -113,10 +116,10 @@
         public Paint convert(ParsedValue<ParsedValue[], Paint> value, Font font) {
             ParsedValue[] values = value.getValue();
             int v = 0;
-            final Size startX = (Size) ((ParsedValue<?, Size>) values[v++]).convert(font);
-            final Size startY = (Size) ((ParsedValue<?, Size>) values[v++]).convert(font);
-            final Size endX = (Size) ((ParsedValue<?, Size>) values[v++]).convert(font);
-            final Size endY = (Size) ((ParsedValue<?, Size>) values[v++]).convert(font);
+            final Size startX = ((ParsedValue<?, Size>) values[v++]).convert(font);
+            final Size startY = ((ParsedValue<?, Size>) values[v++]).convert(font);
+            final Size endX = ((ParsedValue<?, Size>) values[v++]).convert(font);
+            final Size endY = ((ParsedValue<?, Size>) values[v++]).convert(font);
             boolean proportional = startX.getUnits() == SizeUnits.PERCENT && startX.getUnits() == startY.getUnits() && startX.getUnits() == endX.getUnits() && startX.getUnits() == endY.getUnits();
             final CycleMethod cycleMethod = (CycleMethod) values[v++].convert(font);
             final Stop[] stops = new Stop[values.length - v];
@@ -132,6 +135,71 @@
         }
     }
 
+    public static final class ImagePatternConverter extends StyleConverter<ParsedValue[], Paint> {
+
+        public static ImagePatternConverter getInstance() {
+            return Holder.IMAGE_PATTERN_INSTANCE;
+        }
+
+        private ImagePatternConverter() {
+            super();
+        }
+
+        @Override
+        public Paint convert(ParsedValue<ParsedValue[], Paint> value, Font font) {
+            ParsedValue[] values = value.getValue();
+            ParsedValue<ParsedValue[],String> url = values[0];
+            if (values.length == 1) {
+                return new ImagePattern(new Image(url.convert(font)));
+            }
+
+            ParsedValue<?, Size> x = values[1];
+            ParsedValue<?, Size> y = values[2];
+            ParsedValue<?, Size> w = values[3];
+            ParsedValue<?, Size> h = values[4];
+            boolean p = values.length < 6 ? true : (Boolean) values[5].getValue();
+
+            return new ImagePattern(
+                    new Image(url.convert(font)),
+                    x.convert(font).getValue(),
+                    y.convert(font).getValue(),
+                    w.convert(font).getValue(),
+                    h.convert(font).getValue(), p);
+        }
+
+        @Override
+        public String toString() {
+            return "ImagePatternConverter";
+        }
+    }
+
+    public static final class RepeatingImagePatternConverter extends StyleConverter<ParsedValue[], Paint> {
+
+        public static RepeatingImagePatternConverter getInstance() {
+            return Holder.REPEATING_IMAGE_PATTERN_INSTANCE;
+        }
+
+        private RepeatingImagePatternConverter() {
+            super();
+        }
+
+        @Override
+        public Paint convert(ParsedValue<ParsedValue[], Paint> value, Font font) {
+            ParsedValue[] values = value.getValue();
+            ParsedValue<ParsedValue[],String> url = values[0];
+            String u = url.convert(font);
+            // If u is null, then we failed to locate the image associated with the url specified in the CSS file.
+            if (u == null) return null;
+            final Image image = new Image(u);
+            return new ImagePattern(image, 0, 0, image.getWidth(), image.getHeight(), false);
+        }
+
+        @Override
+        public String toString() {
+            return "RepeatingImagePatternConverter";
+        }
+    }
+
     public static final class RadialGradientConverter extends StyleConverter<ParsedValue[], Paint> {
 
         public static RadialGradientConverter getInstance() {
@@ -151,11 +219,11 @@
             // proportional, we need to get to the Size. getValue() will
             // return ParsedValue<?,Size>, so getValue().convert(font) will
             // give us the size.
-            final Size focusAngle = values[v++] != null ? (Size) ((ParsedValue<?, Size>) values[v-1]).convert(font) : null;
-            final Size focusDistance = values[v++] != null ? (Size) ((ParsedValue<?, Size>) values[v-1]).convert(font) : null;
-            final Size centerX = values[v++] != null ? (Size) ((ParsedValue<?, Size>) values[v-1]).convert(font) : null;
-            final Size centerY = values[v++] != null ? (Size) ((ParsedValue<?, Size>) values[v-1]).convert(font) : null;
-            final Size radius = (Size) ((ParsedValue<?, Size>) values[v++]).convert(font);
+            final Size focusAngle = values[v++] != null ? ((ParsedValue<?, Size>) values[v-1]).convert(font) : null;
+            final Size focusDistance = values[v++] != null ? ((ParsedValue<?, Size>) values[v-1]).convert(font) : null;
+            final Size centerX = values[v++] != null ? ((ParsedValue<?, Size>) values[v-1]).convert(font) : null;
+            final Size centerY = values[v++] != null ? ((ParsedValue<?, Size>) values[v-1]).convert(font) : null;
+            final Size radius = ((ParsedValue<?, Size>) values[v++]).convert(font);
             boolean proportional = radius.getUnits().equals(SizeUnits.PERCENT);
             boolean unitsAgree = centerX != null ? proportional == centerX.getUnits().equals(SizeUnits.PERCENT) : true;
             unitsAgree = unitsAgree && centerY != null ? proportional == centerY.getUnits().equals(SizeUnits.PERCENT) : true;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/com/sun/javafx/css/converters/ShapeConverter.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.sun.javafx.css.converters;
+
+import javafx.scene.shape.SVGPath;
+import javafx.scene.shape.Shape;
+import javafx.scene.text.Font;
+import com.sun.javafx.css.ParsedValue;
+import com.sun.javafx.css.StyleConverter;
+
+/**
+ * Converts an SVG shape string into a Shape object.
+ */
+public class ShapeConverter extends StyleConverter<String, Shape> {
+    private static final ShapeConverter INSTANCE = new ShapeConverter();
+
+    public static ShapeConverter getInstance() { return INSTANCE; }
+
+    @Override public Shape convert(ParsedValue<String, Shape> value, Font font) {
+        String svg = value.getValue();
+        if (svg == null || svg.isEmpty()) return null;
+        SVGPath path = new SVGPath();
+        path.setContent(svg);
+        return path;
+    }
+}
--- a/javafx-ui-common/src/com/sun/javafx/css/parser/CSSParser.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/css/parser/CSSParser.java	Tue Sep 11 20:39:23 2012 -0400
@@ -24,22 +24,26 @@
  */
 package com.sun.javafx.css.parser;
 
-import com.sun.javafx.css.*;
 import java.io.BufferedReader;
 import java.io.CharArrayReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.Reader;
 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.Map;
-
 import javafx.geometry.Insets;
 import javafx.scene.effect.BlurType;
 import javafx.scene.effect.Effect;
+import javafx.scene.layout.BackgroundPosition;
+import javafx.scene.layout.BackgroundRepeat;
+import javafx.scene.layout.BackgroundSize;
+import javafx.scene.layout.BorderStrokeStyle;
+import javafx.scene.layout.BorderWidths;
 import javafx.scene.paint.Color;
 import javafx.scene.paint.CycleMethod;
 import javafx.scene.paint.Paint;
@@ -50,7 +54,20 @@
 import javafx.scene.text.Font;
 import javafx.scene.text.FontPosture;
 import javafx.scene.text.FontWeight;
-
+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.FontUnits;
+import com.sun.javafx.css.ParsedValue;
+import com.sun.javafx.css.Rule;
+import com.sun.javafx.css.Selector;
+import com.sun.javafx.css.SimpleSelector;
+import com.sun.javafx.css.Size;
+import com.sun.javafx.css.SizeUnits;
+import com.sun.javafx.css.StyleManager;
+import com.sun.javafx.css.Styleable;
+import com.sun.javafx.css.Stylesheet;
 import com.sun.javafx.css.converters.BooleanConverter;
 import com.sun.javafx.css.converters.EffectConverter;
 import com.sun.javafx.css.converters.EnumConverter;
@@ -62,16 +79,23 @@
 import com.sun.javafx.css.converters.StringConverter;
 import com.sun.javafx.css.converters.URLConverter;
 import com.sun.javafx.logging.PlatformLogger;
-import com.sun.javafx.scene.layout.region.BackgroundImage;
-import com.sun.javafx.scene.layout.region.BorderImage;
-import com.sun.javafx.scene.layout.region.BorderStyle;
+import com.sun.javafx.scene.layout.region.BackgroundPositionConverter;
+import com.sun.javafx.scene.layout.region.BackgroundSizeConverter;
+import com.sun.javafx.scene.layout.region.BorderImageSliceConverter;
+import com.sun.javafx.scene.layout.region.BorderImageSlices;
+import com.sun.javafx.scene.layout.region.BorderImageWidthConverter;
+import com.sun.javafx.scene.layout.region.BorderImageWidthsSequenceConverter;
+import com.sun.javafx.scene.layout.region.BorderStrokeStyleSequenceConverter;
+import com.sun.javafx.scene.layout.region.BorderStyleConverter;
+import com.sun.javafx.scene.layout.region.LayeredBackgroundPositionConverter;
+import com.sun.javafx.scene.layout.region.LayeredBackgroundSizeConverter;
+import com.sun.javafx.scene.layout.region.LayeredBorderPaintConverter;
+import com.sun.javafx.scene.layout.region.LayeredBorderStyleConverter;
 import com.sun.javafx.scene.layout.region.Margins;
-import com.sun.javafx.scene.layout.region.Repeat;
-import com.sun.javafx.scene.layout.region.StrokeBorder;
-import java.net.MalformedURLException;
-import java.text.MessageFormat;
-import javafx.collections.ObservableList;
-import javafx.scene.Node;
+import com.sun.javafx.scene.layout.region.RepeatStruct;
+import com.sun.javafx.scene.layout.region.RepeatStructConverter;
+import com.sun.javafx.scene.layout.region.SliceSequenceConverter;
+import com.sun.javafx.scene.layout.region.StrokeBorderPaintConverter;
 
 final public class CSSParser {
     static boolean EXIT_ON_ERROR = false;
@@ -415,7 +439,7 @@
     
     private void reportError(CssError error) {
         List<CssError> errors = null;
-        if ((errors = StyleManager.getErrors()) != null) {        
+        if ((errors = StyleManager.getErrors()) != null) {
             errors.add(error);
         }
     }
@@ -468,8 +492,8 @@
         return buf.toString();
     }
     
-   // Assumes string is not a lookup!
-   private ParsedValue<Color,Color> colorValueOfString(String str) {
+    // Assumes string is not a lookup!
+    private ParsedValue<Color,Color> colorValueOfString(String str) {
 
         if(str.startsWith("#") || str.startsWith("0x")) {
 
@@ -715,7 +739,7 @@
         } else if ("-fx-border-image-source".equals(prop)) {
              return parseURILayers(root);
         } else if ("-fx-border-image-width".equals(prop)) {
-             return parseMarginsLayers(root);
+             return parseBorderImageWidthLayers(root);
         } else if ("-fx-padding".equals(prop)) {
             ParsedValue<?,Size>[] sides = parseSizeSeries(root);
             return new ParsedValue<ParsedValue<?,Size>[],Insets>(sides, InsetsConverter.getInstance());
@@ -1347,6 +1371,10 @@
             return parseLinearGradient(root);
         } else if ("radial-gradient".regionMatches(true, 0, fcn, 0, 15)) {
             return parseRadialGradient(root);
+        } else if ("image-pattern".regionMatches(true, 0, fcn, 0, 13)) {
+            return parseImagePattern(root);
+        } else if ("repeating-image-pattern".regionMatches(true, 0, fcn, 0, 23)) {
+            return parseRepeatingImagePattern(root);
         } else if ("ladder".regionMatches(true, 0, fcn, 0, 6)) {
             return parseLadder(root);
         } else if ("url".regionMatches(true, 0, fcn, 0, 3)) {
@@ -2131,6 +2159,114 @@
         
     }
     
+    // Based off ImagePattern constructor
+    //
+    // image-pattern(<uri-string>[,<size>,<size>,<size>,<size>[,<boolean>]?]?)
+    //
+    private ParsedValue<ParsedValue[], Paint> parseImagePattern(final Term root) throws ParseException {
+
+        // first term in the chain is the function name...
+        final String fn = (root.token != null) ? root.token.getText() : null;
+        // NOTE: We should put this in an assertion, so as not to do this work ordinarily, because only a
+        // bug in the parser can cause this.
+        assert !"image-pattern".regionMatches(true, 0, fn, 0, 13) : "Expected \'image-pattern\'";
+
+        Term arg;
+        if ((arg = root.firstArg) == null ||
+             arg.token == null ||
+             arg.token.getText().isEmpty()) {
+            error(root,
+                "Expected \'<uri-string>\'");
+        }
+
+        Term prev = arg;
+
+        final String uri = arg.token.getText();
+        ParsedValue[] uriValues = new ParsedValue[] {
+            new ParsedValue<String,String>(uri, StringConverter.getInstance()),
+            new ParsedValue<URL,URL>(sourceOfStylesheet, null)
+        };
+        ParsedValue parsedURI = new ParsedValue<ParsedValue[],String>(uriValues, URLConverter.getInstance());
+
+        // If nextArg is null, then there are no remaining arguments, so we are done.
+        if (arg.nextArg == null) {
+            ParsedValue[] values = new ParsedValue[1];
+            values[0] = parsedURI;
+            return new ParsedValue<ParsedValue[], Paint>(values, PaintConverter.ImagePatternConverter.getInstance());
+        }
+
+        // There must now be 4 sizes in a row.
+        Token token;
+        if ((arg = arg.nextArg) == null) error(prev, "Expected \'<size>\'");
+        ParsedValue<?, Size> x = parseSize(arg);
+
+        prev = arg;
+        if ((arg = arg.nextArg) == null) error(prev, "Expected \'<size>\'");
+        ParsedValue<?, Size> y = parseSize(arg);
+
+        prev = arg;
+        if ((arg = arg.nextArg) == null) error(prev, "Expected \'<size>\'");
+        ParsedValue<?, Size> w = parseSize(arg);
+
+        prev = arg;
+        if ((arg = arg.nextArg) == null) error(prev, "Expected \'<size>\'");
+        ParsedValue<?, Size> h = parseSize(arg);
+
+        // If there are no more args, then we are done.
+        if (arg.nextArg == null) {
+            ParsedValue[] values = new ParsedValue[5];
+            values[0] = parsedURI;
+            values[1] = x;
+            values[2] = y;
+            values[3] = w;
+            values[4] = h;
+            return new ParsedValue<ParsedValue[], Paint>(values, PaintConverter.ImagePatternConverter.getInstance());
+        }
+
+        prev = arg;
+        if ((arg = arg.nextArg) == null) error(prev, "Expected \'<boolean>\'");
+        if ((token = arg.token) == null || token.getText() == null) error(arg, "Expected \'<boolean>\'");
+
+        ParsedValue[] values = new ParsedValue[6];
+        values[0] = parsedURI;
+        values[1] = x;
+        values[2] = y;
+        values[3] = w;
+        values[4] = h;
+        values[5] = new ParsedValue<Boolean, Boolean>(Boolean.parseBoolean(token.getText()), null);
+        return new ParsedValue<ParsedValue[], Paint>(values, PaintConverter.ImagePatternConverter.getInstance());
+    }
+
+    // For tiling ImagePatterns easily.
+    //
+    // repeating-image-pattern(<uri-string>)
+    //
+    private ParsedValue<ParsedValue[], Paint> parseRepeatingImagePattern(final Term root) throws ParseException {
+        // first term in the chain is the function name...
+        final String fn = (root.token != null) ? root.token.getText() : null;
+        // NOTE: We should put this in an assertion, so as not to do this work ordinarily, because only a
+        // bug in the parser can cause this.
+        assert !"repeating-image-pattern".regionMatches(true, 0, fn, 0, 23) : "Expected \'repeating-image-pattern\'";
+
+        Term arg;
+        if ((arg = root.firstArg) == null ||
+             arg.token == null ||
+             arg.token.getText().isEmpty()) {
+            error(root,
+                "Expected \'<uri-string>\'");
+        }
+
+        final String uri = arg.token.getText();
+        ParsedValue[] uriValues = new ParsedValue[] {
+            new ParsedValue<String,String>(uri, StringConverter.getInstance()),
+            new ParsedValue<URL,URL>(sourceOfStylesheet, null)
+        };
+        ParsedValue parsedURI = new ParsedValue<ParsedValue[],String>(uriValues, URLConverter.getInstance());
+        ParsedValue[] values = new ParsedValue[1];
+        values[0] = parsedURI;
+        return new ParsedValue<ParsedValue[], Paint>(values, PaintConverter.RepeatingImagePatternConverter.getInstance());
+    }
+
     // parse a series of paint values separated by commas.
     // i.e., <paint> [, <paint>]*
     private ParsedValue<ParsedValue<?,Paint>[],Paint[]> parsePaintLayers(Term root)
@@ -2271,7 +2407,7 @@
      * returned ParsedValue is [size, size, size, size] with the semantics
      * [top offset, right offset, bottom offset left offset]
      */
-    private ParsedValue<ParsedValue<?,Size>[], BackgroundImage.BackgroundPosition> parseBackgroundPosition(Term term)
+    private ParsedValue<ParsedValue<?,Size>[], BackgroundPosition> parseBackgroundPosition(Term term)
         throws ParseException {
 
         if (term.token == null ||
@@ -2515,32 +2651,32 @@
         }
 
         ParsedValue<?,Size>[] values = new ParsedValue[] {top, right, bottom, left};
-        return new ParsedValue<ParsedValue<?,Size>[], BackgroundImage.BackgroundPosition>(values, BackgroundImage.BackgroundPositionConverter.getInstance());
+        return new ParsedValue<ParsedValue<?,Size>[], BackgroundPosition>(values, BackgroundPositionConverter.getInstance());
     }
 
-    private ParsedValue<ParsedValue<ParsedValue<?,Size>[], BackgroundImage.BackgroundPosition>[],BackgroundImage.BackgroundPosition[]>
+    private ParsedValue<ParsedValue<ParsedValue<?,Size>[], BackgroundPosition>[], BackgroundPosition[]>
             parseBackgroundPositionLayers(final Term root) throws ParseException {
 
         int nLayers = numberOfLayers(root);
-        ParsedValue<ParsedValue<?,Size>[], BackgroundImage.BackgroundPosition>[] layers = new ParsedValue[nLayers];
+        ParsedValue<ParsedValue<?,Size>[], BackgroundPosition>[] layers = new ParsedValue[nLayers];
         int layer = 0;
         Term term = root;
         while (term != null) {
             layers[layer++] = parseBackgroundPosition(term);
             term = nextLayer(term);
         }
-        return new ParsedValue<ParsedValue<ParsedValue<?,Size>[], BackgroundImage.BackgroundPosition>[],BackgroundImage.BackgroundPosition[]>(layers,BackgroundImage.LayeredBackgroundPositionConverter.getInstance());
+        return new ParsedValue<ParsedValue<ParsedValue<?,Size>[], BackgroundPosition>[], BackgroundPosition[]>(layers, LayeredBackgroundPositionConverter.getInstance());
     }
 
     /*
     http://www.w3.org/TR/css3-background/#the-background-repeat
     <repeat-style> = repeat-x | repeat-y | [repeat | space | round | no-repeat]{1,2}
     */
-    private ParsedValue<Repeat, Repeat>[] parseRepeatStyle(final Term root)
+    private ParsedValue<BackgroundRepeat, BackgroundRepeat>[] parseRepeatStyle(final Term root)
             throws ParseException {
 
-        Repeat xAxis, yAxis;
-        xAxis = yAxis = Repeat.NO_REPEAT;
+        BackgroundRepeat xAxis, yAxis;
+        xAxis = yAxis = BackgroundRepeat.NO_REPEAT;
 
         Term term = root;
 
@@ -2551,26 +2687,26 @@
 
         String text = term.token.getText().toLowerCase();
         if ("repeat-x".equals(text)) {
-            xAxis = Repeat.REPEAT;
-            yAxis = Repeat.NO_REPEAT;
+            xAxis = BackgroundRepeat.REPEAT;
+            yAxis = BackgroundRepeat.NO_REPEAT;
         } else if ("repeat-y".equals(text)) {
-            xAxis = Repeat.NO_REPEAT;
-            yAxis = Repeat.REPEAT;
+            xAxis = BackgroundRepeat.NO_REPEAT;
+            yAxis = BackgroundRepeat.REPEAT;
         } else if ("repeat".equals(text)) {
-            xAxis = Repeat.REPEAT;
-            yAxis = Repeat.REPEAT;
+            xAxis = BackgroundRepeat.REPEAT;
+            yAxis = BackgroundRepeat.REPEAT;
         } else if ("space".equals(text)) {
-            xAxis = Repeat.SPACE;
-            yAxis = Repeat.SPACE;
+            xAxis = BackgroundRepeat.SPACE;
+            yAxis = BackgroundRepeat.SPACE;
         } else if ("round".equals(text)) {
-            xAxis = Repeat.ROUND;
-            yAxis = Repeat.ROUND;
+            xAxis = BackgroundRepeat.ROUND;
+            yAxis = BackgroundRepeat.ROUND;
         } else if ("no-repeat".equals(text)) {
-            xAxis = Repeat.NO_REPEAT;
-            yAxis = Repeat.NO_REPEAT;
+            xAxis = BackgroundRepeat.NO_REPEAT;
+            yAxis = BackgroundRepeat.NO_REPEAT;
         } else if ("stretch".equals(text)) {
-            xAxis = Repeat.NO_REPEAT;
-            yAxis = Repeat.NO_REPEAT;
+            xAxis = BackgroundRepeat.NO_REPEAT;
+            yAxis = BackgroundRepeat.NO_REPEAT;
         } else {
             error(term, "Expected  \'<repeat-style>\' " + text);
         }
@@ -2587,62 +2723,62 @@
             } else if ("repeat-y".equals(text)) {
                 error(term, "Unexpected \'repeat-y\'");
             } else if ("repeat".equals(text)) {
-                yAxis = Repeat.REPEAT;
+                yAxis = BackgroundRepeat.REPEAT;
             } else if ("space".equals(text)) {
-                yAxis = Repeat.SPACE;
+                yAxis = BackgroundRepeat.SPACE;
             } else if ("round".equals(text)) {
-                yAxis = Repeat.ROUND;
+                yAxis = BackgroundRepeat.ROUND;
             } else if ("no-repeat".equals(text)) {
-                yAxis = Repeat.NO_REPEAT;
+                yAxis = BackgroundRepeat.NO_REPEAT;
             } else if ("stretch".equals(text)) {
-                yAxis = Repeat.NO_REPEAT;
+                yAxis = BackgroundRepeat.NO_REPEAT;
             } else {
                 error(term, "Expected  \'<repeat-style>\'");
             }
         }
 
         return new ParsedValue[] {
-            new ParsedValue<Repeat,Repeat>(xAxis, null),
-            new ParsedValue<Repeat,Repeat>(yAxis, null)
+            new ParsedValue<BackgroundRepeat,BackgroundRepeat>(xAxis, null),
+            new ParsedValue<BackgroundRepeat,BackgroundRepeat>(yAxis, null)
         };
     }
 
-    private ParsedValue<ParsedValue<Repeat, Repeat>[][],BorderImage.BorderImageRepeat[]>
+    private ParsedValue<ParsedValue<BackgroundRepeat, BackgroundRepeat>[][],RepeatStruct[]>
             parseBorderImageRepeatStyleLayers(final Term root) throws ParseException {
 
         int nLayers = numberOfLayers(root);
-        ParsedValue<Repeat, Repeat>[][] layers = new ParsedValue[nLayers][];
+        ParsedValue<BackgroundRepeat, BackgroundRepeat>[][] layers = new ParsedValue[nLayers][];
         int layer = 0;
         Term term = root;
         while (term != null) {
             layers[layer++] = parseRepeatStyle(term);
             term = nextLayer(term);
         }
-        return new ParsedValue<ParsedValue<Repeat, Repeat>[][],BorderImage.BorderImageRepeat[]>(layers, BorderImage.RepeatConverter.getInstance());
+        return new ParsedValue<ParsedValue<BackgroundRepeat, BackgroundRepeat>[][],RepeatStruct[]>(layers, RepeatStructConverter.getInstance());
     }
 
-    private ParsedValue<ParsedValue<Repeat, Repeat>[][],BackgroundImage.BackgroundRepeat[]>
+    private ParsedValue<ParsedValue<BackgroundRepeat, BackgroundRepeat>[][], RepeatStruct[]>
             parseBackgroundRepeatStyleLayers(final Term root) throws ParseException {
 
         int nLayers = numberOfLayers(root);
-        ParsedValue<Repeat, Repeat>[][] layers = new ParsedValue[nLayers][];
+        ParsedValue<BackgroundRepeat, BackgroundRepeat>[][] layers = new ParsedValue[nLayers][];
         int layer = 0;
         Term term = root;
         while (term != null) {
             layers[layer++] = parseRepeatStyle(term);
             term = nextLayer(term);
         }
-        return new ParsedValue<ParsedValue<Repeat, Repeat>[][],BackgroundImage.BackgroundRepeat[]>(layers, BackgroundImage.BackgroundRepeatConverter.getInstance());
+        return new ParsedValue<ParsedValue<BackgroundRepeat, BackgroundRepeat>[][], RepeatStruct[]>(layers, RepeatStructConverter.getInstance());
     }
 
     /*
     http://www.w3.org/TR/css3-background/#the-background-size
     <bg-size> = [ <length> | <percentage> | auto ]{1,2} | cover | contain
     */
-    private ParsedValue<ParsedValue[],BackgroundImage.BackgroundSize> parseBackgroundSize(final Term root)
+    private ParsedValue<ParsedValue[], BackgroundSize> parseBackgroundSize(final Term root)
         throws ParseException {
 
-        ParsedValue<?,Size> height = ZERO_PERCENT, width = ZERO_PERCENT;
+        ParsedValue<?,Size> height = null, width = null;
         boolean cover = false, contain = false;
 
         Term term = root;
@@ -2653,8 +2789,7 @@
                 (term.token.getText() != null) ? term.token.getText().toLowerCase() : null;
 
             if ("auto".equals(text)) {
-                width = ZERO_PERCENT;
-                height = ZERO_PERCENT;
+                // We don't do anything because width / height are already initialized
             } else if ("cover".equals(text)) {
                 cover = true;
             } else if ("contain".equals(text)) {
@@ -2667,7 +2802,7 @@
             }
         } else if (isSize(term.token)) {
             width = parseSize(term);
-            height = ZERO_PERCENT;
+            height = null;
         } else {
             error(term, "Expected \'<bg-size>\'");
         }
@@ -2680,7 +2815,7 @@
                     (term.token.getText() != null) ? term.token.getText().toLowerCase() : null;
 
                 if ("auto".equals(text)) {
-                    height = ZERO_PERCENT;
+                    height = null;
                 } else if ("cover".equals(text)) {
                     error(term, "Unexpected \'cover\'");
                 } else if ("contain".equals(text)) {
@@ -2705,21 +2840,21 @@
             new ParsedValue<String,Boolean>((cover ? "true" : "false"), BooleanConverter.getInstance()),
             new ParsedValue<String,Boolean>((contain ? "true" : "false"), BooleanConverter.getInstance())
         };
-        return new ParsedValue<ParsedValue[],BackgroundImage.BackgroundSize>(values, BackgroundImage.BackgroundSizeConverter.getInstance());
+        return new ParsedValue<ParsedValue[], BackgroundSize>(values, BackgroundSizeConverter.getInstance());
     }
 
-    private ParsedValue<ParsedValue<ParsedValue[],BackgroundImage.BackgroundSize>[], BackgroundImage.BackgroundSize[]>
+    private ParsedValue<ParsedValue<ParsedValue[], BackgroundSize>[],  BackgroundSize[]>
             parseBackgroundSizeLayers(final Term root) throws ParseException {
 
         int nLayers = numberOfLayers(root);
-        ParsedValue<ParsedValue[],BackgroundImage.BackgroundSize>[] layers = new ParsedValue[nLayers];
+        ParsedValue<ParsedValue[], BackgroundSize>[] layers = new ParsedValue[nLayers];
         int layer = 0;
         Term term = root;
         while (term != null) {
             layers[layer++] = parseBackgroundSize(term);
             term = nextLayer(term);
         }
-        return new ParsedValue<ParsedValue<ParsedValue[],BackgroundImage.BackgroundSize>[], BackgroundImage.BackgroundSize[]>(layers, BackgroundImage.LayeredBackgroundSizeConverter.getInstance());
+        return new ParsedValue<ParsedValue<ParsedValue[], BackgroundSize>[], BackgroundSize[]>(layers, LayeredBackgroundSizeConverter.getInstance());
     }
 
     private ParsedValue<ParsedValue<?,Paint>[], Paint[]> parseBorderPaint(final Term root)
@@ -2739,7 +2874,7 @@
         if (paint < 3) paints[2] = paints[0]; // bottom = top
         if (paint < 4) paints[3] = paints[1]; // left = right
 
-        return new ParsedValue<ParsedValue<?,Paint>[], Paint[]>(paints, StrokeBorder.BorderPaintConverter.getInstance());
+        return new ParsedValue<ParsedValue<?,Paint>[], Paint[]>(paints, StrokeBorderPaintConverter.getInstance());
     }
 
     private ParsedValue<ParsedValue<ParsedValue<?,Paint>[],Paint[]>[], Paint[][]> parseBorderPaintLayers(final Term root)
@@ -2753,15 +2888,15 @@
             layers[layer++] = parseBorderPaint(term);
             term = nextLayer(term);
         }
-        return new ParsedValue<ParsedValue<ParsedValue<?,Paint>[],Paint[]>[], Paint[][]>(layers, StrokeBorder.LayeredBorderPaintConverter.getInstance());
+        return new ParsedValue<ParsedValue<ParsedValue<?,Paint>[],Paint[]>[], Paint[][]>(layers, LayeredBorderPaintConverter.getInstance());
     }
 
     // borderStyle (borderStyle (borderStyle borderStyle?)?)?
-    private ParsedValue<ParsedValue<ParsedValue[],BorderStyle>[],BorderStyle[]> parseBorderStyleSeries(final Term root)
+    private ParsedValue<ParsedValue<ParsedValue[],BorderStrokeStyle>[],BorderStrokeStyle[]> parseBorderStyleSeries(final Term root)
             throws ParseException {
 
         Term term = root;
-        ParsedValue<ParsedValue[],BorderStyle>[] borders = new ParsedValue[4];
+        ParsedValue<ParsedValue[],BorderStrokeStyle>[] borders = new ParsedValue[4];
         int border = 0;
         while (term != null) {
             borders[border++] = parseBorderStyle(term);
@@ -2772,22 +2907,22 @@
         if (border < 3) borders[2] = borders[0]; // bottom = top
         if (border < 4) borders[3] = borders[1]; // left = right
 
-        return new ParsedValue<ParsedValue<ParsedValue[],BorderStyle>[],BorderStyle[]>(borders, StrokeBorder.BorderStyleSequenceConverter.getInstance());
+        return new ParsedValue<ParsedValue<ParsedValue[],BorderStrokeStyle>[],BorderStrokeStyle[]>(borders, BorderStrokeStyleSequenceConverter.getInstance());
     }
 
 
-    private ParsedValue<ParsedValue<ParsedValue<ParsedValue[],BorderStyle>[],BorderStyle[]>[], BorderStyle[][]>
+    private ParsedValue<ParsedValue<ParsedValue<ParsedValue[],BorderStrokeStyle>[],BorderStrokeStyle[]>[], BorderStrokeStyle[][]>
             parseBorderStyleLayers(final Term root) throws ParseException {
 
         int nLayers = numberOfLayers(root);
-        ParsedValue<ParsedValue<ParsedValue[],BorderStyle>[],BorderStyle[]>[] layers = new ParsedValue[nLayers];
+        ParsedValue<ParsedValue<ParsedValue[],BorderStrokeStyle>[],BorderStrokeStyle[]>[] layers = new ParsedValue[nLayers];
         int layer = 0;
         Term term = root;
         while (term != null) {
             layers[layer++] = parseBorderStyleSeries(term);
             term = nextLayer(term);
         }
-        return new ParsedValue<ParsedValue<ParsedValue<ParsedValue[],BorderStyle>[],BorderStyle[]>[], BorderStyle[][]>(layers,StrokeBorder.LayeredBorderStyleConverter.getInstance());
+        return new ParsedValue<ParsedValue<ParsedValue<ParsedValue[],BorderStrokeStyle>[],BorderStrokeStyle[]>[], BorderStrokeStyle[][]>(layers, LayeredBorderStyleConverter.getInstance());
     }
 
     // Only meant to be used from parseBorderStyle, but might be useful elsewhere
@@ -2808,7 +2943,7 @@
     //      <dash-style> [centered | inside | outside]? [line-join [miter <number> | bevel | round]]? [line-cap [square | butt | round]]?
     // where <dash-style> =
     //      [ none | solid | dotted | dashed ]
-    private ParsedValue<ParsedValue[],BorderStyle> parseBorderStyle(final Term root)
+    private ParsedValue<ParsedValue[],BorderStrokeStyle> parseBorderStyle(final Term root)
             throws ParseException {
 
 
@@ -2903,7 +3038,7 @@
             strokeLineCap
         };
 
-        return new ParsedValue(values, StrokeBorder.BorderStyleConverter.getInstance());
+        return new ParsedValue(values, BorderStyleConverter.getInstance());
     }
 
     //
@@ -2927,31 +3062,6 @@
         return segments;
     }
 
-
-    private static final ParsedValue<ParsedValue<?,Size>[],Double[]> DASHED =
-            new ParsedValue<ParsedValue<?,Size>[],Double[]>(
-                new ParsedValue[] {
-                    new ParsedValue<Size,Size>(new Size(5.0f, SizeUnits.PX), null),
-                    new ParsedValue<Size,Size>(new Size(3.0f, SizeUnits.PX), null)
-                }, SizeConverter.SequenceConverter.getInstance());
-
-    private static final ParsedValue<ParsedValue<?,Size>[],Double[]> DOTTED =
-            new ParsedValue<ParsedValue<?,Size>[],Double[]>(
-                new ParsedValue[]{
-                    new ParsedValue<Size,Size>(new Size(1.0f, SizeUnits.PX), null),
-                    new ParsedValue<Size,Size>(new Size(3.0f, SizeUnits.PX), null)
-                }, SizeConverter.SequenceConverter.getInstance());
-
-    private static final ParsedValue<ParsedValue<?,Size>[],Double[]> SOLID =
-            new ParsedValue<ParsedValue<?,Size>[],Double[]>(
-                new ParsedValue[]{
-                    /* empty array */
-                }, SizeConverter.SequenceConverter.getInstance());
-
-
-    private static final ParsedValue<ParsedValue<?,Size>[],Double[]> NONE =
-            new ParsedValue<ParsedValue<?,Size>[],Double[]>(null, SizeConverter.SequenceConverter.getInstance());
-
     /*
     <border-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset
     */
@@ -2966,15 +3076,17 @@
         final String text = root.token.getText().toLowerCase();
 
         if ("none".equals(text)) {
-            return NONE;
+            return BorderStyleConverter.NONE;
         } else if ("hidden".equals(text)) {
-            return NONE;
+            // The "hidden" mode doesn't make sense for FX, because it is the
+            // same as "none" except for border-collapsed CSS tables
+            return BorderStyleConverter.NONE;
         } else if ("dotted".equals(text)) {
-            return DOTTED;
+            return BorderStyleConverter.DOTTED;
         } else if ("dashed".equals(text)) {
-            return DASHED;
+            return BorderStyleConverter.DASHED;
         } else if ("solid".equals(text)) {
-            return SOLID;
+            return BorderStyleConverter.SOLID;
         } else if ("double".equals(text)) {
             error(root, "Unsupported <border-style> \'double\'");
         } else if ("groove".equals(text)) {
@@ -2990,7 +3102,7 @@
         }
         // error throws so we should never get here.
         // but the compiler wants a return, so here it is.
-        return SOLID;
+        return BorderStyleConverter.SOLID;
     }
 
     private ParsedValue<ParsedValue<?,Size>[],Double[]> segments(Term root)
@@ -3090,7 +3202,7 @@
      * http://www.w3.org/TR/css3-background/#the-border-image-slice
      * [<number> | <percentage>]{1,4} && fill?
      */
-    private ParsedValue<ParsedValue[],BorderImage.BorderImageSlice> parseBorderImageSlice(final Term root)
+    private ParsedValue<ParsedValue[],BorderImageSlices> parseBorderImageSlice(final Term root)
         throws ParseException {
 
         Term term = root;
@@ -3123,21 +3235,65 @@
                 new ParsedValue<ParsedValue<?,Size>[],Insets>(insets, InsetsConverter.getInstance()),
                 new ParsedValue<Boolean,Boolean>(fill, null)
         };
-        return new ParsedValue<ParsedValue[], BorderImage.BorderImageSlice>(values, BorderImage.SliceConverter.getInstance());
+        return new ParsedValue<ParsedValue[], BorderImageSlices>(values, BorderImageSliceConverter.getInstance());
     }
 
-    private ParsedValue<ParsedValue<ParsedValue[],BorderImage.BorderImageSlice>[],BorderImage.BorderImageSlice[]>
+    private ParsedValue<ParsedValue<ParsedValue[],BorderImageSlices>[],BorderImageSlices[]>
             parseBorderImageSliceLayers(final Term root) throws ParseException {
 
         int nLayers = numberOfLayers(root);
-        ParsedValue<ParsedValue[], BorderImage.BorderImageSlice>[] layers = new ParsedValue[nLayers];
+        ParsedValue<ParsedValue[], BorderImageSlices>[] layers = new ParsedValue[nLayers];
         int layer = 0;
         Term term = root;
         while (term != null) {
             layers[layer++] = parseBorderImageSlice(term);
             term = nextLayer(term);
         }
-        return new ParsedValue<ParsedValue<ParsedValue[],BorderImage.BorderImageSlice>[],BorderImage.BorderImageSlice[]> (layers, BorderImage.SliceSequenceConverter.getInstance());
+        return new ParsedValue<ParsedValue<ParsedValue[],BorderImageSlices>[],BorderImageSlices[]> (layers, SliceSequenceConverter.getInstance());
+    }
+
+    /*
+     * http://www.w3.org/TR/css3-background/#border-image-width
+     * [ <length> | <percentage> | <number> | auto ]{1,4}
+     */
+    private ParsedValue<ParsedValue<?,Size>[], BorderWidths> parseBorderImageWidth(final Term root)
+            throws ParseException {
+
+        Term term = root;
+        if (term.token == null || !isSize(term.token))
+            error(term, "Expected \'<size>\'");
+
+        ParsedValue<?,Size>[] insets = new ParsedValue[4];
+
+        int inset = 0;
+        while (inset < 4 && term != null) {
+            insets[inset++] = parseSize(term);
+
+            if ((term = term.nextInSeries) != null &&
+                    term.token != null &&
+                    term.token.getType() == CSSLexer.IDENT) {
+            }
+        }
+
+        if (inset < 2) insets[1] = insets[0]; // right = top
+        if (inset < 3) insets[2] = insets[0]; // bottom = top
+        if (inset < 4) insets[3] = insets[1]; // left = right
+
+        return new ParsedValue<ParsedValue<?,Size>[], BorderWidths>(insets, BorderImageWidthConverter.getInstance());
+    }
+
+    private ParsedValue<ParsedValue<ParsedValue<?,Size>[],BorderWidths>[],BorderWidths[]>
+        parseBorderImageWidthLayers(final Term root) throws ParseException {
+
+        int nLayers = numberOfLayers(root);
+        ParsedValue<ParsedValue<?,Size>[], BorderWidths>[] layers = new ParsedValue[nLayers];
+        int layer = 0;
+        Term term = root;
+        while (term != null) {
+            layers[layer++] = parseBorderImageWidth(term);
+            term = nextLayer(term);
+        }
+        return new ParsedValue<ParsedValue<ParsedValue<?,Size>[],BorderWidths>[],BorderWidths[]> (layers, BorderImageWidthsSequenceConverter.getInstance());
     }
 
 
@@ -3159,7 +3315,7 @@
         if (arg.token == null ||
             arg.token.getType() != CSSLexer.STRING ||
             arg.token.getText() == null ||
-            arg.token.getText().isEmpty()) error(arg, "Excpected \'url(\"<uri-string>\")\'");
+            arg.token.getText().isEmpty()) error(arg, "Expected \'url(\"<uri-string>\")\'");
 
         final String uri = arg.token.getText();
         ParsedValue[] uriValues = new ParsedValue[] {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/com/sun/javafx/css/parser/Css2Java.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.sun.javafx.css.parser;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+
+import com.sun.javafx.css.Stylesheet;
+import java.io.*;
+
+/** Css2Java <input file> [<package name> <output file name>]
+ * java -classpath <sdk desktop lib path>/javafx-ui-common.jar com.sun.javafx.css.parser.Css2Java input.css full.package.name output.java
+ *  If no output file is given, then the input file name is used with an extension of 'java'
+ */
+public class Css2Java {
+    public static void main(String args[]) throws Exception {
+        
+        if ( args.length < 1) throw new IllegalArgumentException("expected <input file> [<package name> <output file name>] as arguments");
+
+        try {
+            String ifname = args[0];
+            String packageName = (args.length > 1 ? args[1] : null);
+            String ofname = (args.length > 2) ?
+                args[2] : ifname.substring(0, ifname.lastIndexOf('.')+1).concat("java");
+            
+            convertToJava(ifname, ofname, packageName);
+        } catch (Exception e) {
+            System.err.println(e.toString());
+            e.printStackTrace(System.err);
+            System.exit(-1);
+        } 
+    }
+
+    public static void convertToJava(String ifname, String ofname, String packageName) throws IOException {
+        final URL urlIn = new java.net.URL("file", null, ifname);
+
+        CSSParser.EXIT_ON_ERROR = true;
+        Stylesheet stylesheet = CSSParser.getInstance().parse(urlIn);
+
+        File outFile = new File(ofname);
+        PrintWriter writer = new PrintWriter(outFile);
+        
+        if (packageName != null && ! packageName.isEmpty()) {
+            writer.write("package ");
+            writer.write(packageName);
+            writer.write(";");
+            writer.write("\r\n\r\n");
+        }
+        
+        String className = outFile.getName();
+        className = className.substring(0, className.indexOf("."));
+        stylesheet.writeJava(writer, className);
+        writer.flush();
+        writer.close();
+    }
+}
--- a/javafx-ui-common/src/com/sun/javafx/menu/MenuBase.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/menu/MenuBase.java	Tue Sep 11 20:39:23 2012 -0400
@@ -25,13 +25,11 @@
 
 package com.sun.javafx.menu;
 
-import com.sun.javafx.event.EventTypeUtil;
 import javafx.beans.property.ObjectProperty;
 import javafx.beans.property.ReadOnlyBooleanProperty;
 import javafx.collections.ObservableList;
 import javafx.event.Event;
 import javafx.event.EventHandler;
-import javafx.event.EventType;
 
 
 public interface MenuBase extends MenuItemBase {
--- a/javafx-ui-common/src/com/sun/javafx/scene/layout/region/BackgroundFill.java	Tue Sep 11 20:35:27 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,255 +0,0 @@
-/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.javafx.scene.layout.region;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import javafx.geometry.Insets;
-import javafx.scene.paint.Paint;
-
-import com.sun.javafx.css.StyleableProperty;
-import com.sun.javafx.css.converters.InsetsConverter;
-import com.sun.javafx.css.converters.PaintConverter;
-import java.util.ArrayList;
-import javafx.beans.value.WritableValue;
-import javafx.scene.Node;
-import javafx.scene.paint.Color;
-
-
-public class BackgroundFill {
-
-     /**
-      * Super-lazy instantiation pattern from Bill Pugh.
-      * @treatAsPrivate implementation detail
-      */
-     private static class StyleableProperties {
-         
-         // 
-         // These are sub-properties of Region.BACKGROUND_FILLS
-         //
-         private static final StyleableProperty<Node,Paint[]> BACKGROUND_COLOR =
-            new StyleableProperty<Node,Paint[]>("-fx-background-color", 
-                PaintConverter.SequenceConverter.getInstance(), 
-                new Paint[] {Color.BLACK}) {
-
-            @Override
-            public boolean isSettable(Node node) {
-                return false;
-            }
-
-            @Override
-            public WritableValue<Paint[]> getWritableValue(Node node) {
-                return null;
-            }
-        };
-         
-        private static final StyleableProperty<Node,Insets[]> BACKGROUND_RADIUS =
-            new StyleableProperty<Node,Insets[]>("-fx-background-radius", 
-                InsetsConverter.SequenceConverter.getInstance(), 
-                new Insets[] {Insets.EMPTY}) {
-
-            @Override
-            public boolean isSettable(Node node) {
-                return false;
-            }
-
-            @Override
-            public WritableValue<Insets[]> getWritableValue(Node node) {
-                return null;
-            }
-        };
-
-        private static final StyleableProperty<Node,Insets[]> BACKGROUND_INSETS =
-            new StyleableProperty<Node,Insets[]>("-fx-background-insets", 
-                InsetsConverter.SequenceConverter.getInstance(), 
-                new Insets[] {Insets.EMPTY}) {
-
-            @Override
-            public boolean isSettable(Node node) {
-                return false;
-            }
-
-            @Override
-            public WritableValue<Insets[]> getWritableValue(Node node) {
-                return null;
-            }
-        };
-
-        private static final List<StyleableProperty> STYLEABLES;
-         static {
-             final List<StyleableProperty> subProperties = 
-                 new ArrayList<StyleableProperty>();
-            Collections.addAll(subProperties,
-                BACKGROUND_COLOR,
-                BACKGROUND_RADIUS,
-                BACKGROUND_INSETS
-            );
-            STYLEABLES = Collections.unmodifiableList(subProperties);
-         }
-    }
-
-     /**
-      * Super-lazy instantiation pattern from Bill Pugh. StyleablePropertyHolder is referenced
-      * no earlier (and therefore loaded no earlier by the class loader) than
-      * the moment that  impl_CSS_STYLEABLES() is called.
-      * @treatAsPrivate implementation detail
-      */
-     public static List<StyleableProperty> impl_CSS_STYLEABLES() {
-         return BackgroundFill.StyleableProperties.STYLEABLES;
-     }
-
-     /**
-      * RT-19263
-      * @treatAsPrivate implementation detail
-      * @deprecated This is an experimental API that is not intended for general use and is subject to change in future versions
-      */
-     @Deprecated
-    public List<StyleableProperty> impl_getStyleableProperties() {
-        return impl_CSS_STYLEABLES();
-    }
-
-    final private Paint fill;
-    public Paint getFill() {
-        return fill;
-    }
-
-    /**
-     * Defined the radius of the top left corner of the region this border is
-     * being applied to. It only has effect if the region is a rectangular region.
-     *
-     * @defaultValue 0.0
-     */
-    final private double topLeftCornerRadius;
-    public double getTopLeftCornerRadius() {
-        return topLeftCornerRadius;
-    }
-
-    /**
-     * Defined the radius of the top right corner of the region this border is
-     * being applied to. It only has effect if the region is a rectangular region.
-     *
-     * @defaultValue 0.0
-     */
-    final private double topRightCornerRadius;
-    public double getTopRightCornerRadius() {
-        return topRightCornerRadius;
-    }
-
-    /**
-     * Defined the radius of the bottom left corner of the region this border is
-     * being applied to. It only has effect if the region is a rectangular region.
-     *
-     * @defaultValue 0.0
-     */
-    final private double bottomLeftCornerRadius;
-    public double getBottomLeftCornerRadius() {
-        return bottomLeftCornerRadius;
-    }
-
-    /**
-     * Defined the radius of the bottom right corner of the region this border is
-     * being applied to. It only has effect if the region is a rectangular region.
-     *
-     * @defaultValue 0.0
-     */
-    final private double bottomRightCornerRadius;
-    public double getBottomRightCornerRadius() {
-        return bottomRightCornerRadius;
-    }
-
-    /**
-     * Offsets to use from the region bounds. Units are scene graph units.
-     *
-     * @defaultValue null
-     */
-    final private Insets offsets;
-    public Insets getOffsets() {
-        if (offsets == null) return Insets.EMPTY;
-        return offsets;
-    }
-
-    /**
-     * Since BackgroundFill is an immutable class we only need to compute the
-     * hash code once
-     */
-    private int hash = 0;
-
-    // Constructed only from BackgroundFillsConverter
-    BackgroundFill(Paint fill, double topLeftCornerRadius,
-            double topRightCornerRadius, double bottomRightCornerRadius,
-            double bottomLeftCornerRadius, Insets offsets) {
-        this.fill = fill;
-        this.topLeftCornerRadius = topLeftCornerRadius;
-        this.topRightCornerRadius = topRightCornerRadius;
-        this.bottomRightCornerRadius = bottomRightCornerRadius;
-        this.bottomLeftCornerRadius = bottomLeftCornerRadius;
-        this.offsets = offsets;
-    }
-
-    @Override public String toString() {
-        return "BackgroundFill [fill=" + fill + ", "
-            +  "radii=" + topLeftCornerRadius + ", "
-            +  topRightCornerRadius + ","
-            +  bottomRightCornerRadius + ","
-            +  bottomLeftCornerRadius + ", offets="
-            +  offsets + "]";
-    }
-
-    /**
-     * @inheritDoc
-     */
-    @Override public boolean equals(Object obj) {
-        if (obj == this) return true;
-        if (obj instanceof BackgroundFill) {
-            BackgroundFill other = (BackgroundFill) obj;
-            return fill.equals(other.fill)
-              && topLeftCornerRadius == other.topLeftCornerRadius
-              && topRightCornerRadius == other.topRightCornerRadius
-              && bottomLeftCornerRadius == other.bottomLeftCornerRadius
-              && bottomRightCornerRadius == other.bottomRightCornerRadius
-              && (offsets == null ? other.offsets == null : other.offsets.equals(offsets));
-        } else return false;
-    }
-
-    /**
-     * @inheritDoc
-     */
-    @Override public int hashCode() {
-        if (hash == 0) {
-            long bits = 17L;
-            bits = 37L * bits + (fill == null ? 0L : fill.hashCode());
-            bits = 37L * bits + Double.doubleToLongBits(topLeftCornerRadius);
-            bits = 37L * bits + Double.doubleToLongBits(topRightCornerRadius);
-            bits = 37L * bits + Double.doubleToLongBits(bottomLeftCornerRadius);
-            bits = 37L * bits + Double.doubleToLongBits(bottomRightCornerRadius);
-            bits = 37L * bits + (offsets == null ? 0L : offsets.hashCode());
-            hash = (int) (bits ^ (bits >> 32));
-        }
-        return hash;
-    }
-}
--- a/javafx-ui-common/src/com/sun/javafx/scene/layout/region/BackgroundFillConverter.java	Tue Sep 11 20:35:27 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.javafx.scene.layout.region;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import javafx.geometry.Insets;
-import javafx.scene.paint.Paint;
-
-import com.sun.javafx.css.StyleConverter;
-import com.sun.javafx.css.StyleableProperty;
-import com.sun.javafx.css.ParsedValue;
-
-public final class BackgroundFillConverter extends StyleConverter<ParsedValue[], List<BackgroundFill>> {
-
-    public static class Holder {
-        private static final BackgroundFillConverter BACKGROUND_FILLS_CONVERTER
-                = new BackgroundFillConverter();
-    }
-
-    public static BackgroundFillConverter getInstance() {
-        return Holder.BACKGROUND_FILLS_CONVERTER;
-    }
-
-    private BackgroundFillConverter() {
-        super();
-    }
-
-    @Override
-    public List<BackgroundFill> convert(Map<StyleableProperty, Object> convertedValues) {
-        Paint[] fills = null;
-        Insets[] radii = null;
-        Insets[] insets = null;
-        List<StyleableProperty> styleables = BackgroundFill.impl_CSS_STYLEABLES();
-        for (int k = 0; k < styleables.size(); k++) {
-            StyleableProperty styleable = styleables.get(k);
-            Object value = convertedValues.get(styleable);
-            if (value == null) {
-                continue;
-            }
-            if ("-fx-background-color".equals(styleable.getProperty())) {
-                fills = (Paint[]) value;
-            } else if ("-fx-background-radius".equals(styleable.getProperty())) {
-                radii = (Insets[]) value;
-            } else if ("-fx-background-insets".equals(styleable.getProperty())) {
-                insets = (Insets[]) value;
-            }
-        }
-        int nFills = (fills != null) ? fills.length : 0;
-        List<BackgroundFill> results = new ArrayList<BackgroundFill>();
-        for (int i = 0; i < nFills; i++) {
-            Insets radius = (radii != null) ? radii[Math.min(i, radii.length - 1)] : Insets.EMPTY;
-            Insets offsets = (insets != null) ? insets[Math.min(i, insets.length - 1)] : Insets.EMPTY;
-            BackgroundFill bf = new BackgroundFill(fills[i], radius.getTop(), radius.getRight(), radius.getBottom(), radius.getLeft(), offsets);
-            results.add(bf);
-        }
-        return results;
-    }
-
-    @Override
-    public String toString() {
-        return "BackgroundFillsType";
-    }
-}
--- a/javafx-ui-common/src/com/sun/javafx/scene/layout/region/BackgroundImage.java	Tue Sep 11 20:35:27 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,810 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.javafx.scene.layout.region;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import javafx.scene.image.Image;
-import javafx.scene.text.Font;
-
-import com.sun.javafx.css.Size;
-import com.sun.javafx.css.SizeUnits;
-import com.sun.javafx.css.StyleConverter;
-import com.sun.javafx.css.StyleableProperty;
-import com.sun.javafx.css.ParsedValue;
-import com.sun.javafx.css.converters.BooleanConverter;
-import com.sun.javafx.css.converters.URLConverter;
-import java.util.ArrayList;
-import javafx.beans.value.WritableValue;
-import javafx.scene.Node;
-
-/**
- * A background image that can be applied to a Region. It is based in the CSS 3
- * specification http://www.w3.org/TR/css3-background/
- *
- */
-public class BackgroundImage {
-
-    private static class Holder {
-
-        private static final BackgroundRepeatConverter BACKGROUND_REPEAT_CONVERTER =
-                new BackgroundRepeatConverter();
-
-        private static final BackgroundPositionConverter BACKGROUND_POSITION_CONVERTER =
-                new BackgroundPositionConverter();
-
-        private static final LayeredBackgroundPositionConverter LAYERED_BACKGROUND_POSITION_CONVERTER =
-                new LayeredBackgroundPositionConverter();
-
-
-        private static final BackgroundSizeConverter BACKGROUND_SIZE_CONVERTER =
-                new BackgroundSizeConverter();
-
-        private static final LayeredBackgroundSizeConverter LAYERED_BACKGROUND_SIZE_CONVERTER =
-                new LayeredBackgroundSizeConverter();
-    }
-    /**
-     * Super-lazy instantiation pattern from Bill Pugh.
-     * @treatAsPrivate implementation detail
-     */
-    private static class StyleableProperties {
-        
-        private static final StyleableProperty<Node,Image[]> BACKGROUND_IMAGE =
-            new StyleableProperty<Node,Image[]>("-fx-background-image",
-                URLConverter.SequenceConverter.getInstance()) {
-
-            @Override
-            public boolean isSettable(Node node) {
-                return false;
-            }
-
-            @Override
-            public WritableValue<Image[]> getWritableValue(Node node) {
-                return null;
-            }
-        };
-        
-        private static final StyleableProperty<Node,BackgroundRepeat[]> BACKGROUND_REPEAT =
-            new StyleableProperty<Node,BackgroundRepeat[]>("-fx-background-repeat", 
-                BackgroundRepeatConverter.getInstance(),
-                new BackgroundRepeat[] { new BackgroundRepeat(Repeat.REPEAT, Repeat.REPEAT) }){
-
-            @Override
-            public boolean isSettable(Node node) {
-                return false;
-            }
-
-            @Override
-            public WritableValue<BackgroundRepeat[]> getWritableValue(Node node) {
-                return null;
-            }
-        };                
-                
-        private static final StyleableProperty<Node,BackgroundPosition[]> BACKGROUND_POSITION =
-            new StyleableProperty<Node,BackgroundPosition[]>("-fx-background-position", 
-                LayeredBackgroundPositionConverter.getInstance(),
-                new BackgroundPosition[] { new BackgroundPosition() }) {
-                    
-
-            @Override
-            public boolean isSettable(Node node) {
-                return false;
-            }
-
-            @Override
-            public WritableValue<BackgroundPosition[]> getWritableValue(Node node) {
-                return null;
-            }
-        };
-                
-        private static final StyleableProperty<Node,BackgroundSize[]> BACKGROUND_SIZE =
-            new StyleableProperty<Node,BackgroundSize[]>("-fx-background-size", 
-                LayeredBackgroundSizeConverter.getInstance(), 
-                new BackgroundSize[] { new BackgroundSize() } ) {
-
-            @Override
-            public boolean isSettable(Node node) {
-                return false;
-            }
-
-            @Override
-            public WritableValue<BackgroundSize[]> getWritableValue(Node node) {
-                return null;
-            }
-        };
-
-        private static final List<StyleableProperty> STYLEABLES;
-
-        static {
-             final List<StyleableProperty> subProperties = 
-                 new ArrayList<StyleableProperty>();
-            Collections.addAll(subProperties,
-                BACKGROUND_IMAGE,
-                BACKGROUND_REPEAT,
-                BACKGROUND_POSITION,
-                BACKGROUND_SIZE
-            );
-            STYLEABLES = Collections.unmodifiableList(subProperties);
-        }
-    }
-
-    /**
-     * Super-lazy instantiation pattern from Bill Pugh.
-     * @treatAsPrivate implementation detail
-     */
-    public static List<StyleableProperty> impl_CSS_STYLEABLES() {
-        return StyleableProperties.STYLEABLES;
-    }
-
-     /**
-      * RT-19263
-      * @treatAsPrivate implementation detail
-      * @deprecated This is an experimental API that is not intended for general use and is subject to change in future versions
-      */
-     @Deprecated
-    public List<StyleableProperty> impl_getStyleableProperties() {
-        return impl_CSS_STYLEABLES();
-    }
-
-    public static class Builder {
-
-        private Image image;
-        private Repeat repeatX = Repeat.REPEAT;
-        private Repeat repeatY = Repeat.REPEAT;
-        private double top;
-        private double right;
-        private double bottom;
-        private double left;
-        private double width;
-        private double height;
-        private boolean proportionalHPos = true;
-        private boolean proportionalVPos = true;
-        private boolean proportionalWidth = true;
-        private boolean proportionalHeight = true;
-        private boolean contain = false;
-        private boolean cover = false;
-
-        public Builder setImage(Image i) {
-            image = i;
-            return this;
-        }
-
-        public Builder setRepeatX(Repeat r) {
-            repeatX = r;
-            return this;
-        }
-
-        public Builder setRepeatY(Repeat r) {
-            repeatY = r;
-            return this;
-        }
-
-        public Builder setTop(double f) {
-            top = f;
-            return this;
-        }
-
-        public Builder setRight(double f) {
-            right = f;
-            return this;
-        }
-
-        public Builder setBottom(double f) {
-            bottom = f;
-            return this;
-        }
-
-        public Builder setLeft(double f) {
-            left = f;
-            return this;
-        }
-
-        public Builder setWidth(double f) {
-            width = f;
-            return this;
-        }
-
-        public Builder setHeight(double f) {
-            height = f;
-            return this;
-        }
-
-        public Builder setProportionalHPos(boolean b) {
-            proportionalHPos = b;
-            return this;
-        }
-
-        public Builder setProportionalVPos(boolean b) {
-            proportionalVPos = b;
-            return this;
-        }
-
-        public Builder setProportionalWidth(boolean b) {
-            proportionalWidth = b;
-            return this;
-        }
-
-        public Builder setProportionalHeight(boolean b) {
-            proportionalHeight = b;
-            return this;
-        }
-
-        public Builder setContain(boolean b) {
-            contain = b;
-            return this;
-        }
-
-        public Builder setCover(boolean b) {
-            cover = b;
-            return this;
-        }
-
-        public BackgroundImage build() {
-            return new BackgroundImage(image, repeatX, repeatY,
-                    top, right, bottom, left, width, height,
-                    proportionalHPos, proportionalVPos,
-                    proportionalWidth, proportionalHeight,
-                    contain, cover);
-        }
-    }
-
-    /**
-     * The image for this background image
-     *
-     * @default null
-     * @css background-image
-     */
-    public Image getImage() {
-        return image;
-    }
-    final private Image image;
-
-    /**
-     * Should the image be repeated along the X axis
-     *
-     * @default Repeat.REPEAT
-     * @css background-repeat
-     */
-    public Repeat getRepeatX() {
-        return repeatX;
-    }
-    final private Repeat repeatX;
-
-    /**
-     * Should the image be repeated along the Y axis
-     *
-     * @default Repeat.REPEAT
-     * @css background-repeat
-     */
-    public Repeat getRepeatY() {
-        return repeatY;
-    }
-    final private Repeat repeatY;
-
-    /**
-     * The position of the left of the image from left of the Region.
-     *
-     * @default 0
-     * @css background-position (Percentages are a percentage of the
-     *                          {@code (region width - image width)}
-     *                          this means 50% is centered and 100%
-     *                          means right align image)
-     */
-    public double getLeft() {
-        return left;
-    }
-    final private double left;
-
-    /**
-     * The position of the top of the image from top of the Region.
-     *
-     * @default 0
-     * @css background-position (Percentages are a percentage of the
-     *                          {@code (region height - image height)}
-     *                          this means 50% is centered and 100%
-     *                          means bottom align image)
-     */
-    public double getTop() {
-        return top;
-    }
-    final private double top;
-
-    /**
-     * The position of the right of the image from right of the Region.
-     * If this and {@code left} are !=0 then {@code left} has
-     * precedence
-     *
-     * @default 0
-     * @css background-position (Percentages are a percentage of the
-     *                          {@code (region width - image width)}
-     *                          this means 50% is centered and 100%
-     *                          means right align image)
-     */
-    public double getRight() {
-        return right;
-    }
-    final private double right;
-
-    /**
-     * The position of the bottom of the image from bottom of the Region.
-     * If this and {@code top} are !=0 then {@code top} has
-     * precedence
-     *
-     * @default 0
-     * @css background-position (Percentages are a percentage of the
-     *                          {@code (region height - image height)}
-     *                          this means 50% is centered and 100%
-     *                          means bottom align image)
-     */
-    public double getBottom() {
-        return bottom;
-    }
-    final private double bottom;
-
-    /**
-     * Indicates whether the horizontal position units are proportional or absolute.
-     * If this flag is true, position units are defined in a [0..1] space and
-     * refer to the size of background positioning area minus the size of
-     * background image. If this flag is false, then position units are pixels.
-     * @default true
-     */
-    public boolean isProportionalHPos() {
-        return proportionalHPos;
-    }
-    final private boolean proportionalHPos;
-
-    /**
-     * Indicates whether the vertical position units are proportional or absolute.
-     * If this flag is true, position units are defined in a [0..1] space and
-     * refer to the size of background positioning area minus the size of
-     * background image. If this flag is false, then position units are pixels.
-     * @default true
-     */
-    public boolean isProportionalVPos() {
-        return proportionalVPos;
-    }
-    final private boolean proportionalVPos;
-
-    /**
-     * The width of the the image. If <=0 then width is auto sized. If both
-     * width and height are auto then image is used at its intrinsic(loaded)
-     * size. If height is specified and this is auto then the width is
-     * calculated based on maintaining the aspect ratio while matching the
-     * chosen height.
-     *
-     * @default 0 (auto)
-     * @css background-size (Percentages are a percentage of the Region width)
-     */
-    public double getWidth() {
-        return width;
-    }
-    final private double width;
-
-    /**
-     * The height of the image. If <= 0 then width is auto sized. If both
-     * width and height are auto then image is used at its intrinsic(loaded)
-     * size. If width is specified and this is auto then the height is
-     * calculated based on maintaining the aspect ratio while matching the
-     * chosen width.
-     *
-     * @default 0 (auto)
-     * @css background-size (Percentages are a percentage of the Region height)
-     */
-    public double getHeight() {
-        return height;
-    }
-    final private double height;
-
-    /**
-     * Indicates whether the size units are proportional or absolute.
-     * If this flag is true, size units are defined in a [0..1] space and
-     * represent a percentage of the region size. If this flag is false,
-     * then size units are pixels.
-     * @default true
-     */
-    public boolean isProportionalWidth() {
-        return proportionalWidth;
-    }
-    final private boolean proportionalWidth;
-
-    public boolean isProportionalHeight() {
-        return proportionalHeight;
-    }
-    final private boolean proportionalHeight;
-
-    /**
-     * If true the image is scaled to be completely contained within the Region
-     * with its aspect ratio maintained.
-     *
-     * This has precedence over width and height.
-     *
-     * @default false
-     * @css background-size
-     */
-    public boolean isContain() {
-        return contain;
-    }
-    final private boolean contain;
-
-    /**
-     * If true the image is scaled to be the smallest size that completely covers
-     * the Region with its aspect ratio maintained.
-     *
-     * This has precedence over width, height and contain.
-     *
-     * @default false
-     * @css background-size
-     */
-    public boolean isCover() {
-        return cover;
-    }
-    final private boolean cover;
-
-    private BackgroundImage(Image image, Repeat repeatX, Repeat repeatY,
-            double top, double right, double bottom, double left, double width, double height,
-            boolean proportionalHPos, boolean proportionalVPos,
-            boolean proportionalWidth, boolean proportionalHeight,
-            boolean contain, boolean cover) {
-        this.image = image;
-        this.repeatX = repeatX;
-        this.repeatY = repeatY;
-        this.left = left;
-        this.top = top;
-        this.right = right;
-        this.bottom = bottom;
-        this.width = width;
-        this.height = height;
-        this.proportionalHPos = proportionalHPos;
-        this.proportionalVPos = proportionalVPos;
-        this.proportionalWidth = proportionalWidth;
-        this.proportionalHeight = proportionalHeight;
-        this.contain = contain;
-        this.cover = cover;
-    }
-
-    /**
-     * background-repeat    <repeat-style> [ , <repeat-style> ]*
-     * where <repeat-style> = repeat-x | repeat-y | [repeat | space | round | no-repeat]{1,2}
-     */
-    public static final class BackgroundRepeatConverter extends StyleConverter<ParsedValue<Repeat, Repeat>[][], BackgroundRepeat[]> {
-
-        public static BackgroundRepeatConverter getInstance() {
-            return Holder.BACKGROUND_REPEAT_CONVERTER;
-        }
-
-        private BackgroundRepeatConverter() {
-            super();
-        }
-
-        @Override
-        public BackgroundRepeat[] convert(ParsedValue<ParsedValue<Repeat, Repeat>[][], BackgroundRepeat[]> value, Font font) {
-            ParsedValue<Repeat, Repeat>[][] layers = value.getValue();
-            BackgroundRepeat[] backgroundRepeat = new BackgroundRepeat[layers.length];
-            for (int l = 0; l < layers.length; l++) {
-                ParsedValue<Repeat,Repeat>[] repeats = layers[l];
-                Repeat horizontal = repeats[0].getValue();
-                Repeat vertical = repeats[1].getValue();
-                backgroundRepeat[l] = new BackgroundRepeat(horizontal,vertical);
-            }
-            return backgroundRepeat;
-        }
-
-        @Override
-        public String toString() {
-            return "BackgroundRepeatType";
-        }
-    }
-
-    // TODO: same as ImageBorder BorderImageRepeat
-    final static public class BackgroundRepeat {
-
-        final private Repeat repeatX;
-        final private Repeat repeatY;
-
-        public BackgroundRepeat(Repeat repeatX, Repeat repeatY) {
-            this.repeatX = repeatX;
-            this.repeatY = repeatY;
-        }
-
-        public Repeat getRepeatX() {
-            return repeatX;
-        }
-
-        public Repeat getRepeatY() {
-            return repeatY;
-        }
-    }
-
-// container for background-position
-    // TOOD: eliminate this
-    final static public class BackgroundPosition {
-
-        public static final Size ZERO_PERCENT = new Size(0, SizeUnits.PERCENT);
-        public static final Size FIFTY_PERCENT = new Size(50, SizeUnits.PERCENT);
-        public static final Size ONE_HUNDRED_PERCENT = new Size(100, SizeUnits.PERCENT);
-        final private double top;
-        final private double right;
-        final private double bottom;
-        final private double left;
-        private boolean proportionalHPos;
-        private boolean proportionalVPos;
-
-        private BackgroundPosition() {
-            this(0.0f, 0.0f, 0.0f, 0.0f, false, false);
-        }
-
-        public double getTop() {
-            return top;
-        }
-
-        public double getRight() {
-            return right;
-        }
-
-        public double getBottom() {
-            return bottom;
-        }
-
-        public double getLeft() {
-            return left;
-        }
-
-        public boolean isProportionalHPos() {
-            return proportionalHPos;
-        }
-
-        public boolean isProportionalVPos() {
-            return proportionalVPos;
-        }
-
-        // Public for testing
-        public BackgroundPosition(double top, double right, double bottom, double left, 
-                                  boolean proportionalHPos, boolean proportionalVPos) {
-            this.top = top;
-            this.right = right;
-            this.bottom = bottom;
-            this.left = left;
-            this.proportionalHPos = proportionalHPos;
-            this.proportionalVPos = proportionalVPos;
-        }
-    }
-
-    /**
-     * background-position: <bg-position>
-     * where <bg-position> = [
-     *   [ [ <size> | left | center | right ] [ <size> | top | center | bottom ]? ]
-     *   | [ [ center | [ left | right ] <size>? ] || [ center | [ top | bottom ] <size>? ]
-     * ]
-     * @see <a href="http://www.w3.org/TR/css3-background/#the-background-position">background-position</a>
-     */
-    public static final class LayeredBackgroundPositionConverter extends StyleConverter<ParsedValue<ParsedValue<?, Size>[], BackgroundPosition>[], BackgroundPosition[]> {
-
-        public static LayeredBackgroundPositionConverter getInstance() {
-            return Holder.LAYERED_BACKGROUND_POSITION_CONVERTER;
-        }
-
-        private LayeredBackgroundPositionConverter() {
-            super();
-        }
-
-        @Override
-        public BackgroundPosition[] convert(ParsedValue<ParsedValue<ParsedValue<?, Size>[], BackgroundPosition>[], BackgroundPosition[]> value, Font font) {
-            ParsedValue<ParsedValue<?, Size>[], BackgroundPosition>[] layers = value.getValue();
-            BackgroundPosition[] positions = new BackgroundPosition[layers.length];
-            for (int l = 0; l < layers.length; l++) {
-                positions[l] = layers[l].convert(font);
-            }
-            return positions;
-        }
-
-        @Override
-        public String toString() {
-            return "LayeredBackgroundPositionConverter";
-        }
-    }
-
-    public static final class BackgroundPositionConverter extends StyleConverter<ParsedValue<?, Size>[], BackgroundPosition> {
-
-        public static BackgroundPositionConverter getInstance() {
-            return Holder.BACKGROUND_POSITION_CONVERTER;
-        }
-
-
-        private BackgroundPositionConverter() {
-            super();
-        }
-
-        @Override
-        public BackgroundPosition convert(ParsedValue<ParsedValue<?, Size>[], BackgroundPosition> value, Font font) {
-
-            ParsedValue<?, Size>[] positions = value.getValue();
-
-            // The parser gives us 4 values, none of them null
-            Size top = positions[0].convert(font);
-
-            Size right = positions[1].convert(font);
-
-            Size bottom = positions[2].convert(font);
-
-            Size left = positions[3].convert(font);
-
-            boolean horizontalEdgeProportional =
-                    (bottom.getValue() > 0 && bottom.getUnits() == SizeUnits.PERCENT)
-                    || top.getUnits() == SizeUnits.PERCENT;
-
-            // either left or right will be set, not both
-            boolean verticalEdgeProportional =
-                    (right.getValue() > 0 && right.getUnits() == SizeUnits.PERCENT)
-                    || left.getUnits() == SizeUnits.PERCENT;
-
-            double t = (top != null) ? top.pixels(font) : 0.0;
-
-            double r = (right != null) ? right.pixels(font) : 0.0;
-
-            double b = (bottom != null) ? bottom.pixels(font) : 0.0;
-
-            double l = (left != null) ? left.pixels(font) : 0.0;
-
-            return new BackgroundPosition(t, r, b, l,
-                    verticalEdgeProportional, horizontalEdgeProportional);
-        }
-
-        @Override
-        public String toString() {
-            return "BackgroundPositionConverter";
-        }
-    }
-
-    final static public class BackgroundSize {
-
-        public static final BackgroundSize AUTO_SIZE =
-                new BackgroundSize(0.0f, 0.0f, true, true, false, false);
-        public static final BackgroundSize COVER =
-                new BackgroundSize(0.0f, 0.0f, true, true, true, false);
-        public static final BackgroundSize CONTAIN =
-                new BackgroundSize(0.0f, 0.0f, true, true, false, true);
-        final private boolean proportionalWidth;
-        final private boolean proportionalHeight;
-        final private double width;
-        final private double height;
-        final private boolean cover;
-        final private boolean contain;
-
-        public BackgroundSize(double width, double height,
-                boolean proportionalWidth, boolean proportionalHeight,
-                boolean cover, boolean contain) {
-            this.width = width;
-            this.height = height;
-            this.proportionalWidth = proportionalWidth;
-            this.proportionalHeight = proportionalHeight;
-            this.contain = contain;
-            this.cover = cover;
-        }
-
-        private BackgroundSize() {
-            this(0.0f, 0.0f, false, false, false, false);
-        }
-
-        public boolean isProportionalWidth() {
-            return proportionalWidth;
-        }
-
-        public boolean isProportionalHeight() {
-            return proportionalHeight;
-        }
-
-        public double getWidth() {
-            return width;
-        }
-
-        public double getHeight() {
-            return height;
-        }
-
-        public boolean isCover() {
-            return cover;
-        }
-
-        public boolean isContain() {
-            return contain;
-        }
-    }
-
-    /**
-     * background-size      <bg-size> [ , <bg-size> ]*
-     * <bg-size> = [ <size> | auto ]{1,2} | cover | contain
-     * @see <a href="http://www.w3.org/TR/css3-background/#the-background-size">background-size</a>
-     */
-    final public static class LayeredBackgroundSizeConverter extends StyleConverter<ParsedValue<ParsedValue[], BackgroundSize>[], BackgroundSize[]> {
-
-        public static LayeredBackgroundSizeConverter getInstance() {
-            return Holder.LAYERED_BACKGROUND_SIZE_CONVERTER;
-        }
-
-        private LayeredBackgroundSizeConverter() {
-            super();
-        }
-
-        @Override
-        public BackgroundSize[] convert(ParsedValue<ParsedValue<ParsedValue[], BackgroundSize>[], BackgroundSize[]> value, Font font) {
-            ParsedValue<ParsedValue[], BackgroundSize>[] layers = value.getValue();
-            BackgroundSize[] sizes = new BackgroundSize[layers.length];
-            for (int l = 0; l < layers.length; l++) {
-                sizes[l] = layers[l].convert(font);
-            }
-            return sizes;
-        }
-    }
-
-    final public static class BackgroundSizeConverter extends StyleConverter<ParsedValue[], BackgroundSize> {
-
-        public static BackgroundSizeConverter getInstance() {
-            return Holder.BACKGROUND_SIZE_CONVERTER;
-        }
-
-        private BackgroundSizeConverter() {
-            super();
-        }
-
-        @Override
-        public BackgroundSize convert(ParsedValue<ParsedValue[], BackgroundSize> value, Font font) {
-            ParsedValue[] values = value.getValue();
-
-            Size wSize = (values[0] != null)
-                    ? ((ParsedValue<?, Size>) values[0]).convert(font) : null;
-            Size hSize = (values[1] != null)
-                    ? ((ParsedValue<?, Size>) values[1]).convert(font) : null;
-
-            boolean proportionalWidth = false;
-            boolean proportionalHeight = false;
-
-            if (wSize != null) {
-                proportionalWidth = wSize.getUnits() == SizeUnits.PERCENT;
-            }
-            if (hSize != null) {
-                // wSize will be null if wSize is AUTO                
-                proportionalHeight = hSize.getUnits() == SizeUnits.PERCENT;
-            }
-
-            double w = (wSize != null) ? wSize.pixels(font) : 0.0;
-            double h = (hSize != null) ? hSize.pixels(font) : 0.0;
-
-            boolean cover = (values[2] != null)
-                    ? BooleanConverter.getInstance().convert(values[2], font) : false;
-
-            boolean contain = (values[3] != null)
-                    ? BooleanConverter.getInstance().convert(values[3], font) : false;
-
-            return new BackgroundSize(w, h, proportionalWidth, proportionalHeight, cover, contain);
-        }
-
-        @Override
-        public String toString() {
-            return "BackgroundSizeConverter";
-        }
-    }
-}
--- a/javafx-ui-common/src/com/sun/javafx/scene/layout/region/BackgroundImageConverter.java	Tue Sep 11 20:35:27 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.javafx.scene.layout.region;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import javafx.scene.image.Image;
-
-import com.sun.javafx.css.StyleConverter;
-import com.sun.javafx.css.StyleableProperty;
-import com.sun.javafx.css.ParsedValue;
-
-public final class BackgroundImageConverter extends StyleConverter<ParsedValue[], List<BackgroundImage>> {
-
-    private static class Holder {
-        private static final BackgroundImageConverter BACKGROUND_IMAGE_CONVERTER =
-            new BackgroundImageConverter();
-    }
-
-    public static BackgroundImageConverter getInstance() {
-        return Holder.BACKGROUND_IMAGE_CONVERTER;
-    }
-
-    private BackgroundImageConverter() {
-        super();
-    }
-
-    @Override
-    public List<BackgroundImage> convert(Map<StyleableProperty, Object> convertedValues) {
-        String[] imageUrls = null;
-        BackgroundImage.BackgroundRepeat[] repeats = null;
-        BackgroundImage.BackgroundPosition[] positions = null;
-        BackgroundImage.BackgroundSize[] sizes = null;
-        List<StyleableProperty> styleables = BackgroundImage.impl_CSS_STYLEABLES();
-        for (int k = 0; k < styleables.size(); k++) {
-            StyleableProperty styleable = styleables.get(k);
-            Object value = convertedValues.get(styleable);
-            if (value == null) {
-                continue;
-            }
-            if ("-fx-background-image".equals(styleable.getProperty())) {
-                imageUrls = (String[]) value;
-            } else if ("-fx-background-repeat".equals(styleable.getProperty())) {
-                repeats = (BackgroundImage.BackgroundRepeat[]) value;
-            } else if ("-fx-background-position".equals(styleable.getProperty())) {
-                positions = (BackgroundImage.BackgroundPosition[]) value;
-            } else if ("-fx-background-size".equals(styleable.getProperty())) {
-                sizes = (BackgroundImage.BackgroundSize[]) value;
-            }
-        }
-        List<BackgroundImage> images = new ArrayList<BackgroundImage>();
-        int nImages = (imageUrls != null) ? imageUrls.length : 0;
-        for (int index = 0; index < nImages; index++) {
-            if (imageUrls[index] == null) continue;
-            BackgroundImage.BackgroundRepeat repeat = (repeats != null) ? repeats[Math.min(index, repeats.length - 1)] : null;
-            BackgroundImage.BackgroundPosition position = (positions != null) ? positions[Math.min(index, positions.length - 1)] : null;
-            BackgroundImage.BackgroundSize size = (sizes != null) ? sizes[Math.min(index, sizes.length - 1)] : null;
-            BackgroundImage.Builder builder = new BackgroundImage.Builder();
-            builder.setImage(new Image(imageUrls[index]));
-            if (repeat != null) {
-                builder.setRepeatX(repeat.getRepeatX()).setRepeatY(repeat.getRepeatY());
-            }
-            if (position != null) {
-                builder.setTop(position.getTop())
-                       .setRight(position.getRight())
-                       .setBottom(position.getBottom())
-                       .setLeft(position.getLeft())
-                       .setProportionalHPos(position.isProportionalHPos())
-                       .setProportionalVPos(position.isProportionalVPos());
-            }
-            if (size != null) {
-                builder.setWidth(size.getWidth())
-                       .setHeight(size.getHeight())
-                       .setContain(size.isContain())
-                       .setCover(size.isCover())
-                       .setProportionalWidth(size.isProportionalWidth())
-                       .setProportionalHeight(size.isProportionalHeight());
-            }
-            images.add(builder.build());
-        }
-        return images;
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/com/sun/javafx/scene/layout/region/BackgroundPositionConverter.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.javafx.scene.layout.region;
+
+import javafx.geometry.Side;
+import javafx.scene.layout.BackgroundPosition;
+import javafx.scene.text.Font;
+import com.sun.javafx.css.ParsedValue;
+import com.sun.javafx.css.Size;
+import com.sun.javafx.css.SizeUnits;
+import com.sun.javafx.css.StyleConverter;
+
+/**
+ * Given four Sizes from the Parser, this converter will produce a BackgroundPosition object.
+ */
+public final class BackgroundPositionConverter extends StyleConverter<ParsedValue<?, Size>[], BackgroundPosition> {
+    private static final BackgroundPositionConverter BACKGROUND_POSITION_CONVERTER =
+            new BackgroundPositionConverter();
+
+    public static BackgroundPositionConverter getInstance() {
+        return BACKGROUND_POSITION_CONVERTER;
+    }
+
+    // Disallow instantiation
+    private BackgroundPositionConverter() { }
+
+    @Override
+    public BackgroundPosition convert(ParsedValue<ParsedValue<?, Size>[], BackgroundPosition> value, Font font) {
+        ParsedValue<?, Size>[] positions = value.getValue();
+
+        // The parser gives us 4 values, none of them null
+        final Size top = positions[0].convert(font);
+        final Size right = positions[1].convert(font);
+        final Size bottom = positions[2].convert(font);
+        final Size left = positions[3].convert(font);
+
+        boolean verticalEdgeProportional =
+                (bottom.getValue() > 0 && bottom.getUnits() == SizeUnits.PERCENT)
+                        || top.getUnits() == SizeUnits.PERCENT;
+
+        // either left or right will be set, not both
+        boolean horizontalEdgeProportional =
+                (right.getValue() > 0 && right.getUnits() == SizeUnits.PERCENT)
+                        || left.getUnits() == SizeUnits.PERCENT;
+
+        final double t = top.pixels(font);
+        final double r = right.pixels(font);
+        final double b = bottom.pixels(font);
+        final double l = left.pixels(font);
+
+        return new BackgroundPosition(
+                (l == 0 && r != 0) ? Side.RIGHT : Side.LEFT,
+                (l == 0 && r != 0) ? r : l,
+                horizontalEdgeProportional,
+                (t == 0 && b != 0) ? Side.BOTTOM : Side.TOP,
+                (t == 0 && b != 0) ? b : t,
+                verticalEdgeProportional);
+    }
+
+    /**
+     * @inheritDoc
+     */
+    @Override public String toString() {
+        return "BackgroundPositionConverter";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/com/sun/javafx/scene/layout/region/BackgroundSizeConverter.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.javafx.scene.layout.region;
+
+import com.sun.javafx.css.ParsedValue;
+import com.sun.javafx.css.Size;
+import com.sun.javafx.css.SizeUnits;
+import com.sun.javafx.css.StyleConverter;
+import com.sun.javafx.css.converters.BooleanConverter;
+import javafx.scene.layout.BackgroundSize;
+import javafx.scene.text.Font;
+
+/**
+ */
+public final class BackgroundSizeConverter  extends StyleConverter<ParsedValue[], BackgroundSize> {
+    private static final BackgroundSizeConverter BACKGROUND_SIZE_CONVERTER =
+            new BackgroundSizeConverter();
+
+    public static BackgroundSizeConverter getInstance() {
+        return BACKGROUND_SIZE_CONVERTER;
+    }
+
+    // Disallow instantiation
+    private BackgroundSizeConverter() { }
+
+    @Override
+    public BackgroundSize convert(ParsedValue<ParsedValue[], BackgroundSize> value, Font font) {
+        ParsedValue[] values = value.getValue();
+
+        // A Size that is null represents that we are "auto" for that dimension
+        final Size wSize = (values[0] != null)
+                ? ((ParsedValue<?, Size>) values[0]).convert(font) : null;
+        final Size hSize = (values[1] != null)
+                ? ((ParsedValue<?, Size>) values[1]).convert(font) : null;
+
+        boolean proportionalWidth = true;
+        boolean proportionalHeight = true;
+
+        if (wSize != null) {
+            proportionalWidth = wSize.getUnits() == SizeUnits.PERCENT;
+        }
+        if (hSize != null) {
+            // wSize will be null if wSize is AUTO
+            proportionalHeight = hSize.getUnits() == SizeUnits.PERCENT;
+        }
+
+        double w = (wSize != null) ? wSize.pixels(font) : BackgroundSize.AUTO;
+        double h = (hSize != null) ? hSize.pixels(font) : BackgroundSize.AUTO;
+
+        boolean cover = (values[2] != null)
+                ? BooleanConverter.getInstance().convert(values[2], font) : false;
+
+        boolean contain = (values[3] != null)
+                ? BooleanConverter.getInstance().convert(values[3], font) : false;
+
+        return new BackgroundSize(w, h, proportionalWidth, proportionalHeight, contain, cover);
+    }
+
+    /**
+     * @inheritDoc
+     */
+    @Override public String toString() {
+        return "BackgroundSizeConverter";
+    }
+}
--- a/javafx-ui-common/src/com/sun/javafx/scene/layout/region/Border.java	Tue Sep 11 20:35:27 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.javafx.scene.layout.region;
-
-import javafx.geometry.Insets;
-
-/**
- * Baseclass for CSS style Borders
- *
- */
-public abstract class Border {
-
-    protected static class Builder {
-        protected double leftWidth = 1;
-        protected double topWidth = 1;
-        protected double rightWidth = 1;
-        protected double bottomWidth = 1;
-        protected boolean proportionalWidth = false;
-        protected Insets offsets = Insets.EMPTY;
-
-        public Builder setLeftWidth(double f) { leftWidth = f; return this; }
-        public Builder setTopWidth(double f) { topWidth = f; return this; }
-        public Builder setRightWidth(double f) { rightWidth = f; return this; }
-        public Builder setBottomWidth(double f) { bottomWidth = f; return this; }
-        public Builder setProportionalWidth(boolean b) { proportionalWidth = b; return this; }
-        public Builder setOffsets(Insets i) { offsets = i; return this; }
-    }
-
-    /**
-     * Width of the border on the left of the Region. If the Region is non
-     * rectangular then this is used for the border around the whole shape.
-     * Percentages are a percentage of region width.
-     *
-     * @css border-left-width
-     * @defaultValue 1
-     */
-    public double getLeftWidth() { return leftWidth; }
-    final private double leftWidth;
-
-    /**
-     * Width of the border on the top of the Region. If {@code null} then the
-     * leftWidth is used. Percentages are a percentage of region height.
-     *
-     * @css border-top-width
-     * @defaultValue null = use leftWidth
-     */
-    public double getTopWidth() { return topWidth; }
-    final private double topWidth;
-
-    /**
-     * Width of the border on the right of the Region. If {@code null} then the
-     * leftWidth is used. Percentages are a percentage of region width.
-     *
-     * @css border-right-width
-     * @defaultValue null = use leftWidth
-     */
-    public double getRightWidth() { return rightWidth; }
-    final private double rightWidth;
-
-    /**
-     * Width of the border on the top of the Region. If {@code null} then the
-     * leftWidth is used. Percentages are a percentage of region height.
-     *
-     * @css border-bottom-width
-     * @defaultValue null = use leftWidth
-     */
-    public double getBottomWidth() { return bottomWidth; }
-    final private double bottomWidth;
-
-    /**
-     * Indicates whether the width units are proportional or absolute.
-     * If this flag is true, width units are defined in a [0..1] space and
-     * represent a percentage of the image width. If this flag is false,
-     * then width units are image pixels.
-     * @default false
-     */
-    public boolean isProportionalWidth() { return proportionalWidth; }
-    final private boolean proportionalWidth;
-
-    /**
-     * Offsets to use from the region bounds. Units are scene graph units.
-     *
-     * @defaultValue null
-     */
-    public Insets getOffsets() { return offsets; }
-    final private Insets offsets;
-
-    /** */
-    protected Border(double topWidth, double rightWidth, double bottomWidth,
-            double leftWidth, boolean proportional, Insets offsets) {
-        this.topWidth = topWidth;
-        this.rightWidth = rightWidth;
-        this.bottomWidth = bottomWidth;
-        this.leftWidth = leftWidth;
-        this.proportionalWidth = proportional;
-        this.offsets = offsets;
-    }
-}
--- a/javafx-ui-common/src/com/sun/javafx/scene/layout/region/BorderImage.java	Tue Sep 11 20:35:27 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,589 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.javafx.scene.layout.region;
-
-import java.util.Collections;
-import java.util.List;
-
-import javafx.geometry.Insets;
-import javafx.scene.image.Image;
-import javafx.scene.text.Font;
-
-import com.sun.javafx.css.Size;
-import com.sun.javafx.css.SizeUnits;
-import com.sun.javafx.css.StyleConverter;
-import com.sun.javafx.css.StyleableProperty;
-import com.sun.javafx.css.ParsedValue;
-import com.sun.javafx.css.converters.InsetsConverter;
-import com.sun.javafx.css.converters.URLConverter;
-import java.util.ArrayList;
-import javafx.beans.value.WritableValue;
-import javafx.scene.Node;
-
-/**
- * A Border that uses a image as fill. The image is sliced into 9 parts which
- * are used to fill the top-left,top,top-right,right,center,left,bottom-left,
- * bottom and bottom-right sections of the border.
- *
- */
-public class BorderImage extends Border {
-
-    /* lazy, thread-safe */
-    private static class Holder {
-
-        private static final RepeatConverter BORDER_IMAGE_REPEAT_CONVERTER =
-                new RepeatConverter();
-        private static final SliceConverter BORDER_IMAGE_SLICE_CONVERTER =
-                new SliceConverter();
-        private static final SliceSequenceConverter BORDER_IMAGE_SLICE_SEQUENCE_CONVERTER =
-                new SliceSequenceConverter();
-    }
-
-    /**
-     * Super-lazy instantiation pattern from Bill Pugh.
-     * @treatAsPrivate implementation detail
-     */
-    private static class StyleableProperties {
-
-        private static final StyleableProperty<Node,String[]> BORDER_IMAGE_SOURCE =
-            new StyleableProperty<Node,String[]>("-fx-border-image-source", 
-                URLConverter.SequenceConverter.getInstance()) {
-
-            @Override
-            public boolean isSettable(Node node) {
-                return false;
-            }
-
-            @Override
-            public WritableValue<String[]> getWritableValue(Node node) {
-                return null;
-            }
-        };
-        
-        private static final StyleableProperty<Node,BorderImageRepeat[]> BORDER_IMAGE_REPEAT =
-            new StyleableProperty<Node,BorderImageRepeat[]>("-fx-border-image-repeat",
-                RepeatConverter.getInstance(), 
-                new BorderImageRepeat[] { new BorderImageRepeat(Repeat.REPEAT, Repeat.REPEAT) }){
-
-            @Override
-            public boolean isSettable(Node node) {
-                return false;
-            }
-
-            @Override
-            public WritableValue<BorderImageRepeat[]> getWritableValue(Node node) {
-                return null;
-            }
-        };
-        
-        private static final StyleableProperty<Node,BorderImageSlice[]> BORDER_IMAGE_SLICE = 
-            new StyleableProperty<Node,BorderImageSlice[]> ("-fx-border-image-slice",
-                SliceSequenceConverter.getInstance(), 
-                new BorderImageSlice[] { new BorderImageSlice(1,1,1,1,true,false) }) {
-
-            @Override
-            public boolean isSettable(Node node) {
-                return false;
-            }
-
-            @Override
-            public WritableValue<BorderImageSlice[]> getWritableValue(Node node) {
-                return null;
-            }
-        };
-        
-        private static final StyleableProperty<Node,Margins[]> BORDER_IMAGE_WIDTH =
-            new StyleableProperty<Node,Margins[]>("-fx-border-image-width", 
-                Margins.SequenceConverter.getInstance(), 
-                new Margins[] { new Margins(1.0,1.0,1.0,1.0,true) }){
-
-            @Override
-            public boolean isSettable(Node node) {
-                return false;
-            }
-
-            @Override
-            public WritableValue<Margins[]> getWritableValue(Node node) {
-                return null;
-            }
-        };
-        
-        private static final StyleableProperty<Node,Insets[]> BORDER_IMAGE_INSETS =
-            new StyleableProperty<Node,Insets[]>("-fx-border-image-insets", 
-                InsetsConverter.SequenceConverter.getInstance(), 
-                new Insets[] {Insets.EMPTY}) {
-
-            @Override
-            public boolean isSettable(Node node) {
-                return false;
-            }
-
-            @Override
-            public WritableValue<Insets[]> getWritableValue(Node node) {
-                return null;
-            }
-        };
-
-        private static final List<StyleableProperty> STYLEABLES;
-        static {
-             final List<StyleableProperty> subProperties = 
-                 new ArrayList<StyleableProperty>();
-            Collections.addAll(subProperties,
-                BORDER_IMAGE_SOURCE,
-                BORDER_IMAGE_REPEAT,
-                BORDER_IMAGE_SLICE,
-                BORDER_IMAGE_WIDTH,
-                BORDER_IMAGE_INSETS
-            );
-            STYLEABLES = Collections.unmodifiableList(subProperties);
-        }
-    }
-
-    /**
-     * Super-lazy instantiation pattern from Bill Pugh.
-     * @treatAsPrivate implementation detail
-     */
-    public static List<StyleableProperty> impl_CSS_STYLEABLES() {
-        return BorderImage.StyleableProperties.STYLEABLES;
-    }
-
-     /**
-      * RT-19263
-      * @treatAsPrivate implementation detail
-      * @deprecated This is an experimental API that is not intended for general use and is subject to change in future versions
-      */
-     @Deprecated
-    public List<StyleableProperty> impl_getStyleableProperties() {
-        return impl_CSS_STYLEABLES();
-    }
-
-    public static class Builder extends Border.Builder {
-
-        private Image image;
-        private boolean fillCenter;
-        private boolean proportionalSlice = true;
-        private double topSlice = 1.0;
-        private double rightSlice = 1.0;
-        private double bottomSlice = 1.0;
-        private double leftSlice = 1.0;
-        private Repeat repeatX = Repeat.NO_REPEAT;
-        private Repeat repeatY = Repeat.NO_REPEAT;
-
-        public Builder setImage(Image i) {
-            image = i;
-            return this;
-        }
-
-        public Builder setFillCenter(boolean b) {
-            fillCenter = b;
-            return this;
-        }
-
-        public Builder setProportionalSlice(boolean b) {
-            proportionalSlice = b;
-            return this;
-        }
-
-        public Builder setTopSlice(double f) {
-            topSlice = f;
-            return this;
-        }
-
-        public Builder setRightSlice(double f) {
-            rightSlice = f;
-            return this;
-        }
-
-        public Builder setBottomSlice(double f) {
-            bottomSlice = f;
-            return this;
-        }
-
-        public Builder setLeftSlice(double f) {
-            leftSlice = f;
-            return this;
-        }
-
-        public Builder setRepeatX(Repeat r) {
-            repeatX = r;
-            return this;
-        }
-
-        public Builder setRepeatY(Repeat r) {
-            repeatY = r;
-            return this;
-        }
-
-        @Override
-        public Builder setLeftWidth(double f) {
-            super.setLeftWidth(f);
-            return this;
-        }
-
-        @Override
-        public Builder setTopWidth(double f) {
-            super.setTopWidth(f);
-            return this;
-        }
-
-        @Override
-        public Builder setRightWidth(double f) {
-            super.setRightWidth(f);
-            return this;
-        }
-
-        @Override
-        public Builder setBottomWidth(double f) {
-            super.setBottomWidth(f);
-            return this;
-        }
-
-        @Override
-        public Builder setProportionalWidth(boolean b) {
-            super.setProportionalWidth(b);
-            return this;
-        }
-
-        @Override
-        public Builder setOffsets(Insets i) {
-            super.setOffsets(i);
-            return this;
-        }
-
-        public BorderImage build() {
-            return new BorderImage(image, fillCenter,
-                    topSlice, rightSlice, bottomSlice, leftSlice,
-                    repeatX, repeatY, proportionalSlice, proportionalWidth,
-                    topWidth, rightWidth, bottomWidth, leftWidth, offsets);
-        }
-    }
-
-    /**
-     * The image used to paint this border
-     *
-     * @defaultValue null
-     */
-    public Image getImage() {
-        return image;
-    }
-    final private Image image;
-
-    /**
-     * If true then the center slice is painted as a additional background after
-     * all background fills and background images. If false the center slice is
-     * just ignored and never painted.
-     *
-     * @defaultValue false
-     */
-    public boolean isFillCenter() {
-        return fillCenter;
-    }
-    final private boolean fillCenter;
-
-    /**
-     * The position of the left slice from the left hand side of the image. Size
-     * units are image pixels or percentage of image width.
-     * @see #proportionalSlice
-     * @defaultValue 100%
-     */
-    public double getLeftSlice() {
-        return leftSlice;
-    }
-    final private double leftSlice;
-
-    /**
-     * The position of the top slice from the top side of the image. Size
-     * units are image pixels or percentage of image width.
-     * @see #proportionalSlice
-     * @defaultValue 100%
-     */
-    public double getTopSlice() {
-        return topSlice;
-    }
-    final private double topSlice;
-
-    /**
-     * The position of the right slice from the right hand side of the image. Size
-     * units are image pixels or percentage of image width.
-     * @see #proportionalSlice
-     * @defaultValue 100%
-     */
-    public double getRightSlice() {
-        return rightSlice;
-    }
-    final private double rightSlice;
-
-    /**
-     * The position of the bottom slice from the bottom side of the image. Size
-     * units are image pixels or percentage of image width.
-     * @see #proportionalSlice
-     * @defaultValue 100%
-     */
-    public double getBottomSlice() {
-        return bottomSlice;
-    }
-    final private double bottomSlice;
-
-    /**
-     * Indicates whether the slice units are proportional or absolute.
-     * If this flag is true, slice units are defined in a [0..1] space and
-     * represent a percentage of the image width. If this flag is false,
-     * then slice units are image pixels.
-     * @default true
-     */
-    public boolean isProportionalSlice() {
-        return proportionalSlice;
-    }
-    final private boolean proportionalSlice;
-
-    /**
-     * Should the image be repeated along the X axis. The value {@code NO_REPEAT}
-     * has same meaning as the css spec value {@code stretch} meaning the
-     * image is stretched to fill each slice. The effects the top, center and
-     * bottom slices.
-     *
-     * @default Repeat.NO_REPEAT
-     */
-    public Repeat getRepeatX() {
-        return repeatX;
-    }
-    final private Repeat repeatX;
-
-    /**
-     * Should the image be repeated along the Y axis.The value {@code NO_REPEAT}
-     * has same meaning as the css spec value {@code stretch} meaning the
-     * image is stretched to fill each slice. The effects the left, center and
-     * right slices.
-     *
-     * @default Repeat.NO_REPEAT
-     */
-    public Repeat getRepeatY() {
-        return repeatY;
-    }
-    final private Repeat repeatY;
-
-    private BorderImage(Image image, boolean fillCenter, double topSlice,
-            double rightSlice, double bottomSlice, double leftSlice,
-            Repeat repeatX, Repeat repeatY,
-            boolean proportionalSlice, boolean proportionalWidth,
-            double topWidth, double rightWidth, double bottomWidth, double leftWidth,
-            Insets offsets) {
-        super(topWidth, rightWidth, bottomWidth, leftWidth, proportionalWidth, offsets);
-        this.image = image;
-        this.fillCenter = fillCenter;
-        this.topSlice = topSlice;
-        this.rightSlice = rightSlice;
-        this.bottomSlice = bottomSlice;
-        this.leftSlice = leftSlice;
-        this.repeatX = repeatX;
-        this.repeatY = repeatY;
-        this.proportionalSlice = proportionalSlice;
-    }
-
-    final static public class BorderImageRepeat {
-
-        final private Repeat repeatX;
-        final private Repeat repeatY;
-
-        public BorderImageRepeat(Repeat repeatX, Repeat repeatY) {
-            this.repeatX = repeatX;
-            this.repeatY = repeatY;
-        }
-
-        public Repeat getRepeatX() {
-            return repeatX;
-        }
-
-        public Repeat getRepeatY() {
-            return repeatY;
-        }
-    }
-
-    /**
-     * border-image-repeat  <repeat-style> [ , <repeat-style> ]*
-     * where <repeat-style> = repeat-x | repeat-y | [repeat | space | round | stretch | no-repeat]{1,2}
-     */
-    final static public class RepeatConverter extends StyleConverter<ParsedValue<Repeat, Repeat>[][], BorderImageRepeat[]> {
-
-        public static RepeatConverter getInstance() {
-            return Holder.BORDER_IMAGE_REPEAT_CONVERTER;
-        }
-
-        private RepeatConverter() {
-            super();
-        }
-
-        @Override
-        public BorderImageRepeat[] convert(ParsedValue<ParsedValue<Repeat, Repeat>[][], BorderImageRepeat[]> value, Font font) {
-            ParsedValue<Repeat, Repeat>[][] layers = value.getValue();
-            BorderImageRepeat[] borderImageRepeats = new BorderImageRepeat[layers.length];
-            for (int l = 0; l < layers.length; l++) {
-                ParsedValue<Repeat,Repeat>[] repeats = layers[l];
-                Repeat horizontal = repeats[0].getValue();
-                Repeat vertical = repeats[1].getValue();
-                borderImageRepeats[l] = new BorderImageRepeat(horizontal, vertical);
-            }
-            return borderImageRepeats;
-        }
-
-        @Override
-        public String toString() {
-            return "BorderImageRepeatConverter";
-        }
-    }
-
-    final static public class BorderImageSlice {
-
-        final private double top;
-        final private double right;
-        final private double bottom;
-        final private double left;
-        final private boolean proportional;
-        final private boolean fill;
-
-        public BorderImageSlice(double top, double right, double bottom, double left,
-                boolean proportional, boolean fill) {
-            this.top = top;
-            this.right = right;
-            this.bottom = bottom;
-            this.left = left;
-            this.proportional = proportional;
-            this.fill = fill;
-        }
-
-        public double getTop() {
-            return top;
-        }
-
-        public double getRight() {
-            return right;
-        }
-
-        public double getBottom() {
-            return bottom;
-        }
-
-        public double getLeft() {
-            return left;
-        }
-
-        public boolean isProportional() {
-            return proportional;
-        }
-
-        public boolean isFill() {
-            return fill;
-        }
-    }
-
-    /**
-     * [<size> | <size> <size> <size> <size>] <fill>? [ , [ <size> | <size> <size> <size> <size>] <fill>? ]*
-     */
-    final static public class SliceSequenceConverter extends StyleConverter<ParsedValue<ParsedValue[], BorderImageSlice>[], BorderImageSlice[]> {
-
-        public static SliceSequenceConverter getInstance() {
-            return Holder.BORDER_IMAGE_SLICE_SEQUENCE_CONVERTER;
-        }
-
-        @Override
-        public BorderImageSlice[] convert(ParsedValue<ParsedValue<ParsedValue[], BorderImageSlice>[], BorderImageSlice[]> value, Font font) {
-            // For 'border-image-slice: 10% fill, 20% 30%', the value arg will be
-            // ParsedValue { values: [
-            //     ParsedValue { values: [ ParsedValue {parsed: 10%}, ParsedValue {parsed: fill}] } ,
-            //     ParsedValue { values: [ ParsedValue {parsed: 20%}, ParsedValue {parsed: 30%}] }
-            // ]}
-            //
-            // For 'border-image-slice: 10% fill', the value arg will be
-            // ParsedValue { values: [ ParsedValue {parsed: 10%}, ParsedValue {parsed: fill}] }
-            //
-            // For 'border-image-slice: 10%', the value arg will be
-            // ParsedValue {parsed: 10%}
-            //
-            // where the sizes are actually Size objects.
-            //
-            // If the value arg contains multiple layers, unwind the nested
-            // values by one level.
-            ParsedValue<ParsedValue[], BorderImageSlice>[] layers = value.getValue();
-            BorderImageSlice[] borderImageSlices = new BorderImageSlice[layers.length];
-            for (int l = 0; l < layers.length; l++) {
-                borderImageSlices[l] = SliceConverter.getInstance().convert(layers[l], font);
-            }
-            return borderImageSlices;
-        }
-
-        @Override
-        public String toString() {
-            return "BorderImageSliceSequenceConverter";
-        }
-    }
-
-    final static public class SliceConverter extends StyleConverter<ParsedValue[], BorderImageSlice> {
-
-        public static SliceConverter getInstance() {
-            return Holder.BORDER_IMAGE_SLICE_CONVERTER;
-        }
-
-        private SliceConverter() {
-            super();
-        }
-
-        @Override
-        public BorderImageSlice convert(ParsedValue<ParsedValue[], BorderImageSlice> layer, Font font) {
-            // Parser sends insets and boolean fill
-
-            ParsedValue[] values = layer.getValue();
-
-            // value[0] is ParsedValue<Value<?,Size>[],Insets>
-            ParsedValue<?, Size>[] sizes = (ParsedValue<?, Size>[]) values[0].getValue();
-            Size topSz = (Size) sizes[0].convert(font);
-            Size rightSz = (Size) sizes[1].convert(font);
-            Size bottomSz = (Size) sizes[2].convert(font);
-            Size leftSz = (Size) sizes[3].convert(font);
-
-            boolean proportional = false;
-            if (topSz.getUnits() == rightSz.getUnits()
-                    && topSz.getUnits() == bottomSz.getUnits()
-                    && rightSz.getUnits() == leftSz.getUnits()) {
-                proportional = topSz.getUnits() == SizeUnits.PERCENT;
-            } else {
-                System.err.println("border-image-slice size units do not match");
-            }
-
-            Double top = topSz.pixels(font);
-            Double right = rightSz.pixels(font);
-            Double bottom = bottomSz.pixels(font);
-            Double left = leftSz.pixels(font);
-
-            Boolean fill = (Boolean) values[1].getValue();
-
-            return new BorderImageSlice(top, right, bottom, left, proportional, fill);
-        }
-
-        @Override
-        public String toString() {
-            return "BorderImageSliceType";
-        }
-    }
-}
--- a/javafx-ui-common/src/com/sun/javafx/scene/layout/region/BorderImageConverter.java	Tue Sep 11 20:35:27 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.javafx.scene.layout.region;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import javafx.geometry.Insets;
-import javafx.scene.image.Image;
-
-import com.sun.javafx.css.StyleConverter;
-import com.sun.javafx.css.StyleableProperty;
-import com.sun.javafx.css.ParsedValue;
-
-public final class BorderImageConverter extends StyleConverter<ParsedValue[], List<BorderImage>> {
-
-    private static class Holder {
-        private static final BorderImageConverter BORDER_IMAGE_CONVERTER =
-                new BorderImageConverter();
-    }
-
-    public static BorderImageConverter getInstance() {
-        return Holder.BORDER_IMAGE_CONVERTER;
-    }
-
-    private BorderImageConverter() {
-        super();
-    }
-
-    @Override
-    public List<BorderImage> convert(Map<StyleableProperty, Object> convertedValues) {
-        String[] imageUrls = null;
-        BorderImage.BorderImageRepeat[] repeats = null;
-        BorderImage.BorderImageSlice[] slices = null;
-        Margins[] widths = null;
-        Insets[] insets = null;
-        List<StyleableProperty> styleables = BorderImage.impl_CSS_STYLEABLES();
-        for (int k = 0; k < styleables.size(); k++) {
-            StyleableProperty styleable = styleables.get(k);
-            Object value = convertedValues.get(styleable);
-            if (value == null) {
-                continue;
-            }
-            if ("-fx-border-image-source".equals(styleable.getProperty())) {
-                imageUrls = (String[]) value;
-            } else if ("-fx-border-image-repeat".equals(styleable.getProperty())) {
-                repeats = (BorderImage.BorderImageRepeat[]) value;
-            } else if ("-fx-border-image-slice".equals(styleable.getProperty())) {
-                slices = (BorderImage.BorderImageSlice[]) value;
-            } else if ("-fx-border-image-width".equals(styleable.getProperty())) {
-                widths = (Margins[]) value;
-            } else if ("-fx-border-image-insets".equals(styleable.getProperty())) {
-                insets = (Insets[]) value;
-            }
-        }
-        int nImages = imageUrls != null ? imageUrls.length : 0;
-        List<BorderImage> borders = new ArrayList<BorderImage>();
-        for (int index = 0; index < nImages; index++) {
-            if (imageUrls[index]==null) continue;
-            BorderImage.BorderImageRepeat repeat = (repeats != null) ?
-                repeats[Math.min(index, repeats.length - 1)] : null;
-            BorderImage.BorderImageSlice slice = (slices != null) ?
-                slices[Math.min(index, slices.length - 1)] : null;
-            Margins width = (widths != null) ?
-                widths[Math.min(index, widths.length - 1)] : null;
-            Insets inset = (insets != null) ?
-                insets[Math.min(index, insets.length - 1)] : null;
-            BorderImage.Builder builder = new BorderImage.Builder();
-            builder.setImage(new Image(imageUrls[index]));
-            if (width != null) {
-                builder.setTopWidth(width.getTop())
-                       .setRightWidth(width.getRight())
-                       .setBottomWidth(width.getBottom())
-                       .setLeftWidth(width.getLeft())
-                       .setProportionalWidth(width.isProportional());
-            }
-            if (inset != null) {
-                builder.setOffsets(inset);
-            }
-            if (slice != null) {
-                builder.setFillCenter(slice.isFill())
-                       .setTopSlice(slice.getTop())
-                       .setRightSlice(slice.getRight())
-                       .setBottomSlice(slice.getBottom())
-                       .setLeftSlice(slice.getLeft())
-                       .setProportionalSlice(slice.isProportional());
-            }
-            if (repeat != null) {
-                builder.setRepeatX(repeat.getRepeatX())
-                       .setRepeatY(repeat.getRepeatY());
-            }
-            borders.add(builder.build());
-        }
-        return borders;
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/com/sun/javafx/scene/layout/region/BorderImageSliceConverter.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.javafx.scene.layout.region;
+
+import javafx.scene.layout.BorderWidths;
+import javafx.scene.text.Font;
+import com.sun.javafx.css.ParsedValue;
+import com.sun.javafx.css.Size;
+import com.sun.javafx.css.SizeUnits;
+import com.sun.javafx.css.StyleConverter;
+
+/**
+ */
+public final class BorderImageSliceConverter extends StyleConverter<ParsedValue[], BorderImageSlices> {
+
+    private static final BorderImageSliceConverter BORDER_IMAGE_SLICE_CONVERTER =
+            new BorderImageSliceConverter();
+
+    public static BorderImageSliceConverter getInstance() {
+        return BORDER_IMAGE_SLICE_CONVERTER;
+    }
+
+    // Disallow instantiation
+    private BorderImageSliceConverter() { }
+
+    @Override
+    public BorderImageSlices convert(ParsedValue<ParsedValue[], BorderImageSlices> layer, Font font) {
+        // Parser sends insets and boolean fill
+        final ParsedValue[] values = layer.getValue();
+
+        // value[0] is ParsedValue<Value<?,Size>[],Insets>
+        final ParsedValue<?, Size>[] sizes = (ParsedValue<?, Size>[]) values[0].getValue();
+        final Size topSz = sizes[0].convert(font);
+        final Size rightSz = sizes[1].convert(font);
+        final Size bottomSz = sizes[2].convert(font);
+        final Size leftSz = sizes[3].convert(font);
+
+        return new BorderImageSlices(
+                new BorderWidths(
+                topSz.pixels(font),
+                rightSz.pixels(font),
+                bottomSz.pixels(font),
+                leftSz.pixels(font),
+                topSz.getUnits() == SizeUnits.PERCENT,
+                rightSz.getUnits() == SizeUnits.PERCENT,
+                bottomSz.getUnits() == SizeUnits.PERCENT,
+                leftSz.getUnits() == SizeUnits.PERCENT
+                ),
+                (Boolean) values[1].getValue());
+    }
+
+    /**
+     * @inheritDoc
+     */
+    @Override public String toString() {
+        return "BorderImageSliceConverter";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/com/sun/javafx/scene/layout/region/BorderImageSlices.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.javafx.scene.layout.region;
+
+import javafx.scene.layout.BorderWidths;
+
+/**
+ * A helper class during the conversion process.
+ */
+public class BorderImageSlices {
+    public static final BorderImageSlices EMPTY = new BorderImageSlices(BorderWidths.EMPTY, false);
+
+    public BorderWidths widths;
+    public boolean filled;
+
+    public BorderImageSlices(BorderWidths widths, boolean filled) {
+        this.widths = widths;
+        this.filled = filled;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/com/sun/javafx/scene/layout/region/BorderImageWidthConverter.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,74 @@
+package com.sun.javafx.scene.layout.region;
+
+import javafx.scene.layout.BorderWidths;
+import javafx.scene.text.Font;
+import com.sun.javafx.css.ParsedValue;
+import com.sun.javafx.css.Size;
+import com.sun.javafx.css.SizeUnits;
+import com.sun.javafx.css.StyleConverter;
+
+/**
+ * User: richardbair
+ * Date: 8/10/12
+ * Time: 8:07 PM
+ */
+public class BorderImageWidthConverter extends StyleConverter<ParsedValue<?, Size>[], BorderWidths> {
+    private static final BorderImageWidthConverter CONVERTER_INSTANCE = new BorderImageWidthConverter();
+
+    public static BorderImageWidthConverter getInstance() {
+        return CONVERTER_INSTANCE;
+    }
+
+    private BorderImageWidthConverter() { }
+
+    @Override
+    public BorderWidths convert(ParsedValue<ParsedValue<?, Size>[], BorderWidths> value, Font font) {
+        ParsedValue<?, Size>[] sides = value.getValue();
+        assert sides.length == 4;
+
+        double top = 1, right = 1, bottom = 1, left = 1;
+        boolean topPercent = false, rightPercent = false, bottomPercent = false, leftPercent = false;
+        ParsedValue<?, Size> val = sides[0];
+        if ("auto".equals(val.getValue())) {
+            top = BorderWidths.AUTO;
+        } else {
+            Size size = val.convert(font);
+            top = size.pixels(font);
+            topPercent = size.getUnits() == SizeUnits.PERCENT;
+        }
+
+        val = sides[1];
+        if ("auto".equals(val.getValue())) {
+            right = BorderWidths.AUTO;
+        } else {
+            Size size = val.convert(font);
+            right = size.pixels(font);
+            rightPercent = size.getUnits() == SizeUnits.PERCENT;
+        }
+
+        val = sides[2];
+        if ("auto".equals(val.getValue())) {
+            bottom = BorderWidths.AUTO;
+        } else {
+            Size size = val.convert(font);
+            bottom = size.pixels(font);
+            bottomPercent = size.getUnits() == SizeUnits.PERCENT;
+        }
+
+        val = sides[3];
+        if ("auto".equals(val.getValue())) {
+            left = BorderWidths.AUTO;
+        } else {
+            Size size = val.convert(font);
+            left = size.pixels(font);
+            leftPercent = size.getUnits() == SizeUnits.PERCENT;
+        }
+
+        return new BorderWidths(top, right, bottom, left, topPercent, rightPercent, bottomPercent, leftPercent);
+    }
+
+    @Override
+    public String toString() {
+        return "BorderImageWidthConverter";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/com/sun/javafx/scene/layout/region/BorderImageWidthsSequenceConverter.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,52 @@
+package com.sun.javafx.scene.layout.region;
+
+import com.sun.javafx.css.ParsedValue;
+import com.sun.javafx.css.StyleConverter;
+import com.sun.javafx.css.Size;
+import javafx.scene.layout.BorderWidths;
+import javafx.scene.text.Font;
+
+/**
+ * User: richardbair
+ * Date: 8/10/12
+ * Time: 8:27 PM
+ */
+public class BorderImageWidthsSequenceConverter extends StyleConverter<ParsedValue<ParsedValue<?,Size>[], BorderWidths>[], BorderWidths[]> {
+    private static final BorderImageWidthsSequenceConverter CONVERTER =
+            new BorderImageWidthsSequenceConverter();
+
+    public static BorderImageWidthsSequenceConverter getInstance() {
+        return CONVERTER;
+    }
+
+    @Override
+    public BorderWidths[] convert(ParsedValue<ParsedValue<ParsedValue<?,Size>[], BorderWidths>[], BorderWidths[]> value, Font font) {
+        // For 'border-image-slice: 10% fill, 20% 30%', the value arg will be
+        // ParsedValue { values: [
+        //     ParsedValue { values: [ ParsedValue {parsed: 10%}, ParsedValue {parsed: fill}] } ,
+        //     ParsedValue { values: [ ParsedValue {parsed: 20%}, ParsedValue {parsed: 30%}] }
+        // ]}
+        //
+        // For 'border-image-slice: 10% fill', the value arg will be
+        // ParsedValue { values: [ ParsedValue {parsed: 10%}, ParsedValue {parsed: fill}] }
+        //
+        // For 'border-image-slice: 10%', the value arg will be
+        // ParsedValue {parsed: 10%}
+        //
+        // where the sizes are actually Size objects.
+        //
+        // If the value arg contains multiple layers, unwind the nested
+        // values by one level.
+        ParsedValue<ParsedValue<?,Size>[], BorderWidths>[] layers = value.getValue();
+        BorderWidths[] widths = new BorderWidths[layers.length];
+        for (int l = 0; l < layers.length; l++) {
+            widths[l] = BorderImageWidthConverter.getInstance().convert(layers[l], font);
+        }
+        return widths;
+    }
+
+    @Override
+    public String toString() {
+        return "BorderImageWidthsSequenceConverter";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/com/sun/javafx/scene/layout/region/BorderStrokeStyleSequenceConverter.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.javafx.scene.layout.region;
+
+import javafx.scene.layout.BorderStrokeStyle;
+import javafx.scene.text.Font;
+import com.sun.javafx.css.ParsedValue;
+import com.sun.javafx.css.StyleConverter;
+
+/**
+ * User: richardbair
+ * Date: 8/10/12
+ * Time: 7:31 AM
+ */
+public final class BorderStrokeStyleSequenceConverter extends StyleConverter<ParsedValue<ParsedValue[],BorderStrokeStyle>[],BorderStrokeStyle[]> {
+    /**
+     * Convert an array of border style values to an array of BorderStyle which
+     * contains one BorderStyle element per border (top, right, bottom, left).
+     */
+    private static final BorderStrokeStyleSequenceConverter BORDER_STYLE_SEQUENCE_CONVERTER =
+            new BorderStrokeStyleSequenceConverter();
+
+    public static BorderStrokeStyleSequenceConverter getInstance() {
+        return BORDER_STYLE_SEQUENCE_CONVERTER;
+    }
+
+    private BorderStrokeStyleSequenceConverter() {
+        super();
+    }
+
+    @Override
+    public BorderStrokeStyle[] convert(ParsedValue<ParsedValue<ParsedValue[],BorderStrokeStyle>[], BorderStrokeStyle[]> value, Font font) {
+
+        ParsedValue<ParsedValue[],BorderStrokeStyle>[] borders = value.getValue();
+        BorderStrokeStyle[] styles = new BorderStrokeStyle[4];
+
+        styles[0] = (borders.length > 0) ?
+                borders[0].convert(font) : BorderStrokeStyle.SOLID;
+
+        styles[1] = (borders.length > 1) ?
+                borders[1].convert(font) : styles[0];
+
+        styles[2] = (borders.length > 2) ?
+                borders[2].convert(font) : styles[0];
+
+        styles[3] = (borders.length > 3) ?
+                borders[3].convert(font) : styles[1];
+
+        return styles;
+    }
+
+    @Override
+    public String toString() {
+        return "BorderStrokeStyleSequenceConverter";
+    }
+
+}
--- a/javafx-ui-common/src/com/sun/javafx/scene/layout/region/BorderStyle.java	Tue Sep 11 20:35:27 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,211 +0,0 @@
-/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.javafx.scene.layout.region;
-
-import javafx.scene.shape.StrokeLineCap;
-import javafx.scene.shape.StrokeLineJoin;
-import javafx.scene.shape.StrokeType;
-
-
-public class BorderStyle {
-
-
-    /** placeholder for border-style 'none' */
-    static final public BorderStyle NONE = new BorderStyle();
-
-    /** placeholder for border-style 'solid' */
-    static final public BorderStyle SOLID = new BorderStyle(
-                StrokeType.CENTERED,
-                StrokeLineJoin.MITER,
-                StrokeLineCap.BUTT,
-                10.0,
-                0.0,
-                new double[] {}
-        );
-
-    /**
-     * Defines the direction (inside, outside, or both) that the strokeWidth
-     * is applied to the boundary of the shape.
-     *
-     * @profile desktop
-     * @defaultValue CENTERED
-     */
-    public StrokeType getStrokeType() { return strokeType; }
-    final private StrokeType strokeType;
-
-    /**
-     * Defines the decoration applied where path segments meet.
-     * The value must have one of the following values:
-     * {@code StrokeLineJoin.BEVEL}, {@code StrokeLineJoin.MITER},
-     * and {@code StrokeLineJoin.ROUND}.
-     *
-     * @defaultValue MITER
-     */
-    public StrokeLineJoin getStrokeLineJoin() { return strokeLineJoin; }
-    final private StrokeLineJoin strokeLineJoin;
-
-    /**
-     * The end cap style of this {@code Shape} as one of the following
-     * values that define possible end cap styles:
-     * {@code StrokeLineCap.BUTT}, {@code StrokeLineCap.ROUND},
-     * and  {@code StrokeLineCap.SQUARE}.
-     *
-     * @defaultValue SQUARE
-     */
-    public StrokeLineCap getStrokeLineCap() { return strokeLineCap; }
-    final private StrokeLineCap strokeLineCap;
-
-    /**
-     * Defines the limit for the {@code StrokeLineJoin.MITER} line join style.
-     *
-     * @defaultValue 10
-     */
-    public double getStrokeMiterLimit() { return strokeMiterLimit; }
-    final private double strokeMiterLimit;
-
-    /**
-     * Defines a distance specified in user coordinates that represents
-     * an offset into the dashing pattern. In other words, the dash phase
-     * defines the point in the dashing pattern that will correspond
-     * to the beginning of the stroke.
-     *
-     * @defaultValue 0
-     */
-    public double getStrokeDashOffset() { return strokeDashOffset; }
-    final private double strokeDashOffset;
-
-    /**
-     * Defines the array representing the lengths of the dash segments.
-     * Alternate entries in the array represent the user space lengths
-     * of the opaque and transparent segments of the dashes.
-     * As the pen moves along the outline of the {@code Shape} to be stroked,
-     * the user space distance that the pen travels is accumulated.
-     * The distance value is used to index into the dash array.
-     * The pen is opaque when its current cumulative distance maps
-     * to an even element of the dash array and transparent otherwise.
-     * An empty strokeDashArray indicates a solid line with no spaces.
-     * @defaultValue empty
-     */
-    public double[] getStrokeDashArray() { return strokeDashArray; }
-    final private double[] strokeDashArray;
-
-    public BorderStyle(StrokeType strokeType, StrokeLineJoin strokeLineJoin,
-            StrokeLineCap strokeLineCap, Double strokeMiterLimit,
-            Double strokeDashOffset, double[] strokeDashArray) {
-        this.strokeType = (strokeType != null) ?
-                strokeType : StrokeType.CENTERED;
-        this.strokeLineJoin = (strokeLineJoin != null) ?
-                strokeLineJoin : StrokeLineJoin.MITER;
-        this.strokeLineCap = (strokeLineCap != null) ?
-                strokeLineCap : StrokeLineCap.BUTT;
-        this.strokeMiterLimit = (strokeMiterLimit != null) ?
-                strokeMiterLimit : 10.0f;
-        this.strokeDashOffset = (strokeDashOffset != null) ?
-                strokeDashOffset : 0.0f;
-        this.strokeDashArray = (strokeDashArray != null) ?
-                strokeDashArray : null;
-    }
-
-    private BorderStyle() {
-        strokeType = StrokeType.CENTERED;
-        strokeLineJoin = StrokeLineJoin.MITER;
-        strokeLineCap = StrokeLineCap.BUTT;
-        strokeMiterLimit = 10.0f;
-        strokeDashOffset = 0.0f;
-        strokeDashArray = null;
-    }
-
-    boolean adjusted = false;
-    void adjustForStrokeWidth(double width) {
-        if (width > 1 && !adjusted) {
-            if (strokeDashArray != null && strokeDashArray.length > 0) {
-                double factor = width - 1;
-                for (int n=0; n<strokeDashArray.length; n++)
-                    strokeDashArray[n] *= factor;
-            }
-            adjusted = true;
-        }
-    }
-
-    @Override
-    public String toString() {
-        String s = "BorderStyle.NONE";
-        if (this == BorderStyle.SOLID) {
-            s = "BorderStyle.SOLID";
-        } else if(this != BorderStyle.NONE) {
-            StringBuilder sbuf = new StringBuilder();
-            sbuf.append("BorderStyle: ");
-            sbuf.append(strokeType);
-            sbuf.append(", ");
-            sbuf.append(strokeLineJoin);
-            sbuf.append(", ");
-            sbuf.append(strokeLineCap);
-            sbuf.append(", ");
-            sbuf.append(strokeMiterLimit);
-            sbuf.append(", ");
-            sbuf.append(strokeDashOffset);
-            sbuf.append(", [");
-            if (strokeDashArray != null) {
-            for(int n=0; n<strokeDashArray.length-1; n++) {
-                sbuf.append(strokeDashArray[n]);
-                sbuf.append(", ");
-            }
-            if (strokeDashArray.length > 0) {
-                sbuf.append(strokeDashArray[strokeDashArray.length-1]);
-            }
-            }
-            sbuf.append("]");
-            s = sbuf.toString();
-        }
-        return s;
-    }
-
-    /** Primarily for unit testing */
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) return true;
-        if (obj instanceof BorderStyle) {
-            BorderStyle other = (BorderStyle)obj;
-            if ((this.strokeType == other.strokeType) &&
-                 (this.strokeLineJoin == other.strokeLineJoin) &&
-                 (this.strokeLineCap == other.strokeLineCap) &&
-                 (this.strokeMiterLimit == other.strokeMiterLimit) &&
-                 (this.strokeDashOffset == other.strokeDashOffset)) {
-
-                if ((this.strokeDashArray != null && other.strokeDashArray != null) &&
-                    (this.strokeDashArray.length == other.strokeDashArray.length)) {
-
-                    return java.util.Arrays.equals(strokeDashArray, other.strokeDashArray);
-                } else {
-                    return (this.strokeDashArray == null && other.strokeDashArray == null);
-                }
-            }
-        }
-        return false;
-    }
-
-}
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/com/sun/javafx/scene/layout/region/BorderStyleConverter.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,163 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.javafx.scene.layout.region;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import javafx.scene.layout.BorderStrokeStyle;
+import javafx.scene.shape.StrokeLineCap;
+import javafx.scene.shape.StrokeLineJoin;
+import javafx.scene.shape.StrokeType;
+import javafx.scene.text.Font;
+import com.sun.javafx.css.ParsedValue;
+import com.sun.javafx.css.Size;
+import com.sun.javafx.css.StyleConverter;
+
+/**
+ */
+public class BorderStyleConverter  extends StyleConverter<ParsedValue[], BorderStrokeStyle> {
+//    private static final ParsedValue<ParsedValue<?,Size>[],Double[]> DASHED =
+//            new ParsedValue<ParsedValue<?,Size>[],Double[]>(
+//                    new ParsedValue[] {
+//                            new ParsedValue<Size,Size>(new Size(5.0f, SizeUnits.PX), null),
+//                            new ParsedValue<Size,Size>(new Size(3.0f, SizeUnits.PX), null)
+//                    }, SizeConverter.SequenceConverter.getInstance());
+//
+//    private static final ParsedValue<ParsedValue<?,Size>[],Double[]> DOTTED =
+//            new ParsedValue<ParsedValue<?,Size>[],Double[]>(
+//                    new ParsedValue[]{
+//                            new ParsedValue<Size,Size>(new Size(1.0f, SizeUnits.PX), null),
+//                            new ParsedValue<Size,Size>(new Size(3.0f, SizeUnits.PX), null)
+//                    }, SizeConverter.SequenceConverter.getInstance());
+//
+//    private static final ParsedValue<ParsedValue<?,Size>[],Double[]> SOLID =
+//            new ParsedValue<ParsedValue<?,Size>[],Double[]>(
+//                    new ParsedValue[]{
+//                            /* empty array */
+//                    }, SizeConverter.SequenceConverter.getInstance());
+
+
+    public static final ParsedValue<ParsedValue<?,Size>[],Double[]> NONE = new ParsedValue<ParsedValue<?,Size>[],Double[]>(null, null);
+    public static final ParsedValue<ParsedValue<?,Size>[],Double[]> HIDDEN = new ParsedValue<ParsedValue<?,Size>[],Double[]>(null, null);
+    public static final ParsedValue<ParsedValue<?,Size>[],Double[]> DOTTED = new ParsedValue<ParsedValue<?,Size>[],Double[]>(null, null);
+    public static final ParsedValue<ParsedValue<?,Size>[],Double[]> DASHED = new ParsedValue<ParsedValue<?,Size>[],Double[]>(null, null);
+    public static final ParsedValue<ParsedValue<?,Size>[],Double[]> SOLID = new ParsedValue<ParsedValue<?,Size>[],Double[]>(null, null);
+
+    /**
+     * Convert a sequence of values to a BorderStyle.
+     */
+    private static final BorderStyleConverter BORDER_STYLE_CONVERTER =
+            new BorderStyleConverter();
+
+    public static BorderStyleConverter getInstance() {
+        return BORDER_STYLE_CONVERTER;
+    }
+
+    // Prevent instantiation
+    private BorderStyleConverter() { }
+
+    @Override
+    public BorderStrokeStyle convert(ParsedValue<ParsedValue[],BorderStrokeStyle> value, Font font) {
+
+        final ParsedValue[] values = value.getValue();
+
+        // The first value may be some named style, such as DOTTED, DASHED, SOLID, or NONE.
+        // However even if named, there might be additional style information such as the
+        // round cap to use, etc. But most of the time, people will only define the name and
+        // nothing more. So we special case this so that if you use "solid" in CSS and that
+        // is all, then we map it to BorderStrokeStyle.SOLID and quite early.
+        Object v = values[0];
+        final boolean onlyNamed = values[1] == null &&
+                values[2] == null &&
+                values[3] == null &&
+                values[4] == null &&
+                values[5] == null;
+
+        if (NONE == v) return BorderStrokeStyle.NONE;
+        if (DOTTED == v && onlyNamed) {
+            return BorderStrokeStyle.DOTTED;
+        } else if (DASHED == v && onlyNamed) {
+            return BorderStrokeStyle.DASHED;
+        } else if (SOLID == v && onlyNamed) {
+            return BorderStrokeStyle.SOLID;
+        }
+
+        // We have some custom specified value
+        ParsedValue<?,Size>[] dash_vals =
+                ((ParsedValue<ParsedValue<?,Size>[],Double[]>)values[0]).getValue();
+
+        final List<Double> dashes;
+        if (dash_vals == null) {
+            if (DOTTED == v) {
+                dashes = BorderStrokeStyle.DOTTED.getDashArray();
+            } else if (DASHED == v) {
+                dashes = BorderStrokeStyle.DASHED.getDashArray();
+            } else if (SOLID == v) {
+                dashes = BorderStrokeStyle.SOLID.getDashArray();
+            } else {
+                dashes = Collections.emptyList();
+            }
+        } else {
+            dashes = new ArrayList<Double>(dash_vals.length);
+            for(int dash=0; dash<dash_vals.length; dash++) {
+                final Size size = dash_vals[dash].convert(font);
+                dashes.add(size.pixels(font));
+            }
+        }
+
+        final double dash_phase =
+                (values[1] != null) ? (Double)values[1].convert(font) : 0;
+
+        final StrokeType stroke_type =
+                (values[2] != null) ? (StrokeType)values[2].convert(font) : StrokeType.INSIDE;
+
+        final StrokeLineJoin line_join =
+                (values[3] != null) ? (StrokeLineJoin)values[3].convert(font) : StrokeLineJoin.MITER;
+
+        final double miter_limit =
+                (values[4] != null) ? (Double)values[4].convert(font) : 10;
+
+        final StrokeLineCap line_cap =
+                (values[5] != null) ? (StrokeLineCap)values[5].convert(font) : DOTTED == v ? StrokeLineCap.ROUND : StrokeLineCap.BUTT;
+
+        final BorderStrokeStyle borderStyle = new BorderStrokeStyle(stroke_type, line_join, line_cap,
+                miter_limit, dash_phase, dashes);
+
+        if (BorderStrokeStyle.SOLID.equals(borderStyle)) {
+            return BorderStrokeStyle.SOLID;
+        } else {
+            return borderStyle;
+        }
+    }
+
+    /**
+     * @inheritDoc
+     */
+    @Override public String toString() {
+        return "BorderStyleConverter";
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/com/sun/javafx/scene/layout/region/LayeredBackgroundPositionConverter.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,43 @@
+package com.sun.javafx.scene.layout.region;
+
+import javafx.scene.layout.BackgroundPosition;
+import javafx.scene.text.Font;
+import com.sun.javafx.css.ParsedValue;
+import com.sun.javafx.css.Size;
+import com.sun.javafx.css.StyleConverter;
+
+/**
+ * background-position: <bg-position>
+ * where <bg-position> = [
+ *   [ [ <size> | left | center | right ] [ <size> | top | center | bottom ]? ]
+ *   | [ [ center | [ left | right ] <size>? ] || [ center | [ top | bottom ] <size>? ]
+ * ]
+ * @see <a href="http://www.w3.org/TR/css3-background/#the-background-position">background-position</a>
+ */
+public final class LayeredBackgroundPositionConverter extends StyleConverter<ParsedValue<ParsedValue<?, Size>[], BackgroundPosition>[], BackgroundPosition[]> {
+    private static final LayeredBackgroundPositionConverter LAYERED_BACKGROUND_POSITION_CONVERTER =
+            new LayeredBackgroundPositionConverter();
+
+    public static LayeredBackgroundPositionConverter getInstance() {
+        return LAYERED_BACKGROUND_POSITION_CONVERTER;
+    }
+
+    private LayeredBackgroundPositionConverter() {
+        super();
+    }
+
+    @Override
+    public BackgroundPosition[] convert(ParsedValue<ParsedValue<ParsedValue<?, Size>[], BackgroundPosition>[], BackgroundPosition[]> value, Font font) {
+        ParsedValue<ParsedValue<?, Size>[], BackgroundPosition>[] layers = value.getValue();
+        BackgroundPosition[] positions = new BackgroundPosition[layers.length];
+        for (int l = 0; l < layers.length; l++) {
+            positions[l] = layers[l].convert(font);
+        }
+        return positions;
+    }
+
+    @Override
+    public String toString() {
+        return "LayeredBackgroundPositionConverter";
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/com/sun/javafx/scene/layout/region/LayeredBackgroundSizeConverter.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,39 @@
+package com.sun.javafx.scene.layout.region;
+
+import com.sun.javafx.css.ParsedValue;
+import com.sun.javafx.css.StyleConverter;
+import javafx.scene.layout.BackgroundSize;
+import javafx.scene.text.Font;
+
+/**
+ * This class appears to be an artifact of the implementation, such that we need
+ * to pass values around as ParsedValues, and so we have a parsed value that just
+ * holds an array of background sizes, and the converter just pulls those
+ * background sizes back out.
+ *
+ * background-size      <bg-size> [ , <bg-size> ]*
+ * <bg-size> = [ <size> | auto ]{1,2} | cover | contain
+ * @see <a href="http://www.w3.org/TR/css3-background/#the-background-size">background-size</a>
+ */
+public final class LayeredBackgroundSizeConverter extends StyleConverter<ParsedValue<ParsedValue[], BackgroundSize>[], BackgroundSize[]> {
+    private static final LayeredBackgroundSizeConverter LAYERED_BACKGROUND_SIZE_CONVERTER =
+            new LayeredBackgroundSizeConverter();
+
+    public static LayeredBackgroundSizeConverter getInstance() {
+        return LAYERED_BACKGROUND_SIZE_CONVERTER;
+    }
+
+    private LayeredBackgroundSizeConverter() {
+        super();
+    }
+
+    @Override
+    public BackgroundSize[] convert(ParsedValue<ParsedValue<ParsedValue[], BackgroundSize>[], BackgroundSize[]> value, Font font) {
+        ParsedValue<ParsedValue[], BackgroundSize>[] layers = value.getValue();
+        BackgroundSize[] sizes = new BackgroundSize[layers.length];
+        for (int l = 0; l < layers.length; l++) {
+            sizes[l] = layers[l].convert(font);
+        }
+        return sizes;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/com/sun/javafx/scene/layout/region/LayeredBorderPaintConverter.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,42 @@
+package com.sun.javafx.scene.layout.region;
+
+import com.sun.javafx.css.ParsedValue;
+import com.sun.javafx.css.StyleConverter;
+import javafx.scene.paint.Paint;
+import javafx.scene.text.Font;
+
+/*
+ * border-color	<paint> | <paint> <paint> <paint> <paint> [ , [<paint> | <paint> <paint> <paint> <paint>] ]*	null
+ */
+public final class LayeredBorderPaintConverter extends StyleConverter<ParsedValue<ParsedValue<?,Paint>[],Paint[]>[], Paint[][]> {
+    /**
+     * Convert layers of border paint values to an array of Paint[], where
+     * each layer contains one Paint element per border.
+     */
+    private static final LayeredBorderPaintConverter LAYERED_BORDER_PAINT_CONVERTER =
+            new LayeredBorderPaintConverter();
+
+    public static LayeredBorderPaintConverter getInstance() {
+        return LAYERED_BORDER_PAINT_CONVERTER;
+    }
+
+    private LayeredBorderPaintConverter() {
+        super();
+    }
+
+    @Override
+    public Paint[][] convert(ParsedValue<ParsedValue<ParsedValue<?,Paint>[],Paint[]>[], Paint[][]> value, Font font) {
+        ParsedValue<ParsedValue<?,Paint>[],Paint[]>[] layers = value.getValue();
+        Paint[][] paints = new Paint[layers.length][0];
+        for(int layer=0; layer<layers.length; layer++) {
+            paints[layer] = StrokeBorderPaintConverter.getInstance().convert(layers[layer],font);
+        }
+        return paints;
+    }
+
+    @Override
+    public String toString() {
+        return "LayeredBorderPaintConverter";
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/com/sun/javafx/scene/layout/region/LayeredBorderStyleConverter.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,55 @@
+package com.sun.javafx.scene.layout.region;
+
+import javafx.scene.layout.BorderStrokeStyle;
+import javafx.scene.text.Font;
+import com.sun.javafx.css.ParsedValue;
+import com.sun.javafx.css.StyleConverter;
+
+/**
+ * User: richardbair
+ * Date: 8/9/12
+ * Time: 4:53 PM
+ */
+/*
+* border-style: <border-style> [, <border-style>]*
+* where <border-style> = <dash-style> [phase(<number>)]? [centered | inside | outside]?
+*                        [line-join [miter <number> | bevel | round]]?
+*                        [line-cap [square | butt | round]]?
+* where <dash-style> = none | solid | dotted | dashed | segments(<size>[, <size>]+) ]
+*/
+public final class LayeredBorderStyleConverter
+        extends StyleConverter<ParsedValue<ParsedValue<ParsedValue[],BorderStrokeStyle>[], BorderStrokeStyle[]>[], BorderStrokeStyle[][]> {
+
+    /**
+     * Convert layers of border style values to an array of BorderStyle[], where
+     * each layer contains one BorderStyle element per border.
+     */
+    private static final LayeredBorderStyleConverter LAYERED_BORDER_STYLE_CONVERTER =
+            new LayeredBorderStyleConverter();
+
+    public static LayeredBorderStyleConverter getInstance() {
+        return LAYERED_BORDER_STYLE_CONVERTER;
+    }
+
+    private LayeredBorderStyleConverter() {
+        super();
+    }
+
+    @Override
+    public BorderStrokeStyle[][]
+    convert(ParsedValue<ParsedValue<ParsedValue<ParsedValue[], BorderStrokeStyle>[],BorderStrokeStyle[]>[], BorderStrokeStyle[][]> value, Font font) {
+
+        ParsedValue<ParsedValue<ParsedValue[], BorderStrokeStyle>[],BorderStrokeStyle[]>[] layers = value.getValue();
+        BorderStrokeStyle[][] styles = new BorderStrokeStyle[layers.length][0];
+
+        for (int layer=0; layer<layers.length; layer++) {
+            styles[layer] = layers[layer].convert(font);
+        }
+        return styles;
+    }
+
+    @Override
+    public String toString() {
+        return "LayeredBorderStyleConverter";
+    }
+}
--- a/javafx-ui-common/src/com/sun/javafx/scene/layout/region/Margins.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/scene/layout/region/Margins.java	Tue Sep 11 20:39:23 2012 -0400
@@ -38,25 +38,25 @@
  */
 public class Margins {
 
-    // lazy, thread-safe instatiation
+    // lazy, thread-safe instantiation
     private static class Holder {
         static Converter CONVERTER_INSTANCE = new Converter();
         static SequenceConverter SEQUENCE_CONVERTER_INSTANCE = new SequenceConverter();
     }
 
-    final private double top;
+    final double top;
     public final double getTop() { return top; }
 
-    final private double right;
+    final double right;
     public final double getRight() { return right; }
 
-    final private double bottom;
+    final double bottom;
     public final double getBottom() { return bottom; }
 
-    final private double left;
+    final double left;
     public final double getLeft() { return left; }
 
-    final private boolean proportional;
+    final boolean proportional;
     public final boolean isProportional() { return proportional; }
 
     public Margins(double top, double right, double bottom, double left, boolean proportional) {
--- a/javafx-ui-common/src/com/sun/javafx/scene/layout/region/Repeat.java	Tue Sep 11 20:35:27 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.javafx.scene.layout.region;
-
-/**
- * Enumation of options for repeating images in backgrounds and borders
- *
- */
-public enum Repeat {
-    /**
-     * The image is placed once and not repeated
-     */
-    NO_REPEAT,
-    /**
-     * The image is repeated as often as needed to cover the area.
-     */
-    REPEAT,
-    /**
-     * The image is repeated as often as will fit within the area without being
-     * clipped and then the images are spaced out to fill the area. The first
-     * and last images touch the edges of the area.
-     */
-    SPACE,
-    /**
-     * The image is repeated as often as will fit within the area. If it
-     * doesn't fit a whole number of times, it is reduced in size until it does.
-     */
-    ROUND
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/com/sun/javafx/scene/layout/region/RepeatStruct.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.javafx.scene.layout.region;
+
+import javafx.scene.layout.BackgroundRepeat;
+
+/**
+ * An implementation class used by CSS as a struct for moving
+ * data discovered during parsing to the Background and Border
+ * converters.
+ */
+public final class RepeatStruct {
+    public final BackgroundRepeat repeatX;
+    public final BackgroundRepeat repeatY;
+
+    public RepeatStruct(BackgroundRepeat repeatX, BackgroundRepeat repeatY) {
+        this.repeatX = repeatX;
+        this.repeatY = repeatY;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/com/sun/javafx/scene/layout/region/RepeatStructConverter.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.javafx.scene.layout.region;
+
+import com.sun.javafx.css.ParsedValue;
+import com.sun.javafx.css.StyleConverter;
+import javafx.scene.layout.BackgroundRepeat;
+import javafx.scene.text.Font;
+
+/**
+ */
+public final class RepeatStructConverter extends StyleConverter<ParsedValue<BackgroundRepeat, BackgroundRepeat>[][], RepeatStruct[]> {
+
+    private static final RepeatStructConverter REPEAT_STRUCT_CONVERTER =
+            new RepeatStructConverter();
+
+    public static RepeatStructConverter getInstance() {
+        return REPEAT_STRUCT_CONVERTER;
+    }
+
+    private RepeatStructConverter() { }
+
+    @Override
+    public RepeatStruct[] convert(ParsedValue<ParsedValue<BackgroundRepeat, BackgroundRepeat>[][], RepeatStruct[]> value, Font font) {
+        final ParsedValue<BackgroundRepeat, BackgroundRepeat>[][] layers = value.getValue();
+        final RepeatStruct[] backgroundRepeat = new RepeatStruct[layers.length];
+        for (int l = 0; l < layers.length; l++) {
+            final ParsedValue<BackgroundRepeat, BackgroundRepeat>[] repeats = layers[l];
+            final BackgroundRepeat horizontal = repeats[0].getValue();
+            final BackgroundRepeat vertical = repeats[1].getValue();
+            backgroundRepeat[l] = new RepeatStruct(horizontal, vertical);
+        }
+        return backgroundRepeat;
+    }
+
+    /**
+     * @inheritDoc
+     */
+    @Override public String toString() {
+        return "RepeatStructConverter";
+    }
+}
--- a/javafx-ui-common/src/com/sun/javafx/scene/layout/region/ShapeChangeListener.java	Tue Sep 11 20:35:27 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.javafx.scene.layout.region;
-
-
-public interface ShapeChangeListener {
-    void changed();
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/com/sun/javafx/scene/layout/region/SliceSequenceConverter.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,48 @@
+package com.sun.javafx.scene.layout.region;
+
+import javafx.scene.text.Font;
+import com.sun.javafx.css.ParsedValue;
+import com.sun.javafx.css.StyleConverter;
+
+/**
+ * [<size> | <size> <size> <size> <size>] <fill>? [ , [ <size> | <size> <size> <size> <size>] <fill>? ]*
+ */
+public final class SliceSequenceConverter extends StyleConverter<ParsedValue<ParsedValue[], BorderImageSlices>[], BorderImageSlices[]> {
+    private static final SliceSequenceConverter BORDER_IMAGE_SLICE_SEQUENCE_CONVERTER =
+            new SliceSequenceConverter();
+
+    public static SliceSequenceConverter getInstance() {
+        return BORDER_IMAGE_SLICE_SEQUENCE_CONVERTER;
+    }
+
+    @Override
+    public BorderImageSlices[] convert(ParsedValue<ParsedValue<ParsedValue[], BorderImageSlices>[], BorderImageSlices[]> value, Font font) {
+        // For 'border-image-slice: 10% fill, 20% 30%', the value arg will be
+        // ParsedValue { values: [
+        //     ParsedValue { values: [ ParsedValue {parsed: 10%}, ParsedValue {parsed: fill}] } ,
+        //     ParsedValue { values: [ ParsedValue {parsed: 20%}, ParsedValue {parsed: 30%}] }
+        // ]}
+        //
+        // For 'border-image-slice: 10% fill', the value arg will be
+        // ParsedValue { values: [ ParsedValue {parsed: 10%}, ParsedValue {parsed: fill}] }
+        //
+        // For 'border-image-slice: 10%', the value arg will be
+        // ParsedValue {parsed: 10%}
+        //
+        // where the sizes are actually Size objects.
+        //
+        // If the value arg contains multiple layers, unwind the nested
+        // values by one level.
+        ParsedValue<ParsedValue[], BorderImageSlices>[] layers = value.getValue();
+        BorderImageSlices[] borderImageSlices = new BorderImageSlices[layers.length];
+        for (int l = 0; l < layers.length; l++) {
+            borderImageSlices[l] = BorderImageSliceConverter.getInstance().convert(layers[l], font);
+        }
+        return borderImageSlices;
+    }
+
+    @Override
+    public String toString() {
+        return "BorderImageSliceSequenceConverter";
+    }
+}
--- a/javafx-ui-common/src/com/sun/javafx/scene/layout/region/StrokeBorder.java	Tue Sep 11 20:35:27 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,662 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.javafx.scene.layout.region;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import javafx.geometry.Insets;
-import javafx.scene.paint.Color;
-import javafx.scene.paint.Paint;
-import javafx.scene.shape.StrokeLineCap;
-import javafx.scene.shape.StrokeLineJoin;
-import javafx.scene.shape.StrokeType;
-import javafx.scene.text.Font;
-
-import com.sun.javafx.css.Size;
-import com.sun.javafx.css.StyleConverter;
-import com.sun.javafx.css.StyleableProperty;
-import com.sun.javafx.css.ParsedValue;
-import com.sun.javafx.css.converters.InsetsConverter;
-import java.util.ArrayList;
-import javafx.beans.value.WritableValue;
-import javafx.scene.Node;
-
-
-public class StrokeBorder extends Border {
-
-    // lazy, thread-safe
-    private static class Holder {
-
-        /**
-         * Convert layers of border paint values to an array of Paint[], where
-         * each layer contains one Paint element per border.
-         */
-        private static final LayeredBorderPaintConverter LAYERED_BORDER_PAINT_CONVERTER =
-                new LayeredBorderPaintConverter();
-
-        /**
-         * Convert an array of border paint values to an array of Paint which
-         * contains one Paint element per border (top, right, bottom, left).
-         */
-        private static final BorderPaintConverter BORDER_PAINT_CONVERTER =
-                new BorderPaintConverter();
-
-        /**
-         * Convert layers of border style values to an array of BorderStyle[], where
-         * each layer contains one BorderStyle element per border.
-         */
-        private static final LayeredBorderStyleConverter LAYERED_BORDER_STYLE_CONVERTER =
-                new LayeredBorderStyleConverter();
-        /**
-         * Convert an array of border style values to an array of BorderStyle which
-         * contains one BorderStyle element per border (top, right, bottom, left).
-         */
-        private static final BorderStyleSequenceConverter BORDER_STYLE_SEQUENCE_CONVERTER =
-                new BorderStyleSequenceConverter();
-
-        /**
-         * Convert a sequence of values to a BorderStyle.
-         */
-        private static final BorderStyleConverter BORDER_STYLE_CONVERTER =
-                new BorderStyleConverter();
-
-    }
-
-     /**
-      * Super-lazy instantiation pattern from Bill Pugh.
-      * @treatAsPrivate implementation detail
-      */
-     private static class StyleableProperties {
-         
-        private static final StyleableProperty<Node,Paint[]> BORDER_COLOR =
-            new StyleableProperty<Node,Paint[]>("-fx-border-color", 
-                LayeredBorderPaintConverter.getInstance()) {
-
-            @Override
-            public boolean isSettable(Node node) {
-                return false;
-            }
-
-            @Override
-            public WritableValue<Paint[]> getWritableValue(Node node) {
-                return null;
-            }
-        };
-        
-        private static final StyleableProperty<Node,BorderStyle[][]> BORDER_STYLE =
-            new StyleableProperty<Node,BorderStyle[][]>("-fx-border-style",
-                LayeredBorderStyleConverter.getInstance()){
-
-            @Override
-            public boolean isSettable(Node node) {
-                return false;
-            }
-
-            @Override
-            public WritableValue<BorderStyle[][]> getWritableValue(Node node) {
-                return null;
-            }
-        };
-        
-        private static final StyleableProperty<Node,Margins[]> BORDER_WIDTH = 
-            new StyleableProperty<Node,Margins[]> ("-fx-border-width",
-                Margins.SequenceConverter.getInstance()) {
-
-            @Override
-            public boolean isSettable(Node node) {
-                return false;
-            }
-
-            @Override
-            public WritableValue<Margins[]> getWritableValue(Node node) {
-                return null;
-            }
-        };
-        
-        private static final StyleableProperty<Node,Margins[]> BORDER_RADIUS =
-            new StyleableProperty<Node,Margins[]>("-fx-border-radius", 
-                Margins.SequenceConverter.getInstance()){
-
-            @Override
-            public boolean isSettable(Node node) {
-                return false;
-            }
-
-            @Override
-            public WritableValue<Margins[]> getWritableValue(Node node) {
-                return null;
-            }
-        };
-        
-        private static final StyleableProperty<Node,Insets[]> BORDER_INSETS =
-            new StyleableProperty<Node,Insets[]>("-fx-border-insets", 
-                InsetsConverter.SequenceConverter.getInstance()) {
-
-            @Override
-            public boolean isSettable(Node node) {
-                return false;
-            }
-
-            @Override
-            public WritableValue<Insets[]> getWritableValue(Node node) {
-                return null;
-            }
-        };
-
-        private static final List<StyleableProperty> STYLEABLES;
-        static {
-             final List<StyleableProperty> subProperties = 
-                 new ArrayList<StyleableProperty>();
-            Collections.addAll(subProperties,
-                BORDER_COLOR,
-                BORDER_INSETS,
-                BORDER_RADIUS,
-                BORDER_STYLE,
-                BORDER_WIDTH
-            );
-            STYLEABLES = Collections.unmodifiableList(subProperties);
-        }
-        
-    }
-
-     /**
-      * Super-lazy instantiation pattern from Bill Pugh.
-      * @treatAsPrivate implementation detail
-      */
-     public static List<StyleableProperty> impl_CSS_STYLEABLES() {
-         return StrokeBorder.StyleableProperties.STYLEABLES;
-     }
-     
-    /**
-     * RT-19263
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an experimental API that is not intended for general use and is subject to change in future versions
-     */
-    @Deprecated
-    public List<StyleableProperty> impl_getStyleableProperties() {
-        return impl_CSS_STYLEABLES();
-    }
-
-    /**
-     * Defines the radius of the top left corner of the region this border is
-     * being applied to. It only has effect if the region is a rectangular region.
-     *
-     * @defaultValue 0.0
-     */
-    public double getTopLeftCornerRadius() { return topLeftCornerRadius; }
-    final private double topLeftCornerRadius;
-
-    /**
-     * Defines the radius of the top right corner of the region this border is
-     * being applied to. It only has effect if the region is a rectangular region.
-     *
-     * @defaultValue 0.0
-     */
-    public double getTopRightCornerRadius() { return topRightCornerRadius; }
-    final private double topRightCornerRadius;
-
-    /**
-     * Define the radius of the bottom left corner of the region this border is
-     * being applied to. It only has effect if the region is a rectangular region.
-     *
-     * @defaultValue 0.0
-     */
-    public double getBottomLeftCornerRadius() { return bottomLeftCornerRadius; }
-    final private double bottomLeftCornerRadius;
-
-    /**
-     * Defines the radius of the bottom right corner of the region this border is
-     * being applied to. It only has effect if the region is a rectangular region.
-     *
-     * @defaultValue 0.0
-     */
-    public double getBottomRightCornerRadius() { return bottomRightCornerRadius; }
-    final private double bottomRightCornerRadius;
-
-    /**
-     * Defines the fill of left side of this border
-     *
-     * @css border-top-color
-     * @defaultValue BLACK
-     */
-    public Paint getLeftFill() { return leftFill; }
-    final private Paint leftFill;
-
-    /**
-     * Defines the fill of top side of this border. If {@code null} then the
-     * leftFill is used.
-     *
-     * @css border-top-color
-     * @defaultValue null = same as leftFill
-     */
-    public Paint getTopFill() { return topFill; }
-    final private Paint topFill;
-
-    /**
-     * Defines the fill of right side of this border. If {@code null} then the
-     * leftFill is used.
-     *
-     * @css border-top-color
-     * @defaultValue null = same as leftFill
-     */
-    public Paint getRightFill() { return rightFill; }
-    final private Paint rightFill;
-
-    /**
-     * Defines the fill of bottom side of this border. If {@code null} then the
-     * leftFill is used.
-     *
-     * @css border-top-color
-     * @defaultValue null = same as leftFill
-     */
-    public Paint getBottomFill() { return bottomFill; }
-    final private Paint bottomFill;
-
-    /**
-     * Defines the style of top side of this border.
-     *
-     * @css border-top-style
-     * @defaultValue solid
-     */
-    public BorderStyle getTopStyle() { return topStyle; }
-    final private BorderStyle topStyle;
-
-    /**
-     * Defines the style of top side of this border. If {@code null} then
-     * topStyle is used;
-     *
-     * @css border-right-style
-     * @defaultValue null = same as topStyle
-     */
-    public BorderStyle getRightStyle() { return rightStyle; }
-    final private BorderStyle rightStyle;
-
-    /**
-     * Defines the style of bottom side of this border. If {@code null} then
-     * topStyle is used;  Use BorderStyle.NONE to set the border to
-     * have no border style.
-     *
-     * @css border-bottom-style
-     * @defaultValue null = same as topStyle
-     */
-    public BorderStyle getBottomStyle() { return bottomStyle; }
-    final private BorderStyle bottomStyle;
-
-    /**
-     * Defines the style of left side of this border. If {@code null} then
-     * rightStyle is used. Use BorderStyle.NONE to set the border to
-     * have no border style.
-     *
-     * @css border-left-style
-     * @defaultValue null = same as rightStyle
-     */
-    public BorderStyle getLeftStyle() { return leftStyle; }
-    final private BorderStyle leftStyle;
-
-    public static class Builder extends Border.Builder {
-        private double topLeftCornerRadius = 0.0;
-        private double topRightCornerRadius = 0.0;
-        private double bottomLeftCornerRadius = 0.0;
-        private double bottomRightCornerRadius = 0.0;
-        private Paint topFill = Color.BLACK;
-        private Paint rightFill = Color.BLACK;
-        private Paint bottomFill = Color.BLACK;
-        private Paint leftFill = Color.BLACK;
-        private BorderStyle topStyle = BorderStyle.SOLID;
-        private BorderStyle rightStyle = BorderStyle.SOLID;
-        private BorderStyle bottomStyle = BorderStyle.SOLID;
-        private BorderStyle leftStyle = BorderStyle.SOLID;
-
-        public Builder() {}
-
-        public Builder setTopLeftCornerRadius(double f) {
-            topLeftCornerRadius = f;
-            return this;
-        }
-        public Builder setTopRightCornerRadius(double f) {
-            topRightCornerRadius = f;
-            return this;
-    }
-        public Builder setBottomRightCornerRadius(double f) {
-            bottomRightCornerRadius = f;
-            return this;
-        }
-        public Builder setBottomLeftCornerRadius(double f) {
-            bottomLeftCornerRadius = f;
-            return this;
-        }
-        public Builder setTopFill(Paint f) {
-            topFill = f;
-            return this;
-        }
-        public Builder setRightFill(Paint f) {
-            rightFill = f;
-            return this;
-        }
-        public Builder setBottomFill(Paint f) {
-            bottomFill = f;
-            return this;
-        }
-        public Builder setLeftFill(Paint f) {
-            leftFill = f;
-            return this;
-        }
-        public Builder setTopStyle(BorderStyle f) {
-            topStyle = f;
-            return this;
-        }
-        public Builder setRightStyle(BorderStyle f) {
-            rightStyle = f;
-            return this;
-        }
-        public Builder setBottomStyle(BorderStyle f) {
-            bottomStyle = f;
-            return this;
-        }
-        public Builder setLeftStyle(BorderStyle f) {
-            leftStyle = f;
-            return this;
-        }
-        public StrokeBorder build() {
-
-            if (topStyle != null) topStyle.adjustForStrokeWidth(topWidth);
-            if (rightStyle != null) rightStyle.adjustForStrokeWidth(rightWidth);
-            if (bottomStyle != null) bottomStyle.adjustForStrokeWidth(bottomWidth);
-            if (leftStyle != null) leftStyle.adjustForStrokeWidth(leftWidth);
-
-            return new StrokeBorder(
-                topWidth,
-                rightWidth,
-                bottomWidth,
-                leftWidth,
-                proportionalWidth,
-                offsets,
-                topLeftCornerRadius,
-                topRightCornerRadius,
-                bottomLeftCornerRadius,
-                bottomRightCornerRadius,
-                topFill,
-                rightFill,
-                bottomFill,
-                leftFill,
-                topStyle,
-                rightStyle,
-                bottomStyle,
-                leftStyle
-            );
-        }
-    }
-
-    StrokeBorder(
-        double topWidth,
-        double rightWidth,
-        double bottomWidth,
-        double leftWidth,
-        boolean proportionalWidth,
-        Insets offsets,
-        double topLeftCornerRadius,
-        double topRightCornerRadius,
-        double bottomLeftCornerRadius,
-        double bottomRightCornerRadius,
-        Paint topFill,
-        Paint rightFill,
-        Paint bottomFill,
-        Paint leftFill,
-        BorderStyle topStyle,
-        BorderStyle rightStyle,
-        BorderStyle bottomStyle,
-        BorderStyle leftStyle
-    ) {
-        super (
-            topWidth,
-            rightWidth,
-            bottomWidth,
-            leftWidth,
-            proportionalWidth,
-            offsets
-        );
-        this.topLeftCornerRadius = topLeftCornerRadius;
-        this.topRightCornerRadius = topRightCornerRadius;
-        this.bottomLeftCornerRadius = bottomLeftCornerRadius;
-        this.bottomRightCornerRadius = bottomRightCornerRadius;
-        this.topFill = topFill;
-        this.rightFill = rightFill;
-        this.bottomFill = bottomFill;
-        this.leftFill = leftFill;
-        this.topStyle = topStyle;
-        this.rightStyle = rightStyle;
-        this.bottomStyle = bottomStyle;
-        this.leftStyle = leftStyle;
-    }
-
-    /*
-     * border-style: <border-style> [, <border-style>]*
-     * where <border-style> = <dash-style> [phase(<number>)]? [centered | inside | outside]?
-     *                        [line-join [miter <number> | bevel | round]]?
-     *                        [line-cap [square | butt | round]]?
-     * where <dash-style> = none | solid | dotted | dashed | segments(<size>[, <size>]+) ]
-     */
-    static final public class LayeredBorderStyleConverter
-            extends StyleConverter<ParsedValue<ParsedValue<ParsedValue[],BorderStyle>[], BorderStyle[]>[], BorderStyle[][]> {
-
-        public static LayeredBorderStyleConverter getInstance() {
-            return Holder.LAYERED_BORDER_STYLE_CONVERTER;
-        }
-
-        private LayeredBorderStyleConverter() {
-            super();
-        }
-
-        @Override
-        public BorderStyle[][]
-                convert(ParsedValue<ParsedValue<ParsedValue<ParsedValue[], BorderStyle>[],BorderStyle[]>[], BorderStyle[][]> value, Font font) {
-
-            ParsedValue<ParsedValue<ParsedValue[], BorderStyle>[],BorderStyle[]>[] layers = value.getValue();
-            BorderStyle[][] styles = new BorderStyle[layers.length][0];
-
-            for (int layer=0; layer<layers.length; layer++) {
-                styles[layer] = layers[layer].convert(font);
-    }
-            return styles;
-        }
-
-        @Override
-        public String toString() {
-            return "LayeredBorderStyleType";
-    }
-
-    }
-
-    static final public class BorderStyleSequenceConverter extends StyleConverter<ParsedValue<ParsedValue[],BorderStyle>[],BorderStyle[]> {
-
-        public static BorderStyleSequenceConverter getInstance() {
-            return Holder.BORDER_STYLE_SEQUENCE_CONVERTER;
-        }
-
-        private BorderStyleSequenceConverter() {
-            super();
-        }
-
-        @Override
-        public BorderStyle[] convert(ParsedValue<ParsedValue<ParsedValue[],BorderStyle>[], BorderStyle[]> value, Font font) {
-
-            ParsedValue<ParsedValue[],BorderStyle>[] borders = value.getValue();
-            BorderStyle[] styles = new BorderStyle[4];
-
-            styles[0] = (borders.length > 0) ?
-                borders[0].convert(font) : BorderStyle.SOLID;
-
-            styles[1] = (borders.length > 1) ?
-                borders[1].convert(font) : styles[0];
-
-            styles[2] = (borders.length > 2) ?
-                borders[2].convert(font) : styles[0];
-
-            styles[3] = (borders.length > 3) ?
-                borders[3].convert(font) : styles[1];
-
-            return styles;
-    }
-
-        @Override
-        public String toString() {
-            return "BorderStyleType";
-    }
-
-    }
-
-
-    static final public class BorderStyleConverter extends StyleConverter<ParsedValue[],BorderStyle> {
-
-        public static BorderStyleConverter getInstance() {
-            return Holder.BORDER_STYLE_CONVERTER;
-        }
-
-        private BorderStyleConverter() {
-            super();
-        }
-
-        @Override
-        public BorderStyle convert(ParsedValue<ParsedValue[],BorderStyle> value, Font font) {
-
-            ParsedValue[] values = value.getValue();
-
-            // TODO: does the parser do this, or will the dash segments just be null?
-            if (values.length == 1 && BorderStyle.NONE == values[0].getValue()) {
-                return BorderStyle.NONE;
-            }
-
-            ParsedValue<?,Size>[] dash_vals =
-                    ((ParsedValue<ParsedValue<?,Size>[],Double[]>)values[0]).getValue();
-
-            if (dash_vals == null) {
-                return BorderStyle.NONE;
-            }
-
-            double[] dashes = new double[dash_vals.length];
-            for(int dash=0; dash<dash_vals.length; dash++) {
-                Size size = dash_vals[dash].convert(font);
-                dashes[dash] = size.pixels(font);
-            }
-
-            Double dash_phase =
-                    (values[1] != null) ? (Double)values[1].convert(font) : 0;
-
-            StrokeType stroke_type =
-                    (values[2] != null) ? (StrokeType)values[2].convert(font) : StrokeType.CENTERED;
-
-            StrokeLineJoin line_join =
-                    (values[3] != null) ? (StrokeLineJoin)values[3].convert(font) : StrokeLineJoin.MITER;
-
-            Double miter_limit =
-                    (values[4] != null) ? (Double)values[4].convert(font) : 10;
-
-            StrokeLineCap line_cap =
-                    (values[5] != null) ? (StrokeLineCap)values[5].convert(font) : StrokeLineCap.BUTT;
-
-            BorderStyle borderStyle = new BorderStyle(stroke_type, line_join, line_cap,
-                    miter_limit, dash_phase, dashes);
-            if (BorderStyle.SOLID.equals(borderStyle)) {
-                return BorderStyle.SOLID;
-            } else {
-                return borderStyle;
-            }
-        }
-
-        @Override
-        public String toString() {
-            return "StyleType";
-        }
-
-    }
-
-    /*
-     * border-color	<paint> | <paint> <paint> <paint> <paint> [ , [<paint> | <paint> <paint> <paint> <paint>] ]*	null
-     */
-    static final public class LayeredBorderPaintConverter extends StyleConverter<ParsedValue<ParsedValue<?,Paint>[],Paint[]>[], Paint[][]> {
-
-        public static LayeredBorderPaintConverter getInstance() {
-            return Holder.LAYERED_BORDER_PAINT_CONVERTER;
-        }
-
-        private LayeredBorderPaintConverter() {
-            super();
-        }
-
-        @Override
-        public Paint[][] convert(ParsedValue<ParsedValue<ParsedValue<?,Paint>[],Paint[]>[], Paint[][]> value, Font font) {
-            ParsedValue<ParsedValue<?,Paint>[],Paint[]>[] layers = value.getValue();
-            Paint[][] paints = new Paint[layers.length][0];
-            for(int layer=0; layer<layers.length; layer++) {
-                paints[layer] = BorderPaintConverter.getInstance().convert(layers[layer],font);
-    }
-            return paints;
-        }
-
-        @Override
-        public String toString() {
-            return "LayeredBorderPaintType";
-}
-    }
-
-    static final public class BorderPaintConverter extends StyleConverter<ParsedValue<?,Paint>[], Paint[]> {
-
-        public static BorderPaintConverter getInstance() {
-            return Holder.BORDER_PAINT_CONVERTER;
-        }
-
-        private BorderPaintConverter() {
-            super();
-        }
-
-        @Override
-        public Paint[] convert(ParsedValue<ParsedValue<?,Paint>[], Paint[]> value, Font font) {
-            ParsedValue<?,Paint>[] borders = value.getValue();
-            Paint[] paints = new Paint[4];
-
-            paints[0] = (borders.length > 0) ?
-                borders[0].convert(font) : Color.BLACK;
-
-            paints[1] = (borders.length > 1) ?
-                borders[1].convert(font) : paints[0];
-
-            paints[2] = (borders.length > 2) ?
-                borders[2].convert(font) : paints[0];
-
-            paints[3] = (borders.length > 3) ?
-                borders[3].convert(font) : paints[1];
-
-            return paints;
-        }
-
-        @Override
-        public String toString() {
-            return "BorderPaintType";
-        }
-    }
-
-}
--- a/javafx-ui-common/src/com/sun/javafx/scene/layout/region/StrokeBorderConverter.java	Tue Sep 11 20:35:27 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.sun.javafx.scene.layout.region;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import javafx.geometry.Insets;
-import javafx.scene.paint.Paint;
-
-import com.sun.javafx.css.StyleConverter;
-import com.sun.javafx.css.StyleableProperty;
-import com.sun.javafx.css.ParsedValue;
-
-public final class StrokeBorderConverter extends StyleConverter<ParsedValue[], List<StrokeBorder>> {
-
-    private static class Holder {
-        private static final StrokeBorderConverter STROKE_BORDER_CONVERTER =
-            new StrokeBorderConverter();
-    }
-
-    public static StrokeBorderConverter getInstance() {
-        return Holder.STROKE_BORDER_CONVERTER;
-    }
-
-    private StrokeBorderConverter() {
-        super();
-    }
-
-    @Override
-    public List<StrokeBorder> convert(Map<StyleableProperty, Object> convertedValues) {
-        Paint[][] borderColor = null;
-        BorderStyle[][] borderStyle = null;
-        Margins[] borderWidth = null;
-        Margins[] borderRadii = null;
-        Insets[] borderInsets = null;
-        List<StyleableProperty> styleables = StrokeBorder.impl_CSS_STYLEABLES();
-        for (int k = 0; k < styleables.size(); k++) {
-            StyleableProperty styleable = styleables.get(k);
-            Object value = convertedValues.get(styleable);
-            if (value == null) {
-                continue;
-                //System.out.println("StrokeBorderType.convert: styleable = " + styleable + ", value = " + value);
-            }
-            if ("-fx-border-color".equals(styleable.getProperty())) {
-                borderColor = (Paint[][]) value;
-            } else if ("-fx-border-style".equals(styleable.getProperty())) {
-                borderStyle = (BorderStyle[][]) value;
-            } else if ("-fx-border-width".equals(styleable.getProperty())) {
-                borderWidth = (Margins[]) value;
-            } else if ("-fx-border-radius".equals(styleable.getProperty())) {
-                borderRadii = (Margins[]) value;
-            } else if ("-fx-border-insets".equals(styleable.getProperty())) {
-                borderInsets = (Insets[]) value;
-            }
-        }
-        final int max = (borderColor != null) ? borderColor.length : 0;
-        List<StrokeBorder> strokeBorders = new ArrayList<StrokeBorder>();
-        for (int index = 0; index < max; index++) {
-            BorderStyle[] style = (borderStyle != null) ? borderStyle[Math.min(index, borderStyle.length - 1)] : null;
-            Margins widths = (borderWidth != null) ? borderWidth[Math.min(index, borderWidth.length - 1)] : null;
-            Margins radius = (borderRadii != null) ? borderRadii[Math.min(index, borderRadii.length - 1)] : null;
-            Insets offsets = (borderInsets != null) ? borderInsets[Math.min(index, borderInsets.length - 1)] : null;
-            StrokeBorder.Builder builder = new StrokeBorder.Builder();
-            builder.setTopFill(borderColor[index][0]).setRightFill(borderColor[index][1]).setBottomFill(borderColor[index][2]).setLeftFill(borderColor[index][3]);
-            if (widths != null) {
-                builder.setTopWidth(widths.getTop()).setRightWidth(widths.getRight()).setBottomWidth(widths.getBottom()).setLeftWidth(widths.getLeft()).setProportionalWidth(widths.isProportional());
-            }
-            if (radius != null) {
-                builder.setTopLeftCornerRadius(radius.getTop()).setTopRightCornerRadius(radius.getRight()).setBottomRightCornerRadius(radius.getBottom()).setBottomLeftCornerRadius(radius.getLeft()).setProportionalWidth(radius.isProportional());
-            }
-            if (offsets != null) {
-                builder.setOffsets(offsets);
-            }
-            if (style != null) {
-                builder.setTopStyle(style[0]).setRightStyle(style[1]).setBottomStyle(style[2]).setLeftStyle(style[3]);
-            }
-            strokeBorders.add(builder.build());
-        }
-        return strokeBorders;
-    }
-
-    @Override
-    public String toString() {
-        return "StrokeBorderType";
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/com/sun/javafx/scene/layout/region/StrokeBorderPaintConverter.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package com.sun.javafx.scene.layout.region;
+
+import javafx.scene.paint.Color;
+import javafx.scene.paint.Paint;
+import javafx.scene.text.Font;
+import com.sun.javafx.css.ParsedValue;
+import com.sun.javafx.css.StyleConverter;
+
+/**
+ */
+public class StrokeBorderPaintConverter extends StyleConverter<ParsedValue<?,Paint>[], Paint[]> {
+    /**
+     * Convert an array of border paint values to an array of Paint which
+     * contains one Paint element per border (top, right, bottom, left).
+     */
+    private static final StrokeBorderPaintConverter STROKE_BORDER_PAINT_CONVERTER =
+            new StrokeBorderPaintConverter();
+
+    public static StrokeBorderPaintConverter getInstance() {
+        return STROKE_BORDER_PAINT_CONVERTER;
+    }
+
+    // Prevent instantiation
+    private StrokeBorderPaintConverter() { }
+
+    @Override
+    public Paint[] convert(ParsedValue<ParsedValue<?,Paint>[], Paint[]> value, Font font) {
+        final ParsedValue<?,Paint>[] borders = value.getValue();
+        final Paint[] paints = new Paint[4];
+
+        paints[0] = (borders.length > 0) ?
+                borders[0].convert(font) : Color.BLACK;
+
+        paints[1] = (borders.length > 1) ?
+                borders[1].convert(font) : paints[0];
+
+        paints[2] = (borders.length > 2) ?
+                borders[2].convert(font) : paints[0];
+
+        paints[3] = (borders.length > 3) ?
+                borders[3].convert(font) : paints[1];
+
+        return paints;
+    }
+
+    @Override public String toString() {
+        return "StrokeBorderPaintConverter";
+    }
+}
--- a/javafx-ui-common/src/com/sun/javafx/scene/text/FontManager.java	Tue Sep 11 20:35:27 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.javafx.scene.text;
-
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.Properties;
-
-/**
- * Handles looking up embedded fonts, etc.
- * TODO needs to be rewritten with mobile in mind (they don't have Properties
- * class implementation)
- */
-public class FontManager {
-    private static FontManager instance;
-    
-    public static FontManager getInstance() {
-        if (instance == null) instance = new FontManager();
-        return instance;
-    }
-    
-    private Properties map = new Properties();
-    
-    private FontManager() {
-        loadEmbeddedFontDefinitions();
-    }
-    
-    void loadEmbeddedFontDefinitions() {
-        // locate the META-INF directory and search for a fonts.mf
-        // located there
-        URL u = FontManager.class.getResource("/META-INF/fonts.mf");
-        if (u == null) return;
-        
-        // read in the contents of the file
-        try {
-            InputStream in = u.openStream();
-            map.load(in);
-            in.close();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-    
-    /**
-     * Looks for an embedded font with the given full font name. If the font
-     * is embedded, then the relative path to the font is returned If the font
-     * is not embedded, then null is returned.
-     * 
-     * @param name
-     * @return
-     */
-    public String findPathByName(String name) {
-        return map.getProperty(name);
-    }
-
-    /**
-     * @return Gets all the embedded path names that lead to fonts.
-     */
-    public String[] getAllPaths() {
-        if (map.size() == 0) return new String[0];
-        
-        String[] paths = new String[map.size()];
-        Enumeration values = map.elements();
-        int index = 0;
-        while (values.hasMoreElements()) {
-            paths[index++] = (String)values.nextElement();
-        }
-        return paths;
-    }
-    
-    public String[] getAllNames() {
-        if (map.size() == 0) return new String[0];
-        
-        String[] names = new String[map.size()];
-        Enumeration keys = map.keys();
-        int index = 0;
-        while (keys.hasMoreElements()) {
-            names[index++] = (String)keys.nextElement();
-        }
-        return names;
-    }
-}
--- a/javafx-ui-common/src/com/sun/javafx/stage/FocusUngrabEvent.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/stage/FocusUngrabEvent.java	Tue Sep 11 20:39:23 2012 -0400
@@ -25,14 +25,13 @@
 
 package com.sun.javafx.stage;
 
-import com.sun.javafx.event.EventTypeUtil;
 import javafx.event.Event;
 import javafx.event.EventTarget;
 import javafx.event.EventType;
 
 public final class FocusUngrabEvent extends Event {
     public static final EventType<FocusUngrabEvent> FOCUS_UNGRAB =
-            EventTypeUtil.registerInternalEventType(Event.ANY, "FOCUS_UNGRAB");
+            new EventType<FocusUngrabEvent>(Event.ANY, "FOCUS_UNGRAB");
 
     public FocusUngrabEvent() {
         super(FOCUS_UNGRAB);
--- a/javafx-ui-common/src/com/sun/javafx/tk/TKStage.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/tk/TKStage.java	Tue Sep 11 20:39:23 2012 -0400
@@ -179,4 +179,28 @@
      * @see #grabFocus
      */
     public void ungrabFocus();
+
+    /**
+     * Requests text input in form of native keyboard for text component
+     * contained by this Window. Native text input component is drawn on the place
+     * of JavaFX component to cover it completely and to provide native text editing
+     * techniques. Any change of text is immediately reflected in JavaFX text component.
+     *
+     * @param text text to be shown in the native text input component
+     * @param type type of text input component @see com.sun.javafx.scene.control.behavior.TextInputTypes
+     * @param width width of JavaFX text input component
+     * @param height height of JavaFX text input component
+     * @param M standard transformation matrix for drawing the native text component derived from JavaFX component
+     */
+    void requestInput(String text, int type, double width, double height,
+                        double Mxx, double Mxy, double Mxz, double Mxt,
+                        double Myx, double Myy, double Myz, double Myt,
+                        double Mzx, double Mzy, double Mzz, double Mzt);
+
+    /**
+     * Native keyboard for text input is no longer necessary.
+     * Keyboard will be hidden and native text input component too.
+     */
+    void releaseInput();
+
 }
--- a/javafx-ui-common/src/com/sun/javafx/tk/Toolkit.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/com/sun/javafx/tk/Toolkit.java	Tue Sep 11 20:39:23 2012 -0400
@@ -151,25 +151,6 @@
                 return Boolean.getBoolean("javafx.verbose");
             }
         });
-
-        // This loading of msvcr100.dll (VS2010) is required when run with Java 6
-        // since it was build with VS2003 and doesn't include msvcr100.dll in it's JRE.
-        // Note: See README-builds.html on MSVC requirement: VS2010 is required.
-        if (PlatformUtil.isWindows()) {
-            AccessController.doPrivileged(new PrivilegedAction<Object>() {
-                public Object run() {
-                    try {
-                        com.sun.javafx.runtime.NativeLibLoader.loadLibrary("msvcr100");
-                    } catch (Throwable t) {
-			if (verbose) {
-                            System.err.println("Error: failed to load msvcr100.dll : " + t);
-                        }
-                    }
-                    return null;
-                }
-            });
-        }
-
         AccessController.doPrivileged(new PrivilegedAction<Object>() {
             public Object run() {
                 // Get the javafx.version and javafx.runtime.version from a preconstructed
--- a/javafx-ui-common/src/javafx/geometry/Insets.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/javafx/geometry/Insets.java	Tue Sep 11 20:39:23 2012 -0400
@@ -62,7 +62,7 @@
      * The cached hash code, used to improve performance in situations where
      * we cache gradients, such as in the CSS routines.
      */
-    int hash = 0;
+    private int hash = 0;
 
     /**
      * Constructs a new Insets instance with four different offsets.
@@ -121,7 +121,7 @@
             bits = 37L * bits + Double.doubleToLongBits(right);
             bits = 37L * bits + Double.doubleToLongBits(bottom);
             bits = 37L * bits + Double.doubleToLongBits(left);
-	    hash = (int) (bits ^ (bits >> 32));
+            hash = (int) (bits ^ (bits >> 32));
         }
         return hash;
     }
@@ -132,6 +132,6 @@
      */
     @Override public String toString() {
         return "Insets [top=" + top + ", right=" + right + ", bottom="
-                + bottom + ",left=" + left + "]";
+                + bottom + ", left=" + left + "]";
     }
 }
--- a/javafx-ui-common/src/javafx/scene/Parent.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/javafx/scene/Parent.java	Tue Sep 11 20:39:23 2012 -0400
@@ -59,6 +59,9 @@
 import com.sun.javafx.sg.PGNode;
 import com.sun.javafx.tk.Toolkit;
 
+import static com.sun.javafx.logging.PulseLogger.PULSE_LOGGING_ENABLED;
+import static com.sun.javafx.logging.PulseLogger.PULSE_LOGGER;
+
 /**
  * The base class for all nodes that have children in the scene graph.
  * <p>
@@ -994,6 +997,7 @@
      */
     public final void layout() {
         if (isNeedsLayout()) {
+            if (PULSE_LOGGING_ENABLED) PULSE_LOGGER.fxIncrementCounter("Parent#layout() on dirty Node");
             performingLayout = true;
 
             PlatformLogger logger = Logging.getLayoutLogger();
@@ -1015,6 +1019,8 @@
                 }
             }
             performingLayout = false;
+        } else {
+            if (PULSE_LOGGING_ENABLED) PULSE_LOGGER.fxIncrementCounter("Parent#layout() on clean Node");
         }
     }
 
--- a/javafx-ui-common/src/javafx/scene/Scene.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/javafx/scene/Scene.java	Tue Sep 11 20:39:23 2012 -0400
@@ -44,7 +44,6 @@
 import javafx.beans.Observable;
 import javafx.beans.property.ReadOnlyBooleanProperty;
 import javafx.beans.property.SimpleObjectProperty;
-import javafx.collections.FXCollections;
 import javafx.collections.ListChangeListener.Change;
 import javafx.collections.ObservableList;
 import javafx.collections.ObservableMap;
@@ -126,6 +125,8 @@
 import javafx.stage.StageStyle;
 import javafx.util.Callback;
 
+import static com.sun.javafx.logging.PulseLogger.PULSE_LOGGING_ENABLED;
+import static com.sun.javafx.logging.PulseLogger.PULSE_LOGGER;
 
 /**
  * The JavaFX {@code Scene} class is the container for all content in a scene graph.
@@ -2203,15 +2204,30 @@
                 PerformanceTracker.logEvent("Scene - first repaint");
             }
 
-            Scene.this.doCSSPass();
-            Scene.this.doLayoutPass();
+            if (PULSE_LOGGING_ENABLED) {
+                long start = System.currentTimeMillis();
+                Scene.this.doCSSPass();
+                PULSE_LOGGER.fxMessage(start, System.currentTimeMillis(), "CSS Pass");
+                
+                start = System.currentTimeMillis();
+                Scene.this.doLayoutPass();
+                PULSE_LOGGER.fxMessage(start, System.currentTimeMillis(), "Layout Pass");
+            } else {
+                Scene.this.doCSSPass();
+                Scene.this.doLayoutPass();
+            }
 
             boolean dirty = dirtyNodes == null || dirtyNodesSize != 0 || !isDirtyEmpty();
             if (dirty) {
                 getRoot().updateBounds();
                 if (impl_peer != null) {
                     try {
+                        long start = PULSE_LOGGING_ENABLED ? System.currentTimeMillis() : 0;
                         impl_peer.waitForSynchronization();
+                        if (PULSE_LOGGING_ENABLED) {
+                            PULSE_LOGGER.fxMessage(start, System.currentTimeMillis(), "Waiting for previous rendering");
+                        }
+                        start = PULSE_LOGGING_ENABLED ? System.currentTimeMillis() : 0;
                         // synchronize scene properties
                         synchronizeSceneProperties();
                         // Run the synchronizer
@@ -2219,13 +2235,21 @@
                         Scene.this.mouseHandler.pulse();
                         // Tell the scene peer that it needs to repaint
                         impl_peer.markDirty();
+                        if (PULSE_LOGGING_ENABLED) {
+                            PULSE_LOGGER.fxMessage(start, System.currentTimeMillis(), "Copy state to render graph");
+                        }
                     } finally {
                         impl_peer.releaseSynchronization();
                     }
                 } else {
+                    long start = PULSE_LOGGING_ENABLED ? System.currentTimeMillis() : 0;
                     synchronizeSceneProperties();
                     synchronizeSceneNodes();
                     Scene.this.mouseHandler.pulse();
+                    if (PULSE_LOGGING_ENABLED) {
+                        PULSE_LOGGER.fxMessage(start, System.currentTimeMillis(), "Synchronize with null peer");
+                    }
+
                 }
             }
 
--- a/javafx-ui-common/src/javafx/scene/doc-files/cssref.html	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/javafx/scene/doc-files/cssref.html	Tue Sep 11 20:39:23 2012 -0400
@@ -659,7 +659,7 @@
     <h3><a name="typesize" id="typesize">&lt;size&gt;</a></h3>
     <p>A size is a <a href="#typenumber" class="typeref">&lt;number&gt;</a>
       with units of <a href="#typelength" class="typeref">&lt;length&gt;</a> or
-      <a href="#typepercentage" class="typeref">&lt;percentage&gt;</a>If units
+      <a href="#typepercentage" class="typeref">&lt;percentage&gt;</a>. If units
       are not specified then specified the 'px' is assumed.</p>
     <h4><a name="typelength" id="typelength">&lt;length&gt;</a></h4>
     <p class="grammar"><a href="#typenumber">&lt;number&gt;</a>[ px | mm | cm |
@@ -877,10 +877,15 @@
     </table>
     <h3><a name="typepaint" id="typepaint">&lt;paint&gt;</a></h3>
     <p>Paint values can either be a solid color specified in one of the color
-      syntaxes or they can be a linear or radial gradient.</p>
+      syntaxes, they can be a linear or radial gradient, or an image-pattern.</p>
     <p class="grammar"><a href="#typecolor" class="typelink">&lt;color&gt;</a> |
-      &lt;linear-gradient&gt; | &lt;radial-gradient&gt;</p>
-    <h4>Linear Gradients <span class="grammar" style="font-size: smaller;">&lt;linear-gradient&gt;</span></h4>
+      <a href="#typelinear-gradient" class="typelink">&lt;linear-gradient&gt;</a> |
+      <a href="#typeradial-gradient" class="typelink">&lt;radial-gradient&gt;</a> |
+      <a href="#typeimage-pattern" class="typelink">&lt;image-pattern&gt;</a></p>
+      <a href="#typeimage-pattern" class="typelink">&lt;repeating-image-pattern&gt;</a></p>
+    <h4>Linear Gradients<span class="grammar" style="font-size: smaller;">
+            <a name="typelinear-gradient" id="typelinear-gradient">&lt;linear-gradient&gt;</a>
+        </span></h4>
     <p class="grammar">linear-gradient( [ [from <a href="#typepoint" class="typelink">&lt;point&gt;</a>
       to <a href="#typepoint" class="typelink">&lt;point&gt;</a>] | [ to
       &lt;side-or-corner&gt;], ]? [ [ repeat | reflect ], ]? <a href="#color-stop"
@@ -920,7 +925,9 @@
     <p class="grammar"><font color="#af0000">linear (&lt;size&gt;, &lt;size&gt;)
         to (&lt;size&gt;, &lt;size&gt;) stops [ (&lt;number&gt;,&lt;color&gt;)
         ]+ [ repeat | reflect ]?</font></p>
-    <h4>Radial Gradients <span class="grammar" style="font-size: smaller;">&lt;radial-gradient&gt;</span></h4>
+    <h4>Radial Gradients <span class="grammar" style="font-size: smaller;">
+            <a name="typeradial-gradient" id="typeradial-gradient">&lt;radial-gradient&gt;</a>
+        </span></h4>
     <p class="grammar">radial-gradient([ focus-angle <a href="#typeangle" class="typelink">&lt;angle&gt;</a>,
       ]? [ focus-distance <a href="#typepercentage" class="typelink">&lt;percentage&gt;</a>,
       ]? [ center <a href="#typepoint" class="typelink">&lt;point&gt;</a>, ]?
@@ -946,6 +953,49 @@
         | &lt;number&gt; ] ]? [ focus-distance &lt;size&gt; ]? [ center
         &lt;size,size&gt; ]? &lt;size&gt; stops [ ( &lt;number&gt;,
         &lt;color&gt; ) ]+ [ repeat | reflect ]?</font></p>
+    <h4>Image Paint <span class="grammar" style="font-size: smaller;">
+            <a name="typeimage-pattern" id="typeimage-pattern">&lt;image-pattern&gt;</a>
+        </span></h4>
+    <p class="grammar">image-pattern(<a href="#typestring" class="typelink">&lt;string&gt;</a>,
+      [<a href="#typesize" class="typelink">&lt;size&gt;</a>,
+      <a href="#typesize" class="typelink">&lt;size&gt;</a>,
+      <a href="#typesize" class="typelink">&lt;size&gt;</a>,
+      <a href="#typesize" class="typelink">&lt;size&gt;</a>[,
+      <a href="#typeboolean" class="typelink">&lt;boolean&gt;</a>]?]?)</p>
+    <p>The parameters, in order, are:<br>
+    <p style="margin-left: 40px;">  
+    <span class="grammar"><a href="#typestring" class="typelink">&lt;string&gt;</a></span>
+      The URL of the image.<br>
+      <span class="grammar"><a href="#typesize" class="typelink">&lt;size&gt;</a></span>
+      The <i>x</i> origin of the anchor rectangle.<br>
+      <span class="grammar"><a href="#typesize" class="typelink">&lt;size&gt;</a></span>
+      The <i>y</i> origin of the anchor rectangle.<br>
+      <span class="grammar"><a href="#typesize" class="typelink">&lt;size&gt;</a></span>
+      The width of the anchor rectangle.<br>
+      <span class="grammar"><a href="#typesize" class="typelink">&lt;size&gt;</a></span>
+      The height of the anchor rectangle.<br>
+      <span class="grammar"><a href="#typeboolean" class="typelink">&lt;boolean&gt;</a></span>
+      The proportional flag which indicates whether start and end locations are proportional or absolute<br>
+    </p>
+    <p>For a full explanation of the parameters, refer to the 
+        <a href="../paint/ImagePattern.html" class="typelink">ImagePattern</a> javadoc.</p>    
+    <p>Following are examples of the use of image-pattern:</p>
+    <p class="example">image-pattern("images/Duke.png")</p>
+    <p class="example">image-pattern("images/Duke.png", 20%, 20%, 80%, 80%)</p>
+    <p class="example">image-pattern("images/Duke.png", 20%, 20%, 80%, 80%, true)</p>
+    <p class="example">image-pattern("images/Duke.png", 20, 20, 80, 80, false)</p>
+
+    <p>Related, there is the <code>repeating-image-pattern</code> function which is a shorthand
+    for producing tiled image based fills. It is equivalent to
+    <p class="example">image-pattern("images/Duke.png", 0, 0, imageWidth, imageHeight, false)</p>
+    </p>
+
+    <p class="grammar">repeating-image-pattern(<a href="#typestring" class="typelink">&lt;string&gt;</a>)</p>
+    <p>The only parameter is the uri of the image. Following is an example of the use of image-pattern:</p>
+    <p class="example">repeating-image-pattern("com/mycompany/myapp/images/Duke.png")</p>
+
+
+
     <h3><a name="typecolor" id="typecolor">&lt;color&gt;</a></h3>
     <p class="grammar">&lt;named-color&gt; | &lt;looked-up-color&gt; |
       &lt;rgb-color&gt; | &lt;hsb-color&gt; | &lt;color-function&gt;</p>
@@ -2480,8 +2530,8 @@
                 class="typelink">&lt;size&gt;</a>
               <a href="#typesize" class="typelink">&lt;size&gt;</a> ] fill? [ ,
               [ <a href="#typesize" class="typelink">&lt;size&gt;</a> | <a href="#typesize"
-                class="typelink">&lt;size&gt;</a><a
-                <a=""
+                class="typelink">&lt;size&gt;</a>
+                <a
                 href="#typesize"
                 class="typelink">&lt;size&gt;</a>
               <a href="#typesize" class="typelink">&lt;size&gt;</a> <a href="#typesize"
@@ -5367,5 +5417,6 @@
         rights reserved. Use is subject to <a href="http://download.oracle.com/javafx/2.0/api/license.html">license
           terms</a>. </small> </p>
     <br>
+    </table>
   </body>
 </html>
--- a/javafx-ui-common/src/javafx/scene/input/ContextMenuEvent.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/javafx/scene/input/ContextMenuEvent.java	Tue Sep 11 20:39:23 2012 -0400
@@ -26,7 +26,6 @@
 
 package javafx.scene.input;
 
-import com.sun.javafx.event.EventTypeUtil;
 import com.sun.javafx.scene.input.InputEventUtils;
 import java.io.IOException;
 import javafx.event.Event;
@@ -53,7 +52,7 @@
      * This event occurs when a context menu is requested.
      */
     public static final EventType<ContextMenuEvent> CONTEXT_MENU_REQUESTED =
-            EventTypeUtil.registerInternalEventType(ContextMenuEvent.ANY, "CONTEXT_MENU_REQUESTED");
+            new EventType<ContextMenuEvent>(ContextMenuEvent.ANY, "CONTEXT_MENU_REQUESTED");
 
     private ContextMenuEvent(final EventType<? extends ContextMenuEvent> eventType) {
         super(eventType);
--- a/javafx-ui-common/src/javafx/scene/input/DragEvent.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/javafx/scene/input/DragEvent.java	Tue Sep 11 20:39:23 2012 -0400
@@ -24,7 +24,6 @@
  */
 package javafx.scene.input;
 
-import com.sun.javafx.event.EventTypeUtil;
 import java.util.EnumSet;
 import java.util.Set;
 
@@ -205,7 +204,7 @@
      * Common supertype for all drag event types.
      */
     public static final EventType<DragEvent> ANY =
-            EventTypeUtil.registerInternalEventType(InputEvent.ANY, "DRAG");
+            new EventType<DragEvent>(InputEvent.ANY, "DRAG");
 
     /**
      * This event occurs when drag gesture enters a node. It's the
@@ -218,7 +217,7 @@
      * which is similar
      */
     public static final EventType<DragEvent> DRAG_ENTERED_TARGET =
-            EventTypeUtil.registerInternalEventType(DragEvent.ANY, "DRAG_ENTERED_TARGET");
+            new EventType<DragEvent>(DragEvent.ANY, "DRAG_ENTERED_TARGET");
 
     /**
      * This event occurs when drag gesture enters a node.
@@ -230,7 +229,7 @@
      * which is similar
      */
     public static final EventType<DragEvent> DRAG_ENTERED =
-            EventTypeUtil.registerInternalEventType(DragEvent.DRAG_ENTERED_TARGET, "DRAG_ENTERED");
+            new EventType<DragEvent>(DragEvent.DRAG_ENTERED_TARGET, "DRAG_ENTERED");
 
     /**
      * This event occurs when drag gesture exits a node. It's the
@@ -243,7 +242,7 @@
      * which is similar
      */
     public static final EventType<DragEvent> DRAG_EXITED_TARGET =
-            EventTypeUtil.registerInternalEventType(DragEvent.ANY, "DRAG_EXITED_TARGET");
+            new EventType<DragEvent>(DragEvent.ANY, "DRAG_EXITED_TARGET");
 
     /**
      * This event occurs when drag gesture exits a node.
@@ -255,13 +254,13 @@
      * which is similar
      */
     public static final EventType<DragEvent> DRAG_EXITED =
-            EventTypeUtil.registerInternalEventType(DragEvent.DRAG_EXITED_TARGET, "DRAG_EXITED");
+            new EventType<DragEvent>(DragEvent.DRAG_EXITED_TARGET, "DRAG_EXITED");
 
     /**
      * This event occurs when drag gesture progresses within this node.
      */
     public static final EventType<DragEvent> DRAG_OVER =
-            EventTypeUtil.registerInternalEventType(DragEvent.ANY, "DRAG_OVER");
+            new EventType<DragEvent>(DragEvent.ANY, "DRAG_OVER");
 
     // Do we want DRAG_TRANSFER_MODE_CHANGED event?
 //    /**
@@ -280,7 +279,7 @@
      * in handler of this event.
      */
     public static final EventType<DragEvent> DRAG_DROPPED =
-            EventTypeUtil.registerInternalEventType(DragEvent.ANY, "DRAG_DROPPED");
+            new EventType<DragEvent>(DragEvent.ANY, "DRAG_DROPPED");
 
     /**
      * This event occurs on drag-and-drop gesture source after its data has
@@ -293,7 +292,7 @@
      * indicates that no data was transferred during the drag and drop gesture.
      */
     public static final EventType<DragEvent> DRAG_DONE =
-            EventTypeUtil.registerInternalEventType(DragEvent.ANY, "DRAG_DONE");
+            new EventType<DragEvent>(DragEvent.ANY, "DRAG_DONE");
 
     private DragEvent(final EventType<? extends DragEvent> eventType) {
         super(eventType);
--- a/javafx-ui-common/src/javafx/scene/input/GestureEvent.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/javafx/scene/input/GestureEvent.java	Tue Sep 11 20:39:23 2012 -0400
@@ -25,7 +25,6 @@
 
 package javafx.scene.input;
 
-import com.sun.javafx.event.EventTypeUtil;
 import com.sun.javafx.scene.input.InputEventUtils;
 import com.sun.javafx.tk.Toolkit;
 import java.io.IOException;
@@ -51,7 +50,7 @@
      * Common supertype for all gestures.
      */
     public static final EventType<GestureEvent> ANY =
-            EventTypeUtil.registerInternalEventType(InputEvent.ANY, "GESTURE");
+            new EventType<GestureEvent>(InputEvent.ANY, "GESTURE");
 
     /**
      * Creates a new instance of {@code GestureEvent}.
--- a/javafx-ui-common/src/javafx/scene/input/InputEvent.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/javafx/scene/input/InputEvent.java	Tue Sep 11 20:39:23 2012 -0400
@@ -24,7 +24,6 @@
  */
 package javafx.scene.input;
 
-import com.sun.javafx.event.EventTypeUtil;
 import javafx.event.Event;
 import javafx.event.EventTarget;
 import javafx.event.EventType;
@@ -38,7 +37,7 @@
      * Common supertype for all input event types.
      */
     public static final EventType<InputEvent> ANY =
-            EventTypeUtil.registerInternalEventType(Event.ANY, "INPUT");
+            new EventType<InputEvent> (Event.ANY, "INPUT");
 
     /**
      * Creates new instance of InputEvent.
--- a/javafx-ui-common/src/javafx/scene/input/InputMethodEvent.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/javafx/scene/input/InputMethodEvent.java	Tue Sep 11 20:39:23 2012 -0400
@@ -25,7 +25,6 @@
 
 package javafx.scene.input;
 
-import com.sun.javafx.event.EventTypeUtil;
 import javafx.collections.FXCollections;
 import javafx.collections.ObservableList;
 import javafx.event.EventTarget;
@@ -53,7 +52,7 @@
      * The only valid EventType for the InputMethodEvent.
      */
     public static final EventType<InputMethodEvent> INPUT_METHOD_TEXT_CHANGED =
-            EventTypeUtil.registerInternalEventType(InputEvent.ANY, "INPUT_METHOD_TEXT_CHANGED");
+            new EventType<InputMethodEvent>(InputEvent.ANY, "INPUT_METHOD_TEXT_CHANGED");
 
     private InputMethodEvent(final EventType<? extends InputMethodEvent> eventType) {
         super(eventType);
--- a/javafx-ui-common/src/javafx/scene/input/KeyEvent.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/javafx/scene/input/KeyEvent.java	Tue Sep 11 20:39:23 2012 -0400
@@ -26,7 +26,6 @@
 
 package javafx.scene.input;
 
-import com.sun.javafx.event.EventTypeUtil;
 import com.sun.javafx.tk.Toolkit;
 import javafx.event.EventTarget;
 import javafx.event.EventType;
@@ -86,19 +85,19 @@
      * Common supertype for all key event types.
      */
     public static final EventType<KeyEvent> ANY =
-            EventTypeUtil.registerInternalEventType(InputEvent.ANY, "KEY");
+            new EventType<KeyEvent>(InputEvent.ANY, "KEY");
 
     /**
      * This event occurs when a key has been pressed.
      */
     public static final EventType<KeyEvent> KEY_PRESSED =
-            EventTypeUtil.registerInternalEventType(KeyEvent.ANY, "KEY_PRESSED");
+            new EventType<KeyEvent>(KeyEvent.ANY, "KEY_PRESSED");
 
     /**
      * This event occurs when a key has been released.
      */
     public static final EventType<KeyEvent> KEY_RELEASED =
-            EventTypeUtil.registerInternalEventType(KeyEvent.ANY, "KEY_RELEASED");
+            new EventType<KeyEvent>(KeyEvent.ANY, "KEY_RELEASED");
 
     /**
      * This event occurs when a key has been typed (pressed and released).
@@ -106,7 +105,7 @@
      * string, the {@code code} and {@code text} fields are not used.
      */
     public static final EventType<KeyEvent> KEY_TYPED =
-            EventTypeUtil.registerInternalEventType(KeyEvent.ANY, "KEY_TYPED");
+            new EventType<KeyEvent>(KeyEvent.ANY, "KEY_TYPED");
 
     private KeyEvent(final EventType<? extends KeyEvent> eventType) {
         super(eventType);
--- a/javafx-ui-common/src/javafx/scene/input/MouseDragEvent.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/javafx/scene/input/MouseDragEvent.java	Tue Sep 11 20:39:23 2012 -0400
@@ -24,7 +24,6 @@
  */
 package javafx.scene.input;
 
-import com.sun.javafx.event.EventTypeUtil;
 import javafx.event.EventTarget;
 import javafx.event.EventType;
 
@@ -59,20 +58,20 @@
      * Common supertype for all mouse event types.
      */
     public static final EventType<MouseDragEvent> ANY =
-            EventTypeUtil.registerInternalEventType(MouseEvent.ANY, "MOUSE-DRAG");
+            new EventType<MouseDragEvent>(MouseEvent.ANY, "MOUSE-DRAG");
 
     /**
      * This event occurs when the gesture progresses within this node.
      */
     public static final EventType<MouseDragEvent> MOUSE_DRAG_OVER =
-            EventTypeUtil.registerInternalEventType(MouseDragEvent.ANY, "MOUSE-DRAG_OVER");
+            new EventType<MouseDragEvent>(MouseDragEvent.ANY, "MOUSE-DRAG_OVER");
 
     /**
      * This event occurs when the gesture ends (by releasing mouse button)
      * on this node.
      */
     public static final EventType<MouseDragEvent> MOUSE_DRAG_RELEASED =
-            EventTypeUtil.registerInternalEventType(MouseDragEvent.ANY, "MOUSE-DRAG_RELEASED");
+            new EventType<MouseDragEvent>(MouseDragEvent.ANY, "MOUSE-DRAG_RELEASED");
 
     /**
      * This event occurs when the gesture enters a node. It's the bubbling variant,
@@ -85,7 +84,7 @@
      * which is similar
      */
     public static final EventType<MouseDragEvent> MOUSE_DRAG_ENTERED_TARGET =
-            EventTypeUtil.registerInternalEventType(MouseDragEvent.ANY, "MOUSE-DRAG_ENTERED_TARGET");
+            new EventType<MouseDragEvent>(MouseDragEvent.ANY, "MOUSE-DRAG_ENTERED_TARGET");
 
     /**
      * This event occurs when the gesture enters a node. This event type is
@@ -96,7 +95,7 @@
      * which is similar
      */
     public static final EventType<MouseDragEvent> MOUSE_DRAG_ENTERED =
-            EventTypeUtil.registerInternalEventType(MouseDragEvent.MOUSE_DRAG_ENTERED_TARGET,
+            new EventType<MouseDragEvent>(MouseDragEvent.MOUSE_DRAG_ENTERED_TARGET,
                     "MOUSE-DRAG_ENTERED");
 
     /**
@@ -110,7 +109,7 @@
      * which is similar
      */
     public static final EventType<MouseDragEvent> MOUSE_DRAG_EXITED_TARGET =
-            EventTypeUtil.registerInternalEventType(MouseDragEvent.ANY, "MOUSE-DRAG_EXITED_TARGET");
+            new EventType<MouseDragEvent>(MouseDragEvent.ANY, "MOUSE-DRAG_EXITED_TARGET");
 
     /**
      * This event occurs when the gesture exits a node. This event type is
@@ -121,7 +120,7 @@
      * which is similar
      */
     public static final EventType<MouseDragEvent> MOUSE_DRAG_EXITED =
-            EventTypeUtil.registerInternalEventType(MouseDragEvent.MOUSE_DRAG_EXITED_TARGET,
+            new EventType<MouseDragEvent>(MouseDragEvent.MOUSE_DRAG_EXITED_TARGET,
                     "MOUSE-DRAG_EXITED");
 
     private MouseDragEvent(Object source, EventTarget target,
--- a/javafx-ui-common/src/javafx/scene/input/MouseEvent.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/javafx/scene/input/MouseEvent.java	Tue Sep 11 20:39:23 2012 -0400
@@ -26,7 +26,6 @@
 
 package javafx.scene.input;
 
-import com.sun.javafx.event.EventTypeUtil;
 import com.sun.javafx.tk.Toolkit;
 import javafx.event.Event;
 import javafx.event.EventTarget;
@@ -133,7 +132,7 @@
      * Common supertype for all mouse event types.
      */
     public static final EventType<MouseEvent> ANY =
-            EventTypeUtil.registerInternalEventType(InputEvent.ANY, "MOUSE");
+            new EventType<MouseEvent>(InputEvent.ANY, "MOUSE");
 
     /**
      * This event occurs when mouse button is pressed. This activates a
@@ -141,7 +140,7 @@
      * the button is released are delivered to the same node.
      */
     public static final EventType<MouseEvent> MOUSE_PRESSED =
-            EventTypeUtil.registerInternalEventType(MouseEvent.ANY, "MOUSE_PRESSED");
+            new EventType<MouseEvent>(MouseEvent.ANY, "MOUSE_PRESSED");
 
     /**
      * This event occurs when mouse button is released. It is delivered
@@ -149,7 +148,7 @@
      * a press-drag-release gesture.
      */
     public static final EventType<MouseEvent> MOUSE_RELEASED =
-            EventTypeUtil.registerInternalEventType(MouseEvent.ANY, "MOUSE_RELEASED");
+            new EventType<MouseEvent>(MouseEvent.ANY, "MOUSE_RELEASED");
 
     /**
      * This event occurs when mouse button has been clicked (pressed and
@@ -159,7 +158,7 @@
      * pressed and released).
      */
     public static final EventType<MouseEvent> MOUSE_CLICKED =
-            EventTypeUtil.registerInternalEventType(MouseEvent.ANY, "MOUSE_CLICKED");
+            new EventType<MouseEvent>(MouseEvent.ANY, "MOUSE_CLICKED");
 
     /**
      * This event occurs when mouse enters a node. It's the bubbling variant,
@@ -171,7 +170,7 @@
      * @see MouseEvent MouseEvent for more information about mouse entered/exited handling
      */
     public static final EventType<MouseEvent> MOUSE_ENTERED_TARGET =
-            EventTypeUtil.registerInternalEventType(MouseEvent.ANY, "MOUSE_ENTERED_TARGET");
+            new EventType<MouseEvent>(MouseEvent.ANY, "MOUSE_ENTERED_TARGET");
 
     /**
      * This event occurs when mouse enters a node. This event type is delivered
@@ -181,7 +180,7 @@
      * @see MouseEvent MouseEvent for more information about mouse entered/exited handling
      */
     public static final EventType<MouseEvent> MOUSE_ENTERED =
-            EventTypeUtil.registerInternalEventType(MouseEvent.MOUSE_ENTERED_TARGET, "MOUSE_ENTERED");
+            new EventType<MouseEvent>(MouseEvent.MOUSE_ENTERED_TARGET, "MOUSE_ENTERED");
 
     /**
      * This event occurs when mouse exits a node. It's the bubbling variant,
@@ -193,7 +192,7 @@
      * @see MouseEvent MouseEvent for more information about mouse entered/exited handling
      */
     public static final EventType<MouseEvent> MOUSE_EXITED_TARGET =
-            EventTypeUtil.registerInternalEventType(MouseEvent.ANY, "MOUSE_EXITED_TARGET");
+            new EventType<MouseEvent>(MouseEvent.ANY, "MOUSE_EXITED_TARGET");
 
     /**
      * This event occurs when mouse exits a node. This event type is delivered
@@ -203,7 +202,7 @@
      * @see MouseEvent MouseEvent for more information about mouse entered/exited handling
      */
     public static final EventType<MouseEvent> MOUSE_EXITED =
-            EventTypeUtil.registerInternalEventType(MouseEvent.MOUSE_EXITED_TARGET, "MOUSE_EXITED");
+            new EventType<MouseEvent>(MouseEvent.MOUSE_EXITED_TARGET, "MOUSE_EXITED");
 
     /**
      * This event occurs when mouse moves within a node and no buttons
@@ -211,7 +210,7 @@
      * occurs instead.
      */
     public static final EventType<MouseEvent> MOUSE_MOVED =
-            EventTypeUtil.registerInternalEventType(MouseEvent.ANY, "MOUSE_MOVED");
+            new EventType<MouseEvent>(MouseEvent.ANY, "MOUSE_MOVED");
 
     /**
      * This event occurs when mouse moves with a pressed button.
@@ -220,7 +219,7 @@
      * regardless of the mouse being within bounds of the node.
      */
     public static final EventType<MouseEvent> MOUSE_DRAGGED =
-            EventTypeUtil.registerInternalEventType(MouseEvent.ANY, "MOUSE_DRAGGED");
+            new EventType<MouseEvent>(MouseEvent.ANY, "MOUSE_DRAGGED");
 
     /**
      * This event is delivered to a node that is identified as a source of a
@@ -240,7 +239,7 @@
      * @see DragEvent DragEvent for more details about drag and drop gestures
      */
     public static final EventType<MouseEvent> DRAG_DETECTED =
-            EventTypeUtil.registerInternalEventType(MouseEvent.ANY, "DRAG_DETECTED");
+            new EventType<MouseEvent>(MouseEvent.ANY, "DRAG_DETECTED");
 
     MouseEvent(final EventType<? extends MouseEvent> eventType) {
         super(eventType);
--- a/javafx-ui-common/src/javafx/scene/input/RotateEvent.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/javafx/scene/input/RotateEvent.java	Tue Sep 11 20:39:23 2012 -0400
@@ -25,7 +25,6 @@
 
 package javafx.scene.input;
 
-import com.sun.javafx.event.EventTypeUtil;
 import javafx.event.EventTarget;
 import javafx.event.EventType;
 
@@ -63,26 +62,26 @@
      * Common supertype for all rotate event types.
      */
     public static final EventType<RotateEvent> ANY =
-            EventTypeUtil.registerInternalEventType(GestureEvent.ANY, "ANY_ROTATE");
+            new EventType<RotateEvent>(GestureEvent.ANY, "ANY_ROTATE");
 
     /**
      * This event occurs when user performs a rotating gesture such as
      * dragging two fingers around each other.
      */
     public static final EventType<RotateEvent> ROTATE =
-            EventTypeUtil.registerInternalEventType(RotateEvent.ANY, "ROTATE");
+            new EventType<RotateEvent>(RotateEvent.ANY, "ROTATE");
 
     /**
      * This event occurs when a rotating gesture is detected.
      */
     public static final EventType<RotateEvent> ROTATION_STARTED =
-            EventTypeUtil.registerInternalEventType(RotateEvent.ANY, "ROTATION_STARTED");
+            new EventType<RotateEvent>(RotateEvent.ANY, "ROTATION_STARTED");
 
     /**
      * This event occurs when a rotating gesture ends.
      */
     public static final EventType<RotateEvent> ROTATION_FINISHED =
-            EventTypeUtil.registerInternalEventType(RotateEvent.ANY, "ROTATION_FINISHED");
+            new EventType<RotateEvent>(RotateEvent.ANY, "ROTATION_FINISHED");
 
     private RotateEvent(final EventType<? extends RotateEvent> eventType) {
         super(eventType);
--- a/javafx-ui-common/src/javafx/scene/input/ScrollEvent.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/javafx/scene/input/ScrollEvent.java	Tue Sep 11 20:39:23 2012 -0400
@@ -24,7 +24,6 @@
  */
 package javafx.scene.input;
 
-import com.sun.javafx.event.EventTypeUtil;
 import javafx.event.EventTarget;
 import javafx.event.EventType;
 
@@ -103,28 +102,28 @@
      * Common supertype for all scroll event types.
      */
     public static final EventType<ScrollEvent> ANY =
-            EventTypeUtil.registerInternalEventType(GestureEvent.ANY, "ANY_SCROLL");
+            new EventType<ScrollEvent> (GestureEvent.ANY, "ANY_SCROLL");
 
     /**
      * This event occurs when user performs a scrolling action such as
      * rotating mouse wheel or dragging a finger over touch screen.
      */
     public static final EventType<ScrollEvent> SCROLL =
-            EventTypeUtil.registerInternalEventType(ScrollEvent.ANY, "SCROLL");
+            new EventType<ScrollEvent> (ScrollEvent.ANY, "SCROLL");
 
     /**
      * This event occurs when a scrolling gesture is detected. It doesn't
      * occur for mouse wheel scrolling.
      */
     public static final EventType<ScrollEvent> SCROLL_STARTED =
-            EventTypeUtil.registerInternalEventType(ScrollEvent.ANY, "SCROLL_STARTED");
+            new EventType<ScrollEvent> (ScrollEvent.ANY, "SCROLL_STARTED");
 
     /**
      * This event occurs when a scrolling gesture ends. It doesn't
      * occur for mouse wheel scrolling.
      */
     public static final EventType<ScrollEvent> SCROLL_FINISHED =
-            EventTypeUtil.registerInternalEventType(ScrollEvent.ANY, "SCROLL_FINISHED");
+            new EventType<ScrollEvent> (ScrollEvent.ANY, "SCROLL_FINISHED");
 
     
     private ScrollEvent(final EventType<? extends ScrollEvent> eventType) {
--- a/javafx-ui-common/src/javafx/scene/input/SwipeEvent.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/javafx/scene/input/SwipeEvent.java	Tue Sep 11 20:39:23 2012 -0400
@@ -24,7 +24,6 @@
  */
 package javafx.scene.input;
 
-import com.sun.javafx.event.EventTypeUtil;
 import javafx.event.EventTarget;
 import javafx.event.EventType;
 
@@ -62,31 +61,31 @@
      * Common supertype for all swipe event types.
      */
     public static final EventType<SwipeEvent> ANY =
-            EventTypeUtil.registerInternalEventType(GestureEvent.ANY, "ANY_SWIPE");
+            new EventType<SwipeEvent>(GestureEvent.ANY, "ANY_SWIPE");
 
     /**
      * This event occurs when user performs leftward swipe gesture.
      */
     public static final EventType<SwipeEvent> SWIPE_LEFT =
-            EventTypeUtil.registerInternalEventType(SwipeEvent.ANY, "SWIPE_LEFT");
+            new EventType<SwipeEvent>(SwipeEvent.ANY, "SWIPE_LEFT");
 
     /**
      * This event occurs when user performs rightward swipe gesture.
      */
     public static final EventType<SwipeEvent> SWIPE_RIGHT =
-            EventTypeUtil.registerInternalEventType(SwipeEvent.ANY, "SWIPE_RIGHT");
+            new EventType<SwipeEvent>(SwipeEvent.ANY, "SWIPE_RIGHT");
 
     /**
      * This event occurs when user performs upward swipe gesture.
      */
     public static final EventType<SwipeEvent> SWIPE_UP =
-            EventTypeUtil.registerInternalEventType(SwipeEvent.ANY, "SWIPE_UP");
+            new EventType<SwipeEvent>(SwipeEvent.ANY, "SWIPE_UP");
 
     /**
      * This event occurs when user performs downward swipe gesture.
      */
     public static final EventType<SwipeEvent> SWIPE_DOWN =
-            EventTypeUtil.registerInternalEventType(SwipeEvent.ANY, "SWIPE_DOWN");
+            new EventType<SwipeEvent>(SwipeEvent.ANY, "SWIPE_DOWN");
 
     private SwipeEvent(final EventType<? extends SwipeEvent> eventType) {
         super(eventType);
--- a/javafx-ui-common/src/javafx/scene/input/TouchEvent.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/javafx/scene/input/TouchEvent.java	Tue Sep 11 20:39:23 2012 -0400
@@ -26,7 +26,6 @@
 package javafx.scene.input;
 
 import com.sun.javafx.collections.annotations.ReturnsUnmodifiableCollection;
-import com.sun.javafx.event.EventTypeUtil;
 import java.util.Collections;
 import java.util.List;
 import javafx.event.Event;
@@ -63,33 +62,33 @@
      * Common supertype for all touch event types.
      */
     public static final EventType<TouchEvent> ANY =
-            EventTypeUtil.registerInternalEventType(InputEvent.ANY, "TOUCH");
+            new EventType<TouchEvent>(InputEvent.ANY, "TOUCH");
 
     /**
      * This event occurs when the touch point is pressed (touched for the
      * first time).
      */
     public static final EventType<TouchEvent> TOUCH_PRESSED =
-            EventTypeUtil.registerInternalEventType(ANY, "TOUCH_PRESSED");
+            new EventType<TouchEvent>(ANY, "TOUCH_PRESSED");
 
     /**
      * This event occurs when the touch point is moved.
      */
     public static final EventType<TouchEvent> TOUCH_MOVED =
-            EventTypeUtil.registerInternalEventType(ANY, "TOUCH_MOVED");
+            new EventType<TouchEvent>(ANY, "TOUCH_MOVED");
 
     /**
      * This event occurs when the touch point is released.
      */
     public static final EventType<TouchEvent> TOUCH_RELEASED =
-            EventTypeUtil.registerInternalEventType(ANY, "TOUCH_RELEASED");
+            new EventType<TouchEvent>(ANY, "TOUCH_RELEASED");
 
     /**
      * This event occurs when the touch point is pressed and still (doesn't
      * move).
      */
     public static final EventType<TouchEvent> TOUCH_STATIONARY =
-            EventTypeUtil.registerInternalEventType(ANY, "TOUCH_STATIONARY");
+            new EventType<TouchEvent>(ANY, "TOUCH_STATIONARY");
 
     private TouchEvent(EventType<? extends TouchEvent> eventType) {
         super(eventType);
--- a/javafx-ui-common/src/javafx/scene/input/ZoomEvent.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/javafx/scene/input/ZoomEvent.java	Tue Sep 11 20:39:23 2012 -0400
@@ -25,7 +25,6 @@
 
 package javafx.scene.input;
 
-import com.sun.javafx.event.EventTypeUtil;
 import javafx.event.EventTarget;
 import javafx.event.EventType;
 
@@ -63,26 +62,26 @@
      * Common supertype for all zoom event types.
      */
     public static final EventType<ZoomEvent> ANY =
-            EventTypeUtil.registerInternalEventType(GestureEvent.ANY, "ANY_ZOOM");
+            new EventType<ZoomEvent>(GestureEvent.ANY, "ANY_ZOOM");
 
     /**
      * This event occurs when user performs a zooming gesture such as
      * dragging two fingers apart.
      */
     public static final EventType<ZoomEvent> ZOOM =
-            EventTypeUtil.registerInternalEventType(ZoomEvent.ANY, "ZOOM");
+            new EventType<ZoomEvent>(ZoomEvent.ANY, "ZOOM");
 
     /**
      * This event occurs when a zooming gesture is detected.
      */
     public static final EventType<ZoomEvent> ZOOM_STARTED =
-            EventTypeUtil.registerInternalEventType(ZoomEvent.ANY, "ZOOM_STARTED");
+            new EventType<ZoomEvent>(ZoomEvent.ANY, "ZOOM_STARTED");
 
     /**
      * This event occurs when a zooming gesture ends.
      */
     public static final EventType<ZoomEvent> ZOOM_FINISHED =
-            EventTypeUtil.registerInternalEventType(ZoomEvent.ANY, "ZOOM_FINISHED");
+            new EventType<ZoomEvent>(ZoomEvent.ANY, "ZOOM_FINISHED");
 
     private ZoomEvent(final EventType<? extends ZoomEvent> eventType) {
         super(eventType);
--- a/javafx-ui-common/src/javafx/scene/layout/AnchorPane.java	Tue Sep 11 20:35:27 2012 -0400
+++ b/javafx-ui-common/src/javafx/scene/layout/AnchorPane.java	Tue Sep 11 20:39:23 2012 -0400
@@ -23,7 +23,6 @@
  * questions.
  */
 
-
 package javafx.scene.layout;
 
 import javafx.geometry.Bounds;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/javafx/scene/layout/Background.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,501 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javafx.scene.layout;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import javafx.geometry.Insets;
+import javafx.scene.Node;
+import javafx.scene.image.Image;
+import javafx.scene.paint.Color;
+import javafx.scene.paint.Paint;
+import com.sun.javafx.UnmodifiableArrayList;
+import com.sun.javafx.css.StyleableProperty;
+import com.sun.javafx.css.SubStyleableProperty;
+import com.sun.javafx.css.converters.InsetsConverter;
+import com.sun.javafx.css.converters.PaintConverter;
+import com.sun.javafx.css.converters.URLConverter;
+import com.sun.javafx.scene.layout.region.LayeredBackgroundPositionConverter;
+import com.sun.javafx.scene.layout.region.LayeredBackgroundSizeConverter;
+import com.sun.javafx.scene.layout.region.RepeatStruct;
+import com.sun.javafx.scene.layout.region.RepeatStructConverter;
+
+/**
+ * The Background of a {@link Region}. A Background is an immutable object which
+ * encapsulates the entire set of data required to render the background
+ * of a Region. Because this class is immutable, you can freely reuse the same
+ * Background on many different Regions. Please refer to
+ * {@link ../doc-files/cssref.html JavaFX CSS Reference} for a complete description
+ * of the CSS rules for styling the background of a Region.
+ * <p/>
+ * Every Background is comprised of {@link #getFills() fills} and / or
+ * {@link #getImages() images}. Neither list will ever be null, but either or
+ * both may be empty. Each defined {@link BackgroundFill} is rendered in order,
+ * followed by each defined {@link BackgroundImage}.
+ * <p/>
+ * The Background's {@link #getOutsets() outsets} define any extension of the drawing area of a Region
+ * which is necessary to account for all background drawing. These outsets are strictly
+ * defined by the BackgroundFills that are specified on this Background, if any, because
+ * all BackgroundImages are clipped to the drawing area, and do not define it. The
+ * outsets values are strictly non-negative.
+ *
+ * @since JavaFX 8
+ */
+public final class Background {
+    static final StyleableProperty<Node,Paint[]> BACKGROUND_COLOR =
+            new SubStyleableProperty<Paint[]>("-fx-background-color",
+                    PaintConverter.SequenceConverter.getInstance(),
+                    new Paint[] {Color.BLACK});
+
+    static final StyleableProperty<Node,Insets[]> BACKGROUND_RADIUS =
+            new SubStyleableProperty<Insets[]>("-fx-background-radius",
+                    InsetsConverter.SequenceConverter.getInstance(),
+                    new Insets[] {Insets.EMPTY});
+
+    static final StyleableProperty<Node,Insets[]> BACKGROUND_INSETS =
+            new SubStyleableProperty<Insets[]>("-fx-background-insets",
+                    InsetsConverter.SequenceConverter.getInstance(),
+                    new Insets[] {Insets.EMPTY});
+
+    static final StyleableProperty<Node,Image[]> BACKGROUND_IMAGE =
+            new SubStyleableProperty<Image[]>("-fx-background-image",
+                    URLConverter.SequenceConverter.getInstance());
+
+    static final StyleableProperty<Node,RepeatStruct[]> BACKGROUND_REPEAT =
+            new SubStyleableProperty<RepeatStruct[]>("-fx-background-repeat",
+                    RepeatStructConverter.getInstance(),
+                    new RepeatStruct[] {new RepeatStruct(BackgroundRepeat.REPEAT,
+                                                         BackgroundRepeat.REPEAT) });
+
+    static final StyleableProperty<Node,BackgroundPosition[]> BACKGROUND_POSITION =
+            new SubStyleableProperty<BackgroundPosition[]>("-fx-background-position",
+                    LayeredBackgroundPositionConverter.getInstance(),
+                    new BackgroundPosition[] { BackgroundPosition.DEFAULT });
+
+    static final StyleableProperty<Node,BackgroundSize[]> BACKGROUND_SIZE =
+            new SubStyleableProperty<BackgroundSize[]>("-fx-background-size",
+                    LayeredBackgroundSizeConverter.getInstance(),
+                    new BackgroundSize[] { BackgroundSize.DEFAULT } );
+
+    private static final List<StyleableProperty> STYLEABLES =
+            (List<StyleableProperty>) (List) Collections.unmodifiableList(
+                    Arrays.asList(BACKGROUND_COLOR,
+                            BACKGROUND_INSETS,
+                            BACKGROUND_RADIUS,
+                            BACKGROUND_IMAGE,
+                            BACKGROUND_REPEAT,
+                            BACKGROUND_POSITION,
+                            BACKGROUND_SIZE));
+
+    /**
+     * @treatAsPrivate implementation detail
+     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
+     */
+    @Deprecated public static List<StyleableProperty> impl_CSS_STYLEABLES() {
+        return STYLEABLES;
+    }
+
+    /**
+     * An empty Background, useful to use instead of null.
+     */
+    public static final Background EMPTY = new Background((BackgroundFill[])null, null);
+
+    /**
+     * The list of BackgroundFills which together define the filled portion
+     * of this Background. This List is unmodifiable and immutable. It
+     * will never be null. The elements of this list will also never be null.
+     */
+    final List<BackgroundFill> fills;
+    public final List<BackgroundFill> getFills() { return fills; }
+
+    /**
+     * The list of BackgroundImages which together define the image portion
+     * of this Background. This List is unmodifiable and immutable. It
+     * will never be null. The elements of this list will also never be null.
+     */
+    final List<BackgroundImage> images;
+    public final List<BackgroundImage> getImages() { return images; }
+
+    /**
+     * The outsets of this Background. This represents the largest
+     * bounding rectangle within which all drawing for the Background
+     * will take place. The outsets will never be negative, and represent
+     * the distance from the edge of the Region outward. Any BackgroundImages
+     * which would extend beyond the outsets will be clipped. Only the
+     * BackgroundFills contribute to the outsets.
+     */
+    final Insets outsets;
+    public final Insets getOutsets() { return outsets; }
+
+    /**
+     * Gets whether the background is empty. It is empty if there are no fills or images.
+     * @return true if the Background is empty, false otherwise.
+     */
+    public final boolean isEmpty() {
+        return fills.isEmpty() && images.isEmpty();
+    }
+
+    /**
+     * Specifies whether the Background has at least one opaque fill.
+     */
+    final boolean hasOpaqueFill;
+
+    /**
+     * Package-private immutable fields referring to the opaque insets
+     * of this Background.
+     */
+    private final double opaqueTop, opaqueRight, opaqueBottom, opaqueLeft;
+    final boolean hasPercentageBasedOpaqueInsets;
+
+    /**
+     * The cached hash code computation for the Background. One very big
+     * reason for making Background immutable was to make it possible to
+     * cache and reuse the same Background instance for multiple
+     * Regions (for example, every un-hovered Button should have the same
+     * Background instance). To enable efficient caching, we cache the hash.
+     */
+    private final int hash;
+
+    /**
+     * Create a new Background by supplying an array of BackgroundFills.
+     * This array may be null, or may contain null values. Any null values
+     * will be ignored and will not contribute to the {@link #getFills() fills}
+     * or {@link #getOutsets() outsets}.
+     *
+     * @param fills     The fills. This may be null, and may contain nulls. Any
+     *                  contained nulls are filtered out and not included in the
+     *                  final List of fills. A null array becomes an empty List.
+     */
+    public Background(final BackgroundFill... fills) {
+        this(fills, null);
+    }
+
+    /**
+     * Create a new Background by supplying an array of BackgroundImages.
+     * This array may be null, or may contain null values. Any null values will
+     * be ignored and will not contribute to the {@link #getImages() images}.
+     *
+     * @param images    The images. This may be null, and may contain nulls. Any
+     *                  contained nulls are filtered out and not included in the
+     *                  final List of images. A null array becomes an empty List.
+     */
+    public Background(final BackgroundImage... images) {
+        this(null, images);
+    }
+
+    /**
+     * Create a new Background supply two Lists, one for background fills and
+     * one for background images. Either list may be null, and may contain nulls.
+     * Any null values in these lists will be ignored and will not
+     * contribute to the {@link #getFills() fills}, {@link #getImages() images}, or
+     * {@link #getOutsets() outsets}.
+     *
+     * @param fills     The fills. This may be null, and may contain nulls. Any
+     *                  contained nulls are filtered out and not included in the
+     *                  final List of fills. A null List becomes an empty List.
+     * @param images    The images. This may be null, and may contain nulls. Any
+     *                  contained nulls are filtered out and not included in the
+     *                  final List of images. A null List becomes an empty List.
+     */
+    public Background(final List<BackgroundFill> fills, final List<BackgroundImage> images) {
+        // NOTE: This constructor had to be supplied in order to cause a Builder
+        // to be auto-generated, because otherwise the types of the fills and images
+        // properties didn't match the types of the array based constructor parameters.
+        // So a Builder will use this constructor, while the CSS engine uses the
+        // array based constructor (for speed).
+        this(fills == null ? null : fills.toArray(new BackgroundFill[fills.size()]),
+             images == null ? null : images.toArray(new BackgroundImage[images.size()]));
+    }
+
+    /**
+     * Create a new Background by supplying two arrays, one for background fills,
+     * and one for background images. Either array may be null, and may contain null
+     * values. Any null values in these arrays will be ignored and will not
+     * contribute to the {@link #getFills() fills}, {@link #getImages() images}, or
+     * {@link #getOutsets() outsets}.
+     *
+     * @param fills     The fills. This may be null, and may contain nulls. Any
+     *                  contained nulls are filtered out and not included in the
+     *                  final List of fills. A null array becomes an empty List.
+     * @param images    The images. This may be null, and may contain nulls. Any
+     *                  contained nulls are filtered out and not included in the
+     *                  final List of images. A null array becomes an empty List.
+     */
+    public Background(final BackgroundFill[] fills, final BackgroundImage[] images) {
+        // The cumulative insets
+        double outerTop = 0, outerRight = 0, outerBottom = 0, outerLeft = 0;
+        boolean hasPercentOpaqueInsets = false;
+        boolean opaqueFill = false;
+
+        // If the fills is empty or null then we know we can just use the shared
+        // immutable empty list from Collections.
+        if (fills == null || fills.length == 0) {
+            this.fills = Collections.emptyList();
+        } else {
+            // We need to iterate over all of the supplied elements in the fills array.
+            // Each null element is ignored. Each non-null element is inspected to
+            // see if it contributes to the outsets.
+            final BackgroundFill[] noNulls = new BackgroundFill[fills.length];
+            int size = 0;
+            for (int i=0; i<fills.length; i++) {
+                final BackgroundFill fill = fills[i];
+                if (fill != null) {
+                    noNulls[size++] = fill;
+                    final Insets fillInsets = fill.getInsets();
+                    final double fillTop = fillInsets.getTop();
+                    final double fillRight = fillInsets.getRight();
+                    final double fillBottom = fillInsets.getBottom();
+                    final double fillLeft = fillInsets.getLeft();
+                    outerTop = outerTop <= fillTop ? outerTop : fillTop; // min
+                    outerRight = outerRight <= fillRight ? outerRight : fillRight; // min
+                    outerBottom = outerBottom <= fillBottom ? outerBottom : fillBottom; // min
+                    outerLeft = outerLeft <= fillLeft ? outerLeft : fillLeft; // min
+
+                    if (fill.fill.isOpaque()) {
+                        opaqueFill = true;
+                        if (fill.getRadii().hasPercentBasedRadii) {
+                            hasPercentOpaqueInsets = true;
+                        }
+                    }
+                }
+            }
+            this.fills = new UnmodifiableArrayList<BackgroundFill>(noNulls, size);
+        }
+
+        hasOpaqueFill = opaqueFill;
+        if (hasPercentOpaqueInsets) {
+            opaqueTop = Double.NaN;
+            opaqueRight = Double.NaN;
+            opaqueBottom = Double.NaN;
+            opaqueLeft = Double.NaN;
+        } else {
+            double[] trbl = new double[4];
+            computeOpaqueInsets(1, 1, true, trbl);
+            opaqueTop = trbl[0];
+            opaqueRight = trbl[1];
+            opaqueBottom = trbl[2];
+            opaqueLeft = trbl[3];
+        }
+        hasPercentageBasedOpaqueInsets = hasPercentOpaqueInsets;
+
+        // This ensures that we either have outsets of 0, if all the insets were positive,
+        // or a value greater than zero if they were negative.
+        outsets = new Insets(
+                Math.max(0, -outerTop),
+                Math.max(0, -outerRight),
+                Math.max(0, -outerBottom),
+                Math.max(0, -outerLeft));
+
+        // An null or empty images array results in an empty list
+        if (images == null || images.length == 0) {
+            this.images = Collections.emptyList();
+        } else {
+            // Filter out any  null values and create an immutable array list
+            final BackgroundImage[] noNulls = new BackgroundImage[images.length];
+            int size = 0;
+            for (int i=0; i<images.length; i++) {
+                final BackgroundImage image = images[i];
+                if (image != null) noNulls[size++] = image;
+            }
+            this.images = new UnmodifiableArrayList<BackgroundImage>(noNulls, size);
+        }
+
+        // Pre-compute the hash code. NOTE: all variables are prefixed with "this" so that we
+        // do not accidentally compute the hash based on the constructor arguments rather than
+        // based on the fields themselves!
+        int result = this.fills.hashCode();
+        result = 31 * result + this.images.hashCode();
+        hash = result;
+    }
+
+    /**
+     * Computes the opaque insets for a region with the specified width and height. This call
+     * must be made whenever the width or height of the region change, because the opaque insets
+     * are based on background fills, and the corner radii of a background fill can be percentage
+     * based. Thus, we need to potentially recompute the opaque insets whenever the width or
+     * height of the region change. On the other hand, if there are no percentage based corner
+     * radii, then we can simply return the pre-computed and cached answers.
+     *
+     * @param width     The width of the region
+     * @param height    The height of the region
+     * @param trbl      A four-element array of doubles in order: top, right, bottom, left.
+     */
+    void computeOpaqueInsets(double width, double height, double[] trbl) {
+        computeOpaqueInsets(width, height, false, trbl);
+    }
+
+    /**
+     * Computes the opaque insets. The first time this is called from the constructor
+     * we want to take the long route through and compute everything, whether there are
+     * percentage based insets or not (the constructor ensures not to call it in the case
+     * that it has percentage based insets!). All other times, this is called by the other
+     * computeOpaqueInsets method with "firstTime" set to false, such that if we have
+     * percentage based insets, then we will bail early.
+     *
+     * @param width        The width of the region
+     * @param height       The height of the region
+     * @param firstTime    Whether this is being called from the constructor
+     * @param trbl         A four-element array of doubles in order: top, right, bottom, left.
+     */
+    private void computeOpaqueInsets(double width, double height, boolean firstTime, double[] trbl) {
+        // If during object construction we determined that there are no opaque
+        // fills, then we will simple return the "I don't know" answer for
+        // the opaque insets.
+        if (!hasOpaqueFill) {
+            trbl[0] = Double.NaN;
+            trbl[1] = Double.NaN;
+            trbl[2] = Double.NaN;
+            trbl[3] = Double.NaN;
+            return;
+        }
+
+        // If during construction time we determined that none of the fills had a percentage based
+        // opaque inset, then we can return the pre-computed values. This is worth doing since
+        // at this time all CSS based radii for BackgroundFills are literal values!
+        if (!firstTime && !hasPercentageBasedOpaqueInsets) {
+            trbl[0] = opaqueTop;
+            trbl[1] = opaqueRight;
+            trbl[2] = opaqueBottom;
+            trbl[3] = opaqueLeft;
+            return;
+        }
+
+        // NOTE: We know at this point that there is an opaque fill, and that at least one
+        // of them uses a percentage for at least one corner radius. Iterate over each
+        // BackgroundFill. If the fill is opaque, then we will compute the largest rectangle
+        // which will fit within its opaque area, taking the corner radii into account.
+        // Initialize them to the "I Don't Know" answer.
+        double opaqueRegionLeft = Double.NaN,
+                opaqueRegionTop = Double.NaN,
+                opaqueRegionRight = Double.NaN,
+                opaqueRegionBottom = Double.NaN;
+
+        for (int i=0, max=fills.size(); i<max; i++) {
+            final BackgroundFill fill = fills.get(i);
+            final Insets fillInsets = fill.getInsets();
+            final double fillTop = fillInsets.getTop();
+            final double fillRight = fillInsets.getRight();
+            final double fillBottom = fillInsets.getBottom();
+            final double fillLeft = fillInsets.getLeft();
+
+            if (fill.fill.isOpaque()) {
+                // Some possible configurations:
+                //     (a) rect1 is completely contained by rect2
+                //     (b) rect2 is completely contained by rect1
+                //     (c) rect1 is the same height as rect 2 and they overlap on the left or right
+                //     (d) rect1 is the same width as rect 2 and they overlap on the top or bottom
+                //     (e) they are disjoint or overlap in an unsupported manner.
+                final CornerRadii radii = fill.getRadii();
+                final double topLeftHorizontalRadius = radii.isTopLeftHorizontalRadiusAsPercentage() ?
+                        width * radii.getTopLeftHorizontalRadius() : radii.getTopLeftHorizontalRadius();
+                final double topLeftVerticalRadius = radii.isTopLeftVerticalRadiusAsPercentage() ?
+                        height * radii.getTopLeftVerticalRadius() : radii.getTopLeftVerticalRadius();
+                final double topRightVerticalRadius = radii.isTopRightVerticalRadiusAsPercentage() ?
+                        height * radii.getTopRightVerticalRadius() : radii.getTopRightVerticalRadius();
+                final double topRightHorizontalRadius = radii.isTopRightHorizontalRadiusAsPercentage() ?
+                        width * radii.getTopRightHorizontalRadius() : radii.getTopRightHorizontalRadius();
+                final double bottomRightHorizontalRadius = radii.isBottomRightHorizontalRadiusAsPercentage() ?
+                        width * radii.getBottomRightHorizontalRadius() : radii.getBottomRightHorizontalRadius();
+                final double bottomRightVerticalRadius = radii.isBottomRightVerticalRadiusAsPercentage() ?
+                        height * radii.getBottomRightVerticalRadius() : radii.getBottomRightVerticalRadius();
+                final double bottomLeftVerticalRadius = radii.isBottomLeftVerticalRadiusAsPercentage() ?
+                        height * radii.getBottomLeftVerticalRadius() : radii.getBottomLeftVerticalRadius();
+                final double bottomLeftHorizontalRadius = radii.isBottomLeftHorizontalRadiusAsPercentage() ?
+                        width * radii.getBottomLeftHorizontalRadius() : radii.getBottomLeftHorizontalRadius();
+
+                final double t = fillTop + (Math.max(topLeftVerticalRadius, topRightVerticalRadius) / 2);
+                final double r = fillRight + (Math.max(topRightHorizontalRadius, bottomRightHorizontalRadius) / 2);
+                final double b = fillBottom + (Math.max(bottomLeftVerticalRadius, bottomRightVerticalRadius) / 2);
+                final double l = fillLeft + (Math.max(topLeftHorizontalRadius, bottomLeftHorizontalRadius) / 2);
+                if (Double.isNaN(opaqueRegionTop)) {
+                    // This only happens for the first opaque fill we encounter
+                    opaqueRegionTop = t;
+                    opaqueRegionRight = r;
+                    opaqueRegionBottom = b;
+                    opaqueRegionLeft = l;
+                } else {
+                    final boolean largerTop = t >= opaqueRegionTop;
+                    final boolean largerRight = r >= opaqueRegionRight;
+                    final boolean largerBottom = b >= opaqueRegionBottom;
+                    final boolean largerLeft = l >= opaqueRegionLeft;
+                    if (largerTop && largerRight && largerBottom && largerLeft) {
+                        // The new fill is completely contained within the existing rect, so no change
+                        continue;
+                    } else if (!largerTop && !largerRight && !largerBottom && !largerLeft) {
+                        // The new fill completely contains the existing rect, so use these
+                        // new values for our opaque region
+                        opaqueRegionTop = fillTop;
+                        opaqueRegionRight = fillRight;
+                        opaqueRegionBottom = fillBottom;
+                        opaqueRegionLeft = fillLeft;
+                    } else if (l == opaqueRegionLeft && r == opaqueRegionRight) {
+                        // The left and right insets are the same between the two rects, so just pick
+                        // the smallest top and bottom
+                        opaqueRegionTop = Math.min(t, opaqueRegionTop);
+                        opaqueRegionBottom = Math.min(b, opaqueRegionBottom);
+                    } else if (t == opaqueRegionTop && b == opaqueRegionBottom) {
+                        // The top and bottom are the same between the two rects so just pick
+                        // the smallest left and right
+                        opaqueRegionLeft = Math.min(l, opaqueRegionLeft);
+                        opaqueRegionRight = Math.min(r, opaqueRegionRight);
+                    } else {
+                        // They are disjoint or overlap in some other manner. So we will just
+                        // ignore this region.
+                        continue;
+                    }
+                }
+            }
+        }
+
+        trbl[0] = opaqueRegionTop;
+        trbl[1] = opaqueRegionRight;
+        trbl[2] = opaqueRegionBottom;
+        trbl[3] = opaqueRegionLeft;
+    }
+
+    /**
+     * @inheritDoc
+     */
+    @Override public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        Background that = (Background) o;
+        // Because the hash is cached, this can be a very fast check
+        if (hash != that.hash) return false;
+        if (!fills.equals(that.fills)) return false;
+        if (!images.equals(that.images)) return false;
+
+        return true;
+    }
+
+    /**
+     * @inheritDoc
+     */
+    @Override public int hashCode() {
+        return hash;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/javafx/scene/layout/BackgroundConverter.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javafx.scene.layout;
+
+import java.util.Map;
+import javafx.geometry.Insets;
+import javafx.scene.image.Image;
+import javafx.scene.paint.Paint;
+import com.sun.javafx.css.ParsedValue;
+import com.sun.javafx.css.StyleConverter;
+import com.sun.javafx.css.StyleableProperty;
+import com.sun.javafx.scene.layout.region.RepeatStruct;
+
+/**
+ * Converts the CSS for -fx-background items into a Background.
+ */
+class BackgroundConverter extends StyleConverter<ParsedValue[], Background> {
+    static final BackgroundConverter INSTANCE = new BackgroundConverter();
+
+    @Override public Background convert(Map<StyleableProperty,Object> convertedValues) {
+        final Paint[] fills = (Paint[]) convertedValues.get(Background.BACKGROUND_COLOR);
+        final String[] imageUrls = (String[]) convertedValues.get(Background.BACKGROUND_IMAGE);
+        final boolean hasFills = fills != null && fills.length > 0;
+        final boolean hasImages = imageUrls != null && imageUrls.length > 0;
+
+        // If there are neither background fills nor images, then there is nothing for us to construct.
+        if (!hasFills && !hasImages) return null;
+
+        // Iterate over all of the fills, and create BackgroundFill objects for each.
+        BackgroundFill[] backgroundFills = null;
+        if (hasFills) {
+            backgroundFills = new BackgroundFill[fills.length];
+
+            Object tmp = convertedValues.get(Background.BACKGROUND_INSETS);
+            final Insets[] insets = tmp == null ? new Insets[0] : (Insets[]) tmp;
+
+            tmp = convertedValues.get(Background.BACKGROUND_RADIUS);
+            final Insets[] radii = tmp == null ? new Insets[0] : (Insets[]) tmp;
+
+            final int lastInsetsIndex = insets.length - 1;
+            final int lastRadiiIndex = radii.length - 1;
+            for (int i=0; i<fills.length; i++) {
+                Insets in = insets.length > 0 ? insets[i <= lastInsetsIndex ? i : lastInsetsIndex] : Insets.EMPTY;
+                CornerRadii ra = CornerRadii.EMPTY;
+                Insets rai = radii.length > 0 ? radii[i <= lastRadiiIndex ? i : lastRadiiIndex] : null;
+                if (rai != null && rai != Insets.EMPTY) {
+                    double top = rai.getTop();
+                    double right = rai.getRight();
+                    double bottom = rai.getBottom();
+                    double left = rai.getLeft();
+                    // TODO need to write a unit test for cases where top, right, bottom, left are < 0
+                    ra = new CornerRadii(
+                            top < 0 ? 0 : top,
+                            right < 0 ? 0 : right,
+                            bottom < 0 ? 0 : bottom,
+                            left < 0 ? 0 : left, false);
+                }
+                backgroundFills[i] = new BackgroundFill(fills[i], ra, in);
+            }
+        }
+
+        // Iterate over all of the image, and create BackgroundImage objects for each.
+        BackgroundImage[] backgroundImages = null;
+        if (hasImages) {
+            // TODO convert image urls into image objects!
+            backgroundImages = new BackgroundImage[imageUrls.length];
+
+            Object tmp = convertedValues.get(Background.BACKGROUND_REPEAT);
+            final RepeatStruct[] repeats = tmp == null ? new RepeatStruct[0] : (RepeatStruct[]) tmp;
+
+            tmp = convertedValues.get(Background.BACKGROUND_POSITION);
+            final BackgroundPosition[] positions = tmp == null ? new BackgroundPosition[0] : (BackgroundPosition[]) tmp;
+
+            tmp = convertedValues.get(Background.BACKGROUND_SIZE);
+            final BackgroundSize[] sizes = tmp == null ? new BackgroundSize[0] : (BackgroundSize[]) tmp;
+
+            final int lastRepeatIndex = repeats.length - 1;
+            final int lastPositionIndex = positions.length - 1;
+            final int lastSizeIndex = sizes.length - 1;
+            for (int i = 0; i < imageUrls.length; i++) {
+                // RT-21335: skip background and border images whose image url is null
+                if (imageUrls[i] == null) continue;
+
+                final Image image = new Image(imageUrls[i]);
+                final RepeatStruct repeat = (repeats.length > 0) ?
+                        repeats[i <= lastRepeatIndex ? i : lastRepeatIndex] : null; // min
+                final BackgroundPosition position = (positions.length > 0) ?
+                        positions[i <= lastPositionIndex ? i : lastPositionIndex] : null; // min
+                final BackgroundSize size = (sizes.length > 0) ?
+                        sizes[i <= lastSizeIndex ? i : lastSizeIndex] : null; // min
+                backgroundImages[i] = new BackgroundImage(image,
+                        repeat == null ? null : repeat.repeatX,
+                        repeat == null ? null : repeat.repeatY,
+                        position, size);
+            }
+        }
+
+        // Give the background fills and background images to a newly constructed BackgroundConverter,
+        // and return it.
+        return new Background(backgroundFills, backgroundImages);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/javafx/scene/layout/BackgroundFill.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,123 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javafx.scene.layout;
+
+import javafx.geometry.Insets;
+import javafx.scene.paint.Color;
+import javafx.scene.paint.Paint;
+
+/**
+ * The fill and associated properties that direct how to fill the background of a
+ * {@link Region}. Because BackgroundFill is an immutable object, it can safely be
+ * used in any cache, and can safely be reused among multiple Regions or multiple
+ * times in the same Region.
+ * <p/>
+ * All BackgroundFills are drawn in order.
+ * <p/>
+ * When applied to a Region with a defined shape, the corner radii are ignored.
+ */
+public final class BackgroundFill {
+    /**
+     * The Paint to use for filling the background of the {@link Region}.
+     * This value will never be null.
+     */
+    final Paint fill;
+    public final Paint getFill() { return fill; }
+
+    /**
+     * The Radii to use for representing the four radii of the
+     * BackgroundFill. Each corner can therefore be independently
+     * specified. This will never be null. The radii values will
+     * never be negative.
+     */
+    final CornerRadii radii;
+    public final CornerRadii getRadii() { return radii; }
+
+    /**
+     * The Insets to use for this fill. Each inset indicates at what
+     * distance from the Region's bounds the drawing should begin.
+     * The insets will never be null, but the values may be negative
+     * in order to position the border beyond the natural bounds
+     * (that is, (0, 0, width, height)) of the Region.
+     */
+    final Insets insets;
+    public final Insets getInsets() { return insets; }
+
+    /**
+     * A cached hash for improved performance on subsequent hash or
+     * equality look ups. It is expected that BackgroundFill will in
+     * many instances be loaded from a CSS cache, such that storing
+     * this value is beneficial.
+     */
+    private final int hash;
+
+    /**
+     * Creates a new BackgroundFill with the specified fill, radii, and
+     * insets. Null values are acceptable, but default values will be
+     * used in place of any null value.
+     *
+     * @param fill   Any Paint. If null, the value Color.TRANSPARENT is used.
+     * @param radii  The corner Radii. If null, the value Radii.EMPTY is used.
+     * @param insets The insets. If null, the value Insets.EMPTY is used.
+     */
+    public BackgroundFill(Paint fill, CornerRadii radii, Insets insets) {
+        // As per the CSS Spec (section 3.2): initial value of background-color is TRANSPARENT
+        this.fill = fill == null ? Color.TRANSPARENT : fill;
+        this.radii = radii == null ? CornerRadii.EMPTY : radii;
+        this.insets = insets == null ? Insets.EMPTY : insets;
+
+        // Pre-compute the hash code. NOTE: all variables are prefixed with "this" so that we
+        // do not accidentally compute the hash based on the constructor arguments rather than
+        // based on the fields themselves!
+        int result = this.fill.hashCode();
+        result = 31 * result + this.radii.hashCode();
+        result = 31 * result + this.insets.hashCode();
+        hash = result;
+    }
+
+    /**
+     * @inheritDoc
+     */
+    @Override public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        BackgroundFill that = (BackgroundFill) o;
+        // Because the hash is cached, this can be a very fast check
+        if (hash != that.hash) return false;
+        if (!fill.equals(that.fill)) return false;
+        if (!insets.equals(that.insets)) return false;
+        if (!radii.equals(that.radii)) return false;
+
+        return true;
+    }
+
+    /**
+     * @inheritDoc
+     */
+    @Override public int hashCode() {
+        return hash;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/javafx/scene/layout/BackgroundImage.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javafx.scene.layout;
+
+import javafx.scene.image.Image;
+
+/**
+ * Defines properties describing how to render an image as the background to
+ * some {@link Region}. A BackgroundImage must have an Image specified (it cannot be
+ * null). The {@link #getRepeatX() repeatX} and {@link #getRepeatY() repeatY}
+ * properties define how the image is to be repeated in each direction. The
+ * {@link #getPosition() position} property defines how to position the image on the
+ * Region while the {@link #getSize() size} property defines the size of the image
+ * on the Region. For example, the {@code size} might be defined with
+ * {@link javafx.scene.layout.BackgroundSize#isCover() cover = true}, meaning the image
+ * should be stretched to cover the entire rendering surface of the Region.
+ * <p/>
+ * Because the BackgroundImage is immutable, it can safely be used in any
+ * cache, and can safely be reused among multiple Regions.
+ */
+public final class BackgroundImage {
+
+    // TODO we need to attach a listener to the Image such that when the image loads
+    // we cause the Region to repaint (probably the Region itself needs to handle this).
+
+    /**
+     * The image to be used. This will never be null. If this
+     * image fails to load, then the entire BackgroundImage will
+     * be skipped at rendering time.
+     */
+    final Image image;
+    public final Image getImage() { return image; }
+
+    /**
+     * Indicates in what manner (if at all) the background image
+     * is to be repeated along the x-axis of the region. This
+     * will never be null.
+     */
+    final BackgroundRepeat repeatX;
+    public final BackgroundRepeat getRepeatX() { return repeatX; }
+
+    /**
+     * Indicates in what manner (if at all) the background image
+     * is to be repeated along the y-axis of the region. This will
+     * never be null.
+     */
+    final BackgroundRepeat repeatY;
+    public final BackgroundRepeat getRepeatY() { return repeatY; }
+
+    /**
+     * The position of this BackgroundImage relative to the Region. Note that any
+     * position outside the background area of the region will be clipped.
+     */
+    final BackgroundPosition position;
+    public final BackgroundPosition getPosition() { return position; }
+
+    /**
+     * The size of this image relative to the Region.
+     */
+    final BackgroundSize size;
+    public final BackgroundSize getSize() { return size; }
+
+    /**
+     * A cached hash code for faster secondary usage. It is expected
+     * that BackgroundImage will be pulled from a cache in many cases.
+     */
+    private final int hash;
+
+    /**
+     * Creates a new BackgroundImage. The {@code image} must be specified.
+     *
+     * @param image       The image to use. This cannot be null.
+     * @param repeatX     The BackgroundRepeat for the x axis. If null, this value defaults to REPEAT.
+     * @param repeatY     The BackgroundRepeat for the y axis. If null, this value defaults to REPEAT.
+     * @param position    The BackgroundPosition to use. If null, defaults to BackgroundPosition.DEFAULT.
+     * @param size        The BackgroundSize. If null, defaults to BackgroundSize.DEFAULT.
+     */
+    public BackgroundImage(
+            Image image, BackgroundRepeat repeatX, BackgroundRepeat repeatY,
+            BackgroundPosition position, BackgroundSize size)
+    {
+        if (image == null) throw new NullPointerException("Image cannot be null");
+        this.image = image;
+        // As per the CSS 3 Spec (section 3.4): default to REPEAT
+        this.repeatX = repeatX == null ? BackgroundRepeat.REPEAT : repeatX;
+        this.repeatY = repeatY == null ? BackgroundRepeat.REPEAT : repeatY;
+        this.position = position == null ? BackgroundPosition.DEFAULT : position;
+        this.size = size == null ? BackgroundSize.DEFAULT : size;
+
+        // Pre-compute the hash code. NOTE: all variables are prefixed with "this" so that we
+        // do not accidentally compute the hash based on the constructor arguments rather than
+        // based on the fields themselves!
+        int result = this.image.hashCode();
+        result = 31 * result + this.repeatX.hashCode();
+        result = 31 * result + this.repeatY.hashCode();
+        result = 31 * result + this.position.hashCode();
+        result = 31 * result + this.size.hashCode();
+        hash = result;
+    }
+
+    /**
+     * @inheritDoc
+     */
+    @Override public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        BackgroundImage that = (BackgroundImage) o;
+        // Because the hash is cached, this can be very fast
+        if (hash != that.hash) return false;
+        if (!image.equals(that.image)) return false;
+        if (!position.equals(that.position)) return false;
+        if (repeatX != that.repeatX) return false;
+        if (repeatY != that.repeatY) return false;
+        if (!size.equals(that.size)) return false;
+
+        return true;
+    }
+
+    /**
+     * @inheritDoc
+     */
+    @Override public int hashCode() {
+        return hash;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/javafx/scene/layout/BackgroundPosition.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,186 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javafx.scene.layout;
+
+import javafx.geometry.Side;
+
+/**
+ * Represents the position of a {@link BackgroundImage} within the
+ * {@link Region}'s drawing area.
+ * <p/>
+ * The BackgroundImage can be positioned either from the left or right side
+ * along the horizontal axis, and from either the top or bottom side along
+ * the vertical axis. The {@link #getHorizontalSide() horizontalSide} and
+ * {@link #getVerticalSide() verticalSide} properties define to which side the
+ * remaining properties pertain. The {@link #getHorizontalPosition() horizontalPosition}
+ * specifies the distance of the BackgroundImage from the corresponding side of the Region,
+ * and {@link #isHorizontalAsPercentage() horizontalAsPercentage} indicates whether
+ * this is as a literal value or a percentage. Similar properties exist for
+ * specifying the size relative to the vertical axis.
+ * <p/>
+ * For example, suppose I had a BackgroundPosition with a {@code horizontalSide}
+ * of {@code Side.RIGHT}, a {@code horizontalPosition} of .05, and a
+ * {@code horizontalAsPercentage} of {@code true}. In this case, the right
+ * side of the BackgroundImage will be 5% of the width of the Region from
+ * the Region's right edge.
+ */
+public class BackgroundPosition {
+    /**
+     * The default BackgroundPosition for any BackgroundImage. The default
+     * is to have no insets and to be defined as 0% and 0%. That is, the
+     * position is in the top-left corner.
+     */
+    public static final BackgroundPosition DEFAULT = new BackgroundPosition(
+            Side.LEFT, 0, true, Side.TOP, 0, true);
+    // As per the CSS 3 Spec (3.6), 0% 0% is the default
+
+    /**
+     * The side along the horizontal axis to which the BackgroundImage is
+     * anchored. This will only be LEFT or RIGHT and never null.
+     */
+    final Side horizontalSide;
+    public final Side getHorizontalSide() { return horizontalSide; }
+
+    /**
+     * The side along the vertical axis to which the BackgroundImage is
+     * anchored. This will only be TOP or BOTTOM and never null.
+     */
+    final Side verticalSide;
+    public final Side getVerticalSide() { return verticalSide; }
+
+    /**
+     * The value indicating the position of the BackgroundImage relative
+     * to the Region along the side indicated by the
+     * {@link #getHorizontalSide() horizontalSide} property. This value
+     * is either a literal or a percentage, depending on the
+     * {@link #isHorizontalAsPercentage() horizontalAsPercentage} property.
+     * Negative values are acceptable.
+     */
+    final double horizontalPosition;
+    public final double getHorizontalPosition() { return horizontalPosition; }
+
+    /**
+     * The value indicating the position of the BackgroundImage relative
+     * to the Region along the side indicated by the {@link #getVerticalSide() verticalSide}
+     * property. This value is either a literal or a percentage, depending on the
+     * {@link #isVerticalAsPercentage() verticalAsPercentage} property. Negative
+     * values are acceptable.
+     */
+    final double verticalPosition;
+    public final double getVerticalPosition() { return verticalPosition; }
+
+    /**
+     * Specifies whether the {@link #getHorizontalPosition() horizontalPosition} should
+     * be interpreted as a literal number or as a percentage.
+     */
+    final boolean horizontalAsPercentage;
+    public final boolean isHorizontalAsPercentage() { return horizontalAsPercentage; }
+
+    /**
+     * Specifies whether the {@link #getVerticalPosition() verticalPosition} should
+     * be interpreted as a literal number or as a percentage.
+     */
+    final boolean verticalAsPercentage;
+    public final boolean isVerticalAsPercentage() { return verticalAsPercentage; }
+
+    /**
+     * A cached has code value.
+     */
+    private final int hash;
+
+    /**
+     * Creates a new BackgroundPosition.
+     *
+     * @param horizontalSide            The horizontal side, must be either null, LEFT, or RIGHT. If null, LEFT
+     *                                  will be used. If TOP or BOTTOM is specified, an IllegalArgumentException
+     *                                  is thrown.
+     * @param horizontalPosition        The horizontal position value.
+     * @param horizontalAsPercentage    Whether to interpret the horizontal position as a decimal or percentage
+     * @param verticalSide              The vertical side, must be either null, TOP, or BOTTOM. If null, TOP
+     *                                  will be used. If LEFT or RIGHT is specified, an IllegalArgumentException
+     *                                  is thrown.
+     * @param verticalPosition          The vertical position value.
+     * @param verticalAsPercentage      Whether to interpret the vertical position as a decimal or percentage
+     */
+    public BackgroundPosition(Side horizontalSide, double horizontalPosition, boolean horizontalAsPercentage,
+                              Side verticalSide, double verticalPosition, boolean verticalAsPercentage) {
+
+        if (horizontalSide == Side.TOP || horizontalSide == Side.BOTTOM) {
+            throw new IllegalArgumentException("The horizontalSide must be LEFT or RIGHT");
+        }
+
+        if (verticalSide == Side.LEFT || verticalSide == Side.RIGHT) {
+            throw new IllegalArgumentException("The verticalSide must be TOP or BOTTOM");
+        }
+
+        this.horizontalSide = horizontalSide == null ? Side.LEFT : horizontalSide;
+        this.verticalSide = verticalSide == null ? Side.TOP : verticalSide;
+        this.horizontalPosition = horizontalPosition;
+        this.verticalPosition = verticalPosition;
+        this.horizontalAsPercentage = horizontalAsPercentage;
+        this.verticalAsPercentage = verticalAsPercentage;
+
+        // Pre-compute the hash code. NOTE: all variables are prefixed with "this" so that we
+        // do not accidentally compute the hash based on the constructor arguments rather than
+        // based on the fields themselves!
+        int result;
+        long temp;
+        result = this.horizontalSide.hashCode();
+        result = 31 * result + this.verticalSide.hashCode();
+        temp = this.horizontalPosition != +0.0d ? Double.doubleToLongBits(this.horizontalPosition) : 0L;
+        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        temp = this.verticalPosition != +0.0d ? Double.doubleToLongBits(this.verticalPosition) : 0L;
+        result = 31 * result + (int) (temp ^ (temp >>> 32));
+        result = 31 * result + (this.horizontalAsPercentage ? 1 : 0);
+        result = 31 * result + (this.verticalAsPercentage ? 1 : 0);
+        hash = result;
+    }
+
+    /**
+     * @inheritDoc
+     */
+    @Override public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+        BackgroundPosition that = (BackgroundPosition) o;
+        if (hash != that.hash) return false;
+        if (horizontalAsPercentage != that.horizontalAsPercentage) return false;
+        if (Double.compare(that.horizontalPosition, horizontalPosition) != 0) return false;
+        if (verticalAsPercentage != that.verticalAsPercentage) return false;
+        if (Double.compare(that.verticalPosition, verticalPosition) != 0) return false;
+        if (horizontalSide != that.horizontalSide) return false;
+        if (verticalSide != that.verticalSide) return false;
+
+        return true;
+    }
+
+    /**
+     * @inheritDoc
+     */
+    @Override public int hashCode() {
+        return hash;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/javafx/scene/layout/BackgroundRepeat.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javafx.scene.layout;
+
+/**
+ * Enumeration of options for repeating images in backgrounds
+ */
+public enum BackgroundRepeat {
+    /**
+     * The image is repeated as often as needed to cover the area.
+     */
+    REPEAT,
+    /**
+     * The image is repeated as often as will fit within the area without being
+     * clipped and then the images are spaced out to fill the area. The first
+     * and last images touch the edges of the area.
+     */
+    SPACE,
+    /**
+     * The image is repeated as often as will fit within the area. If it
+     * doesn't fit a whole number of times, it is reduced in size until it does.
+     */
+    ROUND,
+    /**
+     * The image is placed once and not repeated
+     */
+    NO_REPEAT
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javafx-ui-common/src/javafx/scene/layout/BackgroundSize.java	Tue Sep 11 20:39:23 2012 -0400
@@ -0,0 +1,195 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package javafx.scene.layout;
+
+/**
+ * Defines the size of the area that a BackgroundImage should fill relative
+ * to the Region it is styling. There are several properties who's values
+ * take precedence over the others. In particular there are 4 key properties,
+ * {@code wid