Bug 1959646 - Add zero-parameter overloads for dumping frame trees. r=layout-reviewers,emilio

This patch adds zero-parameter overloads for `DumpFrameTree()` and
`DumpFrameTreeInCSSPixels()`, making it easier to call these functions in the
debugger without having to pass `false` as an argument.

Additionally, this patch reverts bug 1959538 since that change [1] is no longer
needed with these new overloads.

[1]https://hg.mozilla.org/mozilla-central/rev/7371d5813735

Differential Revision: https://phabricator.services.mozilla.com/D245155
This commit is contained in:
Ting-Yu Lin
2025-04-11 00:25:58 +00:00
parent a99efe3c47
commit d8e1c44122
4 changed files with 14 additions and 6 deletions

View File

@@ -192,11 +192,11 @@ define ct
end
define ft
call $arg0->DumpFrameTree(false)
call $arg0->DumpFrameTree()
end
define ftp
call $arg0->DumpFrameTreeInCSSPixels(false)
call $arg0->DumpFrameTreeInCSSPixels()
end
define ftl

View File

@@ -8954,6 +8954,8 @@ nsresult nsIFrame::MakeFrameName(const nsAString& aType,
return NS_OK;
}
void nsIFrame::DumpFrameTree() const { DumpFrameTree(false); }
void nsIFrame::DumpFrameTree(bool aListOnlyDeterministic) const {
ListFlags flags;
if (aListOnlyDeterministic) {
@@ -8962,6 +8964,10 @@ void nsIFrame::DumpFrameTree(bool aListOnlyDeterministic) const {
PresShell()->GetRootFrame()->List(stderr, "", flags);
}
void nsIFrame::DumpFrameTreeInCSSPixels() const {
DumpFrameTreeInCSSPixels(false);
}
void nsIFrame::DumpFrameTreeInCSSPixels(bool aListOnlyDeterministic) const {
ListFlags flags{ListFlag::DisplayInCSSPixels};
if (aListOnlyDeterministic) {

View File

@@ -5636,8 +5636,10 @@ class nsIFrame : public nsQueryFrame {
/**
* Dump the frame tree beginning from the root frame.
*/
void DumpFrameTree(bool aListOnlyDeterministic = false) const;
void DumpFrameTreeInCSSPixels(bool aListOnlyDeterministic = false) const;
void DumpFrameTree() const;
void DumpFrameTree(bool aListOnlyDeterministic) const;
void DumpFrameTreeInCSSPixels() const;
void DumpFrameTreeInCSSPixels(bool aListOnlyDeterministic) const;
/**
* Dump the frame tree beginning from ourselves.

View File

@@ -4,12 +4,12 @@
def frametree(debugger, command, result, dict):
"""Dumps the frame tree containing the given nsIFrame*."""
debugger.HandleCommand("expr (" + command + ")->DumpFrameTree(false)")
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(false)")
debugger.HandleCommand("expr (" + command + ")->DumpFrameTreeInCSSPixels()")
def frametreelimited(debugger, command, result, dict):