diff --git a/layout/xul/base/src/nsMenuFrame.cpp b/layout/xul/base/src/nsMenuFrame.cpp index b5c37dce8751..a06a4807951e 100644 --- a/layout/xul/base/src/nsMenuFrame.cpp +++ b/layout/xul/base/src/nsMenuFrame.cpp @@ -743,7 +743,23 @@ nsMenuFrame::Reflow(nsIPresContext* aPresContext, nsresult rv = child->GetNextSibling(&child); NS_ASSERTION(rv == NS_OK,"failed to get next child"); } - } + } else if (aReflowState.reason == eReflowReason_Dirty) { + // sometimes incrementals are converted to dirty. This is done in the case just above this. So lets check + // to see if this was converted. If it was it will still have a reflow state. + if (aReflowState.reflowCommand) { + // it was converted so lets see if the next child is this one. If it is then convert it back and + // pass it down. + nsIFrame* incrementalChild = nsnull; + aReflowState.reflowCommand->GetNext(incrementalChild, PR_FALSE); + if (incrementalChild == popupChild) + { + nsHTMLReflowState state(aReflowState); + state.reason = eReflowReason_Incremental; + return Reflow(aPresContext, aDesiredSize, state, aStatus); + + } + } + } // If we're a menulist AND if we're intrinsically sized, then // we need to flow our popup and use its width as our own width. diff --git a/layout/xul/base/src/nsMenuPopupFrame.cpp b/layout/xul/base/src/nsMenuPopupFrame.cpp index 6cd265639060..53ead32f1b43 100644 --- a/layout/xul/base/src/nsMenuPopupFrame.cpp +++ b/layout/xul/base/src/nsMenuPopupFrame.cpp @@ -682,10 +682,13 @@ nsMenuPopupFrame::SyncViewWithFrame(nsIPresContext* aPresContext, viewManager->MoveViewTo(view, xpos, ypos); viewManager->ResizeView(view, mRect.width, mRect.height); - nsAutoString shouldDisplay; - mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::menutobedisplayed, shouldDisplay); - if ( shouldDisplay.Equals("true") ) - mContent->SetAttribute(kNameSpaceID_None, nsXULAtoms::menuactive, "true", PR_TRUE); + nsAutoString shouldDisplay, menuActive; + mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::menuactive, menuActive); + if ( !menuActive.Equals("true") ) { + mContent->GetAttribute(kNameSpaceID_None, nsXULAtoms::menutobedisplayed, shouldDisplay); + if ( shouldDisplay.Equals("true") ) + mContent->SetAttribute(kNameSpaceID_None, nsXULAtoms::menuactive, "true", PR_TRUE); + } return NS_OK; } diff --git a/layout/xul/base/src/nsPopupSetFrame.cpp b/layout/xul/base/src/nsPopupSetFrame.cpp index 43cae6fd69b2..3b9bed9b4c08 100644 --- a/layout/xul/base/src/nsPopupSetFrame.cpp +++ b/layout/xul/base/src/nsPopupSetFrame.cpp @@ -237,7 +237,23 @@ nsPopupSetFrame::Reflow(nsIPresContext* aPresContext, nsresult rv = child->GetNextSibling(&child); NS_ASSERTION(rv == NS_OK,"failed to get next child"); } - } + } else if (aReflowState.reason == eReflowReason_Dirty) { + // sometimes incrementals are converted to dirty. This is done in the case just above this. So lets check + // to see if this was converted. If it was it will still have a reflow state. + if (aReflowState.reflowCommand) { + // it was converted so lets see if the next child is this one. If it is then convert it back and + // pass it down. + nsIFrame* incrementalChild = nsnull; + aReflowState.reflowCommand->GetNext(incrementalChild, PR_FALSE); + if (incrementalChild == popupChild) + { + nsHTMLReflowState state(aReflowState); + state.reason = eReflowReason_Incremental; + return Reflow(aPresContext, aDesiredSize, state, aStatus); + + } + } + } // Handle reflowing our subordinate popup if (popupChild) {