Bug 198938

Summary: [lldb-webkit] Show whether frame is focused in Frame and Document summaries
Product: WebKit Reporter: Daniel Bates <dbates>
Component: Tools / TestsAssignee: Daniel Bates <dbates>
Status: ASSIGNED    
Severity: Normal CC: simon.fraser, wenson_hsieh
Priority: P2    
Version: WebKit Local Build   
Hardware: iPhone / iPad   
OS: iOS 12   
Attachments:
Description Flags
Patch
none
Patch none

Daniel Bates
Reported 2019-06-17 16:26:41 PDT
I found it useful to know whether a Frame is focused or not when investigating bug #198922. Add this info to the Frame and Document summaries.
Attachments
Patch (4.08 KB, patch)
2019-06-17 16:30 PDT, Daniel Bates
no flags
Patch (4.24 KB, patch)
2019-08-23 09:51 PDT, Daniel Bates
no flags
Daniel Bates
Comment 1 2019-06-17 16:30:52 PDT
Simon Fraser (smfr)
Comment 2 2019-06-17 16:37:14 PDT
Comment on attachment 372288 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=372288&action=review > Tools/lldb/lldb_webkit.py:725 > + def is_focused(self): > + page_ptr = self.valobj.GetChildMemberWithName('m_page') > + if not page_ptr or not bool(page_ptr.GetValueAsUnsigned(0)): > + return False > + # Every page has a FocusController. > + focus_controller_ptr = StdUniquePtrWrapper(page_ptr.GetChildMemberWithName('m_focusController'), dict()) > + focused_frame_ptr = focus_controller_ptr.value().GetChildMemberWithName('m_focusedFrame').GetChildMemberWithName('m_ptr') > + return focused_frame_ptr.GetValueAsUnsigned(0) == self.valobj.GetAddress().GetFileAddress() This seems very prone to breakage, for example if someone renamed m_focusedFrame. Can we instead add String Document::debugDescription() const, and call it from here?
Daniel Bates
Comment 3 2019-06-17 16:42:56 PDT
(In reply to Simon Fraser (smfr) from comment #2) > Comment on attachment 372288 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=372288&action=review > > > Tools/lldb/lldb_webkit.py:725 > > + def is_focused(self): > > + page_ptr = self.valobj.GetChildMemberWithName('m_page') > > + if not page_ptr or not bool(page_ptr.GetValueAsUnsigned(0)): > > + return False > > + # Every page has a FocusController. > > + focus_controller_ptr = StdUniquePtrWrapper(page_ptr.GetChildMemberWithName('m_focusController'), dict()) > > + focused_frame_ptr = focus_controller_ptr.value().GetChildMemberWithName('m_focusedFrame').GetChildMemberWithName('m_ptr') > > + return focused_frame_ptr.GetValueAsUnsigned(0) == self.valobj.GetAddress().GetFileAddress() > > This seems very prone to breakage, for example if someone renamed > m_focusedFrame. Can we instead add String Document::debugDescription() > const, and call it from here? With time... I can do anything you want 😀 I don't have such a luxury at the moment. R- the patch if this is a deal breaker and cannot be addressed at another junction.
Daniel Bates
Comment 4 2019-08-23 09:51:38 PDT
Created attachment 377130 [details] Patch I haven't had a chance to address Simon's remarks. Just posted an updated patch that I use locally for archiving.
Note You need to log in before you can comment on or make changes to this bug.