changeset 9608:d8249d99ccbe jdk-9+109

Merge
author kcr
date Sat, 05 Mar 2016 14:45:22 -0800
parents 89c38425ecf3 e111a3367804
children 342b190cf11f a8ca5d58b7e0
files
diffstat 20 files changed, 273 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/build.gradle	Thu Mar 03 03:42:45 2016 -0800
+++ b/build.gradle	Sat Mar 05 14:45:22 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016, 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
@@ -2392,7 +2392,21 @@
                                         args("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}",
                                              "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
                                              "BASE_NAME=avplugin", "VERSION=${version}", "LIBAV_DIR=${libavDir}",
-                                              IS_64 ? "ARCH=x64" : "ARCH=x32")
+                                             "SUFFIX=", IS_64 ? "ARCH=x64" : "ARCH=x32")
+                                    }
+                                }
+                            }
+
+                            project.ext.libav.ffmpeg.versions.each { version ->
+                                def libavDir = "${project.ext.libav.ffmpeg.basedir}-${version}"
+                                File dir = file(libavDir)
+                                if (dir.exists()) {
+                                    exec {
+                                        commandLine ("make", "${makeJobsFlag}", "-C", "${nativeSrcDir}/gstreamer/projects/linux/avplugin")
+                                        args("CC=${mediaProperties.compiler}", "LINKER=${mediaProperties.linker}",
+                                             "OUTPUT_DIR=${nativeOutputDir}", "BUILD_TYPE=${buildType}",
+                                             "BASE_NAME=avplugin", "VERSION=${version}", "LIBAV_DIR=${libavDir}",
+                                             "SUFFIX=-ffmpeg", IS_64 ? "ARCH=x64" : "ARCH=x32")
                                     }
                                 }
                             }
--- a/modules/controls/src/main/java/javafx/scene/control/SpinnerValueFactory.java	Thu Mar 03 03:42:45 2016 -0800
+++ b/modules/controls/src/main/java/javafx/scene/control/SpinnerValueFactory.java	Sat Mar 05 14:45:22 2016 -0800
@@ -720,6 +720,8 @@
             });
 
             valueProperty().addListener((o, oldValue, newValue) -> {
+                if (newValue == null) return;
+
                 // when the value is set, we need to react to ensure it is a
                 // valid value (and if not, blow up appropriately)
                 if (newValue < getMin()) {
--- a/modules/controls/src/main/java/javafx/scene/control/TableCell.java	Thu Mar 03 03:42:45 2016 -0800
+++ b/modules/controls/src/main/java/javafx/scene/control/TableCell.java	Sat Mar 05 14:45:22 2016 -0800
@@ -468,6 +468,9 @@
         updateItem(oldIndex);
         updateSelection();
         updateFocus();
+
+        // Fix for JDK-8150525
+        updateEditing();
     }
 
     private boolean isLastVisibleColumn = false;
--- a/modules/controls/src/main/java/javafx/scene/control/skin/NestedTableColumnHeader.java	Thu Mar 03 03:42:45 2016 -0800
+++ b/modules/controls/src/main/java/javafx/scene/control/skin/NestedTableColumnHeader.java	Sat Mar 05 14:45:22 2016 -0800
@@ -453,7 +453,7 @@
                 boolean found = false;
                 for (int j = 0; j < oldHeaders.size(); j++) {
                     TableColumnHeader oldColumn = oldHeaders.get(j);
-                    if (column == oldColumn.getTableColumn()) {
+                    if (oldColumn.represents(column)) {
                         newHeaders.add(oldColumn);
                         found = true;
                         break;
@@ -484,6 +484,36 @@
         }
     }
 
+    // Used to test whether this column header properly represents the given column.
+    // In particular, whether it has child column headers for all child columns
+    boolean represents(TableColumnBase<?, ?> column) {
+        if (column.getColumns().isEmpty()) {
+            // this column has no children, but we are in a NestedTableColumnHeader instance,
+            // so the match is bad.
+            return false;
+        }
+
+        if (column != getTableColumn()) {
+            return false;
+        }
+
+        final int columnCount = column.getColumns().size();
+        final int headerCount = getColumnHeaders().size();
+        if (columnCount != headerCount) {
+            return false;
+        }
+
+        for (int i = 0; i < columnCount; i++) {
+            // we expect the order of all children to match the order of the headers
+            TableColumnBase<?,?> childColumn = column.getColumns().get(i);
+            TableColumnHeader childHeader = getColumnHeaders().get(i);
+            if (!childHeader.represents(childColumn)) {
+                return false;
+            }
+        }
+        return true;
+    }
+
     /** {@inheritDoc} */
     @Override double getDragRectHeight() {
         return label.prefHeight(-1);
--- a/modules/controls/src/main/java/javafx/scene/control/skin/TableColumnHeader.java	Thu Mar 03 03:42:45 2016 -0800
+++ b/modules/controls/src/main/java/javafx/scene/control/skin/TableColumnHeader.java	Sat Mar 05 14:45:22 2016 -0800
@@ -996,6 +996,17 @@
         return getHeight();
     }
 
+    // Used to test whether this column header properly represents the given column.
+    // In particular, whether it has child column headers for all child columns
+    boolean represents(TableColumnBase<?, ?> column) {
+        if (!column.getColumns().isEmpty()) {
+            // this column has children, but we are in a TableColumnHeader instance,
+            // so the match is bad.
+            return false;
+        }
+        return column == getTableColumn();
+    }
+
 
 
     /***************************************************************************
--- a/modules/controls/src/main/java/javafx/scene/control/skin/TitledPaneSkin.java	Thu Mar 03 03:42:45 2016 -0800
+++ b/modules/controls/src/main/java/javafx/scene/control/skin/TitledPaneSkin.java	Sat Mar 05 14:45:22 2016 -0800
@@ -136,6 +136,7 @@
             }
         };
         contentContainer.setClip(clipRect);
+        updateClip();
 
         if (control.isExpanded()) {
             setTransition(1.0f);
@@ -164,8 +165,8 @@
             hpos = pos.getHpos();
             vpos = pos.getVpos();
         });
-        registerChangeListener(control.widthProperty(), e -> clipRect.setWidth(getSkinnable().getWidth()));
-        registerChangeListener(control.heightProperty(), e -> clipRect.setHeight(contentContainer.getHeight()));
+        registerChangeListener(control.widthProperty(), e -> updateClip());
+        registerChangeListener(control.heightProperty(), e -> updateClip());
         registerChangeListener(titleRegion.alignmentProperty(), e -> {
             pos = titleRegion.getAlignment();
             hpos = pos.getHpos();
@@ -236,6 +237,7 @@
         titleRegion.resize(w, headerHeight);
         positionInArea(titleRegion, x, y,
                 w, headerHeight, 0, HPos.LEFT, VPos.CENTER);
+        titleRegion.requestLayout();
 
         // content
         double contentHeight = (h - headerHeight) * getTransition();
@@ -294,6 +296,11 @@
      *                                                                         *
      **************************************************************************/
 
+    private void updateClip() {
+        clipRect.setWidth(getSkinnable().getWidth());
+        clipRect.setHeight(contentContainer.getHeight());
+    }
+
     private void setExpanded(boolean expanded) {
         if (! getSkinnable().isCollapsible()) {
             setTransition(1.0f);
--- a/modules/controls/src/test/java/test/javafx/scene/control/SpinnerTest.java	Thu Mar 03 03:42:45 2016 -0800
+++ b/modules/controls/src/test/java/test/javafx/scene/control/SpinnerTest.java	Sat Mar 05 14:45:22 2016 -0800
@@ -1274,7 +1274,7 @@
     /***************************************************************************
      *                                                                         *
      * Tests for bugs                                                          *
-     *                                                                         *                                                                         *
+     *                                                                         *
      **************************************************************************/
 
     @Test public void test_rt_39655_decrement() {
@@ -1292,4 +1292,10 @@
         intSpinner.increment();
         assertEquals(8, (int) intSpinner.getValue());
     }
+
+    @Test public void test_jdk_8150962() {
+        Spinner<Double> spinner = new Spinner<>(-100, 100, 0, 0.5);
+        spinner.getValueFactory().setValue(null);
+        assertNull(spinner.getValue());
+    }
 }
\ No newline at end of file
--- a/modules/fxml/src/main/java/com/sun/javafx/fxml/builder/ProxyBuilder.java	Thu Mar 03 03:42:45 2016 -0800
+++ b/modules/fxml/src/main/java/com/sun/javafx/fxml/builder/ProxyBuilder.java	Sat Mar 05 14:45:22 2016 -0800
@@ -33,6 +33,7 @@
 import java.util.AbstractMap;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Comparator;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedHashMap;
@@ -40,6 +41,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.TreeSet;
 import javafx.beans.NamedArg;
 import javafx.util.Builder;
 import sun.reflect.misc.ConstructorUtil;
@@ -117,10 +119,33 @@
                     + " the constructor is not properly annotated.");
         }
 
-        constructors = constructorsMap.keySet();
+        constructors = new TreeSet<>(constructorComparator);
+        constructors.addAll(constructorsMap.keySet());
         propertiesMap = scanForSetters();
     }
 
+    //make sure int goes before float
+    private final Comparator<Constructor> constructorComparator
+            = (Constructor o1, Constructor o2) -> {
+                int len1 = o1.getParameterCount();
+                int len2 = o2.getParameterCount();
+                int lim = Math.min(len1, len2);
+                for (int i = 0; i < lim; i++) {
+                    Class c1 = o1.getParameterTypes()[i];
+                    Class c2 = o2.getParameterTypes()[i];
+                    if (c1.equals(c2)) {
+                        continue;
+                    }
+                    if (c1.equals(Integer.TYPE) && c2.equals(Double.TYPE)) {
+                        return -1;
+                    }
+                    if (c1.equals(Double.TYPE) && c2.equals(Integer.TYPE)) {
+                        return 1;
+                    }
+                    return c1.getCanonicalName().compareTo(c2.getCanonicalName());
+                }
+                return len1 - len2;
+            };
     private final Map<String, Object> userValues = new HashMap<>();
 
     @Override
@@ -264,7 +289,7 @@
 
         // there may be more constructor with the same argument names
         // (this often happens in case of List<T> and T... etc.
-        Set<Constructor> chosenConstructors = new HashSet<>();
+        Set<Constructor> chosenConstructors = new TreeSet<>(constructorComparator);
         Set<String> argsNotSet = null;
         for (Constructor c : constructors) {
             Set<String> argumentNames = getArgumentNames(c);
--- a/modules/fxml/src/test/java/test/com/sun/javafx/fxml/builder/ProxyBuilderTest.java	Thu Mar 03 03:42:45 2016 -0800
+++ b/modules/fxml/src/test/java/test/com/sun/javafx/fxml/builder/ProxyBuilderTest.java	Sat Mar 05 14:45:22 2016 -0800
@@ -27,6 +27,7 @@
 import com.sun.javafx.fxml.builder.ProxyBuilder;
 import java.util.Arrays;
 import java.util.List;
+import javafx.beans.NamedArg;
 import javafx.scene.paint.Color;
 import javafx.scene.paint.Paint;
 import javafx.stage.StageStyle;
@@ -249,4 +250,70 @@
         public void get() {}
         public void set() {}
     }
+
+    public static class SameArgNames {
+        public boolean intIntCalled;
+        public boolean doubleDoubleCalled;
+
+        public SameArgNames(@NamedArg("a") int a, @NamedArg("b") int b) {
+            intIntCalled = true;
+        }
+        public SameArgNames(@NamedArg("a") double a, @NamedArg("b") double b) {
+            doubleDoubleCalled = true;
+        }
+        public void setC(int c) {}
+    }
+
+    public static class SameArgNames2 {
+        public boolean intIntCalled;
+        public boolean doubleDoubleCalled;
+
+        public SameArgNames2(@NamedArg("a") double a, @NamedArg("b") double b) {
+            doubleDoubleCalled = true;
+        }
+        public SameArgNames2(@NamedArg("a") int a, @NamedArg("b") int b) {
+            intIntCalled = true;
+        }
+        public void setC(int c) {}
+    }
+
+    private Object createObject(Class clazz, String a, String b, String c) {
+        ProxyBuilder pb = new ProxyBuilder(clazz);
+        pb.put("a", a);
+        pb.put("b", b);
+        if (c != null) {
+            pb.put("c", c);
+        }
+        return pb.build();
+    }
+
+    private void check_JDK_8146325(String a, String b, String c, boolean resInt, boolean resDouble) {
+        SameArgNames result = (SameArgNames) createObject(SameArgNames.class, a, b, c);
+        assertEquals(resInt, result.intIntCalled);
+        assertEquals(resDouble, result.doubleDoubleCalled);
+
+        SameArgNames2 result2 = (SameArgNames2) createObject(SameArgNames2.class, a, b, c);
+        assertEquals(resInt, result2.intIntCalled);
+        assertEquals(resDouble, result2.doubleDoubleCalled);
+    }
+
+    @Test
+    public void test_JDK_8146325_IntExact() {
+        check_JDK_8146325("123", "456", null, true, false);
+    }
+
+    @Test
+    public void test_JDK_8146325_IntSetter() {
+        check_JDK_8146325("123", "456", "789", true, false);
+    }
+
+    @Test
+    public void test_JDK_8146325_DoubleExact() {
+        check_JDK_8146325("123", "456.1", null, false, true);
+    }
+
+    @Test
+    public void test_JDK_8146325_DoubleSetter() {
+        check_JDK_8146325("123", "456.1", "789", false, true);
+    }
 }
--- a/modules/fxpackager/src/main/native/library/common/PosixPlatform.cpp	Thu Mar 03 03:42:45 2016 -0800
+++ b/modules/fxpackager/src/main/native/library/common/PosixPlatform.cpp	Sat Mar 05 14:45:22 2016 -0800
@@ -227,7 +227,7 @@
 bool PosixProcess::Wait() {
     bool result = false;
 
-    int status;
+    int status = 0;
     pid_t wpid;
 
     //TODO Use waitpid instead of wait
--- a/modules/graphics/src/main/native-glass/mac/GlassMenu.m	Thu Mar 03 03:42:45 2016 -0800
+++ b/modules/graphics/src/main/native-glass/mac/GlassMenu.m	Sat Mar 05 14:45:22 2016 -0800
@@ -60,7 +60,7 @@
     self = [super init];
     if (self != nil)
     {
-        self->menu = [[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@"Menubar"];
+        self->menu = [[NSMenu allocWithZone:NSDefaultMallocZone()] initWithTitle:@"Menubar"];
     }
     return self;
 }
@@ -82,17 +82,17 @@
     {
         GET_MAIN_JENV;
         self->jDelegate = (*env)->NewGlobalRef(env, jdelegate);
-        NSString* title = [GlassHelper nsStringWithJavaString:jtitle withEnv:env];
+        NSString *title = [GlassHelper nsStringWithJavaString:jtitle withEnv:env];
         LOG("initWithJavajdelegate: jdelegate %p jtitle %s",
             jdelegate, [title UTF8String]);
 
-        self->item = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:title
-                                                                          action:NULL
-                                                                   keyEquivalent:@""];
+        self->item = [[NSMenuItem alloc] initWithTitle:title
+                                                action:NULL
+                                         keyEquivalent:@""];
         [self->item setEnabled:(BOOL)jenabled];
         [self->item setTarget:self];
 
-        self->menu = [[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:[self->item title]];
+        self->menu = [[NSMenu alloc] initWithTitle:[self->item title]];
         [self->menu setDelegate: self];
     }
     return self;
@@ -117,9 +117,9 @@
         LOG("initWithJavajdelegate: jdelegate %p jcallback %p jtitle %s",
             jdelegate, jcallback, [title UTF8String]);
 
-        self->item = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:title
-                                                                          action:@selector(action:)
-                                                                   keyEquivalent:shortcut];
+        self->item = [[NSMenuItem alloc] initWithTitle:title
+                                                action:@selector(action:)
+                                         keyEquivalent:shortcut];
         if (jshortcut != '\0')
         {
             [self _setShortcut:jshortcut modifiers:jmodifiers];
@@ -292,7 +292,7 @@
     GLASS_ASSERT_MAIN_JAVA_THREAD(env);
     GLASS_POOL_ENTER;
     {
-        GlassMenubar *menubar = [[GlassMenubar allocWithZone:[NSMenu menuZone]] init];
+        GlassMenubar *menubar = [[GlassMenubar alloc] init];
         value = ptr_to_jlong(menubar);
     }
     GLASS_POOL_EXIT;
@@ -522,7 +522,13 @@
     GLASS_POOL_ENTER;
     {
         GlassMenu *menu = (GlassMenu *)jlong_to_ptr(jMenuPtr);
-        [menu->item setTitle:[GlassHelper nsStringWithJavaString:jTitle withEnv:env]];
+        NSInteger index = [[NSApp mainMenu] indexOfItem: menu->item];
+        NSString *title = [GlassHelper nsStringWithJavaString:jTitle withEnv:env];
+        if (index != -1) {
+            [[[[NSApp mainMenu] itemAtIndex:index] submenu] setTitle: title];
+        } else {
+            [menu->item setTitle:title];
+        }
     }
     GLASS_POOL_EXIT;
     GLASS_CHECK_EXCEPTION(env);
--- a/modules/media/src/main/native/gstreamer/gstreamer-lite/gstreamer/gst/gstregistry.c	Thu Mar 03 03:42:45 2016 -0800
+++ b/modules/media/src/main/native/gstreamer/gstreamer-lite/gstreamer/gst/gstregistry.c	Sat Mar 05 14:45:22 2016 -0800
@@ -157,7 +157,8 @@
 #include <link.h>
 #include <dlfcn.h>
 
-static const int AVCODEC_EXPLICIT_VERSIONS[] = { 53, 54, 55 };
+static const int AVCODEC_EXPLICIT_VERSIONS[] = { 53, 54, 55, 56 };
+static const int AVCODEC_FFMPEG_EXPLICIT_VERSIONS[] = { 56 };
 
 typedef unsigned (*avcodec_version_proto)();
 
@@ -1308,6 +1309,7 @@
   gchar *filename_partial;
 #ifdef LINUX
   void *avcHandle = NULL;
+  gboolean isAVCFFMPEG = FALSE;
 #endif // LINUX
 #endif // GSTREAMER_LITE
 
@@ -1382,6 +1384,22 @@
               g_free(libname);
           }
 
+          // Look for libavcodec-ffmpeg if libavcodec is not available
+          if (avcHandle == NULL)
+          {
+              vi = (sizeof(AVCODEC_FFMPEG_EXPLICIT_VERSIONS)/sizeof(AVCODEC_FFMPEG_EXPLICIT_VERSIONS[0]));
+              while(!avcHandle && --vi >= 0)
+              {
+                int version = AVCODEC_FFMPEG_EXPLICIT_VERSIONS[vi];
+                gchar* libname = g_strdup_printf("libavcodec-ffmpeg.so.%d", version);
+                avcHandle = dlopen(libname, RTLD_NOW);
+                g_free(libname);
+              }
+
+              if (avcHandle)
+                isAVCFFMPEG = TRUE;
+          }
+
           if (avcHandle)
           {
               dlclose(avcHandle);
@@ -1392,7 +1410,10 @@
               if (g_stat (filename, &file_status) < 0) // Not available, create a versioned filename
               {
                   g_free(filename);
-                  filename = g_strdup_printf("%s-%d%s", filename_partial, AVCODEC_EXPLICIT_VERSIONS[vi], GST_EXTRA_MODULE_SUFFIX);
+                  if (isAVCFFMPEG)
+                    filename = g_strdup_printf("%s-ffmpeg-%d%s", filename_partial, AVCODEC_FFMPEG_EXPLICIT_VERSIONS[vi], GST_EXTRA_MODULE_SUFFIX);
+                  else
+                    filename = g_strdup_printf("%s-%d%s", filename_partial, AVCODEC_EXPLICIT_VERSIONS[vi], GST_EXTRA_MODULE_SUFFIX);
               }
           }
           else
--- a/modules/media/src/main/native/gstreamer/projects/linux/avplugin/Makefile	Thu Mar 03 03:42:45 2016 -0800
+++ b/modules/media/src/main/native/gstreamer/projects/linux/avplugin/Makefile	Sat Mar 05 14:45:22 2016 -0800
@@ -10,8 +10,8 @@
 DIRLIST = av
 
 ifneq ($(strip $(VERSION)),)
-TARGET = $(BUILD_DIR)/lib$(BASE_NAME)-$(VERSION).so
-OBJBASE_DIR = $(BUILD_DIR)/obj/plugins/avplugin-$(VERSION)
+TARGET = $(BUILD_DIR)/lib$(BASE_NAME)$(SUFFIX)-$(VERSION).so
+OBJBASE_DIR = $(BUILD_DIR)/obj/plugins/$(BASE_NAME)$(SUFFIX)-$(VERSION)
 else
 TARGET = $(BUILD_DIR)/lib$(BASE_NAME).so
 OBJBASE_DIR = $(BUILD_DIR)/obj/plugins/avplugin
--- a/modules/web/src/main/java/com/sun/javafx/webkit/prism/PrismInvoker.java	Thu Mar 03 03:42:45 2016 -0800
+++ b/modules/web/src/main/java/com/sun/javafx/webkit/prism/PrismInvoker.java	Sat Mar 05 14:45:22 2016 -0800
@@ -58,7 +58,7 @@
         return Toolkit.getToolkit().isFxUserThread();
     }
 
-    @Override protected void checkEventThread() {
+    @Override public void checkEventThread() {
         Toolkit.getToolkit().checkFxUserThread();
     }
 
--- a/modules/web/src/main/java/com/sun/webkit/Invoker.java	Thu Mar 03 03:42:45 2016 -0800
+++ b/modules/web/src/main/java/com/sun/webkit/Invoker.java	Sat Mar 05 14:45:22 2016 -0800
@@ -79,7 +79,7 @@
      * @throws IllegalStateException if the current thread is not the event
      *         thread
      */
-    protected void checkEventThread() {
+    public void checkEventThread() {
         if (!isEventThread()) {
             throw new IllegalStateException("Current thread is not event thread"
                     + ", current thread: " + Thread.currentThread().getName());
--- a/modules/web/src/main/java/com/sun/webkit/dom/JSObject.java	Thu Mar 03 03:42:45 2016 -0800
+++ b/modules/web/src/main/java/com/sun/webkit/dom/JSObject.java	Sat Mar 05 14:45:22 2016 -0800
@@ -25,6 +25,7 @@
 
 package com.sun.webkit.dom;
 
+import com.sun.webkit.Invoker;
 import java.security.AccessControlContext;
 import java.security.AccessController;
 import netscape.javascript.JSException;
@@ -49,6 +50,7 @@
 
     @Override
     public Object eval(String s) throws JSException {
+        Invoker.getInvoker().checkEventThread();
         return evalImpl(peer, peer_type, s);
     }
     private static native Object evalImpl(long peer, int peer_type,
@@ -56,6 +58,7 @@
 
     @Override
     public Object getMember(String name) {
+        Invoker.getInvoker().checkEventThread();
         return getMemberImpl(peer, peer_type, name);
     }
     private static native Object getMemberImpl(long peer, int peer_type,
@@ -63,6 +66,7 @@
 
     @Override
     public void setMember(String name, Object value) throws JSException {
+        Invoker.getInvoker().checkEventThread();
         setMemberImpl(peer, peer_type, name, value,
                       AccessController.getContext());
     }
@@ -72,6 +76,7 @@
 
     @Override
     public void removeMember(String name) throws JSException {
+        Invoker.getInvoker().checkEventThread();
         removeMemberImpl(peer, peer_type, name);
     }
     private static native void removeMemberImpl(long peer, int peer_type,
@@ -79,6 +84,7 @@
 
     @Override
     public Object getSlot(int index) throws JSException {
+        Invoker.getInvoker().checkEventThread();
         return getSlotImpl(peer, peer_type, index);
     }
     private static native Object getSlotImpl(long peer, int peer_type,
@@ -86,6 +92,7 @@
 
     @Override
     public void setSlot(int index, Object value) throws JSException {
+        Invoker.getInvoker().checkEventThread();
         setSlotImpl(peer, peer_type, index, value,
                     AccessController.getContext());
     }
@@ -95,6 +102,7 @@
 
     @Override
     public Object call(String methodName, Object... args) throws JSException {
+        Invoker.getInvoker().checkEventThread();
         return callImpl(peer, peer_type, methodName, args,
                         AccessController.getContext());
     }
@@ -104,6 +112,7 @@
 
     @Override
     public String toString() {
+        Invoker.getInvoker().checkEventThread();
         return toStringImpl(peer, peer_type);
     }
     private static native String toStringImpl(long peer, int peer_type);
--- a/modules/web/src/main/java/javafx/scene/web/WebView.java	Thu Mar 03 03:42:45 2016 -0800
+++ b/modules/web/src/main/java/javafx/scene/web/WebView.java	Sat Mar 05 14:45:22 2016 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2016, 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
@@ -54,6 +54,8 @@
 import javafx.scene.input.ScrollEvent;
 import javafx.scene.input.TransferMode;
 import javafx.scene.text.FontSmoothingType;
+import javafx.stage.Stage;
+import javafx.stage.Window;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -947,6 +949,28 @@
 
     // event handling
 
+    // To handle stage pulse we need to know if currently webview and
+    // tree is visible or not
+    private boolean isTreeReallyVisible() {
+        if (getScene() == null) {
+            return false;
+        }
+
+        final Window window = getScene().getWindow();
+
+        if (window == null) {
+            return false;
+        }
+
+        boolean iconified = (window instanceof Stage) ? ((Stage)window).isIconified() : false;
+
+        return impl_isTreeVisible()
+               && window.isShowing()
+               && window.getWidth() > 0
+               && window.getHeight() > 0
+               && !iconified;
+    }
+
     private void handleStagePulse() {
         // The stage pulse occurs before the scene pulse.
         // Here the page content is updated before CSS/Layout/Sync pass
@@ -964,10 +988,7 @@
 
         if (page == null) return;
 
-        boolean reallyVisible = impl_isTreeVisible()
-                && getScene() != null
-                && getScene().getWindow() != null
-                && getScene().getWindow().isShowing();
+        boolean reallyVisible = isTreeReallyVisible();
 
         if (reallyVisible) {
             if (page.isDirty()) {
--- a/modules/web/src/main/native/Source/WebCore/loader/cache/CachedResourceLoader.cpp	Thu Mar 03 03:42:45 2016 -0800
+++ b/modules/web/src/main/native/Source/WebCore/loader/cache/CachedResourceLoader.cpp	Sat Mar 05 14:45:22 2016 -0800
@@ -822,7 +822,7 @@
 
 void CachedResourceLoader::checkForPendingPreloads()
 {
-    if (m_pendingPreloads.isEmpty() || !m_document->body() || !m_document->body()->renderer())
+    if (m_pendingPreloads.isEmpty() || !m_document || !m_document->body() || !m_document->body()->renderer())
         return;
 #if PLATFORM(IOS)
     // We always preload resources on iOS. See <https://bugs.webkit.org/show_bug.cgi?id=91276>.
--- a/modules/web/src/main/native/Source/WebCore/platform/java/WebPage.cpp	Thu Mar 03 03:42:45 2016 -0800
+++ b/modules/web/src/main/native/Source/WebCore/platform/java/WebPage.cpp	Sat Mar 05 14:45:22 2016 -0800
@@ -840,6 +840,8 @@
     settings.setLoadsImagesAutomatically(true);
     settings.setMinimumFontSize(0);
     settings.setMinimumLogicalFontSize(5);
+    // FIXME(arunprsad): Will be addressed in JDK-8148129.
+    settings.setAcceleratedCompositingEnabled(false);
     settings.setScriptEnabled(true);
     settings.setJavaScriptCanOpenWindowsAutomatically(true);
     settings.setPluginsEnabled(usePlugins);
--- a/modules/web/src/test/java/test/javafx/scene/web/MiscellaneousTest.java	Thu Mar 03 03:42:45 2016 -0800
+++ b/modules/web/src/test/java/test/javafx/scene/web/MiscellaneousTest.java	Sat Mar 05 14:45:22 2016 -0800
@@ -127,6 +127,23 @@
         });
     }
 
+    // JDK-8133775
+    @Test(expected = IllegalStateException.class) public void testDOMObjectThreadOwnership() {
+          class IllegalStateExceptionChecker {
+              public Object resultObject;
+              public void start() {
+                 WebEngine engine = new WebEngine();
+                 // Get DOM object from JavaFX Application Thread.
+                 resultObject = engine.executeScript("document.createElement('span')");
+              }
+           }
+           IllegalStateExceptionChecker obj = new IllegalStateExceptionChecker();
+           submit(obj::start);
+           // Try accessing the resultObject created in JavaFX Application Thread
+           // from someother thread. It should throw an exception.
+           obj.resultObject.toString();
+     }
+
     private WebEngine createWebEngine() {
         return submit(() -> new WebEngine());
     }