Bug 497519 part 2. Only do special handling for legends whose content parnt is an HTML fieldset. bzbarsky

This commit is contained in:
Timothy Nikkel
2009-08-07 15:51:25 -04:00
parent 178fe7160a
commit d63b94a05f
3 changed files with 33 additions and 2 deletions

View File

@@ -3656,11 +3656,15 @@ nsCSSFrameConstructor::FindHTMLData(nsIContent* aContent,
(aParentFrame->GetType() != nsGkAtoms::fieldSetFrame &&
aParentFrame->GetStyleContext()->GetPseudoType() !=
nsCSSAnonBoxes::fieldsetContent) ||
!aContent->GetParent() ||
!aContent->GetParent()->IsNodeOfType(nsINode::eHTML) ||
aContent->GetParent()->Tag() != nsGkAtoms::fieldset ||
aStyleContext->GetStyleDisplay()->IsFloating() ||
aStyleContext->GetStyleDisplay()->IsAbsolutelyPositioned())) {
// <legend> is only special inside fieldset frames, but for floated or
// <legend> is only special inside fieldset, check both the frame tree
// parent and content tree parent due to XBL issues. For floated or
// absolutely positioned legends we want to construct by display type and
// not do special legend stuff
// not do special legend stuff.
// XXXbz it would be nice if we could just decide this based on the parent
// tag, and hence just use a SIMPLE_TAG_CHAIN for legend below, but the
// fact that with XBL we could end up with this legend element in some