diff --git a/dom/base/ResponsiveImageSelector.cpp b/dom/base/ResponsiveImageSelector.cpp index ea9c48f30d87..d4043aabe5c9 100644 --- a/dom/base/ResponsiveImageSelector.cpp +++ b/dom/base/ResponsiveImageSelector.cpp @@ -33,7 +33,6 @@ static bool ParseInteger(const nsAString& aString, int32_t& aInt) { return !(parseResult & (nsContentUtils::eParseHTMLInteger_Error | nsContentUtils::eParseHTMLInteger_DidNotConsumeAllInput | - nsContentUtils::eParseHTMLInteger_IsPercent | nsContentUtils::eParseHTMLInteger_NonStandard)); } diff --git a/dom/base/nsAttrValue.cpp b/dom/base/nsAttrValue.cpp index e3d1cfbdf6cc..eafcf0fed337 100644 --- a/dom/base/nsAttrValue.cpp +++ b/dom/base/nsAttrValue.cpp @@ -1383,7 +1383,6 @@ bool nsAttrValue::ParseIntWithBounds(const nsAString& aString, int32_t aMin, val = std::min(val, aMax); bool nonStrict = (val != originalVal) || - (result & nsContentUtils::eParseHTMLInteger_IsPercent) || (result & nsContentUtils::eParseHTMLInteger_NonStandard) || (result & nsContentUtils::eParseHTMLInteger_DidNotConsumeAllInput); @@ -1409,8 +1408,7 @@ void nsAttrValue::ParseIntWithFallback(const nsAString& aString, nonStrict = true; } - if ((result & nsContentUtils::eParseHTMLInteger_IsPercent) || - (result & nsContentUtils::eParseHTMLInteger_NonStandard) || + if ((result & nsContentUtils::eParseHTMLInteger_NonStandard) || (result & nsContentUtils::eParseHTMLInteger_DidNotConsumeAllInput)) { nonStrict = true; } @@ -1426,7 +1424,6 @@ void nsAttrValue::ParseClampedNonNegativeInt(const nsAString& aString, nsContentUtils::ParseHTMLIntegerResultFlags result; int32_t val = nsContentUtils::ParseHTMLInteger(aString, &result); bool nonStrict = - (result & nsContentUtils::eParseHTMLInteger_IsPercent) || (result & nsContentUtils::eParseHTMLInteger_NonStandard) || (result & nsContentUtils::eParseHTMLInteger_DidNotConsumeAllInput); @@ -1461,7 +1458,6 @@ bool nsAttrValue::ParseNonNegativeIntValue(const nsAString& aString) { } bool nonStrict = - (result & nsContentUtils::eParseHTMLInteger_IsPercent) || (result & nsContentUtils::eParseHTMLInteger_NonStandard) || (result & nsContentUtils::eParseHTMLInteger_DidNotConsumeAllInput); @@ -1480,7 +1476,6 @@ bool nsAttrValue::ParsePositiveIntValue(const nsAString& aString) { } bool nonStrict = - (result & nsContentUtils::eParseHTMLInteger_IsPercent) || (result & nsContentUtils::eParseHTMLInteger_NonStandard) || (result & nsContentUtils::eParseHTMLInteger_DidNotConsumeAllInput); diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 9b4a5af94529..a4e30fed4686 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -1182,10 +1182,6 @@ int32_t nsContentUtils::ParseHTMLInteger(const nsAString& aValue, break; } foundValue = true; - } else if (*iter == char16_t('%')) { - ++iter; - result |= eParseHTMLInteger_IsPercent; - break; } else { break; } diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h index c31a539ab211..24580f129536 100644 --- a/dom/base/nsContentUtils.h +++ b/dom/base/nsContentUtils.h @@ -601,17 +601,16 @@ class nsContentUtils { enum ParseHTMLIntegerResultFlags { eParseHTMLInteger_NoFlags = 0, - eParseHTMLInteger_IsPercent = 1 << 0, // eParseHTMLInteger_NonStandard is set if the string representation of the // integer was not the canonical one (e.g. had extra leading '+' or '0'). - eParseHTMLInteger_NonStandard = 1 << 1, - eParseHTMLInteger_DidNotConsumeAllInput = 1 << 2, + eParseHTMLInteger_NonStandard = 1 << 0, + eParseHTMLInteger_DidNotConsumeAllInput = 1 << 1, // Set if one or more error flags were set. - eParseHTMLInteger_Error = 1 << 3, - eParseHTMLInteger_ErrorNoValue = 1 << 4, - eParseHTMLInteger_ErrorOverflow = 1 << 5, + eParseHTMLInteger_Error = 1 << 2, + eParseHTMLInteger_ErrorNoValue = 1 << 3, + eParseHTMLInteger_ErrorOverflow = 1 << 4, // Use this flag to detect the difference between overflow and underflow - eParseHTMLInteger_Negative = 1 << 6, + eParseHTMLInteger_Negative = 1 << 5, }; static int32_t ParseHTMLInteger(const nsAString& aValue, ParseHTMLIntegerResultFlags* aResult);