Bug 226204 - AX: Fix build failure for WK API WTF::String usage
Summary: AX: Fix build failure for WK API WTF::String usage
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: chris fleizach
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-24 18:13 PDT by chris fleizach
Modified: 2021-05-24 19:33 PDT (History)
3 users (show)

See Also:


Attachments
patch (2.85 KB, patch)
2021-05-24 18:15 PDT, chris fleizach
no flags Details | Formatted Diff | Diff
patch (4.96 KB, patch)
2021-05-24 18:48 PDT, chris fleizach
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description chris fleizach 2021-05-24 18:13:26 PDT
Build failure from 

https://bugs.webkit.org/show_bug.cgi?id=225909#c13
Comment 1 Radar WebKit Bug Importer 2021-05-24 18:13:43 PDT
<rdar://problem/78428840>
Comment 2 chris fleizach 2021-05-24 18:15:38 PDT
Created attachment 429605 [details]
patch
Comment 3 Tim Horton 2021-05-24 18:42:03 PDT
Comment on attachment 429605 [details]
patch

I think the caller of WKAccessibilityTestingInjectPreference in WKTR likely needs to change too
Comment 4 chris fleizach 2021-05-24 18:48:37 PDT
Created attachment 429607 [details]
patch
Comment 5 Tim Horton 2021-05-24 18:56:19 PDT
Comment on attachment 429607 [details]
patch

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

> Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm:105
> +    WKAccessibilityTestingInjectPreference(page, toWKString(context, JSValueMakeString(context, domain)).get(), toWKString(context, JSValueMakeString(context, key)).get(), toWK((String)encodedString).get());

Probably could be WKStringCreateWithJSString
Comment 6 Darin Adler 2021-05-24 19:04:37 PDT
Comment on attachment 429607 [details]
patch

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

>> Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm:105
>> +    WKAccessibilityTestingInjectPreference(page, toWKString(context, JSValueMakeString(context, domain)).get(), toWKString(context, JSValueMakeString(context, key)).get(), toWK((String)encodedString).get());
> 
> Probably could be WKStringCreateWithJSString

instead of:

    toWKString(context, JSValueMakeString(context, domain)).get()

write:

    toWK(domain).get()

As long as you include the header StringFunctions.h. Also should come up with a better way to convert an NSString to a WKString that does not involve converting to (String).
Comment 7 Darin Adler 2021-05-24 19:08:41 PDT
Instead of:

    toWK((String)encodedString).get()

Should use:

    toWK(encodedString.createJSStringRef.get())

As long as we include the header AccessibilityCommonMac.h and StringFunctions.h
Comment 8 Darin Adler 2021-05-24 19:10:38 PDT
Or could add createWKStringRef to the NSString category.
Comment 9 Darin Adler 2021-05-24 19:11:01 PDT
Could name that toWK and overload it for NSString.
Comment 10 EWS 2021-05-24 19:33:23 PDT
Committed r277987 (238100@main): <https://commits.webkit.org/238100@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 429607 [details].