From 7875c9ce3d893a52cd8bb24deff61afeece76e2a Mon Sep 17 00:00:00 2001 From: "bernd.mielke%snafu.de" Date: Fri, 7 Dec 2001 10:02:31 +0000 Subject: [PATCH] add hr frame to layout debugging logic, bug 110596 r=karnaze sr=attinasi git-svn-id: svn://10.0.0.236/trunk@109992 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsFrame.cpp | 25 ++++++++++++++++++++++-- mozilla/layout/html/base/src/nsFrame.cpp | 25 ++++++++++++++++++++++-- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index 152bb2468cd..db3c1a3f484 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -4568,6 +4568,7 @@ void DR_State::InitFrameTypeTable() AddFrameTypeInfo(nsLayoutAtoms::brFrame, "br", "br"); AddFrameTypeInfo(nsLayoutAtoms::bulletFrame, "bullet", "bullet"); AddFrameTypeInfo(nsLayoutAtoms::gfxButtonControlFrame, "button", "gfxButtonControl"); + AddFrameTypeInfo(nsLayoutAtoms::hrFrame, "hr", "hr"); AddFrameTypeInfo(nsLayoutAtoms::htmlFrameInnerFrame, "frameI", "htmlFrameInner"); AddFrameTypeInfo(nsLayoutAtoms::htmlFrameOuterFrame, "frameO", "htmlFrameOuter"); AddFrameTypeInfo(nsLayoutAtoms::imageFrame, "img", "image"); @@ -4608,7 +4609,20 @@ void DR_State::DisplayFrameTypeInfo(nsIFrame* aFrame, for (PRInt32 i = 0; i < aIndent; i++) { printf(" "); } - printf("%s %p ", frameTypeInfo->mNameAbbrev, aFrame); + if(!strcmp(frameTypeInfo->mNameAbbrev,"unknown")) { + nsAutoString name; + nsIFrameDebug* frameDebug; + if (NS_SUCCEEDED(aFrame->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**)&frameDebug))) { + frameDebug->GetFrameName(name); + printf("%s %p ", NS_LossyConvertUCS2toASCII(name).get(), aFrame); + } + else { + printf("%s %p ", frameTypeInfo->mNameAbbrev, aFrame); + } + } + else { + printf("%s %p ", frameTypeInfo->mNameAbbrev, aFrame); + } } } @@ -4710,7 +4724,13 @@ void DR_State::PrettyUC(nscoord aSize, strcpy(aBuf, "UC"); } else { - sprintf(aBuf, "%d", aSize); + if(0xdeadbeef == aSize) + { + strcpy(aBuf, "deadbeef"); + } + else { + sprintf(aBuf, "%d", aSize); + } } } @@ -4745,6 +4765,7 @@ static void DisplayReflowEnterPrint(nsIPresContext* aPresContext, if (aTreeNode.mDisplay) { DR_state.DisplayFrameTypeInfo(aFrame, aTreeNode.mIndent); + char width[16]; char height[16]; DR_state.PrettyUC(aReflowState.availableWidth, width); diff --git a/mozilla/layout/html/base/src/nsFrame.cpp b/mozilla/layout/html/base/src/nsFrame.cpp index 152bb2468cd..db3c1a3f484 100644 --- a/mozilla/layout/html/base/src/nsFrame.cpp +++ b/mozilla/layout/html/base/src/nsFrame.cpp @@ -4568,6 +4568,7 @@ void DR_State::InitFrameTypeTable() AddFrameTypeInfo(nsLayoutAtoms::brFrame, "br", "br"); AddFrameTypeInfo(nsLayoutAtoms::bulletFrame, "bullet", "bullet"); AddFrameTypeInfo(nsLayoutAtoms::gfxButtonControlFrame, "button", "gfxButtonControl"); + AddFrameTypeInfo(nsLayoutAtoms::hrFrame, "hr", "hr"); AddFrameTypeInfo(nsLayoutAtoms::htmlFrameInnerFrame, "frameI", "htmlFrameInner"); AddFrameTypeInfo(nsLayoutAtoms::htmlFrameOuterFrame, "frameO", "htmlFrameOuter"); AddFrameTypeInfo(nsLayoutAtoms::imageFrame, "img", "image"); @@ -4608,7 +4609,20 @@ void DR_State::DisplayFrameTypeInfo(nsIFrame* aFrame, for (PRInt32 i = 0; i < aIndent; i++) { printf(" "); } - printf("%s %p ", frameTypeInfo->mNameAbbrev, aFrame); + if(!strcmp(frameTypeInfo->mNameAbbrev,"unknown")) { + nsAutoString name; + nsIFrameDebug* frameDebug; + if (NS_SUCCEEDED(aFrame->QueryInterface(NS_GET_IID(nsIFrameDebug), (void**)&frameDebug))) { + frameDebug->GetFrameName(name); + printf("%s %p ", NS_LossyConvertUCS2toASCII(name).get(), aFrame); + } + else { + printf("%s %p ", frameTypeInfo->mNameAbbrev, aFrame); + } + } + else { + printf("%s %p ", frameTypeInfo->mNameAbbrev, aFrame); + } } } @@ -4710,7 +4724,13 @@ void DR_State::PrettyUC(nscoord aSize, strcpy(aBuf, "UC"); } else { - sprintf(aBuf, "%d", aSize); + if(0xdeadbeef == aSize) + { + strcpy(aBuf, "deadbeef"); + } + else { + sprintf(aBuf, "%d", aSize); + } } } @@ -4745,6 +4765,7 @@ static void DisplayReflowEnterPrint(nsIPresContext* aPresContext, if (aTreeNode.mDisplay) { DR_state.DisplayFrameTypeInfo(aFrame, aTreeNode.mIndent); + char width[16]; char height[16]; DR_state.PrettyUC(aReflowState.availableWidth, width);