Bug 1449798 - Remove GenericSpecifiedValues::ShouldComputeStyleStruct and mSIDs. r=emilio
This was useful because nsRuleData in the old style system may not hold all the data, but the only subclass ServoSpecifiedValues is always able to hold any data, and thus passes NS_STYLE_INHERIT_MASK to mSIDS. Given this, this method and mSIDs seems to be useless and can be removed. MozReview-Commit-ID: 4vWcV4DRS2i
This commit is contained in:
@@ -185,48 +185,44 @@ void
|
||||
HTMLTableCellElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
||||
GenericSpecifiedValues* aData)
|
||||
{
|
||||
if (aData->ShouldComputeStyleStruct(NS_STYLE_INHERIT_BIT(Position))) {
|
||||
// width: value
|
||||
if (!aData->PropertyIsSet(eCSSProperty_width)) {
|
||||
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::width);
|
||||
if (value && value->Type() == nsAttrValue::eInteger) {
|
||||
if (value->GetIntegerValue() > 0)
|
||||
aData->SetPixelValue(eCSSProperty_width, (float)value->GetIntegerValue());
|
||||
// else 0 implies auto for compatibility.
|
||||
}
|
||||
else if (value && value->Type() == nsAttrValue::ePercent) {
|
||||
if (value->GetPercentValue() > 0.0f)
|
||||
aData->SetPercentValue(eCSSProperty_width, value->GetPercentValue());
|
||||
// else 0 implies auto for compatibility
|
||||
}
|
||||
// width: value
|
||||
if (!aData->PropertyIsSet(eCSSProperty_width)) {
|
||||
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::width);
|
||||
if (value && value->Type() == nsAttrValue::eInteger) {
|
||||
if (value->GetIntegerValue() > 0)
|
||||
aData->SetPixelValue(eCSSProperty_width, (float)value->GetIntegerValue());
|
||||
// else 0 implies auto for compatibility.
|
||||
}
|
||||
// height: value
|
||||
if (!aData->PropertyIsSet(eCSSProperty_height)) {
|
||||
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::height);
|
||||
if (value && value->Type() == nsAttrValue::eInteger) {
|
||||
if (value->GetIntegerValue() > 0)
|
||||
aData->SetPixelValue(eCSSProperty_height, (float)value->GetIntegerValue());
|
||||
// else 0 implies auto for compatibility.
|
||||
}
|
||||
else if (value && value->Type() == nsAttrValue::ePercent) {
|
||||
if (value->GetPercentValue() > 0.0f)
|
||||
aData->SetPercentValue(eCSSProperty_height, value->GetPercentValue());
|
||||
// else 0 implies auto for compatibility
|
||||
}
|
||||
else if (value && value->Type() == nsAttrValue::ePercent) {
|
||||
if (value->GetPercentValue() > 0.0f)
|
||||
aData->SetPercentValue(eCSSProperty_width, value->GetPercentValue());
|
||||
// else 0 implies auto for compatibility
|
||||
}
|
||||
}
|
||||
if (aData->ShouldComputeStyleStruct(NS_STYLE_INHERIT_BIT(Text))) {
|
||||
if (!aData->PropertyIsSet(eCSSProperty_white_space)) {
|
||||
// nowrap: enum
|
||||
if (aAttributes->GetAttr(nsGkAtoms::nowrap)) {
|
||||
// See if our width is not a nonzero integer width.
|
||||
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::width);
|
||||
nsCompatibility mode = aData->Document()->GetCompatibilityMode();
|
||||
if (!value || value->Type() != nsAttrValue::eInteger ||
|
||||
value->GetIntegerValue() == 0 ||
|
||||
eCompatibility_NavQuirks != mode) {
|
||||
aData->SetKeywordValue(eCSSProperty_white_space, StyleWhiteSpace::Nowrap);
|
||||
}
|
||||
// height: value
|
||||
if (!aData->PropertyIsSet(eCSSProperty_height)) {
|
||||
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::height);
|
||||
if (value && value->Type() == nsAttrValue::eInteger) {
|
||||
if (value->GetIntegerValue() > 0)
|
||||
aData->SetPixelValue(eCSSProperty_height, (float)value->GetIntegerValue());
|
||||
// else 0 implies auto for compatibility.
|
||||
}
|
||||
else if (value && value->Type() == nsAttrValue::ePercent) {
|
||||
if (value->GetPercentValue() > 0.0f)
|
||||
aData->SetPercentValue(eCSSProperty_height, value->GetPercentValue());
|
||||
// else 0 implies auto for compatibility
|
||||
}
|
||||
}
|
||||
if (!aData->PropertyIsSet(eCSSProperty_white_space)) {
|
||||
// nowrap: enum
|
||||
if (aAttributes->GetAttr(nsGkAtoms::nowrap)) {
|
||||
// See if our width is not a nonzero integer width.
|
||||
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::width);
|
||||
nsCompatibility mode = aData->Document()->GetCompatibilityMode();
|
||||
if (!value || value->Type() != nsAttrValue::eInteger ||
|
||||
value->GetIntegerValue() == 0 ||
|
||||
eCompatibility_NavQuirks != mode) {
|
||||
aData->SetKeywordValue(eCSSProperty_white_space, StyleWhiteSpace::Nowrap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user