diff --git a/.gdbinit b/.gdbinit index 56bdc4dcd765..8d0a71fd3184 100644 --- a/.gdbinit +++ b/.gdbinit @@ -187,8 +187,16 @@ define ft call $arg0->DumpFrameTree() end +define ftp + call $arg0->DumpFrameTreeInCSSPixels() +end + define ftl call $arg0->DumpFrameTreeLimited() end +define ftlp + call $arg0->DumpFrameTreeLimitedInCSSPixels() +end + source .gdbinit_python diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 63dfab70acfc..c982ac7f0d3e 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -8243,7 +8243,14 @@ void nsIFrame::DumpFrameTree() const { PresShell()->GetRootFrame()->List(stderr); } +void nsIFrame::DumpFrameTreeInCSSPixels() const { + PresShell()->GetRootFrame()->List(stderr, "", ListFlag::DisplayInCSSPixels); +} + void nsIFrame::DumpFrameTreeLimited() const { List(stderr); } +void nsIFrame::DumpFrameTreeLimitedInCSSPixels() const { + List(stderr, "", ListFlag::DisplayInCSSPixels); +} #endif diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index 3831cf37bb01..06d27e826750 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -4762,11 +4762,13 @@ class nsIFrame : public nsQueryFrame { * Dump the frame tree beginning from the root frame. */ void DumpFrameTree() const; + void DumpFrameTreeInCSSPixels() const; /** * Dump the frame tree beginning from ourselves. */ void DumpFrameTreeLimited() const; + void DumpFrameTreeLimitedInCSSPixels() const; virtual nsresult GetFrameName(nsAString& aResult) const = 0; #endif diff --git a/python/lldbutils/lldbutils/layout.py b/python/lldbutils/lldbutils/layout.py index 9a12199bec21..0f2b3a96a461 100644 --- a/python/lldbutils/lldbutils/layout.py +++ b/python/lldbutils/lldbutils/layout.py @@ -9,11 +9,22 @@ def frametree(debugger, command, result, dict): debugger.HandleCommand('expr (' + command + ')->DumpFrameTree()') +def frametree_pixels(debugger, command, result, dict): + """Dumps the frame tree containing the given nsIFrame* in CSS pixels.""" + debugger.HandleCommand('expr (' + command + ')->DumpFrameTreeInCSSPixels()') + + def frametreelimited(debugger, command, result, dict): """Dumps the subtree of a frame tree rooted at the given nsIFrame*.""" debugger.HandleCommand('expr (' + command + ')->DumpFrameTreeLimited()') +def frametreelimited_pixels(debugger, command, result, dict): + """Dumps the subtree of a frame tree rooted at the given nsIFrame* + in CSS pixels.""" + debugger.HandleCommand('expr (' + command + ')->DumpFrameTreeLimitedInCSSPixels()') + + def pstate(debugger, command, result, dict): """Displays a frame's state bits symbolically.""" debugger.HandleCommand('expr mozilla::PrintFrameState(' + command + ')') @@ -21,9 +32,16 @@ def pstate(debugger, command, result, dict): def init(debugger): debugger.HandleCommand('command script add -f lldbutils.layout.frametree frametree') + debugger.HandleCommand( + 'command script add -f lldbutils.layout.frametree_pixels frametree_pixels') debugger.HandleCommand( "command script add -f lldbutils.layout.frametreelimited frametreelimited" ) + debugger.HandleCommand( + "command script add -f lldbutils.layout.frametreelimited_pixels frametreelimited_pixels" + ) debugger.HandleCommand('command alias ft frametree') + debugger.HandleCommand('command alias ftp frametree_pixels') debugger.HandleCommand('command alias ftl frametreelimited') + debugger.HandleCommand('command alias ftlp frametreelimited_pixels') debugger.HandleCommand('command script add -f lldbutils.layout.pstate pstate')