Bug 1237633 - Part 2: Avoid fatal assertion when a responsive image's size specifier is invalid. r=johns, r=jdm
authorJosh Matthews <josh@joshmatthews.net>
Thu, 07 Jan 2016 15:02:14 -0500
changeset 292701 a5b5494464dd4df1409b474ac11df5d72a50d95e
parent 292700 ba9323ccb99125a17bcc77a1066d7aec40fc85e2
child 292702 1e856020a8d22b6152f18215dbbe7a6a33a77ce4
push id74955
push userryanvm@gmail.com
push dateTue, 12 Apr 2016 03:08:36 +0000
treeherdermozilla-inbound@1e856020a8d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohns, jdm
bugs1237633
milestone48.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 1237633 - Part 2: Avoid fatal assertion when a responsive image's size specifier is invalid. r=johns, r=jdm MozReview-Commit-ID: LyG6xn5VbSE
dom/base/ResponsiveImageSelector.cpp
dom/html/crashtests/1237633.html
dom/html/crashtests/crashtests.list
--- a/dom/base/ResponsiveImageSelector.cpp
+++ b/dom/base/ResponsiveImageSelector.cpp
@@ -449,17 +449,16 @@ ResponsiveImageSelector::ComputeFinalWid
     nsCSSValue defaultWidth(100.0f, eCSSUnit_ViewportWidth);
     effectiveWidth = nsRuleNode::CalcLengthWithInitialFont(pctx,
                                                            defaultWidth);
   } else {
     effectiveWidth = nsRuleNode::CalcLengthWithInitialFont(pctx,
                                                            mSizeValues[i]);
   }
 
-  MOZ_ASSERT(effectiveWidth >= 0);
   *aWidth = nsPresContext::AppUnitsToDoubleCSSPixels(std::max(effectiveWidth, 0));
   return true;
 }
 
 ResponsiveImageCandidate::ResponsiveImageCandidate()
 {
   mType = eCandidateType_Invalid;
   mValue.mDensity = 1.0;
new file mode 100644
--- /dev/null
+++ b/dom/html/crashtests/1237633.html
@@ -0,0 +1,1 @@
+<img srcset="data:,a 2400w" sizes="(min-width: 1px) calc(300px - 100vw)">
--- a/dom/html/crashtests/crashtests.list
+++ b/dom/html/crashtests/crashtests.list
@@ -71,9 +71,9 @@ load 865147.html
 load 877910.html
 load 903106.html
 load 916322-1.html
 load 916322-2.html
 load 1032654.html
 pref(dom.image.srcset.enabled,true) load 1141260.html
 load 1228876.html
 load 1230110.html
-
+load 1237633.html