--- a/dom/html/HTMLBRElement.cpp
+++ b/dom/html/HTMLBRElement.cpp
@@ -53,17 +53,17 @@ HTMLBRElement::ParseAttribute(int32_t aN
void
HTMLBRElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
if (!aData->PropertyIsSet(eCSSProperty_clear)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::clear);
if (value && value->Type() == nsAttrValue::eEnum)
- aData->SetKeywordValue(eCSSProperty_clear, value->GetEnumValue());
+ aDecls.SetKeywordValue(eCSSProperty_clear, value->GetEnumValue());
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aDecls);
}
NS_IMETHODIMP_(bool)
HTMLBRElement::IsAttributeMapped(const nsAtom* aAttribute) const
{
static const MappedAttributeEntry attributes[] = {
--- a/dom/html/HTMLBodyElement.cpp
+++ b/dom/html/HTMLBodyElement.cpp
@@ -94,102 +94,102 @@ HTMLBodyElement::MapAttributesIntoRule(c
const nsAttrValue* value;
// if marginwidth/marginheight are set, reflect them as 'margin'
value = aAttributes->GetAttr(nsGkAtoms::marginwidth);
if (value && value->Type() == nsAttrValue::eInteger) {
bodyMarginWidth = value->GetIntegerValue();
if (bodyMarginWidth < 0) {
bodyMarginWidth = 0;
}
- aData->SetPixelValueIfUnset(eCSSProperty_margin_left, (float)bodyMarginWidth);
- aData->SetPixelValueIfUnset(eCSSProperty_margin_right, (float)bodyMarginWidth);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_margin_left, (float)bodyMarginWidth);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_margin_right, (float)bodyMarginWidth);
}
value = aAttributes->GetAttr(nsGkAtoms::marginheight);
if (value && value->Type() == nsAttrValue::eInteger) {
bodyMarginHeight = value->GetIntegerValue();
if (bodyMarginHeight < 0) {
bodyMarginHeight = 0;
}
- aData->SetPixelValueIfUnset(eCSSProperty_margin_top, (float)bodyMarginHeight);
- aData->SetPixelValueIfUnset(eCSSProperty_margin_bottom, (float)bodyMarginHeight);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_margin_top, (float)bodyMarginHeight);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_margin_bottom, (float)bodyMarginHeight);
}
// topmargin (IE-attribute)
if (bodyMarginHeight == -1) {
value = aAttributes->GetAttr(nsGkAtoms::topmargin);
if (value && value->Type() == nsAttrValue::eInteger) {
bodyTopMargin = value->GetIntegerValue();
if (bodyTopMargin < 0) {
bodyTopMargin = 0;
}
- aData->SetPixelValueIfUnset(eCSSProperty_margin_top, (float)bodyTopMargin);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_margin_top, (float)bodyTopMargin);
}
}
// bottommargin (IE-attribute)
if (bodyMarginHeight == -1) {
value = aAttributes->GetAttr(nsGkAtoms::bottommargin);
if (value && value->Type() == nsAttrValue::eInteger) {
bodyBottomMargin = value->GetIntegerValue();
if (bodyBottomMargin < 0) {
bodyBottomMargin = 0;
}
- aData->SetPixelValueIfUnset(eCSSProperty_margin_bottom, (float)bodyBottomMargin);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_margin_bottom, (float)bodyBottomMargin);
}
}
// leftmargin (IE-attribute)
if (bodyMarginWidth == -1) {
value = aAttributes->GetAttr(nsGkAtoms::leftmargin);
if (value && value->Type() == nsAttrValue::eInteger) {
bodyLeftMargin = value->GetIntegerValue();
if (bodyLeftMargin < 0) {
bodyLeftMargin = 0;
}
- aData->SetPixelValueIfUnset(eCSSProperty_margin_left, (float)bodyLeftMargin);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_margin_left, (float)bodyLeftMargin);
}
}
// rightmargin (IE-attribute)
if (bodyMarginWidth == -1) {
value = aAttributes->GetAttr(nsGkAtoms::rightmargin);
if (value && value->Type() == nsAttrValue::eInteger) {
bodyRightMargin = value->GetIntegerValue();
if (bodyRightMargin < 0) {
bodyRightMargin = 0;
}
- aData->SetPixelValueIfUnset(eCSSProperty_margin_right, (float)bodyRightMargin);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_margin_right, (float)bodyRightMargin);
}
}
// if marginwidth or marginheight is set in the <frame> and not set in the <body>
// reflect them as margin in the <body>
if (bodyMarginWidth == -1 || bodyMarginHeight == -1) {
nsCOMPtr<nsIDocShell> docShell(aData->Document()->GetDocShell());
if (docShell) {
nscoord frameMarginWidth=-1; // default value
nscoord frameMarginHeight=-1; // default value
docShell->GetMarginWidth(&frameMarginWidth); // -1 indicates not set
docShell->GetMarginHeight(&frameMarginHeight);
if (bodyMarginWidth == -1 && frameMarginWidth >= 0) {
if (bodyLeftMargin == -1) {
- aData->SetPixelValueIfUnset(eCSSProperty_margin_left, (float)frameMarginWidth);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_margin_left, (float)frameMarginWidth);
}
if (bodyRightMargin == -1) {
- aData->SetPixelValueIfUnset(eCSSProperty_margin_right, (float)frameMarginWidth);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_margin_right, (float)frameMarginWidth);
}
}
if (bodyMarginHeight == -1 && frameMarginHeight >= 0) {
if (bodyTopMargin == -1) {
- aData->SetPixelValueIfUnset(eCSSProperty_margin_top, (float)frameMarginHeight);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_margin_top, (float)frameMarginHeight);
}
if (bodyBottomMargin == -1) {
- aData->SetPixelValueIfUnset(eCSSProperty_margin_bottom, (float)frameMarginHeight);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_margin_bottom, (float)frameMarginHeight);
}
}
}
}
// When display if first asked for, go ahead and get our colors set up.
if (nsHTMLStyleSheet* styleSheet = aData->Document()->GetAttributeStyleSheet()) {
nscolor color;
@@ -209,17 +209,17 @@ HTMLBodyElement::MapAttributesIntoRule(c
}
}
if (!aData->PropertyIsSet(eCSSProperty_color)) {
// color: color
nscolor color;
value = aAttributes->GetAttr(nsGkAtoms::text);
if (value && value->GetColorValue(color)) {
- aData->SetColorValue(eCSSProperty_color, color);
+ aDecls.SetColorValue(eCSSProperty_color, color);
}
}
nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aDecls);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aDecls);
}
nsMapRuleToAttributesFunc
--- a/dom/html/HTMLFontElement.cpp
+++ b/dom/html/HTMLFontElement.cpp
@@ -57,41 +57,41 @@ void
HTMLFontElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
// face: string list
if (!aData->PropertyIsSet(eCSSProperty_font_family)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::face);
if (value && value->Type() == nsAttrValue::eString &&
!value->IsEmptyString()) {
- aData->SetFontFamily(value->GetStringValue());
+ aDecls.SetFontFamily(value->GetStringValue());
}
}
// size: int
if (!aData->PropertyIsSet(eCSSProperty_font_size)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::size);
if (value && value->Type() == nsAttrValue::eInteger)
- aData->SetKeywordValue(eCSSProperty_font_size, value->GetIntegerValue());
+ aDecls.SetKeywordValue(eCSSProperty_font_size, value->GetIntegerValue());
}
if (!aData->PropertyIsSet(eCSSProperty_color)) {
// color: color
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::color);
nscolor color;
if (value && value->GetColorValue(color)) {
- aData->SetColorValue(eCSSProperty_color, color);
+ aDecls.SetColorValue(eCSSProperty_color, color);
}
}
if (aData->Document()->GetCompatibilityMode() == eCompatibility_NavQuirks) {
// Make <a><font color="red">text</font></a> give the text a red underline
// in quirks mode. The NS_STYLE_TEXT_DECORATION_LINE_OVERRIDE_ALL flag only
// affects quirks mode rendering.
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::color);
nscolor color;
if (value && value->GetColorValue(color)) {
- aData->SetTextDecorationColorOverride();
+ aDecls.SetTextDecorationColorOverride();
}
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aDecls);
}
NS_IMETHODIMP_(bool)
HTMLFontElement::IsAttributeMapped(const nsAtom* aAttribute) const
--- a/dom/html/HTMLHRElement.cpp
+++ b/dom/html/HTMLHRElement.cpp
@@ -76,42 +76,42 @@ HTMLHRElement::MapAttributesIntoRule(con
}
// align: enum
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::align);
if (value && value->Type() == nsAttrValue::eEnum) {
// Map align attribute into auto side margins
switch (value->GetEnumValue()) {
case NS_STYLE_TEXT_ALIGN_LEFT:
- aData->SetPixelValueIfUnset(eCSSProperty_margin_left, 0.0f);
- aData->SetAutoValueIfUnset(eCSSProperty_margin_right);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_margin_left, 0.0f);
+ aDecls.SetAutoValueIfUnset(eCSSProperty_margin_right);
break;
case NS_STYLE_TEXT_ALIGN_RIGHT:
- aData->SetAutoValueIfUnset(eCSSProperty_margin_left);
- aData->SetPixelValueIfUnset(eCSSProperty_margin_right, 0.0f);
+ aDecls.SetAutoValueIfUnset(eCSSProperty_margin_left);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_margin_right, 0.0f);
break;
case NS_STYLE_TEXT_ALIGN_CENTER:
- aData->SetAutoValueIfUnset(eCSSProperty_margin_left);
- aData->SetAutoValueIfUnset(eCSSProperty_margin_right);
+ aDecls.SetAutoValueIfUnset(eCSSProperty_margin_left);
+ aDecls.SetAutoValueIfUnset(eCSSProperty_margin_right);
break;
}
}
if (!aData->PropertyIsSet(eCSSProperty_height)) {
// size: integer
if (noshade) {
// noshade case: size is set using the border
- aData->SetAutoValue(eCSSProperty_height);
+ 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
// removing all but the top border.
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::size);
if (value && value->Type() == nsAttrValue::eInteger) {
- aData->SetPixelValue(eCSSProperty_height, (float)value->GetIntegerValue());
+ aDecls.SetPixelValue(eCSSProperty_height, (float)value->GetIntegerValue());
} // else use default value from html.css
}
}
// if not noshade, border styles are dealt with by html.css
if (noshade) {
// size: integer
// if a size is set, use half of it per side, otherwise, use 1px per side
@@ -125,49 +125,49 @@ HTMLHRElement::MapAttributesIntoRule(con
// subpixel borders should be removed.
// In the meantime, this makes http://www.microsoft.com/ look right.
sizePerSide = 1.0f;
allSides = false;
}
} else {
sizePerSide = 1.0f; // default to a 2px high line
}
- aData->SetPixelValueIfUnset(eCSSProperty_border_top_width, sizePerSide);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_border_top_width, sizePerSide);
if (allSides) {
- aData->SetPixelValueIfUnset(eCSSProperty_border_right_width, sizePerSide);
- aData->SetPixelValueIfUnset(eCSSProperty_border_bottom_width, sizePerSide);
- aData->SetPixelValueIfUnset(eCSSProperty_border_left_width, sizePerSide);
+ 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))
- aData->SetKeywordValue(eCSSProperty_border_top_style,
+ aDecls.SetKeywordValue(eCSSProperty_border_top_style,
NS_STYLE_BORDER_STYLE_SOLID);
if (allSides) {
- aData->SetKeywordValueIfUnset(eCSSProperty_border_right_style,
+ aDecls.SetKeywordValueIfUnset(eCSSProperty_border_right_style,
NS_STYLE_BORDER_STYLE_SOLID);
- aData->SetKeywordValueIfUnset(eCSSProperty_border_bottom_style,
+ aDecls.SetKeywordValueIfUnset(eCSSProperty_border_bottom_style,
NS_STYLE_BORDER_STYLE_SOLID);
- aData->SetKeywordValueIfUnset(eCSSProperty_border_left_style,
+ aDecls.SetKeywordValueIfUnset(eCSSProperty_border_left_style,
NS_STYLE_BORDER_STYLE_SOLID);
// If it would be noticeable, set the border radius to
// 10000px on all corners; this triggers the clamping to make
// circular ends. This assumes the <hr> isn't larger than
// that in *both* dimensions.
for (const nsCSSPropertyID* props =
nsCSSProps::SubpropertyEntryFor(eCSSProperty_border_radius);
*props != eCSSProperty_UNKNOWN; ++props) {
- aData->SetPixelValueIfUnset(*props, 10000.0f);
+ aDecls.SetPixelValueIfUnset(*props, 10000.0f);
}
}
}
// color: a color
// (we got the color attribute earlier)
if (colorIsSet) {
- aData->SetColorValueIfUnset(eCSSProperty_color, color);
+ aDecls.SetColorValueIfUnset(eCSSProperty_color, color);
}
nsGenericHTMLElement::MapWidthAttributeInto(aAttributes, aDecls);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aDecls);
}
NS_IMETHODIMP_(bool)
HTMLHRElement::IsAttributeMapped(const nsAtom* aAttribute) const
--- a/dom/html/HTMLIFrameElement.cpp
+++ b/dom/html/HTMLIFrameElement.cpp
@@ -88,20 +88,20 @@ HTMLIFrameElement::MapAttributesIntoRule
// If frameborder is 0 or No, set border to 0
// else leave it as the value set in html.css
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::frameborder);
if (value && value->Type() == nsAttrValue::eEnum) {
int32_t frameborder = value->GetEnumValue();
if (NS_STYLE_FRAME_0 == frameborder ||
NS_STYLE_FRAME_NO == frameborder ||
NS_STYLE_FRAME_OFF == frameborder) {
- aData->SetPixelValueIfUnset(eCSSProperty_border_top_width, 0.0f);
- aData->SetPixelValueIfUnset(eCSSProperty_border_right_width, 0.0f);
- aData->SetPixelValueIfUnset(eCSSProperty_border_bottom_width, 0.0f);
- aData->SetPixelValueIfUnset(eCSSProperty_border_left_width, 0.0f);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_border_top_width, 0.0f);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_border_right_width, 0.0f);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_border_bottom_width, 0.0f);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_border_left_width, 0.0f);
}
}
nsGenericHTMLElement::MapImageSizeAttributesInto(aAttributes, aDecls);
nsGenericHTMLElement::MapImageAlignAttributeInto(aAttributes, aDecls);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aDecls);
}
--- a/dom/html/HTMLLIElement.cpp
+++ b/dom/html/HTMLLIElement.cpp
@@ -68,17 +68,17 @@ HTMLLIElement::ParseAttribute(int32_t aN
void
HTMLLIElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
if (!aData->PropertyIsSet(eCSSProperty_list_style_type)) {
// type: enum
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::type);
if (value && value->Type() == nsAttrValue::eEnum)
- aData->SetKeywordValue(eCSSProperty_list_style_type, value->GetEnumValue());
+ aDecls.SetKeywordValue(eCSSProperty_list_style_type, value->GetEnumValue());
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aDecls);
}
NS_IMETHODIMP_(bool)
HTMLLIElement::IsAttributeMapped(const nsAtom* aAttribute) const
{
--- a/dom/html/HTMLPreElement.cpp
+++ b/dom/html/HTMLPreElement.cpp
@@ -43,17 +43,17 @@ HTMLPreElement::ParseAttribute(int32_t a
void
HTMLPreElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
if (!aData->PropertyIsSet(eCSSProperty_white_space)) {
// wrap: empty
if (aAttributes->GetAttr(nsGkAtoms::wrap))
- aData->SetKeywordValue(eCSSProperty_white_space, StyleWhiteSpace::PreWrap);
+ aDecls.SetKeywordValue(eCSSProperty_white_space, StyleWhiteSpace::PreWrap);
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aDecls);
}
NS_IMETHODIMP_(bool)
HTMLPreElement::IsAttributeMapped(const nsAtom* aAttribute) const
{
--- a/dom/html/HTMLSharedElement.cpp
+++ b/dom/html/HTMLSharedElement.cpp
@@ -81,19 +81,19 @@ static void
DirectoryMapAttributesIntoRule(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
if (!aData->PropertyIsSet(eCSSProperty_list_style_type)) {
// type: enum
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::type);
if (value) {
if (value->Type() == nsAttrValue::eEnum) {
- aData->SetKeywordValue(eCSSProperty_list_style_type, value->GetEnumValue());
+ aDecls.SetKeywordValue(eCSSProperty_list_style_type, value->GetEnumValue());
} else {
- aData->SetKeywordValue(eCSSProperty_list_style_type, NS_STYLE_LIST_STYLE_DISC);
+ aDecls.SetKeywordValue(eCSSProperty_list_style_type, NS_STYLE_LIST_STYLE_DISC);
}
}
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aDecls);
}
NS_IMETHODIMP_(bool)
--- a/dom/html/HTMLSharedListElement.cpp
+++ b/dom/html/HTMLSharedListElement.cpp
@@ -82,17 +82,17 @@ HTMLSharedListElement::ParseAttribute(in
void
HTMLSharedListElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
if (!aData->PropertyIsSet(eCSSProperty_list_style_type)) {
// type: enum
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::type);
if (value && value->Type() == nsAttrValue::eEnum) {
- aData->SetKeywordValue(eCSSProperty_list_style_type, value->GetEnumValue());
+ aDecls.SetKeywordValue(eCSSProperty_list_style_type, value->GetEnumValue());
}
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aDecls);
}
NS_IMETHODIMP_(bool)
HTMLSharedListElement::IsAttributeMapped(const nsAtom* aAttribute) const
--- a/dom/html/HTMLTableCaptionElement.cpp
+++ b/dom/html/HTMLTableCaptionElement.cpp
@@ -53,17 +53,17 @@ HTMLTableCaptionElement::ParseAttribute(
void
HTMLTableCaptionElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
if (!aData->PropertyIsSet(eCSSProperty_caption_side)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::align);
if (value && value->Type() == nsAttrValue::eEnum)
- aData->SetKeywordValue(eCSSProperty_caption_side, value->GetEnumValue());
+ aDecls.SetKeywordValue(eCSSProperty_caption_side, value->GetEnumValue());
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aDecls);
}
NS_IMETHODIMP_(bool)
HTMLTableCaptionElement::IsAttributeMapped(const nsAtom* aAttribute) const
{
--- a/dom/html/HTMLTableCellElement.cpp
+++ b/dom/html/HTMLTableCellElement.cpp
@@ -185,49 +185,49 @@ void
HTMLTableCellElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
// width: value
if (!aData->PropertyIsSet(eCSSProperty_width)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::width);
if (value && value->Type() == nsAttrValue::eInteger) {
if (value->GetIntegerValue() > 0)
- aData->SetPixelValue(eCSSProperty_width, (float)value->GetIntegerValue());
+ 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)
- aData->SetPercentValue(eCSSProperty_width, value->GetPercentValue());
+ aDecls.SetPercentValue(eCSSProperty_width, value->GetPercentValue());
// else 0 implies auto for compatibility
}
}
// height: value
if (!aData->PropertyIsSet(eCSSProperty_height)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::height);
if (value && value->Type() == nsAttrValue::eInteger) {
if (value->GetIntegerValue() > 0)
- aData->SetPixelValue(eCSSProperty_height, (float)value->GetIntegerValue());
+ 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)
- aData->SetPercentValue(eCSSProperty_height, value->GetPercentValue());
+ aDecls.SetPercentValue(eCSSProperty_height, value->GetPercentValue());
// else 0 implies auto for compatibility
}
}
if (!aData->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) {
- aData->SetKeywordValue(eCSSProperty_white_space, StyleWhiteSpace::Nowrap);
+ aDecls.SetKeywordValue(eCSSProperty_white_space, StyleWhiteSpace::Nowrap);
}
}
}
nsGenericHTMLElement::MapDivAlignAttributeInto(aAttributes, aDecls);
nsGenericHTMLElement::MapVAlignAttributeInto(aAttributes, aDecls);
nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aDecls);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aDecls);
--- a/dom/html/HTMLTableColElement.cpp
+++ b/dom/html/HTMLTableColElement.cpp
@@ -71,17 +71,17 @@ HTMLTableColElement::MapAttributesIntoRu
// 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) {
- aData->SetIntValue(eCSSProperty__x_span, value->GetIntegerValue());
+ aDecls.SetIntValue(eCSSProperty__x_span, value->GetIntegerValue());
}
}
}
nsGenericHTMLElement::MapWidthAttributeInto(aAttributes, aDecls);
nsGenericHTMLElement::MapDivAlignAttributeInto(aAttributes, aDecls);
nsGenericHTMLElement::MapVAlignAttributeInto(aAttributes, aDecls);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aDecls);
--- a/dom/html/HTMLTableElement.cpp
+++ b/dom/html/HTMLTableElement.cpp
@@ -945,71 +945,71 @@ HTMLTableElement::MapAttributesIntoRule(
// 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)) {
- aData->SetPixelValue(eCSSProperty_border_spacing, float(value->GetIntegerValue()));
+ 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) {
- aData->SetAutoValueIfUnset(eCSSProperty_margin_left);
- aData->SetAutoValueIfUnset(eCSSProperty_margin_right);
+ aDecls.SetAutoValueIfUnset(eCSSProperty_margin_left);
+ aDecls.SetAutoValueIfUnset(eCSSProperty_margin_right);
}
}
// hspace is mapped into left and right margin,
// vspace is mapped into top and bottom margins
// - *** Quirks Mode only ***
if (eCompatibility_NavQuirks == mode) {
value = aAttributes->GetAttr(nsGkAtoms::hspace);
if (value && value->Type() == nsAttrValue::eInteger) {
- aData->SetPixelValueIfUnset(eCSSProperty_margin_left, (float)value->GetIntegerValue());
- aData->SetPixelValueIfUnset(eCSSProperty_margin_right, (float)value->GetIntegerValue());
+ aDecls.SetPixelValueIfUnset(eCSSProperty_margin_left, (float)value->GetIntegerValue());
+ aDecls.SetPixelValueIfUnset(eCSSProperty_margin_right, (float)value->GetIntegerValue());
}
value = aAttributes->GetAttr(nsGkAtoms::vspace);
if (value && value->Type() == nsAttrValue::eInteger) {
- aData->SetPixelValueIfUnset(eCSSProperty_margin_top, (float)value->GetIntegerValue());
- aData->SetPixelValueIfUnset(eCSSProperty_margin_bottom, (float)value->GetIntegerValue());
+ aDecls.SetPixelValueIfUnset(eCSSProperty_margin_top, (float)value->GetIntegerValue());
+ aDecls.SetPixelValueIfUnset(eCSSProperty_margin_bottom, (float)value->GetIntegerValue());
}
}
// bordercolor
value = aAttributes->GetAttr(nsGkAtoms::bordercolor);
nscolor color;
if (value && value->GetColorValue(color)) {
- aData->SetColorValueIfUnset(eCSSProperty_border_top_color, color);
- aData->SetColorValueIfUnset(eCSSProperty_border_left_color, color);
- aData->SetColorValueIfUnset(eCSSProperty_border_bottom_color, color);
- aData->SetColorValueIfUnset(eCSSProperty_border_right_color, color);
+ aDecls.SetColorValueIfUnset(eCSSProperty_border_top_color, color);
+ aDecls.SetColorValueIfUnset(eCSSProperty_border_left_color, color);
+ aDecls.SetColorValueIfUnset(eCSSProperty_border_bottom_color, color);
+ aDecls.SetColorValueIfUnset(eCSSProperty_border_right_color, color);
}
// border
const nsAttrValue* borderValue = aAttributes->GetAttr(nsGkAtoms::border);
if (borderValue) {
// border = 1 pixel default
int32_t borderThickness = 1;
if (borderValue->Type() == nsAttrValue::eInteger)
borderThickness = borderValue->GetIntegerValue();
// by default, set all border sides to the specified width
- aData->SetPixelValueIfUnset(eCSSProperty_border_top_width, (float)borderThickness);
- aData->SetPixelValueIfUnset(eCSSProperty_border_left_width, (float)borderThickness);
- aData->SetPixelValueIfUnset(eCSSProperty_border_bottom_width, (float)borderThickness);
- aData->SetPixelValueIfUnset(eCSSProperty_border_right_width, (float)borderThickness);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_border_top_width, (float)borderThickness);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_border_left_width, (float)borderThickness);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_border_bottom_width, (float)borderThickness);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_border_right_width, (float)borderThickness);
}
nsGenericHTMLElement::MapImageSizeAttributesInto(aAttributes, aDecls);
nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aDecls);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aDecls);
}
NS_IMETHODIMP_(bool)
@@ -1050,20 +1050,20 @@ MapInheritedTableAttributesIntoRule(cons
MappedDeclarations& aDecls)
{
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::cellpadding);
if (value && value->Type() == nsAttrValue::eInteger) {
// We have cellpadding. This will override our padding values if we
// don't have any set.
float pad = float(value->GetIntegerValue());
- aData->SetPixelValueIfUnset(eCSSProperty_padding_top, pad);
- aData->SetPixelValueIfUnset(eCSSProperty_padding_right, pad);
- aData->SetPixelValueIfUnset(eCSSProperty_padding_bottom, pad);
- aData->SetPixelValueIfUnset(eCSSProperty_padding_left, pad);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_padding_top, pad);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_padding_right, pad);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_padding_bottom, pad);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_padding_left, pad);
}
}
nsMappedAttributes*
HTMLTableElement::GetAttributesMappedForCell()
{
return mTableInheritedAttributes;
}
--- a/dom/html/HTMLTableSectionElement.cpp
+++ b/dom/html/HTMLTableSectionElement.cpp
@@ -164,17 +164,17 @@ HTMLTableSectionElement::ParseAttribute(
void
HTMLTableSectionElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
// height: value
if (!aData->PropertyIsSet(eCSSProperty_height)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::height);
if (value && value->Type() == nsAttrValue::eInteger)
- aData->SetPixelValue(eCSSProperty_height, (float)value->GetIntegerValue());
+ aDecls.SetPixelValue(eCSSProperty_height, (float)value->GetIntegerValue());
}
nsGenericHTMLElement::MapDivAlignAttributeInto(aAttributes, aDecls);
nsGenericHTMLElement::MapVAlignAttributeInto(aAttributes, aDecls);
nsGenericHTMLElement::MapBackgroundAttributesInto(aAttributes, aDecls);
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aDecls);
}
NS_IMETHODIMP_(bool)
--- a/dom/html/HTMLTextAreaElement.cpp
+++ b/dom/html/HTMLTextAreaElement.cpp
@@ -429,17 +429,17 @@ void
HTMLTextAreaElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
// wrap=off
if (!aData->PropertyIsSet(eCSSProperty_white_space)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::wrap);
if (value && value->Type() == nsAttrValue::eString &&
value->Equals(nsGkAtoms::OFF, eIgnoreCase)) {
- aData->SetKeywordValue(eCSSProperty_white_space, StyleWhiteSpace::Pre);
+ aDecls.SetKeywordValue(eCSSProperty_white_space, StyleWhiteSpace::Pre);
}
}
nsGenericHTMLFormElementWithState::MapDivAlignAttributeInto(aAttributes, aDecls);
nsGenericHTMLFormElementWithState::MapCommonAttributesInto(aAttributes, aDecls);
}
nsChangeHint
--- a/dom/html/nsGenericHTMLElement.cpp
+++ b/dom/html/nsGenericHTMLElement.cpp
@@ -1164,28 +1164,28 @@ nsGenericHTMLElement::ParseScrollingValu
static inline void
MapLangAttributeInto(const nsMappedAttributes* aAttributes, MappedDeclarations& aDecls)
{
const nsAttrValue* langValue = aAttributes->GetAttr(nsGkAtoms::lang);
if (!langValue) {
return;
}
MOZ_ASSERT(langValue->Type() == nsAttrValue::eAtom);
- aData->SetIdentAtomValueIfUnset(eCSSProperty__x_lang,
+ aDecls.SetIdentAtomValueIfUnset(eCSSProperty__x_lang,
langValue->GetAtomValue());
if (!aData->PropertyIsSet(eCSSProperty_text_emphasis_position)) {
const nsAtom* lang = langValue->GetAtomValue();
if (nsStyleUtil::MatchesLanguagePrefix(lang, u"zh")) {
- aData->SetKeywordValue(eCSSProperty_text_emphasis_position,
+ 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.
- aData->SetKeywordValue(eCSSProperty_text_emphasis_position,
+ aDecls.SetKeywordValue(eCSSProperty_text_emphasis_position,
NS_STYLE_TEXT_EMPHASIS_POSITION_DEFAULT);
}
}
}
/**
* Handle attributes common to all html elements
*/
@@ -1194,38 +1194,38 @@ nsGenericHTMLElement::MapCommonAttribute
MappedDeclarations& aDecls)
{
if (!aData->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)) {
- aData->SetKeywordValue(eCSSProperty__moz_user_modify,
+ aDecls.SetKeywordValue(eCSSProperty__moz_user_modify,
StyleUserModify::ReadWrite);
}
else if (value->Equals(nsGkAtoms::_false, eIgnoreCase)) {
- aData->SetKeywordValue(eCSSProperty__moz_user_modify,
+ aDecls.SetKeywordValue(eCSSProperty__moz_user_modify,
StyleUserModify::ReadOnly);
}
}
}
MapLangAttributeInto(aAttributes, aDecls);
}
void
nsGenericHTMLElement::MapCommonAttributesInto(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
MapCommonAttributesIntoExceptHidden(aAttributes, aDecls);
if (!aData->PropertyIsSet(eCSSProperty_display)) {
if (aAttributes->IndexOfAttr(nsGkAtoms::hidden) >= 0) {
- aData->SetKeywordValue(eCSSProperty_display, StyleDisplay::None);
+ aDecls.SetKeywordValue(eCSSProperty_display, StyleDisplay::None);
}
}
}
/* static */ const nsGenericHTMLElement::MappedAttributeEntry
nsGenericHTMLElement::sCommonAttributeMap[] = {
{ &nsGkAtoms::contenteditable },
{ &nsGkAtoms::lang },
@@ -1277,126 +1277,126 @@ 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 (align == NS_STYLE_TEXT_ALIGN_LEFT) {
- aData->SetKeywordValue(eCSSProperty_float, StyleFloat::Left);
+ aDecls.SetKeywordValue(eCSSProperty_float, StyleFloat::Left);
} else if (align == NS_STYLE_TEXT_ALIGN_RIGHT) {
- aData->SetKeywordValue(eCSSProperty_float, StyleFloat::Right);
+ aDecls.SetKeywordValue(eCSSProperty_float, StyleFloat::Right);
}
}
if (!aData->PropertyIsSet(eCSSProperty_vertical_align)) {
switch (align) {
case NS_STYLE_TEXT_ALIGN_LEFT:
case NS_STYLE_TEXT_ALIGN_RIGHT:
break;
default:
- aData->SetKeywordValue(eCSSProperty_vertical_align, align);
+ aDecls.SetKeywordValue(eCSSProperty_vertical_align, align);
break;
}
}
}
}
void
nsGenericHTMLElement::MapDivAlignAttributeInto(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
if (!aData->PropertyIsSet(eCSSProperty_text_align)) {
// align: enum
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::align);
if (value && value->Type() == nsAttrValue::eEnum)
- aData->SetKeywordValue(eCSSProperty_text_align, value->GetEnumValue());
+ aDecls.SetKeywordValue(eCSSProperty_text_align, value->GetEnumValue());
}
}
void
nsGenericHTMLElement::MapVAlignAttributeInto(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
if (!aData->PropertyIsSet(eCSSProperty_vertical_align)) {
// align: enum
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::valign);
if (value && value->Type() == nsAttrValue::eEnum)
- aData->SetKeywordValue(eCSSProperty_vertical_align, value->GetEnumValue());
+ aDecls.SetKeywordValue(eCSSProperty_vertical_align, value->GetEnumValue());
}
}
void
nsGenericHTMLElement::MapImageMarginAttributeInto(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
const nsAttrValue* value;
// hspace: value
value = aAttributes->GetAttr(nsGkAtoms::hspace);
if (value) {
if (value->Type() == nsAttrValue::eInteger) {
- aData->SetPixelValueIfUnset(eCSSProperty_margin_left,
+ aDecls.SetPixelValueIfUnset(eCSSProperty_margin_left,
(float)value->GetIntegerValue());
- aData->SetPixelValueIfUnset(eCSSProperty_margin_right,
+ aDecls.SetPixelValueIfUnset(eCSSProperty_margin_right,
(float)value->GetIntegerValue());
} else if (value->Type() == nsAttrValue::ePercent) {
- aData->SetPercentValueIfUnset(eCSSProperty_margin_left,
+ aDecls.SetPercentValueIfUnset(eCSSProperty_margin_left,
value->GetPercentValue());
- aData->SetPercentValueIfUnset(eCSSProperty_margin_right,
+ aDecls.SetPercentValueIfUnset(eCSSProperty_margin_right,
value->GetPercentValue());
}
}
// vspace: value
value = aAttributes->GetAttr(nsGkAtoms::vspace);
if (value) {
if (value->Type() == nsAttrValue::eInteger) {
- aData->SetPixelValueIfUnset(eCSSProperty_margin_top,
+ aDecls.SetPixelValueIfUnset(eCSSProperty_margin_top,
(float)value->GetIntegerValue());
- aData->SetPixelValueIfUnset(eCSSProperty_margin_bottom,
+ aDecls.SetPixelValueIfUnset(eCSSProperty_margin_bottom,
(float)value->GetIntegerValue());
} else if (value->Type() == nsAttrValue::ePercent) {
- aData->SetPercentValueIfUnset(eCSSProperty_margin_top,
+ aDecls.SetPercentValueIfUnset(eCSSProperty_margin_top,
value->GetPercentValue());
- aData->SetPercentValueIfUnset(eCSSProperty_margin_bottom,
+ aDecls.SetPercentValueIfUnset(eCSSProperty_margin_bottom,
value->GetPercentValue());
}
}
}
void
nsGenericHTMLElement::MapWidthAttributeInto(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
// width: value
if (!aData->PropertyIsSet(eCSSProperty_width)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::width);
if (value && value->Type() == nsAttrValue::eInteger) {
- aData->SetPixelValue(eCSSProperty_width,
+ aDecls.SetPixelValue(eCSSProperty_width,
(float)value->GetIntegerValue());
} else if (value && value->Type() == nsAttrValue::ePercent) {
- aData->SetPercentValue(eCSSProperty_width,
+ aDecls.SetPercentValue(eCSSProperty_width,
value->GetPercentValue());
}
}
}
void
nsGenericHTMLElement::MapHeightAttributeInto(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
// height: value
if (!aData->PropertyIsSet(eCSSProperty_height)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::height);
if (value && value->Type() == nsAttrValue::eInteger) {
- aData->SetPixelValue(eCSSProperty_height,
+ aDecls.SetPixelValue(eCSSProperty_height,
(float)value->GetIntegerValue());
} else if (value && value->Type() == nsAttrValue::ePercent) {
- aData->SetPercentValue(eCSSProperty_height,
+ aDecls.SetPercentValue(eCSSProperty_height,
value->GetPercentValue());
}
}
}
void
nsGenericHTMLElement::MapImageSizeAttributesInto(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
@@ -1413,60 +1413,60 @@ nsGenericHTMLElement::MapImageBorderAttr
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::border);
if (!value)
return;
nscoord val = 0;
if (value->Type() == nsAttrValue::eInteger)
val = value->GetIntegerValue();
- aData->SetPixelValueIfUnset(eCSSProperty_border_top_width, (float)val);
- aData->SetPixelValueIfUnset(eCSSProperty_border_right_width, (float)val);
- aData->SetPixelValueIfUnset(eCSSProperty_border_bottom_width, (float)val);
- aData->SetPixelValueIfUnset(eCSSProperty_border_left_width, (float)val);
-
- aData->SetKeywordValueIfUnset(eCSSProperty_border_top_style,
+ aDecls.SetPixelValueIfUnset(eCSSProperty_border_top_width, (float)val);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_border_right_width, (float)val);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_border_bottom_width, (float)val);
+ aDecls.SetPixelValueIfUnset(eCSSProperty_border_left_width, (float)val);
+
+ aDecls.SetKeywordValueIfUnset(eCSSProperty_border_top_style,
NS_STYLE_BORDER_STYLE_SOLID);
- aData->SetKeywordValueIfUnset(eCSSProperty_border_right_style,
+ aDecls.SetKeywordValueIfUnset(eCSSProperty_border_right_style,
NS_STYLE_BORDER_STYLE_SOLID);
- aData->SetKeywordValueIfUnset(eCSSProperty_border_bottom_style,
+ aDecls.SetKeywordValueIfUnset(eCSSProperty_border_bottom_style,
NS_STYLE_BORDER_STYLE_SOLID);
- aData->SetKeywordValueIfUnset(eCSSProperty_border_left_style,
+ aDecls.SetKeywordValueIfUnset(eCSSProperty_border_left_style,
NS_STYLE_BORDER_STYLE_SOLID);
- aData->SetCurrentColorIfUnset(eCSSProperty_border_top_color);
- aData->SetCurrentColorIfUnset(eCSSProperty_border_right_color);
- aData->SetCurrentColorIfUnset(eCSSProperty_border_bottom_color);
- aData->SetCurrentColorIfUnset(eCSSProperty_border_left_color);
+ aDecls.SetCurrentColorIfUnset(eCSSProperty_border_top_color);
+ aDecls.SetCurrentColorIfUnset(eCSSProperty_border_right_color);
+ aDecls.SetCurrentColorIfUnset(eCSSProperty_border_bottom_color);
+ aDecls.SetCurrentColorIfUnset(eCSSProperty_border_left_color);
}
void
nsGenericHTMLElement::MapBackgroundInto(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
if (!aData->PropertyIsSet(eCSSProperty_background_image)) {
// background
nsAttrValue* value =
const_cast<nsAttrValue*>(aAttributes->GetAttr(nsGkAtoms::background));
if (value) {
- aData->SetBackgroundImage(*value);
+ aDecls.SetBackgroundImage(*value);
}
}
}
void
nsGenericHTMLElement::MapBGColorInto(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
if (!aData->PropertyIsSet(eCSSProperty_background_color)) {
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::bgcolor);
nscolor color;
if (value && value->GetColorValue(color)) {
- aData->SetColorValue(eCSSProperty_background_color, color);
+ aDecls.SetColorValue(eCSSProperty_background_color, color);
}
}
}
void
nsGenericHTMLElement::MapBackgroundAttributesInto(const nsMappedAttributes* aAttributes,
MappedDeclarations& aDecls)
{
--- a/dom/mathml/nsMathMLElement.cpp
+++ b/dom/mathml/nsMathMLElement.cpp
@@ -517,17 +517,17 @@ nsMathMLElement::MapMathMLAttributesInto
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) {
- aData->SetNumberValue(eCSSProperty__moz_script_size_multiplier, floatValue);
+ aDecls.SetNumberValue(eCSSProperty__moz_script_size_multiplier, floatValue);
} else {
ReportParseErrorNoTag(str,
nsGkAtoms::scriptsizemultiplier_,
aData->Document());
}
}
}
@@ -550,17 +550,17 @@ nsMathMLElement::MapMathMLAttributesInto
PARSE_ALLOW_UNITLESS | CONVERT_UNITLESS_TO_PERCENT,
aData->Document());
if (scriptMinSize.GetUnit() == eCSSUnit_Percent) {
scriptMinSize.SetFloatValue(8.0 * scriptMinSize.GetPercentValue(),
eCSSUnit_Point);
}
if (scriptMinSize.GetUnit() != eCSSUnit_Null) {
- aData->SetLengthValue(eCSSProperty__moz_script_min_size, scriptMinSize);
+ aDecls.SetLengthValue(eCSSProperty__moz_script_min_size, scriptMinSize);
}
}
// scriptlevel
//
// "Changes the scriptlevel in effect for the children. When the value is
// given without a sign, it sets scriptlevel to the specified value; when a
// sign is given, it increments ("+") or decrements ("-") the current
@@ -580,19 +580,19 @@ nsMathMLElement::MapMathMLAttributesInto
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
// Integer to indicate that. Otherwise we store it as a Number
// to indicate that the scriptlevel is absolute.
char16_t ch = str.CharAt(0);
if (ch == '+' || ch == '-') {
- aData->SetIntValue(eCSSProperty__moz_script_level, intValue);
+ aDecls.SetIntValue(eCSSProperty__moz_script_level, intValue);
} else {
- aData->SetNumberValue(eCSSProperty__moz_script_level, intValue);
+ aDecls.SetNumberValue(eCSSProperty__moz_script_level, intValue);
}
} else {
ReportParseErrorNoTag(str,
nsGkAtoms::scriptlevel_,
aData->Document());
}
}
}
@@ -640,25 +640,25 @@ nsMathMLElement::MapMathMLAttributesInto
static const char sizes[3][7] = { "small", "normal", "big" };
static const int32_t values[MOZ_ARRAY_LENGTH(sizes)] = {
NS_STYLE_FONT_SIZE_SMALL, NS_STYLE_FONT_SIZE_MEDIUM,
NS_STYLE_FONT_SIZE_LARGE
};
str.CompressWhitespace();
for (uint32_t i = 0; i < ArrayLength(sizes); ++i) {
if (str.EqualsASCII(sizes[i])) {
- aData->SetKeywordValue(eCSSProperty_font_size, values[i]);
+ aDecls.SetKeywordValue(eCSSProperty_font_size, values[i]);
break;
}
}
} else if (fontSize.GetUnit() == eCSSUnit_Percent) {
- aData->SetPercentValue(eCSSProperty_font_size,
+ aDecls.SetPercentValue(eCSSProperty_font_size,
fontSize.GetPercentValue());
} else if (fontSize.GetUnit() != eCSSUnit_Null) {
- aData->SetLengthValue(eCSSProperty_font_size, fontSize);
+ aDecls.SetLengthValue(eCSSProperty_font_size, fontSize);
}
}
// fontfamily
//
// "Should be the name of a font that may be available to a MathML renderer,
// or a CSS font specification; See Section 6.5 Using CSS with MathML and
// CSS for more information. Deprecated in favor of mathvariant."
@@ -668,17 +668,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)) {
- aData->SetFontFamily(value->GetStringValue());
+ aDecls.SetFontFamily(value->GetStringValue());
}
// fontstyle
//
// "Specified the font style to use for the token. Deprecated in favor of
// mathvariant."
//
// values: "normal" | "italic"
@@ -693,19 +693,19 @@ nsMathMLElement::MapMathMLAttributesInto
aData->Document());
if (value->Type() == nsAttrValue::eString &&
!aData->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")) {
- aData->SetKeywordValue(eCSSProperty_font_style, NS_FONT_STYLE_NORMAL);
+ aDecls.SetKeywordValue(eCSSProperty_font_style, NS_FONT_STYLE_NORMAL);
} else if (str.EqualsASCII("italic")) {
- aData->SetKeywordValue(eCSSProperty_font_style, NS_FONT_STYLE_ITALIC);
+ aDecls.SetKeywordValue(eCSSProperty_font_style, NS_FONT_STYLE_ITALIC);
}
}
}
// fontweight
//
// "Specified the font weight for the token. Deprecated in favor of
// mathvariant."
@@ -720,20 +720,20 @@ nsMathMLElement::MapMathMLAttributesInto
WarnDeprecated(nsGkAtoms::fontweight_->GetUTF16String(),
nsGkAtoms::mathvariant_->GetUTF16String(),
aData->Document());
if (value->Type() == nsAttrValue::eString &&
!aData->PropertyIsSet(eCSSProperty_font_weight)) {
nsAutoString str(value->GetStringValue());
str.CompressWhitespace();
if (str.EqualsASCII("normal")) {
- aData->SetKeywordValue(eCSSProperty_font_weight,
+ aDecls.SetKeywordValue(eCSSProperty_font_weight,
FontWeight::Normal().ToFloat());
} else if (str.EqualsASCII("bold")) {
- aData->SetKeywordValue(eCSSProperty_font_weight,
+ aDecls.SetKeywordValue(eCSSProperty_font_weight,
FontWeight::Bold().ToFloat());
}
}
}
// mathvariant
//
// "Specifies the logical class of the token. Note that this class is more
@@ -766,17 +766,17 @@ nsMathMLElement::MapMathMLAttributesInto
NS_MATHML_MATHVARIANT_SANS_SERIF_ITALIC,
NS_MATHML_MATHVARIANT_SANS_SERIF_BOLD_ITALIC,
NS_MATHML_MATHVARIANT_MONOSPACE, NS_MATHML_MATHVARIANT_INITIAL,
NS_MATHML_MATHVARIANT_TAILED, NS_MATHML_MATHVARIANT_LOOPED,
NS_MATHML_MATHVARIANT_STRETCHED
};
for (uint32_t i = 0; i < ArrayLength(sizes); ++i) {
if (str.EqualsASCII(sizes[i])) {
- aData->SetKeywordValue(eCSSProperty__moz_math_variant, values[i]);
+ aDecls.SetKeywordValue(eCSSProperty__moz_math_variant, values[i]);
break;
}
}
}
// mathbackground
//
// "Specifies the background color to be used to fill in the bounding box of
@@ -802,17 +802,17 @@ nsMathMLElement::MapMathMLAttributesInto
WarnDeprecated(nsGkAtoms::background->GetUTF16String(),
nsGkAtoms::mathbackground_->GetUTF16String(),
aData->Document());
}
}
if (value) {
nscolor color;
if (value->GetColorValue(color)) {
- aData->SetColorValueIfUnset(eCSSProperty_background_color, color);
+ aDecls.SetColorValueIfUnset(eCSSProperty_background_color, color);
}
}
// mathcolor
//
// "Specifies the foreground color to use when drawing the components of this
// element, such as the content for token elements or any lines, surds, or
// other decorations. It also establishes the default mathcolor used for
@@ -834,17 +834,17 @@ nsMathMLElement::MapMathMLAttributesInto
if (value) {
WarnDeprecated(nsGkAtoms::color->GetUTF16String(),
nsGkAtoms::mathcolor_->GetUTF16String(),
aData->Document());
}
}
nscolor color;
if (value && value->GetColorValue(color)) {
- aData->SetColorValueIfUnset(eCSSProperty_color, color);
+ aDecls.SetColorValueIfUnset(eCSSProperty_color, color);
}
// width
//
// "Specifies the desired width of the entire table and is intended for
// visual user agents. When the value is a percentage value, the value is
// relative to the horizontal space a MathML renderer has available for the
// math element. When the value is "auto", the MathML renderer should
@@ -856,20 +856,20 @@ nsMathMLElement::MapMathMLAttributesInto
//
if (!aData->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) {
- aData->SetPercentValue(eCSSProperty_width,
+ aDecls.SetPercentValue(eCSSProperty_width,
width.GetPercentValue());
} else if (width.GetUnit() != eCSSUnit_Null) {
- aData->SetLengthValue(eCSSProperty_width, width);
+ aDecls.SetLengthValue(eCSSProperty_width, width);
}
}
}
// dir
//
// Overall Directionality of Mathematics Formulas:
// "The overall directionality for a formula, basically the direction of the
@@ -894,17 +894,17 @@ nsMathMLElement::MapMathMLAttributesInto
!aData->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])) {
- aData->SetKeywordValue(eCSSProperty_direction, dirValues[i]);
+ aDecls.SetKeywordValue(eCSSProperty_direction, dirValues[i]);
break;
}
}
}
}
void
nsMathMLElement::GetEventTargetParent(EventChainPreVisitor& aVisitor)