Bug 224793

Summary: [Win] GetDoubleClickTime() returns 0 in the non-interactive window station on Windows 10 version 2004
Product: WebKit Reporter: Fujii Hironori <Hironori.Fujii>
Component: Tools / TestsAssignee: Fujii Hironori <Hironori.Fujii>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, bfulgham, don.olmstead, lingcherd_ho, pvollan, ross.kirsling, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
WIP patch
none
Patch
none
Patch none

Description Fujii Hironori 2021-04-19 18:39:03 PDT
[Win][WK1] Some editing and events tests are failing if running as admin in Windows 10 20H2

The following tests are failing in Windows 10 20H2.

  editing/deleting/smart-delete-across-editable-boundaries-2.html [ Failure ]
  editing/deleting/smart-delete-paragraph-005.html [ Failure ]
  editing/selection/5057506-2.html [ Failure ]
  editing/selection/5195166-1.html [ Failure ]
  editing/selection/anchor-focus1.html [ Failure ]
  editing/selection/click-in-focusable-link-should-not-clear-selection.html [ Failure ]
  editing/selection/double-click-selection-with-dom-mutation.html [ Failure ]
  editing/selection/doubleclick-beside-cr-span.html [ Failure ]
  editing/selection/doubleclick-crash.html [ Failure ]
  editing/selection/doubleclick-inline-first-last-contenteditable.html [ Failure ]
  editing/selection/doubleclick-japanese-text.html [ Failure ]
  editing/selection/doubleclick-whitespace.html [ Failure ]
  editing/selection/extend-after-mouse-selection.html [ Failure ]
  editing/selection/extend-selection-after-double-click.html [ Failure ]
  editing/selection/fake-doubleclick.html [ Failure ]
  editing/selection/mixed-editability-1.html [ Failure ]
  editing/selection/paragraph-granularity.html [ Failure ]
  editing/selection/select-from-textfield-outwards.html [ Failure ]
  editing/selection/selection-actions.html [ Failure ]
  editing/selection/shift-click.html [ Failure ]
  editing/selection/triple-click-in-pre.html [ Failure ]
  editing/selection/user-select-all-with-shift.html [ Failure ]
  editing/selection/word-granularity.html [ Failure ]
  editing/undo/undo-smart-delete-reversed-selection.html [ Failure ]
  editing/undo/undo-smart-delete-word.html [ Failure ]
  fast/events/5056619.html [ Failure ]
  fast/events/click-count.html [ Failure ]
  fast/events/dblclick-addEventListener.html [ Failure ]
  fast/events/mouse-click-events.html [ Failure ]
  fast/events/ondragenter.html [ Failure ]
  fast/events/selectstart-by-double-triple-clicks.html [ Failure ]
  fast/events/updateLayoutForHitTest.html [ Failure ]
  fast/events/zoom-dblclick.html [ Failure ]
  fast/text/offsetForPosition-complex-fallback.html [ Failure ]
  
However, those tests are passing if running as a normal user.
DumpRenderTree.exe should be run as admin for CreateWindowStation API.
Comment 1 Fujii Hironori 2021-04-19 19:24:16 PDT
Because AppleWin marks all editing/selection as flaky, it's not easy to observe this issue. But, AppleWin also has this issue.

> editing/selection/ [ Pass Failure ]

https://github.com/WebKit/WebKit/blob/a13091fa25bc02a82063ea6cfb65faae6ed8006a/LayoutTests/platform/win/TestExpectations#L1229
Comment 2 Fujii Hironori 2021-04-20 21:24:41 PDT
Created attachment 426641 [details]
WIP patch

GetDoubleClickTime() returns 0 in the window station.
Comment 3 Fujii Hironori 2021-04-20 22:30:01 PDT
SetDoubleClickTime also fails in the window station.
GetLastError() returns ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION.
Comment 4 Fujii Hironori 2021-04-20 22:45:07 PDT
winapi - GetDoubleClickTime returns 0 unexpectedly - Stack Overflow
https://stackoverflow.com/q/63466907

Bug in Windows 10 Version 2004: GetDoubleClickTime unexpectedly returns 0 when Batch Login is used | Wolfsbeeren
https://www.neunbeere.de/blog/2020/08/bug-in-windows-10-version-2004-getdoubleclicktime-unexpectedly-returns-0-when-batch-login-is-used/
Comment 5 Fujii Hironori 2021-04-21 00:42:41 PDT
Created attachment 426654 [details]
Patch
Comment 6 Alex Christensen 2021-04-21 13:13:17 PDT
Comment on attachment 426654 [details]
Patch

WebEventFactory.cpp also calls GetDoubleClickTime.
This should be put into a shared function and used by both.
Comment 7 Fujii Hironori 2021-04-21 19:26:31 PDT
Created attachment 426765 [details]
Patch
Comment 8 Fujii Hironori 2021-04-21 21:51:33 PDT
Comment on attachment 426765 [details]
Patch

Clearing flags on attachment: 426765

Committed r276421 (236886@main): <https://commits.webkit.org/236886@main>
Comment 9 Fujii Hironori 2021-04-21 21:51:37 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Ling Ho 2021-04-22 16:25:33 PDT
<rdar://76999405>