Bug 1139560 - Reject non-standard parses of integers in srcset descriptors. r=jst, a=lizzard
authorJohn Schoenick <john@pointysoftware.net>
Wed, 04 Mar 2015 23:09:00 -0500
changeset 266984 d83a84142769d6ccfb3d78f10ec194745f24b52d
parent 266983 21784d04ac243e559b150b1fb50d2792fce3670e
child 266985 3057b13be4989373f104562b743faa8c8b42a148
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjst, lizzard
bugs1139560
milestone39.0a2
Bug 1139560 - Reject non-standard parses of integers in srcset descriptors. r=jst, a=lizzard
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)
 {
 }