Bug 236476: Change GetHTMLAttribute to GetParsedAttr. Also fixes bug 232706 by removing final uses of nsHTMLValue.
r=bz sr=jst
This commit is contained in:
Родитель
5672680bb1
Коммит
163b6ef1cc
|
@ -82,7 +82,6 @@ REQUIRES = xpcom \
|
|||
|
||||
EXPORTS = \
|
||||
nsAtomListUtils.h \
|
||||
nsHTMLValue.h \
|
||||
nsNodeInfoManager.h \
|
||||
nsPropertyTable.h \
|
||||
nsStubDocumentObserver.h \
|
||||
|
@ -116,7 +115,6 @@ CPPSRCS = \
|
|||
nsGenericDOMNodeList.cpp \
|
||||
nsGenericElement.cpp \
|
||||
nsHTMLContentSerializer.cpp \
|
||||
nsHTMLValue.cpp \
|
||||
nsImageLoadingContent.cpp \
|
||||
nsMappedAttributes.cpp \
|
||||
nsNameSpaceManager.cpp \
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsAttrValue.h"
|
||||
#include "nsHTMLValue.h"
|
||||
#include "nsIAtom.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsICSSStyleRule.h"
|
||||
|
@ -49,6 +48,100 @@
|
|||
#include "nsISVGValue.h"
|
||||
#endif
|
||||
|
||||
nsVoidArray* nsAttrValue::sEnumTableArray = nsnull;
|
||||
|
||||
class nsCheapStringBufferUtils {
|
||||
public:
|
||||
/**
|
||||
* Get the string pointer
|
||||
* @param aBuf the buffer
|
||||
* @return a pointer to the string
|
||||
*/
|
||||
static const PRUnichar* StrPtr(const PRUnichar* aBuf) {
|
||||
NS_ASSERTION(aBuf, "Cannot work on null buffer!");
|
||||
return (const PRUnichar*)( ((const char*)aBuf) + sizeof(PRUint32) );
|
||||
}
|
||||
static PRUnichar* StrPtr(PRUnichar* aBuf) {
|
||||
NS_ASSERTION(aBuf, "Cannot work on null buffer!");
|
||||
return (PRUnichar*)( ((char*)aBuf) + sizeof(PRUint32) );
|
||||
}
|
||||
/**
|
||||
* Get the string length
|
||||
* @param aBuf the buffer
|
||||
* @return the string length
|
||||
*/
|
||||
static PRUint32 Length(const PRUnichar* aBuf) {
|
||||
NS_ASSERTION(aBuf, "Cannot work on null buffer!");
|
||||
return *((PRUint32*)aBuf);
|
||||
}
|
||||
/**
|
||||
* Get a DependentString from a buffer
|
||||
*
|
||||
* @param aBuf the buffer to get string from
|
||||
* @return a DependentString representing this string
|
||||
*/
|
||||
static nsDependentSubstring GetDependentString(const PRUnichar* aBuf) {
|
||||
NS_ASSERTION(aBuf, "Cannot work on null buffer!");
|
||||
const PRUnichar* buf = StrPtr(aBuf);
|
||||
return Substring(buf, buf + Length(aBuf));
|
||||
}
|
||||
/**
|
||||
* Construct from an AString
|
||||
* @param aBuf the buffer to copy to
|
||||
* @param aStr the string to construct from
|
||||
*/
|
||||
static void CopyToBuffer(PRUnichar*& aBuf, const nsAString& aStr) {
|
||||
PRUint32 len = aStr.Length();
|
||||
aBuf = (PRUnichar*)nsMemory::Alloc(sizeof(PRUint32) +
|
||||
len * sizeof(PRUnichar));
|
||||
*((PRUint32*)aBuf) = len;
|
||||
CopyUnicodeTo(aStr, 0, StrPtr(aBuf), len);
|
||||
}
|
||||
/**
|
||||
* Construct from an AString
|
||||
* @param aBuf the buffer to copy to
|
||||
* @param aStr the string to construct from
|
||||
*/
|
||||
static void CopyToExistingBuffer(PRUnichar*& aBuf, PRUnichar* aOldBuf,
|
||||
const nsAString& aStr) {
|
||||
NS_ASSERTION(aOldBuf, "Cannot work on null buffer!");
|
||||
PRUint32 len = aStr.Length();
|
||||
aBuf = NS_STATIC_CAST(PRUnichar*,
|
||||
nsMemory::Realloc(aOldBuf, sizeof(PRUint32) +
|
||||
len * sizeof(PRUnichar)));
|
||||
*(NS_REINTERPRET_CAST(PRUint32*, aBuf)) = len;
|
||||
CopyUnicodeTo(aStr, 0, StrPtr(aBuf), len);
|
||||
}
|
||||
/**
|
||||
* Construct from another nsCheapStringBuffer
|
||||
* @param aBuf the buffer to put into
|
||||
* @param aSrc the buffer to construct from
|
||||
*/
|
||||
static void Clone(PRUnichar*& aBuf, const PRUnichar* aSrc) {
|
||||
NS_ASSERTION(aSrc, "Cannot work on null buffer!");
|
||||
aBuf = (PRUnichar*)nsMemory::Clone(aSrc, sizeof(PRUint32) +
|
||||
Length(aSrc) * sizeof(PRUnichar));
|
||||
}
|
||||
/**
|
||||
* Free the memory for the buf
|
||||
* @param aBuf the buffer to free
|
||||
*/
|
||||
static void Free(PRUnichar* aBuf) {
|
||||
NS_ASSERTION(aBuf, "Cannot work on null buffer!");
|
||||
nsMemory::Free(aBuf);
|
||||
}
|
||||
/**
|
||||
* Get a hashcode for the buffer
|
||||
* @param aBuf the buffer
|
||||
* @return the hashcode
|
||||
*/
|
||||
static PRUint32 HashCode(const PRUnichar* aBuf) {
|
||||
NS_ASSERTION(aBuf, "Cannot work on null buffer!");
|
||||
return nsCRT::BufferHashCode(StrPtr(aBuf),
|
||||
Length(aBuf));
|
||||
}
|
||||
};
|
||||
|
||||
nsAttrValue::nsAttrValue()
|
||||
: mBits(0)
|
||||
{
|
||||
|
@ -85,6 +178,26 @@ nsAttrValue::~nsAttrValue()
|
|||
ResetIfSet();
|
||||
}
|
||||
|
||||
/* static */
|
||||
nsresult
|
||||
nsAttrValue::Init()
|
||||
{
|
||||
NS_ASSERTION(!sEnumTableArray, "nsAttrValue already initialized");
|
||||
|
||||
sEnumTableArray = new nsVoidArray;
|
||||
NS_ENSURE_TRUE(sEnumTableArray, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* static */
|
||||
void
|
||||
nsAttrValue::Shutdown()
|
||||
{
|
||||
delete sEnumTableArray;
|
||||
sEnumTableArray = nsnull;
|
||||
}
|
||||
|
||||
nsAttrValue::ValueType
|
||||
nsAttrValue::Type() const
|
||||
{
|
||||
|
@ -232,10 +345,10 @@ nsAttrValue::SetTo(const nsAString& aValue)
|
|||
}
|
||||
|
||||
void
|
||||
nsAttrValue::SetTo(PRInt16 aInt, ValueType aType)
|
||||
nsAttrValue::SetTo(PRInt16 aInt)
|
||||
{
|
||||
ResetIfSet();
|
||||
SetIntValueAndType(aInt, aType);
|
||||
SetIntValueAndType(aInt, eInteger);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -315,7 +428,19 @@ nsAttrValue::ToString(nsAString& aResult) const
|
|||
}
|
||||
case eEnum:
|
||||
{
|
||||
NS_NOTREACHED("trying to convert enum to string");
|
||||
PRInt16 val = GetEnumValue();
|
||||
EnumTable* table = NS_STATIC_CAST(EnumTable*, sEnumTableArray->
|
||||
FastElementAt(GetIntInternal() & NS_ATTRVALUE_ENUMTABLEINDEX_MASK));
|
||||
while (table->tag) {
|
||||
if (table->value == val) {
|
||||
aResult.AssignASCII(table->tag);
|
||||
|
||||
return;
|
||||
}
|
||||
table++;
|
||||
}
|
||||
|
||||
NS_NOTREACHED("couldn't find value in EnumTable");
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -365,71 +490,6 @@ nsAttrValue::ToString(nsAString& aResult) const
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsAttrValue::ToHTMLValue(nsHTMLValue& aResult) const
|
||||
{
|
||||
switch(Type()) {
|
||||
case eString:
|
||||
{
|
||||
aResult.SetStringValue(GetStringValue());
|
||||
break;
|
||||
}
|
||||
case eAtom:
|
||||
{
|
||||
nsAutoString tmp;
|
||||
GetAtomValue()->ToString(tmp);
|
||||
aResult.SetStringValue(tmp);
|
||||
break;
|
||||
}
|
||||
case eInteger:
|
||||
{
|
||||
aResult.SetIntValue(GetIntInternal(), eHTMLUnit_Integer);
|
||||
break;
|
||||
}
|
||||
case eColor:
|
||||
{
|
||||
nscolor v;
|
||||
GetColorValue(v);
|
||||
aResult.SetColorValue(v);
|
||||
break;
|
||||
}
|
||||
case eProportional:
|
||||
{
|
||||
aResult.SetIntValue(GetProportionalValue(), eHTMLUnit_Proportional);
|
||||
break;
|
||||
}
|
||||
case eEnum:
|
||||
{
|
||||
aResult.SetIntValue(GetEnumValue(), eHTMLUnit_Enumerated);
|
||||
break;
|
||||
}
|
||||
case ePercent:
|
||||
{
|
||||
aResult.SetPercentValue(GetPercentValue());
|
||||
break;
|
||||
}
|
||||
case eCSSStyleRule:
|
||||
{
|
||||
aResult.SetCSSStyleRuleValue(GetCSSStyleRuleValue());
|
||||
break;
|
||||
}
|
||||
case eAtomArray:
|
||||
{
|
||||
nsCOMArray<nsIAtom>* array = new nsCOMArray<nsIAtom>(*GetAtomArrayValue());
|
||||
aResult.SetAtomArrayValue(array);
|
||||
break;
|
||||
}
|
||||
#ifdef MOZ_SVG
|
||||
case eSVGValue:
|
||||
{
|
||||
nsAutoString tmp;
|
||||
GetSVGValue()->GetValueString(tmp);
|
||||
aResult.SetStringValue(tmp);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
const nsDependentSubstring
|
||||
nsAttrValue::GetStringValue() const
|
||||
{
|
||||
|
@ -738,16 +798,36 @@ nsAttrValue::ParseStringOrAtom(const nsAString& aValue)
|
|||
|
||||
PRBool
|
||||
nsAttrValue::ParseEnumValue(const nsAString& aValue,
|
||||
const nsHTMLValue::EnumTable* aTable,
|
||||
const EnumTable* aTable,
|
||||
PRBool aCaseSensitive)
|
||||
{
|
||||
ResetIfSet();
|
||||
|
||||
// Have to const cast here since nsVoidArray can't deal with constpointers
|
||||
EnumTable* tableStart = NS_CONST_CAST(EnumTable*, aTable);
|
||||
|
||||
nsAutoString val(aValue);
|
||||
while (aTable->tag) {
|
||||
if (aCaseSensitive ? val.EqualsASCII(aTable->tag) :
|
||||
val.EqualsIgnoreCase(aTable->tag)) {
|
||||
SetIntValueAndType(aTable->value, eEnum);
|
||||
|
||||
// Find index of EnumTable
|
||||
PRInt16 index = sEnumTableArray->IndexOf(tableStart);
|
||||
if (index < 0) {
|
||||
index = sEnumTableArray->Count();
|
||||
NS_ASSERTION(index <= NS_ATTRVALUE_ENUMTABLEINDEX_MAXVALUE,
|
||||
"too many enum tables");
|
||||
if (!sEnumTableArray->AppendElement(tableStart)) {
|
||||
return PR_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
PRInt32 value = (aTable->value << NS_ATTRVALUE_ENUMTABLEINDEX_BITS) +
|
||||
index;
|
||||
|
||||
SetIntValueAndType(value, eEnum);
|
||||
NS_ASSERTION(GetEnumValue() == aTable->value,
|
||||
"failed to store enum properly");
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
|
|
@ -43,13 +43,13 @@
|
|||
#include "nsDependentSubstring.h"
|
||||
#include "nsColor.h"
|
||||
#include "nsCOMArray.h"
|
||||
#include "nsHTMLValue.h"
|
||||
|
||||
typedef unsigned long PtrBits;
|
||||
class nsAString;
|
||||
class nsIAtom;
|
||||
class nsICSSStyleRule;
|
||||
class nsISVGValue;
|
||||
class nsIDocument;
|
||||
|
||||
#define NS_ATTRVALUE_MAX_STRINGLENGTH_ATOM 12
|
||||
|
||||
|
@ -62,6 +62,10 @@ class nsISVGValue;
|
|||
#define NS_ATTRVALUE_INTEGERTYPE_MAXVALUE ((1 << (31 - NS_ATTRVALUE_INTEGERTYPE_BITS)) - 1)
|
||||
#define NS_ATTRVALUE_INTEGERTYPE_MINVALUE (-NS_ATTRVALUE_INTEGERTYPE_MAXVALUE - 1)
|
||||
|
||||
#define NS_ATTRVALUE_ENUMTABLEINDEX_BITS (32 - 16 - NS_ATTRVALUE_INTEGERTYPE_BITS)
|
||||
#define NS_ATTRVALUE_ENUMTABLEINDEX_MAXVALUE ((1 << NS_ATTRVALUE_ENUMTABLEINDEX_BITS) - 1)
|
||||
#define NS_ATTRVALUE_ENUMTABLEINDEX_MASK (PtrBits((1 << NS_ATTRVALUE_ENUMTABLEINDEX_BITS) - 1))
|
||||
|
||||
class nsAttrValue {
|
||||
public:
|
||||
nsAttrValue();
|
||||
|
@ -73,6 +77,9 @@ public:
|
|||
#endif
|
||||
~nsAttrValue();
|
||||
|
||||
static nsresult Init();
|
||||
static void Shutdown();
|
||||
|
||||
// This has to be the same as in ValueBaseType
|
||||
enum ValueType {
|
||||
eString = 0x00, // 00
|
||||
|
@ -98,7 +105,7 @@ public:
|
|||
|
||||
void SetTo(const nsAttrValue& aOther);
|
||||
void SetTo(const nsAString& aValue);
|
||||
void SetTo(PRInt16 aInt, ValueType aType);
|
||||
void SetTo(PRInt16 aInt);
|
||||
void SetTo(nsICSSStyleRule* aValue);
|
||||
#ifdef MOZ_SVG
|
||||
void SetTo(nsISVGValue* aValue);
|
||||
|
@ -107,7 +114,6 @@ public:
|
|||
void SwapValueWith(nsAttrValue& aOther);
|
||||
|
||||
void ToString(nsAString& aResult) const;
|
||||
void ToHTMLValue(nsHTMLValue& aResult) const;
|
||||
|
||||
// Methods to get value. These methods do not convert so only use them
|
||||
// to retrieve the datatype that this nsAttrValue has.
|
||||
|
@ -117,7 +123,7 @@ public:
|
|||
inline PRInt32 GetIntegerValue() const;
|
||||
PRBool GetColorValue(nscolor& aColor) const;
|
||||
inline PRInt32 GetProportionalValue() const;
|
||||
inline PRInt32 GetEnumValue() const;
|
||||
inline PRInt16 GetEnumValue() const;
|
||||
inline float GetPercentValue() const;
|
||||
inline nsCOMArray<nsIAtom>* GetAtomArrayValue() const;
|
||||
inline nsICSSStyleRule* GetCSSStyleRuleValue() const;
|
||||
|
@ -140,6 +146,23 @@ public:
|
|||
void ParseAtomArray(const nsAString& aValue);
|
||||
void ParseStringOrAtom(const nsAString& aValue);
|
||||
|
||||
/**
|
||||
* Structure for a mapping from int (enum) values to strings. When you use
|
||||
* it you generally create an array of them.
|
||||
* Instantiate like this:
|
||||
* EnumTable myTable[] = {
|
||||
* { "string1", 1 },
|
||||
* { "string2", 2 },
|
||||
* { 0 }
|
||||
* }
|
||||
*/
|
||||
struct EnumTable {
|
||||
/** The string the value maps to */
|
||||
const char* tag;
|
||||
/** The enum value that maps to this string */
|
||||
PRInt16 value;
|
||||
};
|
||||
|
||||
/**
|
||||
* Parse into an enum value.
|
||||
*
|
||||
|
@ -149,7 +172,7 @@ public:
|
|||
* @return whether the enum value was found or not
|
||||
*/
|
||||
PRBool ParseEnumValue(const nsAString& aValue,
|
||||
const nsHTMLValue::EnumTable* aTable,
|
||||
const EnumTable* aTable,
|
||||
PRBool aCaseSensitive = PR_FALSE);
|
||||
|
||||
/**
|
||||
|
@ -233,6 +256,8 @@ private:
|
|||
PRBool EnsureEmptyMiscContainer();
|
||||
PRBool EnsureEmptyAtomArray();
|
||||
|
||||
static nsVoidArray* sEnumTableArray;
|
||||
|
||||
PtrBits mBits;
|
||||
};
|
||||
|
||||
|
@ -261,11 +286,14 @@ nsAttrValue::GetProportionalValue() const
|
|||
return GetIntInternal();
|
||||
}
|
||||
|
||||
inline PRInt32
|
||||
inline PRInt16
|
||||
nsAttrValue::GetEnumValue() const
|
||||
{
|
||||
NS_PRECONDITION(Type() == eEnum, "wrong type");
|
||||
return GetIntInternal();
|
||||
// We don't need to worry about sign extension here since we're
|
||||
// returning an PRInt16 which will cut away the top bits.
|
||||
return NS_STATIC_CAST(PRInt16,
|
||||
GetIntInternal() >> NS_ATTRVALUE_ENUMTABLEINDEX_BITS);
|
||||
}
|
||||
|
||||
inline float
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsIDOMHTMLFormElement.h"
|
||||
#include "nsDOMError.h"
|
||||
#include "nsHTMLValue.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsISaveAsCharset.h"
|
||||
|
||||
|
@ -1226,11 +1225,8 @@ nsFormSubmission::GetSubmitCharset(nsGenericHTMLElement* aForm,
|
|||
|
||||
nsresult rv = NS_OK;
|
||||
nsAutoString acceptCharsetValue;
|
||||
nsHTMLValue value;
|
||||
rv = aForm->GetHTMLAttribute(nsHTMLAtoms::acceptcharset, value);
|
||||
if (rv == NS_CONTENT_ATTR_HAS_VALUE && value.GetUnit() == eHTMLUnit_String) {
|
||||
value.GetStringValue(acceptCharsetValue);
|
||||
}
|
||||
aForm->GetAttr(kNameSpaceID_None, nsHTMLAtoms::acceptcharset,
|
||||
acceptCharsetValue);
|
||||
|
||||
PRInt32 charsetLen = acceptCharsetValue.Length();
|
||||
if (charsetLen > 0) {
|
||||
|
@ -1395,11 +1391,9 @@ void
|
|||
nsFormSubmission::GetEnumAttr(nsGenericHTMLElement* aContent,
|
||||
nsIAtom* atom, PRInt32* aValue)
|
||||
{
|
||||
nsHTMLValue value;
|
||||
if (aContent->GetHTMLAttribute(atom, value) == NS_CONTENT_ATTR_HAS_VALUE) {
|
||||
if (eHTMLUnit_Enumerated == value.GetUnit()) {
|
||||
*aValue = value.GetIntValue();
|
||||
}
|
||||
const nsAttrValue* value = aContent->GetParsedAttr(atom);
|
||||
if (value && value->Type() == nsAttrValue::eEnum) {
|
||||
*aValue = value->GetEnumValue();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -479,7 +479,7 @@ nsGenericHTMLElement::SetLang(const nsAString& aLang)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
static const nsHTMLValue::EnumTable kDirTable[] = {
|
||||
static const nsAttrValue::EnumTable kDirTable[] = {
|
||||
{ "ltr", NS_STYLE_DIRECTION_LTR },
|
||||
{ "rtl", NS_STYLE_DIRECTION_RTL },
|
||||
{ 0 }
|
||||
|
@ -488,11 +488,13 @@ static const nsHTMLValue::EnumTable kDirTable[] = {
|
|||
nsresult
|
||||
nsGenericHTMLElement::GetDir(nsAString& aDir)
|
||||
{
|
||||
nsHTMLValue value;
|
||||
nsresult result = GetHTMLAttribute(nsHTMLAtoms::dir, value);
|
||||
const nsAttrValue* attr = mAttrsAndChildren.GetAttr(nsHTMLAtoms::dir);
|
||||
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE == result) {
|
||||
value.EnumValueToString(kDirTable, aDir);
|
||||
if (attr && attr->Type() == nsAttrValue::eInteger) {
|
||||
attr->ToString(aDir);
|
||||
}
|
||||
else {
|
||||
aDir.Truncate();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -1762,12 +1764,7 @@ nsGenericHTMLElement::SetAttrAndNotify(PRInt32 aNamespaceID,
|
|||
|
||||
mutation.mAttrName = aAttribute;
|
||||
nsAutoString newValue;
|
||||
// It sucks that we have to call GetAttr just to get the stringvalue
|
||||
// here, but in SetInlineStyleRule we don't have the stringvalue
|
||||
// directly and it would be a waste of time to get it since in the
|
||||
// common case it's not needed. If we make nsHTMLValue->string
|
||||
// conversion possible we wouldn't have to do this.
|
||||
GetAttr(aNamespaceID, aAttribute, newValue);
|
||||
aParsedValue.ToString(newValue);
|
||||
if (!newValue.IsEmpty()) {
|
||||
mutation.mNewAttrValue = do_GetAtom(newValue);
|
||||
}
|
||||
|
@ -1873,40 +1870,11 @@ nsGenericHTMLElement::GetAttr(PRInt32 aNameSpaceID, nsIAtom *aAttribute,
|
|||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
// Use subclass to convert enums to string.
|
||||
if (attrValue->Type() == nsAttrValue::eEnum) {
|
||||
nsHTMLValue htmlVal(attrValue->GetEnumValue(), eHTMLUnit_Enumerated);
|
||||
if (aNameSpaceID != kNameSpaceID_None ||
|
||||
AttributeToString(aAttribute, htmlVal, aResult) !=
|
||||
NS_CONTENT_ATTR_HAS_VALUE) {
|
||||
NS_NOTREACHED("no enum to string conversion found");
|
||||
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
|
||||
attrValue->ToString(aResult);
|
||||
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsGenericHTMLElement::GetHTMLAttribute(nsIAtom* aAttribute,
|
||||
nsHTMLValue& aValue) const
|
||||
{
|
||||
const nsAttrValue* val = mAttrsAndChildren.GetAttr(aAttribute);
|
||||
|
||||
if (!val) {
|
||||
aValue.Reset();
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
val->ToHTMLValue(aValue);
|
||||
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
|
||||
const nsAttrValue*
|
||||
nsGenericHTMLElement::GetClasses() const
|
||||
{
|
||||
|
@ -2183,22 +2151,6 @@ nsGenericHTMLElement::IsContentOfType(PRUint32 aFlags) const
|
|||
//----------------------------------------------------------------------
|
||||
|
||||
|
||||
nsresult
|
||||
nsGenericHTMLElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
if (nsHTMLAtoms::dir == aAttribute) {
|
||||
if (aValue.GetUnit() == eHTMLUnit_Enumerated) {
|
||||
aValue.EnumValueToString(kDirTable, aResult);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
aResult.Truncate();
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsGenericHTMLElement::ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
|
@ -2415,7 +2367,7 @@ nsGenericHTMLElement::GetPresContext()
|
|||
}
|
||||
|
||||
// XXX check all mappings against ebina's usage
|
||||
static const nsHTMLValue::EnumTable kAlignTable[] = {
|
||||
static const nsAttrValue::EnumTable kAlignTable[] = {
|
||||
{ "left", NS_STYLE_TEXT_ALIGN_LEFT },
|
||||
{ "right", NS_STYLE_TEXT_ALIGN_RIGHT },
|
||||
|
||||
|
@ -2433,7 +2385,7 @@ static const nsHTMLValue::EnumTable kAlignTable[] = {
|
|||
|
||||
// Elements that should return vertical align values "middle", "bottom", and "top"
|
||||
// instead of "center", "baseline", and "texttop" from GetAttribute() should use this
|
||||
static const nsHTMLValue::EnumTable kVAlignTable[] = {
|
||||
static const nsAttrValue::EnumTable kVAlignTable[] = {
|
||||
{ "left", NS_STYLE_TEXT_ALIGN_LEFT },
|
||||
{ "right", NS_STYLE_TEXT_ALIGN_RIGHT },
|
||||
{ "top", NS_STYLE_VERTICAL_ALIGN_TOP },//verified
|
||||
|
@ -2448,7 +2400,7 @@ static const nsHTMLValue::EnumTable kVAlignTable[] = {
|
|||
{ 0 }
|
||||
};
|
||||
|
||||
static const nsHTMLValue::EnumTable kDivAlignTable[] = {
|
||||
static const nsAttrValue::EnumTable kDivAlignTable[] = {
|
||||
{ "left", NS_STYLE_TEXT_ALIGN_LEFT },
|
||||
{ "right", NS_STYLE_TEXT_ALIGN_MOZ_RIGHT },
|
||||
{ "center", NS_STYLE_TEXT_ALIGN_MOZ_CENTER },
|
||||
|
@ -2457,7 +2409,7 @@ static const nsHTMLValue::EnumTable kDivAlignTable[] = {
|
|||
{ 0 }
|
||||
};
|
||||
|
||||
static const nsHTMLValue::EnumTable kFrameborderTable[] = {
|
||||
static const nsAttrValue::EnumTable kFrameborderTable[] = {
|
||||
{ "yes", NS_STYLE_FRAME_YES },
|
||||
{ "no", NS_STYLE_FRAME_NO },
|
||||
{ "1", NS_STYLE_FRAME_1 },
|
||||
|
@ -2465,7 +2417,7 @@ static const nsHTMLValue::EnumTable kFrameborderTable[] = {
|
|||
{ 0 }
|
||||
};
|
||||
|
||||
static const nsHTMLValue::EnumTable kScrollingTable[] = {
|
||||
static const nsAttrValue::EnumTable kScrollingTable[] = {
|
||||
{ "yes", NS_STYLE_FRAME_YES },
|
||||
{ "no", NS_STYLE_FRAME_NO },
|
||||
{ "on", NS_STYLE_FRAME_ON },
|
||||
|
@ -2476,7 +2428,7 @@ static const nsHTMLValue::EnumTable kScrollingTable[] = {
|
|||
{ 0 }
|
||||
};
|
||||
|
||||
static const nsHTMLValue::EnumTable kTableVAlignTable[] = {
|
||||
static const nsAttrValue::EnumTable kTableVAlignTable[] = {
|
||||
{ "top", NS_STYLE_VERTICAL_ALIGN_TOP },
|
||||
{ "middle", NS_STYLE_VERTICAL_ALIGN_MIDDLE },
|
||||
{ "bottom", NS_STYLE_VERTICAL_ALIGN_BOTTOM },
|
||||
|
@ -2494,7 +2446,7 @@ nsGenericHTMLElement::ParseAlignValue(const nsAString& aString,
|
|||
//----------------------------------------
|
||||
|
||||
// Vanilla table as defined by the html4 spec...
|
||||
static const nsHTMLValue::EnumTable kTableHAlignTable[] = {
|
||||
static const nsAttrValue::EnumTable kTableHAlignTable[] = {
|
||||
{ "left", NS_STYLE_TEXT_ALIGN_LEFT },
|
||||
{ "right", NS_STYLE_TEXT_ALIGN_RIGHT },
|
||||
{ "center", NS_STYLE_TEXT_ALIGN_CENTER },
|
||||
|
@ -2504,7 +2456,7 @@ static const nsHTMLValue::EnumTable kTableHAlignTable[] = {
|
|||
};
|
||||
|
||||
// This table is used for TABLE when in compatability mode
|
||||
static const nsHTMLValue::EnumTable kCompatTableHAlignTable[] = {
|
||||
static const nsAttrValue::EnumTable kCompatTableHAlignTable[] = {
|
||||
{ "left", NS_STYLE_TEXT_ALIGN_LEFT },
|
||||
{ "right", NS_STYLE_TEXT_ALIGN_RIGHT },
|
||||
{ "center", NS_STYLE_TEXT_ALIGN_CENTER },
|
||||
|
@ -2526,20 +2478,10 @@ nsGenericHTMLElement::ParseTableHAlignValue(const nsAString& aString,
|
|||
return aResult.ParseEnumValue(aString, kTableHAlignTable);
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsGenericHTMLElement::TableHAlignValueToString(const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
if (InNavQuirksMode(GetOwnerDoc())) {
|
||||
return aValue.EnumValueToString(kCompatTableHAlignTable, aResult);
|
||||
}
|
||||
return aValue.EnumValueToString(kTableHAlignTable, aResult);
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
|
||||
// These tables are used for TD,TH,TR, etc (but not TABLE)
|
||||
static const nsHTMLValue::EnumTable kTableCellHAlignTable[] = {
|
||||
static const nsAttrValue::EnumTable kTableCellHAlignTable[] = {
|
||||
{ "left", NS_STYLE_TEXT_ALIGN_LEFT },
|
||||
{ "right", NS_STYLE_TEXT_ALIGN_MOZ_RIGHT },
|
||||
{ "center", NS_STYLE_TEXT_ALIGN_MOZ_CENTER },
|
||||
|
@ -2548,7 +2490,7 @@ static const nsHTMLValue::EnumTable kTableCellHAlignTable[] = {
|
|||
{ 0 }
|
||||
};
|
||||
|
||||
static const nsHTMLValue::EnumTable kCompatTableCellHAlignTable[] = {
|
||||
static const nsAttrValue::EnumTable kCompatTableCellHAlignTable[] = {
|
||||
{ "left", NS_STYLE_TEXT_ALIGN_LEFT },
|
||||
{ "right", NS_STYLE_TEXT_ALIGN_MOZ_RIGHT },
|
||||
{ "center", NS_STYLE_TEXT_ALIGN_MOZ_CENTER },
|
||||
|
@ -2561,7 +2503,6 @@ static const nsHTMLValue::EnumTable kCompatTableCellHAlignTable[] = {
|
|||
// NS_STYLE_TEXT_ALIGN_CENTER to map to center by using the following order
|
||||
{ "center", NS_STYLE_TEXT_ALIGN_CENTER },
|
||||
{ "absmiddle", NS_STYLE_TEXT_ALIGN_CENTER },
|
||||
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
|
@ -2575,16 +2516,6 @@ nsGenericHTMLElement::ParseTableCellHAlignValue(const nsAString& aString,
|
|||
return aResult.ParseEnumValue(aString, kTableCellHAlignTable);
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsGenericHTMLElement::TableCellHAlignValueToString(const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
if (InNavQuirksMode(GetOwnerDoc())) {
|
||||
return aValue.EnumValueToString(kCompatTableCellHAlignTable, aResult);
|
||||
}
|
||||
return aValue.EnumValueToString(kTableCellHAlignTable, aResult);
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
|
||||
PRBool
|
||||
|
@ -2594,27 +2525,6 @@ nsGenericHTMLElement::ParseTableVAlignValue(const nsAString& aString,
|
|||
return aResult.ParseEnumValue(aString, kTableVAlignTable);
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsGenericHTMLElement::AlignValueToString(const nsHTMLValue& aValue,
|
||||
nsAString& aResult)
|
||||
{
|
||||
return aValue.EnumValueToString(kAlignTable, aResult);
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsGenericHTMLElement::VAlignValueToString(const nsHTMLValue& aValue,
|
||||
nsAString& aResult)
|
||||
{
|
||||
return aValue.EnumValueToString(kVAlignTable, aResult);
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsGenericHTMLElement::TableVAlignValueToString(const nsHTMLValue& aValue,
|
||||
nsAString& aResult)
|
||||
{
|
||||
return aValue.EnumValueToString(kTableVAlignTable, aResult);
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsGenericHTMLElement::ParseDivAlignValue(const nsAString& aString,
|
||||
nsAttrValue& aResult) const
|
||||
|
@ -2622,13 +2532,6 @@ nsGenericHTMLElement::ParseDivAlignValue(const nsAString& aString,
|
|||
return aResult.ParseEnumValue(aString, kDivAlignTable);
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsGenericHTMLElement::DivAlignValueToString(const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
return aValue.EnumValueToString(kDivAlignTable, aResult);
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsGenericHTMLElement::ParseImageAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aString,
|
||||
|
@ -2653,13 +2556,6 @@ nsGenericHTMLElement::ParseFrameborderValue(const nsAString& aString,
|
|||
return aResult.ParseEnumValue(aString, kFrameborderTable);
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsGenericHTMLElement::FrameborderValueToString(const nsHTMLValue& aValue,
|
||||
nsAString& aResult)
|
||||
{
|
||||
return aValue.EnumValueToString(kFrameborderTable, aResult);
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsGenericHTMLElement::ParseScrollingValue(const nsAString& aString,
|
||||
nsAttrValue& aResult)
|
||||
|
@ -2667,13 +2563,6 @@ nsGenericHTMLElement::ParseScrollingValue(const nsAString& aString,
|
|||
return aResult.ParseEnumValue(aString, kScrollingTable);
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsGenericHTMLElement::ScrollingValueToString(const nsHTMLValue& aValue,
|
||||
nsAString& aResult)
|
||||
{
|
||||
return aValue.EnumValueToString(kScrollingTable, aResult);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsGenericHTMLElement::ReparseStyleAttribute()
|
||||
{
|
||||
|
|
|
@ -62,7 +62,6 @@ class nsIForm;
|
|||
class nsIPresState;
|
||||
class nsIScrollableView;
|
||||
class nsILayoutHistoryState;
|
||||
class nsHTMLValue;
|
||||
struct nsRect;
|
||||
struct nsSize;
|
||||
struct nsRuleData;
|
||||
|
@ -239,7 +238,10 @@ public:
|
|||
|
||||
// HTML element methods
|
||||
void Compact() { mAttrsAndChildren.Compact(); }
|
||||
nsresult GetHTMLAttribute(nsIAtom* aAttribute, nsHTMLValue& aValue) const;
|
||||
const nsAttrValue* GetParsedAttr(nsIAtom* aAttr) const
|
||||
{
|
||||
return mAttrsAndChildren.GetAttr(aAttr);
|
||||
}
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
|
||||
// Implementation for nsIStyledContent
|
||||
|
@ -253,22 +255,6 @@ public:
|
|||
already_AddRefed<nsIURI> GetBaseURI() const;
|
||||
|
||||
//----------------------------------------
|
||||
/**
|
||||
* Turn an attribute value into string based on the type of attribute
|
||||
* (does not need to do standard types such as string, integer,
|
||||
* color ...). Called by GetAttr().
|
||||
*
|
||||
* @param aAttribute the attribute to convert
|
||||
* @param aValue the value to convert
|
||||
* @param aResult the string [OUT]
|
||||
* @return NS_CONTENT_ATTR_HAS_VALUE if the value was successfully converted
|
||||
* NS_CONTENT_ATTR_NOT_THERE if the value could not be converted
|
||||
* @see nsGenericHTMLElement::GetAttr
|
||||
*/
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
|
||||
/**
|
||||
* Convert an attribute string value to attribute type based on the type of
|
||||
* attribute. Called by SetAttr().
|
||||
|
@ -353,15 +339,6 @@ public:
|
|||
*/
|
||||
PRBool ParseDivAlignValue(const nsAString& aString,
|
||||
nsAttrValue& aResult) const;
|
||||
/**
|
||||
* Convert a div align value to string
|
||||
*
|
||||
* @param aValue the value to convert
|
||||
* @param aResult the resulting string
|
||||
* @return whether the value was converted
|
||||
*/
|
||||
PRBool DivAlignValueToString(const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
|
||||
/**
|
||||
* Convert a table halign string to value (left/right/center/char/justify)
|
||||
|
@ -372,15 +349,6 @@ public:
|
|||
*/
|
||||
PRBool ParseTableHAlignValue(const nsAString& aString,
|
||||
nsAttrValue& aResult) const;
|
||||
/**
|
||||
* Convert a table halign value to string
|
||||
*
|
||||
* @param aValue the value to convert
|
||||
* @param aResult the resulting string
|
||||
* @return whether the value was converted
|
||||
*/
|
||||
PRBool TableHAlignValueToString(const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
|
||||
/**
|
||||
* Convert a table cell halign string to value
|
||||
|
@ -391,15 +359,6 @@ public:
|
|||
*/
|
||||
PRBool ParseTableCellHAlignValue(const nsAString& aString,
|
||||
nsAttrValue& aResult) const;
|
||||
/**
|
||||
* Convert a table cell halign value to string
|
||||
*
|
||||
* @param aValue the value to convert
|
||||
* @param aResult the resulting string
|
||||
* @return whether the value was converted
|
||||
*/
|
||||
PRBool TableCellHAlignValueToString(const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
|
||||
/**
|
||||
* Convert a table valign string to value (left/right/center/char/justify/
|
||||
|
@ -411,36 +370,6 @@ public:
|
|||
*/
|
||||
static PRBool ParseTableVAlignValue(const nsAString& aString,
|
||||
nsAttrValue& aResult);
|
||||
/**
|
||||
* Convert a table valign value to string
|
||||
*
|
||||
* @param aValue the value to convert
|
||||
* @param aResult the resulting string
|
||||
* @return whether the value was converted
|
||||
*/
|
||||
static PRBool TableVAlignValueToString(const nsHTMLValue& aValue,
|
||||
nsAString& aResult);
|
||||
|
||||
/**
|
||||
* Convert an align value to string (left/right/texttop/baseline/center/
|
||||
* bottom/top/middle/absbottom/abscenter/absmiddle)
|
||||
*
|
||||
* @param aValue the value to convert
|
||||
* @param aResult the resulting string
|
||||
* @return whether the value was converted
|
||||
*/
|
||||
static PRBool AlignValueToString(const nsHTMLValue& aValue,
|
||||
nsAString& aResult);
|
||||
|
||||
/**
|
||||
* Convert a valign value to string
|
||||
*
|
||||
* @param aValue the value to convert
|
||||
* @param aResult the resulting string
|
||||
* @return whether the value was converted
|
||||
*/
|
||||
static PRBool VAlignValueToString(const nsHTMLValue& aValue,
|
||||
nsAString& aResult);
|
||||
|
||||
/**
|
||||
* Convert an image attribute to value (width, height, hspace, vspace, border)
|
||||
|
@ -462,15 +391,6 @@ public:
|
|||
*/
|
||||
static PRBool ParseFrameborderValue(const nsAString& aString,
|
||||
nsAttrValue& aResult);
|
||||
/**
|
||||
* Convert a frameborder value to string
|
||||
*
|
||||
* @param aValue the value to convert
|
||||
* @param aResult the resulting string
|
||||
* @return whether the value was converted
|
||||
*/
|
||||
static PRBool FrameborderValueToString(const nsHTMLValue& aValue,
|
||||
nsAString& aResult);
|
||||
|
||||
/**
|
||||
* Convert a scrolling string to value (yes/no/on/off/scroll/noscroll/auto)
|
||||
|
@ -481,15 +401,6 @@ public:
|
|||
*/
|
||||
static PRBool ParseScrollingValue(const nsAString& aString,
|
||||
nsAttrValue& aResult);
|
||||
/**
|
||||
* Convert a scrolling value to string
|
||||
*
|
||||
* @param aValue the value to convert
|
||||
* @param aResult the resulting string
|
||||
* @return whether the value was converted
|
||||
*/
|
||||
static PRBool ScrollingValueToString(const nsHTMLValue& aValue,
|
||||
nsAString& aResult);
|
||||
|
||||
/**
|
||||
* Create the style struct from the style attr. Used when an element is first
|
||||
|
|
|
@ -85,9 +85,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
|
||||
|
@ -166,20 +163,6 @@ nsHTMLAppletElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLAppletElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
nsGenericHTMLElement::VAlignValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
static void
|
||||
MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
||||
nsRuleData* aData)
|
||||
|
|
|
@ -68,9 +68,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
};
|
||||
|
@ -104,7 +101,7 @@ NS_IMPL_DOM_CLONENODE(nsHTMLBRElement)
|
|||
|
||||
NS_IMPL_STRING_ATTR(nsHTMLBRElement, Clear, clear)
|
||||
|
||||
static const nsHTMLValue::EnumTable kClearTable[] = {
|
||||
static const nsAttrValue::EnumTable kClearTable[] = {
|
||||
{ "left", NS_STYLE_CLEAR_LEFT },
|
||||
{ "right", NS_STYLE_CLEAR_RIGHT },
|
||||
{ "all", NS_STYLE_CLEAR_LEFT_AND_RIGHT },
|
||||
|
@ -124,20 +121,6 @@ nsHTMLBRElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLBRElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::clear) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
aValue.EnumValueToString(kClearTable, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
static void
|
||||
MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
||||
nsRuleData* aData)
|
||||
|
|
|
@ -138,8 +138,6 @@ BodyRule::MapRuleInfoInto(nsRuleData* aData)
|
|||
if (!aData || (aData->mSID != eStyleStruct_Margin) || !aData->mMarginData || !mPart)
|
||||
return NS_OK; // We only care about margins.
|
||||
|
||||
nsHTMLValue value;
|
||||
|
||||
PRInt32 bodyMarginWidth = -1;
|
||||
PRInt32 bodyMarginHeight = -1;
|
||||
PRInt32 bodyTopMargin = -1;
|
||||
|
@ -152,11 +150,12 @@ BodyRule::MapRuleInfoInto(nsRuleData* aData)
|
|||
nsCompatibility mode = aData->mPresContext->CompatibilityMode();
|
||||
|
||||
|
||||
const nsAttrValue* value;
|
||||
if (mPart->GetAttrCount() > 0) {
|
||||
// if marginwidth/marginheight are set, reflect them as 'margin'
|
||||
mPart->GetHTMLAttribute(nsHTMLAtoms::marginwidth, value);
|
||||
if (eHTMLUnit_Integer == value.GetUnit()) {
|
||||
bodyMarginWidth = value.GetIntValue();
|
||||
value = mPart->GetParsedAttr(nsHTMLAtoms::marginwidth);
|
||||
if (value && value->Type() == nsAttrValue::eInteger) {
|
||||
bodyMarginWidth = value->GetIntegerValue();
|
||||
if (bodyMarginWidth < 0) bodyMarginWidth = 0;
|
||||
nsCSSRect& margin = aData->mMarginData->mMargin;
|
||||
if (margin.mLeft.GetUnit() == eCSSUnit_Null)
|
||||
|
@ -165,9 +164,9 @@ BodyRule::MapRuleInfoInto(nsRuleData* aData)
|
|||
margin.mRight.SetFloatValue((float)bodyMarginWidth, eCSSUnit_Pixel);
|
||||
}
|
||||
|
||||
mPart->GetHTMLAttribute(nsHTMLAtoms::marginheight, value);
|
||||
if (eHTMLUnit_Integer == value.GetUnit()) {
|
||||
bodyMarginHeight = value.GetIntValue();
|
||||
value = mPart->GetParsedAttr(nsHTMLAtoms::marginheight);
|
||||
if (value && value->Type() == nsAttrValue::eInteger) {
|
||||
bodyMarginHeight = value->GetIntegerValue();
|
||||
if (bodyMarginHeight < 0) bodyMarginHeight = 0;
|
||||
nsCSSRect& margin = aData->mMarginData->mMargin;
|
||||
if (margin.mTop.GetUnit() == eCSSUnit_Null)
|
||||
|
@ -178,9 +177,9 @@ BodyRule::MapRuleInfoInto(nsRuleData* aData)
|
|||
|
||||
if (eCompatibility_NavQuirks == mode){
|
||||
// topmargin (IE-attribute)
|
||||
mPart->GetHTMLAttribute(nsHTMLAtoms::topmargin, value);
|
||||
if (eHTMLUnit_Integer == value.GetUnit()) {
|
||||
bodyTopMargin = value.GetIntValue();
|
||||
value = mPart->GetParsedAttr(nsHTMLAtoms::topmargin);
|
||||
if (value && value->Type() == nsAttrValue::eInteger) {
|
||||
bodyTopMargin = value->GetIntegerValue();
|
||||
if (bodyTopMargin < 0) bodyTopMargin = 0;
|
||||
nsCSSRect& margin = aData->mMarginData->mMargin;
|
||||
if (margin.mTop.GetUnit() == eCSSUnit_Null)
|
||||
|
@ -188,9 +187,9 @@ BodyRule::MapRuleInfoInto(nsRuleData* aData)
|
|||
}
|
||||
|
||||
// bottommargin (IE-attribute)
|
||||
mPart->GetHTMLAttribute(nsHTMLAtoms::bottommargin, value);
|
||||
if (eHTMLUnit_Integer == value.GetUnit()) {
|
||||
bodyBottomMargin = value.GetIntValue();
|
||||
value = mPart->GetParsedAttr(nsHTMLAtoms::bottommargin);
|
||||
if (value && value->Type() == nsAttrValue::eInteger) {
|
||||
bodyBottomMargin = value->GetIntegerValue();
|
||||
if (bodyBottomMargin < 0) bodyBottomMargin = 0;
|
||||
nsCSSRect& margin = aData->mMarginData->mMargin;
|
||||
if (margin.mBottom.GetUnit() == eCSSUnit_Null)
|
||||
|
@ -198,9 +197,9 @@ BodyRule::MapRuleInfoInto(nsRuleData* aData)
|
|||
}
|
||||
|
||||
// leftmargin (IE-attribute)
|
||||
mPart->GetHTMLAttribute(nsHTMLAtoms::leftmargin, value);
|
||||
if (eHTMLUnit_Integer == value.GetUnit()) {
|
||||
bodyLeftMargin = value.GetIntValue();
|
||||
value = mPart->GetParsedAttr(nsHTMLAtoms::leftmargin);
|
||||
if (value && value->Type() == nsAttrValue::eInteger) {
|
||||
bodyLeftMargin = value->GetIntegerValue();
|
||||
if (bodyLeftMargin < 0) bodyLeftMargin = 0;
|
||||
nsCSSRect& margin = aData->mMarginData->mMargin;
|
||||
if (margin.mLeft.GetUnit() == eCSSUnit_Null)
|
||||
|
@ -208,9 +207,9 @@ BodyRule::MapRuleInfoInto(nsRuleData* aData)
|
|||
}
|
||||
|
||||
// rightmargin (IE-attribute)
|
||||
mPart->GetHTMLAttribute(nsHTMLAtoms::rightmargin, value);
|
||||
if (eHTMLUnit_Integer == value.GetUnit()) {
|
||||
bodyRightMargin = value.GetIntValue();
|
||||
value = mPart->GetParsedAttr(nsHTMLAtoms::rightmargin);
|
||||
if (value && value->Type() == nsAttrValue::eInteger) {
|
||||
bodyRightMargin = value->GetIntegerValue();
|
||||
if (bodyRightMargin < 0) bodyRightMargin = 0;
|
||||
nsCSSRect& margin = aData->mMarginData->mMargin;
|
||||
if (margin.mRight.GetUnit() == eCSSUnit_Null)
|
||||
|
|
|
@ -101,9 +101,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
virtual nsresult HandleDOMEvent(nsPresContext* aPresContext,
|
||||
nsEvent* aEvent, nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
|
@ -253,7 +250,7 @@ nsHTMLButtonElement::SetFocus(nsPresContext* aPresContext)
|
|||
}
|
||||
}
|
||||
|
||||
static const nsHTMLValue::EnumTable kButtonTypeTable[] = {
|
||||
static const nsAttrValue::EnumTable kButtonTypeTable[] = {
|
||||
{ "button", NS_FORM_BUTTON_BUTTON },
|
||||
{ "reset", NS_FORM_BUTTON_RESET },
|
||||
{ "submit", NS_FORM_BUTTON_SUBMIT },
|
||||
|
@ -278,22 +275,6 @@ nsHTMLButtonElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLButtonElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::type) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
aValue.EnumValueToString(kButtonTypeTable, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
return nsGenericHTMLFormElement::AttributeToString(aAttribute, aValue,
|
||||
aResult);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsHTMLButtonElement::HandleDOMEvent(nsPresContext* aPresContext,
|
||||
nsEvent* aEvent,
|
||||
|
|
|
@ -70,9 +70,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
};
|
||||
|
@ -130,20 +127,6 @@ nsHTMLDivElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDivElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
DivAlignValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
static void
|
||||
MapAttributesIntoRule(const nsMappedAttributes* aAttributes, nsRuleData* aData)
|
||||
{
|
||||
|
|
|
@ -72,9 +72,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
};
|
||||
|
@ -110,6 +107,32 @@ NS_IMPL_STRING_ATTR(nsHTMLFontElement, Color, color)
|
|||
NS_IMPL_STRING_ATTR(nsHTMLFontElement, Face, face)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLFontElement, Size, size)
|
||||
|
||||
static const nsAttrValue::EnumTable kRelFontSizeTable[] = {
|
||||
{ "-10", -10 },
|
||||
{ "-9", -9 },
|
||||
{ "-8", -8 },
|
||||
{ "-7", -7 },
|
||||
{ "-6", -6 },
|
||||
{ "-5", -5 },
|
||||
{ "-4", -4 },
|
||||
{ "-3", -3 },
|
||||
{ "-2", -2 },
|
||||
{ "-1", -1 },
|
||||
{ "-0", 0 },
|
||||
{ "+0", 0 },
|
||||
{ "+1", 1 },
|
||||
{ "+2", 2 },
|
||||
{ "+3", 3 },
|
||||
{ "+4", 4 },
|
||||
{ "+5", 5 },
|
||||
{ "+6", 6 },
|
||||
{ "+7", 7 },
|
||||
{ "+8", 8 },
|
||||
{ "+9", 9 },
|
||||
{ "+10", 10 },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
|
||||
PRBool
|
||||
nsHTMLFontElement::ParseAttribute(nsIAtom* aAttribute,
|
||||
|
@ -118,15 +141,13 @@ nsHTMLFontElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
{
|
||||
if (aAttribute == nsHTMLAtoms::size) {
|
||||
nsAutoString tmp(aValue);
|
||||
PRInt32 ec, v = tmp.ToInteger(&ec);
|
||||
if(NS_SUCCEEDED(ec)) {
|
||||
tmp.CompressWhitespace(PR_TRUE, PR_FALSE);
|
||||
PRUnichar ch = tmp.First();
|
||||
aResult.SetTo(v, (ch == '+' || ch == '-') ?
|
||||
nsAttrValue::eEnum : nsAttrValue::eInteger);
|
||||
return PR_TRUE;
|
||||
tmp.CompressWhitespace(PR_TRUE, PR_TRUE);
|
||||
PRUnichar ch = tmp.First();
|
||||
if (ch == '+' || ch == '-') {
|
||||
return aResult.ParseEnumValue(aValue, kRelFontSizeTable);
|
||||
}
|
||||
return PR_FALSE;
|
||||
|
||||
return aResult.ParseIntValue(aValue);
|
||||
}
|
||||
if (aAttribute == nsHTMLAtoms::pointSize ||
|
||||
aAttribute == nsHTMLAtoms::fontWeight) {
|
||||
|
@ -139,33 +160,6 @@ nsHTMLFontElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFontElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
if ((aAttribute == nsHTMLAtoms::size) ||
|
||||
(aAttribute == nsHTMLAtoms::pointSize) ||
|
||||
(aAttribute == nsHTMLAtoms::fontWeight)) {
|
||||
if (aValue.GetUnit() == eHTMLUnit_Enumerated) {
|
||||
nsAutoString intVal;
|
||||
PRInt32 value = aValue.GetIntValue();
|
||||
intVal.AppendInt(value, 10);
|
||||
if (value >= 0) {
|
||||
aResult = NS_LITERAL_STRING("+") + intVal;
|
||||
}
|
||||
else {
|
||||
aResult = intVal;
|
||||
}
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
static void
|
||||
MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
||||
nsRuleData* aData)
|
||||
|
|
|
@ -164,9 +164,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
virtual nsresult HandleDOMEvent(nsPresContext* aPresContext,
|
||||
nsEvent* aEvent, nsIDOMEvent** aDOMEvent,
|
||||
PRUint32 aFlags,
|
||||
|
@ -586,13 +583,13 @@ nsHTMLFormElement::Reset()
|
|||
return rv;
|
||||
}
|
||||
|
||||
static const nsHTMLValue::EnumTable kFormMethodTable[] = {
|
||||
static const nsAttrValue::EnumTable kFormMethodTable[] = {
|
||||
{ "get", NS_FORM_METHOD_GET },
|
||||
{ "post", NS_FORM_METHOD_POST },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
static const nsHTMLValue::EnumTable kFormEnctypeTable[] = {
|
||||
static const nsAttrValue::EnumTable kFormEnctypeTable[] = {
|
||||
{ "multipart/form-data", NS_FORM_ENCTYPE_MULTIPART },
|
||||
{ "application/x-www-form-urlencoded", NS_FORM_ENCTYPE_URLENCODED },
|
||||
{ "text/plain", NS_FORM_ENCTYPE_TEXTPLAIN },
|
||||
|
@ -614,27 +611,6 @@ nsHTMLFormElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFormElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::method) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
aValue.EnumValueToString(kFormMethodTable, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::enctype) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
aValue.EnumValueToString(kFormEnctypeTable, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
void
|
||||
nsHTMLFormElement::SetDocument(nsIDocument* aDocument, PRBool aDeep,
|
||||
PRBool aCompileEventHandlers)
|
||||
|
|
|
@ -69,10 +69,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
};
|
||||
|
@ -146,24 +142,6 @@ nsHTMLFrameElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLFrameElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFrameElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::frameborder) {
|
||||
FrameborderValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::scrolling) {
|
||||
ScrollingValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
|
||||
return nsGenericHTMLFrameElement::AttributeToString(aAttribute, aValue,
|
||||
aResult);
|
||||
}
|
||||
|
||||
static void
|
||||
MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
||||
nsRuleData* aData)
|
||||
|
|
|
@ -85,9 +85,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute,
|
||||
PRInt32 aModType) const;
|
||||
private:
|
||||
|
@ -221,12 +218,9 @@ nsHTMLFrameSetElement::GetRowSpec(PRInt32 *aNumValues,
|
|||
*aSpecs = nsnull;
|
||||
|
||||
if (!mRowSpecs) {
|
||||
nsHTMLValue value;
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE == GetHTMLAttribute(nsHTMLAtoms::rows, value) &&
|
||||
eHTMLUnit_String == value.GetUnit()) {
|
||||
nsAutoString rows;
|
||||
value.GetStringValue(rows);
|
||||
nsresult rv = ParseRowCol(rows, mNumRows, &mRowSpecs);
|
||||
const nsAttrValue* value = GetParsedAttr(nsHTMLAtoms::rows);
|
||||
if (value && value->Type() == nsAttrValue::eString) {
|
||||
nsresult rv = ParseRowCol(value->GetStringValue(), mNumRows, &mRowSpecs);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
|
@ -257,12 +251,9 @@ nsHTMLFrameSetElement::GetColSpec(PRInt32 *aNumValues,
|
|||
*aSpecs = nsnull;
|
||||
|
||||
if (!mColSpecs) {
|
||||
nsHTMLValue value;
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE == GetHTMLAttribute(nsHTMLAtoms::cols, value) &&
|
||||
eHTMLUnit_String == value.GetUnit()) {
|
||||
nsAutoString cols;
|
||||
value.GetStringValue(cols);
|
||||
nsresult rv = ParseRowCol(cols, mNumCols, &mColSpecs);
|
||||
const nsAttrValue* value = GetParsedAttr(nsHTMLAtoms::cols);
|
||||
if (value && value->Type() == nsAttrValue::eString) {
|
||||
nsresult rv = ParseRowCol(value->GetStringValue(), mNumCols, &mColSpecs);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
|
@ -302,18 +293,6 @@ nsHTMLFrameSetElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLFrameSetElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::frameborder) {
|
||||
nsGenericHTMLElement::FrameborderValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
nsChangeHint
|
||||
nsHTMLFrameSetElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
|
||||
PRInt32 aModType) const
|
||||
|
|
|
@ -73,9 +73,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
};
|
||||
|
@ -115,7 +112,7 @@ NS_IMPL_STRING_ATTR(nsHTMLHRElement, Size, size)
|
|||
NS_IMPL_STRING_ATTR(nsHTMLHRElement, Width, width)
|
||||
NS_IMPL_STRING_ATTR(nsHTMLHRElement, Color, color)
|
||||
|
||||
static const nsHTMLValue::EnumTable kAlignTable[] = {
|
||||
static const nsAttrValue::EnumTable kAlignTable[] = {
|
||||
{ "left", NS_STYLE_TEXT_ALIGN_LEFT },
|
||||
{ "right", NS_STYLE_TEXT_ALIGN_RIGHT },
|
||||
{ "center", NS_STYLE_TEXT_ALIGN_CENTER },
|
||||
|
@ -143,21 +140,6 @@ nsHTMLHRElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHRElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
aValue.EnumValueToString(kAlignTable, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
static void
|
||||
MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
||||
nsRuleData* aData)
|
||||
|
|
|
@ -68,9 +68,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
};
|
||||
|
@ -118,21 +115,6 @@ nsHTMLHeadingElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLHeadingElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
DivAlignValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
static void
|
||||
MapAttributesIntoRule(const nsMappedAttributes* aAttributes, nsRuleData* aData)
|
||||
{
|
||||
|
|
|
@ -70,10 +70,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
};
|
||||
|
@ -152,30 +148,6 @@ nsHTMLIFrameElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLFrameElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLIFrameElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::frameborder) {
|
||||
FrameborderValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::scrolling) {
|
||||
ScrollingValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
VAlignValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
return nsGenericHTMLFrameElement::AttributeToString(aAttribute, aValue,
|
||||
aResult);
|
||||
}
|
||||
|
||||
static void
|
||||
MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
||||
nsRuleData* aData)
|
||||
|
|
|
@ -117,9 +117,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute,
|
||||
PRInt32 aModType) const;
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
|
@ -363,22 +360,22 @@ nsHTMLImageElement::GetWidthHeight()
|
|||
size.height = NSTwipsToIntPixels(size.height, t2p);
|
||||
}
|
||||
} else {
|
||||
nsHTMLValue value;
|
||||
const nsAttrValue* value;
|
||||
nsCOMPtr<imgIContainer> image;
|
||||
if (mCurrentRequest) {
|
||||
mCurrentRequest->GetImage(getter_AddRefs(image));
|
||||
}
|
||||
|
||||
if (GetHTMLAttribute(nsHTMLAtoms::width,
|
||||
value) == NS_CONTENT_ATTR_HAS_VALUE) {
|
||||
size.width = value.GetIntValue();
|
||||
if ((value = GetParsedAttr(nsHTMLAtoms::width)) &&
|
||||
value->Type() == nsAttrValue::eInteger) {
|
||||
size.width = value->GetIntegerValue();
|
||||
} else if (image) {
|
||||
image->GetWidth(&size.width);
|
||||
}
|
||||
|
||||
if (GetHTMLAttribute(nsHTMLAtoms::height,
|
||||
value) == NS_CONTENT_ATTR_HAS_VALUE) {
|
||||
size.height = value.GetIntValue();
|
||||
if ((value = GetParsedAttr(nsHTMLAtoms::height)) &&
|
||||
value->Type() == nsAttrValue::eInteger) {
|
||||
size.height = value->GetIntegerValue();
|
||||
} else if (image) {
|
||||
image->GetHeight(&size.height);
|
||||
}
|
||||
|
@ -443,21 +440,6 @@ nsHTMLImageElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLImageElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
VAlignValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
static void
|
||||
MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
||||
nsRuleData* aData)
|
||||
|
|
|
@ -179,9 +179,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute,
|
||||
PRInt32 aModType) const;
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
|
@ -564,13 +561,12 @@ NS_IMPL_STRING_ATTR(nsHTMLInputElement, UseMap, usemap)
|
|||
NS_IMETHODIMP
|
||||
nsHTMLInputElement::GetSize(PRUint32* aValue)
|
||||
{
|
||||
*aValue = 0;
|
||||
|
||||
nsHTMLValue value;
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE ==
|
||||
GetHTMLAttribute(nsHTMLAtoms::size, value) &&
|
||||
value.GetUnit() == eHTMLUnit_Integer) {
|
||||
*aValue = value.GetIntValue();
|
||||
const nsAttrValue* attrVal = mAttrsAndChildren.GetAttr(nsHTMLAtoms::size);
|
||||
if (attrVal && attrVal->Type() == nsAttrValue::eInteger) {
|
||||
*aValue = attrVal->GetIntegerValue();
|
||||
}
|
||||
else {
|
||||
*aValue = 0;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -1727,8 +1723,7 @@ nsHTMLInputElement::SetParent(nsIContent* aParent)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
static const nsHTMLValue::EnumTable kInputTypeTable[] = {
|
||||
static const nsAttrValue::EnumTable kInputTypeTable[] = {
|
||||
{ "button", NS_FORM_INPUT_BUTTON },
|
||||
{ "checkbox", NS_FORM_INPUT_CHECKBOX },
|
||||
{ "file", NS_FORM_INPUT_FILE },
|
||||
|
@ -1795,43 +1790,10 @@ nsHTMLInputElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInputElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::type) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
// The DOM spec says that input types should be capitalized but
|
||||
// AFAIK all existing browsers return the type in lower case,
|
||||
// http://bugzilla.mozilla.org/show_bug.cgi?id=32369 is the bug
|
||||
// about this problem. -- jst@netscape.com
|
||||
// Update. The DOM spec will be changed to have input types be
|
||||
// all-lowercase. See
|
||||
// http://bugzilla.mozilla.org/show_bug.cgi?id=113174#c12
|
||||
// -- bzbarsky@mit.edu
|
||||
|
||||
aValue.EnumValueToString(kInputTypeTable, aResult);
|
||||
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
AlignValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
return nsGenericHTMLFormElement::AttributeToString(aAttribute, aValue,
|
||||
aResult);
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLInputElement::GetType(nsAString& aValue)
|
||||
{
|
||||
const nsHTMLValue::EnumTable *table = kInputTypeTable;
|
||||
const nsAttrValue::EnumTable *table = kInputTypeTable;
|
||||
|
||||
while (table->tag) {
|
||||
if (mType == table->value) {
|
||||
|
|
|
@ -68,9 +68,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
};
|
||||
|
@ -107,7 +104,7 @@ NS_IMPL_STRING_ATTR(nsHTMLLIElement, Type, type)
|
|||
NS_IMPL_INT_ATTR(nsHTMLLIElement, Value, value)
|
||||
|
||||
|
||||
static const nsHTMLValue::EnumTable kUnorderedListItemTypeTable[] = {
|
||||
static const nsAttrValue::EnumTable kUnorderedListItemTypeTable[] = {
|
||||
{ "disc", NS_STYLE_LIST_STYLE_DISC },
|
||||
{ "circle", NS_STYLE_LIST_STYLE_CIRCLE },
|
||||
{ "round", NS_STYLE_LIST_STYLE_CIRCLE },
|
||||
|
@ -115,7 +112,7 @@ static const nsHTMLValue::EnumTable kUnorderedListItemTypeTable[] = {
|
|||
{ 0 }
|
||||
};
|
||||
|
||||
static const nsHTMLValue::EnumTable kOrderedListItemTypeTable[] = {
|
||||
static const nsAttrValue::EnumTable kOrderedListItemTypeTable[] = {
|
||||
{ "A", NS_STYLE_LIST_STYLE_OLD_UPPER_ALPHA },
|
||||
{ "a", NS_STYLE_LIST_STYLE_OLD_LOWER_ALPHA },
|
||||
{ "I", NS_STYLE_LIST_STYLE_OLD_UPPER_ROMAN },
|
||||
|
@ -140,22 +137,6 @@ nsHTMLLIElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLLIElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::type) {
|
||||
if (!aValue.EnumValueToString(kOrderedListItemTypeTable, aResult)) {
|
||||
aValue.EnumValueToString(kUnorderedListItemTypeTable, aResult);
|
||||
}
|
||||
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
|
||||
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
static void
|
||||
MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
||||
nsRuleData* aData)
|
||||
|
|
|
@ -85,9 +85,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute,
|
||||
PRInt32 aModType) const;
|
||||
nsresult SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
|
||||
|
@ -145,7 +142,7 @@ NS_IMPL_STRING_ATTR(nsHTMLLegendElement, AccessKey, accesskey)
|
|||
NS_IMPL_STRING_ATTR(nsHTMLLegendElement, Align, align)
|
||||
|
||||
// this contains center, because IE4 does
|
||||
static const nsHTMLValue::EnumTable kAlignTable[] = {
|
||||
static const nsAttrValue::EnumTable kAlignTable[] = {
|
||||
{ "left", NS_STYLE_TEXT_ALIGN_LEFT },
|
||||
{ "right", NS_STYLE_TEXT_ALIGN_RIGHT },
|
||||
{ "center", NS_STYLE_TEXT_ALIGN_CENTER },
|
||||
|
@ -166,22 +163,6 @@ nsHTMLLegendElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLLegendElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
aValue.EnumValueToString(kAlignTable, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
return nsGenericHTMLFormElement::AttributeToString(aAttribute, aValue,
|
||||
aResult);
|
||||
}
|
||||
|
||||
nsChangeHint
|
||||
nsHTMLLegendElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
|
||||
PRInt32 aModType) const
|
||||
|
|
|
@ -78,9 +78,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
};
|
||||
|
@ -126,7 +123,7 @@ NS_IMPL_INT_ATTR(nsHTMLSharedListElement, Start, start)
|
|||
NS_IMPL_STRING_ATTR(nsHTMLSharedListElement, Type, type)
|
||||
|
||||
|
||||
nsHTMLValue::EnumTable kListTypeTable[] = {
|
||||
nsAttrValue::EnumTable kListTypeTable[] = {
|
||||
{ "none", NS_STYLE_LIST_STYLE_NONE },
|
||||
{ "disc", NS_STYLE_LIST_STYLE_DISC },
|
||||
{ "circle", NS_STYLE_LIST_STYLE_CIRCLE },
|
||||
|
@ -140,7 +137,7 @@ nsHTMLValue::EnumTable kListTypeTable[] = {
|
|||
{ 0 }
|
||||
};
|
||||
|
||||
nsHTMLValue::EnumTable kOldListTypeTable[] = {
|
||||
nsAttrValue::EnumTable kOldListTypeTable[] = {
|
||||
{ "1", NS_STYLE_LIST_STYLE_OLD_DECIMAL },
|
||||
{ "A", NS_STYLE_LIST_STYLE_OLD_UPPER_ALPHA },
|
||||
{ "a", NS_STYLE_LIST_STYLE_OLD_LOWER_ALPHA },
|
||||
|
@ -168,34 +165,6 @@ nsHTMLSharedListElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSharedListElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::type &&
|
||||
(mNodeInfo->Equals(nsHTMLAtoms::ol) ||
|
||||
mNodeInfo->Equals(nsHTMLAtoms::ul))) {
|
||||
PRInt32 v = aValue.GetIntValue();
|
||||
switch (v) {
|
||||
case NS_STYLE_LIST_STYLE_OLD_DECIMAL:
|
||||
case NS_STYLE_LIST_STYLE_OLD_LOWER_ROMAN:
|
||||
case NS_STYLE_LIST_STYLE_OLD_UPPER_ROMAN:
|
||||
case NS_STYLE_LIST_STYLE_OLD_LOWER_ALPHA:
|
||||
case NS_STYLE_LIST_STYLE_OLD_UPPER_ALPHA:
|
||||
aValue.EnumValueToString(kOldListTypeTable, aResult);
|
||||
break;
|
||||
default:
|
||||
aValue.EnumValueToString(kListTypeTable, aResult);
|
||||
break;
|
||||
}
|
||||
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
|
||||
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
static void
|
||||
MapAttributesIntoRule(const nsMappedAttributes* aAttributes, nsRuleData* aData)
|
||||
{
|
||||
|
|
|
@ -87,9 +87,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
|
||||
|
@ -262,22 +259,6 @@ nsHTMLObjectElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
VAlignValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
return nsGenericHTMLFormElement::AttributeToString(aAttribute, aValue,
|
||||
aResult);
|
||||
}
|
||||
|
||||
static void
|
||||
MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
||||
nsRuleData* aData)
|
||||
|
|
|
@ -71,9 +71,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
};
|
||||
|
@ -122,21 +119,6 @@ nsHTMLParagraphElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLParagraphElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
DivAlignValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
static void
|
||||
MapAttributesIntoRule(const nsMappedAttributes* aAttributes, nsRuleData* aData)
|
||||
{
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
#include "nsStyleContext.h"
|
||||
|
||||
// XXX nav4 has type= start= (same as OL/UL)
|
||||
extern nsHTMLValue::EnumTable kListTypeTable[];
|
||||
extern nsAttrValue::EnumTable kListTypeTable[];
|
||||
|
||||
class nsHTMLSharedElement : public nsGenericHTMLElement,
|
||||
public nsImageLoadingContent,
|
||||
|
@ -120,9 +120,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
|
||||
|
@ -294,38 +291,6 @@ nsHTMLSharedElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLSharedElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
if (mNodeInfo->Equals(nsHTMLAtoms::embed)) {
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
AlignValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (mNodeInfo->Equals(nsHTMLAtoms::spacer)) {
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
AlignValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (mNodeInfo->Equals(nsHTMLAtoms::dir) ||
|
||||
mNodeInfo->Equals(nsHTMLAtoms::menu)) {
|
||||
if (aAttribute == nsHTMLAtoms::type) {
|
||||
aValue.EnumValueToString(kListTypeTable, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
// spacer element code
|
||||
|
||||
static void
|
||||
|
|
|
@ -85,9 +85,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
};
|
||||
|
@ -211,22 +208,6 @@ nsHTMLObjectElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLObjectElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
VAlignValueToString(aValue, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
return nsGenericHTMLFormElement::AttributeToString(aAttribute, aValue,
|
||||
aResult);
|
||||
}
|
||||
|
||||
static void
|
||||
MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
||||
nsRuleData* aData)
|
||||
|
|
|
@ -68,9 +68,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
};
|
||||
|
@ -107,7 +104,7 @@ NS_IMPL_DOM_CLONENODE(nsHTMLTableCaptionElement)
|
|||
NS_IMPL_STRING_ATTR(nsHTMLTableCaptionElement, Align, align)
|
||||
|
||||
|
||||
static const nsHTMLValue::EnumTable kCaptionAlignTable[] = {
|
||||
static const nsAttrValue::EnumTable kCaptionAlignTable[] = {
|
||||
{ "left", NS_SIDE_LEFT },
|
||||
{ "right", NS_SIDE_RIGHT },
|
||||
{ "top", NS_SIDE_TOP},
|
||||
|
@ -127,22 +124,6 @@ nsHTMLTableCaptionElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCaptionElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
aValue.EnumValueToString(kCaptionAlignTable, aResult);
|
||||
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
static
|
||||
void MapAttributesIntoRule(const nsMappedAttributes* aAttributes, nsRuleData* aData)
|
||||
{
|
||||
|
|
|
@ -71,9 +71,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker);
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
|
@ -254,7 +251,7 @@ nsHTMLTableCellElement::SetAlign(const nsAString& aValue)
|
|||
}
|
||||
|
||||
|
||||
static const nsHTMLValue::EnumTable kCellScopeTable[] = {
|
||||
static const nsAttrValue::EnumTable kCellScopeTable[] = {
|
||||
{ "row", NS_STYLE_CELL_SCOPE_ROW },
|
||||
{ "col", NS_STYLE_CELL_SCOPE_COL },
|
||||
{ "rowgroup", NS_STYLE_CELL_SCOPE_ROWGROUP },
|
||||
|
@ -284,7 +281,7 @@ nsHTMLTableCellElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
// reset large colspan values as IE and opera do
|
||||
// quirks mode does not honor the special html 4 value of 0
|
||||
if (val > MAX_COLSPAN || val < 0 || (0 == val && InNavQuirksMode(GetOwnerDoc()))) {
|
||||
aResult.SetTo(1, nsAttrValue::eInteger);
|
||||
aResult.SetTo(1);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
|
@ -295,7 +292,7 @@ nsHTMLTableCellElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
PRInt32 val = aResult.GetIntegerValue();
|
||||
// quirks mode does not honor the special html 4 value of 0
|
||||
if (val < 0 || (0 == val && InNavQuirksMode(GetOwnerDoc()))) {
|
||||
aResult.SetTo(1, nsAttrValue::eInteger);
|
||||
aResult.SetTo(1);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
|
@ -322,36 +319,6 @@ nsHTMLTableCellElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableCellElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
/* ignore these attributes, stored already as strings
|
||||
abbr, axis, ch, headers
|
||||
*/
|
||||
/* ignore attributes that are of standard types
|
||||
charoff, colspan, rowspan, height, width, nowrap, background, bgcolor
|
||||
*/
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (TableCellHAlignValueToString(aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::scope) {
|
||||
if (aValue.EnumValueToString(kCellScopeTable, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::valign) {
|
||||
if (TableVAlignValueToString(aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
static
|
||||
void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
||||
nsRuleData* aData)
|
||||
|
|
|
@ -72,9 +72,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
};
|
||||
|
@ -142,31 +139,6 @@ nsHTMLTableColElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableColElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
/* ignore these attributes, stored already as strings
|
||||
ch
|
||||
*/
|
||||
/* ignore attributes that are of standard types
|
||||
charoff, span
|
||||
*/
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (TableCellHAlignValueToString(aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::valign) {
|
||||
if (TableVAlignValueToString(aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
static
|
||||
void MapAttributesIntoRule(const nsMappedAttributes* aAttributes, nsRuleData* aData)
|
||||
{
|
||||
|
|
|
@ -84,9 +84,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
|
||||
|
@ -834,7 +831,7 @@ nsHTMLTableElement::DeleteRow(PRInt32 aValue)
|
|||
return parent->RemoveChild(row, getter_AddRefs(deleted_row));
|
||||
}
|
||||
|
||||
static const nsHTMLValue::EnumTable kFrameTable[] = {
|
||||
static const nsAttrValue::EnumTable kFrameTable[] = {
|
||||
{ "void", NS_STYLE_TABLE_FRAME_NONE },
|
||||
{ "above", NS_STYLE_TABLE_FRAME_ABOVE },
|
||||
{ "below", NS_STYLE_TABLE_FRAME_BELOW },
|
||||
|
@ -847,7 +844,7 @@ static const nsHTMLValue::EnumTable kFrameTable[] = {
|
|||
{ 0 }
|
||||
};
|
||||
|
||||
static const nsHTMLValue::EnumTable kRulesTable[] = {
|
||||
static const nsAttrValue::EnumTable kRulesTable[] = {
|
||||
{ "none", NS_STYLE_TABLE_RULES_NONE },
|
||||
{ "groups", NS_STYLE_TABLE_RULES_GROUPS },
|
||||
{ "rows", NS_STYLE_TABLE_RULES_ROWS },
|
||||
|
@ -856,7 +853,7 @@ static const nsHTMLValue::EnumTable kRulesTable[] = {
|
|||
{ 0 }
|
||||
};
|
||||
|
||||
static const nsHTMLValue::EnumTable kLayoutTable[] = {
|
||||
static const nsAttrValue::EnumTable kLayoutTable[] = {
|
||||
{ "auto", NS_STYLE_TABLE_LAYOUT_AUTO },
|
||||
{ "fixed", NS_STYLE_TABLE_LAYOUT_FIXED },
|
||||
{ 0 }
|
||||
|
@ -879,7 +876,7 @@ nsHTMLTableElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
if (aAttribute == nsHTMLAtoms::border) {
|
||||
if (!aResult.ParseIntWithBounds(aValue, 0)) {
|
||||
// XXX this should really be NavQuirks only to allow non numeric value
|
||||
aResult.SetTo(1, nsAttrValue::eInteger);
|
||||
aResult.SetTo(1);
|
||||
}
|
||||
|
||||
return PR_TRUE;
|
||||
|
@ -922,38 +919,6 @@ nsHTMLTableElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
/* ignore summary, just a string */
|
||||
/* ignore attributes that are of standard types border, cellpadding,
|
||||
cellspacing, cols, height, width, background, bgcolor */
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (TableHAlignValueToString(aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::frame) {
|
||||
if (aValue.EnumValueToString(kFrameTable, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::layout) {
|
||||
if (aValue.EnumValueToString(kLayoutTable, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::rules) {
|
||||
if (aValue.EnumValueToString(kRulesTable, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
static void
|
||||
MapTableFrameInto(const nsMappedAttributes* aAttributes,
|
||||
nsRuleData* aData, PRUint8 aBorderStyle)
|
||||
|
|
|
@ -79,9 +79,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
|
||||
|
@ -410,31 +407,6 @@ nsHTMLTableRowElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableRowElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
/* ignore these attributes, stored already as strings
|
||||
ch
|
||||
*/
|
||||
/* ignore attributes that are of standard types
|
||||
charoff, height, width, background, bgcolor
|
||||
*/
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (TableCellHAlignValueToString(aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::valign) {
|
||||
if (TableVAlignValueToString(aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
static
|
||||
void MapAttributesIntoRule(const nsMappedAttributes* aAttributes, nsRuleData* aData)
|
||||
{
|
||||
|
|
|
@ -74,9 +74,6 @@ public:
|
|||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
||||
const nsAString& aValue,
|
||||
nsAttrValue& aResult);
|
||||
NS_IMETHOD AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const;
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
|
||||
|
@ -260,31 +257,6 @@ nsHTMLTableSectionElement::ParseAttribute(nsIAtom* aAttribute,
|
|||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLTableSectionElement::AttributeToString(nsIAtom* aAttribute,
|
||||
const nsHTMLValue& aValue,
|
||||
nsAString& aResult) const
|
||||
{
|
||||
/* ignore these attributes, stored already as strings
|
||||
ch
|
||||
*/
|
||||
/* ignore attributes that are of standard types
|
||||
charoff, height, width, background, bgcolor
|
||||
*/
|
||||
if (aAttribute == nsHTMLAtoms::align) {
|
||||
if (TableCellHAlignValueToString(aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::valign) {
|
||||
if (TableVAlignValueToString(aValue, aResult)) {
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
return nsGenericHTMLElement::AttributeToString(aAttribute, aValue, aResult);
|
||||
}
|
||||
|
||||
static
|
||||
void MapAttributesIntoRule(const nsMappedAttributes* aAttributes, nsRuleData* aData)
|
||||
{
|
||||
|
|
|
@ -51,7 +51,6 @@
|
|||
// XXX because nsIEventListenerManager has broken includes
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsHTMLValue.h"
|
||||
#include "nsIAtom.h"
|
||||
#include "nsINodeInfo.h"
|
||||
#include "nsIControllers.h"
|
||||
|
|
|
@ -274,6 +274,14 @@ Initialize(nsIModule* aSelf)
|
|||
|
||||
return rv;
|
||||
}
|
||||
rv = nsAttrValue::Init();
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_ERROR("Could not initialize nsAttrValue");
|
||||
|
||||
Shutdown();
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
// Register all of our atoms once
|
||||
nsCSSAnonBoxes::AddRefAtoms();
|
||||
|
@ -417,6 +425,7 @@ Shutdown()
|
|||
NS_IF_RELEASE(nsRuleNode::gLangService);
|
||||
nsGenericHTMLElement::Shutdown();
|
||||
|
||||
nsAttrValue::Shutdown();
|
||||
nsContentUtils::Shutdown();
|
||||
nsLayoutStylesheetCache::Shutdown();
|
||||
NS_NameSpaceManagerShutdown();
|
||||
|
|
|
@ -661,36 +661,34 @@ NS_IMETHODIMP
|
|||
nsFormControlFrame::GetMaxLength(PRInt32* aSize)
|
||||
{
|
||||
*aSize = -1;
|
||||
nsresult result = NS_CONTENT_ATTR_NOT_THERE;
|
||||
|
||||
nsGenericHTMLElement *content = nsGenericHTMLElement::FromContent(mContent);
|
||||
|
||||
if (content) {
|
||||
nsHTMLValue value;
|
||||
result = content->GetHTMLAttribute(nsHTMLAtoms::maxlength, value);
|
||||
if (eHTMLUnit_Integer == value.GetUnit()) {
|
||||
*aSize = value.GetIntValue();
|
||||
const nsAttrValue* attr = content->GetParsedAttr(nsHTMLAtoms::maxlength);
|
||||
if (attr && attr->Type() == nsAttrValue::eInteger) {
|
||||
*aSize = attr->GetIntegerValue();
|
||||
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsFormControlFrame::GetSizeFromContent(PRInt32* aSize) const
|
||||
{
|
||||
*aSize = -1;
|
||||
nsresult result = NS_CONTENT_ATTR_NOT_THERE;
|
||||
|
||||
nsGenericHTMLElement *content = nsGenericHTMLElement::FromContent(mContent);
|
||||
|
||||
if (content) {
|
||||
nsHTMLValue value;
|
||||
result = content->GetHTMLAttribute(nsHTMLAtoms::size, value);
|
||||
if (eHTMLUnit_Integer == value.GetUnit()) {
|
||||
*aSize = value.GetIntValue();
|
||||
const nsAttrValue* attr = content->GetParsedAttr(nsHTMLAtoms::size);
|
||||
if (attr && attr->Type() == nsAttrValue::eInteger) {
|
||||
*aSize = attr->GetIntegerValue();
|
||||
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(PRInt32)
|
||||
|
|
|
@ -132,18 +132,13 @@ nsresult nsFormControlHelper::GetFrameFontFM(nsIFrame* aFrame,
|
|||
nsresult
|
||||
nsFormControlHelper::GetWrapProperty(nsIContent * aContent, nsString &aOutValue)
|
||||
{
|
||||
aOutValue.SetLength(0);
|
||||
nsresult result = NS_CONTENT_ATTR_NOT_THERE;
|
||||
nsGenericHTMLElement *content = nsGenericHTMLElement::FromContent(aContent);
|
||||
|
||||
if (content) {
|
||||
nsHTMLValue value;
|
||||
result = content->GetHTMLAttribute(nsHTMLAtoms::wrap, value);
|
||||
if (eHTMLUnit_String == value.GetUnit()) {
|
||||
value.GetStringValue(aOutValue);
|
||||
}
|
||||
if (aContent->IsContentOfType(nsIContent::eHTML)) {
|
||||
return aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::wrap, aOutValue);
|
||||
}
|
||||
return result;
|
||||
|
||||
aOutValue.Truncate();
|
||||
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -340,17 +335,10 @@ nsresult
|
|||
nsFormControlHelper::GetName(nsIContent* aContent, nsAString* aResult)
|
||||
{
|
||||
NS_PRECONDITION(aResult, "Null pointer bad!");
|
||||
nsGenericHTMLElement *formControl =
|
||||
nsGenericHTMLElement::FromContent(aContent);
|
||||
if (!formControl)
|
||||
if (!aContent->IsContentOfType(nsIContent::eHTML))
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsHTMLValue value;
|
||||
nsresult rv = formControl->GetHTMLAttribute(nsHTMLAtoms::name, value);
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE == rv && eHTMLUnit_String == value.GetUnit()) {
|
||||
value.GetStringValue(*aResult);
|
||||
}
|
||||
return rv;
|
||||
return aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::name, *aResult);
|
||||
}
|
||||
|
||||
PRInt32
|
||||
|
@ -369,17 +357,10 @@ nsresult
|
|||
nsFormControlHelper::GetValueAttr(nsIContent* aContent, nsAString* aResult)
|
||||
{
|
||||
NS_PRECONDITION(aResult, "Null pointer bad!");
|
||||
nsGenericHTMLElement *formControl =
|
||||
nsGenericHTMLElement::FromContent(aContent);
|
||||
if (!formControl)
|
||||
if (!aContent->IsContentOfType(nsIContent::eHTML))
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsHTMLValue value;
|
||||
nsresult rv = formControl->GetHTMLAttribute(nsHTMLAtoms::value, value);
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE == rv && eHTMLUnit_String == value.GetUnit()) {
|
||||
value.GetStringValue(*aResult);
|
||||
}
|
||||
return rv;
|
||||
return aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::value, *aResult);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
|
|
|
@ -150,11 +150,9 @@ PRInt32 nsLegendFrame::GetAlign()
|
|||
nsGenericHTMLElement *content = nsGenericHTMLElement::FromContent(mContent);
|
||||
|
||||
if (content) {
|
||||
nsHTMLValue value;
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE == (content->GetHTMLAttribute(nsHTMLAtoms::align, value))) {
|
||||
if (eHTMLUnit_Enumerated == value.GetUnit()) {
|
||||
intValue = value.GetIntValue();
|
||||
}
|
||||
const nsAttrValue* attr = content->GetParsedAttr(nsHTMLAtoms::align);
|
||||
if (attr && attr->Type() == nsAttrValue::eEnum) {
|
||||
intValue = attr->GetEnumValue();
|
||||
}
|
||||
}
|
||||
return intValue;
|
||||
|
|
|
@ -1474,19 +1474,18 @@ nsTextControlFrame::GetCols()
|
|||
NS_ASSERTION(content, "Content is not HTML content!");
|
||||
|
||||
if (IsTextArea()) {
|
||||
nsHTMLValue attr;
|
||||
nsresult rv = content->GetHTMLAttribute(nsHTMLAtoms::cols, attr);
|
||||
if (rv == NS_CONTENT_ATTR_HAS_VALUE) {
|
||||
PRInt32 cols = attr.GetIntValue();
|
||||
const nsAttrValue* attr = content->GetParsedAttr(nsHTMLAtoms::cols);
|
||||
if (attr) {
|
||||
PRInt32 cols = attr->Type() == nsAttrValue::eInteger ?
|
||||
attr->GetIntegerValue() : 0;
|
||||
// XXX why a default of 1 char, why hide it
|
||||
return (cols <= 0) ? 1 : cols;
|
||||
}
|
||||
} else {
|
||||
// Else we know (assume) it is an input with size attr
|
||||
nsHTMLValue attr;
|
||||
nsresult rv = content->GetHTMLAttribute(nsHTMLAtoms::size, attr);
|
||||
if (rv == NS_CONTENT_ATTR_HAS_VALUE) {
|
||||
PRInt32 cols = attr.GetIntValue();
|
||||
const nsAttrValue* attr = content->GetParsedAttr(nsHTMLAtoms::size);
|
||||
if (attr && attr->Type() == nsAttrValue::eInteger) {
|
||||
PRInt32 cols = attr->GetIntegerValue();
|
||||
if (cols > 0) {
|
||||
return cols;
|
||||
}
|
||||
|
@ -1505,10 +1504,9 @@ nsTextControlFrame::GetRows()
|
|||
nsGenericHTMLElement::FromContent(mContent);
|
||||
NS_ASSERTION(content, "Content is not HTML content!");
|
||||
|
||||
nsHTMLValue attr;
|
||||
nsresult rv = content->GetHTMLAttribute(nsHTMLAtoms::rows, attr);
|
||||
if (rv == NS_CONTENT_ATTR_HAS_VALUE) {
|
||||
PRInt32 rows = attr.GetIntValue();
|
||||
const nsAttrValue* attr = content->GetParsedAttr(nsHTMLAtoms::rows);
|
||||
if (attr && attr->Type() == nsAttrValue::eInteger) {
|
||||
PRInt32 rows = attr->GetIntegerValue();
|
||||
return (rows <= 0) ? DEFAULT_ROWS_TEXTAREA : rows;
|
||||
}
|
||||
return DEFAULT_ROWS_TEXTAREA;
|
||||
|
@ -2902,18 +2900,17 @@ nsresult
|
|||
nsTextControlFrame::GetMaxLength(PRInt32* aSize)
|
||||
{
|
||||
*aSize = -1;
|
||||
nsresult rv = NS_CONTENT_ATTR_NOT_THERE;
|
||||
|
||||
nsGenericHTMLElement *content = nsGenericHTMLElement::FromContent(mContent);
|
||||
|
||||
if (content) {
|
||||
nsHTMLValue value;
|
||||
rv = content->GetHTMLAttribute(nsHTMLAtoms::maxlength, value);
|
||||
if (eHTMLUnit_Integer == value.GetUnit()) {
|
||||
*aSize = value.GetIntValue();
|
||||
const nsAttrValue* attr = content->GetParsedAttr(nsHTMLAtoms::maxlength);
|
||||
if (attr && attr->Type() == nsAttrValue::eInteger) {
|
||||
*aSize = attr->GetIntegerValue();
|
||||
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
return NS_CONTENT_ATTR_NOT_THERE;
|
||||
}
|
||||
|
||||
// this is where we propagate a content changed event
|
||||
|
@ -3197,14 +3194,9 @@ nsTextControlFrame::GetWidthInCharacters() const
|
|||
nsGenericHTMLElement *content = nsGenericHTMLElement::FromContent(mContent);
|
||||
if (content)
|
||||
{
|
||||
nsHTMLValue resultValue;
|
||||
nsresult rv = content->GetHTMLAttribute(nsHTMLAtoms::cols, resultValue);
|
||||
if (NS_CONTENT_ATTR_NOT_THERE != rv)
|
||||
{
|
||||
if (resultValue.GetUnit() == eHTMLUnit_Integer)
|
||||
{
|
||||
return (resultValue.GetIntValue());
|
||||
}
|
||||
const nsAttrValue* attr = content->GetParsedAttr(nsHTMLAtoms::cols);
|
||||
if (attr && attr->Type() == nsAttrValue::eInteger) {
|
||||
return attr->GetIntegerValue();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
#include "nsIEditor.h"
|
||||
#include "nsITextControlFrame.h"
|
||||
#include "nsFormControlHelper.h"//for the inputdimensions
|
||||
#include "nsHTMLValue.h" //for nsHTMLValue
|
||||
#include "nsIFontMetrics.h"
|
||||
#include "nsWeakReference.h" //for service and presshell pointers
|
||||
#include "nsIScrollableViewProvider.h"
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
#include "nsINodeInfo.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsIView.h"
|
||||
#include "nsHTMLValue.h"
|
||||
#include "nsHTMLParts.h"
|
||||
#include "nsLayoutAtoms.h"
|
||||
|
||||
|
|
|
@ -59,7 +59,6 @@
|
|||
#include "nsIFontMetrics.h"
|
||||
#include "nsHTMLParts.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLValue.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "prprf.h"
|
||||
|
@ -6839,12 +6838,9 @@ nsBlockFrame::RenumberLists(nsPresContext* aPresContext)
|
|||
nsGenericHTMLElement *hc = nsGenericHTMLElement::FromContent(mContent);
|
||||
|
||||
if (hc) {
|
||||
nsHTMLValue value;
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE ==
|
||||
hc->GetHTMLAttribute(nsHTMLAtoms::start, value)) {
|
||||
if (eHTMLUnit_Integer == value.GetUnit()) {
|
||||
ordinal = value.GetIntValue();
|
||||
}
|
||||
const nsAttrValue* attr = hc->GetParsedAttr(nsHTMLAtoms::start);
|
||||
if (attr && attr->Type() == nsAttrValue::eInteger) {
|
||||
ordinal = attr->GetIntegerValue();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include "nsBulletFrame.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsHTMLParts.h"
|
||||
#include "nsHTMLValue.h"
|
||||
#include "nsHTMLContainerFrame.h"
|
||||
#include "nsIFontMetrics.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
|
@ -392,18 +391,15 @@ nsBulletFrame::SetListItemOrdinal(PRInt32 aNextOrdinal,
|
|||
// Try to get value directly from the list-item, if it specifies a
|
||||
// value attribute. Note: we do this with our parent's content
|
||||
// because our parent is the list-item.
|
||||
nsHTMLValue value;
|
||||
nsIContent* parentContent = mParent->GetContent();
|
||||
if (parentContent) {
|
||||
nsGenericHTMLElement *hc =
|
||||
nsGenericHTMLElement::FromContent(parentContent);
|
||||
if (hc) {
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE ==
|
||||
hc->GetHTMLAttribute(nsHTMLAtoms::value, value)) {
|
||||
if (eHTMLUnit_Integer == value.GetUnit()) {
|
||||
// Use ordinal specified by the value attribute
|
||||
mOrdinal = value.GetIntValue();
|
||||
}
|
||||
const nsAttrValue* attr = hc->GetParsedAttr(nsHTMLAtoms::value);
|
||||
if (attr && attr->Type() == nsAttrValue::eInteger) {
|
||||
// Use ordinal specified by the value attribute
|
||||
mOrdinal = attr->GetIntegerValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -574,13 +574,12 @@ nsSize nsSubDocumentFrame::GetMargin()
|
|||
nsSize result(-1, -1);
|
||||
nsGenericHTMLElement *content = nsGenericHTMLElement::FromContent(mContent);
|
||||
if (content) {
|
||||
nsHTMLValue value;
|
||||
content->GetHTMLAttribute(nsHTMLAtoms::marginwidth, value);
|
||||
if (eHTMLUnit_Integer == value.GetUnit())
|
||||
result.width = value.GetIntValue();
|
||||
content->GetHTMLAttribute(nsHTMLAtoms::marginheight, value);
|
||||
if (eHTMLUnit_Integer == value.GetUnit())
|
||||
result.height = value.GetIntValue();
|
||||
const nsAttrValue* attr = content->GetParsedAttr(nsHTMLAtoms::marginwidth);
|
||||
if (attr && attr->Type() == nsAttrValue::eInteger)
|
||||
result.width = attr->GetIntegerValue();
|
||||
attr = content->GetParsedAttr(nsHTMLAtoms::marginheight);
|
||||
if (attr && attr->Type() == nsAttrValue::eInteger)
|
||||
result.height = attr->GetIntegerValue();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -670,18 +670,17 @@ PRInt32 nsHTMLFramesetFrame::GetBorderWidth(nsPresContext* aPresContext,
|
|||
}
|
||||
}
|
||||
float p2t = aPresContext->ScaledPixelsToTwips();
|
||||
nsHTMLValue htmlVal;
|
||||
nsGenericHTMLElement *content = nsGenericHTMLElement::FromContent(mContent);
|
||||
|
||||
if (content) {
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE == (content->GetHTMLAttribute(nsHTMLAtoms::border, htmlVal))) {
|
||||
nsHTMLUnit unit = htmlVal.GetUnit();
|
||||
const nsAttrValue* attr = content->GetParsedAttr(nsHTMLAtoms::border);
|
||||
if (attr) {
|
||||
PRInt32 intVal = 0;
|
||||
if (eHTMLUnit_Integer == unit) {
|
||||
intVal = htmlVal.GetIntValue();
|
||||
}
|
||||
if (intVal < 0) {
|
||||
intVal = 0;
|
||||
if (attr->Type() == nsAttrValue::eInteger) {
|
||||
intVal = attr->GetIntegerValue();
|
||||
if (intVal < 0) {
|
||||
intVal = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (forcing && intVal == 0) {
|
||||
|
@ -895,22 +894,20 @@ static
|
|||
nsFrameborder GetFrameBorderHelper(nsGenericHTMLElement* aContent)
|
||||
{
|
||||
if (nsnull != aContent) {
|
||||
nsHTMLValue value;
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE == (aContent->GetHTMLAttribute(nsHTMLAtoms::frameborder, value))) {
|
||||
if (eHTMLUnit_Enumerated == value.GetUnit()) {
|
||||
switch (value.GetIntValue())
|
||||
{
|
||||
case NS_STYLE_FRAME_YES:
|
||||
case NS_STYLE_FRAME_1:
|
||||
return eFrameborder_Yes;
|
||||
break;
|
||||
const nsAttrValue* attr = aContent->GetParsedAttr(nsHTMLAtoms::frameborder);
|
||||
if (attr && attr->Type() == nsAttrValue::eEnum) {
|
||||
switch (attr->GetEnumValue())
|
||||
{
|
||||
case NS_STYLE_FRAME_YES:
|
||||
case NS_STYLE_FRAME_1:
|
||||
return eFrameborder_Yes;
|
||||
break;
|
||||
|
||||
case NS_STYLE_FRAME_NO:
|
||||
case NS_STYLE_FRAME_0:
|
||||
return eFrameborder_No;
|
||||
break;
|
||||
}
|
||||
}
|
||||
case NS_STYLE_FRAME_NO:
|
||||
case NS_STYLE_FRAME_0:
|
||||
return eFrameborder_No;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return eFrameborder_Notset;
|
||||
|
@ -950,10 +947,10 @@ nscolor nsHTMLFramesetFrame::GetBorderColor()
|
|||
nsGenericHTMLElement *content = nsGenericHTMLElement::FromContent(mContent);
|
||||
|
||||
if (content) {
|
||||
nsHTMLValue value;
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE == (content->GetHTMLAttribute(nsHTMLAtoms::bordercolor, value))) {
|
||||
const nsAttrValue* attr = content->GetParsedAttr(nsHTMLAtoms::bordercolor);
|
||||
if (attr) {
|
||||
nscolor color;
|
||||
if (value.GetColorValue(color)) {
|
||||
if (attr->GetColorValue(color)) {
|
||||
return color;
|
||||
}
|
||||
}
|
||||
|
@ -967,10 +964,10 @@ nscolor nsHTMLFramesetFrame::GetBorderColor(nsIContent* aContent)
|
|||
nsGenericHTMLElement *content = nsGenericHTMLElement::FromContent(aContent);
|
||||
|
||||
if (content) {
|
||||
nsHTMLValue value;
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE == (content->GetHTMLAttribute(nsHTMLAtoms::bordercolor, value))) {
|
||||
const nsAttrValue* attr = content->GetParsedAttr(nsHTMLAtoms::bordercolor);
|
||||
if (attr) {
|
||||
nscolor color;
|
||||
if (value.GetColorValue(color)) {
|
||||
if (attr->GetColorValue(color)) {
|
||||
return color;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
#include "nsCSSAnonBoxes.h"
|
||||
#include "nsIWidget.h"
|
||||
#include "nsILinkHandler.h"
|
||||
#include "nsHTMLValue.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIURL.h"
|
||||
|
|
|
@ -61,15 +61,14 @@ void testAttributes(nsGenericHTMLElement* content) {
|
|||
content->SetAttribute(kNameSpaceID_None, sHEIGHT, sempty, PR_FALSE);
|
||||
content->SetAttribute(kNameSpaceID_None, sSRC, sfoo_gif, PR_FALSE);
|
||||
|
||||
nsHTMLValue ret;
|
||||
nsresult rv;
|
||||
rv = content->GetHTMLAttribute(sBORDER, ret);
|
||||
if (rv == NS_CONTENT_ATTR_NOT_THERE || ret.GetUnit() != eHTMLUnit_String) {
|
||||
const nsAttrValue* attr;
|
||||
attr = content->GetParsedAttr(sBORDER);
|
||||
if (!attr || attr->Type() != nsAttrValue::eString) {
|
||||
printf("test 0 failed\n");
|
||||
}
|
||||
|
||||
rv = content->GetHTMLAttribute(sBAD, ret);
|
||||
if (rv != NS_CONTENT_ATTR_NOT_THERE) {
|
||||
attr = content->GetParsedAttr(sBAD);
|
||||
if (attr) {
|
||||
printf("test 2 failed\n");
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "nsHTMLAtoms.h"
|
||||
#include "nsIStyledContent.h"
|
||||
#include "nsIDOMMutationEvent.h"
|
||||
#include "nsHTMLValue.h"
|
||||
#include "nsICSSStyleRule.h"
|
||||
#include "nsINodeInfo.h"
|
||||
#include "nsICSSLoader.h"
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
#include "nsIContent.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsHTMLParts.h"
|
||||
#include "nsHTMLValue.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsIView.h"
|
||||
|
@ -636,10 +635,9 @@ PRInt32 nsTableCellFrame::GetRowSpan()
|
|||
nsGenericHTMLElement *hc = nsGenericHTMLElement::FromContent(mContent);
|
||||
|
||||
if (hc) {
|
||||
nsHTMLValue val;
|
||||
hc->GetHTMLAttribute(nsHTMLAtoms::rowspan, val);
|
||||
if (eHTMLUnit_Integer == val.GetUnit()) {
|
||||
rowSpan=val.GetIntValue();
|
||||
const nsAttrValue* attr = hc->GetParsedAttr(nsHTMLAtoms::rowspan);
|
||||
if (attr && attr->Type() == nsAttrValue::eInteger) {
|
||||
rowSpan = attr->GetIntegerValue();
|
||||
}
|
||||
}
|
||||
return rowSpan;
|
||||
|
@ -651,10 +649,9 @@ PRInt32 nsTableCellFrame::GetColSpan()
|
|||
nsGenericHTMLElement *hc = nsGenericHTMLElement::FromContent(mContent);
|
||||
|
||||
if (hc) {
|
||||
nsHTMLValue val;
|
||||
hc->GetHTMLAttribute(nsHTMLAtoms::colspan, val);
|
||||
if (eHTMLUnit_Integer == val.GetUnit()) {
|
||||
colSpan=val.GetIntValue();
|
||||
const nsAttrValue* attr = hc->GetParsedAttr(nsHTMLAtoms::colspan);
|
||||
if (attr && attr->Type() == nsAttrValue::eInteger) {
|
||||
colSpan = attr->GetIntegerValue();
|
||||
}
|
||||
}
|
||||
return colSpan;
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
#include "nsLayoutAtoms.h"
|
||||
|
||||
class nsTableFrame;
|
||||
class nsHTMLValue;
|
||||
|
||||
/**
|
||||
* Additional frame-state bits
|
||||
|
|
|
@ -51,7 +51,6 @@
|
|||
#include "nsTableRowGroupFrame.h"
|
||||
#include "nsTableOuterFrame.h"
|
||||
#include "nsTablePainter.h"
|
||||
#include "nsHTMLValue.h"
|
||||
|
||||
#include "BasicTableLayoutStrategy.h"
|
||||
#include "FixedTableLayoutStrategy.h"
|
||||
|
|
|
@ -54,7 +54,6 @@ class nsTableRowGroupFrame;
|
|||
class nsTableRowFrame;
|
||||
class nsTableColGroupFrame;
|
||||
class nsITableLayoutStrategy;
|
||||
class nsHTMLValue;
|
||||
class nsStyleContext;
|
||||
|
||||
struct nsTableReflowState;
|
||||
|
|
Загрузка…
Ссылка в новой задаче