mirror of
https://github.com/classilla/tenfourfox.git
synced 2024-07-06 19:29:27 +00:00
#506: M984869 M1308793 M1316649
This commit is contained in:
parent
904f503b34
commit
0cfeee90dc
@ -3423,7 +3423,8 @@ nsCSSFrameConstructor::FindHTMLData(Element* aElement,
|
|||||||
SIMPLE_TAG_CREATE(frameset, NS_NewHTMLFramesetFrame),
|
SIMPLE_TAG_CREATE(frameset, NS_NewHTMLFramesetFrame),
|
||||||
SIMPLE_TAG_CREATE(iframe, NS_NewSubDocumentFrame),
|
SIMPLE_TAG_CREATE(iframe, NS_NewSubDocumentFrame),
|
||||||
{ &nsGkAtoms::button,
|
{ &nsGkAtoms::button,
|
||||||
FCDATA_WITH_WRAPPING_BLOCK(FCDATA_ALLOW_BLOCK_STYLES,
|
FCDATA_WITH_WRAPPING_BLOCK(FCDATA_ALLOW_BLOCK_STYLES |
|
||||||
|
FCDATA_ALLOW_GRID_FLEX_COLUMNSET,
|
||||||
NS_NewHTMLButtonControlFrame,
|
NS_NewHTMLButtonControlFrame,
|
||||||
nsCSSAnonBoxes::buttonContent) },
|
nsCSSAnonBoxes::buttonContent) },
|
||||||
SIMPLE_TAG_CHAIN(canvas, nsCSSFrameConstructor::FindCanvasData),
|
SIMPLE_TAG_CHAIN(canvas, nsCSSFrameConstructor::FindCanvasData),
|
||||||
@ -3710,34 +3711,74 @@ nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aIt
|
|||||||
nsIFrame* maybeAbsoluteContainingBlock = newFrame;
|
nsIFrame* maybeAbsoluteContainingBlock = newFrame;
|
||||||
nsIFrame* possiblyLeafFrame = newFrame;
|
nsIFrame* possiblyLeafFrame = newFrame;
|
||||||
if (bits & FCDATA_CREATE_BLOCK_WRAPPER_FOR_ALL_KIDS) {
|
if (bits & FCDATA_CREATE_BLOCK_WRAPPER_FOR_ALL_KIDS) {
|
||||||
RefPtr<nsStyleContext> blockContext;
|
RefPtr<nsStyleContext> outerSC =
|
||||||
blockContext =
|
|
||||||
mPresShell->StyleSet()->ResolveAnonymousBoxStyle(*data->mAnonBoxPseudo,
|
mPresShell->StyleSet()->ResolveAnonymousBoxStyle(*data->mAnonBoxPseudo,
|
||||||
styleContext);
|
styleContext);
|
||||||
nsIFrame* blockFrame =
|
|
||||||
NS_NewBlockFormattingContext(mPresShell, blockContext);
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
nsContainerFrame* containerFrame = do_QueryFrame(newFrame);
|
nsContainerFrame* containerFrame = do_QueryFrame(newFrame);
|
||||||
MOZ_ASSERT(containerFrame);
|
MOZ_ASSERT(containerFrame);
|
||||||
#endif
|
#endif
|
||||||
nsContainerFrame* container = static_cast<nsContainerFrame*>(newFrame);
|
nsContainerFrame* container = static_cast<nsContainerFrame*>(newFrame);
|
||||||
InitAndRestoreFrame(aState, content, container, blockFrame);
|
nsContainerFrame* outerFrame;
|
||||||
|
nsContainerFrame* innerFrame;
|
||||||
SetInitialSingleChild(container, blockFrame);
|
if (bits & FCDATA_ALLOW_GRID_FLEX_COLUMNSET) {
|
||||||
|
switch (display->mDisplay) {
|
||||||
// Now figure out whether newFrame or blockFrame should be the
|
case NS_STYLE_DISPLAY_FLEX:
|
||||||
// absolute container. It should be the latter if it's
|
case NS_STYLE_DISPLAY_INLINE_FLEX:
|
||||||
// positioned, otherwise the former.
|
outerFrame = NS_NewFlexContainerFrame(mPresShell, outerSC);
|
||||||
const nsStyleDisplay* blockDisplay = blockContext->StyleDisplay();
|
InitAndRestoreFrame(aState, content, container, outerFrame);
|
||||||
if (blockDisplay->IsAbsPosContainingBlock(blockFrame)) {
|
innerFrame = outerFrame;
|
||||||
maybeAbsoluteContainingBlockDisplay = blockDisplay;
|
break;
|
||||||
maybeAbsoluteContainingBlock = blockFrame;
|
case NS_STYLE_DISPLAY_GRID:
|
||||||
maybeAbsoluteContainingBlockStyleFrame = blockFrame;
|
case NS_STYLE_DISPLAY_INLINE_GRID:
|
||||||
|
outerFrame = NS_NewGridContainerFrame(mPresShell, outerSC);
|
||||||
|
InitAndRestoreFrame(aState, content, container, outerFrame);
|
||||||
|
innerFrame = outerFrame;
|
||||||
|
break;
|
||||||
|
default: {
|
||||||
|
nsContainerFrame* columnSetFrame = nullptr;
|
||||||
|
RefPtr<nsStyleContext> innerSC = outerSC;
|
||||||
|
const nsStyleColumn* columns = outerSC->StyleColumn();
|
||||||
|
if (columns->mColumnCount != NS_STYLE_COLUMN_COUNT_AUTO ||
|
||||||
|
columns->mColumnWidth.GetUnit() != eStyleUnit_Auto) {
|
||||||
|
columnSetFrame =
|
||||||
|
NS_NewColumnSetFrame(mPresShell, outerSC, nsFrameState(0));
|
||||||
|
InitAndRestoreFrame(aState, content, container, columnSetFrame);
|
||||||
|
innerSC = mPresShell->StyleSet()->ResolveAnonymousBoxStyle(
|
||||||
|
nsCSSAnonBoxes::columnContent, outerSC);
|
||||||
|
}
|
||||||
|
innerFrame = NS_NewBlockFormattingContext(mPresShell, innerSC);
|
||||||
|
if (columnSetFrame) {
|
||||||
|
InitAndRestoreFrame(aState, content, columnSetFrame, innerFrame);
|
||||||
|
SetInitialSingleChild(columnSetFrame, innerFrame);
|
||||||
|
outerFrame = columnSetFrame;
|
||||||
|
} else {
|
||||||
|
InitAndRestoreFrame(aState, content, container, innerFrame);
|
||||||
|
outerFrame = innerFrame;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
innerFrame = NS_NewBlockFormattingContext(mPresShell, outerSC);
|
||||||
|
InitAndRestoreFrame(aState, content, container, innerFrame);
|
||||||
|
outerFrame = innerFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Our kids should go into the blockFrame
|
SetInitialSingleChild(container, outerFrame);
|
||||||
newFrame = blockFrame;
|
|
||||||
|
// Now figure out whether newFrame or outerFrame should be the
|
||||||
|
// absolute container.
|
||||||
|
auto outerDisplay = outerSC->StyleDisplay();
|
||||||
|
if (outerDisplay->IsAbsPosContainingBlock(outerFrame)) {
|
||||||
|
maybeAbsoluteContainingBlockDisplay = outerDisplay;
|
||||||
|
maybeAbsoluteContainingBlock = outerFrame;
|
||||||
|
maybeAbsoluteContainingBlockStyleFrame = outerFrame;
|
||||||
|
innerFrame->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Our kids should go into the innerFrame.
|
||||||
|
newFrame = innerFrame;
|
||||||
}
|
}
|
||||||
|
|
||||||
aState.AddChild(frameToAddToList, aFrameItems, content, styleContext,
|
aState.AddChild(frameToAddToList, aFrameItems, content, styleContext,
|
||||||
|
@ -688,6 +688,12 @@ private:
|
|||||||
* display:contents
|
* display:contents
|
||||||
*/
|
*/
|
||||||
#define FCDATA_IS_CONTENTS 0x100000
|
#define FCDATA_IS_CONTENTS 0x100000
|
||||||
|
/**
|
||||||
|
* When FCDATA_CREATE_BLOCK_WRAPPER_FOR_ALL_KIDS is set, this bit says
|
||||||
|
* if we should create a grid/flex/columnset container instead of
|
||||||
|
* a block wrapper when the styles says so.
|
||||||
|
*/
|
||||||
|
#define FCDATA_ALLOW_GRID_FLEX_COLUMNSET 0x200000
|
||||||
|
|
||||||
/* Structure representing information about how a frame should be
|
/* Structure representing information about how a frame should be
|
||||||
constructed. */
|
constructed. */
|
||||||
|
@ -478,6 +478,11 @@ void nsHTMLReflowState::InitCBReflowState()
|
|||||||
mCBReflowState = nullptr;
|
mCBReflowState = nullptr;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (parentReflowState->mFlags.mDummyParentReflowState) {
|
||||||
|
// from bug 1316649
|
||||||
|
mCBReflowState = parentReflowState;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (parentReflowState->frame == frame->GetContainingBlock()) {
|
if (parentReflowState->frame == frame->GetContainingBlock()) {
|
||||||
// Inner table frames need to use the containing block of the outer
|
// Inner table frames need to use the containing block of the outer
|
||||||
|
Loading…
Reference in New Issue
Block a user