Bug 186697

Summary: AX: [macOS] When zoom is enabled, focus doesn't follow text cursor
Product: WebKit Reporter: Nan Wang <n_wang>
Component: AccessibilityAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: cfleizach, commit-queue, darin, n_wang, realdawei, rniwa, ryanhaddad, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Bug Depends on: 186783    
Bug Blocks:    
Attachments:
Description Flags
patch
darin: review+
patch commit-queue: commit-queue-

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>