changeset 9276:d4f8c9496683

8136466: [regression] [WebView] Load single page application from jar Reviewed-by: azvegint, kcr Contributed-by: guru.hb@oracle.com
author azvegint
date Fri, 02 Oct 2015 18:39:46 +0300
parents 620f5c6b4383
children f44868fb8f86
files modules/web/src/main/native/Source/WebCore/platform/URL.cpp modules/web/src/main/native/Source/WebCore/platform/URL.h
diffstat 2 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/modules/web/src/main/native/Source/WebCore/platform/URL.cpp	Fri Oct 02 18:41:04 2015 +0300
+++ b/modules/web/src/main/native/Source/WebCore/platform/URL.cpp	Fri Oct 02 18:39:46 2015 +0300
@@ -312,6 +312,9 @@
 {
     m_isValid = false;
     m_protocolIsInHTTPFamily = false;
+#if PLATFORM(JAVA)
+    m_protocolIsInJar = false;
+#endif
     m_schemeEnd = 0;
     m_userStart = 0;
     m_userEnd = 0;
@@ -425,6 +428,11 @@
             if (str[0] == '#') {
                 appendASCII(base.m_string.left(base.m_queryEnd), str, len, parseBuffer);
                 parse(parseBuffer.data(), &relative);
+#if PLATFORM(JAVA)
+            } else if(base.isJarFile()) {
+                appendASCII(base.m_string.left(base.m_pathAfterLastSlash), str, len, parseBuffer);
+                parse(parseBuffer.data(), &relative);
+#endif
             } else {
                 m_string = relative;
                 invalidate();
@@ -1177,6 +1185,13 @@
         && isLetterMatchIgnoringCase(url[2], 'l')
         && isLetterMatchIgnoringCase(url[3], 'e');
 
+#if PLATFORM(JAVA)
+    m_protocolIsInJar = schemeEnd == 3
+        && isLetterMatchIgnoringCase(url[0], 'j')
+        && isLetterMatchIgnoringCase(url[1], 'a')
+        && isLetterMatchIgnoringCase(url[2], 'r');
+#endif
+
     m_protocolIsInHTTPFamily = isLetterMatchIgnoringCase(url[0], 'h')
         && isLetterMatchIgnoringCase(url[1], 't')
         && isLetterMatchIgnoringCase(url[2], 't')
--- a/modules/web/src/main/native/Source/WebCore/platform/URL.h	Fri Oct 02 18:41:04 2015 +0300
+++ b/modules/web/src/main/native/Source/WebCore/platform/URL.h	Fri Oct 02 18:39:46 2015 +0300
@@ -182,6 +182,7 @@
 
 #if PLATFORM(JAVA)
     String deprecatedString() const;
+    bool isJarFile() const { return m_protocolIsInJar; }
 #endif
     const URL* innerURL() const { return 0; }
 
@@ -208,6 +209,9 @@
     String m_string;
     bool m_isValid : 1;
     bool m_protocolIsInHTTPFamily : 1;
+#if PLATFORM(JAVA)
+    bool m_protocolIsInJar : 1;
+#endif
 
     int m_schemeEnd;
     int m_userStart;