Bug 190302 - Expose whether WKWebProcessPlugInNodeHandle is a select element to clients
Summary: Expose whether WKWebProcessPlugInNodeHandle is a select element to clients
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit API (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-10-04 20:26 PDT by Zach Li
Modified: 2018-10-05 07:57 PDT (History)
7 users (show)

See Also:


Attachments
Patch v1 (14.89 KB, patch)
2018-10-04 21:48 PDT, Zach Li
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zach Li 2018-10-04 20:26:28 PDT
Expose whether WKWebProcessPlugInNodeHandle is a select element to clients
Comment 1 Zach Li 2018-10-04 20:27:00 PDT
rdar://problem/45031469
Comment 2 Zach Li 2018-10-04 21:48:20 PDT
Created attachment 351653 [details]
Patch v1
Comment 3 Tim Horton 2018-10-04 22:35:35 PDT
Comment on attachment 351653 [details]
Patch v1

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

> Tools/TestWebKitAPI/Tests/WebKitCocoa/InjectedBundleNodeHandleIsSelectElement.mm:45
> +    WKDOMElement *htmlElement = [document createElement:htmlElementTag];

I don’t know this API well enough; what’s the ownership story for this object returned from a -create method?
Comment 4 Zach Li 2018-10-04 23:10:10 PDT
(In reply to Tim Horton from comment #3)
> Comment on attachment 351653 [details]
> Patch v1
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=351653&action=review
> 
> > Tools/TestWebKitAPI/Tests/WebKitCocoa/InjectedBundleNodeHandleIsSelectElement.mm:45
> > +    WKDOMElement *htmlElement = [document createElement:htmlElementTag];
> 
> I don’t know this API well enough; what’s the ownership story for this
> object returned from a -create method?

`htmlElement` holds a reference to the object and once the method returns, nothing holds a reference to the object and the object gets deallocated.
Comment 5 Tim Horton 2018-10-05 00:24:10 PDT
Comment on attachment 351653 [details]
Patch v1

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

>>> Tools/TestWebKitAPI/Tests/WebKitCocoa/InjectedBundleNodeHandleIsSelectElement.mm:45
>>> +    WKDOMElement *htmlElement = [document createElement:htmlElementTag];
>> 
>> I don’t know this API well enough; what’s the ownership story for this object returned from a -create method?
> 
> `htmlElement` holds a reference to the object and once the method returns, nothing holds a reference to the object and the object gets deallocated.

No, that's not right, because this project doesn't build with ARC.

However, I think the code is fine, because createElement returns an autoreleased object.
Comment 6 WebKit Commit Bot 2018-10-05 00:50:03 PDT
Comment on attachment 351653 [details]
Patch v1

Clearing flags on attachment: 351653

Committed r236869: <https://trac.webkit.org/changeset/236869>
Comment 7 WebKit Commit Bot 2018-10-05 00:50:05 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Zach Li 2018-10-05 07:57:50 PDT
(In reply to Tim Horton from comment #5)
> Comment on attachment 351653 [details]
> Patch v1
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=351653&action=review
> 
> >>> Tools/TestWebKitAPI/Tests/WebKitCocoa/InjectedBundleNodeHandleIsSelectElement.mm:45
> >>> +    WKDOMElement *htmlElement = [document createElement:htmlElementTag];
> >> 
> >> I don’t know this API well enough; what’s the ownership story for this object returned from a -create method?
> > 
> > `htmlElement` holds a reference to the object and once the method returns, nothing holds a reference to the object and the object gets deallocated.
> 
> No, that's not right, because this project doesn't build with ARC.

Oh, I didn't know that is the case.

Why is that?

> 
> However, I think the code is fine, because createElement returns an
> autoreleased object.