Bug 1158412 - Remove assertion for document prescontex and add crash test; r=jdm
authorEdgar Chen <echen@mozilla.com>
Fri, 15 Apr 2016 09:33:20 -0400
changeset 331837 038ff8933b43546cd77633bf522bc819c6b7b4fe
parent 331836 8bcb31d3dfcaae0bbcdc53708a685cc3b4c5c628
child 331838 a46d02998795b1e04849fc6d4fe0fbe09235fcca
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
bugs1158412
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 1158412 - Remove assertion for document prescontex and add crash test; r=jdm MozReview-Commit-ID: BSrmQLfjYUi
dom/base/ResponsiveImageSelector.cpp
dom/base/crashtests/1158412.html
dom/base/crashtests/crashtests.list
--- a/dom/base/ResponsiveImageSelector.cpp
+++ b/dom/base/ResponsiveImageSelector.cpp
@@ -424,17 +424,16 @@ bool
 ResponsiveImageSelector::ComputeFinalWidthForCurrentViewport(double *aWidth)
 {
   unsigned int numSizes = mSizeQueries.Length();
   nsIDocument* doc = Document();
   nsIPresShell *presShell = doc ? doc->GetShell() : nullptr;
   nsPresContext *pctx = presShell ? presShell->GetPresContext() : nullptr;
 
   if (!pctx) {
-    MOZ_ASSERT(false, "Unable to find presContext for this content");
     return false;
   }
 
   MOZ_ASSERT(numSizes == mSizeValues.Length(),
              "mSizeValues length differs from mSizeQueries");
 
   unsigned int i;
   for (i = 0; i < numSizes; i++) {
new file mode 100644
--- /dev/null
+++ b/dom/base/crashtests/1158412.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="UTF-8">
+<script>
+
+function boom()
+{
+    document.styleSheetSets.expando = null;
+    var otherDoc = document.implementation.createDocument("", "", null);
+    var otherSpan = otherDoc.createElementNS("http://www.w3.org/1999/xhtml", "span");
+
+    var img = document.createElementNS("http://www.w3.org/1999/xhtml", "img");
+    img.srcset = "data:,a 1w, data:,b 1w";
+    img.sizes = "1px";
+    otherSpan.appendChild(img);
+}
+
+</script>
+</head>
+<body onload="boom();"></body>
+</html>
\ No newline at end of file
--- a/dom/base/crashtests/crashtests.list
+++ b/dom/base/crashtests/crashtests.list
@@ -194,15 +194,16 @@ load 942979.html
 load 973401.html
 load 978646.html
 pref(dom.webcomponents.enabled,true) load 1024428-1.html
 load 1026714.html
 pref(dom.webcomponents.enabled,true) load 1027461-1.html
 pref(dom.webcomponents.enabled,true) load 1029710.html
 load 1154598.xhtml
 load 1157995.html
+load 1158412.html
 load 1181619.html
 load structured_clone_container_throws.html
 HTTP(..) load xhr_abortinprogress.html
 load xhr_empty_datauri.html
 load xhr_html_nullresponse.html
 load 1230422.html
 load 1251361.html