Bug 210760

Summary: The rect for the primary screen should be retrieved on the main thread.
Product: WebKit Reporter: Andres Gonzalez <andresg_22>
Component: New BugsAssignee: Andres Gonzalez <andresg_22>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, apinheiro, cfleizach, darin, dmazzoni, ews-watchlist, jcraig, jdiggs, samuel_white, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Andres Gonzalez 2020-04-20 12:21:33 PDT
The rect for the primary screen should be retrieved on the main thread.
Comment 1 Andres Gonzalez 2020-04-20 12:26:12 PDT
Created attachment 397001 [details]
Patch
Comment 2 EWS 2020-04-20 13:11:15 PDT
Committed r260392: <https://trac.webkit.org/changeset/260392>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 397001 [details].
Comment 3 Radar WebKit Bug Importer 2020-04-20 13:12:15 PDT
<rdar://problem/62072352>
Comment 4 Darin Adler 2020-04-20 14:49:18 PDT
Comment on attachment 397001 [details]
Patch

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

> Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:1952
> +    static FloatRect screenRect;
> +    if (screenRect.isEmpty()) {
> +        screenRect = Accessibility::retrieveValueFromMainThread<FloatRect>([] () -> FloatRect {
> +            return screenRectForPrimaryScreen();
> +        });
> +    }

You don’t need to add the if statement:

    static FloatRect screenRect = Accessibility::retrieveValueFromMainThread<FloatRect>([] () -> FloatRect {
        return screenRectForPrimaryScreen();
    });
Comment 5 Andres Gonzalez 2020-04-23 08:40:07 PDT
(In reply to Darin Adler from comment #4)
> Comment on attachment 397001 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=397001&action=review
> 
> > Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:1952
> > +    static FloatRect screenRect;
> > +    if (screenRect.isEmpty()) {
> > +        screenRect = Accessibility::retrieveValueFromMainThread<FloatRect>([] () -> FloatRect {
> > +            return screenRectForPrimaryScreen();
> > +        });
> > +    }
> 
> You don’t need to add the if statement:
> 
>     static FloatRect screenRect =
> Accessibility::retrieveValueFromMainThread<FloatRect>([] () -> FloatRect {
>         return screenRectForPrimaryScreen();
>     });

Fixed in https://bugs.webkit.org/show_bug.cgi?id=210914. Thanks!