зеркало из https://github.com/mozilla/gecko-dev.git
Backing out bug 412237 due to regression test failure
This commit is contained in:
Родитель
cf3152214f
Коммит
6fa17badf2
|
@ -222,7 +222,7 @@ Implementation here:
|
|||
/* static */ PRBool
|
||||
nsMathMLElement::ParseNumericValue(const nsString& aString,
|
||||
nsCSSValue& aCSSValue,
|
||||
PRUint32 aFlags)
|
||||
PRBool aRequireLengthUnit)
|
||||
{
|
||||
nsAutoString str(aString);
|
||||
str.CompressWhitespace(); // aString is const in this code...
|
||||
|
@ -237,8 +237,6 @@ nsMathMLElement::ParseNumericValue(const nsString& aString,
|
|||
PRInt32 i = 0;
|
||||
PRUnichar c = str[0];
|
||||
if (c == '-') {
|
||||
if (!(aFlags & PARSE_ALLOW_NEGATIVE))
|
||||
return PR_FALSE;
|
||||
number.Append(c);
|
||||
i++;
|
||||
|
||||
|
@ -272,16 +270,16 @@ nsMathMLElement::ParseNumericValue(const nsString& aString,
|
|||
|
||||
nsCSSUnit cssUnit;
|
||||
if (unit.IsEmpty()) {
|
||||
if (aFlags & PARSE_ALLOW_UNITLESS) {
|
||||
// no explicit unit, this is a number that will act as a multiplier
|
||||
cssUnit = eCSSUnit_Number;
|
||||
} else {
|
||||
// We are supposed to have a unit, but there isn't one.
|
||||
if (aRequireLengthUnit) {
|
||||
// We are supposed to have a length unit, but there isn't one.
|
||||
// If the value is 0 we can just call it "pixels" otherwise
|
||||
// this is illegal.
|
||||
if (floatValue != 0.0)
|
||||
return PR_FALSE;
|
||||
cssUnit = eCSSUnit_Pixel;
|
||||
} else {
|
||||
// no explicit unit, this is a number that will act as a multiplier
|
||||
cssUnit = eCSSUnit_Number;
|
||||
}
|
||||
}
|
||||
else if (unit.EqualsLiteral("%")) {
|
||||
|
@ -330,7 +328,7 @@ nsMathMLElement::MapMathMLAttributesInto(const nsMappedAttributes* aAttributes,
|
|||
if (value && value->Type() == nsAttrValue::eString &&
|
||||
aData->mFontData->mScriptMinSize.GetUnit() == eCSSUnit_Null) {
|
||||
ParseNumericValue(value->GetStringValue(),
|
||||
aData->mFontData->mScriptMinSize, 0);
|
||||
aData->mFontData->mScriptMinSize, PR_TRUE);
|
||||
}
|
||||
|
||||
value = aAttributes->GetAttr(nsGkAtoms::scriptlevel_);
|
||||
|
@ -365,7 +363,7 @@ nsMathMLElement::MapMathMLAttributesInto(const nsMappedAttributes* aAttributes,
|
|||
if (value && value->Type() == nsAttrValue::eString &&
|
||||
aData->mFontData->mSize.GetUnit() == eCSSUnit_Null) {
|
||||
nsAutoString str(value->GetStringValue());
|
||||
if (!ParseNumericValue(str, aData->mFontData->mSize, 0) &&
|
||||
if (!ParseNumericValue(str, aData->mFontData->mSize, PR_TRUE) &&
|
||||
parseSizeKeywords) {
|
||||
static const char sizes[3][7] = { "small", "normal", "big" };
|
||||
static const PRInt32 values[NS_ARRAY_LENGTH(sizes)] = {
|
||||
|
|
|
@ -78,13 +78,9 @@ public:
|
|||
NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const;
|
||||
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;
|
||||
|
||||
enum {
|
||||
PARSE_ALLOW_UNITLESS = 0x01, // unitless 0 will be turned into 0px
|
||||
PARSE_ALLOW_NEGATIVE = 0x02
|
||||
};
|
||||
static PRBool ParseNumericValue(const nsString& aString,
|
||||
nsCSSValue& aCSSValue,
|
||||
PRUint32 aFlags);
|
||||
PRBool aRequireLengthUnit);
|
||||
|
||||
static void MapMathMLAttributesInto(const nsMappedAttributes* aAttributes,
|
||||
nsRuleData* aRuleData);
|
||||
|
|
|
@ -218,9 +218,7 @@ public:
|
|||
static PRBool
|
||||
ParseNumericValue(const nsString& aString,
|
||||
nsCSSValue& aCSSValue) {
|
||||
return nsMathMLElement::ParseNumericValue(aString, aCSSValue,
|
||||
nsMathMLElement::PARSE_ALLOW_NEGATIVE |
|
||||
nsMathMLElement::PARSE_ALLOW_UNITLESS);
|
||||
return nsMathMLElement::ParseNumericValue(aString, aCSSValue, PR_FALSE);
|
||||
}
|
||||
|
||||
static nscoord
|
||||
|
|
|
@ -29,6 +29,6 @@ load 400475-1.xhtml
|
|||
load 402400-1.xhtml
|
||||
load 405187-1.xhtml
|
||||
load 405271-1.xml
|
||||
load 412237-1.xml
|
||||
# load 412237-1.xml
|
||||
load 413063-1.xhtml
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче