Bug 1334330 - Part 4: stylo: Use GenericSpecifiedValue abstraction for <br>; r?emilio
MozReview-Commit-ID: LjoqZ5R8tNb
--- a/dom/html/HTMLBRElement.cpp
+++ b/dom/html/HTMLBRElement.cpp
@@ -48,29 +48,27 @@ HTMLBRElement::ParseAttribute(int32_t aN
}
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
aResult);
}
void
HTMLBRElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
- GenericSpecifiedValues* aGenericData)
+ GenericSpecifiedValues* aData)
{
- nsRuleData* aData = aGenericData->AsRuleData();
- if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Display)) {
- nsCSSValue* clear = aData->ValueForClear();
- if (clear->GetUnit() == eCSSUnit_Null) {
+ if (aData->ShouldComputeStyleStruct(NS_STYLE_INHERIT_BIT(Display))) {
+ if (!aData->PropertyIsSet(eCSSProperty_clear)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::clear);
if (value && value->Type() == nsAttrValue::eEnum)
- clear->SetIntValue(value->GetEnumValue(), eCSSUnit_Enumerated);
+ aData->SetKeywordValue(eCSSProperty_clear, value->GetEnumValue());
}
}
- nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
+ nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
}
NS_IMETHODIMP_(bool)
HTMLBRElement::IsAttributeMapped(const nsIAtom* aAttribute) const
{
static const MappedAttributeEntry attributes[] = {
{ &nsGkAtoms::clear },
{ nullptr }