Bug 1781034 - Remove layout debugger's visual debugging. r=layout-reviewers,dshin
Differential Revision: https://phabricator.services.mozilla.com/D152628
This commit is contained in:
@@ -303,21 +303,6 @@ std::ostream& operator<<(std::ostream& aStream, const nsReflowStatus& aStatus) {
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
static bool gShowFrameBorders = false;
|
||||
|
||||
void nsIFrame::ShowFrameBorders(bool aEnable) { gShowFrameBorders = aEnable; }
|
||||
|
||||
bool nsIFrame::GetShowFrameBorders() { return gShowFrameBorders; }
|
||||
|
||||
static bool gShowEventTargetFrameBorder = false;
|
||||
|
||||
void nsIFrame::ShowEventTargetFrameBorder(bool aEnable) {
|
||||
gShowEventTargetFrameBorder = aEnable;
|
||||
}
|
||||
|
||||
bool nsIFrame::GetShowEventTargetFrameBorder() {
|
||||
return gShowEventTargetFrameBorder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: the log module is created during library initialization which
|
||||
@@ -2762,45 +2747,6 @@ nsSize nsIFrame::OverflowClipMargin(PhysicalAxes aClipAxes) const {
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
static void PaintDebugBorder(nsIFrame* aFrame, DrawTarget* aDrawTarget,
|
||||
const nsRect& aDirtyRect, nsPoint aPt) {
|
||||
nsRect r(aPt, aFrame->GetSize());
|
||||
int32_t appUnitsPerDevPixel = aFrame->PresContext()->AppUnitsPerDevPixel();
|
||||
sRGBColor blueOrRed(aFrame->HasView() ? sRGBColor(0.f, 0.f, 1.f, 1.f)
|
||||
: sRGBColor(1.f, 0.f, 0.f, 1.f));
|
||||
aDrawTarget->StrokeRect(NSRectToRect(r, appUnitsPerDevPixel),
|
||||
ColorPattern(ToDeviceColor(blueOrRed)));
|
||||
}
|
||||
|
||||
static void PaintEventTargetBorder(nsIFrame* aFrame, DrawTarget* aDrawTarget,
|
||||
const nsRect& aDirtyRect, nsPoint aPt) {
|
||||
nsRect r(aPt, aFrame->GetSize());
|
||||
int32_t appUnitsPerDevPixel = aFrame->PresContext()->AppUnitsPerDevPixel();
|
||||
ColorPattern purple(ToDeviceColor(sRGBColor(.5f, 0.f, .5f, 1.f)));
|
||||
aDrawTarget->StrokeRect(NSRectToRect(r, appUnitsPerDevPixel), purple);
|
||||
}
|
||||
|
||||
static void DisplayDebugBorders(nsDisplayListBuilder* aBuilder,
|
||||
nsIFrame* aFrame,
|
||||
const nsDisplayListSet& aLists) {
|
||||
// Draw a border around the child
|
||||
// REVIEW: From nsContainerFrame::PaintChild
|
||||
if (nsIFrame::GetShowFrameBorders() && !aFrame->GetRect().IsEmpty()) {
|
||||
aLists.Outlines()->AppendNewToTop<nsDisplayGeneric>(
|
||||
aBuilder, aFrame, PaintDebugBorder, "DebugBorder",
|
||||
DisplayItemType::TYPE_DEBUG_BORDER);
|
||||
}
|
||||
// Draw a border around the current event target
|
||||
if (nsIFrame::GetShowEventTargetFrameBorder() &&
|
||||
aFrame->PresShell()->GetDrawEventTargetFrame() == aFrame) {
|
||||
aLists.Outlines()->AppendNewToTop<nsDisplayGeneric>(
|
||||
aBuilder, aFrame, PaintEventTargetBorder, "EventTargetBorder",
|
||||
DisplayItemType::TYPE_EVENT_TARGET_BORDER);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Returns whether a display item that gets created with the builder's current
|
||||
* state will have a scrolled clip, i.e. a clip that is scrolled by a scroll
|
||||
@@ -3494,10 +3440,6 @@ void nsIFrame::BuildDisplayListForStackingContext(
|
||||
nsDisplayList resultList(aBuilder);
|
||||
set.SerializeWithCorrectZOrder(&resultList, content);
|
||||
|
||||
#ifdef DEBUG
|
||||
DisplayDebugBorders(aBuilder, this, set);
|
||||
#endif
|
||||
|
||||
// Get the ASR to use for the container items that we create here.
|
||||
const ActiveScrolledRoot* containerItemASR = contASRTracker.GetContainerASR();
|
||||
|
||||
@@ -3997,9 +3939,6 @@ void nsIFrame::BuildDisplayListForSimpleChild(nsDisplayListBuilder* aBuilder,
|
||||
aChild->SetBuiltDisplayList(true);
|
||||
aBuilder->Check();
|
||||
aBuilder->DisplayCaret(aChild, aLists.Outlines());
|
||||
#ifdef DEBUG
|
||||
DisplayDebugBorders(aBuilder, aChild, aLists);
|
||||
#endif
|
||||
}
|
||||
|
||||
nsIFrame::DisplayChildFlag nsIFrame::DisplayFlagForFlexOrGridItem() const {
|
||||
@@ -4322,9 +4261,6 @@ void nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
|
||||
child->BuildDisplayList(aBuilder, aLists);
|
||||
aBuilder->Check();
|
||||
aBuilder->DisplayCaret(child, aLists.Outlines());
|
||||
#ifdef DEBUG
|
||||
DisplayDebugBorders(aBuilder, child, aLists);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4350,9 +4286,6 @@ void nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
|
||||
list.AppendToTop(pseudoStack.Content());
|
||||
list.AppendToTop(pseudoStack.Outlines());
|
||||
extraPositionedDescendants.AppendToTop(pseudoStack.PositionedDescendants());
|
||||
#ifdef DEBUG
|
||||
DisplayDebugBorders(aBuilder, child, aLists);
|
||||
#endif
|
||||
}
|
||||
|
||||
buildingForChild.RestoreBuildingInvisibleItemsValue();
|
||||
|
||||
Reference in New Issue
Block a user