Bug 1139560 - Reject non-standard parses of integers in srcset descriptors. r=jst, a=sledru
authorJohn Schoenick <john@pointysoftware.net>
Wed, 04 Mar 2015 23:09:00 -0500
changeset 258436 dffb5c867f47
parent 258435 1b6ba1cb52f6
child 258437 07666fc071be
push id4668
push userryanvm@gmail.com
push date2015-04-13 16:23 +0000
treeherdermozilla-beta@002faed66e96 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjst, sledru
bugs1139560
milestone38.0
Bug 1139560 - Reject non-standard parses of integers in srcset descriptors. r=jst, a=sledru
dom/base/ResponsiveImageSelector.cpp
--- a/dom/base/ResponsiveImageSelector.cpp
+++ b/dom/base/ResponsiveImageSelector.cpp
@@ -34,17 +34,18 @@ NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(R
 static bool
 ParseInteger(const nsAString& aString, int32_t& aInt)
 {
   nsContentUtils::ParseHTMLIntegerResultFlags parseResult;
   aInt = nsContentUtils::ParseHTMLInteger(aString, &parseResult);
   return !(parseResult &
            ( nsContentUtils::eParseHTMLInteger_Error |
              nsContentUtils::eParseHTMLInteger_DidNotConsumeAllInput |
-             nsContentUtils::eParseHTMLInteger_IsPercent ));
+             nsContentUtils::eParseHTMLInteger_IsPercent |
+             nsContentUtils::eParseHTMLInteger_NonStandard ));
 }
 
 ResponsiveImageSelector::ResponsiveImageSelector(nsIContent *aContent)
   : mOwnerNode(aContent),
     mSelectedCandidateIndex(-1)
 {
 }