Bug 1139560 - Reject non-standard parses of integers in srcset descriptors. r=jst
☠☠ backed out by dcc49f2ed016 ☠ ☠
authorJohn Schoenick <john@pointysoftware.net>
Wed, 04 Mar 2015 23:09:00 -0500
changeset 266564 1e8b305f26b01608beee5b9002ac0748fec705e1
parent 266563 46872ab971799fe92a3a8297228bb3d6ad7bbc34
child 266565 dc2cd9c336c9a37111037fb69870db7afff9095a
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
bugs1139560
milestone39.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 1139560 - Reject non-standard parses of integers in srcset descriptors. r=jst
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)
 {
 }