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.
Created attachment 372288 [details] Patch
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?
(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.
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.