зеркало из https://github.com/mozilla/gecko-dev.git
Stop case-folding attribute values. This makes us compatible with NS4
on those properties that can be gotten in NS4 and compatible with IE 5.5/6 across the board. Bug 113174, r=fabian, sr=jst
This commit is contained in:
Родитель
baccff3105
Коммит
f5ba21ce3e
|
@ -2469,26 +2469,19 @@ nsGenericHTMLElement::ParseCaseSensitiveEnumValue(const nsAReadableString& aValu
|
|||
PRBool
|
||||
nsGenericHTMLElement::EnumValueToString(const nsHTMLValue& aValue,
|
||||
EnumTable* aTable,
|
||||
nsAWritableString& aResult,
|
||||
PRBool aFoldCase)
|
||||
nsAWritableString& aResult)
|
||||
{
|
||||
aResult.Truncate(0);
|
||||
if (aValue.GetUnit() == eHTMLUnit_Enumerated) {
|
||||
PRInt32 v = aValue.GetIntValue();
|
||||
while (nsnull != aTable->tag) {
|
||||
if (aTable->value == v) {
|
||||
aResult.Append(NS_ConvertASCIItoUCS2(aTable->tag));
|
||||
if (aFoldCase) {
|
||||
nsWritingIterator<PRUnichar> start;
|
||||
aResult.BeginWriting(start);
|
||||
|
||||
*start.get() = nsCRT::ToUpper((char)*start);
|
||||
}
|
||||
aResult.Assign(NS_ConvertASCIItoUCS2(aTable->tag));
|
||||
return PR_TRUE;
|
||||
}
|
||||
aTable++;
|
||||
}
|
||||
}
|
||||
aResult.Truncate();
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -228,8 +228,7 @@ public:
|
|||
|
||||
static PRBool EnumValueToString(const nsHTMLValue& aValue,
|
||||
EnumTable* aTable,
|
||||
nsAWritableString& aResult,
|
||||
PRBool aFoldCase=PR_TRUE);
|
||||
nsAWritableString& aResult);
|
||||
|
||||
static PRBool ParseValueOrPercent(const nsAReadableString& aString,
|
||||
nsHTMLValue& aResult,
|
||||
|
|
|
@ -387,7 +387,7 @@ nsHTMLButtonElement::AttributeToString(nsIAtom* aAttribute,
|
|||
{
|
||||
if (aAttribute == nsHTMLAtoms::type) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
EnumValueToString(aValue, kButtonTypeTable, aResult, PR_FALSE);
|
||||
EnumValueToString(aValue, kButtonTypeTable, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -450,13 +450,13 @@ nsHTMLFormElement::AttributeToString(nsIAtom* aAttribute,
|
|||
{
|
||||
if (aAttribute == nsHTMLAtoms::method) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
EnumValueToString(aValue, kFormMethodTable, aResult, PR_FALSE);
|
||||
EnumValueToString(aValue, kFormMethodTable, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
else if (aAttribute == nsHTMLAtoms::enctype) {
|
||||
if (eHTMLUnit_Enumerated == aValue.GetUnit()) {
|
||||
EnumValueToString(aValue, kFormEnctypeTable, aResult, PR_FALSE);
|
||||
EnumValueToString(aValue, kFormEnctypeTable, aResult);
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1441,8 +1441,12 @@ nsHTMLInputElement::AttributeToString(nsIAtom* aAttribute,
|
|||
// about this problem, we pass PR_FALSE as the last argument
|
||||
// here to avoid capitalizing the input type (this is required for
|
||||
// backwards compatibility). -- 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
|
||||
|
||||
EnumValueToString(aValue, kInputTypeTable, aResult, PR_FALSE);
|
||||
EnumValueToString(aValue, kInputTypeTable, aResult);
|
||||
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
}
|
||||
|
|
|
@ -206,10 +206,10 @@ nsHTMLLIElement::AttributeToString(nsIAtom* aAttribute,
|
|||
switch (v) {
|
||||
case NS_STYLE_LIST_STYLE_OLD_LOWER_ALPHA:
|
||||
case NS_STYLE_LIST_STYLE_OLD_LOWER_ROMAN:
|
||||
EnumValueToString(aValue, kListItemTypeTable, aResult, PR_FALSE);
|
||||
EnumValueToString(aValue, kListItemTypeTable, aResult);
|
||||
break;
|
||||
default:
|
||||
EnumValueToString(aValue, kListItemTypeTable, aResult, PR_TRUE);
|
||||
EnumValueToString(aValue, kListItemTypeTable, aResult);
|
||||
}
|
||||
|
||||
return NS_CONTENT_ATTR_HAS_VALUE;
|
||||
|
|
|
@ -224,7 +224,7 @@ nsHTMLOListElement::AttributeToString(nsIAtom* aAttribute,
|
|||
case NS_STYLE_LIST_STYLE_OLD_UPPER_ROMAN:
|
||||
case NS_STYLE_LIST_STYLE_OLD_LOWER_ALPHA:
|
||||
case NS_STYLE_LIST_STYLE_OLD_UPPER_ALPHA:
|
||||
EnumValueToString(aValue, kOldListTypeTable, aResult, PR_FALSE);
|
||||
EnumValueToString(aValue, kOldListTypeTable, aResult);
|
||||
break;
|
||||
default:
|
||||
EnumValueToString(aValue, kListTypeTable, aResult);
|
||||
|
|
|
@ -203,7 +203,7 @@ nsHTMLUListElement::AttributeToString(nsIAtom* aAttribute,
|
|||
case NS_STYLE_LIST_STYLE_OLD_UPPER_ROMAN:
|
||||
case NS_STYLE_LIST_STYLE_OLD_LOWER_ALPHA:
|
||||
case NS_STYLE_LIST_STYLE_OLD_UPPER_ALPHA:
|
||||
EnumValueToString(aValue, kOldListTypeTable, aResult, PR_FALSE);
|
||||
EnumValueToString(aValue, kOldListTypeTable, aResult);
|
||||
|
||||
break;
|
||||
default:
|
||||
|
|
Загрузка…
Ссылка в новой задаче