Bug 1309119 part 3: Change nsCSSFrameConstructor to use nsFlexContainerFrame::IsLegacyBox instead of its own less-complete version. r=mats

MozReview-Commit-ID: 5sElULdTkOT
This commit is contained in:
Daniel Holbert 2016-10-20 13:23:51 -07:00
Родитель b70af4f32a
Коммит 0b7b1fc98b
1 изменённых файлов: 4 добавлений и 12 удалений

Просмотреть файл

@ -340,15 +340,6 @@ IsFlexOrGridContainer(const nsIFrame* aFrame)
t == nsGkAtoms::gridContainerFrame;
}
// Returns true if aFrame has "display: -webkit-{inline-}box"
static inline bool
IsWebkitBox(const nsIFrame* aFrame)
{
auto containerDisplay = aFrame->StyleDisplay()->mDisplay;
return containerDisplay == StyleDisplay::WebkitBox ||
containerDisplay == StyleDisplay::WebkitInlineBox;
}
#if DEBUG
static void
AssertAnonymousFlexOrGridItemParent(const nsIFrame* aChild,
@ -9876,7 +9867,7 @@ nsCSSFrameConstructor::CreateNeededAnonFlexOrGridItems(
}
nsIAtom* containerType = aParentFrame->GetType();
const bool isWebkitBox = IsWebkitBox(aParentFrame);
const bool isWebkitBox = nsFlexContainerFrame::IsLegacyBox(aParentFrame);
FCItemIterator iter(aItems);
do {
@ -12182,7 +12173,7 @@ nsCSSFrameConstructor::WipeContainingBlock(nsFrameConstructorState& aState,
// Check if we're adding to-be-wrapped content right *after* an existing
// anonymous flex or grid item (which would need to absorb this content).
nsIAtom* containerType = aFrame->GetType();
bool isWebkitBox = IsWebkitBox(aFrame);
const bool isWebkitBox = nsFlexContainerFrame::IsLegacyBox(aFrame);
if (aPrevSibling && IsAnonymousFlexOrGridItem(aPrevSibling) &&
iter.item().NeedsAnonFlexOrGridItem(aState, containerType,
isWebkitBox)) {
@ -12224,9 +12215,10 @@ nsCSSFrameConstructor::WipeContainingBlock(nsFrameConstructorState& aState,
// Skip over things that _do_ need an anonymous flex item, because
// they're perfectly happy to go here -- they won't cause a reframe.
nsIFrame* containerFrame = aFrame->GetParent();
const bool isWebkitBox = nsFlexContainerFrame::IsLegacyBox(containerFrame);
if (!iter.SkipItemsThatNeedAnonFlexOrGridItem(aState,
containerFrame->GetType(),
IsWebkitBox(containerFrame))) {
isWebkitBox)) {
// We hit something that _doesn't_ need an anonymous flex item!
// Rebuild the flex container to bust it out.
RecreateFramesForContent(containerFrame->GetContent(), true,