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 77663 ef216b965a04d5f16d121961972a780ceec36216
parent 77662 f3e28e0f909f8f33dde174240088ad03897cfdfd
child 77664 b449db7a038b98f51792264b4e906be36f4d6e4f
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [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);