changeset 10826:b09eba4b1f0c

Merge
author kcr
date Fri, 02 Feb 2018 10:04:10 -0800
parents 648d92cb8881 db96238aa863
children c2cba21c4ba6 146fe4679946
files .hgtags modules/javafx.web/src/main/native/Source/WebCore/bridge/jni/jni_jsobject.mm modules/javafx.web/src/main/native/Source/WebCore/bridge/jni/jni_objc.mm
diffstat 51 files changed, 809 insertions(+), 1059 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Wed Jan 31 06:40:25 2018 -0800
+++ b/.hgtags	Fri Feb 02 10:04:10 2018 -0800
@@ -473,6 +473,7 @@
 3932162186a7b4c53945256818eb7723d1b6a71e jdk-10+34
 90773bfb2a58cce7c1aede30cc47f28cb9c53fe6 jdk-10+35
 674513271a88e51bcd2fb598634519d5f5f46270 jdk-10+36
+afed83541a56745884906842049658b84f1c2650 jdk-11+0
 afed83541a56745884906842049658b84f1c2650 jdk-10+37
 14621a723393fd1f6fc79f5445d8d6cdba8917c0 jdk-10+38
 b43e44ecc365e7ed2063bcdbf60152cbd5e28e5a jdk-10+39
--- a/build.gradle	Wed Jan 31 06:40:25 2018 -0800
+++ b/build.gradle	Fri Feb 02 10:04:10 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2018, 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
@@ -341,6 +341,9 @@
 defineProperty("javaVersion", javaVersionInfo[0])
 defineProperty("javaBuildNumber", javaVersionInfo[1])
 
+defineProperty("libAVRepositoryURL", "https://libav.org/releases/")
+defineProperty("FFmpegRepositoryURL", "https://www.ffmpeg.org/releases/")
+
 loadProperties("$projectDir/build.properties")
 
 // Look for stub runtime in either JDK or modular-sdk dir layout
@@ -386,6 +389,15 @@
 defineProperty("COMPILE_MEDIA", "false")
 ext.IS_COMPILE_MEDIA = Boolean.parseBoolean(COMPILE_MEDIA)
 
+// BUILD_LIBAV_STUBS specifies whether to download and build libav/ffmpeg libraries
+defineProperty("BUILD_LIBAV_STUBS", "false")
+ext.IS_BUILD_LIBAV_STUBS = IS_LINUX ? Boolean.parseBoolean(BUILD_LIBAV_STUBS) : false
+
+// BUILD_WORKING_LIBAV specifies whether to build libav/ffmpeg libraries with
+// decoder, demuxer, etc. required to run media. Valid only if BUILD_LIBAV_STUBS is true.
+defineProperty("BUILD_WORKING_LIBAV", "false")
+ext.IS_BUILD_WORKING_LIBAV = IS_LINUX ? Boolean.parseBoolean(BUILD_WORKING_LIBAV) : false
+
 // COMPILE_PANGO specifies whether to build javafx_font_pango.
 defineProperty("COMPILE_PANGO", "${IS_LINUX}")
 ext.IS_COMPILE_PANGO = Boolean.parseBoolean(COMPILE_PANGO)
@@ -1493,6 +1505,23 @@
         }
     }
 
+    if (!BUILD_CLOSED && IS_BUILD_LIBAV_STUBS) {
+        repositories {
+            ivy {
+                url libAVRepositoryURL
+                layout "pattern", {
+                    artifact "[artifact].[ext]"
+                }
+            }
+            ivy {
+                url FFmpegRepositoryURL
+                layout "pattern", {
+                    artifact "[artifact].[ext]"
+                }
+            }
+        }
+    }
+
     // We want to configure all projects as java projects and use the same compile settings
     // etc, except for the root project which we just want to ignore (and for now media)
     if (project == rootProject) {
@@ -1556,7 +1585,6 @@
 def qualExportsCore = [
     "--add-exports=java.base/jdk.internal.misc=javafx.graphics",
     "--add-exports=java.base/jdk.internal.ref=javafx.media",
-    "--add-exports=java.base/sun.net.www=javafx.web",
     "--add-exports=java.base/sun.nio.ch=javafx.media",
     "--add-exports=java.base/sun.reflect.misc=javafx.base",
     "--add-exports=java.base/sun.reflect.misc=javafx.fxml",
@@ -2934,6 +2962,14 @@
     commonModuleSetup(project, [ 'base', 'graphics', 'media' ])
 
     dependencies {
+        if (IS_BUILD_LIBAV_STUBS) {
+            media name: "libav-0.7.3", ext: "tar.gz"
+            media name: "libav-9.14", ext: "tar.gz"
+            media name: "libav-10.7", ext: "tar.gz"
+            media name: "libav-11.4", ext: "tar.gz"
+            media name: "libav-12.1", ext: "tar.gz"
+            media name: "ffmpeg-3.3.3", ext: "tar.gz"
+        }
     }
 
     compileJava.dependsOn updateCacheIfNeeded
@@ -3071,11 +3107,286 @@
             buildNative.dependsOn buildPlugins
 
             if (t.name == "linux") {
-                def buildAVPlugin = task( "buildAVPlugin", dependsOn: [buildPlugins]) {
+                // Pre-defined command line arguments
+                def cfgCMDArgs = ["sh", "configure"]
+                def commonCfgArgs = ["--enable-shared", "--disable-debug", "--disable-static", "--disable-yasm", "--disable-doc", "--disable-programs", "--disable-everything"]
+                def codecsCfgArgs = ["--enable-decoder=aac,mp3,mp3float,h264", "--enable-parser=aac,h264", "--enable-demuxer=aac,h264,mpegts,mpegtsraw"]
+
+                def copyLibAVStubs = {String fromDir, String toDir ->
+                    FileCollection config = files("config.h")
+                    FileCollection libavcodec = files("avcodec.h", "avfft.h", "dxva2.h", "vaapi.h", "vda.h",
+                                                      "vdpau.h", "version.h", "xvmc.h", "old_codec_ids.h")
+                    FileCollection libavdevice = files("avdevice.h", "version.h")
+                    FileCollection libavfilter = files("avfiltergraph.h", "avfilter.h", "buffersink.h", "buffersrc.h", "version.h");
+                    FileCollection libavformat = files("avformat.h", "avio.h", "version.h")
+                    FileCollection libavresample = files("avresample.h", "version.h")
+                    FileCollection libavutil = files("adler32.h", "blowfish.h", "error.h", "log.h", "pixfmt.h",
+                                                     "aes.h", "bswap.h", "eval.h", "lzo.h", "random_seed.h",
+                                                     "attributes.h", "buffer.h", "fifo.h", "macros.h", "rational.h",
+                                                     "audio_fifo.h", "channel_layout.h", "file.h", "mathematics.h", "samplefmt.h",
+                                                     "avassert.h", "common.h", "frame.h", "md5.h", "sha.h",
+                                                     "avconfig.h", "imgutils.h", "mem.h", "time.h", "avstring.h",
+                                                     "cpu_internal.h", "intfloat.h", "opt.h", "version.h", "avutil.h",
+                                                     "crc.h", "intreadwrite.h", "parseutils.h", "xtea.h", "base64.h",
+                                                     "dict.h", "lfg.h", "pixdesc.h", "intfloat_readwrite.h", "old_pix_fmts.h", "audioconvert.h",
+                                                     "cpu.h")
+                    FileCollection libavutil_x86 = files("cpu.h") // Use cpu.h from x86 instead of libavutil root if exist
+                    FileCollection libswscale = files("swscale.h", "version.h")
+
+                    def copyLibAVFiles = {FileCollection files, String fDir, String tDir ->
+                        File dir = file(tDir)
+                        dir.mkdirs()
+
+                        files.each { File file ->
+                            copy {
+                                from fDir
+                                into tDir
+                                include file.name
+                            }
+                        }
+                    }
+
+                    copyLibAVFiles(config, fromDir, "${toDir}/include")
+                    copyLibAVFiles(libavcodec, "${fromDir}/libavcodec", "${toDir}/include/libavcodec")
+                    copyLibAVFiles(libavdevice, "${fromDir}/libavdevice", "${toDir}/include/libavdevice")
+                    copyLibAVFiles(libavfilter, "${fromDir}/libavfilter", "${toDir}/include/libavfilter")
+                    copyLibAVFiles(libavformat, "${fromDir}/libavformat", "${toDir}/include/libavformat")
+                    copyLibAVFiles(libavresample, "${fromDir}/libavresample", "${toDir}/include/libavresample")
+                    copyLibAVFiles(libavutil, "${fromDir}/libavutil", "${toDir}/include/libavutil")
+                    copyLibAVFiles(libavutil_x86, "${fromDir}/libavutil/x86", "${toDir}/include/libavutil")
+                    copyLibAVFiles(libswscale, "${fromDir}/libswscale", "${toDir}/include/libswscale")
+
+                    // Copy libs
+                    FileTree libs = fileTree(dir: "${fromDir}", include: "**/*.so*")
+                    libs.each {File file ->
+                        copy {
+                            from file
+                            into "${toDir}/lib"
+                        }
+                    }
+                }
+
+                def buildLibAVStubs = task("buildLibAVStubs", dependsOn: []) {
+                    enabled = IS_BUILD_LIBAV_STUBS
+
+                    doLast {
+                        project.ext.libav = [:]
+                        project.ext.libav.basedir = "${buildDir}/native/linux/libav"
+                        project.ext.libav.versions = [ "0.7.3", "9.14", "10.7", "11.4", "12.1" ]
+                        project.ext.libav.versionmap = [ "0.7.3" : "53", "9.14" : "54", "10.7" : "55", "11.4" : "56", "12.1" : "57" ]
+
+                        libav.versions.each { version ->
+                            def libavDir = "${libav.basedir}/libav-${version}"
+                            for (File f : configurations.media.files) {
+                                if (f.name.startsWith("libav-${version}")) {
+                                    File dir = file(libavDir)
+                                    dir.mkdirs()
+                                    def libavTar = "${libav.basedir}/libav-${version}.tar"
+                                    ant.gunzip(src: f, dest: libavTar)
+                                    ant.untar(src: libavTar, dest: libav.basedir)
+                                }
+                            }
+                        }
+
+                        libav.versions.each { version ->
+                            def libavDir = "${libav.basedir}/libav-${version}"
+                            File dir = file(libavDir)
+                            if (dir.exists()) {
+                                def configFile = "${libav.basedir}/libav-${version}/config.h"
+                                File cfgFile = file(configFile)
+                                if (!cfgFile.exists()) {
+                                    // Add execute permissions to version.sh, otherwise build fails
+                                    exec {
+                                        workingDir("$libavDir")
+                                        commandLine("chmod", "+x", "version.sh")
+                                    }
+                                    exec {
+                                        workingDir("$libavDir")
+                                        if (version.equals("0.7.3")) {
+                                            if (IS_BUILD_WORKING_LIBAV) {
+                                                commandLine("sh", "configure", "--enable-shared", "--disable-debug", "--disable-static", "--disable-yasm", "--disable-doc", "--disable-everything", "--disable-mmx", "--disable-mmx2", "--enable-decoder=aac,mp3,mp3float,h264", "--enable-parser=aac,h264", "--enable-demuxer=aac,h264,mpegts,mpegtsraw")
+                                            } else {
+                                                commandLine("sh", "configure", "--enable-shared", "--disable-debug", "--disable-static", "--disable-yasm", "--disable-doc", "--disable-everything", "--disable-mmx", "--disable-mmx2")
+                                            }
+                                        } else {
+                                            if (IS_BUILD_WORKING_LIBAV) {
+                                                commandLine(cfgCMDArgs + commonCfgArgs + codecsCfgArgs)
+                                            } else {
+                                                commandLine(cfgCMDArgs + commonCfgArgs)
+                                            }
+                                        }
+                                    }
+                                }
+                                exec {
+                                    workingDir("$libavDir")
+                                    commandLine("make")
+                                }
+                            }
+                        }
+
+                        libav.versions.each { version ->
+                            def fromDir = "${libav.basedir}/libav-${version}"
+                            def majorVersion = libav.versionmap[version]
+                            def toDir = "${libav.basedir}/libav-${majorVersion}"
+                            copyLibAVStubs(fromDir, toDir)
+                        }
+                    }
+                }
+
+                def buildLibAVFFmpegStubs = task("buildLibAVFFmpegStubs", dependsOn: []) {
+                    enabled = IS_BUILD_LIBAV_STUBS
+
+                    def extraCfgArgs = ["--build-suffix=-ffmpeg"]
+
+                    doLast {
+                        project.ext.libav = [:]
+                        project.ext.libav.basedir = "${buildDir}/native/linux/libavffmpeg"
+                        project.ext.libav.versions = [ "11.4" ]
+                        project.ext.libav.versionmap = [ "11.4" : "56" ]
+
+                        libav.versions.each { version ->
+                            def libavDir = "${libav.basedir}/libav-${version}"
+                            for (File f : configurations.media.files) {
+                                if (f.name.startsWith("libav-${version}")) {
+                                    File dir = file(libavDir)
+                                    dir.mkdirs()
+                                    def libavTar = "${libav.basedir}/libav-${version}.tar"
+                                    ant.gunzip(src: f, dest: libavTar)
+                                    ant.untar(src: libavTar, dest: libav.basedir)
+                                }
+                            }
+                        }
+
+                        libav.versions.each { version ->
+                            def libavDir = "${libav.basedir}/libav-${version}"
+                            File dir = file(libavDir)
+                            if (dir.exists()) {
+                                def configFile = "${libav.basedir}/libav-${version}/config.h"
+                                File cfgFile = file(configFile)
+                                if (!cfgFile.exists()) {
+                                    // Patch *.v files, so we have *_FFMPEG_$MAJOR instead of *_$MAJOR, otherwise library will not be loaded
+                                    FileTree vfiles = fileTree(dir: "${libavDir}", include: "**/*.v")
+                                    vfiles.each {File file ->
+                                        String data = file.getText("UTF-8")
+                                        data = data.replace("_\$MAJOR", "_FFMPEG_\$MAJOR")
+                                        file.write(data, "UTF-8")
+                                    }
+                                    // Add execute permissions to version.sh, otherwise build fails
+                                    exec {
+                                        workingDir("$libavDir")
+                                        commandLine("chmod", "+x", "version.sh")
+                                    }
+                                    exec {
+                                        workingDir("$libavDir")
+                                        if (IS_BUILD_WORKING_LIBAV) {
+                                            commandLine(cfgCMDArgs + commonCfgArgs + codecsCfgArgs + extraCfgArgs)
+                                        } else {
+                                            commandLine(cfgCMDArgs + commonCfgArgs + extraCfgArgs)
+                                        }
+                                    }
+                                }
+                                exec {
+                                    workingDir("$libavDir")
+                                    commandLine("make")
+                                }
+                            }
+                        }
+
+                        libav.versions.each { version ->
+                            def fromDir = "${libav.basedir}/libav-${version}"
+                            def majorVersion = libav.versionmap[version]
+                            def toDir = "${libav.basedir}/libav-${majorVersion}"
+                            copyLibAVStubs(fromDir, toDir)
+
+                            // Special case to copy *-ffmpeg.so to *.so
+                            FileTree libs = fileTree(dir: "${fromDir}", include: "**/*-ffmpeg.so")
+                            libs.each {File file ->
+                                copy {
+                                    from file
+                                    into "${toDir}/lib"
+                                    rename { String fileName ->
+                                        fileName.replace("-ffmpeg", "")
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+
+                def buildFFmpegStubs = task("buildFFmpegStubs", dependsOn: []) {
+                    enabled = IS_BUILD_LIBAV_STUBS
+
+                    doLast {
+                        project.ext.libav = [:]
+                        project.ext.libav.basedir = "${buildDir}/native/linux/ffmpeg"
+                        project.ext.libav.versions = [ "3.3.3" ]
+                        project.ext.libav.versionmap = [ "3.3.3" : "57" ]
+
+                        libav.versions.each { version ->
+                            def libavDir = "${libav.basedir}/ffmpeg-${version}"
+                            for (File f : configurations.media.files) {
+                                if (f.name.startsWith("ffmpeg-${version}")) {
+                                    File dir = file(libavDir)
+                                    dir.mkdirs()
+                                    def libavTar = "${libav.basedir}/ffmpeg-${version}.tar"
+                                    ant.gunzip(src: f, dest: libavTar)
+                                    ant.untar(src: libavTar, dest: libav.basedir)
+                                }
+                            }
+                        }
+
+                        libav.versions.each { version ->
+                            def libavDir = "${libav.basedir}/ffmpeg-${version}"
+                            File dir = file(libavDir)
+                            if (dir.exists()) {
+                                def configFile = "${libav.basedir}/ffmpeg-${version}/config.h"
+                                File cfgFile = file(configFile)
+                                if (!cfgFile.exists()) {
+                                    // Add execute permissions to version.sh, otherwise build fails
+                                    exec {
+                                        workingDir("$libavDir")
+                                        commandLine("chmod", "+x", "version.sh")
+                                    }
+                                    exec {
+                                        workingDir("$libavDir")
+                                        if (IS_BUILD_WORKING_LIBAV) {
+                                            commandLine(cfgCMDArgs + commonCfgArgs + codecsCfgArgs)
+                                        } else {
+                                            commandLine(cfgCMDArgs + commonCfgArgs)
+                                        }
+                                    }
+                                }
+                                exec {
+                                    workingDir("$libavDir")
+                                    commandLine("make")
+                                }
+                            }
+                        }
+
+                        libav.versions.each { version ->
+                            def fromDir = "${libav.basedir}/ffmpeg-${version}"
+                            def majorVersion = libav.versionmap[version]
+                            def toDir = "${libav.basedir}/ffmpeg-${majorVersion}"
+                            copyLibAVStubs(fromDir, toDir)
+                        }
+                    }
+                }
+
+                def buildAVPlugin = task( "buildAVPlugin", dependsOn: [buildPlugins, buildLibAVStubs, buildLibAVFFmpegStubs, buildFFmpegStubs]) {
                     enabled = IS_COMPILE_MEDIA
 
                     doLast {
-                        if (project.ext.properties.containsKey("libav")) {
+                        if (IS_BUILD_LIBAV_STUBS) {
+                            project.ext.libav = [:]
+                            project.ext.libav.basedir = "${buildDir}/native/linux/libav/libav"
+                            project.ext.libav.versions = [ "53", "54", "55", "56", "57" ]
+                            project.ext.libav.libavffmpeg = [:]
+                            project.ext.libav.libavffmpeg.basedir = "${buildDir}/native/linux/libavffmpeg/libav"
+                            project.ext.libav.libavffmpeg.versions = [ "56" ]
+                            project.ext.libav.ffmpeg = [:]
+                            project.ext.libav.ffmpeg.basedir = "${buildDir}/native/linux/ffmpeg/ffmpeg"
+                            project.ext.libav.ffmpeg.versions = [ "57" ]
+
                             project.ext.libav.versions.each { version ->
                                 def libavDir = "${project.ext.libav.basedir}-${version}"
                                 File dir = file(libavDir)
@@ -3090,6 +3401,20 @@
                                 }
                             }
 
+                            project.ext.libav.libavffmpeg.versions.each { version ->
+                                def libavDir = "${project.ext.libav.libavffmpeg.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")
+                                    }
+                                }
+                            }
+
                             project.ext.libav.ffmpeg.versions.each { version ->
                                 def libavDir = "${project.ext.libav.ffmpeg.basedir}-${version}"
                                 File dir = file(libavDir)
@@ -3784,7 +4109,16 @@
     doLast {
         projectsToDocument.each { p ->
             copy {
-                from "$p.projectDir/src/main/docs"
+                from("$p.projectDir/src/main/docs") {
+                    include "**/*.html"
+                    filter { line->
+                        line = line.replace("@FXVERSION@", RELEASE_VERSION)
+                    }
+                }
+                from("$p.projectDir/src/main/docs") {
+                    exclude "**/*.html"
+                }
+
                 into "$buildDir/javadoc"
             }
         }
@@ -4175,10 +4509,20 @@
         // Copy .html and other files needed for doc bundles
         def copyDocFiles = project.task("copyDocFiles$t.capital", type: Copy, dependsOn: copySourceFilesTask) {
             if (copySources) {
-                from "${project.projectDir}/src/main/java"
-                from "${project.projectDir}/src/main/docs"
+                from("${project.projectDir}/src/main/docs") {
+                    include "**/*.html"
+                    filter { line->
+                        line = line.replace("@FXVERSION@", RELEASE_VERSION)
+                    }
+                }
+                from("${project.projectDir}/src/main/docs") {
+                    exclude "**/*.html"
+                }
+                from("${project.projectDir}/src/main/java") {
+                    exclude "**/*.java"
+                }
+
                 into "${modulesSrcDir}/${moduleName}"
-                exclude "**/*.java"
             }
         }
 
--- a/build.properties	Wed Jan 31 06:40:25 2018 -0800
+++ b/build.properties	Fri Feb 02 10:04:10 2018 -0800
@@ -39,7 +39,7 @@
 jfx.release.suffix=-ea
 
 # UPDATE THE FOLLOWING VALUES FOR A NEW RELEASE
-jfx.release.major.version=10
+jfx.release.major.version=11
 jfx.release.minor.version=0
 jfx.release.security.version=0
 jfx.release.patch.version=0
@@ -56,8 +56,8 @@
 
 javadoc.bottom=<small><a href="http://bugreport.java.com/bugreport/">Report a bug or suggest an enhancement</a><br> Copyright &copy; 2008, 2018, Oracle and/or its affiliates. All rights reserved.</small>
 
-javadoc.title=JavaFX 10
-javadoc.header=JavaFX&nbsp;10
+javadoc.title=JavaFX 11
+javadoc.header=JavaFX&nbsp;11
 
 ##############################################################################
 #
--- a/buildSrc/addExports	Wed Jan 31 06:40:25 2018 -0800
+++ b/buildSrc/addExports	Fri Feb 02 10:04:10 2018 -0800
@@ -1,14 +1,17 @@
-# buildSrc/addExports: temporary --add-exports
+# buildSrc/addExports: temporary --add-exports and --add-reads
 #
 # After a promoted jdk build includes the module-info changes associated
-# with a particular fix, we might eventually remove the --add-exports from
-# this file for that fix, after bumping the minimum jdk to that build.
+# with a particular fix, we might eventually remove the --add-exports or
+# --add-reads from this file for that fix, after bumping the minimum jdk
+# to that build.
 #
 # ----------------------------------------------------------------------
 #
 # Qualified exports for JDK-8177566
 --add-exports=javafx.base/com.sun.javafx.reflect=javafx.fxml
 --add-exports=javafx.base/com.sun.javafx.reflect=javafx.web
+# Reads for JDK-8195801
+--add-reads=javafx.graphics=jdk.unsupported
 #
 # ----------------------------------------------------------------------
 #
--- a/dependencies/java.base/module-info.java.extra	Wed Jan 31 06:40:25 2018 -0800
+++ b/dependencies/java.base/module-info.java.extra	Fri Feb 02 10:04:10 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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
@@ -25,7 +25,6 @@
 
 exports jdk.internal.misc to javafx.graphics;
 exports jdk.internal.ref to javafx.media;
-exports sun.net.www to javafx.web;
 exports sun.nio.ch to javafx.media;
 exports sun.reflect.misc to javafx.base;
 exports sun.reflect.misc to javafx.fxml;
--- a/gradle.properties.template	Wed Jan 31 06:40:25 2018 -0800
+++ b/gradle.properties.template	Fri Feb 02 10:04:10 2018 -0800
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2013, 2018, 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
@@ -45,6 +45,18 @@
 #COMPILE_WEBKIT = true
 #COMPILE_MEDIA = true
 
+# These properties can be used to support building the libav stubs in support of
+# running on multiple Linux systems. BUILD_LIBAV_STUBS is intended to build a
+# distribution that will run on multiple versions of Linux. BUILD_WORKING_LIBAV
+# is only intended for developers to test their code locally without needing an
+# installed libav; most developers will not ever need to use this option.
+# BUILD_LIBAV_STUBS is valid with COMPILE_MEDIA = true and BUILD_WORKING_LIBAV
+# is valid with COMPILE_MEDIA = true and BUILD_LIBAV_STUBS = true on Linux
+# platforms only.
+
+# BUILD_LIBAV_STUBS = true
+# BUILD_WORKING_LIBAV = true
+
 # Specifies whether to include the Null3D pipeline, which can be used for
 # performance debugging.
 # Uncomment this flag in order to include the Null3D pipeline in the build.
--- a/modules/javafx.base/src/test/java/test/com/sun/javafx/runtime/VersionInfoTest.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.base/src/test/java/test/com/sun/javafx/runtime/VersionInfoTest.java	Fri Feb 02 10:04:10 2018 -0800
@@ -89,7 +89,7 @@
         String version = VersionInfo.getVersion();
         // Need to update major version number when we develop the next
         // major release.
-        assertTrue(version.startsWith("10"));
+        assertTrue(version.startsWith("11"));
         String runtimeVersion = VersionInfo.getRuntimeVersion();
         assertTrue(runtimeVersion.startsWith(version));
     }
--- a/modules/javafx.controls/src/main/java/javafx/scene/control/ListCell.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.controls/src/main/java/javafx/scene/control/ListCell.java	Fri Feb 02 10:04:10 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, 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
@@ -369,7 +369,7 @@
             list.fireEvent(new ListView.EditEvent<T>(list,
                     ListView.<T>editStartEvent(),
                     null,
-                    list.getEditingIndex()));
+                    getIndex()));
             list.edit(getIndex());
             list.requestFocus();
         }
--- a/modules/javafx.controls/src/main/java/javafx/scene/control/TabPane.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.controls/src/main/java/javafx/scene/control/TabPane.java	Fri Feb 02 10:04:10 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, 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
@@ -752,9 +752,6 @@
                     return;
                 }
             }
-            if (tab != null) {
-                setSelectedItem(tab);
-            }
         }
 
         @Override protected Tab getModelItem(int index) {
--- a/modules/javafx.controls/src/main/java/javafx/scene/control/skin/ToolBarSkin.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.controls/src/main/java/javafx/scene/control/skin/ToolBarSkin.java	Fri Feb 02 10:04:10 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, 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
@@ -185,7 +185,7 @@
                     }
                     Node selected = context.selectInSubtree(item, owner, dir);
                     if (selected != null) return selected;
-                    idx = boxChildren.indexOf(owner);
+                    idx = boxChildren.indexOf(item);
                     if (dir == Direction.NEXT) dir = Direction.NEXT_IN_LINE;
                 }
 
--- a/modules/javafx.controls/src/test/java/test/javafx/scene/control/ListViewTest.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.controls/src/test/java/test/javafx/scene/control/ListViewTest.java	Fri Feb 02 10:04:10 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, 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
@@ -1918,4 +1918,33 @@
             assert(e instanceof NoSuchElementException);
         }
     }
+
+    @Test public void testListEditStartOnCellStandalone_JDK8187432() {
+        ListView<String> control = new ListView<>(FXCollections
+                .observableArrayList("Item1", "Item2", "Item3", "Item4"));
+        control.setEditable(true);
+        control.setCellFactory(TextFieldListCell.forListView());
+        StageLoader sl = new StageLoader(control);
+        int editIndex = 2;
+
+        IndexedCell cell = VirtualFlowTestUtils.getCell(control, editIndex);
+        ObjectProperty<ListView.EditEvent> editEvent = new SimpleObjectProperty<>();
+        control.addEventHandler(ListView.editStartEvent(), e -> editEvent.set(e));
+
+        // start edit on cell
+        cell.startEdit();
+
+        // test cell state
+        assertTrue(cell.isEditing());
+        assertEquals(editIndex, cell.getIndex());
+
+        // test editEvent
+        assertNotNull(editEvent.get());
+        assertEquals("type is startEdit",
+                     ListView.editStartEvent(), editEvent.get().getEventType());
+        assertEquals("index on start event",
+                     editIndex, editEvent.get().getIndex());
+
+        sl.dispose();
+    }
 }
--- a/modules/javafx.controls/src/test/java/test/javafx/scene/control/TabPaneTest.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.controls/src/test/java/test/javafx/scene/control/TabPaneTest.java	Fri Feb 02 10:04:10 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, 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
@@ -35,6 +35,7 @@
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import test.com.sun.javafx.scene.control.infrastructure.StageLoader;
 import javafx.application.Platform;
@@ -83,6 +84,8 @@
 import javafx.scene.control.TabPane;
 import javafx.scene.control.TabPaneShim;
 
+import java.lang.ref.WeakReference;
+
 public class TabPaneTest {
     private TabPane tabPane;//Empty string
     private Toolkit tk;
@@ -1093,4 +1096,35 @@
         tabPane.getTabs().remove(t2);
     }
 
+    // Test for JDK-8154039
+    WeakReference<Tab> weakTab;
+    @Test public void testSelectNonChildTab() {
+        tabPane.getTabs().addAll(tab1);
+        root.getChildren().add(tabPane);
+        show();
+        tk.firePulse();
+        weakTab = new WeakReference<>(new Tab("NonChildTab"));
+        tabPane.getSelectionModel().select(weakTab.get());
+        tk.firePulse();
+        attemptGC(10);
+        tk.firePulse();
+        assertNull(weakTab.get());
+    }
+
+    private void attemptGC(int n) {
+        // Attempt gc n times
+        for (int i = 0; i < n; i++) {
+            System.gc();
+            System.runFinalization();
+
+            if (weakTab.get() == null) {
+                break;
+            }
+            try {
+                Thread.sleep(500);
+            } catch (InterruptedException e) {
+                fail("InterruptedException occurred during Thread.sleep()");
+            }
+        }
+    }
 }
--- a/modules/javafx.controls/src/test/java/test/javafx/scene/control/ToolbarTest.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.controls/src/test/java/test/javafx/scene/control/ToolbarTest.java	Fri Feb 02 10:04:10 2018 -0800
@@ -27,7 +27,7 @@
 
 import javafx.css.CssMetaData;
 import static test.com.sun.javafx.scene.control.infrastructure.ControlTestUtils.*;
-
+import test.com.sun.javafx.scene.control.infrastructure.KeyEventFirer;
 import test.com.sun.javafx.pgstub.StubToolkit;
 import javafx.scene.control.skin.ToolBarSkin;
 import com.sun.javafx.tk.Toolkit;
@@ -38,9 +38,13 @@
 import javafx.css.StyleableProperty;
 import javafx.geometry.Orientation;
 import javafx.scene.Node;
+import javafx.scene.Scene;
 import javafx.scene.control.Button;
 import javafx.scene.control.ToolBar;
+import javafx.scene.input.KeyCode;
+import javafx.scene.layout.Pane;
 import javafx.scene.shape.Rectangle;
+import javafx.stage.Stage;
 import static org.junit.Assert.*;
 
 
@@ -167,4 +171,54 @@
         b3.fire();
     }
 
+    @Test public void toolBarFocusTraversalTest() {
+        toolBar.getItems().clear();
+
+        toolBar.setFocusTraversable(true);
+        assertTrue(toolBar.isFocusTraversable());
+
+        // Create 5 buttons - put 2 of them in a Pane
+        Button btn1 = new Button("Btn1");
+        Button btn2 = new Button("Btn2");
+
+        Button btn3 = new Button("Btn3");
+        Button btn4 = new Button("Btn4");
+        Pane p1 = new Pane(btn3, btn4);
+
+        Button btn5 = new Button("Btn5");
+
+        toolBar.getItems().addAll(btn1, btn2, p1, btn5);
+
+        ToolBarSkin toolbarSkin = new ToolBarSkin(toolBar);
+        toolBar.setSkin(toolbarSkin);
+
+        Scene scene = new Scene(toolBar);
+        Stage stage = new Stage();
+        stage.setScene(scene);
+        stage.show();
+        tk.firePulse();
+
+        toolBar.getScene().getWindow().requestFocus();
+        assertTrue(btn1.isFocused());
+
+        KeyEventFirer keyboard1 = new KeyEventFirer(btn1);
+        keyboard1.doKeyPress(KeyCode.TAB);
+        tk.firePulse();
+        assertTrue(btn2.isFocused());
+
+        KeyEventFirer keyboard2 = new KeyEventFirer(btn2);
+        keyboard2.doKeyPress(KeyCode.TAB);
+        tk.firePulse();
+        assertTrue(btn3.isFocused());
+
+        KeyEventFirer keyboard3 = new KeyEventFirer(btn3);
+        keyboard3.doKeyPress(KeyCode.TAB);
+        tk.firePulse();
+        assertTrue(btn4.isFocused());
+
+        KeyEventFirer keyboard4 = new KeyEventFirer(btn4);
+        keyboard4.doKeyPress(KeyCode.TAB);
+        tk.firePulse();
+        assertTrue(btn5.isFocused());
+    }
 }
--- a/modules/javafx.fxml/src/main/docs/javafx/fxml/doc-files/introduction_to_fxml.html	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.fxml/src/main/docs/javafx/fxml/doc-files/introduction_to_fxml.html	Fri Feb 02 10:04:10 2018 -0800
@@ -31,14 +31,14 @@
 <head>
 <link href="fxml.css" type="text/css" rel="stylesheet"/>    
 <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
-<title>Introduction to FXML | JavaFX 10</title>
-<meta name="description" content="The document introduces FXML, an XML-based declarative markup language for defining user interfaces in JavaFX 10 applications."/>
-<meta name="keywords" content="JavaFX 10, FXML, JavaFX GUI development, web development, Java application development, GUI applications, rich internet applications, RIA, expressive content"/>
+<title>Introduction to FXML | JavaFX @FXVERSION@</title>
+<meta name="description" content="The document introduces FXML, an XML-based declarative markup language for defining user interfaces in JavaFX @FXVERSION@ applications."/>
+<meta name="keywords" content="JavaFX, FXML, JavaFX GUI development, web development, Java application development, GUI applications, rich internet applications, RIA, expressive content"/>
 </head>
 <body>
 
 <div class="fx-code-header">
-<div class="version"><br/>Release: JavaFX 10</div>
+<div class="version"><br/>Release: JavaFX @FXVERSION@</div>
 </div>
 
 <h1>Introduction to FXML</h1>
--- a/modules/javafx.graphics/src/main/docs/javafx/scene/doc-files/cssref.html	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.graphics/src/main/docs/javafx/scene/doc-files/cssref.html	Fri Feb 02 10:04:10 2018 -0800
@@ -30,7 +30,7 @@
 <html lang="en">
   <head>
     <meta name="description" content="This document describes the JavaFX
-              Cascading Style Sheets (CSS) for JavaFX 10 and explains the
+              Cascading Style Sheets (CSS) for JavaFX @FXVERSION@ and explains the
               styles, values, properties and associated grammar.">
     <meta name="keywords" content="JavaFX, JavaFX CSS, JavaFX CSS reference,
               JavaFX CSS guide, JavaFX styling, CSS styles, CSS, cascading style sheets,
@@ -241,7 +241,7 @@
   <body>
     <div class="fx-code-header">
       <div class="version"><br>
-        Release: JavaFX 10</div>
+        Release: JavaFX @FXVERSION@</div>
     </div>
     <h1>JavaFX CSS Reference Guide</h1>
     <h2>Contents</h2>
--- a/modules/javafx.graphics/src/main/java/com/sun/marlin/ByteArrayCache.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.graphics/src/main/java/com/sun/marlin/ByteArrayCache.java	Fri Feb 02 10:04:10 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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
@@ -230,11 +230,7 @@
     }
 
     static byte[] createArray(final int length, final boolean clean) {
-        if (clean) {
-            return new byte[length];
-        }
-        // use JDK9 Unsafe.allocateUninitializedArray(class, length):
-        return (byte[]) OffHeapArray.UNSAFE.allocateUninitializedArray(byte.class, length);
+        return new byte[length];
     }
 
     static void fill(final byte[] array, final int fromIndex,
--- a/modules/javafx.graphics/src/main/java/com/sun/marlin/DRenderer.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.graphics/src/main/java/com/sun/marlin/DRenderer.java	Fri Feb 02 10:04:10 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2018, 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
@@ -26,7 +26,7 @@
 package com.sun.marlin;
 
 import static com.sun.marlin.OffHeapArray.SIZE_INT;
-import jdk.internal.misc.Unsafe;
+import sun.misc.Unsafe;
 
 public final class DRenderer implements DMarlinRenderer, MarlinConst {
 
--- a/modules/javafx.graphics/src/main/java/com/sun/marlin/DRendererNoAA.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.graphics/src/main/java/com/sun/marlin/DRendererNoAA.java	Fri Feb 02 10:04:10 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2018, 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
@@ -26,7 +26,7 @@
 package com.sun.marlin;
 
 import static com.sun.marlin.OffHeapArray.SIZE_INT;
-import jdk.internal.misc.Unsafe;
+import sun.misc.Unsafe;
 
 public final class DRendererNoAA implements DMarlinRenderer, MarlinConst {
 
--- a/modules/javafx.graphics/src/main/java/com/sun/marlin/DoubleArrayCache.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.graphics/src/main/java/com/sun/marlin/DoubleArrayCache.java	Fri Feb 02 10:04:10 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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
@@ -230,11 +230,7 @@
     }
 
     static double[] createArray(final int length, final boolean clean) {
-        if (clean) {
-            return new double[length];
-        }
-        // use JDK9 Unsafe.allocateUninitializedArray(class, length):
-        return (double[]) OffHeapArray.UNSAFE.allocateUninitializedArray(double.class, length);
+        return new double[length];
     }
 
     static void fill(final double[] array, final int fromIndex,
--- a/modules/javafx.graphics/src/main/java/com/sun/marlin/FloatArrayCache.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.graphics/src/main/java/com/sun/marlin/FloatArrayCache.java	Fri Feb 02 10:04:10 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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
@@ -230,11 +230,7 @@
     }
 
     static float[] createArray(final int length, final boolean clean) {
-        if (clean) {
-            return new float[length];
-        }
-        // use JDK9 Unsafe.allocateUninitializedArray(class, length):
-        return (float[]) OffHeapArray.UNSAFE.allocateUninitializedArray(float.class, length);
+        return new float[length];
     }
 
     static void fill(final float[] array, final int fromIndex,
--- a/modules/javafx.graphics/src/main/java/com/sun/marlin/IntArrayCache.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.graphics/src/main/java/com/sun/marlin/IntArrayCache.java	Fri Feb 02 10:04:10 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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
@@ -230,11 +230,7 @@
     }
 
     static int[] createArray(final int length, final boolean clean) {
-        if (clean) {
-            return new int[length];
-        }
-        // use JDK9 Unsafe.allocateUninitializedArray(class, length):
-        return (int[]) OffHeapArray.UNSAFE.allocateUninitializedArray(int.class, length);
+        return new int[length];
     }
 
     static void fill(final int[] array, final int fromIndex,
--- a/modules/javafx.graphics/src/main/java/com/sun/marlin/MaskMarlinAlphaConsumer.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.graphics/src/main/java/com/sun/marlin/MaskMarlinAlphaConsumer.java	Fri Feb 02 10:04:10 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 2018, 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
@@ -28,7 +28,7 @@
 import com.sun.prism.impl.shape.MaskData;
 import java.nio.ByteBuffer;
 import java.util.Arrays;
-import jdk.internal.misc.Unsafe;
+import sun.misc.Unsafe;
 
 public final class MaskMarlinAlphaConsumer implements MarlinAlphaConsumer {
     int x, y, width, height;
--- a/modules/javafx.graphics/src/main/java/com/sun/marlin/OffHeapArray.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.graphics/src/main/java/com/sun/marlin/OffHeapArray.java	Fri Feb 02 10:04:10 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2018, 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
@@ -26,7 +26,10 @@
 package com.sun.marlin;
 
 import static com.sun.marlin.MarlinConst.LOG_UNSAFE_MALLOC;
-import jdk.internal.misc.Unsafe;
+import java.lang.reflect.Field;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import sun.misc.Unsafe;
 
 /**
  *
@@ -40,7 +43,21 @@
     static final int SIZE_INT;
 
     static {
-        UNSAFE   = Unsafe.getUnsafe();
+        UNSAFE = AccessController.doPrivileged(new PrivilegedAction<Unsafe>() {
+            @Override
+            public Unsafe run() {
+                Unsafe ref = null;
+                try {
+                    final Field field = Unsafe.class.getDeclaredField("theUnsafe");
+                    field.setAccessible(true);
+                    ref = (Unsafe) field.get(null);
+                } catch (Exception e) {
+                    throw new InternalError("Unable to get sun.misc.Unsafe instance", e);
+                }
+                return ref;
+            }
+        });
+
         SIZE_INT = Unsafe.ARRAY_INT_INDEX_SCALE;
     }
 
--- a/modules/javafx.graphics/src/main/java/com/sun/marlin/Renderer.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.graphics/src/main/java/com/sun/marlin/Renderer.java	Fri Feb 02 10:04:10 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2018, 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
@@ -26,7 +26,7 @@
 package com.sun.marlin;
 
 import static com.sun.marlin.OffHeapArray.SIZE_INT;
-import jdk.internal.misc.Unsafe;
+import sun.misc.Unsafe;
 
 public final class Renderer implements MarlinRenderer, MarlinConst {
 
--- a/modules/javafx.graphics/src/main/java/com/sun/marlin/RendererNoAA.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.graphics/src/main/java/com/sun/marlin/RendererNoAA.java	Fri Feb 02 10:04:10 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2018, 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
@@ -26,7 +26,7 @@
 package com.sun.marlin;
 
 import static com.sun.marlin.OffHeapArray.SIZE_INT;
-import jdk.internal.misc.Unsafe;
+import sun.misc.Unsafe;
 
 public final class RendererNoAA implements MarlinRenderer, MarlinConst {
 
--- a/modules/javafx.graphics/src/main/java/module-info.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.graphics/src/main/java/module-info.java	Fri Feb 02 10:04:10 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, 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
@@ -36,6 +36,7 @@
 module javafx.graphics {
     requires java.desktop;
     requires java.xml;
+    requires jdk.unsupported;
 
     requires transitive javafx.base;
 
--- a/modules/javafx.media/src/main/native/jfxmedia/platform/gstreamer/GstAVPlaybackPipeline.cpp	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.media/src/main/native/jfxmedia/platform/gstreamer/GstAVPlaybackPipeline.cpp	Fri Feb 02 10:04:10 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, 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
@@ -432,6 +432,18 @@
 
     if (g_str_has_prefix(pstrName, "audio"))
     {
+         // Ignore additional audio tracks if we already have one.
+         // Otherwise files with multiple audio track will fail to play, since
+         // we will not able to connect second audio track.
+         if (pPipeline->m_bHasAudio)
+         {
+            if (pCaps != NULL)
+                gst_caps_unref(pCaps);
+
+            pPipeline->m_pBusCallbackContent->m_DisposeLock->Exit();
+            return;
+        }
+
         if (pPipeline->IsCodecSupported(pCaps))
         {
             pPad = gst_element_get_static_pad(pPipeline->m_Elements[AUDIO_BIN], "sink");
@@ -599,6 +611,10 @@
     }
     else if ((state == GST_STATE_PLAYING && pending_state == GST_STATE_VOID_PENDING) || (state == GST_STATE_PAUSED && pending_state == GST_STATE_PLAYING) || (state == GST_STATE_PAUSED && pending_state == GST_STATE_PAUSED))
     {
+        // Do not increment queue if we playing and only have one track
+        if (!(m_bHasAudio && m_bHasVideo))
+            return;
+
         if (m_Elements[AUDIO_QUEUE] == element)
         {
             g_object_get(m_Elements[VIDEO_QUEUE], "current-level-buffers", &current_level_buffers, NULL);
--- a/modules/javafx.web/src/main/java/javafx/scene/web/HTMLEditorSkin.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.web/src/main/java/javafx/scene/web/HTMLEditorSkin.java	Fri Feb 02 10:04:10 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2018, 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
@@ -352,7 +352,11 @@
                     resetToolbarState = false;
                 } else if (event.isShiftDown() &&
                         (event.getCode() == KeyCode.UP || event.getCode() == KeyCode.DOWN ||
-                                event.getCode() == KeyCode.LEFT || event.getCode() == KeyCode.RIGHT)) {
+                         event.getCode() == KeyCode.LEFT || event.getCode() == KeyCode.RIGHT ||
+                         event.getCode() == KeyCode.HOME || event.getCode() == KeyCode.END)) {
+                    updateToolbarState(true);
+                } else if ((event.isControlDown() || event.isMetaDown()) &&
+                            event.getCode() == KeyCode.A) {
                     updateToolbarState(true);
                 }
             });
@@ -1029,15 +1033,13 @@
         fgColorButton.setDisable(!isCommandEnabled(FOREGROUND_COLOR.getCommand()));
         String foregroundColorValue = getCommandValue(FOREGROUND_COLOR.getCommand());
         if (foregroundColorValue != null) {
-            Color c = Color.web(rgbToHex((String)foregroundColorValue));
-            fgColorButton.setValue(c);
+            fgColorButton.setValue(getColor(foregroundColorValue));
         }
 
         bgColorButton.setDisable(!isCommandEnabled(BACKGROUND_COLOR.getCommand()));
         String backgroundColorValue = getCommandValue(BACKGROUND_COLOR.getCommand());
         if (backgroundColorValue != null) {
-            Color c = Color.web(rgbToHex((String)backgroundColorValue));
-            bgColorButton.setValue(c);
+            bgColorButton.setValue(getColor(backgroundColorValue));
         }
 
         atomicityCount = atomicityCount == 0 ? 0 : --atomicityCount;
@@ -1119,29 +1121,16 @@
         return webPage.queryCommandValue(command);
     }
 
-    private static String rgbToHex(String value) {
-        if (value.startsWith("rgba")) {
-            String[] components = value.substring(value.indexOf('(') + 1, value.lastIndexOf(')')).split(",");
-            value = String.format("#%02X%02X%02X%02X",
-                Integer.parseInt(components[0].trim()),
-                Integer.parseInt(components[1].trim()),
-                Integer.parseInt(components[2].trim()),
-                Integer.parseInt(components[3].trim()));
-            // The default background color for WebView, according to the HTML
-            // standard is rgba=#00000000 (black). The canvas background is expected
-            // to be white.
-            if ("#00000000".equals(value)) {
-                return "#FFFFFFFF";
-            }
-        } else if (value.startsWith("rgb")) {
-            String[] components = value.substring(value.indexOf('(') + 1, value.lastIndexOf(')')).split(",");
-            value = String.format("#%02X%02X%02X",
-                Integer.parseInt(components[0].trim()),
-                Integer.parseInt(components[1].trim()),
-                Integer.parseInt(components[2].trim()));
+    private Color getColor(String value) {
+        Color color = Color.web(value);
+        /* The default background color for WebView, according to the HTML
+         * standard is rgba=#00000000 (transparent). The canvas background is expected
+         * to be white.
+         */
+        if (color.equals(Color.TRANSPARENT)) {
+            color = Color.WHITE;
         }
-
-        return value;
+        return color;
     }
 
     private void applyTextFormatting() {
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/runtime/JSGlobalObject.cpp	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/runtime/JSGlobalObject.cpp	Fri Feb 02 10:04:10 2018 -0800
@@ -574,8 +574,10 @@
 
     m_arrayBufferPrototype.set(vm, this, JSArrayBufferPrototype::create(vm, this, JSArrayBufferPrototype::createStructure(vm, this, m_objectPrototype.get()), ArrayBufferSharingMode::Default));
     m_arrayBufferStructure.set(vm, this, JSArrayBuffer::createStructure(vm, this, m_arrayBufferPrototype.get()));
+#if ENABLE(SHARED_ARRAY_BUFFER)
     m_sharedArrayBufferPrototype.set(vm, this, JSArrayBufferPrototype::create(vm, this, JSArrayBufferPrototype::createStructure(vm, this, m_objectPrototype.get()), ArrayBufferSharingMode::Shared));
     m_sharedArrayBufferStructure.set(vm, this, JSArrayBuffer::createStructure(vm, this, m_sharedArrayBufferPrototype.get()));
+#endif
 
     m_iteratorPrototype.set(vm, this, IteratorPrototype::create(vm, this, IteratorPrototype::createStructure(vm, this, m_objectPrototype.get())));
     m_generatorPrototype.set(vm, this, GeneratorPrototype::create(vm, this, GeneratorPrototype::createStructure(vm, this, m_iteratorPrototype.get())));
@@ -620,10 +622,11 @@
 
     JSArrayBufferConstructor* arrayBufferConstructor = JSArrayBufferConstructor::create(vm, JSArrayBufferConstructor::createStructure(vm, this, m_functionPrototype.get()), m_arrayBufferPrototype.get(), m_speciesGetterSetter.get(), ArrayBufferSharingMode::Default);
     m_arrayBufferPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, arrayBufferConstructor, DontEnum);
+#if ENABLE(SHARED_ARRAY_BUFFER)
     JSArrayBufferConstructor* sharedArrayBufferConstructor = nullptr;
     sharedArrayBufferConstructor = JSArrayBufferConstructor::create(vm, JSArrayBufferConstructor::createStructure(vm, this, m_functionPrototype.get()), m_sharedArrayBufferPrototype.get(), m_speciesGetterSetter.get(), ArrayBufferSharingMode::Shared);
     m_sharedArrayBufferPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, sharedArrayBufferConstructor, DontEnum);
-
+#endif
 #define CREATE_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
 capitalName ## Constructor* lowerName ## Constructor = capitalName ## Constructor::create(vm, capitalName ## Constructor::createStructure(vm, this, m_functionPrototype.get()), m_ ## lowerName ## Prototype.get(), m_speciesGetterSetter.get()); \
 m_ ## lowerName ## Prototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, lowerName ## Constructor, DontEnum); \
@@ -686,7 +689,9 @@
     putDirectWithoutTransition(vm, vm.propertyNames->builtinNames().ArrayPrivateName(), arrayConstructor, DontEnum | DontDelete | ReadOnly);
 
     putDirectWithoutTransition(vm, vm.propertyNames->ArrayBuffer, arrayBufferConstructor, DontEnum);
+#if ENABLE(SHARED_ARRAY_BUFFER)
     putDirectWithoutTransition(vm, vm.propertyNames->SharedArrayBuffer, sharedArrayBufferConstructor, DontEnum);
+#endif
 
 #define PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
 putDirectWithoutTransition(vm, vm.propertyNames-> jsName, lowerName ## Constructor, DontEnum); \
@@ -1288,8 +1293,10 @@
 
     visitor.append(thisObject->m_arrayBufferPrototype);
     visitor.append(thisObject->m_arrayBufferStructure);
+#if ENABLE(SHARED_ARRAY_BUFFER)
     visitor.append(thisObject->m_sharedArrayBufferPrototype);
     visitor.append(thisObject->m_sharedArrayBufferStructure);
+#endif
 
 #define VISIT_SIMPLE_TYPE(CapitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
     visitor.append(thisObject->m_ ## lowerName ## Prototype); \
--- a/modules/javafx.web/src/main/native/Source/JavaScriptCore/runtime/JSGlobalObject.h	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.web/src/main/native/Source/JavaScriptCore/runtime/JSGlobalObject.h	Fri Feb 02 10:04:10 2018 -0800
@@ -338,8 +338,10 @@
     WriteBarrier<Structure> m_moduleLoaderStructure;
     WriteBarrier<JSArrayBufferPrototype> m_arrayBufferPrototype;
     WriteBarrier<Structure> m_arrayBufferStructure;
+#if ENABLE(SHARED_ARRAY_BUFFER)
     WriteBarrier<JSArrayBufferPrototype> m_sharedArrayBufferPrototype;
     WriteBarrier<Structure> m_sharedArrayBufferStructure;
+#endif
 
 #define DEFINE_STORAGE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
     WriteBarrier<capitalName ## Prototype> m_ ## lowerName ## Prototype; \
@@ -670,8 +672,13 @@
         switch (sharingMode) {
         case ArrayBufferSharingMode::Default:
             return m_arrayBufferPrototype.get();
+#if ENABLE(SHARED_ARRAY_BUFFER)
         case ArrayBufferSharingMode::Shared:
             return m_sharedArrayBufferPrototype.get();
+#else
+        default:
+            return m_arrayBufferPrototype.get();
+#endif
         }
     }
     Structure* arrayBufferStructure(ArrayBufferSharingMode sharingMode) const
@@ -679,8 +686,13 @@
         switch (sharingMode) {
         case ArrayBufferSharingMode::Default:
             return m_arrayBufferStructure.get();
+#if ENABLE(SHARED_ARRAY_BUFFER)
         case ArrayBufferSharingMode::Shared:
             return m_sharedArrayBufferStructure.get();
+#else
+        default:
+            return m_arrayBufferStructure.get();
+#endif
         }
         RELEASE_ASSERT_NOT_REACHED();
         return nullptr;
--- a/modules/javafx.web/src/main/native/Source/ThirdParty/icu/source/common/uloc_tag.c	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.web/src/main/native/Source/ThirdParty/icu/source/common/uloc_tag.c	Fri Feb 02 10:04:10 2018 -0800
@@ -2073,6 +2073,14 @@
 #define EXTV 0x0040
 #define PRIV 0x0080
 
+/**
+ * Ticket #12705 - VS2015 update 3, 32 bit release has problems with this function.
+ * As a workaround, we will turn off optimization just for this function.
+ */
+#if (defined(_MSC_VER) && (_MSC_VER >= 1900))
+#pragma optimize( "", off )
+#endif
+
 static ULanguageTag*
 ultag_parse(const char* tag, int32_t tagLen, int32_t* parsedLen, UErrorCode* status) {
     ULanguageTag *t;
@@ -2435,6 +2443,13 @@
     return NULL;
 }
 
+/**
+* Ticket #12705 - Turn optimization back on.
+*/
+#if (defined(_MSC_VER) && (_MSC_VER >= 1900))
+#pragma optimize( "", on )
+#endif
+
 static void
 ultag_close(ULanguageTag* langtag) {
 
--- a/modules/javafx.web/src/main/native/Source/WTF/wtf/Platform.h	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.web/src/main/native/Source/WTF/wtf/Platform.h	Fri Feb 02 10:04:10 2018 -0800
@@ -1228,6 +1228,9 @@
 #define HAVE_NS_ACTIVITY 1
 #endif
 
+/* Disable SharedArrayBuffers until Spectre security concerns are mitigated. */
+#define ENABLE_SHARED_ARRAY_BUFFER 0
+
 #if (OS(DARWIN) && USE(CG)) || (USE(FREETYPE) && !PLATFORM(GTK)) || (PLATFORM(WIN) && (USE(CG) || USE(CAIRO)))
 #undef ENABLE_OPENTYPE_MATH
 #define ENABLE_OPENTYPE_MATH 1
--- a/modules/javafx.web/src/main/native/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.web/src/main/native/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp	Fri Feb 02 10:04:10 2018 -0800
@@ -35,6 +35,7 @@
 #include "Logging.h"
 #include "MediaStreamEvent.h"
 #include "NotImplemented.h"
+#include "Performance.h"
 #include "PlatformStrategies.h"
 #include "RTCDataChannel.h"
 #include "RTCDataChannelEvent.h"
@@ -50,6 +51,7 @@
 #include <webrtc/p2p/base/basicpacketsocketfactory.h>
 #include <webrtc/p2p/client/basicportallocator.h>
 #include <webrtc/pc/peerconnectionfactory.h>
+#include <wtf/CurrentTime.h>
 #include <wtf/MainThread.h>
 
 #include "CoreMediaSoftLink.h"
@@ -303,7 +305,7 @@
 
 static inline void fillRTCStats(RTCStatsReport::Stats& stats, const webrtc::RTCStats& rtcStats)
 {
-    stats.timestamp = rtcStats.timestamp_us() / 1000.0;
+    stats.timestamp = Performance::reduceTimeResolution(Seconds::fromMicroseconds(rtcStats.timestamp_us())).milliseconds();
     stats.id = fromStdString(rtcStats.id());
 }
 
--- a/modules/javafx.web/src/main/native/Source/WebCore/bridge/jni/jni_jsobject.mm	Wed Jan 31 06:40:25 2018 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,695 +0,0 @@
-/*
- * Copyright (C) 2003, 2008 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "jni_jsobject.h"
-
-#if ENABLE(JAVA_BRIDGE)
-
-#include "Frame.h"
-#include "JNIUtility.h"
-#include "JNIUtilityPrivate.h"
-#include "JSDOMBinding.h"
-#include "JavaRuntimeObject.h"
-#include "JavaStringJSC.h"
-#include "Logging.h"
-#include "ScriptController.h"
-#include "StringSourceProvider.h"
-#include "WebCoreFrameView.h"
-#include "runtime_object.h"
-#include "runtime_root.h"
-#include <interpreter/CallFrame.h>
-#include <runtime/Completion.h>
-#include <runtime/JSGlobalObject.h>
-#include <runtime/JSLock.h>
-
-using WebCore::Frame;
-
-using namespace JSC::Bindings;
-using namespace JSC;
-using namespace WebCore;
-
-#define UndefinedHandle 1
-
-static CFRunLoopSourceRef _performJavaScriptSource;
-static CFRunLoopRef _performJavaScriptRunLoop;
-
-// May only be set by dispatchToJavaScriptThread().
-static CFRunLoopSourceRef completionSource;
-
-static void completedJavaScriptAccess (void *i)
-{
-    ASSERT(CFRunLoopGetCurrent() != _performJavaScriptRunLoop);
-
-    JSObjectCallContext *callContext = (JSObjectCallContext *)i;
-    CFRunLoopRef runLoop = (CFRunLoopRef)callContext->originatingLoop;
-
-    ASSERT(CFRunLoopGetCurrent() == runLoop);
-
-    CFRunLoopStop(runLoop);
-}
-
-static pthread_once_t javaScriptAccessLockOnce = PTHREAD_ONCE_INIT;
-static pthread_mutex_t javaScriptAccessLock;
-static int javaScriptAccessLockCount = 0;
-
-static void initializeJavaScriptAccessLock()
-{
-    pthread_mutexattr_t attr;
-
-    pthread_mutexattr_init(&attr);
-    pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE);
-
-    pthread_mutex_init(&javaScriptAccessLock, &attr);
-}
-
-static inline void lockJavaScriptAccess()
-{
-    // Perhaps add deadlock detection?
-    pthread_once(&javaScriptAccessLockOnce, initializeJavaScriptAccessLock);
-    pthread_mutex_lock(&javaScriptAccessLock);
-    javaScriptAccessLockCount++;
-}
-
-static inline void unlockJavaScriptAccess()
-{
-    javaScriptAccessLockCount--;
-    pthread_mutex_unlock(&javaScriptAccessLock);
-}
-
-static void dispatchToJavaScriptThread(JSObjectCallContext *context)
-{
-    // This lock guarantees that only one thread can invoke
-    // at a time, and also guarantees that completionSource;
-    // won't get clobbered.
-    lockJavaScriptAccess();
-
-    CFRunLoopRef currentRunLoop = CFRunLoopGetCurrent();
-
-    ASSERT(currentRunLoop != _performJavaScriptRunLoop);
-
-    // Setup a source to signal once the invocation of the JavaScript
-    // call completes.
-    //
-    // FIXME:  This could be a potential performance issue.  Creating and
-    // adding run loop sources is expensive.  We could create one source
-    // per thread, as needed, instead.
-    context->originatingLoop = currentRunLoop;
-    CFRunLoopSourceContext sourceContext = {0, context, NULL, NULL, NULL, NULL, NULL, NULL, NULL, completedJavaScriptAccess};
-    completionSource = CFRunLoopSourceCreate(NULL, 0, &sourceContext);
-    CFRunLoopAddSource(currentRunLoop, completionSource, kCFRunLoopDefaultMode);
-
-    // Wakeup JavaScript access thread and make it do its work.
-    CFRunLoopSourceSignal(_performJavaScriptSource);
-    if (CFRunLoopIsWaiting(_performJavaScriptRunLoop))
-        CFRunLoopWakeUp(_performJavaScriptRunLoop);
-
-    // Wait until the JavaScript access thread is done.
-    CFRunLoopRun ();
-
-    CFRunLoopRemoveSource(currentRunLoop, completionSource, kCFRunLoopDefaultMode);
-    CFRelease (completionSource);
-
-    unlockJavaScriptAccess();
-}
-
-static void performJavaScriptAccess(void*)
-{
-    ASSERT(CFRunLoopGetCurrent() == _performJavaScriptRunLoop);
-
-    // Dispatch JavaScript calls here.
-    CFRunLoopSourceContext sourceContext;
-    CFRunLoopSourceGetContext (completionSource, &sourceContext);
-    JSObjectCallContext *callContext = (JSObjectCallContext *)sourceContext.info;
-    CFRunLoopRef originatingLoop = callContext->originatingLoop;
-
-    JavaJSObject::invoke (callContext);
-
-    // Signal the originating thread that we're done.
-    CFRunLoopSourceSignal (completionSource);
-    if (CFRunLoopIsWaiting(originatingLoop))
-        CFRunLoopWakeUp(originatingLoop);
-}
-
-// Must be called from the thread that will be used to access JavaScript.
-void JavaJSObject::initializeJNIThreading() {
-    // Should only be called once.
-    ASSERT(!_performJavaScriptRunLoop);
-
-    // Assume that we can retain this run loop forever.  It'll most
-    // likely (always?) be the main loop.
-    _performJavaScriptRunLoop = (CFRunLoopRef)CFRetain(CFRunLoopGetCurrent());
-
-    // Setup a source the other threads can use to signal the _runLoop
-    // thread that a JavaScript call needs to be invoked.
-    CFRunLoopSourceContext sourceContext = {0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, performJavaScriptAccess};
-    _performJavaScriptSource = CFRunLoopSourceCreate(NULL, 0, &sourceContext);
-    CFRunLoopAddSource(_performJavaScriptRunLoop, _performJavaScriptSource, kCFRunLoopDefaultMode);
-}
-
-static bool isJavaScriptThread()
-{
-    return (_performJavaScriptRunLoop == CFRunLoopGetCurrent());
-}
-
-jvalue JavaJSObject::invoke(JSObjectCallContext *context)
-{
-    jvalue result;
-
-    bzero ((void *)&result, sizeof(jvalue));
-
-    if (!isJavaScriptThread()) {
-        // Send the call context to the thread that is allowed to
-        // call JavaScript.
-        dispatchToJavaScriptThread(context);
-        result = context->result;
-    }
-    else {
-        jlong nativeHandle = context->nativeHandle;
-        if (nativeHandle == UndefinedHandle || nativeHandle == 0) {
-            return result;
-        }
-
-        if (context->type == CreateNative) {
-            result.j = JavaJSObject::createNative(nativeHandle);
-        }
-        else {
-            JSObject *imp = jlong_to_impptr(nativeHandle);
-            if (!findProtectingRootObject(imp)) {
-                LOG_ERROR("Attempt to access JavaScript from destroyed applet, type %d.", context->type);
-                return result;
-            }
-
-            switch (context->type){
-                case Call: {
-                    result.l = JavaJSObject(nativeHandle).call(context->string, context->args);
-                    break;
-                }
-
-                case Eval: {
-                    result.l = JavaJSObject(nativeHandle).eval(context->string);
-                    break;
-                }
-
-                case GetMember: {
-                    result.l = JavaJSObject(nativeHandle).getMember(context->string);
-                    break;
-                }
-
-                case SetMember: {
-                    JavaJSObject(nativeHandle).setMember(context->string, context->value);
-                    break;
-                }
-
-                case RemoveMember: {
-                    JavaJSObject(nativeHandle).removeMember(context->string);
-                    break;
-                }
-
-                case GetSlot: {
-                    result.l = JavaJSObject(nativeHandle).getSlot(context->index);
-                    break;
-                }
-
-                case SetSlot: {
-                    JavaJSObject(nativeHandle).setSlot(context->index, context->value);
-                    break;
-                }
-
-                case ToString: {
-                    result.l = (jobject) JavaJSObject(nativeHandle).toString();
-                    break;
-                }
-
-                case Finalize: {
-                    JavaJSObject(nativeHandle).finalize();
-                    break;
-                }
-
-                default: {
-                    LOG_ERROR("invalid JavaScript call");
-                }
-            }
-        }
-        context->result = result;
-    }
-
-    return result;
-}
-
-
-JavaJSObject::JavaJSObject(jlong nativeJSObject)
-{
-    _imp = jlong_to_impptr(nativeJSObject);
-
-    ASSERT(_imp);
-    _rootObject = findProtectingRootObject(_imp);
-    ASSERT(_rootObject);
-}
-
-RootObject* JavaJSObject::rootObject() const
-{
-    return _rootObject && _rootObject->isValid() ? _rootObject.get() : 0;
-}
-
-jobject JavaJSObject::call(jstring methodName, jobjectArray args) const
-{
-    LOG(LiveConnect, "JavaJSObject::call methodName = %s", JavaString(methodName).utf8());
-
-    RootObject* rootObject = this->rootObject();
-    if (!rootObject)
-        return 0;
-
-    // Lookup the function object.
-    ExecState* exec = rootObject->globalObject()->globalExec();
-    JSLockHolder lock(exec);
-
-    Identifier identifier(exec, JavaString(methodName).impl());
-    JSValue function = _imp->get(exec, identifier);
-    CallData callData;
-    CallType callType = getCallData(function, callData);
-    if (callType == CallTypeNone)
-        return 0;
-
-    // Call the function object.
-    MarkedArgumentBuffer argList;
-    getListFromJArray(exec, args, argList);
-    rootObject->globalObject()->globalData().timeoutChecker.start();
-    JSValue result = JSC::call(exec, function, callType, callData, _imp, argList);
-    rootObject->globalObject()->globalData().timeoutChecker.stop();
-
-    return convertValueToJObject(result);
-}
-
-jobject JavaJSObject::eval(jstring script) const
-{
-    LOG(LiveConnect, "JavaJSObject::eval script = %s", JavaString(script).utf8());
-
-    RootObject* rootObject = this->rootObject();
-    if (!rootObject)
-        return 0;
-
-    JSLockHolder lock(rootObject->globalObject()->globalData());
-
-    rootObject->globalObject()->globalData().timeoutChecker.start();
-    JSValue result = JSC::evaluate(rootObject->globalObject()->globalExec(), rootObject->globalObject()->globalScopeChain(), makeSource(JavaString(script).impl()));
-    rootObject->globalObject()->globalData().timeoutChecker.stop();
-
-    return convertValueToJObject(result);
-}
-
-jobject JavaJSObject::getMember(jstring memberName) const
-{
-    LOG(LiveConnect, "JavaJSObject::getMember (%p) memberName = %s", _imp, JavaString(memberName).utf8());
-
-    RootObject* rootObject = this->rootObject();
-    if (!rootObject)
-        return 0;
-
-    ExecState* exec = rootObject->globalObject()->globalExec();
-
-    JSLockHolder lock(exec);
-    JSValue result = _imp->get(exec, Identifier(exec, JavaString(memberName).impl()));
-
-    return convertValueToJObject(result);
-}
-
-void JavaJSObject::setMember(jstring memberName, jobject value) const
-{
-    LOG(LiveConnect, "JavaJSObject::setMember memberName = %s, value = %p", JavaString(memberName).utf8(), value);
-
-    RootObject* rootObject = this->rootObject();
-    if (!rootObject)
-        return;
-
-    ExecState* exec = rootObject->globalObject()->globalExec();
-
-    JSLockHolder lock(exec);
-    PutPropertySlot slot;
-    _imp->methodTable()->put(_imp, exec, Identifier(exec, JavaString(memberName).impl()), convertJObjectToValue(exec, value), slot);
-}
-
-
-void JavaJSObject::removeMember(jstring memberName) const
-{
-    LOG(LiveConnect, "JavaJSObject::removeMember memberName = %s", JavaString(memberName).utf8());
-
-    RootObject* rootObject = this->rootObject();
-    if (!rootObject)
-        return;
-
-    ExecState* exec = rootObject->globalObject()->globalExec();
-    JSLockHolder lock(exec);
-    _imp->methodTable()->deleteProperty(_imp, exec, Identifier(exec, JavaString(memberName).impl()));
-}
-
-
-jobject JavaJSObject::getSlot(jint index) const
-{
-    LOG(LiveConnect, "JavaJSObject::getSlot index = %ld", static_cast<long>(index));
-
-    RootObject* rootObject = this->rootObject();
-    if (!rootObject)
-        return 0;
-
-    ExecState* exec = rootObject->globalObject()->globalExec();
-
-    JSLockHolder lock(exec);
-    JSValue result = _imp->get(exec, index);
-
-    return convertValueToJObject(result);
-}
-
-
-void JavaJSObject::setSlot(jint index, jobject value) const
-{
-    LOG(LiveConnect, "JavaJSObject::setSlot index = %ld, value = %p", static_cast<long>(index), value);
-
-    RootObject* rootObject = this->rootObject();
-    if (!rootObject)
-        return;
-
-    ExecState* exec = rootObject->globalObject()->globalExec();
-    JSLockHolder lock(exec);
-    _imp->methodTable()->putByIndex(_imp, exec, (unsigned)index, convertJObjectToValue(exec, value), false);
-}
-
-
-jstring JavaJSObject::toString() const
-{
-    LOG(LiveConnect, "JavaJSObject::toString");
-
-    RootObject* rootObject = this->rootObject();
-    if (!rootObject)
-        return 0;
-
-    JSObject *thisObj = const_cast<JSObject*>(_imp);
-    ExecState* exec = rootObject->globalObject()->globalExec();
-    JSLockHolder lock(exec);
-
-    return static_cast<jstring>(convertValueToJValue(exec, rootObject, thisObj, JavaTypeObject, "java.lang.String").l);
-}
-
-void JavaJSObject::finalize() const
-{
-    if (RootObject* rootObject = this->rootObject())
-        rootObject->gcUnprotect(_imp);
-}
-
-static PassRefPtr<RootObject> createRootObject(void* nativeHandle)
-{
-    Frame* frame = 0;
-    for (NSView *view = (NSView *)nativeHandle; view; view = [view superview]) {
-        if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) {
-            NSView<WebCoreFrameView> *webCoreFrameView = static_cast<NSView<WebCoreFrameView>*>(view);
-            frame = [webCoreFrameView _web_frame];
-            break;
-        }
-    }
-    if (!frame)
-        return 0;
-    return frame->script()->createRootObject(nativeHandle);
-}
-
-// We're either creating a 'Root' object (via a call to JavaJSObject.getWindow()), or
-// another JavaJSObject.
-jlong JavaJSObject::createNative(jlong nativeHandle)
-{
-    LOG(LiveConnect, "JavaJSObject::createNative nativeHandle = %d", static_cast<int>(nativeHandle));
-
-    if (nativeHandle == UndefinedHandle)
-        return nativeHandle;
-
-    if (findProtectingRootObject(jlong_to_impptr(nativeHandle)))
-        return nativeHandle;
-
-    RefPtr<RootObject> rootObject = createRootObject(jlong_to_ptr(nativeHandle));
-
-    // If rootObject is !NULL We must have been called via netscape.javascript.JavaJSObject.getWindow(),
-    // otherwise we are being called after creating a JavaJSObject in
-    // JavaJSObject::convertValueToJObject().
-    if (rootObject) {
-        JSObject* globalObject = rootObject->globalObject();
-        // We call gcProtect here to get the object into the root object's "protect set" which
-        // is used to test if a native handle is valid as well as getting the root object given the handle.
-        rootObject->gcProtect(globalObject);
-        return ptr_to_jlong(globalObject);
-    }
-
-    return nativeHandle;
-}
-
-jobject JavaJSObject::convertValueToJObject(JSValue value) const
-{
-    RootObject* rootObject = this->rootObject();
-    if (!rootObject)
-        return 0;
-
-
-    ExecState* exec = rootObject->globalObject()->globalExec();
-    JSLockHolder lock(exec);
-    JNIEnv *env = getJNIEnv();
-    jobject result = 0;
-
-    // See section 22.7 of 'JavaScript:  The Definitive Guide, 4th Edition',
-    // figure 22-5.
-    // number -> java.lang.Double
-    // string -> java.lang.String
-    // boolean -> java.lang.Boolean
-    // Java instance -> Java instance
-    // Everything else -> JavaJSObject
-
-    if (value.isNumber()) {
-        jclass JSObjectClass = env->FindClass ("java/lang/Double");
-        jmethodID constructorID = env->GetMethodID (JSObjectClass, "<init>", "(D)V");
-        if (constructorID != NULL) {
-            result = env->NewObject (JSObjectClass, constructorID, (jdouble)value.toNumber(exec));
-        }
-    } else if (value.isString()) {
-        UString stringValue = value.toString(exec)->value(exec);
-        JNIEnv *env = getJNIEnv();
-        result = env->NewString ((const jchar *)stringValue.characters(), stringValue.length());
-    } else if (value.isBoolean()) {
-        jclass JSObjectClass = env->FindClass ("java/lang/Boolean");
-        jmethodID constructorID = env->GetMethodID (JSObjectClass, "<init>", "(Z)V");
-        if (constructorID != NULL) {
-            result = env->NewObject (JSObjectClass, constructorID, (jboolean)value.toBoolean());
-        }
-    }
-    else {
-        // Create a JavaJSObject.
-        jlong nativeHandle;
-
-        if (value.isObject()) {
-            JSObject* object = asObject(value);
-
-            // We either have a wrapper around a Java instance or a JavaScript
-            // object.  If we have a wrapper around a Java instance, return that
-            // instance, otherwise create a new Java JavaJSObject with the JSObject*
-            // as its nativeHandle.
-            if (object->inherits(&JavaRuntimeObject::s_info)) {
-                JavaRuntimeObject* runtimeObject = static_cast<JavaRuntimeObject*>(object);
-                JavaInstance* runtimeInstance = runtimeObject->getInternalJavaInstance();
-                if (!runtimeInstance)
-                    return 0;
-
-                return runtimeInstance->javaInstance();
-            } else {
-                nativeHandle = ptr_to_jlong(object);
-                rootObject->gcProtect(object);
-            }
-        } else {
-        // All other types will result in an undefined object.
-            nativeHandle = UndefinedHandle;
-        }
-
-        // Now create the Java JavaJSObject.  Look for the JavaJSObject in its new (Tiger)
-        // location and in the original Java 1.4.2 location.
-        jclass JSObjectClass;
-
-        JSObjectClass = env->FindClass ("sun/plugin/javascript/webkit/JSObject");
-        if (!JSObjectClass) {
-            env->ExceptionDescribe();
-            env->ExceptionClear();
-            JSObjectClass = env->FindClass ("apple/applet/JSObject");
-        }
-
-        jmethodID constructorID = env->GetMethodID (JSObjectClass, "<init>", "(J)V");
-        if (constructorID != NULL) {
-            result = env->NewObject (JSObjectClass, constructorID, nativeHandle);
-        }
-    }
-
-    return result;
-}
-
-JSValue JavaJSObject::convertJObjectToValue(ExecState* exec, jobject theObject) const
-{
-    // Instances of netscape.javascript.JSObject get converted back to
-    // JavaScript objects.  All other objects are wrapped.  It's not
-    // possible to pass primitive types from the Java to JavaScript.
-    // See section 22.7 of 'JavaScript:  The Definitive Guide, 4th Edition',
-    // figure 22-4.
-    jobject classOfInstance = callJNIMethod<jobject>(theObject, "getClass", "()Ljava/lang/Class;");
-    if (!classOfInstance) {
-        JSLockHolder lock(exec);
-        return JavaInstance::create(theObject, _rootObject)->createRuntimeObject(exec);
-    }
-
-    // Only the sun.plugin.javascript.webkit.JSObject has a member called nativeJSObject. This class is
-    // created above to wrap internal browser objects. The constructor of this class takes the native
-    // pointer and stores it in this object, so that it can be retrieved below.
-    jstring className = (jstring)callJNIMethod<jobject>(classOfInstance, "getName", "()Ljava/lang/String;");
-    if (!className || (strcmp(JavaString(className).utf8(), "sun.plugin.javascript.webkit.JSObject") != 0)) {
-        JSLockHolder lock(exec);
-        return JavaInstance::create(theObject, _rootObject)->createRuntimeObject(exec);
-    }
-
-    // Pull the nativeJSObject value from the Java instance.  This is a
-    // pointer to the JSObject.
-    JNIEnv *env = getJNIEnv();
-    jfieldID fieldID = env->GetFieldID((jclass)classOfInstance, "nativeJSObject", "J");
-    if (fieldID == NULL)
-        return jsUndefined();
-    jlong nativeHandle = env->GetLongField(theObject, fieldID);
-    if (nativeHandle == UndefinedHandle)
-        return jsUndefined();
-    JSObject *imp = jsCast<JSObject*>(jlong_to_impptr(nativeHandle));
-    return imp;
-}
-
-void JavaJSObject::getListFromJArray(ExecState* exec, jobjectArray jArray, MarkedArgumentBuffer& list) const
-{
-    JNIEnv *env = getJNIEnv();
-    int numObjects = jArray ? env->GetArrayLength(jArray) : 0;
-
-    for (int i = 0; i < numObjects; i++) {
-        jobject anObject = env->GetObjectArrayElement ((jobjectArray)jArray, i);
-        if (anObject) {
-            list.append(convertJObjectToValue(exec, anObject));
-            env->DeleteLocalRef (anObject);
-        }
-        else {
-            env->ExceptionDescribe();
-            env->ExceptionClear();
-        }
-    }
-}
-
-extern "C" {
-
-jlong KJS_JSCreateNativeJSObject (JNIEnv*, jclass, jstring, jlong nativeHandle, jboolean)
-{
-    JSObjectCallContext context;
-    context.type = CreateNative;
-    context.nativeHandle = nativeHandle;
-    return JavaJSObject::invoke (&context).j;
-}
-
-void KJS_JSObject_JSFinalize (JNIEnv*, jclass, jlong nativeHandle)
-{
-    JSObjectCallContext context;
-    context.type = Finalize;
-    context.nativeHandle = nativeHandle;
-    JavaJSObject::invoke (&context);
-}
-
-jobject KJS_JSObject_JSObjectCall (JNIEnv*, jclass, jlong nativeHandle, jstring, jstring methodName, jobjectArray args, jboolean)
-{
-    JSObjectCallContext context;
-    context.type = Call;
-    context.nativeHandle = nativeHandle;
-    context.string = methodName;
-    context.args = args;
-    return JavaJSObject::invoke (&context).l;
-}
-
-jobject KJS_JSObject_JSObjectEval (JNIEnv*, jclass, jlong nativeHandle, jstring, jstring jscript, jboolean)
-{
-    JSObjectCallContext context;
-    context.type = Eval;
-    context.nativeHandle = nativeHandle;
-    context.string = jscript;
-    return JavaJSObject::invoke (&context).l;
-}
-
-jobject KJS_JSObject_JSObjectGetMember (JNIEnv*, jclass, jlong nativeHandle, jstring, jstring jname, jboolean)
-{
-    JSObjectCallContext context;
-    context.type = GetMember;
-    context.nativeHandle = nativeHandle;
-    context.string = jname;
-    return JavaJSObject::invoke (&context).l;
-}
-
-void KJS_JSObject_JSObjectSetMember (JNIEnv*, jclass, jlong nativeHandle, jstring, jstring jname, jobject value, jboolean)
-{
-    JSObjectCallContext context;
-    context.type = SetMember;
-    context.nativeHandle = nativeHandle;
-    context.string = jname;
-    context.value = value;
-    JavaJSObject::invoke (&context);
-}
-
-void KJS_JSObject_JSObjectRemoveMember (JNIEnv*, jclass, jlong nativeHandle, jstring, jstring jname, jboolean)
-{
-    JSObjectCallContext context;
-    context.type = RemoveMember;
-    context.nativeHandle = nativeHandle;
-    context.string = jname;
-    JavaJSObject::invoke (&context);
-}
-
-jobject KJS_JSObject_JSObjectGetSlot (JNIEnv*, jclass, jlong nativeHandle, jstring, jint jindex, jboolean)
-{
-    JSObjectCallContext context;
-    context.type = GetSlot;
-    context.nativeHandle = nativeHandle;
-    context.index = jindex;
-    return JavaJSObject::invoke (&context).l;
-}
-
-void KJS_JSObject_JSObjectSetSlot (JNIEnv*, jclass, jlong nativeHandle, jstring, jint jindex, jobject value, jboolean)
-{
-    JSObjectCallContext context;
-    context.type = SetSlot;
-    context.nativeHandle = nativeHandle;
-    context.index = jindex;
-    context.value = value;
-    JavaJSObject::invoke (&context);
-}
-
-jstring KJS_JSObject_JSObjectToString (JNIEnv*, jclass, jlong nativeHandle)
-{
-    JSObjectCallContext context;
-    context.type = ToString;
-    context.nativeHandle = nativeHandle;
-    return (jstring)JavaJSObject::invoke (&context).l;
-}
-
-}
-
-#endif // ENABLE(JAVA_BRIDGE)
--- a/modules/javafx.web/src/main/native/Source/WebCore/bridge/jni/jni_objc.mm	Wed Jan 31 06:40:25 2018 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
- * Copyright (C) 2004 Apple Computer, Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(JAVA_BRIDGE)
-
-#import <Foundation/Foundation.h>
-#import "JNIUtilityPrivate.h"
-#import "JavaType.h"
-#import "objc_utility.h"
-#include <runtime/JSLock.h>
-
-using namespace JSC::Bindings;
-
-@interface NSObject (WebScriptingPrivate)
-- (jvalue)webPlugInCallJava:(jobject)object method:(jmethodID)method returnType:(JavaType)returnType arguments:(jvalue*)args;
-- (jvalue)webPlugInCallJava:(jobject)object
-                   isStatic:(BOOL)isStatic
-                 returnType:(JavaType)returnType
-                     method:(jmethodID)method
-                  arguments:(jvalue*)args
-                 callingURL:(NSURL *)url
-       exceptionDescription:(NSString **)exceptionString;
-@end
-
-bool JSC::Bindings::dispatchJNICall(ExecState* exec, const void* targetAppletView, jobject obj, bool isStatic, JavaType returnType, jmethodID methodID, jvalue* args, jvalue &result, const char*, JSValue& exceptionDescription)
-{
-    id view = (id)targetAppletView;
-
-    // As JavaTypeArray is not known by the Mac JVM, change it to a compatible type.
-    if (returnType == JavaTypeArray)
-        returnType = JavaTypeObject;
-
-    if ([view respondsToSelector:@selector(webPlugInCallJava:isStatic:returnType:method:arguments:callingURL:exceptionDescription:)]) {
-        NSString *_exceptionDescription = 0;
-
-        // Passing nil as the calling URL will cause the Java plugin to use the URL
-        // of the page that contains the applet. The execution restrictions
-        // implemented in WebCore will guarantee that only appropriate JavaScript
-        // can reference the applet.
-        {
-           JSLock::DropAllLocks dropAllLocks(exec);
-            result = [view webPlugInCallJava:obj isStatic:isStatic returnType:returnType method:methodID arguments:args callingURL:nil exceptionDescription:&_exceptionDescription];
-        }
-
-        if (_exceptionDescription != 0) {
-            exceptionDescription = convertNSStringToString(exec, _exceptionDescription);
-        }
-        return true;
-    }
-    else if ([view respondsToSelector:@selector(webPlugInCallJava:method:returnType:arguments:)]) {
-        JSLock::DropAllLocks dropAllLocks(exec);
-        result = [view webPlugInCallJava:obj method:methodID returnType:returnType arguments:args];
-        return true;
-    }
-
-    bzero (&result, sizeof(jvalue));
-    return false;
-}
-
-#endif // ENABLE(JAVA_BRIDGE)
--- a/modules/javafx.web/src/main/native/Source/WebCore/bridge/jni/jsc/BridgeUtils.cpp	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.web/src/main/native/Source/WebCore/bridge/jni/jsc/BridgeUtils.cpp	Fri Feb 02 10:04:10 2018 -0800
@@ -1,5 +1,26 @@
 /*
- * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, 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.
  */
 
 #include "config.h"
@@ -258,8 +279,6 @@
     switch (peer_type) {
     case com_sun_webkit_dom_JSObject_JS_CONTEXT_OBJECT:
         {
-            //based on [JavaJSObject] implementation
-            //[Source/WebCore/bridge/jni/jni_jsobject.mm]
             object = static_cast<JSObjectRef>(jlong_to_ptr(peer));
             rootObject = JSC::Bindings::findProtectingRootObject(reinterpret_cast<JSC::JSObject*>(object));
             if (rootObject) {
--- a/modules/javafx.web/src/main/native/Source/WebCore/page/Performance.cpp	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.web/src/main/native/Source/WebCore/page/Performance.cpp	Fri Feb 02 10:04:10 2018 -0800
@@ -77,7 +77,7 @@
 
 Seconds Performance::reduceTimeResolution(Seconds seconds)
 {
-    double resolution = (100_us).seconds();
+    double resolution = (1000_us).seconds();
     double reduced = std::floor(seconds.seconds() / resolution) * resolution;
     return Seconds(reduced);
 }
--- a/modules/javafx.web/src/main/native/Source/cmake/OptionsGTK.cmake	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.web/src/main/native/Source/cmake/OptionsGTK.cmake	Fri Feb 02 10:04:10 2018 -0800
@@ -1,11 +1,11 @@
 include(GNUInstallDirs)
 include(VersioningUtils)
 
-SET_PROJECT_VERSION(2 18 4)
+SET_PROJECT_VERSION(2 18 5)
 set(WEBKITGTK_API_VERSION 4.0)
 
-CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(WEBKIT2 61 7 24)
-CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(JAVASCRIPTCORE 24 13 6)
+CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(WEBKIT2 61 8 24)
+CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(JAVASCRIPTCORE 24 14 6)
 
 # These are shared variables, but we special case their definition so that we can use the
 # CMAKE_INSTALL_* variables that are populated by the GNUInstallDirs macro.
--- a/modules/javafx.web/src/main/native/Tools/gtk/gtkdoc.py	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.web/src/main/native/Tools/gtk/gtkdoc.py	Fri Feb 02 10:04:10 2018 -0800
@@ -319,9 +319,9 @@
             ldflags = ' "-L%s" %s ' % (self.library_path, additional_ldflags) + ldflags
             current_ld_library_path = env.get('LD_LIBRARY_PATH')
             if current_ld_library_path:
-                env['RUN'] = 'LD_LIBRARY_PATH="%s:%s" ' % (self.library_path, current_ld_library_path)
+                env['LD_LIBRARY_PATH'] = '%s:%s' % (self.library_path, current_ld_library_path)
             else:
-                env['RUN'] = 'LD_LIBRARY_PATH="%s" ' % self.library_path
+                env['LD_LIBRARY_PATH'] = self.library_path
 
         if ldflags:
             env['LDFLAGS'] = '%s %s' % (ldflags, env.get('LDFLAGS', ''))
@@ -332,8 +332,6 @@
             self.logger.debug('CFLAGS=%s', env['CFLAGS'])
         if 'LDFLAGS' in env:
             self.logger.debug('LDFLAGS %s', env['LDFLAGS'])
-        if 'RUN' in env:
-            self.logger.debug('RUN=%s', env['RUN'])
         self._run_command(['gtkdoc-scangobj', '--module=%s' % self.module_name],
                           env=env, cwd=self.output_dir)
 
--- a/modules/javafx.web/src/test/java/test/com/sun/webkit/SharedBufferTest.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.web/src/test/java/test/com/sun/webkit/SharedBufferTest.java	Fri Feb 02 10:04:10 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, 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
@@ -33,7 +33,6 @@
 import java.util.Random;
 import org.junit.After;
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
@@ -124,14 +123,6 @@
                 getSomeData(SEGMENT_SIZE - 10, 10));
     }
 
-    @Test @Ignore
-    public void testGetSomeDataFirstSegmentLastTenBytesWithTruncation() {
-        append(SEGMENT_SIZE * 2.5);
-        assertArrayEquals(
-                g(SEGMENT_SIZE - 5, 5),
-                getSomeData(SEGMENT_SIZE - 5, 10));
-    }
-
     @Test
     public void testGetSomeDataInteriorSegmentFirstTenBytes() {
         append(SEGMENT_SIZE * 2.5);
@@ -154,14 +145,6 @@
                 getSomeData(SEGMENT_SIZE * 2 - 10, 10));
     }
 
-    @Test @Ignore
-    public void testGetSomeDataInteriorSegmentLastTenBytesWithTruncation() {
-        append(SEGMENT_SIZE * 2.5);
-        assertArrayEquals(
-                g(SEGMENT_SIZE * 2 - 5, 5),
-                getSomeData(SEGMENT_SIZE * 2 - 5, 10));
-    }
-
     @Test
     public void testGetSomeDataLastSegmentFirstTenBytes() {
         append(SEGMENT_SIZE * 2.5);
@@ -211,14 +194,6 @@
         assertArrayEquals(g(0, SEGMENT_SIZE), getSomeData(0, SEGMENT_SIZE));
     }
 
-    @Test @Ignore
-    public void testGetSomeDataFirstSegmentWithTruncation() {
-        append(SEGMENT_SIZE * 2.5);
-        assertArrayEquals(
-                g(SEGMENT_SIZE * 0.5, SEGMENT_SIZE - SEGMENT_SIZE * 0.5),
-                getSomeData(SEGMENT_SIZE * 0.5, SEGMENT_SIZE));
-    }
-
     @Test
     public void testGetSomeDataInteriorSegment() {
         append(SEGMENT_SIZE * 2.5);
@@ -227,14 +202,6 @@
                 getSomeData(SEGMENT_SIZE, SEGMENT_SIZE));
     }
 
-    @Test @Ignore
-    public void testGetSomeDataInteriorSegmentWithTruncation() {
-        append(SEGMENT_SIZE * 2.5);
-        assertArrayEquals(
-                g(SEGMENT_SIZE * 1.5, SEGMENT_SIZE - SEGMENT_SIZE * 0.5),
-                getSomeData(SEGMENT_SIZE * 1.5, SEGMENT_SIZE));
-    }
-
     @Test
     public void testGetSomeDataLastSegment() {
         append(SEGMENT_SIZE * 2.5);
@@ -389,41 +356,6 @@
         assertSharedBufferContains(g(0, SEGMENT_SIZE));
     }
 
-    @Test @Ignore
-    public void testAppendThreeSegments() {
-        append(g(0, SEGMENT_SIZE * 3));
-        assertSharedBufferContains(
-                g(0, SEGMENT_SIZE),
-                g(SEGMENT_SIZE, SEGMENT_SIZE),
-                g(SEGMENT_SIZE * 2, SEGMENT_SIZE));
-    }
-
-    @Test @Ignore
-    public void testAppendThreeSegmentsPlusSegmentPlusTenBytes() {
-        append(g(0, SEGMENT_SIZE * 3));
-        append(g(0, SEGMENT_SIZE));
-        append(g(0, 10));
-        assertSharedBufferContains(
-                g(0, SEGMENT_SIZE),
-                g(SEGMENT_SIZE, SEGMENT_SIZE),
-                g(SEGMENT_SIZE * 2, SEGMENT_SIZE),
-                g(0, SEGMENT_SIZE),
-                g(0, 10));
-    }
-
-    @Test @Ignore
-    public void testAppendTenBytesPlusSegmentPlusThreeSegments() {
-        append(g(0, 10));
-        append(g(0, SEGMENT_SIZE));
-        append(g(0, SEGMENT_SIZE * 3));
-        assertSharedBufferContains(
-                g(0, 10),
-                g(0, SEGMENT_SIZE),
-                g(0, SEGMENT_SIZE),
-                g(SEGMENT_SIZE, SEGMENT_SIZE),
-                g(SEGMENT_SIZE * 2, SEGMENT_SIZE));
-    }
-
     @Test
     public void testAppendZeroBytes() {
         append(new byte[0]);
--- a/modules/javafx.web/src/test/java/test/com/sun/webkit/SimpleSharedBufferInputStreamTest.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.web/src/test/java/test/com/sun/webkit/SimpleSharedBufferInputStreamTest.java	Fri Feb 02 10:04:10 2018 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, 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
@@ -33,7 +33,6 @@
 import java.util.Random;
 import org.junit.After;
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
@@ -166,13 +165,6 @@
         assertArrayEquals(g(SEGMENT_SIZE - 10, 10), read(10));
     }
 
-    @Test @Ignore
-    public void testRead3FirstSegmentLastTenBytesWithTruncation() {
-        append(SEGMENT_SIZE * 2.5);
-        readOut(SEGMENT_SIZE - 5);
-        assertArrayEquals(g(SEGMENT_SIZE - 5, 5), read(10));
-    }
-
     @Test
     public void testRead3InteriorSegmentFirstTenBytes() {
         append(SEGMENT_SIZE * 2.5);
@@ -194,13 +186,6 @@
         assertArrayEquals(g(SEGMENT_SIZE * 2 - 10, 10), read(10));
     }
 
-    @Test @Ignore
-    public void testRead3InteriorSegmentLastTenBytesWithTruncation() {
-        append(SEGMENT_SIZE * 2.5);
-        readOut(SEGMENT_SIZE * 2 - 5);
-        assertArrayEquals(g(SEGMENT_SIZE * 2 - 5, 5), read(10));
-    }
-
     @Test
     public void testRead3LastSegmentFirstTenBytes() {
         append(SEGMENT_SIZE * 2.5);
@@ -247,15 +232,6 @@
         assertArrayEquals(g(0, SEGMENT_SIZE), read(SEGMENT_SIZE));
     }
 
-    @Test @Ignore
-    public void testRead3FirstSegmentWithTruncation() {
-        append(SEGMENT_SIZE * 2.5);
-        readOut(SEGMENT_SIZE * 0.5);
-        assertArrayEquals(
-                g(SEGMENT_SIZE * 0.5, SEGMENT_SIZE - SEGMENT_SIZE * 0.5),
-                read(SEGMENT_SIZE));
-    }
-
     @Test
     public void testRead3InteriorSegment() {
         append(SEGMENT_SIZE * 2.5);
@@ -263,15 +239,6 @@
         assertArrayEquals(g(SEGMENT_SIZE, SEGMENT_SIZE), read(SEGMENT_SIZE));
     }
 
-    @Test @Ignore
-    public void testRead3InteriorSegmentWithTruncation() {
-        append(SEGMENT_SIZE * 2.5);
-        readOut(SEGMENT_SIZE * 1.5);
-        assertArrayEquals(
-                g(SEGMENT_SIZE * 1.5, SEGMENT_SIZE - SEGMENT_SIZE * 0.5),
-                read(SEGMENT_SIZE));
-    }
-
     @Test
     public void testRead3LastSegment() {
         append(SEGMENT_SIZE * 2.5);
@@ -381,30 +348,6 @@
         } catch (IndexOutOfBoundsException expected) {}
     }
 
-    @Test @Ignore
-    public void testRead3StandardUse() {
-        int streamSize = 24700;
-        append(streamSize);
-        int numberOfReads = streamSize / SEGMENT_SIZE + 1;
-        for (int i = 0; i < numberOfReads; i++) {
-            byte[] buffer = new byte[8192];
-            int len = is.read(buffer, 0, buffer.length);
-            int expectedLen = i == numberOfReads - 1
-                    ? streamSize % SEGMENT_SIZE : SEGMENT_SIZE;
-            assertEquals(expectedLen, len);
-            byte[] expectedBuffer = new byte[8192];
-            System.arraycopy(g(SEGMENT_SIZE * i, SEGMENT_SIZE), 0,
-                             expectedBuffer, 0,
-                             len);
-            assertArrayEquals(expectedBuffer, buffer);
-        }
-
-        byte[] buffer = new byte[8192];
-        int len = is.read(buffer, 0, buffer.length);
-        assertEquals(-1, len);
-        assertArrayEquals(new byte[8192], buffer);
-    }
-
     private void testSkipSmallNumberOfBytes(long skip) {
         int streamSize = (int) (SEGMENT_SIZE * 2.5);
         int skipCount = streamSize / SEGMENT_SIZE + 1;
@@ -420,16 +363,6 @@
         }
     }
 
-    @Test @Ignore
-    public void testSkipOneByte() {
-        testSkipSmallNumberOfBytes(1);
-    }
-
-    @Test @Ignore
-    public void testSkipTenBytes() {
-        testSkipSmallNumberOfBytes(10);
-    }
-
     @Test
     public void testSkipZeroBytes() {
         testSkipSmallNumberOfBytes(0);
@@ -573,23 +506,6 @@
         assertArrayEquals(g(0, SEGMENT_SIZE), read(SEGMENT_SIZE));
     }
 
-    @Test @Ignore
-    public void testCloseBeforeSubsequentRead() throws IOException {
-        append(SEGMENT_SIZE * 2.5);
-        assertArrayEquals(g(0, 10), read(10));
-        is.close();
-        assertArrayEquals(g(10, SEGMENT_SIZE - 10), read(SEGMENT_SIZE));
-    }
-
-    @Test @Ignore
-    public void testDoubleClose() throws IOException {
-        append(SEGMENT_SIZE * 2.5);
-        assertArrayEquals(g(0, 10), read(10));
-        is.close();
-        is.close();
-        assertArrayEquals(g(10, SEGMENT_SIZE - 10), read(SEGMENT_SIZE));
-    }
-
     @Test
     public void testCloseEmptyBuffer() throws IOException {
         is.close();
--- a/modules/javafx.web/src/test/java/test/javafx/scene/web/WebPageTest.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/javafx.web/src/test/java/test/javafx/scene/web/WebPageTest.java	Fri Feb 02 10:04:10 2018 -0800
@@ -83,4 +83,10 @@
             assertEquals("Expected single frame : ", 1, WebPageShim.getFramesCount(page));
         });
     }
+
+    // JDK-8196011
+    @Test public void testICUTagParse() {
+        load(WebPageTest.class.getClassLoader().getResource(
+                "test/html/icutagparse.html").toExternalForm());
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/javafx.web/src/test/resources/test/html/icutagparse.html	Fri Feb 02 10:04:10 2018 -0800
@@ -0,0 +1,1 @@
+<a lang='roa-x-eml'>ò</a>
--- a/modules/jdk.packager/src/main/java/com/oracle/tools/packager/IOUtils.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/jdk.packager/src/main/java/com/oracle/tools/packager/IOUtils.java	Fri Feb 02 10:04:10 2018 -0800
@@ -219,7 +219,7 @@
     }
 
     @SuppressWarnings("unchecked")
-    public static int execute(Object ... args) throws IOException, InterruptedException {
+    private static Process startProcess(Object... args) throws IOException {
         final ArrayList<String> argsList = new ArrayList<>();
         for (Object a : args) {
             if (a instanceof List) {
@@ -228,7 +228,30 @@
                 argsList.add((String)a);
             }
         }
-        final Process p = Runtime.getRuntime().exec(argsList.toArray(new String[argsList.size()]));
+
+        return Runtime.getRuntime().exec(argsList.toArray(new String[argsList.size()]));
+    }
+
+    private static void logErrorStream(Process p) {
+        final BufferedReader err = new BufferedReader(new InputStreamReader(p.getErrorStream()));
+        Thread t = new Thread(() -> {
+            try {
+                String line;
+                while ((line = err.readLine()) != null) {
+                    Log.error(line);
+                }
+            } catch (IOException ioe) {
+                Log.verbose(ioe);
+            }
+        });
+        t.setDaemon(true);
+        t.start();
+    }
+
+    @SuppressWarnings("unchecked")
+    public static int execute(Object ... args) throws IOException, InterruptedException {
+        final Process p = startProcess(args);
+
         final BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
         Thread t = new Thread(() -> {
             try {
@@ -242,20 +265,38 @@
         });
         t.setDaemon(true);
         t.start();
-        final BufferedReader err = new BufferedReader(new InputStreamReader(p.getErrorStream()));
-        t = new Thread(() -> {
+
+        logErrorStream(p);
+        return p.waitFor();
+    }
+
+    public static int getProcessOutput(List<String> result, Object... args)
+            throws IOException, InterruptedException {
+        final Process p = startProcess(args);
+
+        List<String> list = new ArrayList<>();
+        final BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
+        Thread t = new Thread(() -> {
             try {
                 String line;
-                while ((line = err.readLine()) != null) {
-                    Log.error(line);
+                while ((line = in.readLine()) != null) {
+                    list.add(line);
                 }
             } catch (IOException ioe) {
-                Log.verbose(ioe);
+                com.oracle.tools.packager.Log.verbose(ioe);
             }
         });
         t.setDaemon(true);
         t.start();
-        return p.waitFor();
+
+        logErrorStream(p);
+
+        int ret = p.waitFor();
+
+        result.clear();
+        result.addAll(list);
+
+        return ret;
     }
 
     //no good test if we are running pre-JRE7
--- a/modules/jdk.packager/src/main/java/com/oracle/tools/packager/Platform.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/jdk.packager/src/main/java/com/oracle/tools/packager/Platform.java	Fri Feb 02 10:04:10 2018 -0800
@@ -76,7 +76,7 @@
             majorVersion = Integer.parseInt(parts[0]);
 
             if (parts.length > 1) {
-                minorVersion = Integer.parseInt(parts[0]);
+                minorVersion = Integer.parseInt(parts[1]);
             }
             else {
                 minorVersion = -1;
--- a/modules/jdk.packager/src/main/java/com/oracle/tools/packager/mac/MacAppStoreBundler.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/jdk.packager/src/main/java/com/oracle/tools/packager/mac/MacAppStoreBundler.java	Fri Feb 02 10:04:10 2018 -0800
@@ -144,6 +144,11 @@
         try {
             appImageDir.mkdirs();
 
+            try {
+                MacAppImageBuilder.addNewKeychain(p);
+            } catch (InterruptedException e) {
+                Log.error(e.getMessage());
+            }
             // first, make sure we don't use the local signing key
             p.put(DEVELOPER_ID_APP_SIGNING_KEY.getID(), null);
             File appLocation = prepareAppBundle(p);
@@ -156,6 +161,8 @@
             String inheritEntitlements = getConfig_Inherit_Entitlements(p).toString();
 
             MacAppImageBuilder.signAppBundle(p, appLocation.toPath(), signingIdentity, identifierPrefix, entitlementsFile, inheritEntitlements);
+            MacAppImageBuilder.restoreKeychainList(p);
+
             ProcessBuilder pb;
 
             // create the final pkg file
--- a/modules/jdk.packager/src/main/java/com/oracle/tools/packager/mac/MacPkgBundler.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/jdk.packager/src/main/java/com/oracle/tools/packager/mac/MacPkgBundler.java	Fri Feb 02 10:04:10 2018 -0800
@@ -30,6 +30,7 @@
 import com.oracle.tools.packager.Log;
 import com.oracle.tools.packager.ConfigException;
 import com.oracle.tools.packager.IOUtils;
+import com.oracle.tools.packager.Platform;
 import com.oracle.tools.packager.RelativeFileSet;
 import com.oracle.tools.packager.UnsupportedPlatformException;
 
@@ -396,6 +397,11 @@
     private File createPKG(Map<String, ? super Object> params, File outdir, File appLocation) {
         //generic find attempt
         try {
+            if (Platform.getMajorVersion() > 10 ||
+                (Platform.getMajorVersion() == 10 && Platform.getMinorVersion() >= 12)) {
+                // we need this for OS X 10.12+
+                Log.info(I18N.getString("message.signing.pkg"));
+            }
             String daemonLocation = DAEMON_IMAGE_BUILD_ROOT.fetchFrom(params) + "/" + APP_NAME.fetchFrom(params) + ".daemon";
 
             File appPKG = getPackages_AppPackage(params);
--- a/modules/jdk.packager/src/main/java/jdk/packager/internal/legacy/builders/mac/MacAppImageBuilder.java	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/jdk.packager/src/main/java/jdk/packager/internal/legacy/builders/mac/MacAppImageBuilder.java	Fri Feb 02 10:04:10 2018 -0800
@@ -28,6 +28,7 @@
 import com.oracle.tools.packager.BundlerParamInfo;
 import com.oracle.tools.packager.IOUtils;
 import com.oracle.tools.packager.Log;
+import com.oracle.tools.packager.Platform;
 import com.oracle.tools.packager.RelativeFileSet;
 import com.oracle.tools.packager.StandardBundlerParam;
 import com.oracle.tools.packager.mac.MacResources;
@@ -92,6 +93,8 @@
 
     private final Map<String, ? super Object> params;
 
+    private static List<String> keyChains;
+
     private static Map<String, String> getMacCategories() {
         Map<String, String> map = new HashMap<>();
         map.put("Business", "public.app-category.business");
@@ -415,10 +418,16 @@
 
         // maybe sign
         if (Optional.ofNullable(SIGN_BUNDLE.fetchFrom(params)).orElse(Boolean.TRUE)) {
+            try {
+                addNewKeychain(params);
+            } catch (InterruptedException e) {
+                Log.error(e.getMessage());
+            }
             String signingIdentity = DEVELOPER_ID_APP_SIGNING_KEY.fetchFrom(params);
             if (signingIdentity != null) {
                 signAppBundle(params, root, signingIdentity, BUNDLE_ID_SIGNING_PREFIX.fetchFrom(params), null, null);
             }
+            restoreKeychainList(params);
         }
     }
 
@@ -719,6 +728,79 @@
         }
     }
 
+    public static void addNewKeychain(Map<String, ? super Object> params)
+                                    throws IOException, InterruptedException {
+        if (Platform.getMajorVersion() < 10 ||
+            (Platform.getMajorVersion() == 10 && Platform.getMinorVersion() < 12)) {
+            // we need this for OS X 10.12+
+            return;
+        }
+
+        String keyChain = SIGNING_KEYCHAIN.fetchFrom(params);
+        if (keyChain == null || keyChain.isEmpty()) {
+            return;
+        }
+
+        // get current keychain list
+        String keyChainPath = new File (keyChain).getAbsolutePath().toString();
+        List<String> keychainList = new ArrayList<>();
+        int ret = IOUtils.getProcessOutput(keychainList, "security", "list-keychains");
+        if (ret != 0) {
+            Log.error(I18N.getString("message.keychain.error"));
+            return;
+        }
+
+        boolean contains = keychainList.stream().anyMatch(
+                    str -> str.trim().equals("\""+keyChainPath.trim()+"\""));
+        if (contains) {
+            // keychain is already added in the search list
+            return;
+        }
+
+        keyChains = new ArrayList<>();
+        // remove "
+        keychainList.forEach((String s) -> {
+            String path = s.trim();
+            if (path.startsWith("\"") && path.endsWith("\"")) {
+                path = path.substring(1, path.length()-1);
+            }
+            keyChains.add(path);
+        });
+
+        List<String> args = new ArrayList<>();
+        args.add("security");
+        args.add("list-keychains");
+        args.add("-s");
+
+        args.addAll(keyChains);
+        args.add(keyChain);
+
+        ProcessBuilder  pb = new ProcessBuilder(args);
+        IOUtils.exec(pb, VERBOSE.fetchFrom(params));
+    }
+
+    public static void restoreKeychainList(Map<String, ? super Object> params) throws IOException{
+        if (Platform.getMajorVersion() < 10 ||
+            (Platform.getMajorVersion() == 10 && Platform.getMinorVersion() < 12)) {
+            // we need this for OS X 10.12+
+            return;
+        }
+
+        if (keyChains == null || keyChains.isEmpty()) {
+            return;
+        }
+
+        List<String> args = new ArrayList<>();
+        args.add("security");
+        args.add("list-keychains");
+        args.add("-s");
+
+        args.addAll(keyChains);
+
+        ProcessBuilder  pb = new ProcessBuilder(args);
+        IOUtils.exec(pb, VERBOSE.fetchFrom(params));
+    }
+
     public static void signAppBundle(Map<String, ? super Object> params, Path appLocation, String signingIdentity, String identifierPrefix, String entitlementsFile, String inheritedEntitlements) throws IOException {
         AtomicReference<IOException> toThrow = new AtomicReference<>();
         String appExecutable = "/Contents/MacOS/" + APP_NAME.fetchFrom(params);
--- a/modules/jdk.packager/src/main/native/library/common/LinuxPlatform.cpp	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/jdk.packager/src/main/native/library/common/LinuxPlatform.cpp	Fri Feb 02 10:04:10 2018 -0800
@@ -1116,7 +1116,7 @@
 
     XInitThreadsFunc();
 
-    DllFunction<XOpenDisplayFuncPtr> XOpenDisplayFunc(libX11, "XOpenDisplay33");
+    DllFunction<XOpenDisplayFuncPtr> XOpenDisplayFunc(libX11, "XOpenDisplay");
 
     _display = XOpenDisplayFunc(NULL);
 
--- a/modules/jdk.packager/src/main/resources/com/oracle/tools/packager/mac/MacPkgBundler.properties	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/jdk.packager/src/main/resources/com/oracle/tools/packager/mac/MacPkgBundler.properties	Fri Feb 02 10:04:10 2018 -0800
@@ -33,3 +33,4 @@
 message.preparing-distribution-dist=Preparing distribution.dist\: {0}
 message.config-save-location=Config files are saved to {0}. Use them to customize package.
 message.intermediate-image-location=[DEBUG] Intermediate application bundle image\: {0}
+message.signing.pkg=Warning: For signing PKG, you might need to set "Always Trust" for your certificate using "Keychain Access" tool.
--- a/modules/jdk.packager/src/main/resources/jdk/packager/internal/legacy/builders/mac/MacAppImageBuilder.properties	Wed Jan 31 06:40:25 2018 -0800
+++ b/modules/jdk.packager/src/main/resources/jdk/packager/internal/legacy/builders/mac/MacAppImageBuilder.properties	Fri Feb 02 10:04:10 2018 -0800
@@ -70,4 +70,5 @@
 message.using-custom-resource-from-file=Using custom package resource {0} (loaded from file {1})
 message.using-custom-resource-from-classpath=Using custom package resource {0} (loaded from {1})
 message.using-default-resource-from-classpath=Using default package resource {0} (add {1} to the class path to customize)
-message.ignoring.symlink=Warning: codesign is skipping the symlink {0}
\ No newline at end of file
+message.ignoring.symlink=Warning: codesign is skipping the symlink {0}
+message.keychain.error=Error: unable to get keychain list.
\ No newline at end of file