mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 95530 - topmargin and leftmargin attributes on the BODY element should be honored in all modes (not just Quirks mode). r=dbaron
This commit is contained in:
parent
b4d9575de4
commit
180790c3fa
@ -82,46 +82,44 @@ BodyRule::MapRuleInfoInto(nsRuleData* aData)
|
|||||||
marginBottom->SetFloatValue((float)bodyMarginHeight, eCSSUnit_Pixel);
|
marginBottom->SetFloatValue((float)bodyMarginHeight, eCSSUnit_Pixel);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eCompatibility_NavQuirks == mode){
|
|
||||||
// topmargin (IE-attribute)
|
// topmargin (IE-attribute)
|
||||||
value = mPart->GetParsedAttr(nsGkAtoms::topmargin);
|
value = mPart->GetParsedAttr(nsGkAtoms::topmargin);
|
||||||
if (value && value->Type() == nsAttrValue::eInteger) {
|
if (value && value->Type() == nsAttrValue::eInteger) {
|
||||||
bodyTopMargin = value->GetIntegerValue();
|
bodyTopMargin = value->GetIntegerValue();
|
||||||
if (bodyTopMargin < 0) bodyTopMargin = 0;
|
if (bodyTopMargin < 0) bodyTopMargin = 0;
|
||||||
nsCSSValue* marginTop = aData->ValueForMarginTop();
|
nsCSSValue* marginTop = aData->ValueForMarginTop();
|
||||||
if (marginTop->GetUnit() == eCSSUnit_Null)
|
if (marginTop->GetUnit() == eCSSUnit_Null)
|
||||||
marginTop->SetFloatValue((float)bodyTopMargin, eCSSUnit_Pixel);
|
marginTop->SetFloatValue((float)bodyTopMargin, eCSSUnit_Pixel);
|
||||||
}
|
}
|
||||||
|
|
||||||
// bottommargin (IE-attribute)
|
// bottommargin (IE-attribute)
|
||||||
value = mPart->GetParsedAttr(nsGkAtoms::bottommargin);
|
value = mPart->GetParsedAttr(nsGkAtoms::bottommargin);
|
||||||
if (value && value->Type() == nsAttrValue::eInteger) {
|
if (value && value->Type() == nsAttrValue::eInteger) {
|
||||||
bodyBottomMargin = value->GetIntegerValue();
|
bodyBottomMargin = value->GetIntegerValue();
|
||||||
if (bodyBottomMargin < 0) bodyBottomMargin = 0;
|
if (bodyBottomMargin < 0) bodyBottomMargin = 0;
|
||||||
nsCSSValue* marginBottom = aData->ValueForMarginBottom();
|
nsCSSValue* marginBottom = aData->ValueForMarginBottom();
|
||||||
if (marginBottom->GetUnit() == eCSSUnit_Null)
|
if (marginBottom->GetUnit() == eCSSUnit_Null)
|
||||||
marginBottom->SetFloatValue((float)bodyBottomMargin, eCSSUnit_Pixel);
|
marginBottom->SetFloatValue((float)bodyBottomMargin, eCSSUnit_Pixel);
|
||||||
}
|
}
|
||||||
|
|
||||||
// leftmargin (IE-attribute)
|
// leftmargin (IE-attribute)
|
||||||
value = mPart->GetParsedAttr(nsGkAtoms::leftmargin);
|
value = mPart->GetParsedAttr(nsGkAtoms::leftmargin);
|
||||||
if (value && value->Type() == nsAttrValue::eInteger) {
|
if (value && value->Type() == nsAttrValue::eInteger) {
|
||||||
bodyLeftMargin = value->GetIntegerValue();
|
bodyLeftMargin = value->GetIntegerValue();
|
||||||
if (bodyLeftMargin < 0) bodyLeftMargin = 0;
|
if (bodyLeftMargin < 0) bodyLeftMargin = 0;
|
||||||
nsCSSValue* marginLeft = aData->ValueForMarginLeftValue();
|
nsCSSValue* marginLeft = aData->ValueForMarginLeftValue();
|
||||||
if (marginLeft->GetUnit() == eCSSUnit_Null)
|
if (marginLeft->GetUnit() == eCSSUnit_Null)
|
||||||
marginLeft->SetFloatValue((float)bodyLeftMargin, eCSSUnit_Pixel);
|
marginLeft->SetFloatValue((float)bodyLeftMargin, eCSSUnit_Pixel);
|
||||||
}
|
}
|
||||||
|
|
||||||
// rightmargin (IE-attribute)
|
// rightmargin (IE-attribute)
|
||||||
value = mPart->GetParsedAttr(nsGkAtoms::rightmargin);
|
value = mPart->GetParsedAttr(nsGkAtoms::rightmargin);
|
||||||
if (value && value->Type() == nsAttrValue::eInteger) {
|
if (value && value->Type() == nsAttrValue::eInteger) {
|
||||||
bodyRightMargin = value->GetIntegerValue();
|
bodyRightMargin = value->GetIntegerValue();
|
||||||
if (bodyRightMargin < 0) bodyRightMargin = 0;
|
if (bodyRightMargin < 0) bodyRightMargin = 0;
|
||||||
nsCSSValue* marginRight = aData->ValueForMarginRightValue();
|
nsCSSValue* marginRight = aData->ValueForMarginRightValue();
|
||||||
if (marginRight->GetUnit() == eCSSUnit_Null)
|
if (marginRight->GetUnit() == eCSSUnit_Null)
|
||||||
marginRight->SetFloatValue((float)bodyRightMargin, eCSSUnit_Pixel);
|
marginRight->SetFloatValue((float)bodyRightMargin, eCSSUnit_Pixel);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user