diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 1d885357ed63..060010a8be92 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -1977,19 +1977,18 @@ IsTablePseudo(nsIFrame* aFrame) /* static */ nsCSSFrameConstructor::ParentType -nsCSSFrameConstructor::GetParentType(nsIFrame* aParentFrame) +nsCSSFrameConstructor::GetParentType(nsIAtom* aFrameType) { - nsIAtom* type = aParentFrame->GetType(); - if (type == nsGkAtoms::tableFrame) { + if (aFrameType == nsGkAtoms::tableFrame) { return eTypeTable; } - if (type == nsGkAtoms::tableRowGroupFrame) { + if (aFrameType == nsGkAtoms::tableRowGroupFrame) { return eTypeRowGroup; } - if (type == nsGkAtoms::tableRowFrame) { + if (aFrameType == nsGkAtoms::tableRowFrame) { return eTypeRow; } - if (type == nsGkAtoms::tableColGroupFrame) { + if (aFrameType == nsGkAtoms::tableColGroupFrame) { return eTypeColGroup; } @@ -7270,6 +7269,7 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer, return NS_OK; } parentFrame = childFrame->GetParent(); + parentType = parentFrame->GetType(); #ifdef NOISY_FIRST_LETTER printf(" ==> revised parentFrame="); @@ -7353,9 +7353,13 @@ nsCSSFrameConstructor::ContentRemoved(nsIContent* aContainer, // If we're just reconstructing frames for the element, then the // following ContentInserted notification on the element will - // take care of fixing up any adjacent text nodes. + // take care of fixing up any adjacent text nodes. We don't need + // to do this if the table parent type of our parent type is not + // eTypeBlock, though, because in that case the whitespace isn't + // being suppressed due to us anyway. if (aContainer && aIndexInContainer >= 0 && - aFlags != REMOVE_FOR_RECONSTRUCTION) { + aFlags != REMOVE_FOR_RECONSTRUCTION && + GetParentType(parentType) == eTypeBlock) { // Adjacent whitespace-only text nodes might have been suppressed if // this node does not have inline ends. Create frames for them now // if necessary. diff --git a/layout/base/nsCSSFrameConstructor.h b/layout/base/nsCSSFrameConstructor.h index fd90dda17aa0..846f38a78b55 100644 --- a/layout/base/nsCSSFrameConstructor.h +++ b/layout/base/nsCSSFrameConstructor.h @@ -470,7 +470,12 @@ private: (((PRUint32)(_type)) << FCDATA_PARENT_TYPE_OFFSET) /* Get the parent type that aParentFrame has. */ - static ParentType GetParentType(nsIFrame* aParentFrame); + static ParentType GetParentType(nsIFrame* aParentFrame) { + return GetParentType(aParentFrame->GetType()); + } + + /* Get the parent type for the given nsIFrame type atom */ + static ParentType GetParentType(nsIAtom* aFrameType); /* A constructor function that just creates an nsIFrame object. The caller is responsible for initializing the object, adding it to frame lists,