mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Make ParseAttribute handle namespaced attributes too, since SVG needs to
ParseAttribute things like xlink:href. Bug 314568, r=sicking, sr=jst
This commit is contained in:
parent
fe494a9f14
commit
6d003a9d96
@ -4033,8 +4033,7 @@ nsGenericElement::SetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
|
|||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAttrValue attrValue;
|
nsAttrValue attrValue;
|
||||||
if (aNamespaceID != kNameSpaceID_None ||
|
if (!ParseAttribute(aNamespaceID, aName, aValue, attrValue)) {
|
||||||
!ParseAttribute(aName, aValue, attrValue)) {
|
|
||||||
attrValue.SetTo(aValue);
|
attrValue.SetTo(aValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4131,11 +4130,13 @@ nsGenericElement::SetAttrAndNotify(PRInt32 aNamespaceID,
|
|||||||
}
|
}
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsGenericElement::ParseAttribute(nsIAtom* aAttribute,
|
nsGenericElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (aAttribute == GetIDAttributeName() && !aValue.IsEmpty()) {
|
if (aNamespaceID == kNameSpaceID_None &&
|
||||||
|
aAttribute == GetIDAttributeName() && !aValue.IsEmpty()) {
|
||||||
// Store id as an atom. id="" means that the element has no id,
|
// Store id as an atom. id="" means that the element has no id,
|
||||||
// not that it has an emptystring as the id.
|
// not that it has an emptystring as the id.
|
||||||
aResult.ParseAtom(aValue);
|
aResult.ParseAtom(aValue);
|
||||||
|
@ -727,12 +727,14 @@ protected:
|
|||||||
* attribute. Called by SetAttr(). Note that at the moment we only do this
|
* attribute. Called by SetAttr(). Note that at the moment we only do this
|
||||||
* for attributes in the null namespace (kNameSpaceID_None).
|
* for attributes in the null namespace (kNameSpaceID_None).
|
||||||
*
|
*
|
||||||
|
* @param aNamespaceID the namespace of the attribute to convert
|
||||||
* @param aAttribute the attribute to convert
|
* @param aAttribute the attribute to convert
|
||||||
* @param aValue the string value to convert
|
* @param aValue the string value to convert
|
||||||
* @param aResult the nsAttrValue [OUT]
|
* @param aResult the nsAttrValue [OUT]
|
||||||
* @return PR_TRUE if the parsing was successful, PR_FALSE otherwise
|
* @return PR_TRUE if the parsing was successful, PR_FALSE otherwise
|
||||||
*/
|
*/
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
|
|
||||||
|
@ -2027,36 +2027,40 @@ nsGenericHTMLElement::IsContentOfType(PRUint32 aFlags) const
|
|||||||
|
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsGenericHTMLElement::ParseAttribute(nsIAtom* aAttribute,
|
nsGenericHTMLElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (aAttribute == nsHTMLAtoms::dir) {
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
return aResult.ParseEnumValue(aValue, kDirTable);
|
if (aAttribute == nsHTMLAtoms::dir) {
|
||||||
}
|
return aResult.ParseEnumValue(aValue, kDirTable);
|
||||||
if (aAttribute == nsHTMLAtoms::style) {
|
}
|
||||||
ParseStyleAttribute(this, mNodeInfo->NamespaceEquals(kNameSpaceID_XHTML),
|
if (aAttribute == nsHTMLAtoms::style) {
|
||||||
aValue, aResult);
|
ParseStyleAttribute(this, mNodeInfo->NamespaceEquals(kNameSpaceID_XHTML),
|
||||||
return PR_TRUE;
|
aValue, aResult);
|
||||||
}
|
return PR_TRUE;
|
||||||
if (aAttribute == nsHTMLAtoms::kClass) {
|
}
|
||||||
aResult.ParseAtomArray(aValue);
|
if (aAttribute == nsHTMLAtoms::kClass) {
|
||||||
|
aResult.ParseAtomArray(aValue);
|
||||||
|
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (aAttribute == nsHTMLAtoms::tabindex) {
|
||||||
|
return aResult.ParseIntWithBounds(aValue, -32768, 32767);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (aAttribute == nsHTMLAtoms::name && !aValue.IsEmpty()) {
|
||||||
|
// Store name as an atom. name="" means that the element has no name,
|
||||||
|
// not that it has an emptystring as the name.
|
||||||
|
aResult.ParseAtom(aValue);
|
||||||
|
return PR_TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aAttribute == nsHTMLAtoms::tabindex) {
|
return nsGenericElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
return aResult.ParseIntWithBounds(aValue, -32768, 32767);
|
aResult);
|
||||||
}
|
|
||||||
|
|
||||||
if (aAttribute == nsHTMLAtoms::name && !aValue.IsEmpty()) {
|
|
||||||
// Store name as an atom. name="" means that the element has no name,
|
|
||||||
// not that it has an emptystring as the name.
|
|
||||||
aResult.ParseAtom(aValue);
|
|
||||||
return PR_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nsGenericElement::ParseAttribute(aAttribute, aValue, aResult);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
|
@ -245,18 +245,8 @@ public:
|
|||||||
NS_IMETHOD SetInlineStyleRule(nsICSSStyleRule* aStyleRule, PRBool aNotify);
|
NS_IMETHOD SetInlineStyleRule(nsICSSStyleRule* aStyleRule, PRBool aNotify);
|
||||||
already_AddRefed<nsIURI> GetBaseURI() const;
|
already_AddRefed<nsIURI> GetBaseURI() const;
|
||||||
|
|
||||||
//----------------------------------------
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
/**
|
nsIAtom* aAttribute,
|
||||||
* Convert an attribute string value to attribute type based on the type of
|
|
||||||
* attribute. Called by SetAttr().
|
|
||||||
*
|
|
||||||
* @param aAttribute to attribute to convert
|
|
||||||
* @param aValue the string value to convert
|
|
||||||
* @param aResult the nsAttrValue [OUT]
|
|
||||||
* @return PR_TRUE if the parsing was successful, PR_FALSE otherwise
|
|
||||||
* @see nsGenericHTMLElement::SetAttr
|
|
||||||
*/
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
|
|
||||||
|
@ -96,7 +96,8 @@ public:
|
|||||||
nsIAtom* aPrefix, const nsAString& aValue,
|
nsIAtom* aPrefix, const nsAString& aValue,
|
||||||
PRBool aNotify);
|
PRBool aNotify);
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||||
@ -191,19 +192,23 @@ NS_IMPL_STRING_ATTR(nsHTMLAppletElement, Width, width)
|
|||||||
NS_IMPL_INT_ATTR(nsHTMLAppletElement, TabIndex, tabindex)
|
NS_IMPL_INT_ATTR(nsHTMLAppletElement, TabIndex, tabindex)
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLAppletElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLAppletElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (aAttribute == nsHTMLAtoms::align) {
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
return nsGenericHTMLElement::ParseAlignValue(aValue, aResult);
|
if (aAttribute == nsHTMLAtoms::align) {
|
||||||
}
|
return nsGenericHTMLElement::ParseAlignValue(aValue, aResult);
|
||||||
if (nsGenericHTMLElement::ParseImageAttribute(aAttribute,
|
}
|
||||||
aValue, aResult)) {
|
if (nsGenericHTMLElement::ParseImageAttribute(aAttribute,
|
||||||
return PR_TRUE;
|
aValue, aResult)) {
|
||||||
|
return PR_TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -65,7 +65,8 @@ public:
|
|||||||
// nsIDOMHTMLBRElement
|
// nsIDOMHTMLBRElement
|
||||||
NS_DECL_NSIDOMHTMLBRELEMENT
|
NS_DECL_NSIDOMHTMLBRELEMENT
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||||
@ -110,15 +111,17 @@ static const nsAttrValue::EnumTable kClearTable[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLBRElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLBRElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (aAttribute == nsHTMLAtoms::clear) {
|
if (aAttribute == nsHTMLAtoms::clear && aNamespaceID == kNameSpaceID_None) {
|
||||||
return aResult.ParseEnumValue(aValue, kClearTable);
|
return aResult.ParseEnumValue(aValue, kClearTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -106,7 +106,8 @@ public:
|
|||||||
// nsIDOMHTMLBodyElement
|
// nsIDOMHTMLBodyElement
|
||||||
NS_DECL_NSIDOMHTMLBODYELEMENT
|
NS_DECL_NSIDOMHTMLBODYELEMENT
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
virtual void UnbindFromTree(PRBool aDeep = PR_TRUE,
|
virtual void UnbindFromTree(PRBool aDeep = PR_TRUE,
|
||||||
@ -387,27 +388,31 @@ nsHTMLBodyElement::SetBgColor(const nsAString& aBgColor)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLBodyElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLBodyElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (aAttribute == nsHTMLAtoms::bgcolor ||
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
aAttribute == nsHTMLAtoms::text ||
|
if (aAttribute == nsHTMLAtoms::bgcolor ||
|
||||||
aAttribute == nsHTMLAtoms::link ||
|
aAttribute == nsHTMLAtoms::text ||
|
||||||
aAttribute == nsHTMLAtoms::alink ||
|
aAttribute == nsHTMLAtoms::link ||
|
||||||
aAttribute == nsHTMLAtoms::vlink) {
|
aAttribute == nsHTMLAtoms::alink ||
|
||||||
return aResult.ParseColor(aValue, GetOwnerDoc());
|
aAttribute == nsHTMLAtoms::vlink) {
|
||||||
}
|
return aResult.ParseColor(aValue, GetOwnerDoc());
|
||||||
if (aAttribute == nsHTMLAtoms::marginwidth ||
|
}
|
||||||
aAttribute == nsHTMLAtoms::marginheight ||
|
if (aAttribute == nsHTMLAtoms::marginwidth ||
|
||||||
aAttribute == nsHTMLAtoms::topmargin ||
|
aAttribute == nsHTMLAtoms::marginheight ||
|
||||||
aAttribute == nsHTMLAtoms::bottommargin ||
|
aAttribute == nsHTMLAtoms::topmargin ||
|
||||||
aAttribute == nsHTMLAtoms::leftmargin ||
|
aAttribute == nsHTMLAtoms::bottommargin ||
|
||||||
aAttribute == nsHTMLAtoms::rightmargin) {
|
aAttribute == nsHTMLAtoms::leftmargin ||
|
||||||
return aResult.ParseIntWithBounds(aValue, 0);
|
aAttribute == nsHTMLAtoms::rightmargin) {
|
||||||
|
return aResult.ParseIntWithBounds(aValue, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -98,7 +98,8 @@ public:
|
|||||||
// nsIContent overrides...
|
// nsIContent overrides...
|
||||||
virtual void SetFocus(nsPresContext* aPresContext);
|
virtual void SetFocus(nsPresContext* aPresContext);
|
||||||
virtual PRBool IsFocusable(PRInt32 *aTabIndex = nsnull);
|
virtual PRBool IsFocusable(PRInt32 *aTabIndex = nsnull);
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
virtual nsresult HandleDOMEvent(nsPresContext* aPresContext,
|
virtual nsresult HandleDOMEvent(nsPresContext* aPresContext,
|
||||||
@ -262,11 +263,12 @@ static const nsAttrValue::EnumTable kButtonTypeTable[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLButtonElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLButtonElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (aAttribute == nsHTMLAtoms::type) {
|
if (aAttribute == nsHTMLAtoms::type && kNameSpaceID_None == aNamespaceID) {
|
||||||
// XXX ARG!! This is major evilness. ParseAttribute
|
// XXX ARG!! This is major evilness. ParseAttribute
|
||||||
// shouldn't set members. Override SetAttr instead
|
// shouldn't set members. Override SetAttr instead
|
||||||
PRBool res = aResult.ParseEnumValue(aValue, kButtonTypeTable);
|
PRBool res = aResult.ParseEnumValue(aValue, kButtonTypeTable);
|
||||||
@ -276,7 +278,8 @@ nsHTMLButtonElement::ParseAttribute(nsIAtom* aAttribute,
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
@ -89,7 +89,10 @@ public:
|
|||||||
|
|
||||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||||
nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||||
PRBool ParseAttribute(nsIAtom* aAttribute, const nsAString& aValue, nsAttrValue& aResult);
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
|
const nsAString& aValue,
|
||||||
|
nsAttrValue& aResult);
|
||||||
nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute, PRInt32 aModType) const;
|
nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute, PRInt32 aModType) const;
|
||||||
|
|
||||||
// SetAttr override. C++ is stupid, so have to override both
|
// SetAttr override. C++ is stupid, so have to override both
|
||||||
@ -238,20 +241,27 @@ nsHTMLCanvasElement::IsAttributeMapped(const nsIAtom* aAttribute) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLCanvasElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLCanvasElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if ((aAttribute == nsHTMLAtoms::width) ||
|
if (aNamespaceID == kNameSpaceID_None)
|
||||||
(aAttribute == nsHTMLAtoms::height))
|
|
||||||
{
|
{
|
||||||
return aResult.ParseIntWithBounds(aValue, 0);
|
if ((aAttribute == nsHTMLAtoms::width) ||
|
||||||
|
(aAttribute == nsHTMLAtoms::height))
|
||||||
|
{
|
||||||
|
return aResult.ParseIntWithBounds(aValue, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ParseImageAttribute(aAttribute, aValue, aResult))
|
||||||
|
{
|
||||||
|
return PR_TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ParseImageAttribute(aAttribute, aValue, aResult))
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
return PR_TRUE;
|
aResult);
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -64,7 +64,8 @@ public:
|
|||||||
// nsIDOMHTMLDivElement
|
// nsIDOMHTMLDivElement
|
||||||
NS_DECL_NSIDOMHTMLDIVELEMENT
|
NS_DECL_NSIDOMHTMLDIVELEMENT
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||||
@ -104,29 +105,34 @@ NS_IMPL_STRING_ATTR(nsHTMLDivElement, Align, align)
|
|||||||
|
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLDivElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLDivElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (mNodeInfo->Equals(nsHTMLAtoms::marquee)) {
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
if ((aAttribute == nsHTMLAtoms::width) ||
|
if (mNodeInfo->Equals(nsHTMLAtoms::marquee)) {
|
||||||
(aAttribute == nsHTMLAtoms::height)) {
|
if ((aAttribute == nsHTMLAtoms::width) ||
|
||||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
(aAttribute == nsHTMLAtoms::height)) {
|
||||||
}
|
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
||||||
if (aAttribute == nsHTMLAtoms::bgcolor) {
|
}
|
||||||
return aResult.ParseColor(aValue, GetOwnerDoc());
|
if (aAttribute == nsHTMLAtoms::bgcolor) {
|
||||||
}
|
return aResult.ParseColor(aValue, GetOwnerDoc());
|
||||||
if ((aAttribute == nsHTMLAtoms::hspace) ||
|
}
|
||||||
(aAttribute == nsHTMLAtoms::vspace)) {
|
if ((aAttribute == nsHTMLAtoms::hspace) ||
|
||||||
return aResult.ParseIntWithBounds(aValue, 0);
|
(aAttribute == nsHTMLAtoms::vspace)) {
|
||||||
}
|
return aResult.ParseIntWithBounds(aValue, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mNodeInfo->Equals(nsHTMLAtoms::div) &&
|
||||||
|
aAttribute == nsHTMLAtoms::align) {
|
||||||
|
return ParseDivAlignValue(aValue, aResult);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mNodeInfo->Equals(nsHTMLAtoms::div) && aAttribute == nsHTMLAtoms::align) {
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
return ParseDivAlignValue(aValue, aResult);
|
aResult);
|
||||||
}
|
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -69,7 +69,8 @@ public:
|
|||||||
// nsIDOMHTMLFontElement
|
// nsIDOMHTMLFontElement
|
||||||
NS_DECL_NSIDOMHTMLFONTELEMENT
|
NS_DECL_NSIDOMHTMLFONTELEMENT
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||||
@ -135,30 +136,34 @@ static const nsAttrValue::EnumTable kRelFontSizeTable[] = {
|
|||||||
|
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLFontElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLFontElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (aAttribute == nsHTMLAtoms::size) {
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
nsAutoString tmp(aValue);
|
if (aAttribute == nsHTMLAtoms::size) {
|
||||||
tmp.CompressWhitespace(PR_TRUE, PR_TRUE);
|
nsAutoString tmp(aValue);
|
||||||
PRUnichar ch = tmp.IsEmpty() ? 0 : tmp.First();
|
tmp.CompressWhitespace(PR_TRUE, PR_TRUE);
|
||||||
if ((ch == '+' || ch == '-') &&
|
PRUnichar ch = tmp.IsEmpty() ? 0 : tmp.First();
|
||||||
aResult.ParseEnumValue(aValue, kRelFontSizeTable)) {
|
if ((ch == '+' || ch == '-') &&
|
||||||
return PR_TRUE;
|
aResult.ParseEnumValue(aValue, kRelFontSizeTable)) {
|
||||||
|
return PR_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return aResult.ParseIntValue(aValue);
|
||||||
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::pointSize ||
|
||||||
|
aAttribute == nsHTMLAtoms::fontWeight) {
|
||||||
|
return aResult.ParseIntValue(aValue);
|
||||||
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::color) {
|
||||||
|
return aResult.ParseColor(aValue, GetOwnerDoc());
|
||||||
}
|
}
|
||||||
|
|
||||||
return aResult.ParseIntValue(aValue);
|
|
||||||
}
|
|
||||||
if (aAttribute == nsHTMLAtoms::pointSize ||
|
|
||||||
aAttribute == nsHTMLAtoms::fontWeight) {
|
|
||||||
return aResult.ParseIntValue(aValue);
|
|
||||||
}
|
|
||||||
if (aAttribute == nsHTMLAtoms::color) {
|
|
||||||
return aResult.ParseColor(aValue, GetOwnerDoc());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -199,7 +199,8 @@ public:
|
|||||||
nsIFormControl* aRadio);
|
nsIFormControl* aRadio);
|
||||||
|
|
||||||
// nsIContent
|
// nsIContent
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
virtual nsresult HandleDOMEvent(nsPresContext* aPresContext,
|
virtual nsresult HandleDOMEvent(nsPresContext* aPresContext,
|
||||||
@ -646,18 +647,22 @@ static const nsAttrValue::EnumTable kFormEnctypeTable[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLFormElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLFormElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (aAttribute == nsHTMLAtoms::method) {
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
return aResult.ParseEnumValue(aValue, kFormMethodTable);
|
if (aAttribute == nsHTMLAtoms::method) {
|
||||||
}
|
return aResult.ParseEnumValue(aValue, kFormMethodTable);
|
||||||
if (aAttribute == nsHTMLAtoms::enctype) {
|
}
|
||||||
return aResult.ParseEnumValue(aValue, kFormEnctypeTable);
|
if (aAttribute == nsHTMLAtoms::enctype) {
|
||||||
|
return aResult.ParseEnumValue(aValue, kFormEnctypeTable);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
@ -66,7 +66,8 @@ public:
|
|||||||
NS_DECL_NSIDOMHTMLFRAMEELEMENT
|
NS_DECL_NSIDOMHTMLFRAMEELEMENT
|
||||||
|
|
||||||
// nsIContent
|
// nsIContent
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||||
@ -119,27 +120,31 @@ nsHTMLFrameElement::GetContentDocument(nsIDOMDocument** aContentDocument)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLFrameElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLFrameElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (aAttribute == nsHTMLAtoms::bordercolor) {
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
return aResult.ParseColor(aValue, nsGenericHTMLFrameElement::GetOwnerDoc());
|
if (aAttribute == nsHTMLAtoms::bordercolor) {
|
||||||
}
|
return aResult.ParseColor(aValue, GetOwnerDoc());
|
||||||
if (aAttribute == nsHTMLAtoms::frameborder) {
|
}
|
||||||
return ParseFrameborderValue(aValue, aResult);
|
if (aAttribute == nsHTMLAtoms::frameborder) {
|
||||||
}
|
return ParseFrameborderValue(aValue, aResult);
|
||||||
if (aAttribute == nsHTMLAtoms::marginwidth) {
|
}
|
||||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
if (aAttribute == nsHTMLAtoms::marginwidth) {
|
||||||
}
|
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
||||||
if (aAttribute == nsHTMLAtoms::marginheight) {
|
}
|
||||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
if (aAttribute == nsHTMLAtoms::marginheight) {
|
||||||
}
|
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
||||||
if (aAttribute == nsHTMLAtoms::scrolling) {
|
}
|
||||||
return ParseScrollingValue(aValue, aResult);
|
if (aAttribute == nsHTMLAtoms::scrolling) {
|
||||||
|
return ParseScrollingValue(aValue, aResult);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLFrameElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLFrameElement::ParseAttribute(aNamespaceID, aAttribute,
|
||||||
|
aValue, aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -82,7 +82,8 @@ public:
|
|||||||
NS_IMETHOD GetRowSpec(PRInt32 *aNumValues, const nsFramesetSpec** aSpecs);
|
NS_IMETHOD GetRowSpec(PRInt32 *aNumValues, const nsFramesetSpec** aSpecs);
|
||||||
NS_IMETHOD GetColSpec(PRInt32 *aNumValues, const nsFramesetSpec** aSpecs);
|
NS_IMETHOD GetColSpec(PRInt32 *aNumValues, const nsFramesetSpec** aSpecs);
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute,
|
virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute,
|
||||||
@ -258,21 +259,25 @@ nsHTMLFrameSetElement::GetColSpec(PRInt32 *aNumValues,
|
|||||||
|
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLFrameSetElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLFrameSetElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (aAttribute == nsHTMLAtoms::bordercolor) {
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
return aResult.ParseColor(aValue, GetOwnerDoc());
|
if (aAttribute == nsHTMLAtoms::bordercolor) {
|
||||||
}
|
return aResult.ParseColor(aValue, GetOwnerDoc());
|
||||||
if (aAttribute == nsHTMLAtoms::frameborder) {
|
}
|
||||||
return nsGenericHTMLElement::ParseFrameborderValue(aValue, aResult);
|
if (aAttribute == nsHTMLAtoms::frameborder) {
|
||||||
}
|
return nsGenericHTMLElement::ParseFrameborderValue(aValue, aResult);
|
||||||
if (aAttribute == nsHTMLAtoms::border) {
|
}
|
||||||
return aResult.ParseIntWithBounds(aValue, 0, 100);
|
if (aAttribute == nsHTMLAtoms::border) {
|
||||||
|
return aResult.ParseIntWithBounds(aValue, 0, 100);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsChangeHint
|
nsChangeHint
|
||||||
|
@ -70,7 +70,8 @@ public:
|
|||||||
// nsIDOMNSHTMLHRElement
|
// nsIDOMNSHTMLHRElement
|
||||||
NS_DECL_NSIDOMNSHTMLHRELEMENT
|
NS_DECL_NSIDOMNSHTMLHRELEMENT
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||||
@ -120,24 +121,28 @@ static const nsAttrValue::EnumTable kAlignTable[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLHRElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLHRElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (aAttribute == nsHTMLAtoms::width) {
|
if (aAttribute == kNameSpaceID_None) {
|
||||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
if (aAttribute == nsHTMLAtoms::width) {
|
||||||
}
|
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
||||||
if (aAttribute == nsHTMLAtoms::size) {
|
}
|
||||||
return aResult.ParseIntWithBounds(aValue, 1, 1000);
|
if (aAttribute == nsHTMLAtoms::size) {
|
||||||
}
|
return aResult.ParseIntWithBounds(aValue, 1, 1000);
|
||||||
if (aAttribute == nsHTMLAtoms::align) {
|
}
|
||||||
return aResult.ParseEnumValue(aValue, kAlignTable);
|
if (aAttribute == nsHTMLAtoms::align) {
|
||||||
}
|
return aResult.ParseEnumValue(aValue, kAlignTable);
|
||||||
if (aAttribute == nsHTMLAtoms::color) {
|
}
|
||||||
return aResult.ParseColor(aValue, GetOwnerDoc());
|
if (aAttribute == nsHTMLAtoms::color) {
|
||||||
|
return aResult.ParseColor(aValue, GetOwnerDoc());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -65,7 +65,8 @@ public:
|
|||||||
// nsIDOMHTMLHeadingElement
|
// nsIDOMHTMLHeadingElement
|
||||||
NS_DECL_NSIDOMHTMLHEADINGELEMENT
|
NS_DECL_NSIDOMHTMLHEADINGELEMENT
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||||
@ -104,15 +105,17 @@ NS_IMPL_STRING_ATTR(nsHTMLHeadingElement, Align, align)
|
|||||||
|
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLHeadingElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLHeadingElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (aAttribute == nsHTMLAtoms::align) {
|
if (aAttribute == nsHTMLAtoms::align && aNamespaceID == kNameSpaceID_None) {
|
||||||
return ParseDivAlignValue(aValue, aResult);
|
return ParseDivAlignValue(aValue, aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -67,7 +67,8 @@ public:
|
|||||||
NS_DECL_NSIDOMHTMLIFRAMEELEMENT
|
NS_DECL_NSIDOMHTMLIFRAMEELEMENT
|
||||||
|
|
||||||
// nsIContent
|
// nsIContent
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||||
@ -119,33 +120,37 @@ nsHTMLIFrameElement::GetContentDocument(nsIDOMDocument** aContentDocument)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLIFrameElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLIFrameElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (aAttribute == nsHTMLAtoms::marginwidth) {
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
if (aAttribute == nsHTMLAtoms::marginwidth) {
|
||||||
}
|
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
||||||
if (aAttribute == nsHTMLAtoms::marginheight) {
|
}
|
||||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
if (aAttribute == nsHTMLAtoms::marginheight) {
|
||||||
}
|
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
||||||
if (aAttribute == nsHTMLAtoms::width) {
|
}
|
||||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
if (aAttribute == nsHTMLAtoms::width) {
|
||||||
}
|
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
||||||
if (aAttribute == nsHTMLAtoms::height) {
|
}
|
||||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
if (aAttribute == nsHTMLAtoms::height) {
|
||||||
}
|
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
||||||
if (aAttribute == nsHTMLAtoms::frameborder) {
|
}
|
||||||
return ParseFrameborderValue(aValue, aResult);
|
if (aAttribute == nsHTMLAtoms::frameborder) {
|
||||||
}
|
return ParseFrameborderValue(aValue, aResult);
|
||||||
if (aAttribute == nsHTMLAtoms::scrolling) {
|
}
|
||||||
return ParseScrollingValue(aValue, aResult);
|
if (aAttribute == nsHTMLAtoms::scrolling) {
|
||||||
}
|
return ParseScrollingValue(aValue, aResult);
|
||||||
if (aAttribute == nsHTMLAtoms::align) {
|
}
|
||||||
return ParseAlignValue(aValue, aResult);
|
if (aAttribute == nsHTMLAtoms::align) {
|
||||||
|
return ParseAlignValue(aValue, aResult);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLFrameElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLFrameElement::ParseAttribute(aNamespaceID, aAttribute,
|
||||||
|
aValue, aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -113,7 +113,8 @@ public:
|
|||||||
PRUint32 argc, jsval *argv);
|
PRUint32 argc, jsval *argv);
|
||||||
|
|
||||||
// nsIContent
|
// nsIContent
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute,
|
virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute,
|
||||||
@ -421,23 +422,27 @@ nsHTMLImageElement::SetWidth(PRInt32 aWidth)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLImageElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLImageElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (aAttribute == nsHTMLAtoms::align) {
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
return ParseAlignValue(aValue, aResult);
|
if (aAttribute == nsHTMLAtoms::align) {
|
||||||
}
|
return ParseAlignValue(aValue, aResult);
|
||||||
if (aAttribute == nsHTMLAtoms::src) {
|
}
|
||||||
static const char* kWhitespace = " \n\r\t\b";
|
if (aAttribute == nsHTMLAtoms::src) {
|
||||||
aResult.SetTo(nsContentUtils::TrimCharsInSet(kWhitespace, aValue));
|
static const char* kWhitespace = " \n\r\t\b";
|
||||||
return PR_TRUE;
|
aResult.SetTo(nsContentUtils::TrimCharsInSet(kWhitespace, aValue));
|
||||||
}
|
return PR_TRUE;
|
||||||
if (ParseImageAttribute(aAttribute, aValue, aResult)) {
|
}
|
||||||
return PR_TRUE;
|
if (ParseImageAttribute(aAttribute, aValue, aResult)) {
|
||||||
|
return PR_TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -180,7 +180,8 @@ public:
|
|||||||
virtual void SetFocus(nsPresContext* aPresContext);
|
virtual void SetFocus(nsPresContext* aPresContext);
|
||||||
virtual PRBool IsFocusable(PRInt32 *aTabIndex = nsnull);
|
virtual PRBool IsFocusable(PRInt32 *aTabIndex = nsnull);
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute,
|
virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute,
|
||||||
@ -1728,56 +1729,60 @@ static const nsAttrValue::EnumTable kInputTypeTable[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLInputElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLInputElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (aAttribute == nsHTMLAtoms::type) {
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
// XXX ARG!! This is major evilness. ParseAttribute
|
if (aAttribute == nsHTMLAtoms::type) {
|
||||||
// shouldn't set members. Override SetAttr instead
|
// XXX ARG!! This is major evilness. ParseAttribute
|
||||||
if (!aResult.ParseEnumValue(aValue, kInputTypeTable)) {
|
// shouldn't set members. Override SetAttr instead
|
||||||
mType = NS_FORM_INPUT_TEXT;
|
if (!aResult.ParseEnumValue(aValue, kInputTypeTable)) {
|
||||||
return PR_FALSE;
|
mType = NS_FORM_INPUT_TEXT;
|
||||||
|
return PR_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
mType = aResult.GetEnumValue();
|
||||||
|
if (mType == NS_FORM_INPUT_FILE) {
|
||||||
|
// If the type is being changed to file, set the element value
|
||||||
|
// to the empty string. This is for security.
|
||||||
|
// Call SetValueInternal so that this doesn't accidentally get caught
|
||||||
|
// in the security checks in SetValue.
|
||||||
|
SetValueInternal(EmptyString(), nsnull);
|
||||||
|
}
|
||||||
|
|
||||||
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::width) {
|
||||||
mType = aResult.GetEnumValue();
|
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
||||||
if (mType == NS_FORM_INPUT_FILE) {
|
}
|
||||||
// If the type is being changed to file, set the element value
|
if (aAttribute == nsHTMLAtoms::height) {
|
||||||
// to the empty string. This is for security.
|
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
||||||
// Call SetValueInternal so that this doesn't accidentally get caught
|
}
|
||||||
// in the security checks in SetValue.
|
if (aAttribute == nsHTMLAtoms::maxlength) {
|
||||||
SetValueInternal(EmptyString(), nsnull);
|
return aResult.ParseIntWithBounds(aValue, 0);
|
||||||
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::size) {
|
||||||
|
return aResult.ParseIntWithBounds(aValue, 0);
|
||||||
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::border) {
|
||||||
|
return aResult.ParseIntWithBounds(aValue, 0);
|
||||||
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::align) {
|
||||||
|
return ParseAlignValue(aValue, aResult);
|
||||||
|
}
|
||||||
|
if (ParseImageAttribute(aAttribute, aValue, aResult)) {
|
||||||
|
// We have to call |ParseImageAttribute| unconditionally since we
|
||||||
|
// don't know if we're going to have a type="image" attribute yet,
|
||||||
|
// (or could have it set dynamically in the future). See bug
|
||||||
|
// 214077.
|
||||||
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return PR_TRUE;
|
|
||||||
}
|
|
||||||
if (aAttribute == nsHTMLAtoms::width) {
|
|
||||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
|
||||||
}
|
|
||||||
if (aAttribute == nsHTMLAtoms::height) {
|
|
||||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
|
||||||
}
|
|
||||||
if (aAttribute == nsHTMLAtoms::maxlength) {
|
|
||||||
return aResult.ParseIntWithBounds(aValue, 0);
|
|
||||||
}
|
|
||||||
if (aAttribute == nsHTMLAtoms::size) {
|
|
||||||
return aResult.ParseIntWithBounds(aValue, 0);
|
|
||||||
}
|
|
||||||
if (aAttribute == nsHTMLAtoms::border) {
|
|
||||||
return aResult.ParseIntWithBounds(aValue, 0);
|
|
||||||
}
|
|
||||||
if (aAttribute == nsHTMLAtoms::align) {
|
|
||||||
return ParseAlignValue(aValue, aResult);
|
|
||||||
}
|
|
||||||
if (ParseImageAttribute(aAttribute, aValue, aResult)) {
|
|
||||||
// We have to call |ParseImageAttribute| unconditionally since we
|
|
||||||
// don't know if we're going to have a type="image" attribute yet,
|
|
||||||
// (or could have it set dynamically in the future). See bug
|
|
||||||
// 214077.
|
|
||||||
return PR_TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
|
@ -65,7 +65,8 @@ public:
|
|||||||
// nsIDOMHTMLLIElement
|
// nsIDOMHTMLLIElement
|
||||||
NS_DECL_NSIDOMHTMLLIELEMENT
|
NS_DECL_NSIDOMHTMLLIELEMENT
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||||
@ -122,19 +123,24 @@ static const nsAttrValue::EnumTable kOrderedListItemTypeTable[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLLIElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLLIElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (aAttribute == nsHTMLAtoms::type) {
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
return aResult.ParseEnumValue(aValue, kOrderedListItemTypeTable, PR_TRUE) ||
|
if (aAttribute == nsHTMLAtoms::type) {
|
||||||
aResult.ParseEnumValue(aValue, kUnorderedListItemTypeTable);
|
return aResult.ParseEnumValue(aValue, kOrderedListItemTypeTable,
|
||||||
}
|
PR_TRUE) ||
|
||||||
if (aAttribute == nsHTMLAtoms::value) {
|
aResult.ParseEnumValue(aValue, kUnorderedListItemTypeTable);
|
||||||
return aResult.ParseIntWithBounds(aValue, 0);
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::value) {
|
||||||
|
return aResult.ParseIntWithBounds(aValue, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -84,7 +84,8 @@ public:
|
|||||||
virtual void UnbindFromTree(PRBool aDeep = PR_TRUE,
|
virtual void UnbindFromTree(PRBool aDeep = PR_TRUE,
|
||||||
PRBool aNullParent = PR_TRUE);
|
PRBool aNullParent = PR_TRUE);
|
||||||
virtual void SetFocus(nsPresContext* aPresContext);
|
virtual void SetFocus(nsPresContext* aPresContext);
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute,
|
virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute,
|
||||||
@ -154,15 +155,17 @@ static const nsAttrValue::EnumTable kAlignTable[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLLegendElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLLegendElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (aAttribute == nsHTMLAtoms::align) {
|
if (aAttribute == nsHTMLAtoms::align && aNamespaceID == kNameSpaceID_None) {
|
||||||
return aResult.ParseEnumValue(aValue, kAlignTable);
|
return aResult.ParseEnumValue(aValue, kAlignTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsChangeHint
|
nsChangeHint
|
||||||
|
@ -75,7 +75,8 @@ public:
|
|||||||
// nsIDOMHTMLUListElement
|
// nsIDOMHTMLUListElement
|
||||||
// fully declared by NS_DECL_NSIDOMHTMLOLISTELEMENT
|
// fully declared by NS_DECL_NSIDOMHTMLOLISTELEMENT
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||||
@ -147,22 +148,26 @@ nsAttrValue::EnumTable kOldListTypeTable[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLSharedListElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLSharedListElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (mNodeInfo->Equals(nsHTMLAtoms::ol) ||
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
mNodeInfo->Equals(nsHTMLAtoms::ul)) {
|
if (mNodeInfo->Equals(nsHTMLAtoms::ol) ||
|
||||||
if (aAttribute == nsHTMLAtoms::type) {
|
mNodeInfo->Equals(nsHTMLAtoms::ul)) {
|
||||||
return aResult.ParseEnumValue(aValue, kListTypeTable) ||
|
if (aAttribute == nsHTMLAtoms::type) {
|
||||||
aResult.ParseEnumValue(aValue, kOldListTypeTable, PR_TRUE);
|
return aResult.ParseEnumValue(aValue, kListTypeTable) ||
|
||||||
}
|
aResult.ParseEnumValue(aValue, kOldListTypeTable, PR_TRUE);
|
||||||
if (aAttribute == nsHTMLAtoms::start) {
|
}
|
||||||
return aResult.ParseIntValue(aValue);
|
if (aAttribute == nsHTMLAtoms::start) {
|
||||||
|
return aResult.ParseIntValue(aValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -98,7 +98,8 @@ public:
|
|||||||
virtual void DoneAddingChildren(PRBool aHaveNotified);
|
virtual void DoneAddingChildren(PRBool aHaveNotified);
|
||||||
virtual PRBool IsDoneAddingChildren();
|
virtual PRBool IsDoneAddingChildren();
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||||
@ -365,18 +366,22 @@ nsHTMLObjectElement::GetContentDocument(nsIDOMDocument** aContentDocument)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLObjectElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLObjectElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (aAttribute == nsHTMLAtoms::align) {
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
return ParseAlignValue(aValue, aResult);
|
if (aAttribute == nsHTMLAtoms::align) {
|
||||||
}
|
return ParseAlignValue(aValue, aResult);
|
||||||
if (ParseImageAttribute(aAttribute, aValue, aResult)) {
|
}
|
||||||
return PR_TRUE;
|
if (ParseImageAttribute(aAttribute, aValue, aResult)) {
|
||||||
|
return PR_TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLFormElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLFormElement::ParseAttribute(aNamespaceID, aAttribute,
|
||||||
|
aValue, aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -68,7 +68,8 @@ public:
|
|||||||
// nsIDOMHTMLParagraphElement
|
// nsIDOMHTMLParagraphElement
|
||||||
NS_DECL_NSIDOMHTMLPARAGRAPHELEMENT
|
NS_DECL_NSIDOMHTMLPARAGRAPHELEMENT
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||||
@ -108,15 +109,17 @@ NS_IMPL_STRING_ATTR(nsHTMLParagraphElement, Align, align)
|
|||||||
|
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLParagraphElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLParagraphElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (aAttribute == nsHTMLAtoms::align) {
|
if (aAttribute == nsHTMLAtoms::align && aNamespaceID == kNameSpaceID_None) {
|
||||||
return ParseDivAlignValue(aValue, aResult);
|
return ParseDivAlignValue(aValue, aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -70,7 +70,8 @@ public:
|
|||||||
NS_IMETHOD GetWidth(PRInt32* aWidth);
|
NS_IMETHOD GetWidth(PRInt32* aWidth);
|
||||||
NS_IMETHOD SetWidth(PRInt32 aWidth);
|
NS_IMETHOD SetWidth(PRInt32 aWidth);
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||||
@ -109,18 +110,22 @@ NS_IMPL_INT_ATTR(nsHTMLPreElement, Width, width)
|
|||||||
|
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLPreElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLPreElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (aAttribute == nsHTMLAtoms::cols) {
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
return aResult.ParseIntWithBounds(aValue, 0);
|
if (aAttribute == nsHTMLAtoms::cols) {
|
||||||
}
|
return aResult.ParseIntWithBounds(aValue, 0);
|
||||||
if (aAttribute == nsHTMLAtoms::width) {
|
}
|
||||||
return aResult.ParseIntWithBounds(aValue, 0);
|
if (aAttribute == nsHTMLAtoms::width) {
|
||||||
|
return aResult.ParseIntWithBounds(aValue, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -249,7 +249,8 @@ public:
|
|||||||
virtual void DoneAddingChildren(PRBool aHaveNotified);
|
virtual void DoneAddingChildren(PRBool aHaveNotified);
|
||||||
virtual PRBool IsDoneAddingChildren();
|
virtual PRBool IsDoneAddingChildren();
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||||
@ -1695,14 +1696,16 @@ nsHTMLSelectElement::DoneAddingChildren(PRBool aHaveNotified)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLSelectElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLSelectElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (aAttribute == nsHTMLAtoms::size) {
|
if (aAttribute == nsHTMLAtoms::size && kNameSpaceID_None == aNamespaceID) {
|
||||||
return aResult.ParseIntWithBounds(aValue, 0);
|
return aResult.ParseIntWithBounds(aValue, 0);
|
||||||
}
|
}
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -133,7 +133,8 @@ public:
|
|||||||
virtual PRBool IsFocusable(PRInt32 *aTabIndex = nsnull);
|
virtual PRBool IsFocusable(PRInt32 *aTabIndex = nsnull);
|
||||||
virtual PRUint32 GetDesiredIMEState();
|
virtual PRUint32 GetDesiredIMEState();
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||||
@ -283,46 +284,50 @@ NS_IMPL_URI_ATTR(nsHTMLSharedElement, Href, href)
|
|||||||
NS_IMPL_STRING_ATTR(nsHTMLSharedElement, Target, target)
|
NS_IMPL_STRING_ATTR(nsHTMLSharedElement, Target, target)
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLSharedElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLSharedElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (mNodeInfo->Equals(nsHTMLAtoms::embed)) {
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
if (aAttribute == nsHTMLAtoms::align) {
|
if (mNodeInfo->Equals(nsHTMLAtoms::embed)) {
|
||||||
return ParseAlignValue(aValue, aResult);
|
if (aAttribute == nsHTMLAtoms::align) {
|
||||||
|
return ParseAlignValue(aValue, aResult);
|
||||||
|
}
|
||||||
|
if (ParseImageAttribute(aAttribute, aValue, aResult)) {
|
||||||
|
return PR_TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (ParseImageAttribute(aAttribute, aValue, aResult)) {
|
else if (mNodeInfo->Equals(nsHTMLAtoms::spacer)) {
|
||||||
return PR_TRUE;
|
if (aAttribute == nsHTMLAtoms::size) {
|
||||||
|
return aResult.ParseIntWithBounds(aValue, 0);
|
||||||
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::align) {
|
||||||
|
return ParseAlignValue(aValue, aResult);
|
||||||
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::width ||
|
||||||
|
aAttribute == nsHTMLAtoms::height) {
|
||||||
|
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
else if (mNodeInfo->Equals(nsHTMLAtoms::dir) ||
|
||||||
else if (mNodeInfo->Equals(nsHTMLAtoms::spacer)) {
|
mNodeInfo->Equals(nsHTMLAtoms::menu)) {
|
||||||
if (aAttribute == nsHTMLAtoms::size) {
|
if (aAttribute == nsHTMLAtoms::type) {
|
||||||
return aResult.ParseIntWithBounds(aValue, 0);
|
return aResult.ParseEnumValue(aValue, kListTypeTable);
|
||||||
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::start) {
|
||||||
|
return aResult.ParseIntWithBounds(aValue, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (aAttribute == nsHTMLAtoms::align) {
|
else if (mNodeInfo->Equals(nsHTMLAtoms::basefont)) {
|
||||||
return ParseAlignValue(aValue, aResult);
|
if (aAttribute == nsHTMLAtoms::size) {
|
||||||
}
|
return aResult.ParseIntValue(aValue);
|
||||||
if (aAttribute == nsHTMLAtoms::width ||
|
}
|
||||||
aAttribute == nsHTMLAtoms::height) {
|
|
||||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (mNodeInfo->Equals(nsHTMLAtoms::dir) ||
|
|
||||||
mNodeInfo->Equals(nsHTMLAtoms::menu)) {
|
|
||||||
if (aAttribute == nsHTMLAtoms::type) {
|
|
||||||
return aResult.ParseEnumValue(aValue, kListTypeTable);
|
|
||||||
}
|
|
||||||
if (aAttribute == nsHTMLAtoms::start) {
|
|
||||||
return aResult.ParseIntWithBounds(aValue, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (mNodeInfo->Equals(nsHTMLAtoms::basefont)) {
|
|
||||||
if (aAttribute == nsHTMLAtoms::size) {
|
|
||||||
return aResult.ParseIntValue(aValue);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
// spacer element code
|
// spacer element code
|
||||||
|
@ -91,7 +91,8 @@ public:
|
|||||||
NS_IMETHOD SaveState();
|
NS_IMETHOD SaveState();
|
||||||
virtual PRBool RestoreState(nsPresState* aState);
|
virtual PRBool RestoreState(nsPresState* aState);
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||||
@ -204,18 +205,22 @@ nsHTMLObjectElement::GetContentDocument(nsIDOMDocument** aContentDocument)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLObjectElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLObjectElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (aAttribute == nsHTMLAtoms::align) {
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
return ParseAlignValue(aValue, aResult);
|
if (aAttribute == nsHTMLAtoms::align) {
|
||||||
}
|
return ParseAlignValue(aValue, aResult);
|
||||||
if (ParseImageAttribute(aAttribute, aValue, aResult)) {
|
}
|
||||||
return PR_TRUE;
|
if (ParseImageAttribute(aAttribute, aValue, aResult)) {
|
||||||
|
return PR_TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -65,7 +65,8 @@ public:
|
|||||||
// nsIDOMHTMLTableCaptionElement
|
// nsIDOMHTMLTableCaptionElement
|
||||||
NS_DECL_NSIDOMHTMLTABLECAPTIONELEMENT
|
NS_DECL_NSIDOMHTMLTABLECAPTIONELEMENT
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||||
@ -113,15 +114,17 @@ static const nsAttrValue::EnumTable kCaptionAlignTable[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLTableCaptionElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLTableCaptionElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (aAttribute == nsHTMLAtoms::align) {
|
if (aAttribute == nsHTMLAtoms::align && aNamespaceID == kNameSpaceID_None) {
|
||||||
return aResult.ParseEnumValue(aValue, kCaptionAlignTable);
|
return aResult.ParseEnumValue(aValue, kCaptionAlignTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
|
@ -68,7 +68,8 @@ public:
|
|||||||
// nsIDOMHTMLTableCellElement
|
// nsIDOMHTMLTableCellElement
|
||||||
NS_DECL_NSIDOMHTMLTABLECELLELEMENT
|
NS_DECL_NSIDOMHTMLTABLECELLELEMENT
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||||
@ -261,60 +262,65 @@ static const nsAttrValue::EnumTable kCellScopeTable[] = {
|
|||||||
#define MAX_COLSPAN 1000 // limit as IE and opera do
|
#define MAX_COLSPAN 1000 // limit as IE and opera do
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLTableCellElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLTableCellElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
/* ignore these attributes, stored simply as strings
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
abbr, axis, ch, headers
|
/* ignore these attributes, stored simply as strings
|
||||||
*/
|
abbr, axis, ch, headers
|
||||||
if (aAttribute == nsHTMLAtoms::charoff) {
|
*/
|
||||||
/* attributes that resolve to integers with a min of 0 */
|
if (aAttribute == nsHTMLAtoms::charoff) {
|
||||||
return aResult.ParseIntWithBounds(aValue, 0);
|
/* attributes that resolve to integers with a min of 0 */
|
||||||
}
|
return aResult.ParseIntWithBounds(aValue, 0);
|
||||||
if (aAttribute == nsHTMLAtoms::colspan) {
|
|
||||||
PRBool res = aResult.ParseIntWithBounds(aValue, -1);
|
|
||||||
if (res) {
|
|
||||||
PRInt32 val = aResult.GetIntegerValue();
|
|
||||||
// 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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return res;
|
if (aAttribute == nsHTMLAtoms::colspan) {
|
||||||
}
|
PRBool res = aResult.ParseIntWithBounds(aValue, -1);
|
||||||
if (aAttribute == nsHTMLAtoms::rowspan) {
|
if (res) {
|
||||||
PRBool res = aResult.ParseIntWithBounds(aValue, -1, MAX_ROWSPAN);
|
PRInt32 val = aResult.GetIntegerValue();
|
||||||
if (res) {
|
// reset large colspan values as IE and opera do
|
||||||
PRInt32 val = aResult.GetIntegerValue();
|
// quirks mode does not honor the special html 4 value of 0
|
||||||
// quirks mode does not honor the special html 4 value of 0
|
if (val > MAX_COLSPAN || val < 0 ||
|
||||||
if (val < 0 || (0 == val && InNavQuirksMode(GetOwnerDoc()))) {
|
(0 == val && InNavQuirksMode(GetOwnerDoc()))) {
|
||||||
aResult.SetTo(1);
|
aResult.SetTo(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::rowspan) {
|
||||||
|
PRBool res = aResult.ParseIntWithBounds(aValue, -1, MAX_ROWSPAN);
|
||||||
|
if (res) {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::height) {
|
||||||
|
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
||||||
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::width) {
|
||||||
|
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
||||||
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::align) {
|
||||||
|
return ParseTableCellHAlignValue(aValue, aResult);
|
||||||
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::bgcolor) {
|
||||||
|
return aResult.ParseColor(aValue, GetOwnerDoc());
|
||||||
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::scope) {
|
||||||
|
return aResult.ParseEnumValue(aValue, kCellScopeTable);
|
||||||
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::valign) {
|
||||||
|
return ParseTableVAlignValue(aValue, aResult);
|
||||||
}
|
}
|
||||||
return res;
|
|
||||||
}
|
|
||||||
if (aAttribute == nsHTMLAtoms::height) {
|
|
||||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
|
||||||
}
|
|
||||||
if (aAttribute == nsHTMLAtoms::width) {
|
|
||||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
|
||||||
}
|
|
||||||
if (aAttribute == nsHTMLAtoms::align) {
|
|
||||||
return ParseTableCellHAlignValue(aValue, aResult);
|
|
||||||
}
|
|
||||||
if (aAttribute == nsHTMLAtoms::bgcolor) {
|
|
||||||
return aResult.ParseColor(aValue, GetOwnerDoc());
|
|
||||||
}
|
|
||||||
if (aAttribute == nsHTMLAtoms::scope) {
|
|
||||||
return aResult.ParseEnumValue(aValue, kCellScopeTable);
|
|
||||||
}
|
|
||||||
if (aAttribute == nsHTMLAtoms::valign) {
|
|
||||||
return ParseTableVAlignValue(aValue, aResult);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
|
@ -69,7 +69,8 @@ public:
|
|||||||
// nsIDOMHTMLTableColElement
|
// nsIDOMHTMLTableColElement
|
||||||
NS_DECL_NSIDOMHTMLTABLECOLELEMENT
|
NS_DECL_NSIDOMHTMLTABLECOLELEMENT
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||||
@ -114,29 +115,33 @@ NS_IMPL_STRING_ATTR(nsHTMLTableColElement, Width, width)
|
|||||||
|
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLTableColElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLTableColElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
/* ignore these attributes, stored simply as strings ch */
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
if (aAttribute == nsHTMLAtoms::charoff) {
|
/* ignore these attributes, stored simply as strings ch */
|
||||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
if (aAttribute == nsHTMLAtoms::charoff) {
|
||||||
}
|
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
||||||
if (aAttribute == nsHTMLAtoms::span) {
|
}
|
||||||
/* protection from unrealistic large colspan values */
|
if (aAttribute == nsHTMLAtoms::span) {
|
||||||
return aResult.ParseIntWithBounds(aValue, 1, MAX_COLSPAN);
|
/* protection from unrealistic large colspan values */
|
||||||
}
|
return aResult.ParseIntWithBounds(aValue, 1, MAX_COLSPAN);
|
||||||
if (aAttribute == nsHTMLAtoms::width) {
|
}
|
||||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_TRUE);
|
if (aAttribute == nsHTMLAtoms::width) {
|
||||||
}
|
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_TRUE);
|
||||||
if (aAttribute == nsHTMLAtoms::align) {
|
}
|
||||||
return ParseTableCellHAlignValue(aValue, aResult);
|
if (aAttribute == nsHTMLAtoms::align) {
|
||||||
}
|
return ParseTableCellHAlignValue(aValue, aResult);
|
||||||
if (aAttribute == nsHTMLAtoms::valign) {
|
}
|
||||||
return ParseTableVAlignValue(aValue, aResult);
|
if (aAttribute == nsHTMLAtoms::valign) {
|
||||||
|
return ParseTableVAlignValue(aValue, aResult);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
|
@ -81,7 +81,8 @@ public:
|
|||||||
// nsIDOMHTMLTableElement
|
// nsIDOMHTMLTableElement
|
||||||
NS_DECL_NSIDOMHTMLTABLEELEMENT
|
NS_DECL_NSIDOMHTMLTABLEELEMENT
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||||
@ -876,62 +877,69 @@ static const nsAttrValue::EnumTable kLayoutTable[] = {
|
|||||||
|
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLTableElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLTableElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
/* ignore summary, just a string */
|
/* ignore summary, just a string */
|
||||||
if (aAttribute == nsHTMLAtoms::cellspacing ||
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
aAttribute == nsHTMLAtoms::cellpadding) {
|
if (aAttribute == nsHTMLAtoms::cellspacing ||
|
||||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
aAttribute == nsHTMLAtoms::cellpadding) {
|
||||||
}
|
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
||||||
if (aAttribute == nsHTMLAtoms::cols) {
|
|
||||||
return aResult.ParseIntWithBounds(aValue, 0);
|
|
||||||
}
|
|
||||||
if (aAttribute == nsHTMLAtoms::border) {
|
|
||||||
if (!aResult.ParseIntWithBounds(aValue, 0)) {
|
|
||||||
// XXX this should really be NavQuirks only to allow non numeric value
|
|
||||||
aResult.SetTo(1);
|
|
||||||
}
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::cols) {
|
||||||
return PR_TRUE;
|
return aResult.ParseIntWithBounds(aValue, 0);
|
||||||
}
|
}
|
||||||
if (aAttribute == nsHTMLAtoms::height) {
|
if (aAttribute == nsHTMLAtoms::border) {
|
||||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
if (!aResult.ParseIntWithBounds(aValue, 0)) {
|
||||||
}
|
// XXX this should really be NavQuirks only to allow non numeric value
|
||||||
if (aAttribute == nsHTMLAtoms::width) {
|
aResult.SetTo(1);
|
||||||
if (aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE)) {
|
|
||||||
// treat 0 width as auto
|
|
||||||
nsAttrValue::ValueType type = aResult.Type();
|
|
||||||
if ((type == nsAttrValue::eInteger && aResult.GetIntegerValue() == 0) ||
|
|
||||||
(type == nsAttrValue::ePercent && aResult.GetPercentValue() == 0.0f)) {
|
|
||||||
return PR_FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return PR_TRUE;
|
||||||
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::height) {
|
||||||
|
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
||||||
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::width) {
|
||||||
|
if (aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE)) {
|
||||||
|
// treat 0 width as auto
|
||||||
|
nsAttrValue::ValueType type = aResult.Type();
|
||||||
|
if ((type == nsAttrValue::eInteger &&
|
||||||
|
aResult.GetIntegerValue() == 0) ||
|
||||||
|
(type == nsAttrValue::ePercent &&
|
||||||
|
aResult.GetPercentValue() == 0.0f)) {
|
||||||
|
return PR_FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return PR_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (aAttribute == nsHTMLAtoms::align) {
|
||||||
|
return ParseTableHAlignValue(aValue, aResult);
|
||||||
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::bgcolor ||
|
||||||
|
aAttribute == nsHTMLAtoms::bordercolor) {
|
||||||
|
return aResult.ParseColor(aValue, GetOwnerDoc());
|
||||||
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::frame) {
|
||||||
|
return aResult.ParseEnumValue(aValue, kFrameTable);
|
||||||
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::layout) {
|
||||||
|
return aResult.ParseEnumValue(aValue, kLayoutTable);
|
||||||
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::rules) {
|
||||||
|
return aResult.ParseEnumValue(aValue, kRulesTable);
|
||||||
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::hspace ||
|
||||||
|
aAttribute == nsHTMLAtoms::vspace) {
|
||||||
|
return aResult.ParseIntWithBounds(aValue, 0);
|
||||||
}
|
}
|
||||||
return PR_TRUE;
|
|
||||||
}
|
|
||||||
if (aAttribute == nsHTMLAtoms::align) {
|
|
||||||
return ParseTableHAlignValue(aValue, aResult);
|
|
||||||
}
|
|
||||||
if (aAttribute == nsHTMLAtoms::bgcolor ||
|
|
||||||
aAttribute == nsHTMLAtoms::bordercolor) {
|
|
||||||
return aResult.ParseColor(aValue, GetOwnerDoc());
|
|
||||||
}
|
|
||||||
if (aAttribute == nsHTMLAtoms::frame) {
|
|
||||||
return aResult.ParseEnumValue(aValue, kFrameTable);
|
|
||||||
}
|
|
||||||
if (aAttribute == nsHTMLAtoms::layout) {
|
|
||||||
return aResult.ParseEnumValue(aValue, kLayoutTable);
|
|
||||||
}
|
|
||||||
if (aAttribute == nsHTMLAtoms::rules) {
|
|
||||||
return aResult.ParseEnumValue(aValue, kRulesTable);
|
|
||||||
}
|
|
||||||
if (aAttribute == nsHTMLAtoms::hspace ||
|
|
||||||
aAttribute == nsHTMLAtoms::vspace) {
|
|
||||||
return aResult.ParseIntWithBounds(aValue, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -76,7 +76,8 @@ public:
|
|||||||
// nsIDOMHTMLTableRowElement
|
// nsIDOMHTMLTableRowElement
|
||||||
NS_DECL_NSIDOMHTMLTABLEROWELEMENT
|
NS_DECL_NSIDOMHTMLTABLEROWELEMENT
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||||
@ -385,7 +386,8 @@ NS_IMPL_STRING_ATTR_DEFAULT_VALUE(nsHTMLTableRowElement, VAlign, valign, "middle
|
|||||||
|
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLTableRowElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLTableRowElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
@ -395,26 +397,29 @@ nsHTMLTableRowElement::ParseAttribute(nsIAtom* aAttribute,
|
|||||||
* ch
|
* ch
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (aAttribute == nsHTMLAtoms::charoff) {
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
return aResult.ParseIntWithBounds(aValue, 0);
|
if (aAttribute == nsHTMLAtoms::charoff) {
|
||||||
}
|
return aResult.ParseIntWithBounds(aValue, 0);
|
||||||
if (aAttribute == nsHTMLAtoms::height) {
|
}
|
||||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
if (aAttribute == nsHTMLAtoms::height) {
|
||||||
}
|
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
||||||
if (aAttribute == nsHTMLAtoms::width) {
|
}
|
||||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
if (aAttribute == nsHTMLAtoms::width) {
|
||||||
}
|
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
||||||
if (aAttribute == nsHTMLAtoms::align) {
|
}
|
||||||
return ParseTableCellHAlignValue(aValue, aResult);
|
if (aAttribute == nsHTMLAtoms::align) {
|
||||||
}
|
return ParseTableCellHAlignValue(aValue, aResult);
|
||||||
if (aAttribute == nsHTMLAtoms::bgcolor) {
|
}
|
||||||
return aResult.ParseColor(aValue, GetOwnerDoc());
|
if (aAttribute == nsHTMLAtoms::bgcolor) {
|
||||||
}
|
return aResult.ParseColor(aValue, GetOwnerDoc());
|
||||||
if (aAttribute == nsHTMLAtoms::valign) {
|
}
|
||||||
return ParseTableVAlignValue(aValue, aResult);
|
if (aAttribute == nsHTMLAtoms::valign) {
|
||||||
|
return ParseTableVAlignValue(aValue, aResult);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
|
@ -71,7 +71,8 @@ public:
|
|||||||
// nsIDOMHTMLTableSectionElement
|
// nsIDOMHTMLTableSectionElement
|
||||||
NS_DECL_NSIDOMHTMLTABLESECTIONELEMENT
|
NS_DECL_NSIDOMHTMLTABLESECTIONELEMENT
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||||
@ -232,30 +233,34 @@ nsHTMLTableSectionElement::DeleteRow(PRInt32 aValue)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLTableSectionElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLTableSectionElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
/* ignore these attributes, stored simply as strings
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
ch
|
/* ignore these attributes, stored simply as strings
|
||||||
*/
|
ch
|
||||||
if (aAttribute == nsHTMLAtoms::charoff) {
|
*/
|
||||||
return aResult.ParseIntWithBounds(aValue, 0);
|
if (aAttribute == nsHTMLAtoms::charoff) {
|
||||||
}
|
return aResult.ParseIntWithBounds(aValue, 0);
|
||||||
if (aAttribute == nsHTMLAtoms::height) {
|
}
|
||||||
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
if (aAttribute == nsHTMLAtoms::height) {
|
||||||
}
|
return aResult.ParseSpecialIntValue(aValue, PR_TRUE, PR_FALSE);
|
||||||
if (aAttribute == nsHTMLAtoms::align) {
|
}
|
||||||
return ParseTableCellHAlignValue(aValue, aResult);
|
if (aAttribute == nsHTMLAtoms::align) {
|
||||||
}
|
return ParseTableCellHAlignValue(aValue, aResult);
|
||||||
if (aAttribute == nsHTMLAtoms::bgcolor) {
|
}
|
||||||
return aResult.ParseColor(aValue, GetOwnerDoc());
|
if (aAttribute == nsHTMLAtoms::bgcolor) {
|
||||||
}
|
return aResult.ParseColor(aValue, GetOwnerDoc());
|
||||||
if (aAttribute == nsHTMLAtoms::valign) {
|
}
|
||||||
return ParseTableVAlignValue(aValue, aResult);
|
if (aAttribute == nsHTMLAtoms::valign) {
|
||||||
|
return ParseTableVAlignValue(aValue, aResult);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
|
@ -121,7 +121,8 @@ public:
|
|||||||
PRBool aNotify);
|
PRBool aNotify);
|
||||||
virtual nsresult AppendChildTo(nsIContent* aKid, PRBool aNotify);
|
virtual nsresult AppendChildTo(nsIContent* aKid, PRBool aNotify);
|
||||||
virtual nsresult RemoveChildAt(PRUint32 aIndex, PRBool aNotify);
|
virtual nsresult RemoveChildAt(PRUint32 aIndex, PRBool aNotify);
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||||
@ -491,17 +492,21 @@ nsHTMLTextAreaElement::RemoveChildAt(PRUint32 aIndex, PRBool aNotify)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsHTMLTextAreaElement::ParseAttribute(nsIAtom* aAttribute,
|
nsHTMLTextAreaElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
if (aAttribute == nsHTMLAtoms::cols) {
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
return aResult.ParseIntWithBounds(aValue, 0);
|
if (aAttribute == nsHTMLAtoms::cols) {
|
||||||
|
return aResult.ParseIntWithBounds(aValue, 0);
|
||||||
|
}
|
||||||
|
if (aAttribute == nsHTMLAtoms::rows) {
|
||||||
|
return aResult.ParseIntWithBounds(aValue, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (aAttribute == nsHTMLAtoms::rows) {
|
return nsGenericHTMLElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
return aResult.ParseIntWithBounds(aValue, 0);
|
aResult);
|
||||||
}
|
|
||||||
return nsGenericHTMLElement::ParseAttribute(aAttribute, aValue, aResult);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -165,13 +165,14 @@ nsSVGElement::AfterSetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsSVGElement::ParseAttribute(nsIAtom* aAttribute,
|
nsSVGElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
// Parse value
|
// Parse value
|
||||||
nsCOMPtr<nsISVGValue> svg_value;
|
nsCOMPtr<nsISVGValue> svg_value;
|
||||||
const nsAttrValue* val = mAttrsAndChildren.GetAttr(aAttribute);
|
const nsAttrValue* val = mAttrsAndChildren.GetAttr(aAttribute, aNamespaceID);
|
||||||
if (val) {
|
if (val) {
|
||||||
// Found the attr in the list.
|
// Found the attr in the list.
|
||||||
if (val->Type() == nsAttrValue::eSVGValue) {
|
if (val->Type() == nsAttrValue::eSVGValue) {
|
||||||
@ -180,7 +181,7 @@ nsSVGElement::ParseAttribute(nsIAtom* aAttribute,
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Could be a mapped attribute.
|
// Could be a mapped attribute.
|
||||||
svg_value = GetMappedAttribute(kNameSpaceID_None, aAttribute);
|
svg_value = GetMappedAttribute(aNamespaceID, aAttribute);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (svg_value) {
|
if (svg_value) {
|
||||||
@ -208,12 +209,13 @@ nsSVGElement::ParseAttribute(nsIAtom* aAttribute,
|
|||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aAttribute == nsSVGAtoms::style) {
|
if (aAttribute == nsSVGAtoms::style && aNamespaceID == kNameSpaceID_None) {
|
||||||
nsGenericHTMLElement::ParseStyleAttribute(this, PR_TRUE, aValue, aResult);
|
nsGenericHTMLElement::ParseStyleAttribute(this, PR_TRUE, aValue, aResult);
|
||||||
return PR_TRUE;
|
return PR_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return nsGenericElement::ParseAttribute(aAttribute, aValue, aResult);
|
return nsGenericElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
|
aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
@ -120,9 +120,8 @@ protected:
|
|||||||
const nsAString* aValue, PRBool aNotify);
|
const nsAString* aValue, PRBool aNotify);
|
||||||
virtual nsresult AfterSetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
|
||||||
const nsAString* aValue, PRBool aNotify);
|
const nsAString* aValue, PRBool aNotify);
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID, nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue, nsAttrValue& aResult);
|
||||||
nsAttrValue& aResult);
|
|
||||||
|
|
||||||
// Hooks for subclasses
|
// Hooks for subclasses
|
||||||
virtual PRBool IsEventName(nsIAtom* aName);
|
virtual PRBool IsEventName(nsIAtom* aName);
|
||||||
|
@ -1237,7 +1237,8 @@ nsXULElement::AfterSetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
PRBool
|
PRBool
|
||||||
nsXULElement::ParseAttribute(nsIAtom* aAttribute,
|
nsXULElement::ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult)
|
nsAttrValue& aResult)
|
||||||
{
|
{
|
||||||
@ -1246,18 +1247,21 @@ nsXULElement::ParseAttribute(nsIAtom* aAttribute,
|
|||||||
// WARNING!!
|
// WARNING!!
|
||||||
// This code is largely duplicated in nsXULPrototypeElement::SetAttrAt.
|
// This code is largely duplicated in nsXULPrototypeElement::SetAttrAt.
|
||||||
// Any changes should be made to both functions.
|
// Any changes should be made to both functions.
|
||||||
if (aAttribute == nsXULAtoms::style) {
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
nsGenericHTMLElement::ParseStyleAttribute(this, PR_TRUE, aValue,
|
if (aAttribute == nsXULAtoms::style) {
|
||||||
aResult);
|
nsGenericHTMLElement::ParseStyleAttribute(this, PR_TRUE, aValue,
|
||||||
return PR_TRUE;
|
aResult);
|
||||||
|
return PR_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (aAttribute == nsXULAtoms::clazz) {
|
||||||
|
aResult.ParseAtomArray(aValue);
|
||||||
|
return PR_TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aAttribute == nsXULAtoms::clazz) {
|
if (!nsGenericElement::ParseAttribute(aNamespaceID, aAttribute, aValue,
|
||||||
aResult.ParseAtomArray(aValue);
|
aResult)) {
|
||||||
return PR_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!nsGenericElement::ParseAttribute(aAttribute, aValue, aResult)) {
|
|
||||||
// Fall back to parsing as atom for short values
|
// Fall back to parsing as atom for short values
|
||||||
aResult.ParseStringOrAtom(aValue);
|
aResult.ParseStringOrAtom(aValue);
|
||||||
}
|
}
|
||||||
|
@ -615,7 +615,8 @@ protected:
|
|||||||
virtual nsresult AfterSetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
|
virtual nsresult AfterSetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
|
||||||
const nsAString* aValue, PRBool aNotify);
|
const nsAString* aValue, PRBool aNotify);
|
||||||
|
|
||||||
virtual PRBool ParseAttribute(nsIAtom* aAttribute,
|
virtual PRBool ParseAttribute(PRInt32 aNamespaceID,
|
||||||
|
nsIAtom* aAttribute,
|
||||||
const nsAString& aValue,
|
const nsAString& aValue,
|
||||||
nsAttrValue& aResult);
|
nsAttrValue& aResult);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user