Ignore 'ordinal' attribute for out-of-flow and popup frames. r=enndeakin sr=bzbarsky a=dbaron

This commit is contained in:
mats.palmgren@bredband.net 2007-08-16 08:39:22 -07:00
parent 45153ad611
commit 11174cd361

View File

@ -1190,19 +1190,15 @@ nsBoxFrame::AttributeChanged(PRInt32 aNameSpaceID,
} }
else if (aAttribute == nsGkAtoms::ordinal) { else if (aAttribute == nsGkAtoms::ordinal) {
nsBoxLayoutState state(PresContext()); nsBoxLayoutState state(PresContext());
nsIBox* parent = GetParentBox();
nsIFrame* frameToMove = this;
if (GetStateBits() & NS_FRAME_OUT_OF_FLOW) {
PresContext()->PresShell()->GetPlaceholderFrameFor(this,
&frameToMove);
NS_ASSERTION(frameToMove, "Out of flow without placeholder?");
}
nsIBox* parent = frameToMove->GetParentBox();
// If our parent is not a box, there's not much we can do... but in that // If our parent is not a box, there's not much we can do... but in that
// case our ordinal doesn't matter anyway, so that's ok. // case our ordinal doesn't matter anyway, so that's ok.
if (parent) { // Also don't bother with popup frames since they are kept on the
parent->RelayoutChildAtOrdinal(state, frameToMove); // nsGkAtoms::popupList and RelayoutChildAtOrdinal() only handles
// principal children.
if (parent && !(GetStateBits() & NS_FRAME_OUT_OF_FLOW) &&
GetStyleDisplay()->mDisplay != NS_STYLE_DISPLAY_POPUP) {
parent->RelayoutChildAtOrdinal(state, this);
// XXXldb Should this instead be a tree change on the child or parent? // XXXldb Should this instead be a tree change on the child or parent?
PresContext()->PresShell()-> PresContext()->PresShell()->
FrameNeedsReflow(parent, nsIPresShell::eStyleChange, FrameNeedsReflow(parent, nsIPresShell::eStyleChange,