changeset 11182:20234c4d09b8 12+10

8213806: WebView - JVM crashes for given HTML Reviewed-by: mbilla, kcr
author arajkumar
date Thu, 24 Jan 2019 14:15:12 +0530
parents b1232b8e8de0
children b5c27572ab56
files modules/javafx.web/src/main/native/Source/WebCore/platform/URLHash.h modules/javafx.web/src/test/java/test/javafx/scene/web/MiscellaneousTest.java
diffstat 2 files changed, 28 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/modules/javafx.web/src/main/native/Source/WebCore/platform/URLHash.h	Tue Jan 22 10:39:45 2019 -0800
+++ b/modules/javafx.web/src/main/native/Source/WebCore/platform/URLHash.h	Thu Jan 24 14:15:12 2019 +0530
@@ -35,7 +35,7 @@
     struct URLHash {
         static unsigned hash(const URL& key)
         {
-            return key.string().impl()->hash();
+            return key.string().hash();
         }
 
         static bool equal(const URL& a, const URL& b)
--- a/modules/javafx.web/src/test/java/test/javafx/scene/web/MiscellaneousTest.java	Tue Jan 22 10:39:45 2019 -0800
+++ b/modules/javafx.web/src/test/java/test/javafx/scene/web/MiscellaneousTest.java	Thu Jan 24 14:15:12 2019 +0530
@@ -497,4 +497,31 @@
             assertTrue("Color should be opaque yellow:" + pixelAt399x145, isColorsSimilar(Color.YELLOW, pixelAt399x145, 1));
         });
     }
+
+    @Test public void testShadowDOMWithLoadContent() {
+        loadContent("<html>\n" +
+                    "  <body>\n" +
+                    "    <template id='element-details-template'>\n" +
+                    "      <style>\n" +
+                    "        p { font-weight: bold; }\n" +
+                    "      </style>\n" +
+                    "    </template>\n" +
+                    "    <element-details>\n" +
+                    "    </element-details>\n" +
+                    "    <script>\n" +
+                    "    customElements.define('element-details',\n" +
+                    "      class extends HTMLElement {\n" +
+                    "        constructor() {\n" +
+                    "          super();\n" +
+                    "          const template = document\n" +
+                    "            .getElementById('element-details-template')\n" +
+                    "            .content;\n" +
+                    "          const shadowRoot = this.attachShadow({mode: 'open'})\n" +
+                    "            .appendChild(template.cloneNode(true));\n" +
+                    "        }\n" +
+                    "      })\n" +
+                    "    </script>\n" +
+                    "  </body>\n" +
+                    "</html>");
+    }
 }