Bug 190302

Summary: Expose whether WKWebProcessPlugInNodeHandle is a select element to clients
Product: WebKit Reporter: Zach Li <a.tion.surf>
Component: WebKit APIAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: a.tion.surf, bdakin, commit-queue, mitz, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch v1 none

Zach Li
Reported 2018-10-04 20:26:28 PDT
Expose whether WKWebProcessPlugInNodeHandle is a select element to clients
Attachments
Patch v1 (14.89 KB, patch)
2018-10-04 21:48 PDT, Zach Li
no flags
Zach Li
Comment 1 2018-10-04 20:27:00 PDT
Zach Li
Comment 2 2018-10-04 21:48:20 PDT
Created attachment 351653 [details] Patch v1
Tim Horton
Comment 3 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?
Zach Li
Comment 4 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.
Tim Horton
Comment 5 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.
WebKit Commit Bot
Comment 6 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>
WebKit Commit Bot
Comment 7 2018-10-05 00:50:05 PDT
All reviewed patches have been landed. Closing bug.
Zach Li
Comment 8 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.
Note You need to log in before you can comment on or make changes to this bug.