Bug 1334330 - Part 5: stylo: Use GenericSpecifiedValue abstraction for <li>,<pre>,<ol>,<ul>,<textarea>; r=bz,emilio

MozReview-Commit-ID: JQaa26ay5va
This commit is contained in:
Manish Goregaokar
2017-01-26 16:51:01 -08:00
parent a1fe121f74
commit a2e18900da
5 changed files with 27 additions and 37 deletions

View File

@@ -47,19 +47,17 @@ HTMLPreElement::ParseAttribute(int32_t aNamespaceID,
void
HTMLPreElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
GenericSpecifiedValues* aGenericData)
GenericSpecifiedValues* aData)
{
nsRuleData* aData = aGenericData->AsRuleData();
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Text)) {
nsCSSValue* whiteSpace = aData->ValueForWhiteSpace();
if (whiteSpace->GetUnit() == eCSSUnit_Null) {
if (aData->ShouldComputeStyleStruct(NS_STYLE_INHERIT_BIT(Text))) {
if (!aData->PropertyIsSet(eCSSProperty_white_space)) {
// wrap: empty
if (aAttributes->GetAttr(nsGkAtoms::wrap))
whiteSpace->SetIntValue(NS_STYLE_WHITESPACE_PRE_WRAP, eCSSUnit_Enumerated);
aData->SetKeywordValue(eCSSProperty_white_space, NS_STYLE_WHITESPACE_PRE_WRAP);
}
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aGenericData);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
}
NS_IMETHODIMP_(bool)