changeset 6124:8d28332831a4 8.0-b124

Automated merge with ssh://jfxsrc.us.oracle.com//javafx/8.0/MASTER/jfx/rt
author kcr
date Tue, 14 Jan 2014 17:06:56 -0800
parents d4fcbba5228c 80c29c9a9551
children c2f14b01f0d0 3e1c456afa4c 1cf08bba9bc6 4171f2b5f001
files
diffstat 25 files changed, 767 insertions(+), 159 deletions(-) [+]
line wrap: on
line diff
--- a/build.gradle	Tue Jan 14 08:21:13 2014 -0800
+++ b/build.gradle	Tue Jan 14 17:06:56 2014 -0800
@@ -1436,11 +1436,13 @@
     // TODO also not sure there is any benefit to having css files in the jfxrt.jar at all
     processResources << {
         ["$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/caspian.css",
+        "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/caspian-no-transparency.css",
         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/embedded-qvga.css",
         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/embedded.css",
         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/fxvk.css",
         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/caspian/highcontrast.css",
         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/modena/modena.css",
+        "$buildDir/resources/main/com/sun/javafx/scene/control/skin/modena/modena-no-transparency.css",
         "$buildDir/resources/main/com/sun/javafx/scene/control/skin/modena/touch.css"].each { css ->
             javaexec {
                 executable = JAVA
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/caspian/caspian-no-transparency.css	Tue Jan 14 17:06:56 2014 -0800
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2009, 2011, Oracle anis/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.
+ */
+
+/*******************************************************************************
+ *                                                                             *
+ * PopupMenu                                                                   *
+ *                                                                             *
+ ******************************************************************************/
+
+.context-menu {
+    -fx-background-radius: 0;
+}
+
+/*******************************************************************************
+ *                                                                             *
+ * ChoiceBox                                                                   *
+ *                                                                             *
+ ******************************************************************************/
+
+.choice-box > .context-menu {
+    -fx-background-radius: 0;
+}
+
+/*******************************************************************************
+ *                                                                             *
+ * ComboBox                                                                    *
+ *                                                                             *
+ ******************************************************************************/
+
+.combo-box-popup > .list-view {
+    -fx-background-insets: 0 -1 -1 0, 1 0 1 1;
+    -fx-effect: null;
+}
+.combo-box-popup > .list-view > .virtual-flow > .scroll-bar:vertical{
+    -fx-background-insets: 0, 0 0 1 1;
+    -fx-padding: -1 -2 -1 0;
+}
+
+/*******************************************************************************
+ *                                                                             *
+ * ColorPicker                                                                 *
+ *                                                                             *
+ ******************************************************************************/
+
+.color-palette {
+    -fx-background-radius: 0;
+    -fx-effect: null;
+}
+
+/*******************************************************************************
+ *                                                                             *
+ * Tooltip                                                                     *
+ *                                                                             *
+ ******************************************************************************/
+
+.tooltip {
+    -fx-effect: null;
+    -fx-background-insets: 0 0 -1 0, 1, 2;
+}
+
+/*******************************************************************************
+*                                                                              *
+* DatePicker                                                                   *
+*                                                                              *
+*******************************************************************************/
+
+.date-picker-popup {
+    -fx-background-radius: 0;
+    -fx-effect: null;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/controls/src/main/resources/com/sun/javafx/scene/control/skin/modena/modena-no-transparency.css	Tue Jan 14 17:06:56 2014 -0800
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2009, 2011, 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.
+ *
+ */
+
+
+/*******************************************************************************
+ *                                                                             *
+ * PopupMenu                                                                   *
+ *                                                                             *
+ ******************************************************************************/
+
+.context-menu {
+    -fx-effect: null;
+}
+
+/*******************************************************************************
+ *                                                                             *
+ * ComboBox                                                                    *
+ *                                                                             *
+ ******************************************************************************/
+
+.combo-box-popup > .list-view {
+    -fx-effect: null;
+}
+
+/*******************************************************************************
+ *                                                                             *
+ * ColorPicker                                                                 *
+ *                                                                             *
+ ******************************************************************************/
+
+.color-palette {
+    -fx-background-radius: 0;
+    -fx-effect: null;
+}
+
+/*******************************************************************************
+ *                                                                             *
+ * Tooltip                                                                     *
+ *                                                                             *
+ ******************************************************************************/
+
+.tooltip {
+    -fx-background-color: rgb(30, 30, 30);
+    -fx-background-radius: 0;
+    -fx-effect: null;
+}
+
+/*******************************************************************************
+*                                                                              *
+* DatePicker                                                                   *
+*                                                                              *
+*******************************************************************************/
+.date-picker-popup {
+    -fx-background-radius: 0;
+    -fx-effect: null;
+}
\ No newline at end of file
--- a/modules/fxml/src/main/java/com/sun/javafx/fxml/BeanAdapter.java	Tue Jan 14 08:21:13 2014 -0800
+++ b/modules/fxml/src/main/java/com/sun/javafx/fxml/BeanAdapter.java	Tue Jan 14 17:06:56 2014 -0800
@@ -54,8 +54,6 @@
 public class BeanAdapter extends AbstractMap<String, Object> {
     private final Object bean;
 
-    private static final ClassLoader contextClassLoader;
-
     private static class MethodCache {
         private final Map<String, List<Method>> methods;
         private final MethodCache nextClassCache;
@@ -93,14 +91,7 @@
     public static final String PROPERTY_SUFFIX = "Property";
 
     public static final String VALUE_OF_METHOD_NAME = "valueOf";
-    
-    static {
-        contextClassLoader = Thread.currentThread().getContextClassLoader();
 
-        if (contextClassLoader == null) {
-            throw new NullPointerException();
-        }
-    }
     /**
      * Creates a new Bean adapter.
      *
@@ -474,10 +465,11 @@
         } else if (type == Class.class) {
             try {   
                 ReflectUtil.checkPackageAccess(value.toString());
+                final ClassLoader cl = Thread.currentThread().getContextClassLoader();
                 coercedValue = Class.forName(
                         value.toString(), 
                         false, 
-                        BeanAdapter.contextClassLoader);
+                        cl);
             } catch (ClassNotFoundException exception) {
                 throw new IllegalArgumentException(exception);
             }
--- a/modules/fxml/src/main/java/javafx/fxml/FXMLLoader.java	Tue Jan 14 08:21:13 2014 -0800
+++ b/modules/fxml/src/main/java/javafx/fxml/FXMLLoader.java	Tue Jan 14 17:06:56 2014 -0800
@@ -39,6 +39,7 @@
 import java.lang.reflect.Type;
 import java.net.URL;
 import java.nio.charset.Charset;
+import java.security.AllPermission;
 import java.util.AbstractMap;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -51,6 +52,7 @@
 import java.util.regex.Pattern;
 
 import javafx.beans.DefaultProperty;
+import javafx.beans.InvalidationListener;
 import javafx.beans.property.Property;
 import javafx.beans.value.ChangeListener;
 import javafx.beans.value.ObservableValue;
@@ -88,12 +90,12 @@
 import java.util.EnumMap;
 import java.util.Locale;
 import java.util.StringTokenizer;
-import javafx.beans.InvalidationListener;
 import sun.reflect.CallerSensitive;
 import sun.reflect.Reflection;
 import sun.reflect.misc.ConstructorUtil;
 import sun.reflect.misc.MethodUtil;
 import sun.reflect.misc.ReflectUtil;
+import sun.security.util.SecurityConstants;
 
 /**
  * Loads an object hierarchy from an XML document.
@@ -385,7 +387,7 @@
                     return aValue;
                 } else {
                         if (aValue.charAt(0) == '/') {
-                            final URL res = classLoader.getResource(aValue.substring(1));
+                            final URL res = getClassLoader().getResource(aValue.substring(1));
                             if (res == null) {
                                 throw constructLoadException("Invalid resource: " + aValue + " not found on the classpath");
                             }
@@ -920,7 +922,7 @@
                     if (!staticLoad) {
                         Class<?> type;
                         try {
-                            type = classLoader.loadClass(value);
+                            type = getClassLoader().loadClass(value);
                         } catch (ClassNotFoundException exception) {
                             throw constructLoadException(exception);
                         }
@@ -1110,8 +1112,9 @@
             }
 
             URL location;
+            final ClassLoader cl = getClassLoader();
             if (source.charAt(0) == '/') {
-                location = classLoader.getResource(source.substring(1));
+                location = cl.getResource(source.substring(1));
                 if (location == null) {
                     throw constructLoadException("Cannot resolve path: " + source);
                 }
@@ -1135,7 +1138,7 @@
                         fxmlLoader.location.toExternalForm(),
                         FXMLLoader.this.location.toExternalForm()));
             }
-            fxmlLoader.setClassLoader(classLoader);
+            fxmlLoader.setClassLoader(cl);
             fxmlLoader.impl_setStaticLoad(staticLoad);
 
             Object value = fxmlLoader.loadImpl(callerClass);
@@ -1504,13 +1507,14 @@
 
                 String extension = source.substring(i + 1);
                 ScriptEngine engine;
+                final ClassLoader cl = getClassLoader();
                 if (scriptEngine != null && scriptEngine.getFactory().getExtensions().contains(extension)) {
                     // If we have a page language and it's engine supports the extension, use the same engine
                     engine = scriptEngine;
                 } else {
                     ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
                     try {
-                        Thread.currentThread().setContextClassLoader(classLoader);
+                        Thread.currentThread().setContextClassLoader(cl);
                         ScriptEngineManager scriptEngineManager = getScriptEngineManager();
                         engine = scriptEngineManager.getEngineByExtension(extension);
                     } finally {
@@ -1526,7 +1530,7 @@
                 try {
                     URL location;
                     if (source.charAt(0) == '/') {
-                        location = classLoader.getResource(source.substring(1));
+                        location = cl.getResource(source.substring(1));
                     } else {
                         if (FXMLLoader.this.location == null) {
                             throw constructLoadException("Base location is undefined.");
@@ -1782,7 +1786,7 @@
 
     private final LinkedList<FXMLLoader> loaders;
 
-    private ClassLoader classLoader = defaultClassLoader;
+    private ClassLoader classLoader = null;
     private boolean staticLoad = false;
     private LoadListener loadListener = null;
 
@@ -1798,7 +1802,7 @@
 
     private ScriptEngineManager scriptEngineManager = null;
 
-    private static ClassLoader defaultClassLoader;
+    private static ClassLoader defaultClassLoader = null;
 
     private static final Pattern extraneousWhitespacePattern = Pattern.compile("\\s+");
 
@@ -2020,12 +2024,6 @@
     public static final String FX_NAMESPACE_VERSION = "1";
 
     static {
-        defaultClassLoader = Thread.currentThread().getContextClassLoader();
-
-        if (defaultClassLoader == null) {
-            throw new NullPointerException();
-        }
-
         JAVAFX_VERSION = AccessController.doPrivileged(new PrivilegedAction<String>() {
             @Override
             public String run() {
@@ -2312,7 +2310,15 @@
      * Returns the classloader used by this serializer.
      * @since JavaFX 2.1
      */
+    @CallerSensitive
     public ClassLoader getClassLoader() {
+        if (classLoader == null) {
+            final SecurityManager sm = System.getSecurityManager();
+            final Class caller = (sm != null) ?
+                    Reflection.getCallerClass() :
+                    null;
+            return getDefaultClassLoader(caller);
+        }
         return classLoader;
     }
 
@@ -2923,7 +2929,7 @@
 
     // TODO Rename to loadType() when deprecated static version is removed
     private Class<?> loadTypeForPackage(String packageName, String className) throws ClassNotFoundException {
-        return classLoader.loadClass(packageName + "." + className.replace('.', '$'));
+        return getClassLoader().loadClass(packageName + "." + className.replace('.', '$'));
     }
 
     private static enum SupportedType {
@@ -3026,15 +3032,56 @@
      */
     public static Class<?> loadType(String className) throws ClassNotFoundException {
         ReflectUtil.checkPackageAccess(className);
-        return Class.forName(className, true, defaultClassLoader);
+        return Class.forName(className, true, getDefaultClassLoader());
+    }
+
+    private static boolean needsClassLoaderPermissionCheck(ClassLoader from, ClassLoader to) {
+        if (from == to) {
+            return false;
+        }
+        if (from == null) {
+            return false;
+        }
+        if (to == null) {
+            return true;
+        }
+        ClassLoader acl = to;
+        do {
+            acl = acl.getParent();
+            if (from == acl) {
+                return false;
+            }
+        } while (acl != null);
+        return true;
+    }
+
+    private static ClassLoader getDefaultClassLoader(Class caller) {
+        if (defaultClassLoader == null) {
+            final SecurityManager sm = System.getSecurityManager();
+            if (sm != null) {
+                final ClassLoader callerClassLoader = (caller != null) ?
+                        caller.getClassLoader() :
+                        null;
+                if (needsClassLoaderPermissionCheck(callerClassLoader, FXMLLoader.class.getClassLoader())) {
+                    sm.checkPermission(SecurityConstants.GET_CLASSLOADER_PERMISSION);
+                }
+            }
+            return Thread.currentThread().getContextClassLoader();
+        }
+        return defaultClassLoader;
     }
 
     /**
      * Returns the default class loader.
      * @since JavaFX 2.1
      */
+    @CallerSensitive
     public static ClassLoader getDefaultClassLoader() {
-        return defaultClassLoader;
+        final SecurityManager sm = System.getSecurityManager();
+        final Class caller = (sm != null) ?
+                Reflection.getCallerClass() :
+                null;
+        return getDefaultClassLoader(caller);
     }
 
     /**
@@ -3048,6 +3095,10 @@
         if (defaultClassLoader == null) {
             throw new NullPointerException();
         }
+        final SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            sm.checkPermission(new AllPermission());
+        }
 
         FXMLLoader.defaultClassLoader = defaultClassLoader;
     }
--- a/modules/graphics/src/main/java/com/sun/javafx/application/PlatformImpl.java	Tue Jan 14 08:21:13 2014 -0800
+++ b/modules/graphics/src/main/java/com/sun/javafx/application/PlatformImpl.java	Tue Jan 14 17:06:56 2014 -0800
@@ -45,7 +45,11 @@
 import com.sun.javafx.tk.TKListener;
 import com.sun.javafx.tk.TKStage;
 import com.sun.javafx.tk.Toolkit;
+import javafx.application.Platform;
+import javafx.scene.Scene;
+
 import java.security.AccessController;
+import java.security.AllPermission;
 import java.security.PrivilegedAction;
 
 public class PlatformImpl {
@@ -487,77 +491,26 @@
     }
 
     public static boolean isSupported(ConditionalFeature feature) {
-        switch (feature) {
-            case GRAPHICS:
-                if (isGraphicsSupported == null) {
-                    isGraphicsSupported = checkForClass("javafx.stage.Stage");
+        final boolean supported = isSupportedImpl(feature);
+        if (supported && (feature == ConditionalFeature.TRANSPARENT_WINDOW)) {
+            // some features require the application to have the corresponding
+            // permissions, if the application doesn't have them, the platform
+            // will behave as if the feature wasn't supported
+            final SecurityManager securityManager =
+                    System.getSecurityManager();
+            if (securityManager != null) {
+                try {
+                    securityManager.checkPermission(new AllPermission());
+                } catch (final SecurityException e) {
+                    return false;
                 }
-                return isGraphicsSupported;
-            case CONTROLS:
-                if (isControlsSupported == null) {
-                    isControlsSupported = checkForClass(
-                            "javafx.scene.control.Control");
-                }
-                return isControlsSupported;
-            case MEDIA:
-                if (isMediaSupported == null) {
-                    isMediaSupported = checkForClass(
-                            "javafx.scene.media.MediaView");
-                }
-                return isMediaSupported;
-            case WEB:
-                if (isWebSupported == null) {
-                    isWebSupported = checkForClass("javafx.scene.web.WebView");
-                }
-                return isWebSupported;
-            case SWT:
-                if (isSWTSupported == null) {
-                    isSWTSupported = checkForClass("javafx.embed.swt.FXCanvas");
-                }
-                return isSWTSupported;
-            case SWING:
-                if (isSwingSupported == null) {
-                    isSwingSupported = 
-                        // check for JComponent first, it may not be present
-                        checkForClass("javax.swing.JComponent") &&
-                        checkForClass("javafx.embed.swing.JFXPanel");
-                }
-                return isSwingSupported;
-            case FXML:
-                if (isFXMLSupported == null) {
-                    isFXMLSupported = checkForClass("javafx.fxml.FXMLLoader")
-                            && checkForClass("javax.xml.stream.XMLInputFactory");
-                }
-                return isFXMLSupported;
-            case TWO_LEVEL_FOCUS:
-                if (hasTwoLevelFocus == null) {
-                    return Toolkit.getToolkit().isSupported(feature);
-                }
-                return hasTwoLevelFocus;
-            case VIRTUAL_KEYBOARD:
-                if (hasVirtualKeyboard == null) {
-                    return Toolkit.getToolkit().isSupported(feature);
-                }
-                return hasVirtualKeyboard;
-            case INPUT_TOUCH:
-                if (hasTouch == null) {
-                    return Toolkit.getToolkit().isSupported(feature);
-                }
-                return hasTouch;
-            case INPUT_MULTITOUCH:
-                if (hasMultiTouch == null) {
-                    return Toolkit.getToolkit().isSupported(feature);
-                }
-                return hasMultiTouch;
-            case INPUT_POINTER:
-                if (hasPointer == null) {
-                    return Toolkit.getToolkit().isSupported(feature);
-                }
-                return hasPointer;
-            default:
-                return Toolkit.getToolkit().isSupported(feature);
+            }
+
+            return true;
         }
-    }
+
+        return supported;
+   }
 
     public static interface FinishListener {
         public void idle(boolean implicitExit);
@@ -662,6 +615,7 @@
                     new PrivilegedAction() {
                         @Override public Object run() {
                             StyleManager.getInstance().setDefaultUserAgentStylesheet("com/sun/javafx/scene/control/skin/modena/modena.css");
+
                             if (isSupported(ConditionalFeature.INPUT_TOUCH)) {
                                 StyleManager.getInstance().addUserAgentStylesheet(
                                         "com/sun/javafx/scene/control/skin/modena/touch.css");
@@ -710,4 +664,97 @@
             StyleManager.getInstance().setDefaultUserAgentStylesheet(stylesheetUrl);
         }
     }
+
+    public static void addNoTransparencyStylesheetToScene(final Scene scene) {
+        if (PlatformImpl.isCaspian()) {
+            AccessController.doPrivileged(new PrivilegedAction() {
+                @Override public Object run() {
+                    StyleManager.getInstance().addUserAgentStylesheet(scene,
+                            "com/sun/javafx/scene/control/skin/caspian/caspian-no-transparency.css");
+                    return null;
+                }
+            });
+        } else if (PlatformImpl.isModena()) {
+            AccessController.doPrivileged(new PrivilegedAction() {
+                @Override public Object run() {
+                    StyleManager.getInstance().addUserAgentStylesheet(scene,
+                            "com/sun/javafx/scene/control/skin/modena/modena-no-transparency.css");
+                    return null;
+                }
+            });
+        }
+    }
+
+    private static boolean isSupportedImpl(ConditionalFeature feature) {
+        switch (feature) {
+            case GRAPHICS:
+                if (isGraphicsSupported == null) {
+                    isGraphicsSupported = checkForClass("javafx.stage.Stage");
+                }
+                return isGraphicsSupported;
+            case CONTROLS:
+                if (isControlsSupported == null) {
+                    isControlsSupported = checkForClass(
+                            "javafx.scene.control.Control");
+                }
+                return isControlsSupported;
+            case MEDIA:
+                if (isMediaSupported == null) {
+                    isMediaSupported = checkForClass(
+                            "javafx.scene.media.MediaView");
+                }
+                return isMediaSupported;
+            case WEB:
+                if (isWebSupported == null) {
+                    isWebSupported = checkForClass("javafx.scene.web.WebView");
+                }
+                return isWebSupported;
+            case SWT:
+                if (isSWTSupported == null) {
+                    isSWTSupported = checkForClass("javafx.embed.swt.FXCanvas");
+                }
+                return isSWTSupported;
+            case SWING:
+                if (isSwingSupported == null) {
+                    isSwingSupported =
+                        // check for JComponent first, it may not be present
+                        checkForClass("javax.swing.JComponent") &&
+                        checkForClass("javafx.embed.swing.JFXPanel");
+                }
+                return isSwingSupported;
+            case FXML:
+                if (isFXMLSupported == null) {
+                    isFXMLSupported = checkForClass("javafx.fxml.FXMLLoader")
+                            && checkForClass("javax.xml.stream.XMLInputFactory");
+                }
+                return isFXMLSupported;
+            case TWO_LEVEL_FOCUS:
+                if (hasTwoLevelFocus == null) {
+                    return Toolkit.getToolkit().isSupported(feature);
+                }
+                return hasTwoLevelFocus;
+            case VIRTUAL_KEYBOARD:
+                if (hasVirtualKeyboard == null) {
+                    return Toolkit.getToolkit().isSupported(feature);
+                }
+                return hasVirtualKeyboard;
+            case INPUT_TOUCH:
+                if (hasTouch == null) {
+                    return Toolkit.getToolkit().isSupported(feature);
+                }
+                return hasTouch;
+            case INPUT_MULTITOUCH:
+                if (hasMultiTouch == null) {
+                    return Toolkit.getToolkit().isSupported(feature);
+                }
+                return hasMultiTouch;
+            case INPUT_POINTER:
+                if (hasPointer == null) {
+                    return Toolkit.getToolkit().isSupported(feature);
+                }
+                return hasPointer;
+            default:
+                return Toolkit.getToolkit().isSupported(feature);
+        }
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/graphics/src/main/java/com/sun/javafx/scene/input/DragboardHelper.java	Tue Jan 14 17:06:56 2014 -0800
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2013, 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.input;
+
+import javafx.scene.input.Dragboard;
+
+/**
+ * Used to access internal methods of Dragboard.
+ */
+public class DragboardHelper {
+    private static DragboardAccessor dragboardAccessor;
+
+    static {
+        forceInit(Dragboard.class);
+    }
+
+    private DragboardHelper() {
+    }
+
+    public static void setDataAccessRestriction(Dragboard dragboard,
+            boolean restricted) {
+        dragboardAccessor.setDataAccessRestriction(dragboard, restricted);
+    }
+
+    public static void setDragboardAccessor(final DragboardAccessor newAccessor) {
+        if (dragboardAccessor != null) {
+            throw new IllegalStateException();
+        }
+
+        dragboardAccessor = newAccessor;
+    }
+
+    public interface DragboardAccessor {
+        void setDataAccessRestriction(Dragboard dragboard, boolean restricted);
+    }
+
+    private static void forceInit(final Class<?> classToInit) {
+        try {
+            Class.forName(classToInit.getName(), true,
+                          classToInit.getClassLoader());
+        } catch (final ClassNotFoundException e) {
+            throw new AssertionError(e);  // Can't happen
+        }
+    }
+}
--- a/modules/graphics/src/main/java/com/sun/javafx/tk/DummyToolkit.java	Tue Jan 14 08:21:13 2014 -0800
+++ b/modules/graphics/src/main/java/com/sun/javafx/tk/DummyToolkit.java	Tue Jan 14 17:06:56 2014 -0800
@@ -97,7 +97,7 @@
     }
 
     @Override
-    public TKStage createTKPopupStage(Window peerWindow, TKStage owner, AccessControlContext acc) {
+    public TKStage createTKPopupStage(Window peerWindow, StageStyle popupStyle, TKStage owner, AccessControlContext acc) {
         throw new UnsupportedOperationException("Not supported yet.");
     }
 
--- a/modules/graphics/src/main/java/com/sun/javafx/tk/Toolkit.java	Tue Jan 14 08:21:13 2014 -0800
+++ b/modules/graphics/src/main/java/com/sun/javafx/tk/Toolkit.java	Tue Jan 14 17:06:56 2014 -0800
@@ -277,7 +277,7 @@
     public abstract TKStage createTKStage(Window peerWindow, StageStyle stageStyle, boolean primary,
             Modality modality, TKStage owner, boolean rtl, AccessControlContext acc);
 
-    public abstract TKStage createTKPopupStage(Window peerWindow, TKStage owner, AccessControlContext acc);
+    public abstract TKStage createTKPopupStage(Window peerWindow, StageStyle popupStyle, TKStage owner, AccessControlContext acc);
     public abstract TKStage createTKEmbeddedStage(HostInterface host, AccessControlContext acc);
 
     /**
@@ -298,47 +298,68 @@
      */
     public abstract void closeAppletWindow();
 
-    private final Map<TKPulseListener,Object> stagePulseListeners =
-            new WeakHashMap<TKPulseListener,Object>();
-    private final Map<TKPulseListener,Object> scenePulseListeners =
-            new WeakHashMap<TKPulseListener,Object>();
-    private final Map<TKPulseListener,Object> postScenePulseListeners =
-            new WeakHashMap<TKPulseListener,Object>();
-    private final Map<TKListener,Object> toolkitListeners =
-            new WeakHashMap<TKListener,Object>();
+    private final Map<TKPulseListener,AccessControlContext> stagePulseListeners =
+            new WeakHashMap<TKPulseListener,AccessControlContext>();
+    private final Map<TKPulseListener,AccessControlContext> scenePulseListeners =
+            new WeakHashMap<TKPulseListener,AccessControlContext>();
+    private final Map<TKPulseListener,AccessControlContext> postScenePulseListeners =
+            new WeakHashMap<TKPulseListener,AccessControlContext>();
+    private final Map<TKListener,AccessControlContext> toolkitListeners =
+            new WeakHashMap<TKListener,AccessControlContext>();
 
     // The set of shutdown hooks is strongly held to avoid premature GC.
     private final Set<Runnable> shutdownHooks = new HashSet<Runnable>();
 
+    private void runPulse(final TKPulseListener listener,
+            final AccessControlContext acc) {
+
+        if (acc == null) {
+            throw new IllegalStateException("Invalid AccessControlContext");
+        }
+
+        AccessController.doPrivileged(new PrivilegedAction<Void>() {
+            @Override public Void run() {
+                listener.pulse();
+                return null;
+            }
+        }, acc);
+    }
 
     public void firePulse() {
         // Stages need to be notified of pulses before scenes so the Stage can resized
         // and those changes propogated to scene before it gets its pulse to update
 
-        ArrayList<TKPulseListener> stagePulseList = new ArrayList<TKPulseListener>();
-        ArrayList<TKPulseListener> scenePulseList = new ArrayList<TKPulseListener>();
-        ArrayList<TKPulseListener> postScenePulseList = new ArrayList<TKPulseListener>();
+        // Copy of listener map
+        final Map<TKPulseListener,AccessControlContext> stagePulseList =
+                new WeakHashMap<TKPulseListener,AccessControlContext>();
+        final Map<TKPulseListener,AccessControlContext> scenePulseList =
+                new WeakHashMap<TKPulseListener,AccessControlContext>();
+        final Map<TKPulseListener,AccessControlContext> postScenePulseList =
+                new WeakHashMap<TKPulseListener,AccessControlContext>();
+
         synchronized (this) {
-            stagePulseList.addAll(stagePulseListeners.keySet());
-            scenePulseList.addAll(scenePulseListeners.keySet());
-            postScenePulseList.addAll(postScenePulseListeners.keySet());
+            stagePulseList.putAll(stagePulseListeners);
+            scenePulseList.putAll(scenePulseListeners);
+            postScenePulseList.putAll(postScenePulseListeners);
         }
-        for (TKPulseListener listener: stagePulseList) {
-            listener.pulse();
+        for (Map.Entry<TKPulseListener,AccessControlContext> entry : stagePulseList.entrySet()) {
+            runPulse(entry.getKey(), entry.getValue());
         }
-        for (TKPulseListener listener: scenePulseList) {
-            listener.pulse();
+        for (Map.Entry<TKPulseListener,AccessControlContext> entry : scenePulseList.entrySet()) {
+            runPulse(entry.getKey(), entry.getValue());
         }
-        for (TKPulseListener listener: postScenePulseList) {
-            listener.pulse();
+        for (Map.Entry<TKPulseListener,AccessControlContext> entry : postScenePulseList.entrySet()) {
+            runPulse(entry.getKey(), entry.getValue());
         }
+
         if (lastTkPulseListener != null) {
-            lastTkPulseListener.pulse();
+            runPulse(lastTkPulseListener, lastTkPulseAcc);
         }
     }
     public void addStageTkPulseListener(TKPulseListener listener) {
         synchronized (this) {
-            stagePulseListeners.put(listener, null);
+            AccessControlContext acc = AccessController.getContext();
+            stagePulseListeners.put(listener, acc);
         }
     }
     public void removeStageTkPulseListener(TKPulseListener listener) {
@@ -348,7 +369,8 @@
     }
     public void addSceneTkPulseListener(TKPulseListener listener) {
         synchronized (this) {
-            scenePulseListeners.put(listener, null);
+            AccessControlContext acc = AccessController.getContext();
+            scenePulseListeners.put(listener, acc);
         }
     }
     public void removeSceneTkPulseListener(TKPulseListener listener) {
@@ -358,7 +380,8 @@
     }
     public void addPostSceneTkPulseListener(TKPulseListener listener) {
         synchronized (this) {
-            postScenePulseListeners.put(listener, null);
+            AccessControlContext acc = AccessController.getContext();
+            postScenePulseListeners.put(listener, acc);
         }
     }
     public void removePostSceneTkPulseListener(TKPulseListener listener) {
@@ -368,7 +391,8 @@
     }
 
     public void addTkListener(TKListener listener) {
-        toolkitListeners.put(listener, null);
+        AccessControlContext acc = AccessController.getContext();
+        toolkitListeners.put(listener, acc);
     }
 
     public void removeTkListener(TKListener listener) {
@@ -376,7 +400,9 @@
     }
 
     private TKPulseListener lastTkPulseListener = null;
+    private AccessControlContext lastTkPulseAcc = null;
     public void setLastTkPulseListener(TKPulseListener listener) {
+        lastTkPulseAcc = AccessController.getContext();
         lastTkPulseListener = listener;
     }
 
@@ -404,9 +430,20 @@
         }
     }
 
-    public void notifyWindowListeners(List<TKStage> windows) {
-        for (TKListener listener: toolkitListeners.keySet()) {
-            listener.changedTopLevelWindows(windows);
+    public void notifyWindowListeners(final List<TKStage> windows) {
+        for (Map.Entry<TKListener,AccessControlContext> entry : toolkitListeners.entrySet()) {
+            final TKListener listener = entry.getKey();
+            final AccessControlContext acc = entry.getValue();
+            if (acc == null) {
+                throw new IllegalStateException("Invalid AccessControlContext");
+            }
+
+            AccessController.doPrivileged(new PrivilegedAction<Void>() {
+                @Override public Void run() {
+                    listener.changedTopLevelWindows(windows);
+                    return null;
+                }
+            }, acc);
         }
     }
 
--- a/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/QuantumToolkit.java	Tue Jan 14 08:21:13 2014 -0800
+++ b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/QuantumToolkit.java	Tue Jan 14 17:06:56 2014 -0800
@@ -565,10 +565,11 @@
     }
 
     @Override public TKStage createTKPopupStage(Window peerWindow,
+                                                StageStyle popupStyle,
                                                 TKStage owner,
                                                 AccessControlContext acc) {
         assertToolkitRunning();
-        WindowStage stage = new WindowStage(peerWindow, StageStyle.TRANSPARENT, null, owner);
+        WindowStage stage = new WindowStage(peerWindow, popupStyle, null, owner);
         stage.setSecurityContext(acc);
         stage.setIsPopup();
         stage.init(systemMenu);
--- a/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java	Tue Jan 14 08:21:13 2014 -0800
+++ b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java	Tue Jan 14 17:06:56 2014 -0800
@@ -160,7 +160,10 @@
                 boolean focusable = true;
                 int windowMask = rtl ? Window.RIGHT_TO_LEFT : 0;
                 if (isPopupStage) { // TODO: make it a stage style?
-                    windowMask |= Window.TRANSPARENT | Window.POPUP;
+                    windowMask |= Window.POPUP;
+                    if (style == StageStyle.TRANSPARENT) {
+                        windowMask |= Window.TRANSPARENT;
+                    }
                     focusable = false;
                 } else {
                     switch (style) {
--- a/modules/graphics/src/main/java/com/sun/scenario/animation/AbstractMasterTimer.java	Tue Jan 14 08:21:13 2014 -0800
+++ b/modules/graphics/src/main/java/com/sun/scenario/animation/AbstractMasterTimer.java	Tue Jan 14 17:06:56 2014 -0800
@@ -26,12 +26,12 @@
 package com.sun.scenario.animation;
 
 import java.util.Arrays;
-import javafx.animation.AnimationTimer;
 import javafx.util.Callback;
 import com.sun.javafx.animation.TickCalculation;
 import com.sun.scenario.DelayedRunnable;
 import com.sun.scenario.Settings;
 import com.sun.scenario.animation.shared.PulseReceiver;
+import com.sun.scenario.animation.shared.TimerReceiver;
 
 public abstract class AbstractMasterTimer {
 
@@ -95,7 +95,7 @@
     private boolean receiversLocked;
 
     // synchronize to update frameJobList and frameJobs
-    private AnimationTimer animationTimers[] = new AnimationTimer[2]; // frameJobList
+    private TimerReceiver animationTimers[] = new TimerReceiver[2]; // frameJobList
                                                                      // snapshot
     private int animationTimersLength;
     private boolean animationTimersLocked;
@@ -201,7 +201,7 @@
         }
     }
 
-    public void addAnimationTimer(AnimationTimer timer) {
+    public void addAnimationTimer(TimerReceiver timer) {
         boolean needMoreSize = animationTimersLength == animationTimers.length;
         if (animationTimersLocked || needMoreSize) {
             animationTimers = Arrays.copyOf(animationTimers, needMoreSize ? animationTimers.length * 3 / 2 + 1 : animationTimers.length);
@@ -213,7 +213,7 @@
         }
     }
 
-    public void removeAnimationTimer(AnimationTimer timer) {
+    public void removeAnimationTimer(TimerReceiver timer) {
         if (animationTimersLocked) {
             animationTimers = animationTimers.clone();
             animationTimersLocked = false;
@@ -350,7 +350,7 @@
         }
         recordAnimationEnd();
 
-        final AnimationTimer animationTimersSnapshot[] = animationTimers;
+        final TimerReceiver animationTimersSnapshot[] = animationTimers;
         final int aTLength = animationTimersLength;
         try {
             animationTimersLocked = true;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/graphics/src/main/java/com/sun/scenario/animation/shared/TimerReceiver.java	Tue Jan 14 17:06:56 2014 -0800
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2013, 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.scenario.animation.shared;
+
+/**
+ * A TimerReceiver receives per-frame pulses from the MasterTimer.
+ */
+public interface TimerReceiver {
+    /**
+     * Callback triggered to send a message to the TimerReceiver
+     *
+     * @param now
+     *            The timestamp of the current frame given in nanoseconds. This
+     *            value will be the same for all {@code AnimationTimers} called
+     *            during one frame.
+     */
+    public void handle(long now);
+}
--- a/modules/graphics/src/main/java/javafx/animation/Animation.java	Tue Jan 14 08:21:13 2014 -0800
+++ b/modules/graphics/src/main/java/javafx/animation/Animation.java	Tue Jan 14 17:06:56 2014 -0800
@@ -52,6 +52,9 @@
 import com.sun.scenario.animation.shared.PulseReceiver;
 
 import static com.sun.javafx.animation.TickCalculation.*;
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 
 /**
  * The class {@code Animation} provides the core functionality of all animations
@@ -130,14 +133,25 @@
     private boolean paused = false;
     private final AbstractMasterTimer timer;
 
+    // Access control context, captured whenever we add this pulse reciever to
+    // the master timer (which is called when an animation is played or resumed)
+    private AccessControlContext accessCtrlCtx = null;
+
     private long now() {
         return TickCalculation.fromNano(timer.nanos());
     }
 
+    private void addPulseReceiver() {
+        // Capture the Access Control Context to be used during the animation pulse
+        accessCtrlCtx = AccessController.getContext();
+
+        timer.addPulseReceiver(pulseReceiver);
+    }
+
     void startReceiver(long delay) {
         paused = false;
         startTime = now() + delay;
-        timer.addPulseReceiver(pulseReceiver);
+        addPulseReceiver();
     }
 
     void pauseReceiver() {
@@ -153,7 +167,7 @@
             final long deltaTime = now() - pauseTime;
             startTime += deltaTime;
             paused = false;
-            timer.addPulseReceiver(pulseReceiver);
+            addPulseReceiver();
         }
     }
 
@@ -164,8 +178,16 @@
             if (elapsedTime < 0) {
                 return;
             }
+            if (accessCtrlCtx == null) {
+                throw new IllegalStateException("Error: AccessControlContext not captured");
+            }
 
-            impl_timePulse(elapsedTime);
+            AccessController.doPrivileged(new PrivilegedAction<Void>() {
+                @Override public Void run() {
+                    impl_timePulse(elapsedTime);
+                    return null;
+                }
+            }, accessCtrlCtx);
         }
     };
 
--- a/modules/graphics/src/main/java/javafx/animation/AnimationTimer.java	Tue Jan 14 08:21:13 2014 -0800
+++ b/modules/graphics/src/main/java/javafx/animation/AnimationTimer.java	Tue Jan 14 17:06:56 2014 -0800
@@ -27,6 +27,10 @@
 
 import com.sun.javafx.tk.Toolkit;
 import com.sun.scenario.animation.AbstractMasterTimer;
+import com.sun.scenario.animation.shared.TimerReceiver;
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 
 /**
  * The class {@code AnimationTimer} allows to create a timer, that is called in
@@ -43,9 +47,28 @@
  */
 public abstract class AnimationTimer {
 
+    private class AnimationTimerReceiver implements TimerReceiver {
+        @Override public void handle(final long now) {
+            if (accessCtrlCtx == null) {
+                throw new IllegalStateException("Error: AccessControlContext not captured");
+            }
+
+            AccessController.doPrivileged(new PrivilegedAction<Void>() {
+                @Override public Void run() {
+                    AnimationTimer.this.handle(now);
+                    return null;
+                }
+            }, accessCtrlCtx);
+        }
+    }
+
     private final AbstractMasterTimer timer;
+    private final AnimationTimerReceiver timerReceiver = new AnimationTimerReceiver();
     private boolean active;
 
+    // Access control context, captured in start()
+    private AccessControlContext accessCtrlCtx = null;
+
     /**
      * Creates a new timer.
      */
@@ -78,7 +101,9 @@
      */
     public void start() {
         if (!active) {
-            timer.addAnimationTimer(this);
+            // Capture the Access Control Context to be used during the animation pulse
+            accessCtrlCtx = AccessController.getContext();
+            timer.addAnimationTimer(timerReceiver);
             active = true;
         }
     }
@@ -89,7 +114,7 @@
      */
     public void stop() {
         if (active) {
-            timer.removeAnimationTimer(this);
+            timer.removeAnimationTimer(timerReceiver);
             active = false;
         }
     }
--- a/modules/graphics/src/main/java/javafx/application/ConditionalFeature.java	Tue Jan 14 08:21:13 2014 -0800
+++ b/modules/graphics/src/main/java/javafx/application/ConditionalFeature.java	Tue Jan 14 17:06:56 2014 -0800
@@ -132,6 +132,16 @@
      * NOTE: Currently, this support is available on all platforms
      * except Linux systems without the XComposite extension. The
      * XShape extension is used in that case, so the window edges are aliased.
+     * </p>
+     * <p>
+     * NOTE: In an environment with enabled security manager (for example in
+     * applet mode), usage of transparent windows is protected by security
+     * checks. If the application doesn't have the required permissions, it
+     * won't be able to use this feature and the system will appear as if the
+     * support for transparent windows wasn't implemented. This includes
+     * returning false from the Platform.isSupported(TRANSPARENT_WINDOW) test.
+     * </p>
+     *
      * @since JavaFX 2.2
      */
     TRANSPARENT_WINDOW,
--- a/modules/graphics/src/main/java/javafx/concurrent/Service.java	Tue Jan 14 08:21:13 2014 -0800
+++ b/modules/graphics/src/main/java/javafx/concurrent/Service.java	Tue Jan 14 17:06:56 2014 -0800
@@ -46,6 +46,7 @@
 import javafx.event.EventTarget;
 import javafx.event.EventType;
 import java.security.AccessController;
+import java.security.AccessControlContext;
 import java.security.PrivilegedAction;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.Executor;
@@ -733,13 +734,19 @@
      * @param task a non-null task to execute
      * @since JavaFX 2.1
      */
-    protected void executeTask(Task<V> task) {
-        Executor e = getExecutor();
-        if (e != null) {
-            e.execute(task);
-        } else {
-            EXECUTOR.execute(task);
-        }
+    protected void executeTask(final Task<V> task) {
+        final AccessControlContext acc = AccessController.getContext();
+        final Executor e = getExecutor() != null ? getExecutor() : EXECUTOR;
+        e.execute(new Runnable() {
+            @Override public void run() {
+                AccessController.doPrivileged(new PrivilegedAction<Void>() {
+                    @Override public Void run() {
+                        task.run();
+                        return null;
+                    }
+                }, acc);
+            }
+        });
     }
 
     /***************************************************************************
--- a/modules/graphics/src/main/java/javafx/scene/Scene.java	Tue Jan 14 08:21:13 2014 -0800
+++ b/modules/graphics/src/main/java/javafx/scene/Scene.java	Tue Jan 14 17:06:56 2014 -0800
@@ -25,10 +25,12 @@
 
 package javafx.scene;
 
+import com.sun.javafx.application.PlatformImpl;
 import com.sun.javafx.scene.input.ExtendedInputMethodRequests;
 import com.sun.javafx.tk.TKClipboard;
 import javafx.animation.KeyFrame;
 import javafx.animation.Timeline;
+import javafx.application.Application;
 import javafx.application.ConditionalFeature;
 import javafx.application.Platform;
 import javafx.beans.DefaultProperty;
@@ -123,6 +125,7 @@
 import com.sun.javafx.scene.CssFlags;
 import com.sun.javafx.scene.SceneEventDispatcher;
 import com.sun.javafx.scene.SceneHelper;
+import com.sun.javafx.scene.input.DragboardHelper;
 import com.sun.javafx.scene.input.InputEventUtils;
 import com.sun.javafx.scene.input.KeyCodeMap;
 import com.sun.javafx.scene.input.PickResultChooser;
@@ -373,6 +376,11 @@
         setRoot(root);
         init(width, height);
         setFill(fill);
+
+        final boolean isTransparentWindowsSupported = Platform.isSupported(ConditionalFeature.TRANSPARENT_WINDOW);
+        if (! isTransparentWindowsSupported) {
+            PlatformImpl.addNoTransparencyStylesheetToScene(this);
+        }
     }
 
     static {
@@ -1276,7 +1284,7 @@
     private static List<Runnable> snapshotRunnableListB;
     private static List<Runnable> snapshotRunnableList;
 
-    static void addSnapshotRunnable(Runnable r) {
+    static void addSnapshotRunnable(final Runnable runnable) {
         Toolkit.getToolkit().checkFxUserThread();
 
         if (snapshotPulseListener == null) {
@@ -1310,7 +1318,18 @@
             // had layout and CSS processing, and have been synced
             Toolkit.getToolkit().addPostSceneTkPulseListener(snapshotPulseListener);
         }
-        snapshotRunnableList.add(r);
+
+        final AccessControlContext acc = AccessController.getContext();
+        snapshotRunnableList.add(new Runnable() {
+            @Override public void run() {
+                AccessController.doPrivileged(new PrivilegedAction<Void>() {
+                    @Override public Void run() {
+                        runnable.run();
+                        return null;
+                    }
+                }, acc);
+            }
+        });
         Toolkit.getToolkit().requestNextPulse();
     }
 
@@ -2833,7 +2852,17 @@
                 DragEvent dragEvent =
                         new DragEvent(DragEvent.ANY, dndGesture.dragboard, x, y, screenX, screenY,
                                 transferMode, null, null, pick(x, y));
-                TransferMode tm = dndGesture.processTargetDrop(dragEvent);
+                // Data dropped to the app can be accessed without restriction
+                DragboardHelper.setDataAccessRestriction(dndGesture.dragboard, false);
+
+                TransferMode tm;
+                try {
+                    tm = dndGesture.processTargetDrop(dragEvent);
+                } finally {
+                    DragboardHelper.setDataAccessRestriction(
+                            dndGesture.dragboard, true);
+                }
+                
                 if (dndGesture.source == null) {
                     dndGesture.dragboard = null;
                     dndGesture = null;
@@ -2966,7 +2995,15 @@
                                 mouseEvent.getSource(), target,
                                 MouseEvent.DRAG_DETECTED);
 
-                        fireEvent(target, detectedEvent);
+                        try {
+                            fireEvent(target, detectedEvent);
+                        } finally {
+                            // Putting data to dragboard finished, restrict access to them
+                            if (dragboard != null) {
+                                DragboardHelper.setDataAccessRestriction(
+                                        dragboard, true);
+                            }
+                        }
                     }
 
                     dragDetectedProcessed();
@@ -2994,7 +3031,15 @@
             processingDragDetected();
 
             final EventTarget target = de.getPickResult().getIntersectedNode();
-            fireEvent(target != null ? target : Scene.this, me);
+            try {
+                fireEvent(target != null ? target : Scene.this, me);
+            } finally {
+                // Putting data to dragboard finished, restrict access to them
+                if (dragboard != null) {
+                    DragboardHelper.setDataAccessRestriction(
+                            dragboard, true);
+                }
+            }
 
             dragDetectedProcessed();
 
@@ -3201,6 +3246,10 @@
             } else if (dragboard == null) {
                 dragboard = createDragboard(null, true);
             }
+
+            // The app can see what it puts to dragboard without restriction
+            DragboardHelper.setDataAccessRestriction(dragboard, false);
+
             this.source = source;
             potentialTarget = source;
             sourceTransferModes = t;
@@ -3249,7 +3298,15 @@
                 DragEvent dragEvent =
                         new DragEvent(DragEvent.ANY, dndGesture.dragboard, x, y, screenX, screenY,
                         transferMode, null, null, null);
-                dndGesture.processDropEnd(dragEvent);
+
+                // DRAG_DONE event is delivered to gesture source, it can access
+                // its own data without restriction
+                DragboardHelper.setDataAccessRestriction(dndGesture.dragboard, false);
+                try {
+                    dndGesture.processDropEnd(dragEvent);
+                } finally {
+                    DragboardHelper.setDataAccessRestriction(dndGesture.dragboard, true);
+                }
                 dndGesture = null;
             }
         }
--- a/modules/graphics/src/main/java/javafx/scene/input/Clipboard.java	Tue Jan 14 08:21:13 2014 -0800
+++ b/modules/graphics/src/main/java/javafx/scene/input/Clipboard.java	Tue Jan 14 17:06:56 2014 -0800
@@ -248,6 +248,13 @@
      */
     public final Object getContent(DataFormat dataFormat) {
         Toolkit.getToolkit().checkFxUserThread();
+        return getContentImpl(dataFormat);
+    }
+
+    /**
+     * Getting content overridable by internal subclasses.
+     */
+    Object getContentImpl(DataFormat dataFormat) {
         return peer.getContent(dataFormat);
     }
 
--- a/modules/graphics/src/main/java/javafx/scene/input/Dragboard.java	Tue Jan 14 08:21:13 2014 -0800
+++ b/modules/graphics/src/main/java/javafx/scene/input/Dragboard.java	Tue Jan 14 17:06:56 2014 -0800
@@ -25,8 +25,10 @@
 
 package javafx.scene.input;
 
+import java.security.AllPermission;
 import java.util.Set;
 
+import com.sun.javafx.scene.input.DragboardHelper;
 import com.sun.javafx.tk.TKClipboard;
 import com.sun.javafx.tk.TKScene;
 import javafx.scene.image.Image;
@@ -37,10 +39,26 @@
  */
 public final class Dragboard extends Clipboard {
 
+    /**
+     * Whether access to the data requires a permission.
+     */
+    private boolean dataAccessRestricted = true;
+
     Dragboard(TKClipboard peer) {
         super(peer);
     }
 
+    @Override
+    Object getContentImpl(DataFormat dataFormat) {
+        if (dataAccessRestricted) {
+            final SecurityManager securityManager = System.getSecurityManager();
+            if (securityManager != null) {
+                securityManager.checkPermission(new AllPermission());
+            }
+        }
+        return super.getContentImpl(dataFormat);
+    }
+
     /**
      * Gets set of transport modes supported by source of this drag opeation.
      * @return set of supported transfer modes
@@ -156,4 +174,15 @@
     public double getDragViewOffsetY() {
         return peer.getDragViewOffsetY();
     }
+
+    static {
+        // This is used by classes in different packages to get access to
+        // private and package private methods.
+        DragboardHelper.setDragboardAccessor(new DragboardHelper.DragboardAccessor() {
+            @Override
+            public void setDataAccessRestriction(Dragboard dragboard, boolean restricted) {
+                dragboard.dataAccessRestricted = restricted;
+            }
+        });
+    }
 }
--- a/modules/graphics/src/main/java/javafx/stage/PopupWindow.java	Tue Jan 14 08:21:13 2014 -0800
+++ b/modules/graphics/src/main/java/javafx/stage/PopupWindow.java	Tue Jan 14 17:06:56 2014 -0800
@@ -62,6 +62,7 @@
 import com.sun.javafx.stage.WindowCloseRequestHandler;
 import com.sun.javafx.stage.WindowEventDispatcher;
 import com.sun.javafx.tk.Toolkit;
+import java.security.AllPermission;
 import javafx.beans.property.ObjectPropertyBase;
 import javafx.beans.property.ReadOnlyObjectProperty;
 import javafx.beans.property.ReadOnlyObjectWrapper;
@@ -474,7 +475,18 @@
         Toolkit toolkit = Toolkit.getToolkit();
         if (visible && (impl_peer == null)) {
             // Setup the peer
-            impl_peer = toolkit.createTKPopupStage(this, getOwnerWindow().impl_getPeer(), acc);
+            StageStyle popupStyle;
+            try {
+                final SecurityManager securityManager =
+                        System.getSecurityManager();
+                if (securityManager != null) {
+                    securityManager.checkPermission(new AllPermission());
+                }
+                popupStyle = StageStyle.TRANSPARENT;
+            } catch (final SecurityException e) {
+                popupStyle = StageStyle.UNDECORATED;
+            }
+            impl_peer = toolkit.createTKPopupStage(this, popupStyle, getOwnerWindow().impl_getPeer(), acc);
             peerListener = new PopupWindowPeerListener(PopupWindow.this);
         }
     }
--- a/modules/graphics/src/main/java/javafx/stage/Stage.java	Tue Jan 14 08:21:13 2014 -0800
+++ b/modules/graphics/src/main/java/javafx/stage/Stage.java	Tue Jan 14 17:06:56 2014 -0800
@@ -50,6 +50,7 @@
 import com.sun.javafx.tk.TKPulseListener;
 import com.sun.javafx.tk.TKStage;
 import com.sun.javafx.tk.Toolkit;
+import java.security.AllPermission;
 import javafx.beans.property.DoubleProperty;
 import javafx.beans.property.DoublePropertyBase;
 import javafx.beans.property.ObjectProperty;
@@ -1043,7 +1044,20 @@
             Scene scene = getScene();
             boolean rtl = scene != null && scene.getEffectiveNodeOrientation() == NodeOrientation.RIGHT_TO_LEFT;
 
-            impl_peer = toolkit.createTKStage(this, getStyle(), isPrimary(), getModality(), tkStage, rtl, acc);
+            StageStyle stageStyle = getStyle();
+            if (stageStyle == StageStyle.TRANSPARENT) {
+                final SecurityManager securityManager =
+                        System.getSecurityManager();
+                if (securityManager != null) {
+                    try {
+                        securityManager.checkPermission(new AllPermission());
+                    } catch (final SecurityException e) {
+                        stageStyle = StageStyle.UNDECORATED;
+                    }
+                }
+            }
+            impl_peer = toolkit.createTKStage(this, stageStyle, isPrimary(),
+                                              getModality(), tkStage, rtl, acc);
             impl_peer.setMinimumSize((int) Math.ceil(getMinWidth()),
                     (int) Math.ceil(getMinHeight()));
             impl_peer.setMaximumSize((int) Math.floor(getMaxWidth()),
--- a/modules/graphics/src/test/java/com/sun/javafx/pgstub/StubToolkit.java	Tue Jan 14 08:21:13 2014 -0800
+++ b/modules/graphics/src/test/java/com/sun/javafx/pgstub/StubToolkit.java	Tue Jan 14 17:06:56 2014 -0800
@@ -126,7 +126,7 @@
     }
 
     @Override
-    public TKStage createTKPopupStage(Window peerWindow, TKStage owner, AccessControlContext acc) {
+    public TKStage createTKPopupStage(Window peerWindow, StageStyle popupStyle, TKStage owner, AccessControlContext acc) {
         return new StubPopupStage();
     }
 
@@ -351,6 +351,8 @@
     @Override public boolean isSupported(ConditionalFeature feature) {
         if (feature == ConditionalFeature.SCENE3D) {
             return true;
+        } else if (feature == ConditionalFeature.TRANSPARENT_WINDOW) {
+            return true;
         }
         return false;
     }
--- a/modules/graphics/src/test/java/com/sun/scenario/animation/AbstractMasterTimerTest.java	Tue Jan 14 08:21:13 2014 -0800
+++ b/modules/graphics/src/test/java/com/sun/scenario/animation/AbstractMasterTimerTest.java	Tue Jan 14 17:06:56 2014 -0800
@@ -28,6 +28,7 @@
 import javafx.animation.AnimationTimer;
 import com.sun.scenario.DelayedRunnable;
 import com.sun.scenario.animation.shared.PulseReceiver;
+import com.sun.scenario.animation.shared.TimerReceiver;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -123,15 +124,21 @@
                 flag.flag();
             }
         };
+
+        final TimerReceiver timerReceiver = new TimerReceiver() {
+            @Override public void handle(long l) {
+                animationTimer.handle(l);
+            }
+        };
         
         // add AnimationTimer
-        timer.addAnimationTimer(animationTimer);
+        timer.addAnimationTimer(timerReceiver);
         timer.simulatePulse();
         assertTrue(flag.isFlagged());
         
         // remove AnimationTimer
         flag.unflag();
-        timer.removeAnimationTimer(animationTimer);
+        timer.removeAnimationTimer(timerReceiver);
         timer.simulatePulse();
         assertFalse(flag.isFlagged());
     }
--- a/modules/graphics/src/test/java/javafx/concurrent/ServiceLifecycleTest.java	Tue Jan 14 08:21:13 2014 -0800
+++ b/modules/graphics/src/test/java/javafx/concurrent/ServiceLifecycleTest.java	Tue Jan 14 17:06:56 2014 -0800
@@ -41,6 +41,7 @@
 import org.junit.Test;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
@@ -153,8 +154,9 @@
      ***********************************************************************/
 
     @Test public void callingStartInReadyStateSchedulesJob() {
+        assertNull(executor.scheduled);
         service.start();
-        assertSame(factory.getCurrentTask(), executor.scheduled);
+        assertNotNull(executor.scheduled);
     }
 
     @Test public void callingStartInReadyMovesToScheduledState() {
@@ -164,8 +166,9 @@
     }
 
     @Test public void callingRestartInReadyStateSchedulesJob() {
+        assertNull(executor.scheduled);
         service.restart();
-        assertSame(factory.getCurrentTask(), executor.scheduled);
+        assertNotNull(executor.scheduled);
     }
 
     @Test public void callingRestartInReadyMovesToScheduledState() {