JDK-8159383 : Mouse hover on Webview scroll bar leads to NPE in ScrollBarThemeImpl.hitTest
  • Type: Bug
  • Component: javafx
  • Sub-Component: web
  • Affected Version: 9
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2016-06-13
  • Updated: 2016-06-15
  • Resolved: 2016-06-15
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.

To download the current JDK release, click here.
JDK 9
9Fixed
Related Reports
Relates :  
Description
Mouse hover on Webview scroll bar throws NPE (Call stack below) 
Steps to re-produce 
1. Use Simple HelloWebview and load any webpage which is greater than Webview's width and height 
2. Hover Mouse on Webview scrollbar 
3. observer the exception in console 


This could be due to JDK-8157684 (scroll bar not showing) and JDK-8158659
java.lang.NullPointerException
        at com.sun.javafx.webkit.theme.ScrollBarThemeImpl.hitTest(ScrollBarThemeImpl.java:225)
        at com.sun.webkit.WebPage.twkProcessMouseEvent(Native Method)
        at com.sun.webkit.WebPage.dispatchMouseEvent(WebPage.java:789)
        at javafx.scene.web.WebView.processMouseEvent(WebView.java:1050)
        at javafx.scene.web.WebView.lambda$registerEventHandlers$3(WebView.java:1173)
        at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
        at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
        at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
        at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
        at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
        at javafx.event.Event.fireEvent(Event.java:198)
        at javafx.scene.Scene$MouseHandler.process(Scene.java:3868)
        at javafx.scene.Scene$MouseHandler.access$1300(Scene.java:3596)
        at javafx.scene.Scene.processMouseEvent(Scene.java:1867)
        at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2605)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:382)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:295)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:418)
        at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389)
        at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:417)
        at com.sun.glass.ui.View.handleMouseEvent(View.java:555)
        at com.sun.glass.ui.View.notifyMouse(View.java:937)
        at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:189)
        at java.lang.Thread.run(Thread.java:804)

Comments
Changeset: a69bb28fa5a6 Author: ckyang Date: 2016-06-15 15:07 -0700 URL: http://hg.openjdk.java.net/openjfx/9-dev/rt/rev/a69bb28fa5a6
15-06-2016

+1
15-06-2016

Please review this simple 2 line fix. The bug was caused by I forgot to update ScrollBarWidgetHelper.java to extend ControlHelper instead of RegionHelper when I introduced ControlHelper in a later impl_ encapsulation work. diff --git a/modules/web/src/main/java/com/sun/javafx/webkit/theme/ScrollBarWidgetHelper.java b/modules/web/src/main/java/com/sun/javafx/webkit/theme/ScrollBarWidgetHelper.java --- a/modules/web/src/main/java/com/sun/javafx/webkit/theme/ScrollBarWidgetHelper.java +++ b/modules/web/src/main/java/com/sun/javafx/webkit/theme/ScrollBarWidgetHelper.java @@ -25,14 +25,14 @@ package com.sun.javafx.webkit.theme; -import com.sun.javafx.scene.layout.RegionHelper; +import com.sun.javafx.scene.control.ControlHelper; import com.sun.javafx.util.Utils; import javafx.scene.Node; /** * Used to access internal methods of ScrollBarWidget. */ -public class ScrollBarWidgetHelper extends RegionHelper { +public class ScrollBarWidgetHelper extends ControlHelper { private static final ScrollBarWidgetHelper theInstance; private static ScrollBarWidgetAccessor scrollBarWidgetAccessor;
15-06-2016

Please evaluate and re-assign if its dependent on JDK-8157684
14-06-2016

I can also confirm that this works fine in 8u-dev, so it is likely unrelated to JDK-8157684.
14-06-2016

I used hg bisect to confirm that this regression was caused by the fix for JDK-8158659.
14-06-2016