WebKit Bugzilla
Attachment 372288 Details for
Bug 198938
: [lldb-webkit] Show whether frame is focused in Frame and Document summaries
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198938-20190617163052.patch (text/plain), 4.08 KB, created by
Daniel Bates
on 2019-06-17 16:30:52 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2019-06-17 16:30:52 PDT
Size:
4.08 KB
patch
obsolete
>Subversion Revision: 246325 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index b64968e761a1a8bbbcbc3e06e6620d2b1ba65eb0..be95350636057557098a4d47abec779ee3bdcf56 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,26 @@ >+2019-06-17 Daniel Bates <dabates@apple.com> >+ >+ [lldb-webkit] Show whether frame is focused in Frame and Document summaries >+ https://bugs.webkit.org/show_bug.cgi?id=198938 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Knowing what frame is focused and having this info available directly in the >+ Frame and Document summaries can be helpful when tracking down focusing issues. >+ At least I found such info helpful to me. >+ >+ * lldb/lldb_webkit.py: >+ (__lldb_init_module): >+ (WebCoreFrame_SummaryProvider): Print whether the frame is focused. >+ (WebCoreDocument_SummaryProvider): Print whether the document's frame is focused. >+ (StdUniquePtrWrapper): >+ (StdUniquePtrWrapper.__init__): >+ (StdUniquePtrWrapper.has_value): >+ (StdUniquePtrWrapper.value): >+ Helper class to dereference a std::unique_ptr<>. >+ >+ (WebCoreFrameProvider.is_focused): Added. >+ > 2019-06-06 Daniel Bates <dabates@apple.com> > > [lldb-webkit] Pretty-print all kinds of Documents >diff --git a/Tools/lldb/lldb_webkit.py b/Tools/lldb/lldb_webkit.py >index 8a6c9e47e2130d57b42dcb5784fbcc2aa989e4bb..071e7cc741d17a9c665536b4aae7c1ae21a12362 100644 >--- a/Tools/lldb/lldb_webkit.py >+++ b/Tools/lldb/lldb_webkit.py >@@ -244,14 +244,14 @@ def WebCoreFrame_SummaryProvider(valobj, dict): > origin = '' > url = '' > pageCacheState = '' >- return '{ origin = %s, url = %s, isMainFrame = %d, pageCacheState = %s }' % (origin, url, provider.is_main_frame(), pageCacheState) >+ return '{ origin = %s, url = %s, isMainFrame = %d, isFocused = %d, pageCacheState = %s }' % (origin, url, provider.is_main_frame(), provider.is_focused(), pageCacheState) > > > def WebCoreDocument_SummaryProvider(valobj, dict): > provider = WebCoreDocumentProvider(valobj, dict) > frame = provider.frame() > in_main_frame = '%d' % frame.is_main_frame() if frame else 'Detached' >- return '{ origin = %s, url = %s, inMainFrame = %s, pageCacheState = %s }' % (provider.origin(), provider.url(), in_main_frame, provider.page_cache_state()) >+ return '{ origin = %s, url = %s, inMainFrame = %s, isFocused = %d, pageCacheState = %s }' % (provider.origin(), provider.url(), in_main_frame, frame.is_focused(), provider.page_cache_state()) > > > def btjs(debugger, command, result, internal_dict): >@@ -644,6 +644,17 @@ class WTFURLProvider: > return WTFStringProvider(self.valobj.GetChildMemberWithName('m_string'), dict).to_string() > > >+class StdUniquePtrWrapper: >+ def __init__(self, valobj, internal_dict): >+ self.valobj = valobj >+ >+ def has_value(self): >+ return bool(self.value().GetValueAsUnsigned(0)) >+ >+ def value(self): >+ return self.valobj.GetChildMemberWithName('__ptr_').GetChildMemberWithName('__value_') >+ >+ > class StdOptionalWrapper: > def __init__(self, valobj, internal_dict): > self.valobj = valobj >@@ -704,6 +715,15 @@ class WebCoreFrameProvider: > def is_main_frame(self): > return self.valobj.GetAddress().GetFileAddress() == self.valobj.GetChildMemberWithName('m_mainFrame').GetAddress().GetFileAddress() > >+ 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() >+ > def document(self): > document_ptr = self.valobj.GetChildMemberWithName('m_doc').GetChildMemberWithName('m_ptr') > if not document_ptr or not bool(document_ptr.GetValueAsUnsigned(0)):
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198938
:
372288
|
377130