Bug 1334330 - Part 1: stylo: Abstractify nsMappedAttributes to work on arbitrary containers of specified value data; r=bz,emilio

MozReview-Commit-ID: BSM4TC9RKot
This commit is contained in:
Manish Goregaokar
2017-01-26 13:39:13 -08:00
parent 0f862a03fb
commit 7e8e84c24b
60 changed files with 231 additions and 148 deletions

View File

@@ -707,8 +707,9 @@ HTMLTableElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLTableElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
// XXX Bug 211636: This function is used by a single style rule
// that's used to match two different type of elements -- tables, and
// table cells. (nsHTMLTableCellElement overrides
@@ -841,8 +842,8 @@ HTMLTableElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
borderBottomWidth->SetFloatValue((float)borderThickness, eCSSUnit_Pixel);
}
}
nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aGenericData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
}
NS_IMETHODIMP_(bool)
@@ -880,8 +881,9 @@ HTMLTableElement::GetAttributeMappingFunction() const
static void
MapInheritedTableAttributesIntoRule(const nsMappedAttributes* aAttributes,
nsRuleData* aData)
GenericSpecifiedValues* aGenericData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Padding)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::cellpadding);
if (value && value->Type() == nsAttrValue::eInteger) {