JDK-8326989 : Text selection issues on WebView after WebKit 617.1
  • Type: Bug
  • Component: javafx
  • Sub-Component: web
  • Affected Version: 8u411,jfx23
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-02-28
  • Updated: 2024-03-15
  • Resolved: 2024-03-07
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 8 Other
8u411Fixed jfx17.0.11Fixed
Related Reports
Relates :  
Relates :  
Description
After the fix for JDK-8318614, that updated WebKit to 617.1, text selection within a WebView is not working as expected.

Run the attached text, that shows some simple text. 

Double clicking on any word, like "some" should select and highlight it (as shown in Expected selection.png), but it doesn't (see Selection not visible.png). The same happens if the selection is done by pressing, dragging and releasing the mouse.

However the word is somehow selected (copy and paste work, for instance), and after resizing the application, the blue background shows up (see Selection visible after resizing.png).

The issue happens on macOS, Windows and Linux. 
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jfx17u/pull/187 Date: 2024-03-08 10:18:21 +0000
08-03-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jfx21u/pull/53 Date: 2024-03-08 10:13:27 +0000
08-03-2024

[jfx22u-fix-request] This is a clean backport to jfx22u. This is needed in order to maintain same webkit code across all branches
07-03-2024

Changeset: 64af9875 Author: Hima Bindu Meda <hmeda@openjdk.org> Date: 2024-03-07 04:55:48 +0000 URL: https://git.openjdk.org/jfx/commit/64af987576214fc5483520ce8131895be74a641d
07-03-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jfx22u/pull/18 Date: 2024-03-07 12:43:17 +0000
07-03-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jfx/pull/1391 Date: 2024-03-06 14:51:40 +0000
06-03-2024

A possible fix for this issue is being tested. If internal testing reveals no problems, a PR will be raised soon.
05-03-2024

Further debugging is in progress.
04-03-2024

Comparing the logs between webkit-616.1 and webkit-617.1, it is observed that during the test scenario, double click scenario is processed as "twkProcessMouseEvent" in webkit-617.1 whereas, in webkit-616.1, it is processed as "twkUpdateContent" in webkit-616.1. As seen from below logs, clipRectsType is set as "type: painting" in webkit-616.1 , whereas , in webkit-617.1 clipRectsType is set as "type: root-relative". Debug build of 616.1 shows below trace for double click : EventDispatcher::dispatchEvent dblclick phase 0 bubbles cancelable 0x149002930 on node node 0x149001e10 P 0x149001e10 RenderLayer 0x149001a90 backgroundClipRect with context (root layer: 0x149000c60) (type: painting) (overflow-clip: respect) returning rect infinite 0 libjfxwebkit.dylib 0x000000015ebe6900 _ZN7WebCore11print_traceEv + 48 1 libjfxwebkit.dylib 0x000000015ebf8695 _ZNK7WebCore11RenderLayer18backgroundClipRectERKNS0_16ClipRectsContextE + 581 2 libjfxwebkit.dylib 0x000000015ebfef09 _ZNK7WebCore11RenderLayer14calculateRectsERKNS0_16ClipRectsContextERKNS_10LayoutRectERS4_RNS_8ClipRectES9_RKNS_10LayoutSizeE + 105 3 libjfxwebkit.dylib 0x000000015ebfcdf2 _ZN7WebCore11RenderLayer16collectFragmentsERN3WTF6VectorINS_13LayerFragmentELm1ENS1_15CrashOnOverflowELm16ENS1_10FastMallocEEEPKS0_RKNS_10LayoutRectENS0_23PaginationInclusionModeENS_13ClipRectsTypeENS1_9OptionSetINS0_15ClipRectsOptionEEERKNS_10LayoutSizeEPSB_NS_32ShouldApplyRootOffsetToFragmentsE + 226 4 libjfxwebkit.dylib 0x000000015ebf978f _ZN7WebCore11RenderLayer18paintLayerContentsERNS_15GraphicsContextERKNS0_17LayerPaintingInfoEN3WTF9OptionSetINS0_14PaintLayerFlagEEE + 2447 5 libjfxwebkit.dylib 0x000000015ebf8d30 _ZN7WebCore11RenderLayer31paintLayerContentsAndReflectionERNS_15GraphicsContextERKNS0_17LayerPaintingInfoEN3WTF9OptionSetINS0_14PaintLayerFlagEEE + 432 6 libjfxwebkit.dylib 0x000000015ebf7ca1 _ZN7WebCore11RenderLayer21paintLayerWithEffectsERNS_15GraphicsContextERKNS0_17LayerPaintingInfoEN3WTF9OptionSetINS0_14PaintLayerFlagEEE + 1345 7 libjfxwebkit.dylib 0x000000015ebf6eaf _ZN7WebCore11RenderLayer10paintLayerERNS_15GraphicsContextERKNS0_17LayerPaintingInfoEN3WTF9OptionSetINS0_14PaintLayerFlagEEE + 367 8 libjfxwebkit.dylib 0x000000015ebfdae1 _ZN7WebCore11RenderLayer9paintListENS0_9LayerListERNS_15GraphicsContextERKNS0_17LayerPaintingInfoEN3WTF9OptionSetINS0_14PaintLayerFlagEEE + 241 9 libjfxwebkit.dylib 0x000000015ebf9a4d _ZN7WebCore11RenderLayer18paintLayerContentsERNS_15GraphicsContextERKNS0_17LayerPaintingInfoEN3WTF9OptionSetINS0_14PaintLayerFlagEEE + 3149 10 libjfxwebkit.dylib 0x000000015ebf8d30 _ZN7WebCore11RenderLayer31paintLayerContentsAndReflectionERNS_15GraphicsContextERKNS0_17LayerPaintingInfoEN3WTF9OptionSetINS0_14PaintLayerFlagEEE + 432 11 libjfxwebkit.dylib 0x000000015ebf7ca1 _ZN7WebCore11RenderLayer21paintLayerWithEffectsERNS_15GraphicsContextERKNS0_17LayerPaintingInfoEN3WTF9OptionSetINS0_14PaintLayerFlagEEE + 1345 12 libjfxwebkit.dylib 0x000000015ebf6eaf _ZN7WebCore11RenderLayer10paintLayerERNS_15GraphicsContextERKNS0_17LayerPaintingInfoEN3WTF9OptionSetINS0_14PaintLayerFlagEEE + 367 13 libjfxwebkit.dylib 0x000000015ebf6b98 _ZN7WebCore11RenderLayer5paintERNS_15GraphicsContextERKNS_10LayoutRectERKNS_10LayoutSizeEN3WTF9OptionSetINS_13PaintBehaviorEEEPNS_12RenderObjectENSA_INS0_14PaintLayerFlagEEENS0_25SecurityOriginPaintPolicyEPNS_18EventRegionContextE + 280 14 libjfxwebkit.dylib 0x000000015e42f0a0 _ZN7WebCore9FrameView13paintContentsERNS_15GraphicsContextERKNS_7IntRectENS_6Widget25SecurityOriginPaintPolicyEPNS_18EventRegionContextE + 1104 15 libjfxwebkit.dylib 0x000000015e6301aa _ZN7WebCore10ScrollView5paintERNS_15GraphicsContextERKNS_7IntRectENS_6Widget25SecurityOriginPaintPolicyEPNS_18EventRegionContextE + 730 16 libjfxwebkit.dylib 0x000000015b56d89a _ZN7WebCore7WebPage5paintEP8_jobjectiiii + 554 17 libjfxwebkit.dylib 0x000000015b575f09 Java_com_sun_webkit_WebPage_twkUpdateContent + 73 18 ??? 0x00000001187a50f0 0x0 + 4705636592 19 ??? 0x000000011879f0ff 0x0 + 4705612031 For the same double click event, webkit-617 log is as follows: EventDispatcher::dispatchEvent dblclick phase 0 bubbles cancelable 0x143002920 on node node 0x143001f10 P 0x143001f10 RenderLayer 0x143001b90 backgroundClipRect with context (root layer: 0x143000d50) (type: root-relative) (overflow-clip: respect) returning rect infinite 0 libjfxwebkit.dylib 0x0000000158a2ddc0 _ZN7WebCore11print_traceEv + 48 1 libjfxwebkit.dylib 0x0000000158a3e835 _ZNK7WebCore11RenderLayer18backgroundClipRectERKNS0_16ClipRectsContextE + 581 2 libjfxwebkit.dylib 0x0000000158a45469 _ZNK7WebCore11RenderLayer14calculateRectsERKNS0_16ClipRectsContextERKNS_10LayoutRectERS4_RNS_8ClipRectES9_RKNS_10LayoutSizeE + 105 3 libjfxwebkit.dylib 0x0000000158a43282 _ZN7WebCore11RenderLayer16collectFragmentsERN3WTF6VectorINS_13LayerFragmentELm1ENS1_15CrashOnOverflowELm16ENS1_10FastMallocEEEPKS0_RKNS_10LayoutRectENS0_23PaginationInclusionModeENS_13ClipRectsTypeENS1_9OptionSetINS0_15ClipRectsOptionEEERKNS_10LayoutSizeEPSB_NS_32ShouldApplyRootOffsetToFragmentsE + 226 4 libjfxwebkit.dylib 0x0000000158a47a05 _ZN7WebCore11RenderLayer12hitTestLayerEPS0_S1_RKNS_14HitTestRequestERNS_13HitTestResultERKNS_10LayoutRectERKNS_15HitTestLocationEbPKNS_24HitTestingTransformStateEPd + 3381 5 libjfxwebkit.dylib 0x0000000158a496c0 _ZN7WebCore11RenderLayer11hitTestListENS0_9LayerListEPS0_RKNS_14HitTestRequestERNS_13HitTestResultERKNS_10LayoutRectERKNS_15HitTestLocationEPKNS_24HitTestingTransformStateEPdSH_SG_b + 624 6 libjfxwebkit.dylib 0x0000000158a4765e _ZN7WebCore11RenderLayer12hitTestLayerEPS0_S1_RKNS_14HitTestRequestERNS_13HitTestResultERKNS_10LayoutRectERKNS_15HitTestLocationEbPKNS_24HitTestingTransformStateEPd + 2446 7 libjfxwebkit.dylib 0x0000000158a46adb _ZN7WebCore11RenderLayer7hitTestERKNS_14HitTestRequestERKNS_15HitTestLocationERNS_13HitTestResultE + 859 8 libjfxwebkit.dylib 0x00000001576349cf _ZN7WebCore8Document7hitTestERKNS_14HitTestRequestERKNS_15HitTestLocationERNS_13HitTestResultE + 223 9 libjfxwebkit.dylib 0x0000000157619881 _ZN7WebCore8Document7hitTestERKNS_14HitTestRequestERNS_13HitTestResultE + 65 10 libjfxwebkit.dylib 0x0000000157619654 _ZN7WebCore8Document17prepareMouseEventERKNS_14HitTestRequestERKNS_11LayoutPointERKNS_18PlatformMouseEventE + 196 11 libjfxwebkit.dylib 0x00000001581b4bd9 _ZN7WebCore12EventHandler17prepareMouseEventERKNS_14HitTestRequestERKNS_18PlatformMouseEventE + 265 12 libjfxwebkit.dylib 0x00000001581b53dd _ZN7WebCore12EventHandler20handleMouseMoveEventERKNS_18PlatformMouseEventEPNS_13HitTestResultEb + 701 13 libjfxwebkit.dylib 0x00000001581b5017 _ZN7WebCore12EventHandler10mouseMovedERKNS_18PlatformMouseEventE + 215 14 libjfxwebkit.dylib 0x00000001552f85a5 Java_com_sun_webkit_WebPage_twkProcessMouseEvent + 741 15 ??? 0x000000010adb653a 0x0 + 4477117754
04-03-2024

This regression is a serious usability issue, with no known workaround. Raising the priority to P2.
01-03-2024

Yes, I was testing from head, and indeed it is a different issue.
29-02-2024

Answering my own question, I can reproduce this with the latest build. Raising the priority to P3.
29-02-2024

[~jpereda] Are you testing with the fix for JDK-8323880? That fixed at least some cases of text selection, although you might have discovered a different bug.
29-02-2024