Bug 1338936 - Part 7: stylo: Make sure we don't crash on unimplemented mappers; r?emilio
MozReview-Commit-ID: 6wg32flypt7
--- a/dom/html/nsGenericHTMLElement.cpp
+++ b/dom/html/nsGenericHTMLElement.cpp
@@ -1517,16 +1517,22 @@ nsGenericHTMLElement::MapImageBorderAttr
void
nsGenericHTMLElement::MapBackgroundInto(const nsMappedAttributes* aAttributes,
GenericSpecifiedValues* aData)
{
if (!aData->ShouldComputeStyleStruct(NS_STYLE_INHERIT_BIT(Background)))
return;
+ if (aData->IsServo()) {
+ // FIXME(bug 1330041)
+ NS_WARNING("stylo: cannot handle background");
+ return;
+ }
+
nsPresContext* presContext = aData->PresContext();
if (!aData->PropertyIsSet(eCSSProperty_background_image) &&
presContext->UseDocumentColors()) {
// background
nsAttrValue* value =
const_cast<nsAttrValue*>(aAttributes->GetAttr(nsGkAtoms::background));
if (value) {
@@ -1540,19 +1546,16 @@ nsGenericHTMLElement::MapBackgroundInto(
// put it in the style tree.
if (value->Type() == nsAttrValue::eURL) {
value->LoadImage(presContext->Document());
}
if (value->Type() == nsAttrValue::eImage) {
nsCSSValueList* list = backImage->SetListValue();
list->mValue.SetImageValue(value->GetImageValue());
}
- } else {
- // FIXME(bug 1330041)
- MOZ_ASSERT_UNREACHABLE("stylo: cannot handle background");
}
}
}
}
void
nsGenericHTMLElement::MapBGColorInto(const nsMappedAttributes* aAttributes,
GenericSpecifiedValues* aData)
--- a/dom/mathml/nsMathMLElement.cpp
+++ b/dom/mathml/nsMathMLElement.cpp
@@ -485,16 +485,21 @@ nsMathMLElement::ParseNumericValue(const
aCSSValue.SetFloatValue(floatValue, cssUnit);
return true;
}
void
nsMathMLElement::MapMathMLAttributesInto(const nsMappedAttributes* aAttributes,
GenericSpecifiedValues* aGenericData)
{
+ if (aGenericData->IsServo()) {
+ // FIXME handle MathML properties in Stylo
+ return;
+ }
+
nsRuleData* aData = aGenericData->AsGecko();
if (aData->mSIDs & NS_STYLE_INHERIT_BIT(Font)) {
// scriptsizemultiplier
//
// "Specifies the multiplier to be used to adjust font size due to changes
// in scriptlevel.
//
// values: number