changeset 10727:90773bfb2a58 jdk-10+35

8192806: Building javafx.web module still requires javah Summary: Add required fields to internal sources and use javac -h Reviewed-by: kcr, arajkumar
author jvos
date Tue, 05 Dec 2017 16:11:43 +0100
parents a0212c11b74b
children 279160e9b5a0 0649a23d9e1f
files build.gradle modules/javafx.web/src/main/java/com/sun/webkit/network/URLLoader.java modules/javafx.web/src/main/native/Source/WTF/wtf/unicode/java/UnicodeJava.h modules/javafx.web/src/main/native/Source/WebCore/bindings/java/dom3/java/com/sun/webkit/dom/CharacterDataImpl.java modules/javafx.web/src/main/native/Source/WebCore/platform/java/IDNJava.cpp
diffstat 5 files changed, 66 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/build.gradle	Mon Dec 04 09:32:09 2017 -0800
+++ b/build.gradle	Tue Dec 05 16:11:43 2017 +0100
@@ -3251,20 +3251,6 @@
         jvmArgs "-DWEB_ARCHIVE_JAR_TEST_DIR=$testResourceDir"
     }
 
-    // generate some headers that are not part of our build
-    task generateHeaders(dependsOn: compileJava) {
-        doLast {
-            def dest = file("$buildDir/gensrc/headers/${project.moduleName}");
-            mkdir dest;
-            exec {
-                commandLine("$JAVAH", "-d", "$dest",);
-                args("java.lang.Character",
-                     "java.net.IDN",
-                     );
-            }
-        }
-    }
-
     task compileJavaDOMBinding()
 
     compileTargets { t ->
@@ -3278,7 +3264,7 @@
         File nativeBuildDir = new File("${webkitOutputDir}")
         nativeBuildDir.mkdirs()
 
-        def compileNativeTask = task("compileNative${t.capital}", dependsOn: [generateHeaders, compileJava]) {
+        def compileNativeTask = task("compileNative${t.capital}", dependsOn: [compileJava]) {
             println "Building Webkit configuration /$webkitConfig/ into $webkitOutputDir"
             enabled =  (IS_COMPILE_WEBKIT)
 
--- a/modules/javafx.web/src/main/java/com/sun/webkit/network/URLLoader.java	Mon Dec 04 09:32:09 2017 -0800
+++ b/modules/javafx.web/src/main/java/com/sun/webkit/network/URLLoader.java	Tue Dec 05 16:11:43 2017 +0100
@@ -36,6 +36,7 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.UnsupportedEncodingException;
+import java.lang.annotation.Native;
 import java.net.ConnectException;
 import java.net.HttpRetryException;
 import java.net.HttpURLConnection;
@@ -66,6 +67,8 @@
  */
 final class URLLoader implements Runnable {
 
+    @Native public static final int ALLOW_UNASSIGNED = java.net.IDN.ALLOW_UNASSIGNED;
+
     private static final Logger logger =
             Logger.getLogger(URLLoader.class.getName());
     private static final int MAX_REDIRECTS = 10;
--- a/modules/javafx.web/src/main/native/Source/WTF/wtf/unicode/java/UnicodeJava.h	Mon Dec 04 09:32:09 2017 -0800
+++ b/modules/javafx.web/src/main/native/Source/WTF/wtf/unicode/java/UnicodeJava.h	Tue Dec 05 16:11:43 2017 +0100
@@ -11,9 +11,9 @@
 
 #include <stdint.h>
 
-#include "java_lang_Character.h"
+#include "com_sun_webkit_dom_CharacterDataImpl.h"
 
-#define CharProp(p) java_lang_Character_##p
+#define CharProp(p) com_sun_webkit_dom_CharacterDataImpl_##p
 
 #if PLATFORM(JAVA) && OS(WINDOWS)
 typedef wchar_t UChar;
--- a/modules/javafx.web/src/main/native/Source/WebCore/bindings/java/dom3/java/com/sun/webkit/dom/CharacterDataImpl.java	Mon Dec 04 09:32:09 2017 -0800
+++ b/modules/javafx.web/src/main/native/Source/WebCore/bindings/java/dom3/java/com/sun/webkit/dom/CharacterDataImpl.java	Tue Dec 05 16:11:43 2017 +0100
@@ -25,12 +25,70 @@
 
 package com.sun.webkit.dom;
 
+import java.lang.annotation.Native;
 import org.w3c.dom.CharacterData;
 import org.w3c.dom.DOMException;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
 public class CharacterDataImpl extends NodeImpl implements CharacterData {
+    @Native public static final byte DIRECTIONALITY_LEFT_TO_RIGHT = Character.DIRECTIONALITY_LEFT_TO_RIGHT;
+    @Native public static final byte DIRECTIONALITY_RIGHT_TO_LEFT = Character.DIRECTIONALITY_RIGHT_TO_LEFT;
+    @Native public static final byte DIRECTIONALITY_EUROPEAN_NUMBER = Character.DIRECTIONALITY_EUROPEAN_NUMBER;
+    @Native public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR = Character.DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR;
+    @Native public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR = Character.DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR;
+    @Native public static final byte DIRECTIONALITY_ARABIC_NUMBER = Character.DIRECTIONALITY_ARABIC_NUMBER;
+    @Native public static final byte DIRECTIONALITY_COMMON_NUMBER_SEPARATOR = Character.DIRECTIONALITY_COMMON_NUMBER_SEPARATOR;
+    @Native public static final byte DIRECTIONALITY_PARAGRAPH_SEPARATOR = Character.DIRECTIONALITY_PARAGRAPH_SEPARATOR;
+    @Native public static final byte DIRECTIONALITY_SEGMENT_SEPARATOR = Character.DIRECTIONALITY_SEGMENT_SEPARATOR;
+    @Native public static final byte DIRECTIONALITY_WHITESPACE = Character.DIRECTIONALITY_WHITESPACE;
+    @Native public static final byte DIRECTIONALITY_OTHER_NEUTRALS = Character.DIRECTIONALITY_OTHER_NEUTRALS;
+    @Native public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING = Character.DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING;
+    @Native public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE = Character.DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE;
+    @Native public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC = Character.DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC;
+    @Native public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING = Character.DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING;
+    @Native public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE = Character.DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE;
+    @Native public static final byte DIRECTIONALITY_POP_DIRECTIONAL_FORMAT = Character.DIRECTIONALITY_POP_DIRECTIONAL_FORMAT;
+    @Native public static final byte DIRECTIONALITY_NONSPACING_MARK = Character.DIRECTIONALITY_NONSPACING_MARK;
+    @Native public static final byte DIRECTIONALITY_BOUNDARY_NEUTRAL = Character.DIRECTIONALITY_BOUNDARY_NEUTRAL;
+    @Native public static final byte UNASSIGNED = Character.UNASSIGNED;
+    @Native public static final byte UPPERCASE_LETTER = Character.UPPERCASE_LETTER;
+    @Native public static final byte LOWERCASE_LETTER = Character.LOWERCASE_LETTER;
+    @Native public static final byte TITLECASE_LETTER = Character.TITLECASE_LETTER;
+    @Native public static final byte MODIFIER_LETTER = Character.MODIFIER_LETTER;
+    @Native public static final byte OTHER_LETTER = Character.OTHER_LETTER;
+
+    @Native public static final byte NON_SPACING_MARK = Character.NON_SPACING_MARK;
+    @Native public static final byte ENCLOSING_MARK = Character.ENCLOSING_MARK;
+    @Native public static final byte COMBINING_SPACING_MARK = Character.COMBINING_SPACING_MARK;
+
+    @Native public static final byte DECIMAL_DIGIT_NUMBER = Character.DECIMAL_DIGIT_NUMBER;
+    @Native public static final byte LETTER_NUMBER = Character.LETTER_NUMBER;
+    @Native public static final byte OTHER_NUMBER = Character.OTHER_NUMBER;
+
+    @Native public static final byte SPACE_SEPARATOR = Character.SPACE_SEPARATOR;
+    @Native public static final byte LINE_SEPARATOR = Character.LINE_SEPARATOR;
+    @Native public static final byte PARAGRAPH_SEPARATOR = Character.PARAGRAPH_SEPARATOR;
+
+    @Native public static final byte CONTROL = Character.CONTROL;
+    @Native public static final byte FORMAT = Character.FORMAT;
+    @Native public static final byte PRIVATE_USE = Character.PRIVATE_USE;
+    @Native public static final byte SURROGATE = Character.SURROGATE;
+
+    @Native public static final byte DASH_PUNCTUATION = Character.DASH_PUNCTUATION;
+    @Native public static final byte START_PUNCTUATION = Character.START_PUNCTUATION;
+    @Native public static final byte END_PUNCTUATION = Character.END_PUNCTUATION;
+    @Native public static final byte CONNECTOR_PUNCTUATION = Character.CONNECTOR_PUNCTUATION;
+    @Native public static final byte OTHER_PUNCTUATION = Character.OTHER_PUNCTUATION;
+
+    @Native public static final byte MATH_SYMBOL = Character.MATH_SYMBOL;
+    @Native public static final byte CURRENCY_SYMBOL = Character.CURRENCY_SYMBOL;
+    @Native public static final byte MODIFIER_SYMBOL = Character.MODIFIER_SYMBOL;
+    @Native public static final byte OTHER_SYMBOL = Character.OTHER_SYMBOL;
+
+    @Native public static final byte INITIAL_QUOTE_PUNCTUATION = Character.INITIAL_QUOTE_PUNCTUATION;
+    @Native public static final byte FINAL_QUOTE_PUNCTUATION = Character.FINAL_QUOTE_PUNCTUATION;
+
     CharacterDataImpl(long peer) {
         super(peer);
     }
--- a/modules/javafx.web/src/main/native/Source/WebCore/platform/java/IDNJava.cpp	Mon Dec 04 09:32:09 2017 -0800
+++ b/modules/javafx.web/src/main/native/Source/WebCore/platform/java/IDNJava.cpp	Tue Dec 05 16:11:43 2017 +0100
@@ -4,7 +4,7 @@
 #include "config.h"
 #include "IDNJava.h"
 #include <wtf/java/JavaEnv.h>
-#include "java_net_IDN.h"
+#include "com_sun_webkit_network_URLLoader.h"
 
 static JGClass idnClass;
 static jmethodID toASCIIMID;
@@ -36,7 +36,7 @@
             idnClass,
             toASCIIMID,
             (jstring)hostname.toJavaString(env),
-            java_net_IDN_ALLOW_UNASSIGNED));
+            com_sun_webkit_network_URLLoader_ALLOW_UNASSIGNED));
     CheckAndClearException(env);
 
     return String(env, result);