--- a/dom/html/HTMLBRElement.cpp
+++ b/dom/html/HTMLBRElement.cpp
@@ -50,17 +50,17 @@ HTMLBRElement::ParseAttribute(int32_t aN
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
aMaybeScriptedPrincipal, aResult);
}
void
HTMLBRElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
- if (!aData->PropertyIsSet(eCSSProperty_clear)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_clear)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::clear);
if (value && value->Type() == nsAttrValue::eEnum)
aDecls.SetKeywordValue(eCSSProperty_clear, value->GetEnumValue());
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aDecls);
}
NS_IMETHODIMP_(bool)
--- a/dom/html/HTMLBodyElement.cpp
+++ b/dom/html/HTMLBodyElement.cpp
@@ -204,17 +204,17 @@ HTMLBodyElement::MapAttributesIntoRule(c
}
value = aAttributes->GetAttr(nsGkAtoms::vlink);
if (value && value->GetColorValue(color)) {
styleSheet->SetVisitedLinkColor(color);
}
}
- if (!aData->PropertyIsSet(eCSSProperty_color)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_color)) {
// color: color
nscolor color;
value = aAttributes->GetAttr(nsGkAtoms::text);
if (value && value->GetColorValue(color)) {
aDecls.SetColorValue(eCSSProperty_color, color);
}
}
--- a/dom/html/HTMLFontElement.cpp
+++ b/dom/html/HTMLFontElement.cpp
@@ -53,30 +53,30 @@ HTMLFontElement::ParseAttribute(int32_t
aMaybeScriptedPrincipal, aResult);
}
void
HTMLFontElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
// face: string list
- if (!aData->PropertyIsSet(eCSSProperty_font_family)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_font_family)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::face);
if (value && value->Type() == nsAttrValue::eString &&
!value->IsEmptyString()) {
aDecls.SetFontFamily(value->GetStringValue());
}
}
// size: int
- if (!aData->PropertyIsSet(eCSSProperty_font_size)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_font_size)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::size);
if (value && value->Type() == nsAttrValue::eInteger)
aDecls.SetKeywordValue(eCSSProperty_font_size, value->GetIntegerValue());
}
- if (!aData->PropertyIsSet(eCSSProperty_color)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_color)) {
// color: color
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::color);
nscolor color;
if (value && value->GetColorValue(color)) {
aDecls.SetColorValue(eCSSProperty_color, color);
}
}
if (aData->Document()->GetCompatibilityMode() == eCompatibility_NavQuirks) {
--- a/dom/html/HTMLHRElement.cpp
+++ b/dom/html/HTMLHRElement.cpp
@@ -89,17 +89,17 @@ HTMLHRElement::MapAttributesIntoRule(con
aDecls.SetPixelValueIfUnset(eCSSProperty_margin_right, 0.0f);
break;
case NS_STYLE_TEXT_ALIGN_CENTER:
aDecls.SetAutoValueIfUnset(eCSSProperty_margin_left);
aDecls.SetAutoValueIfUnset(eCSSProperty_margin_right);
break;
}
}
- if (!aData->PropertyIsSet(eCSSProperty_height)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_height)) {
// size: integer
if (noshade) {
// noshade case: size is set using the border
aDecls.SetAutoValue(eCSSProperty_height);
} else {
// normal case
// the height includes the top and bottom borders that are initially 1px.
// for size=1, html.css has a special case rule that makes this work by
@@ -132,17 +132,17 @@ HTMLHRElement::MapAttributesIntoRule(con
}
aDecls.SetPixelValueIfUnset(eCSSProperty_border_top_width, sizePerSide);
if (allSides) {
aDecls.SetPixelValueIfUnset(eCSSProperty_border_right_width, sizePerSide);
aDecls.SetPixelValueIfUnset(eCSSProperty_border_bottom_width, sizePerSide);
aDecls.SetPixelValueIfUnset(eCSSProperty_border_left_width, sizePerSide);
}
- if (!aData->PropertyIsSet(eCSSProperty_border_top_style))
+ if (!aDecls.PropertyIsSet(eCSSProperty_border_top_style))
aDecls.SetKeywordValue(eCSSProperty_border_top_style,
NS_STYLE_BORDER_STYLE_SOLID);
if (allSides) {
aDecls.SetKeywordValueIfUnset(eCSSProperty_border_right_style,
NS_STYLE_BORDER_STYLE_SOLID);
aDecls.SetKeywordValueIfUnset(eCSSProperty_border_bottom_style,
NS_STYLE_BORDER_STYLE_SOLID);
aDecls.SetKeywordValueIfUnset(eCSSProperty_border_left_style,
--- a/dom/html/HTMLLIElement.cpp
+++ b/dom/html/HTMLLIElement.cpp
@@ -64,17 +64,17 @@ HTMLLIElement::ParseAttribute(int32_t aN
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
aMaybeScriptedPrincipal, aResult);
}
void
HTMLLIElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
- if (!aData->PropertyIsSet(eCSSProperty_list_style_type)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_list_style_type)) {
// type: enum
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::type);
if (value && value->Type() == nsAttrValue::eEnum)
aDecls.SetKeywordValue(eCSSProperty_list_style_type, value->GetEnumValue());
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aDecls);
}
--- a/dom/html/HTMLPreElement.cpp
+++ b/dom/html/HTMLPreElement.cpp
@@ -40,17 +40,17 @@ HTMLPreElement::ParseAttribute(int32_t a
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
aMaybeScriptedPrincipal, aResult);
}
void
HTMLPreElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
- if (!aData->PropertyIsSet(eCSSProperty_white_space)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_white_space)) {
// wrap: empty
if (aAttributes->GetAttr(nsGkAtoms::wrap))
aDecls.SetKeywordValue(eCSSProperty_white_space, StyleWhiteSpace::PreWrap);
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aDecls);
}
--- a/dom/html/HTMLSharedElement.cpp
+++ b/dom/html/HTMLSharedElement.cpp
@@ -76,17 +76,17 @@ HTMLSharedElement::ParseAttribute(int32_
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
aMaybeScriptedPrincipal, aResult);
}
static void
DirectoryMapAttributesIntoRule(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
- if (!aData->PropertyIsSet(eCSSProperty_list_style_type)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_list_style_type)) {
// type: enum
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::type);
if (value) {
if (value->Type() == nsAttrValue::eEnum) {
aDecls.SetKeywordValue(eCSSProperty_list_style_type, value->GetEnumValue());
} else {
aDecls.SetKeywordValue(eCSSProperty_list_style_type, NS_STYLE_LIST_STYLE_DISC);
}
--- a/dom/html/HTMLSharedListElement.cpp
+++ b/dom/html/HTMLSharedListElement.cpp
@@ -78,17 +78,17 @@ HTMLSharedListElement::ParseAttribute(in
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
aMaybeScriptedPrincipal, aResult);
}
void
HTMLSharedListElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
- if (!aData->PropertyIsSet(eCSSProperty_list_style_type)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_list_style_type)) {
// type: enum
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::type);
if (value && value->Type() == nsAttrValue::eEnum) {
aDecls.SetKeywordValue(eCSSProperty_list_style_type, value->GetEnumValue());
}
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aDecls);
--- a/dom/html/HTMLTableCaptionElement.cpp
+++ b/dom/html/HTMLTableCaptionElement.cpp
@@ -50,17 +50,17 @@ HTMLTableCaptionElement::ParseAttribute(
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
aMaybeScriptedPrincipal, aResult);
}
void
HTMLTableCaptionElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
- if (!aData->PropertyIsSet(eCSSProperty_caption_side)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_caption_side)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::align);
if (value && value->Type() == nsAttrValue::eEnum)
aDecls.SetKeywordValue(eCSSProperty_caption_side, value->GetEnumValue());
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aDecls);
}
--- a/dom/html/HTMLTableCellElement.cpp
+++ b/dom/html/HTMLTableCellElement.cpp
@@ -181,44 +181,44 @@ HTMLTableCellElement::ParseAttribute(int
aMaybeScriptedPrincipal, aResult);
}
void
HTMLTableCellElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
// width: value
- if (!aData->PropertyIsSet(eCSSProperty_width)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_width)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::width);
if (value && value->Type() == nsAttrValue::eInteger) {
if (value->GetIntegerValue() > 0)
aDecls.SetPixelValue(eCSSProperty_width, (float)value->GetIntegerValue());
// else 0 implies auto for compatibility.
}
else if (value && value->Type() == nsAttrValue::ePercent) {
if (value->GetPercentValue() > 0.0f)
aDecls.SetPercentValue(eCSSProperty_width, value->GetPercentValue());
// else 0 implies auto for compatibility
}
}
// height: value
- if (!aData->PropertyIsSet(eCSSProperty_height)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_height)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::height);
if (value && value->Type() == nsAttrValue::eInteger) {
if (value->GetIntegerValue() > 0)
aDecls.SetPixelValue(eCSSProperty_height, (float)value->GetIntegerValue());
// else 0 implies auto for compatibility.
}
else if (value && value->Type() == nsAttrValue::ePercent) {
if (value->GetPercentValue() > 0.0f)
aDecls.SetPercentValue(eCSSProperty_height, value->GetPercentValue());
// else 0 implies auto for compatibility
}
}
- if (!aData->PropertyIsSet(eCSSProperty_white_space)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_white_space)) {
// nowrap: enum
if (aAttributes->GetAttr(nsGkAtoms::nowrap)) {
// See if our width is not a nonzero integer width.
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::width);
nsCompatibility mode = aData->Document()->GetCompatibilityMode();
if (!value || value->Type() != nsAttrValue::eInteger ||
value->GetIntegerValue() == 0 ||
eCompatibility_NavQuirks != mode) {
--- a/dom/html/HTMLTableColElement.cpp
+++ b/dom/html/HTMLTableColElement.cpp
@@ -62,17 +62,17 @@ HTMLTableColElement::ParseAttribute(int3
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
aMaybeScriptedPrincipal, aResult);
}
void
HTMLTableColElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
- if (!aData->PropertyIsSet(eCSSProperty__x_span)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty__x_span)) {
// span: int
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::span);
if (value && value->Type() == nsAttrValue::eInteger) {
int32_t val = value->GetIntegerValue();
// Note: Do NOT use this code for table cells! The value "0"
// means something special for colspan and rowspan, but for <col
// span> and <colgroup span> it's just disallowed.
if (val > 0) {
--- a/dom/html/HTMLTableElement.cpp
+++ b/dom/html/HTMLTableElement.cpp
@@ -944,17 +944,17 @@ HTMLTableElement::MapAttributesIntoRule(
// which *element* it's matching (style rules should not stop matching
// when the display type is changed).
nsCompatibility mode = aData->Document()->GetCompatibilityMode();
// cellspacing
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::cellspacing);
if (value && value->Type() == nsAttrValue::eInteger &&
- !aData->PropertyIsSet(eCSSProperty_border_spacing)) {
+ !aDecls.PropertyIsSet(eCSSProperty_border_spacing)) {
aDecls.SetPixelValue(eCSSProperty_border_spacing, float(value->GetIntegerValue()));
}
// align; Check for enumerated type (it may be another type if
// illegal)
value = aAttributes->GetAttr(nsGkAtoms::align);
if (value && value->Type() == nsAttrValue::eEnum) {
if (value->GetEnumValue() == NS_STYLE_TEXT_ALIGN_CENTER ||
value->GetEnumValue() == NS_STYLE_TEXT_ALIGN_MOZ_CENTER) {
--- a/dom/html/HTMLTableSectionElement.cpp
+++ b/dom/html/HTMLTableSectionElement.cpp
@@ -161,17 +161,17 @@ HTMLTableSectionElement::ParseAttribute(
aMaybeScriptedPrincipal, aResult);
}
void
HTMLTableSectionElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
// height: value
- if (!aData->PropertyIsSet(eCSSProperty_height)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_height)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::height);
if (value && value->Type() == nsAttrValue::eInteger)
aDecls.SetPixelValue(eCSSProperty_height, (float)value->GetIntegerValue());
}
nsGenericHTMLElement::MapDivAlignAttributeInto(aAttributes, aDecls);
nsGenericHTMLElement::MapVAlignAttributeInto(aAttributes, aDecls);
nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aDecls);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aDecls);
--- a/dom/html/HTMLTextAreaElement.cpp
+++ b/dom/html/HTMLTextAreaElement.cpp
@@ -425,17 +425,17 @@ HTMLTextAreaElement::ParseAttribute(int3
aMaybeScriptedPrincipal, aResult);
}
void
HTMLTextAreaElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
// wrap=off
- if (!aData->PropertyIsSet(eCSSProperty_white_space)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_white_space)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::wrap);
if (value && value->Type() == nsAttrValue::eString &&
value->Equals(nsGkAtoms::OFF, eIgnoreCase)) {
aDecls.SetKeywordValue(eCSSProperty_white_space, StyleWhiteSpace::Pre);
}
}
nsGenericHTMLFormElementWithState::MapDivAlignAttributeInto(aAttributes, aDecls);
--- a/dom/html/nsGenericHTMLElement.cpp
+++ b/dom/html/nsGenericHTMLElement.cpp
@@ -1166,17 +1166,17 @@ MapLangAttributeInto(const nsMappedAttri
{
const nsAttrValue* langValue = aAttributes->GetAttr(nsGkAtoms::lang);
if (!langValue) {
return;
}
MOZ_ASSERT(langValue->Type() == nsAttrValue::eAtom);
aDecls.SetIdentAtomValueIfUnset(eCSSProperty__x_lang,
langValue->GetAtomValue());
- if (!aData->PropertyIsSet(eCSSProperty_text_emphasis_position)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_text_emphasis_position)) {
const nsAtom* lang = langValue->GetAtomValue();
if (nsStyleUtil::MatchesLanguagePrefix(lang, u"zh")) {
aDecls.SetKeywordValue(eCSSProperty_text_emphasis_position,
NS_STYLE_TEXT_EMPHASIS_POSITION_DEFAULT_ZH);
} else if (nsStyleUtil::MatchesLanguagePrefix(lang, u"ja") ||
nsStyleUtil::MatchesLanguagePrefix(lang, u"mn")) {
// This branch is currently no part of the spec.
// See bug 1040668 comment 69 and comment 75.
@@ -1188,17 +1188,17 @@ MapLangAttributeInto(const nsMappedAttri
/**
* Handle attributes common to all html elements
*/
void
nsGenericHTMLElement::MapCommonAttributesIntoExceptHidden(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
- if (!aData->PropertyIsSet(eCSSProperty__moz_user_modify)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty__moz_user_modify)) {
const nsAttrValue* value =
aAttributes->GetAttr(nsGkAtoms::contenteditable);
if (value) {
if (value->Equals(nsGkAtoms::_empty, eCaseMatters) ||
value->Equals(nsGkAtoms::_true, eIgnoreCase)) {
aDecls.SetKeywordValue(eCSSProperty__moz_user_modify,
StyleUserModify::ReadWrite);
}
@@ -1213,17 +1213,17 @@ nsGenericHTMLElement::MapCommonAttribute
}
void
nsGenericHTMLElement::MapCommonAttributesInto(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
MapCommonAttributesIntoExceptHidden(aAttributes, aDecls);
- if (!aData->PropertyIsSet(eCSSProperty_display)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_display)) {
if (aAttributes->IndexOfAttr(nsGkAtoms::hidden) >= 0) {
aDecls.SetKeywordValue(eCSSProperty_display, StyleDisplay::None);
}
}
}
/* static */ const nsGenericHTMLElement::MappedAttributeEntry
nsGenericHTMLElement::sCommonAttributeMap[] = {
@@ -1275,53 +1275,53 @@ nsGenericHTMLElement::sBackgroundColorAt
void
nsGenericHTMLElement::MapImageAlignAttributeInto(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::align);
if (value && value->Type() == nsAttrValue::eEnum) {
int32_t align = value->GetEnumValue();
- if (!aData->PropertyIsSet(eCSSProperty_float)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_float)) {
if (align == NS_STYLE_TEXT_ALIGN_LEFT) {
aDecls.SetKeywordValue(eCSSProperty_float, StyleFloat::Left);
} else if (align == NS_STYLE_TEXT_ALIGN_RIGHT) {
aDecls.SetKeywordValue(eCSSProperty_float, StyleFloat::Right);
}
}
- if (!aData->PropertyIsSet(eCSSProperty_vertical_align)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_vertical_align)) {
switch (align) {
case NS_STYLE_TEXT_ALIGN_LEFT:
case NS_STYLE_TEXT_ALIGN_RIGHT:
break;
default:
aDecls.SetKeywordValue(eCSSProperty_vertical_align, align);
break;
}
}
}
}
void
nsGenericHTMLElement::MapDivAlignAttributeInto(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
- if (!aData->PropertyIsSet(eCSSProperty_text_align)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_text_align)) {
// align: enum
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::align);
if (value && value->Type() == nsAttrValue::eEnum)
aDecls.SetKeywordValue(eCSSProperty_text_align, value->GetEnumValue());
}
}
void
nsGenericHTMLElement::MapVAlignAttributeInto(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
- if (!aData->PropertyIsSet(eCSSProperty_vertical_align)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_vertical_align)) {
// align: enum
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::valign);
if (value && value->Type() == nsAttrValue::eEnum)
aDecls.SetKeywordValue(eCSSProperty_vertical_align, value->GetEnumValue());
}
}
void
@@ -1363,34 +1363,34 @@ nsGenericHTMLElement::MapImageMarginAttr
}
}
void
nsGenericHTMLElement::MapWidthAttributeInto(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
// width: value
- if (!aData->PropertyIsSet(eCSSProperty_width)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_width)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::width);
if (value && value->Type() == nsAttrValue::eInteger) {
aDecls.SetPixelValue(eCSSProperty_width,
(float)value->GetIntegerValue());
} else if (value && value->Type() == nsAttrValue::ePercent) {
aDecls.SetPercentValue(eCSSProperty_width,
value->GetPercentValue());
}
}
}
void
nsGenericHTMLElement::MapHeightAttributeInto(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
// height: value
- if (!aData->PropertyIsSet(eCSSProperty_height)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_height)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::height);
if (value && value->Type() == nsAttrValue::eInteger) {
aDecls.SetPixelValue(eCSSProperty_height,
(float)value->GetIntegerValue());
} else if (value && value->Type() == nsAttrValue::ePercent) {
aDecls.SetPercentValue(eCSSProperty_height,
value->GetPercentValue());
}
@@ -1438,31 +1438,31 @@ nsGenericHTMLElement::MapImageBorderAttr
aDecls.SetCurrentColorIfUnset(eCSSProperty_border_left_color);
}
void
nsGenericHTMLElement::MapBackgroundInto(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
- if (!aData->PropertyIsSet(eCSSProperty_background_image)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_background_image)) {
// background
nsAttrValue* value =
const_cast<nsAttrValue*>(aAttributes->GetAttr(nsGkAtoms::background));
if (value) {
aDecls.SetBackgroundImage(*value);
}
}
}
void
nsGenericHTMLElement::MapBGColorInto(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
- if (!aData->PropertyIsSet(eCSSProperty_background_color)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_background_color)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::bgcolor);
nscolor color;
if (value && value->GetColorValue(color)) {
aDecls.SetColorValue(eCSSProperty_background_color, color);
}
}
}
--- a/dom/mathml/nsMathMLElement.cpp
+++ b/dom/mathml/nsMathMLElement.cpp
@@ -508,17 +508,17 @@ nsMathMLElement::MapMathMLAttributesInto
// in scriptlevel.
//
// values: number
// default: 0.71
//
const nsAttrValue* value =
aAttributes->GetAttr(nsGkAtoms::scriptsizemultiplier_);
if (value && value->Type() == nsAttrValue::eString &&
- !aData->PropertyIsSet(eCSSProperty__moz_script_size_multiplier)) {
+ !aDecls.PropertyIsSet(eCSSProperty__moz_script_size_multiplier)) {
nsAutoString str(value->GetStringValue());
str.CompressWhitespace();
// MathML numbers can't have leading '+'
if (str.Length() > 0 && str.CharAt(0) != '+') {
nsresult errorCode;
float floatValue = str.ToFloat(&errorCode);
// Negative scriptsizemultipliers are not parsed
if (NS_SUCCEEDED(errorCode) && floatValue >= 0.0f) {
@@ -539,17 +539,17 @@ nsMathMLElement::MapMathMLAttributesInto
// values: length
// default: 8pt
//
// We don't allow negative values.
// Unitless and percent values give a multiple of the default value.
//
value = aAttributes->GetAttr(nsGkAtoms::scriptminsize_);
if (value && value->Type() == nsAttrValue::eString &&
- !aData->PropertyIsSet(eCSSProperty__moz_script_min_size)) {
+ !aDecls.PropertyIsSet(eCSSProperty__moz_script_min_size)) {
nsCSSValue scriptMinSize;
ParseNumericValue(value->GetStringValue(), scriptMinSize,
PARSE_ALLOW_UNITLESS | CONVERT_UNITLESS_TO_PERCENT,
aData->Document());
if (scriptMinSize.GetUnit() == eCSSUnit_Percent) {
scriptMinSize.SetFloatValue(8.0 * scriptMinSize.GetPercentValue(),
eCSSUnit_Point);
@@ -567,17 +567,17 @@ nsMathMLElement::MapMathMLAttributesInto
// value. (Note that large decrements can result in negative values of
// scriptlevel, but these values are considered legal.)"
//
// values: ( "+" | "-" )? unsigned-integer
// default: inherited
//
value = aAttributes->GetAttr(nsGkAtoms::scriptlevel_);
if (value && value->Type() == nsAttrValue::eString &&
- !aData->PropertyIsSet(eCSSProperty__moz_script_level)) {
+ !aDecls.PropertyIsSet(eCSSProperty__moz_script_level)) {
nsAutoString str(value->GetStringValue());
str.CompressWhitespace();
if (str.Length() > 0) {
nsresult errorCode;
int32_t intValue = str.ToInteger(&errorCode);
if (NS_SUCCEEDED(errorCode)) {
// This is kind of cheesy ... if the scriptlevel has a sign,
// then it's a relative value and we store the nsCSSValue as an
@@ -625,17 +625,17 @@ nsMathMLElement::MapMathMLAttributesInto
value = aAttributes->GetAttr(nsGkAtoms::fontsize_);
if (value) {
WarnDeprecated(nsGkAtoms::fontsize_->GetUTF16String(),
nsGkAtoms::mathsize_->GetUTF16String(),
aData->Document());
}
}
if (value && value->Type() == nsAttrValue::eString &&
- !aData->PropertyIsSet(eCSSProperty_font_size)) {
+ !aDecls.PropertyIsSet(eCSSProperty_font_size)) {
nsAutoString str(value->GetStringValue());
nsCSSValue fontSize;
if (!ParseNumericValue(str, fontSize, PARSE_SUPPRESS_WARNINGS |
PARSE_ALLOW_UNITLESS | CONVERT_UNITLESS_TO_PERCENT,
nullptr)
&& parseSizeKeywords) {
static const char sizes[3][7] = { "small", "normal", "big" };
static const int32_t values[MOZ_ARRAY_LENGTH(sizes)] = {
@@ -667,17 +667,17 @@ nsMathMLElement::MapMathMLAttributesInto
//
value = aAttributes->GetAttr(nsGkAtoms::fontfamily_);
if (value) {
WarnDeprecated(nsGkAtoms::fontfamily_->GetUTF16String(),
nsGkAtoms::mathvariant_->GetUTF16String(),
aData->Document());
}
if (value && value->Type() == nsAttrValue::eString &&
- !aData->PropertyIsSet(eCSSProperty_font_family)) {
+ !aDecls.PropertyIsSet(eCSSProperty_font_family)) {
aDecls.SetFontFamily(value->GetStringValue());
}
// fontstyle
//
// "Specified the font style to use for the token. Deprecated in favor of
// mathvariant."
//
@@ -687,17 +687,17 @@ nsMathMLElement::MapMathMLAttributesInto
// Note that the font-style property is reset in layout/style/ when
// -moz-math-variant is specified.
value = aAttributes->GetAttr(nsGkAtoms::fontstyle_);
if (value) {
WarnDeprecated(nsGkAtoms::fontstyle_->GetUTF16String(),
nsGkAtoms::mathvariant_->GetUTF16String(),
aData->Document());
if (value->Type() == nsAttrValue::eString &&
- !aData->PropertyIsSet(eCSSProperty_font_style)) {
+ !aDecls.PropertyIsSet(eCSSProperty_font_style)) {
nsAutoString str(value->GetStringValue());
str.CompressWhitespace();
// FIXME(emilio): This should use FontSlantStyle or what not. Or even
// better, it looks deprecated since forever, we should just kill it.
if (str.EqualsASCII("normal")) {
aDecls.SetKeywordValue(eCSSProperty_font_style, NS_FONT_STYLE_NORMAL);
} else if (str.EqualsASCII("italic")) {
aDecls.SetKeywordValue(eCSSProperty_font_style, NS_FONT_STYLE_ITALIC);
@@ -716,17 +716,17 @@ nsMathMLElement::MapMathMLAttributesInto
// Note that the font-weight property is reset in layout/style/ when
// -moz-math-variant is specified.
value = aAttributes->GetAttr(nsGkAtoms::fontweight_);
if (value) {
WarnDeprecated(nsGkAtoms::fontweight_->GetUTF16String(),
nsGkAtoms::mathvariant_->GetUTF16String(),
aData->Document());
if (value->Type() == nsAttrValue::eString &&
- !aData->PropertyIsSet(eCSSProperty_font_weight)) {
+ !aDecls.PropertyIsSet(eCSSProperty_font_weight)) {
nsAutoString str(value->GetStringValue());
str.CompressWhitespace();
if (str.EqualsASCII("normal")) {
aDecls.SetKeywordValue(eCSSProperty_font_weight,
FontWeight::Normal().ToFloat());
} else if (str.EqualsASCII("bold")) {
aDecls.SetKeywordValue(eCSSProperty_font_weight,
FontWeight::Bold().ToFloat());
@@ -742,17 +742,17 @@ nsMathMLElement::MapMathMLAttributesInto
// values: "normal" | "bold" | "italic" | "bold-italic" | "double-struck" |
// "bold-fraktur" | "script" | "bold-script" | "fraktur" | "sans-serif" |
// "bold-sans-serif" | "sans-serif-italic" | "sans-serif-bold-italic" |
// "monospace" | "initial" | "tailed" | "looped" | "stretched"
// default: normal (except on <mi>)
//
value = aAttributes->GetAttr(nsGkAtoms::mathvariant_);
if (value && value->Type() == nsAttrValue::eString &&
- !aData->PropertyIsSet(eCSSProperty__moz_math_variant)) {
+ !aDecls.PropertyIsSet(eCSSProperty__moz_math_variant)) {
nsAutoString str(value->GetStringValue());
str.CompressWhitespace();
static const char sizes[19][23] = {
"normal", "bold", "italic", "bold-italic", "script", "bold-script",
"fraktur", "double-struck", "bold-fraktur", "sans-serif",
"bold-sans-serif", "sans-serif-italic", "sans-serif-bold-italic",
"monospace", "initial", "tailed", "looped", "stretched"
};
@@ -849,17 +849,17 @@ nsMathMLElement::MapMathMLAttributesInto
// relative to the horizontal space a MathML renderer has available for the
// math element. When the value is "auto", the MathML renderer should
// calculate the table width from its contents using whatever layout
// algorithm it chooses. "
//
// values: "auto" | length
// default: auto
//
- if (!aData->PropertyIsSet(eCSSProperty_width)) {
+ if (!aDecls.PropertyIsSet(eCSSProperty_width)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::width);
nsCSSValue width;
// This does not handle auto and unitless values
if (value && value->Type() == nsAttrValue::eString) {
ParseNumericValue(value->GetStringValue(), width, 0, aData->Document());
if (width.GetUnit() == eCSSUnit_Percent) {
aDecls.SetPercentValue(eCSSProperty_width,
width.GetPercentValue());
@@ -886,17 +886,17 @@ nsMathMLElement::MapMathMLAttributesInto
// see Section 3.1.5.1 Overall Directionality of Mathematics Formulas for
// further discussion. It has no effect on mspace."
//
// values: "ltr" | "rtl"
// default: inherited
//
value = aAttributes->GetAttr(nsGkAtoms::dir);
if (value && value->Type() == nsAttrValue::eString &&
- !aData->PropertyIsSet(eCSSProperty_direction)) {
+ !aDecls.PropertyIsSet(eCSSProperty_direction)) {
nsAutoString str(value->GetStringValue());
static const char dirs[][4] = { "ltr", "rtl" };
static const int32_t dirValues[MOZ_ARRAY_LENGTH(dirs)] = {
NS_STYLE_DIRECTION_LTR, NS_STYLE_DIRECTION_RTL
};
for (uint32_t i = 0; i < ArrayLength(dirs); ++i) {
if (str.EqualsASCII(dirs[i])) {
aDecls.SetKeywordValue(eCSSProperty_direction, dirValues[i]);