<rdar://problem/47634344>
Created attachment 390421 [details] Speculative fix
Comment on attachment 390421 [details] Speculative fix View in context: https://bugs.webkit.org/attachment.cgi?id=390421&action=review > Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:2988 > + auto focusedElement = m_focusedElement; auto makes it impossible to tell if this retains the element or not. But it needs to, right?
Comment on attachment 390421 [details] Speculative fix View in context: https://bugs.webkit.org/attachment.cgi?id=390421&action=review >> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:2988 >> + auto focusedElement = m_focusedElement; > > auto makes it impossible to tell if this retains the element or not. But it needs to, right? Since m_focusedElement is a RefPtr<Element>, auto will just copy it (and ensure that it is reffed). If you think it's more clear, I can change this to `auto focusedElement = m_focusedElement.copyRef();`
(In reply to Wenson Hsieh from comment #3) > Comment on attachment 390421 [details] > Speculative fix > > View in context: > https://bugs.webkit.org/attachment.cgi?id=390421&action=review > > >> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:2988 > >> + auto focusedElement = m_focusedElement; > > > > auto makes it impossible to tell if this retains the element or not. But it needs to, right? > > Since m_focusedElement is a RefPtr<Element>, auto will just copy it (and > ensure that it is reffed). Right, but it's impossible to read the code above and tell that it is correct without referring to another file :D
(In reply to Tim Horton from comment #4) > (In reply to Wenson Hsieh from comment #3) > > Comment on attachment 390421 [details] > > Speculative fix > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=390421&action=review > > > > >> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:2988 > > >> + auto focusedElement = m_focusedElement; > > > > > > auto makes it impossible to tell if this retains the element or not. But it needs to, right? > > > > Since m_focusedElement is a RefPtr<Element>, auto will just copy it (and > > ensure that it is reffed). > > Right, but it's impossible to read the code above and tell that it is > correct without referring to another file :D Please do call copyRef().
Created attachment 390456 [details] Patch for landing
Changed to call copyRef() explicitly. Thanks for the review!
Comment on attachment 390456 [details] Patch for landing Clearing flags on attachment: 390456 Committed r256401: <https://trac.webkit.org/changeset/256401>