Bug 527464. Go back to ignoring nowrape in quirks mode if a nonzero width is set in the width attribute. r=bzbarsky

This commit is contained in:
Bernd 2009-11-17 17:50:06 -05:00
parent de6af72a50
commit d554f9f2b3
4 changed files with 12 additions and 1 deletions

View File

@ -371,7 +371,15 @@ void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
if (aData->mTextData->mWhiteSpace.GetUnit() == eCSSUnit_Null) {
// nowrap: enum
if (aAttributes->GetAttr(nsGkAtoms::nowrap)) {
aData->mTextData->mWhiteSpace.SetIntValue(NS_STYLE_WHITESPACE_NOWRAP, eCSSUnit_Enumerated);
// See if our width is not a nonzero integer width.
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::width);
nsCompatibility mode = aData->mPresContext->CompatibilityMode();
if (!value || value->Type() != nsAttrValue::eInteger ||
value->GetIntegerValue() == 0 ||
eCompatibility_NavQuirks != mode) {
aData->mTextData->mWhiteSpace.SetIntValue(NS_STYLE_WHITESPACE_NOWRAP, eCSSUnit_Enumerated);
}
}
}
}

View File

@ -0,0 +1 @@
<table><tr><td width="1" nowrap>x x</td></td></tr></table>

View File

@ -0,0 +1 @@
<table><tr><td width="1">x x</td></td></tr></table>

View File

@ -1339,3 +1339,4 @@ fails-if(MOZ_WIDGET_TOOLKIT!="cocoa") == 488692-1.html 488692-1-ref.html # needs
== 523096-1.html 523096-1-ref.html
== 523468-1.html 523468-1-ref.html
== 524175-1.html 524175-1-ref.html
== 527464-1.html 527464-ref.html