Bug 186697 - AX: [macOS] When zoom is enabled, focus doesn't follow text cursor
Summary: AX: [macOS] When zoom is enabled, focus doesn't follow text cursor
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on: 186783
Blocks:
  Show dependency treegraph
 
Reported: 2018-06-15 14:48 PDT by Nan Wang
Modified: 2018-06-18 14:04 PDT (History)
8 users (show)

See Also:


Attachments
patch (1.62 KB, patch)
2018-06-15 14:56 PDT, Nan Wang
darin: review+
Details | Formatted Diff | Diff
patch (2.77 KB, patch)
2018-06-18 12:20 PDT, Nan Wang
commit-queue: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nan Wang 2018-06-15 14:48:05 PDT
The point conversion is not working since NSScreen is not available in web process

<rdar://problem/41053111>
Comment 1 Nan Wang 2018-06-15 14:56:22 PDT
Created attachment 342849 [details]
patch
Comment 2 Darin Adler 2018-06-17 11:58:55 PDT
Comment on attachment 342849 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=342849&action=review

> Source/WebCore/editing/mac/FrameSelectionMac.mm:42
> +    CGFloat screenHeight = screenRectForPrimaryScreen().height();
> +    if (screenHeight > 0)
>          bounds.origin.y = (screenHeight - (bounds.origin.y + bounds.size.height));
> -    } else
> +    else
>          bounds = CGRectZero;    

Might be even better to use the toUserSpaceForPrimaryScreen function instead of calling screenRectForPrimaryScreen directly.
Comment 3 Nan Wang 2018-06-18 11:20:39 PDT
(In reply to Darin Adler from comment #2)
> Comment on attachment 342849 [details]
> patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=342849&action=review
> 
> > Source/WebCore/editing/mac/FrameSelectionMac.mm:42
> > +    CGFloat screenHeight = screenRectForPrimaryScreen().height();
> > +    if (screenHeight > 0)
> >          bounds.origin.y = (screenHeight - (bounds.origin.y + bounds.size.height));
> > -    } else
> > +    else
> >          bounds = CGRectZero;    
> 
> Might be even better to use the toUserSpaceForPrimaryScreen function instead
> of calling screenRectForPrimaryScreen directly.

Great thanks! I'll update that
Comment 4 Nan Wang 2018-06-18 11:31:08 PDT
Committed r232935: <https://trac.webkit.org/changeset/232935>
Comment 5 Dawei Fenton (:realdawei) 2018-06-18 11:49:08 PDT
Looks like we have build failures on macOS 32-bit after this patch:

https://build.webkit.org/builders/Apple%20High%20Sierra%20Release%20%2832-bit%20Build%29/builds/6741/steps/compile-webkit/logs/stdio


......
/Volumes/Data/slave/highsierra-32bit-release/build/Source/WebCore/platform/PlatformScreen.h:93:11: note: candidate function not viable: no known conversion from 'CGRect' to 'const NSRect' (aka 'const _NSRect') for 1st argument
FloatRect toUserSpaceForPrimaryScreen(const NSRect&);
          ^
2 errors generated.

** BUILD FAILED **
The following build commands failed:
	CompileC /Volumes/Data/slave/highsierra-32bit-release/build/WebKitBuild/WebCore.build/Release/WebCore.build/Objects-normal/i386/UnifiedSource12-mm.o /Volumes/Data/slave/highsierra-32bit-release/build/WebKitBuild/Release/DerivedSources/WebCore/unified-sources/UnifiedSource12-mm.mm normal i386 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)


https://build.webkit.org/builders/Apple%20Sierra%20Release%20%2832-bit%20Build%29/builds/11856/steps/compile-webkit/logs/stdio
....
/Volumes/Data/slave/sierra-32bit-release/build/Source/WebCore/platform/PlatformScreen.h:93:11: note: candidate function not viable: no known conversion from 'CGRect' to 'const NSRect' (aka 'const _NSRect') for 1st argument
FloatRect toUserSpaceForPrimaryScreen(const NSRect&);
          ^
2 errors generated.

** BUILD FAILED **


The following build commands failed:
	CompileC /Volumes/Data/slave/sierra-32bit-release/build/WebKitBuild/WebCore.build/Release/WebCore.build/Objects-normal/i386/UnifiedSource12-mm.o /Volumes/Data/slave/sierra-32bit-release/build/WebKitBuild/Release/DerivedSources/WebCore/unified-sources/UnifiedSource12-mm.mm normal i386 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Comment 6 Nan Wang 2018-06-18 11:55:38 PDT
It worked for me locally. I will revert this and take a look.
Comment 7 WebKit Commit Bot 2018-06-18 11:57:59 PDT
Re-opened since this is blocked by bug 186783
Comment 8 Nan Wang 2018-06-18 12:20:29 PDT
Created attachment 342961 [details]
patch

This should fix the 32-bit build issue.
Comment 9 Dawei Fenton (:realdawei) 2018-06-18 12:47:55 PDT
(In reply to Nan Wang from comment #8)
> Created attachment 342961 [details]
> patch
> 
> This should fix the 32-bit build issue.

great thanks!
Comment 10 WebKit Commit Bot 2018-06-18 13:38:32 PDT
Comment on attachment 342961 [details]
patch

Rejecting attachment 342961 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.webkit.org', '--bot-id=webkit-cq-02', 'validate-changelog', '--check-oops', '--non-interactive', 342961, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

ChangeLog entry in Source/WebCore/ChangeLog contains OOPS!.

Full output: http://webkit-queues.webkit.org/results/8236008
Comment 11 Nan Wang 2018-06-18 14:04:54 PDT
Committed r232944: <https://trac.webkit.org/changeset/232944>