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 bb8491a3fd
commit 312cc0762c
3 changed files with 33 additions and 2 deletions

View File

@ -0,0 +1,26 @@
<html xmlns="http://www.w3.org/1999/xhtml" style="-moz-binding: url(#foo)">
<head>
<xbl:bindings xmlns:xbl="http://www.mozilla.org/xbl">
<xbl:binding id="foo"><xbl:content><fieldset><xbl:children/></fieldset></xbl:content></xbl:binding>
</xbl:bindings>
<script type="text/javascript">
function boom()
{
var dE = document.documentElement;
var leg = document.createElementNS("http://www.w3.org/1999/xhtml", "legend");
leg.style.cssFloat = "left";
dE.appendChild(leg);
document.documentElement.offsetHeight;
dE.removeChild(leg);
}
</script>
</head>
<body onload="boom();"></body>
</html>

View File

@ -240,5 +240,6 @@ load 492112-1.xhtml
load 492163-1.xhtml
load 495350-1.html
load 497519-1.xhtml
load 497519-2.xhtml
load 500467-1.html
load 501878-1.html

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