Bug 1334330 - Part 6: stylo: Use GenericSpecifiedValue abstraction for table elements; r=emilio

MozReview-Commit-ID: 6wo4iw4zEWP
This commit is contained in:
Manish Goregaokar
2017-01-26 16:51:01 -08:00
parent a2e18900da
commit 33a682c81d
10 changed files with 170 additions and 254 deletions

View File

@@ -51,19 +51,17 @@ HTMLTableCaptionElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLTableCaptionElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
GenericSpecifiedValues* aGenericData)
GenericSpecifiedValues* aData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(TableBorder)) {
nsCSSValue* captionSide = aData->ValueForCaptionSide();
if (captionSide->GetUnit() == eCSSUnit_Null) {
if (aData->ShouldComputeStyleStruct(NS_STYLE_INHERIT_BIT(TableBorder))) {
if (!aData->PropertyIsSet(eCSSProperty_caption_side)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::align);
if (value && value->Type() == nsAttrValue::eEnum)
captionSide->SetIntValue(value->GetEnumValue(), eCSSUnit_Enumerated);
aData->SetKeywordValue(eCSSProperty_caption_side, value->GetEnumValue());
}
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
}
NS_IMETHODIMP_(bool)