forked from mirrors/gecko-dev
Bug 1600542 - Remove a few other no longer reachable XUL box special-cases. r=TYLin
The only XUL frames that remain are either scrollbars, or leafs. These are uses that I'm pretty sure are no longer needed. There are a few others that will go in the future. Depends on D172874 Differential Revision: https://phabricator.services.mozilla.com/D172875
This commit is contained in:
parent
c869e31d5e
commit
5dfcee19a5
3 changed files with 18 additions and 64 deletions
|
|
@ -11513,28 +11513,18 @@ PresShell::WindowSizeConstraints PresShell::GetWindowSizeConstraints() {
|
|||
if (!rootFrame || !mPresContext) {
|
||||
return {minSize, maxSize};
|
||||
}
|
||||
if (rootFrame->IsXULBoxFrame()) {
|
||||
UniquePtr<gfxContext> rcx(CreateReferenceRenderingContext());
|
||||
if (!rcx) {
|
||||
return {minSize, maxSize};
|
||||
}
|
||||
nsBoxLayoutState state(mPresContext, rcx.get());
|
||||
minSize = rootFrame->GetXULMinSize(state);
|
||||
maxSize = rootFrame->GetXULMaxSize(state);
|
||||
} else {
|
||||
const auto* pos = rootFrame->StylePosition();
|
||||
if (pos->mMinWidth.ConvertsToLength()) {
|
||||
minSize.width = pos->mMinWidth.ToLength();
|
||||
}
|
||||
if (pos->mMinHeight.ConvertsToLength()) {
|
||||
minSize.height = pos->mMinHeight.ToLength();
|
||||
}
|
||||
if (pos->mMaxWidth.ConvertsToLength()) {
|
||||
maxSize.width = pos->mMaxWidth.ToLength();
|
||||
}
|
||||
if (pos->mMaxHeight.ConvertsToLength()) {
|
||||
maxSize.height = pos->mMaxHeight.ToLength();
|
||||
}
|
||||
const auto* pos = rootFrame->StylePosition();
|
||||
if (pos->mMinWidth.ConvertsToLength()) {
|
||||
minSize.width = pos->mMinWidth.ToLength();
|
||||
}
|
||||
if (pos->mMinHeight.ConvertsToLength()) {
|
||||
minSize.height = pos->mMinHeight.ToLength();
|
||||
}
|
||||
if (pos->mMaxWidth.ConvertsToLength()) {
|
||||
maxSize.width = pos->mMaxWidth.ToLength();
|
||||
}
|
||||
if (pos->mMaxHeight.ConvertsToLength()) {
|
||||
maxSize.height = pos->mMaxHeight.ToLength();
|
||||
}
|
||||
return {minSize, maxSize};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -965,15 +965,6 @@ static bool RecomputePosition(nsIFrame* aFrame) {
|
|||
return false;
|
||||
}
|
||||
|
||||
static bool HasBoxAncestor(nsIFrame* aFrame) {
|
||||
for (nsIFrame* f = aFrame; f; f = f->GetParent()) {
|
||||
if (f->IsXULBoxFrame()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if aFrame's subtree has placeholders for out-of-flow content
|
||||
* that would be affected due to the change to
|
||||
|
|
@ -1285,11 +1276,6 @@ static void StyleChangeReflow(nsIFrame* aFrame, nsChangeHint aHint) {
|
|||
dirtyType = IntrinsicDirty::FrameAncestorsAndDescendants;
|
||||
} else if (aHint & nsChangeHint_ClearAncestorIntrinsics) {
|
||||
dirtyType = IntrinsicDirty::FrameAndAncestors;
|
||||
} else if ((aHint & nsChangeHint_UpdateComputedBSize) &&
|
||||
HasBoxAncestor(aFrame)) {
|
||||
// The frame's computed BSize is changing, and we have a box ancestor
|
||||
// whose cached intrinsic height may need to be updated.
|
||||
dirtyType = IntrinsicDirty::FrameAndAncestors;
|
||||
} else {
|
||||
dirtyType = IntrinsicDirty::None;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -603,23 +603,6 @@ void BasicTableLayoutStrategy::DistributePctISizeToColumns(float aSpanPrefPct,
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
// Bypass some assertions for tables inside XUL which we're realistically not
|
||||
// going to investigate unless they cause havoc. Thunderbird hits these very
|
||||
// often.
|
||||
static bool IsCloseToXULBox(nsTableFrame* aTableFrame) {
|
||||
// NOTE: GetParent() is guaranteed to be the table wrapper (thus non-null).
|
||||
nsIFrame* f = aTableFrame->GetParent()->GetParent();
|
||||
for (size_t i = 0; f && i < 2; ++i) {
|
||||
if (f->IsXULBoxFrame()) {
|
||||
return true;
|
||||
}
|
||||
f = f->GetParent();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
void BasicTableLayoutStrategy::DistributeISizeToColumns(
|
||||
nscoord aISize, int32_t aFirstCol, int32_t aColCount,
|
||||
BtlsISizeType aISizeType, bool aSpanHasSpecifiedISize) {
|
||||
|
|
@ -776,8 +759,7 @@ void BasicTableLayoutStrategy::DistributeISizeToColumns(
|
|||
// Return early -- we don't have any extra space to distribute.
|
||||
return;
|
||||
}
|
||||
NS_ASSERTION(!(aISizeType == BTLS_FINAL_ISIZE && aISize < guess_min) ||
|
||||
IsCloseToXULBox(mTableFrame),
|
||||
NS_ASSERTION(!(aISizeType == BTLS_FINAL_ISIZE && aISize < guess_min),
|
||||
"Table inline-size is less than the "
|
||||
"sum of its columns' min inline-sizes");
|
||||
if (aISize < guess_min_pct) {
|
||||
|
|
@ -1007,13 +989,9 @@ void BasicTableLayoutStrategy::DistributeISizeToColumns(
|
|||
} break;
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG
|
||||
if (!IsCloseToXULBox(mTableFrame)) {
|
||||
NS_ASSERTION((space == 0 || space == nscoord_MAX) &&
|
||||
((l2t == FLEX_PCT_LARGE)
|
||||
? (-0.001f < basis.f && basis.f < 0.001f)
|
||||
: (basis.c == 0 || basis.c == nscoord_MAX)),
|
||||
"didn't subtract all that we added");
|
||||
}
|
||||
#endif
|
||||
NS_ASSERTION(
|
||||
(space == 0 || space == nscoord_MAX) &&
|
||||
((l2t == FLEX_PCT_LARGE) ? (-0.001f < basis.f && basis.f < 0.001f)
|
||||
: (basis.c == 0 || basis.c == nscoord_MAX)),
|
||||
"didn't subtract all that we added");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue