Bug 154991 - Inform WebKit and WebCore if a page is controlled by automation
Summary: Inform WebKit and WebCore if a page is controlled by automation
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Timothy Hatcher
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-03-03 16:22 PST by Timothy Hatcher
Modified: 2016-03-05 16:02 PST (History)
11 users (show)

See Also:


Attachments
Patch (12.45 KB, patch)
2016-03-03 16:27 PST, Timothy Hatcher
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Hatcher 2016-03-03 16:22:50 PST
WebCore will need to know if a page is automated to expose extra WebDriver API on the navigator object. WebKit2 also needs to know for Safari's injected bundle code.
Comment 1 Radar WebKit Bug Importer 2016-03-03 16:23:22 PST
<rdar://problem/24965784>
Comment 2 Timothy Hatcher 2016-03-03 16:27:41 PST
Created attachment 272793 [details]
Patch
Comment 3 Joseph Pecoraro 2016-03-04 00:05:20 PST
Comment on attachment 272793 [details]
Patch

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

r=me

> Source/WebKit2/UIProcess/API/C/WKPagePrivate.h:88
> +WK_EXPORT bool WKPageGetIsControlledByAutomation(WKPageRef page);
> +WK_EXPORT void WKPageSetControlledByAutomation(WKPageRef page, bool controlled);

It seems a little roundabout to require a WK2 API for a client to decide the page is for automation. I realize that is the case right now, but perhaps we should file a bug / have a comment somewhere that we should move to having automation pages in their own process pool, so it is guaranteed / known in WebKit what pages are automation without requiring client involvement.
Comment 4 WebKit Commit Bot 2016-03-04 08:55:47 PST
Comment on attachment 272793 [details]
Patch

Clearing flags on attachment: 272793

Committed r197564: <http://trac.webkit.org/changeset/197564>
Comment 5 WebKit Commit Bot 2016-03-04 08:55:50 PST
All reviewed patches have been landed.  Closing bug.
Comment 6 BJ Burg 2016-03-05 16:02:49 PST
Comment on attachment 272793 [details]
Patch

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

>> Source/WebKit2/UIProcess/API/C/WKPagePrivate.h:88
>> +WK_EXPORT void WKPageSetControlledByAutomation(WKPageRef page, bool controlled);
> 
> It seems a little roundabout to require a WK2 API for a client to decide the page is for automation. I realize that is the case right now, but perhaps we should file a bug / have a comment somewhere that we should move to having automation pages in their own process pool, so it is guaranteed / known in WebKit what pages are automation without requiring client involvement.

While in general I agree that it would be nice to confine automation pages to their own process pool, this may not be feasible for all ports. I'l file a bug internally to get feedback. <rdar://problem/24996361>