diff --git a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp index 2641bad03f2..e3a9436e001 100644 --- a/mozilla/content/html/content/src/nsGenericHTMLElement.cpp +++ b/mozilla/content/html/content/src/nsGenericHTMLElement.cpp @@ -3257,13 +3257,13 @@ nsGenericHTMLElement::MapImageAlignAttributeInto(const nsIHTMLMappedAttributes* aAttributes->GetAttribute(nsHTMLAtoms::align, value); if (value.GetUnit() == eHTMLUnit_Enumerated) { PRUint8 align = (PRUint8)(value.GetIntValue()); - if (aRuleData->mDisplayData && aRuleData->mDisplayData->mFloat.GetUnit() == eCSSUnit_Null) { + if (aRuleData->mSID == eStyleStruct_Display && aRuleData->mDisplayData->mFloat.GetUnit() == eCSSUnit_Null) { if (align == NS_STYLE_TEXT_ALIGN_LEFT) aRuleData->mDisplayData->mFloat.SetIntValue(NS_STYLE_FLOAT_LEFT, eCSSUnit_Enumerated); else if (align == NS_STYLE_TEXT_ALIGN_RIGHT) aRuleData->mDisplayData->mFloat.SetIntValue(NS_STYLE_FLOAT_RIGHT, eCSSUnit_Enumerated); } - else if (aRuleData->mTextData && aRuleData->mTextData->mVerticalAlign.GetUnit() == eCSSUnit_Null) { + else if (aRuleData->mSID == eStyleStruct_TextReset && aRuleData->mTextData->mVerticalAlign.GetUnit() == eCSSUnit_Null) { switch (align) { case NS_STYLE_TEXT_ALIGN_LEFT: case NS_STYLE_TEXT_ALIGN_RIGHT: @@ -3281,7 +3281,7 @@ void nsGenericHTMLElement::MapDivAlignAttributeInto(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aRuleData) { - if (aRuleData->mSID == eStyleStruct_Text && aRuleData->mTextData) { + if (aRuleData->mSID == eStyleStruct_Text) { if (aRuleData->mTextData->mTextAlign.GetUnit() == eCSSUnit_Null) { // align: enum nsHTMLValue value; @@ -3297,7 +3297,7 @@ void nsGenericHTMLElement::MapImageMarginAttributeInto(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (aData->mSID != eStyleStruct_Margin || !aData->mMarginData) + if (aData->mSID != eStyleStruct_Margin) return; nsHTMLValue value; @@ -3339,7 +3339,7 @@ void nsGenericHTMLElement::MapImageSizeAttributesInto(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aAttributes || aData->mSID != eStyleStruct_Position || !aData->mPositionData) + if (aData->mSID != eStyleStruct_Position) return; nsHTMLValue value; @@ -3367,7 +3367,7 @@ void nsGenericHTMLElement::MapImageBorderAttributeInto(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (aData->mSID != eStyleStruct_Border || !aData->mMarginData) + if (aData->mSID != eStyleStruct_Border) return; nsHTMLValue value; @@ -3417,7 +3417,7 @@ void nsGenericHTMLElement::MapBackgroundAttributesInto(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aData || !aData->mColorData || aData->mSID != eStyleStruct_Background) + if (aData->mSID != eStyleStruct_Background) return; if (aData->mColorData->mBackImage.GetUnit() == eCSSUnit_Null) { diff --git a/mozilla/content/html/content/src/nsHTMLAppletElement.cpp b/mozilla/content/html/content/src/nsHTMLAppletElement.cpp index a40b95b55ea..c1e56eaa6cf 100644 --- a/mozilla/content/html/content/src/nsHTMLAppletElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLAppletElement.cpp @@ -216,9 +216,6 @@ static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aData) - return; - nsGenericHTMLElement::MapImageBorderAttributeInto(aAttributes, aData); nsGenericHTMLElement::MapImageMarginAttributeInto(aAttributes, aData); nsGenericHTMLElement::MapImageSizeAttributesInto(aAttributes, aData); diff --git a/mozilla/content/html/content/src/nsHTMLBRElement.cpp b/mozilla/content/html/content/src/nsHTMLBRElement.cpp index 5db86914a03..4757c41718b 100644 --- a/mozilla/content/html/content/src/nsHTMLBRElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLBRElement.cpp @@ -195,9 +195,6 @@ static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aData || !aAttributes) - return; - if (aData->mSID == eStyleStruct_Display) { if (aData->mDisplayData->mClear.GetUnit() == eCSSUnit_Null) { nsHTMLValue value; diff --git a/mozilla/content/html/content/src/nsHTMLBodyElement.cpp b/mozilla/content/html/content/src/nsHTMLBodyElement.cpp index 1a58c98b372..e1b1740dcae 100644 --- a/mozilla/content/html/content/src/nsHTMLBodyElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLBodyElement.cpp @@ -522,10 +522,7 @@ nsHTMLBodyElement::SetDocument(nsIDocument* aDocument, PRBool aDeep, static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aAttributes || !aData) - return; - - if (aData->mDisplayData && aData->mSID == eStyleStruct_Display) { + if (aData->mSID == eStyleStruct_Display) { // When display if first asked for, go ahead and get our colors set up. nsHTMLValue value; @@ -564,7 +561,7 @@ void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleDat } } - if (aData->mColorData && aData->mSID == eStyleStruct_Color) { + if (aData->mSID == eStyleStruct_Color) { if (aData->mColorData->mColor.GetUnit() == eCSSUnit_Null) { // color: color nsHTMLValue value; diff --git a/mozilla/content/html/content/src/nsHTMLDListElement.cpp b/mozilla/content/html/content/src/nsHTMLDListElement.cpp index fe4cfcb8bed..838c27735ec 100644 --- a/mozilla/content/html/content/src/nsHTMLDListElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLDListElement.cpp @@ -67,12 +67,6 @@ public: // nsIDOMHTMLDListElement NS_IMETHOD GetCompact(PRBool* aCompact); NS_IMETHOD SetCompact(PRBool aCompact); - - NS_IMETHOD StringToAttribute(nsIAtom* aAttribute, - const nsAString& aValue, - nsHTMLValue& aResult); - NS_IMETHOD_(PRBool) HasAttributeDependentStyle(const nsIAtom* aAttribute) const; - NS_IMETHOD GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const; }; nsresult @@ -153,47 +147,3 @@ nsHTMLDListElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn) NS_IMPL_BOOL_ATTR(nsHTMLDListElement, Compact, compact) - - -NS_IMETHODIMP -nsHTMLDListElement::StringToAttribute(nsIAtom* aAttribute, - const nsAString& aValue, - nsHTMLValue& aResult) -{ - if (aAttribute == nsHTMLAtoms::compact) { - aResult.SetEmptyValue(); - return NS_CONTENT_ATTR_NO_VALUE; - } - return NS_CONTENT_ATTR_NOT_THERE; -} - -static void -MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) -{ - nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData); -} - -NS_IMETHODIMP_(PRBool) -nsHTMLDListElement::HasAttributeDependentStyle(const nsIAtom* aAttribute) const -{ -#if 0 - static const AttributeDependenceEntry attributes[] = { - // { &nsHTMLAtoms::compact }, // handled by ua.css? - { nsnull, NS_STYLE_HINT_NONE }, - }; -#endif - - static const AttributeDependenceEntry* const map[] = { - // attributes, - sCommonAttributeMap - }; - - return FindAttributeDependence(aAttribute, map, NS_ARRAY_LENGTH(map)); -} - -NS_IMETHODIMP -nsHTMLDListElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const -{ - aMapRuleFunc = &MapAttributesIntoRule; - return NS_OK; -} diff --git a/mozilla/content/html/content/src/nsHTMLDirectoryElement.cpp b/mozilla/content/html/content/src/nsHTMLDirectoryElement.cpp index 26adb31ceae..12f27f73e56 100644 --- a/mozilla/content/html/content/src/nsHTMLDirectoryElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLDirectoryElement.cpp @@ -199,10 +199,7 @@ nsHTMLDirectoryElement::AttributeToString(nsIAtom* aAttribute, static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aData || !aAttributes) - return; - - if (aData->mListData) { + if (aData->mSID == eStyleStruct_List) { if (aData->mListData->mType.GetUnit() == eCSSUnit_Null) { nsHTMLValue value; // type: enum diff --git a/mozilla/content/html/content/src/nsHTMLDivElement.cpp b/mozilla/content/html/content/src/nsHTMLDivElement.cpp index 5a2c041cb9b..2979ccba818 100644 --- a/mozilla/content/html/content/src/nsHTMLDivElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLDivElement.cpp @@ -208,9 +208,6 @@ nsHTMLDivElement::AttributeToString(nsIAtom* aAttribute, static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aData || !aAttributes) - return; - nsGenericHTMLElement::MapDivAlignAttributeInto(aAttributes, aData); nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData); } diff --git a/mozilla/content/html/content/src/nsHTMLFontElement.cpp b/mozilla/content/html/content/src/nsHTMLFontElement.cpp index 14636b6bfcc..ee88df62033 100644 --- a/mozilla/content/html/content/src/nsHTMLFontElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLFontElement.cpp @@ -227,10 +227,7 @@ static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aData) - return; - - if (aData->mFontData) { + if (aData->mSID == eStyleStruct_Font) { nsRuleDataFont& font = *(aData->mFontData); nsHTMLValue value; @@ -279,7 +276,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, font.mWeight.SetIntValue(value.GetIntValue(), eCSSUnit_Enumerated); } } - else if (aData->mColorData && aData->mSID == eStyleStruct_Color) { + else if (aData->mSID == eStyleStruct_Color) { if (aData->mColorData->mColor.GetUnit() == eCSSUnit_Null) { // color: color nsHTMLValue value; @@ -291,7 +288,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, } } } - else if (aData->mTextData && aData->mSID == eStyleStruct_TextReset) { + else if (aData->mSID == eStyleStruct_TextReset) { // Make text give the text a red underline // in quirks mode. The NS_STYLE_TEXT_DECORATION_OVERRIDE_ALL flag only // affects quirks mode rendering. diff --git a/mozilla/content/html/content/src/nsHTMLHRElement.cpp b/mozilla/content/html/content/src/nsHTMLHRElement.cpp index 7312d93e093..b8a621c282e 100644 --- a/mozilla/content/html/content/src/nsHTMLHRElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLHRElement.cpp @@ -227,9 +227,6 @@ static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aAttributes || !aData) - return; - nsHTMLValue value; PRBool noshade = PR_FALSE; diff --git a/mozilla/content/html/content/src/nsHTMLHeadingElement.cpp b/mozilla/content/html/content/src/nsHTMLHeadingElement.cpp index c626d1e982a..e6db5230908 100644 --- a/mozilla/content/html/content/src/nsHTMLHeadingElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLHeadingElement.cpp @@ -190,9 +190,6 @@ nsHTMLHeadingElement::AttributeToString(nsIAtom* aAttribute, static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aData || !aAttributes) - return; - nsGenericHTMLElement::MapDivAlignAttributeInto(aAttributes, aData); nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData); } diff --git a/mozilla/content/html/content/src/nsHTMLIFrameElement.cpp b/mozilla/content/html/content/src/nsHTMLIFrameElement.cpp index 88ee9c8db1e..50c5a93b789 100644 --- a/mozilla/content/html/content/src/nsHTMLIFrameElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLIFrameElement.cpp @@ -438,10 +438,7 @@ static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aData || !aAttributes) - return; - - if (aData->mSID == eStyleStruct_Border && aData->mMarginData) { + if (aData->mSID == eStyleStruct_Border) { // frameborder: 0 | 1 (| NO | YES in quirks mode) // If frameborder is 0 or No, set border to 0 // else leave it as the value set in html.css diff --git a/mozilla/content/html/content/src/nsHTMLImageElement.cpp b/mozilla/content/html/content/src/nsHTMLImageElement.cpp index 61bee4fb134..8423e27a767 100644 --- a/mozilla/content/html/content/src/nsHTMLImageElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLImageElement.cpp @@ -547,8 +547,6 @@ static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aData || !aAttributes) - return; nsGenericHTMLElement::MapImageAlignAttributeInto(aAttributes, aData); nsGenericHTMLElement::MapImageBorderAttributeInto(aAttributes, aData); nsGenericHTMLElement::MapImageMarginAttributeInto(aAttributes, aData); diff --git a/mozilla/content/html/content/src/nsHTMLInputElement.cpp b/mozilla/content/html/content/src/nsHTMLInputElement.cpp index 4c8f385e131..c175c0c8212 100644 --- a/mozilla/content/html/content/src/nsHTMLInputElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLInputElement.cpp @@ -1983,9 +1983,6 @@ static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aData) - return; - nsHTMLValue value; aAttributes->GetAttribute(nsHTMLAtoms::type, value); if (value.GetUnit() == eHTMLUnit_Enumerated && diff --git a/mozilla/content/html/content/src/nsHTMLLIElement.cpp b/mozilla/content/html/content/src/nsHTMLLIElement.cpp index 59c32dd8cf2..e14cbed5651 100644 --- a/mozilla/content/html/content/src/nsHTMLLIElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLLIElement.cpp @@ -218,10 +218,7 @@ static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aAttributes || !aData) - return; - - if (aData->mListData) { + if (aData->mSID == eStyleStruct_List) { if (aData->mListData->mType.GetUnit() == eCSSUnit_Null) { nsHTMLValue value; diff --git a/mozilla/content/html/content/src/nsHTMLMenuElement.cpp b/mozilla/content/html/content/src/nsHTMLMenuElement.cpp index 700abf672cf..c28ee501f94 100644 --- a/mozilla/content/html/content/src/nsHTMLMenuElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLMenuElement.cpp @@ -199,10 +199,7 @@ nsHTMLMenuElement::AttributeToString(nsIAtom* aAttribute, static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aData || !aAttributes) - return; - - if (aData->mListData) { + if (aData->mSID == eStyleStruct_List) { if (aData->mListData->mType.GetUnit() == eCSSUnit_Null) { nsHTMLValue value; // type: enum diff --git a/mozilla/content/html/content/src/nsHTMLOListElement.cpp b/mozilla/content/html/content/src/nsHTMLOListElement.cpp index 64840bb5bd3..6025e22d264 100644 --- a/mozilla/content/html/content/src/nsHTMLOListElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLOListElement.cpp @@ -235,10 +235,7 @@ nsHTMLOListElement::AttributeToString(nsIAtom* aAttribute, static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aData || !aAttributes) - return; - - if (aData->mListData) { + if (aData->mSID == eStyleStruct_List) { if (aData->mListData->mType.GetUnit() == eCSSUnit_Null) { nsHTMLValue value; // type: enum diff --git a/mozilla/content/html/content/src/nsHTMLObjectElement.cpp b/mozilla/content/html/content/src/nsHTMLObjectElement.cpp index b05ad7c113d..0f1433651bd 100644 --- a/mozilla/content/html/content/src/nsHTMLObjectElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLObjectElement.cpp @@ -284,9 +284,6 @@ static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aData) - return; - nsGenericHTMLElement::MapImageAlignAttributeInto(aAttributes, aData); nsGenericHTMLElement::MapImageBorderAttributeInto(aAttributes, aData); nsGenericHTMLElement::MapImageMarginAttributeInto(aAttributes, aData); diff --git a/mozilla/content/html/content/src/nsHTMLParagraphElement.cpp b/mozilla/content/html/content/src/nsHTMLParagraphElement.cpp index 7c353d448bd..3efe2276f18 100644 --- a/mozilla/content/html/content/src/nsHTMLParagraphElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLParagraphElement.cpp @@ -192,9 +192,6 @@ nsHTMLParagraphElement::AttributeToString(nsIAtom* aAttribute, static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aData || !aAttributes) - return; - nsGenericHTMLElement::MapDivAlignAttributeInto(aAttributes, aData); nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData); } diff --git a/mozilla/content/html/content/src/nsHTMLPreElement.cpp b/mozilla/content/html/content/src/nsHTMLPreElement.cpp index 02a743df491..13140aa0fab 100644 --- a/mozilla/content/html/content/src/nsHTMLPreElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLPreElement.cpp @@ -197,22 +197,16 @@ static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aData) - return; + if (aData->mSID == eStyleStruct_Font) { + nsHTMLValue value; - if (aData->mFontData) { - nsRuleDataFont& font = *(aData->mFontData); - - if (nsnull != aAttributes) { - nsHTMLValue value; - - // variable: empty - aAttributes->GetAttribute(nsHTMLAtoms::variable, value); - if (value.GetUnit() == eHTMLUnit_Empty) - font.mFamily.SetStringValue(NS_LITERAL_STRING("serif"), eCSSUnit_String); - } + // variable: empty + aAttributes->GetAttribute(nsHTMLAtoms::variable, value); + if (value.GetUnit() == eHTMLUnit_Empty) + aData->mFontData->mFamily.SetStringValue(NS_LITERAL_STRING("serif"), + eCSSUnit_String); } - else if (aData->mPositionData) { + else if (aData->mSID == eStyleStruct_Position) { // cols: int (nav4 attribute) nsHTMLValue value; if (aData->mPositionData->mWidth.GetUnit() == eCSSUnit_Null) { @@ -226,7 +220,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, aData->mPositionData->mWidth.SetFloatValue((float)value.GetIntValue(), eCSSUnit_Char); } } - else if (aData->mTextData && aData->mSID == eStyleStruct_Text) { + else if (aData->mSID == eStyleStruct_Text) { if (aData->mTextData->mWhiteSpace.GetUnit() == eCSSUnit_Null) { nsHTMLValue value; // wrap: empty diff --git a/mozilla/content/html/content/src/nsHTMLSelectElement.cpp b/mozilla/content/html/content/src/nsHTMLSelectElement.cpp index 868e90bf2a5..2d031349d45 100644 --- a/mozilla/content/html/content/src/nsHTMLSelectElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLSelectElement.cpp @@ -1865,9 +1865,6 @@ static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aData || !aAttributes) - return; - nsGenericHTMLElement::MapImageAlignAttributeInto(aAttributes, aData); nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData); } diff --git a/mozilla/content/html/content/src/nsHTMLSharedElement.cpp b/mozilla/content/html/content/src/nsHTMLSharedElement.cpp index e5e2e741571..a3b8064cf2a 100644 --- a/mozilla/content/html/content/src/nsHTMLSharedElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLSharedElement.cpp @@ -296,13 +296,10 @@ static void SpacerMapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aAttributes || !aData) - return; - nsGenericHTMLElement::MapImageMarginAttributeInto(aAttributes, aData); nsGenericHTMLElement::MapImageSizeAttributesInto(aAttributes, aData); - if (aData->mPositionData) { + if (aData->mSID == eStyleStruct_Position) { nsHTMLValue value; const nsStyleDisplay* display = aData->mStyleContext->GetStyleDisplay(); @@ -344,13 +341,12 @@ SpacerMapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, eCSSUnit_Pixel); } } - } else if (aData->mDisplayData) { + } else if (aData->mSID == eStyleStruct_Display) { nsHTMLValue value; aAttributes->GetAttribute(nsHTMLAtoms::align, value); if (value.GetUnit() == eHTMLUnit_Enumerated) { PRUint8 align = (PRUint8)(value.GetIntValue()); - if (aData->mDisplayData && - aData->mDisplayData->mFloat.GetUnit() == eCSSUnit_Null) { + if (aData->mDisplayData->mFloat.GetUnit() == eCSSUnit_Null) { if (align == NS_STYLE_TEXT_ALIGN_LEFT) aData->mDisplayData->mFloat.SetIntValue(NS_STYLE_FLOAT_LEFT, eCSSUnit_Enumerated); diff --git a/mozilla/content/html/content/src/nsHTMLSharedLeafElement.cpp b/mozilla/content/html/content/src/nsHTMLSharedLeafElement.cpp index e5e2e741571..a3b8064cf2a 100644 --- a/mozilla/content/html/content/src/nsHTMLSharedLeafElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLSharedLeafElement.cpp @@ -296,13 +296,10 @@ static void SpacerMapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aAttributes || !aData) - return; - nsGenericHTMLElement::MapImageMarginAttributeInto(aAttributes, aData); nsGenericHTMLElement::MapImageSizeAttributesInto(aAttributes, aData); - if (aData->mPositionData) { + if (aData->mSID == eStyleStruct_Position) { nsHTMLValue value; const nsStyleDisplay* display = aData->mStyleContext->GetStyleDisplay(); @@ -344,13 +341,12 @@ SpacerMapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, eCSSUnit_Pixel); } } - } else if (aData->mDisplayData) { + } else if (aData->mSID == eStyleStruct_Display) { nsHTMLValue value; aAttributes->GetAttribute(nsHTMLAtoms::align, value); if (value.GetUnit() == eHTMLUnit_Enumerated) { PRUint8 align = (PRUint8)(value.GetIntValue()); - if (aData->mDisplayData && - aData->mDisplayData->mFloat.GetUnit() == eCSSUnit_Null) { + if (aData->mDisplayData->mFloat.GetUnit() == eCSSUnit_Null) { if (align == NS_STYLE_TEXT_ALIGN_LEFT) aData->mDisplayData->mFloat.SetIntValue(NS_STYLE_FLOAT_LEFT, eCSSUnit_Enumerated); diff --git a/mozilla/content/html/content/src/nsHTMLSharedObjectElement.cpp b/mozilla/content/html/content/src/nsHTMLSharedObjectElement.cpp index b05ad7c113d..0f1433651bd 100644 --- a/mozilla/content/html/content/src/nsHTMLSharedObjectElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLSharedObjectElement.cpp @@ -284,9 +284,6 @@ static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aData) - return; - nsGenericHTMLElement::MapImageAlignAttributeInto(aAttributes, aData); nsGenericHTMLElement::MapImageBorderAttributeInto(aAttributes, aData); nsGenericHTMLElement::MapImageMarginAttributeInto(aAttributes, aData); diff --git a/mozilla/content/html/content/src/nsHTMLTableCaptionElement.cpp b/mozilla/content/html/content/src/nsHTMLTableCaptionElement.cpp index d0613c0207a..9bc95b02a61 100644 --- a/mozilla/content/html/content/src/nsHTMLTableCaptionElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLTableCaptionElement.cpp @@ -197,10 +197,7 @@ nsHTMLTableCaptionElement::AttributeToString(nsIAtom* aAttribute, static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aAttributes || !aData) - return; - - if (aData->mSID == eStyleStruct_TableBorder && aData->mTableData) { + if (aData->mSID == eStyleStruct_TableBorder) { if (aData->mTableData->mCaptionSide.GetUnit() == eCSSUnit_Null) { nsHTMLValue value; aAttributes->GetAttribute(nsHTMLAtoms::align, value); diff --git a/mozilla/content/html/content/src/nsHTMLTableCellElement.cpp b/mozilla/content/html/content/src/nsHTMLTableCellElement.cpp index b52d6735ab7..10be205fe2e 100644 --- a/mozilla/content/html/content/src/nsHTMLTableCellElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLTableCellElement.cpp @@ -90,7 +90,7 @@ protected: // This does not return a nsresult since all we care about is if we // found the row element that this cell is in or not. void GetRow(nsIDOMHTMLTableRowElement** aRow); - void GetTable(nsIContent** aTable); + nsIContent * GetTable(); PRInt32 mColIndex; }; @@ -202,10 +202,10 @@ nsHTMLTableCellElement::GetRow(nsIDOMHTMLTableRowElement** aRow) } // protected method -void -nsHTMLTableCellElement::GetTable(nsIContent** aTable) +nsIContent* +nsHTMLTableCellElement::GetTable() { - *aTable = nsnull; + nsIContent *result = nsnull; if (mParent) { // mParent should be a row nsIContent* section = mParent->GetParent(); @@ -214,13 +214,14 @@ nsHTMLTableCellElement::GetTable(nsIContent** aTable) section->GetTag(getter_AddRefs(tag)); if (tag == nsHTMLAtoms::table) { // XHTML, without a row group - NS_ADDREF(*aTable = section); + result = section; } else { // we have a row group. - NS_IF_ADDREF(*aTable = section->GetParent()); + result = section->GetParent(); } } } + return result; } NS_IMETHODIMP @@ -267,6 +268,10 @@ nsHTMLTableCellElement::GetCellIndex(PRInt32* aCellIndex) NS_IMETHODIMP nsHTMLTableCellElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker) { + nsresult rv = + nsGenericHTMLContainerElement::WalkContentStyleRules(aRuleWalker); + NS_ENSURE_SUCCESS(rv, rv); + // Add style information from the mapped attributes of the table // element. This depends on the strange behavior of the // |MapAttributesIntoRule| in nsHTMLTableElement.cpp, which is @@ -274,14 +279,12 @@ nsHTMLTableCellElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker) // contract. However, things are OK (except for the incorrect // dependence on display type rather than tag) since tables and cells // match different, less specific, rules. - nsCOMPtr table; - GetTable(getter_AddRefs(table)); - nsCOMPtr styledTable(do_QueryInterface(table)); + nsCOMPtr styledTable = do_QueryInterface(GetTable()); if (styledTable) { - styledTable->WalkContentStyleRules(aRuleWalker); + rv = styledTable->WalkContentStyleRules(aRuleWalker); } - return nsGenericHTMLContainerElement::WalkContentStyleRules(aRuleWalker); + return rv; } @@ -444,10 +447,7 @@ static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aAttributes || !aData) - return; - - if (aData->mPositionData) { + if (aData->mSID == eStyleStruct_Position) { // width: value nsHTMLValue value; if (aData->mPositionData->mWidth.GetUnit() == eCSSUnit_Null) { @@ -479,37 +479,35 @@ void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, } } } - else if (aData->mTextData) { - if (aData->mSID == eStyleStruct_Text) { - if (aData->mTextData->mTextAlign.GetUnit() == eCSSUnit_Null) { - // align: enum - nsHTMLValue value; - aAttributes->GetAttribute(nsHTMLAtoms::align, value); - if (value.GetUnit() == eHTMLUnit_Enumerated) - aData->mTextData->mTextAlign.SetIntValue(value.GetIntValue(), eCSSUnit_Enumerated); - } + else if (aData->mSID == eStyleStruct_Text) { + if (aData->mTextData->mTextAlign.GetUnit() == eCSSUnit_Null) { + // align: enum + nsHTMLValue value; + aAttributes->GetAttribute(nsHTMLAtoms::align, value); + if (value.GetUnit() == eHTMLUnit_Enumerated) + aData->mTextData->mTextAlign.SetIntValue(value.GetIntValue(), eCSSUnit_Enumerated); + } - if (aData->mTextData->mWhiteSpace.GetUnit() == eCSSUnit_Null) { - // nowrap: enum - nsHTMLValue value; - aAttributes->GetAttribute(nsHTMLAtoms::nowrap, value); - if (value.GetUnit() != eHTMLUnit_Null) { - // See if our width is not a pixel width. - nsHTMLValue widthValue; - aAttributes->GetAttribute(nsHTMLAtoms::width, widthValue); - if (widthValue.GetUnit() != eHTMLUnit_Pixel) - aData->mTextData->mWhiteSpace.SetIntValue(NS_STYLE_WHITESPACE_NOWRAP, eCSSUnit_Enumerated); - } + if (aData->mTextData->mWhiteSpace.GetUnit() == eCSSUnit_Null) { + // nowrap: enum + nsHTMLValue value; + aAttributes->GetAttribute(nsHTMLAtoms::nowrap, value); + if (value.GetUnit() != eHTMLUnit_Null) { + // See if our width is not a pixel width. + nsHTMLValue widthValue; + aAttributes->GetAttribute(nsHTMLAtoms::width, widthValue); + if (widthValue.GetUnit() != eHTMLUnit_Pixel) + aData->mTextData->mWhiteSpace.SetIntValue(NS_STYLE_WHITESPACE_NOWRAP, eCSSUnit_Enumerated); } } - else { - if (aData->mTextData->mVerticalAlign.GetUnit() == eCSSUnit_Null) { - // valign: enum - nsHTMLValue value; - aAttributes->GetAttribute(nsHTMLAtoms::valign, value); - if (value.GetUnit() == eHTMLUnit_Enumerated) - aData->mTextData->mVerticalAlign.SetIntValue(value.GetIntValue(), eCSSUnit_Enumerated); - } + } + else if (aData->mSID == eStyleStruct_TextReset) { + if (aData->mTextData->mVerticalAlign.GetUnit() == eCSSUnit_Null) { + // valign: enum + nsHTMLValue value; + aAttributes->GetAttribute(nsHTMLAtoms::valign, value); + if (value.GetUnit() == eHTMLUnit_Enumerated) + aData->mTextData->mVerticalAlign.SetIntValue(value.GetIntValue(), eCSSUnit_Enumerated); } } diff --git a/mozilla/content/html/content/src/nsHTMLTableColElement.cpp b/mozilla/content/html/content/src/nsHTMLTableColElement.cpp index e7ec0386a72..6730d125c13 100644 --- a/mozilla/content/html/content/src/nsHTMLTableColElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLTableColElement.cpp @@ -247,10 +247,8 @@ nsHTMLTableColElement::AttributeToString(nsIAtom* aAttribute, static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aAttributes || !aData) - return; - - if (aData->mPositionData && aData->mPositionData->mWidth.GetUnit() == eCSSUnit_Null) { + if (aData->mSID == eStyleStruct_Position && + aData->mPositionData->mWidth.GetUnit() == eCSSUnit_Null) { // width nsHTMLValue value; aAttributes->GetAttribute(nsHTMLAtoms::width, value); @@ -273,24 +271,22 @@ void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleDat } } } - else if (aData->mTextData) { - if (aData->mSID == eStyleStruct_Text) { - if (aData->mTextData->mTextAlign.GetUnit() == eCSSUnit_Null) { - // align: enum - nsHTMLValue value; - aAttributes->GetAttribute(nsHTMLAtoms::align, value); - if (value.GetUnit() == eHTMLUnit_Enumerated) - aData->mTextData->mTextAlign.SetIntValue(value.GetIntValue(), eCSSUnit_Enumerated); - } + else if (aData->mSID == eStyleStruct_Text) { + if (aData->mTextData->mTextAlign.GetUnit() == eCSSUnit_Null) { + // align: enum + nsHTMLValue value; + aAttributes->GetAttribute(nsHTMLAtoms::align, value); + if (value.GetUnit() == eHTMLUnit_Enumerated) + aData->mTextData->mTextAlign.SetIntValue(value.GetIntValue(), eCSSUnit_Enumerated); } - else { - if (aData->mTextData->mVerticalAlign.GetUnit() == eCSSUnit_Null) { - // valign: enum - nsHTMLValue value; - aAttributes->GetAttribute(nsHTMLAtoms::valign, value); - if (value.GetUnit() == eHTMLUnit_Enumerated) - aData->mTextData->mVerticalAlign.SetIntValue(value.GetIntValue(), eCSSUnit_Enumerated); - } + } + else if (aData->mSID == eStyleStruct_TextReset) { + if (aData->mTextData->mVerticalAlign.GetUnit() == eCSSUnit_Null) { + // valign: enum + nsHTMLValue value; + aAttributes->GetAttribute(nsHTMLAtoms::valign, value); + if (value.GetUnit() == eHTMLUnit_Enumerated) + aData->mTextData->mVerticalAlign.SetIntValue(value.GetIntValue(), eCSSUnit_Enumerated); } } @@ -301,11 +297,7 @@ static void ColMapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aAttributes || !aData) - return; - if (aData->mSID == eStyleStruct_Table && - aData->mTableData && aData->mTableData->mSpan.GetUnit() == eCSSUnit_Null) { // span: int nsHTMLValue value; diff --git a/mozilla/content/html/content/src/nsHTMLTableElement.cpp b/mozilla/content/html/content/src/nsHTMLTableElement.cpp index c46c92b0677..fc8f3146761 100644 --- a/mozilla/content/html/content/src/nsHTMLTableElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLTableElement.cpp @@ -1237,16 +1237,10 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, // which *element* it's matching (style rules should not stop matching // when the display type is changed). - if (!aData) - return; - - if (!aAttributes) - return; - nsCompatibility mode; aData->mPresContext->GetCompatibilityMode(&mode); - if (aData->mSID == eStyleStruct_TableBorder && aData->mTableData) { + if (aData->mSID == eStyleStruct_TableBorder) { const nsStyleDisplay* readDisplay = aData->mStyleContext->GetStyleDisplay(); if (readDisplay->mDisplay != NS_STYLE_DISPLAY_TABLE_CELL) { // cellspacing @@ -1266,9 +1260,8 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, aData->mTableData->mBorderSpacingY.SetFloatValue(100.0f * value.GetPercentValue(), eCSSUnit_Pixel); } } - } - - if (aData->mSID == eStyleStruct_Table && aData->mTableData) { + } + else if (aData->mSID == eStyleStruct_Table) { const nsStyleDisplay* readDisplay = aData->mStyleContext->GetStyleDisplay(); if (readDisplay->mDisplay != NS_STYLE_DISPLAY_TABLE_CELL) { MapTableBorderInto(aAttributes, aData, 0); @@ -1296,7 +1289,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, aData->mTableData->mRules.SetIntValue(value.GetIntValue(), eCSSUnit_Enumerated); } } - else if (aData->mSID == eStyleStruct_Margin && aData->mMarginData) { + else if (aData->mSID == eStyleStruct_Margin) { const nsStyleDisplay* readDisplay = aData->mStyleContext->GetStyleDisplay(); if (readDisplay->mDisplay != NS_STYLE_DISPLAY_TABLE_CELL) { @@ -1342,7 +1335,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, } } } - else if (aData->mSID == eStyleStruct_Padding && aData->mMarginData) { + else if (aData->mSID == eStyleStruct_Padding) { const nsStyleDisplay* readDisplay = aData->mStyleContext->GetStyleDisplay(); if (readDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_CELL) { @@ -1376,7 +1369,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, } } } - else if (aData->mPositionData) { + else if (aData->mSID == eStyleStruct_Position) { const nsStyleDisplay* readDisplay = aData->mStyleContext->GetStyleDisplay(); if (readDisplay->mDisplay != NS_STYLE_DISPLAY_TABLE_CELL) { @@ -1406,7 +1399,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, if (readDisplay->mDisplay != NS_STYLE_DISPLAY_TABLE_CELL) nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData); } - else if (aData->mSID == eStyleStruct_Border && aData->mMarginData) { + else if (aData->mSID == eStyleStruct_Border) { if (!aData->mStyleContext) return; const nsStyleTableBorder* tableStyle = aData->mStyleContext->GetStyleTableBorder(); const nsStyleDisplay* readDisplay = aData->mStyleContext->GetStyleDisplay(); @@ -1489,8 +1482,7 @@ MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, MapTableBorderInto(aAttributes, aData, borderStyle); } } - - if (aData->mSID == eStyleStruct_Background) { + else if (aData->mSID == eStyleStruct_Background) { const nsStyleDisplay* readDisplay = aData->mStyleContext->GetStyleDisplay(); if (readDisplay->mDisplay != NS_STYLE_DISPLAY_TABLE_CELL) diff --git a/mozilla/content/html/content/src/nsHTMLTableRowElement.cpp b/mozilla/content/html/content/src/nsHTMLTableRowElement.cpp index 8d67a0953be..c40fd887e2b 100644 --- a/mozilla/content/html/content/src/nsHTMLTableRowElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLTableRowElement.cpp @@ -598,10 +598,7 @@ nsHTMLTableRowElement::AttributeToString(nsIAtom* aAttribute, static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aAttributes || !aData) - return; - - if (aData->mPositionData) { + if (aData->mSID == eStyleStruct_Position) { // height: value nsHTMLValue value; if (aData->mPositionData->mHeight.GetUnit() == eCSSUnit_Null) { @@ -612,24 +609,22 @@ void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleDat aData->mPositionData->mHeight.SetPercentValue(value.GetPercentValue()); } } - else if (aData->mTextData) { - if (aData->mSID == eStyleStruct_Text) { - if (aData->mTextData->mTextAlign.GetUnit() == eCSSUnit_Null) { - // align: enum - nsHTMLValue value; - aAttributes->GetAttribute(nsHTMLAtoms::align, value); - if (value.GetUnit() == eHTMLUnit_Enumerated) - aData->mTextData->mTextAlign.SetIntValue(value.GetIntValue(), eCSSUnit_Enumerated); - } + else if (aData->mSID == eStyleStruct_Text) { + if (aData->mTextData->mTextAlign.GetUnit() == eCSSUnit_Null) { + // align: enum + nsHTMLValue value; + aAttributes->GetAttribute(nsHTMLAtoms::align, value); + if (value.GetUnit() == eHTMLUnit_Enumerated) + aData->mTextData->mTextAlign.SetIntValue(value.GetIntValue(), eCSSUnit_Enumerated); } - else { - if (aData->mTextData->mVerticalAlign.GetUnit() == eCSSUnit_Null) { - // valign: enum - nsHTMLValue value; - aAttributes->GetAttribute(nsHTMLAtoms::valign, value); - if (value.GetUnit() == eHTMLUnit_Enumerated) - aData->mTextData->mVerticalAlign.SetIntValue(value.GetIntValue(), eCSSUnit_Enumerated); - } + } + else if (aData->mSID == eStyleStruct_TextReset) { + if (aData->mTextData->mVerticalAlign.GetUnit() == eCSSUnit_Null) { + // valign: enum + nsHTMLValue value; + aAttributes->GetAttribute(nsHTMLAtoms::valign, value); + if (value.GetUnit() == eHTMLUnit_Enumerated) + aData->mTextData->mVerticalAlign.SetIntValue(value.GetIntValue(), eCSSUnit_Enumerated); } } diff --git a/mozilla/content/html/content/src/nsHTMLTableSectionElement.cpp b/mozilla/content/html/content/src/nsHTMLTableSectionElement.cpp index 6651c2c9b97..cd1dc821609 100644 --- a/mozilla/content/html/content/src/nsHTMLTableSectionElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLTableSectionElement.cpp @@ -354,10 +354,7 @@ nsHTMLTableSectionElement::AttributeToString(nsIAtom* aAttribute, static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aAttributes || !aData) - return; - - if (aData->mPositionData) { + if (aData->mSID == eStyleStruct_Position) { // height: value nsHTMLValue value; if (aData->mPositionData->mHeight.GetUnit() == eCSSUnit_Null) { @@ -366,24 +363,22 @@ void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleDat aData->mPositionData->mHeight.SetFloatValue((float)value.GetPixelValue(), eCSSUnit_Pixel); } } - else if (aData->mTextData) { - if (aData->mSID == eStyleStruct_Text) { - if (aData->mTextData->mTextAlign.GetUnit() == eCSSUnit_Null) { - // align: enum - nsHTMLValue value; - aAttributes->GetAttribute(nsHTMLAtoms::align, value); - if (value.GetUnit() == eHTMLUnit_Enumerated) - aData->mTextData->mTextAlign.SetIntValue(value.GetIntValue(), eCSSUnit_Enumerated); - } + else if (aData->mSID == eStyleStruct_Text) { + if (aData->mTextData->mTextAlign.GetUnit() == eCSSUnit_Null) { + // align: enum + nsHTMLValue value; + aAttributes->GetAttribute(nsHTMLAtoms::align, value); + if (value.GetUnit() == eHTMLUnit_Enumerated) + aData->mTextData->mTextAlign.SetIntValue(value.GetIntValue(), eCSSUnit_Enumerated); } - else { - if (aData->mTextData->mVerticalAlign.GetUnit() == eCSSUnit_Null) { - // valign: enum - nsHTMLValue value; - aAttributes->GetAttribute(nsHTMLAtoms::valign, value); - if (value.GetUnit() == eHTMLUnit_Enumerated) - aData->mTextData->mVerticalAlign.SetIntValue(value.GetIntValue(), eCSSUnit_Enumerated); - } + } + else if (aData->mSID == eStyleStruct_TextReset) { + if (aData->mTextData->mVerticalAlign.GetUnit() == eCSSUnit_Null) { + // valign: enum + nsHTMLValue value; + aAttributes->GetAttribute(nsHTMLAtoms::valign, value); + if (value.GetUnit() == eHTMLUnit_Enumerated) + aData->mTextData->mVerticalAlign.SetIntValue(value.GetIntValue(), eCSSUnit_Enumerated); } } diff --git a/mozilla/content/html/content/src/nsHTMLTextAreaElement.cpp b/mozilla/content/html/content/src/nsHTMLTextAreaElement.cpp index 1f1d672cd44..2ec2f5dac78 100644 --- a/mozilla/content/html/content/src/nsHTMLTextAreaElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLTextAreaElement.cpp @@ -622,9 +622,6 @@ static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aAttributes || !aData) - return; - nsGenericHTMLElement::MapDivAlignAttributeInto(aAttributes, aData); nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData); } diff --git a/mozilla/content/html/content/src/nsHTMLUListElement.cpp b/mozilla/content/html/content/src/nsHTMLUListElement.cpp index e88b4e30b56..e35f8d2af3e 100644 --- a/mozilla/content/html/content/src/nsHTMLUListElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLUListElement.cpp @@ -216,10 +216,7 @@ nsHTMLUListElement::AttributeToString(nsIAtom* aAttribute, static void MapAttributesIntoRule(const nsIHTMLMappedAttributes* aAttributes, nsRuleData* aData) { - if (!aData || !aAttributes) - return; - - if (aData->mListData) { + if (aData->mSID == eStyleStruct_List) { if (aData->mListData->mType.GetUnit() == eCSSUnit_Null) { nsHTMLValue value; // type: enum