JDK-8185132 : window.requestAnimationFrame API is not working
Type:Bug
Component:javafx
Sub-Component:web
Affected Version:8u151,9.0.1,10
Priority:P2
Status:Resolved
Resolution:Fixed
Submitted:2017-07-24
Updated:2017-10-10
Resolved:2017-08-01
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
Sites(e.g. apple.com) which uses requestAnimationFrame API are not rendering properly.
Load https://codepen.io/matt-west/pen/bGdEC in HelloWebView to reproduce the issue.
Comments
changeset: a654f851e724
user: arajkumar
date: Tue Aug 01 14:20:34 2017 +0530
description: 8185132: window.requestAnimationFrame API is not working
Reviewed-by: ghb, mbilla
URL: http://hg.openjdk.java.net/openjfx/10-dev/rt/rev/a654f851e724
01-08-2017
Tested the fix and test case..
+1
28-07-2017
+1, Fix verified by loading https://codepen.io/matt-west/pen/bGdEC in WebView.
Till now we never enabled window.requestAnimationFrame(rAF) API, recent WebKit upgrade(JDK-8183292) enables rAF by default. Most of the websites which uses rAF calls the API through polyfill interface[1]. So it was working earlier, after JDK-8183292 only the API exists without any implementation.
[1] https://gist.github.com/paulirish/1579671
27-07-2017
Partial rendering is due to missing requestAnimationFrame[1]. Previous WebKit disabled by default[2], but recent upgrade enables rAF by default[3]. From platform side we should provide an implementation or enable the default implementation available in WebKit. The below patch fixes the issue,
diff -r 3b13cad6db4b modules/javafx.web/src/main/native/Source/WTF/wtf/Platform.h
--- a/modules/javafx.web/src/main/native/Source/WTF/wtf/Platform.h Wed Jul 26 16:34:33 2017 +0530
+++ b/modules/javafx.web/src/main/native/Source/WTF/wtf/Platform.h Wed Jul 26 23:21:53 2017 +0530
@@ -1066,7 +1066,7 @@
#define USE_VIDEOTOOLBOX 1
#endif
-#if PLATFORM(COCOA) || PLATFORM(GTK) || (PLATFORM(WIN) && !USE(WINGDI))
+#if PLATFORM(COCOA) || PLATFORM(GTK) || (PLATFORM(WIN) && !USE(WINGDI)) || PLATFORM(JAVA)
#define USE_REQUEST_ANIMATION_FRAME_TIMER 1
#endif
[1] https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame
[2] https://bugs.webkit.org/show_bug.cgi?id=156980
[3] https://trac.webkit.org/changeset/210797/webkit