Bug 679671. Save the original string when parsing nonnegative or positive integer values shows them as non-strict. r=mounir
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 31 Aug 2011 18:09:23 -0400
changeset 76367 94a4a478d774833daef7aaf90f1695d003f4185f
parent 76366 aa18f86328827be7708de6af301902d793e464fd
child 76368 7d3d1c2c75f88ecaaf896fd6d5716f41b6c5707a
child 76369 893d04548dd91416867f956a981b11cb52aa20ba
push id21097
push userbmo@edmorley.co.uk
push dateThu, 01 Sep 2011 07:45:07 +0000
treeherdermozilla-central@7d3d1c2c75f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmounir
bugs679671
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 679671. Save the original string when parsing nonnegative or positive integer values shows them as non-strict. r=mounir
content/base/src/nsAttrValue.cpp
--- a/content/base/src/nsAttrValue.cpp
+++ b/content/base/src/nsAttrValue.cpp
@@ -1107,34 +1107,34 @@ nsAttrValue::ParseNonNegativeIntValue(co
 
   PRInt32 ec;
   PRBool strict;
   PRInt32 originalVal = StringToInteger(aString, &strict, &ec);
   if (NS_FAILED(ec) || originalVal < 0) {
     return PR_FALSE;
   }
 
-  SetIntValueAndType(originalVal, eInteger, nsnull);
+  SetIntValueAndType(originalVal, eInteger, strict ? nsnull : &aString);
 
   return PR_TRUE;
 }
 
 PRBool
 nsAttrValue::ParsePositiveIntValue(const nsAString& aString)
 {
   ResetIfSet();
 
   PRInt32 ec;
   PRBool strict;
   PRInt32 originalVal = StringToInteger(aString, &strict, &ec);
   if (NS_FAILED(ec) || originalVal <= 0) {
     return PR_FALSE;
   }
 
-  SetIntValueAndType(originalVal, eInteger, nsnull);
+  SetIntValueAndType(originalVal, eInteger, strict ? nsnull : &aString);
 
   return PR_TRUE;
 }
 
 void
 nsAttrValue::SetColorValue(nscolor aColor, const nsAString& aString)
 {
   nsStringBuffer* buf = GetStringBuffer(aString);