Bug 1383755 - Part 2. Add crash test for object resizer. r?masayuki draft
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Thu, 27 Jul 2017 18:21:27 +0900
changeset 618263 e0297f065a5910fd75c09d5211cd9884fa03f4c1
parent 618262 12b40028f537b1542032d798769aa97e453198fd
child 640013 3ec90846107cef155d975a8f796298c87fc884ad
push id71273
push userbmo:m_kato@ga2.so-net.ne.jp
push dateMon, 31 Jul 2017 04:13:15 +0000
reviewersmasayuki
bugs1383755
milestone56.0a1
Bug 1383755 - Part 2. Add crash test for object resizer. r?masayuki MozReview-Commit-ID: WLyLl5vIj0
editor/libeditor/crashtests/1383755.html
editor/libeditor/crashtests/crashtests.list
new file mode 100644
--- /dev/null
+++ b/editor/libeditor/crashtests/1383755.html
@@ -0,0 +1,26 @@
+<html>
+  <head>
+    <script type="application/javascript">
+      let table = document.createElement('table');
+      document.documentElement.appendChild(table);
+      let tr = document.createElement('tr');
+      table.appendChild(tr);
+      let input = document.createElement('input');
+      document.documentElement.appendChild(input);
+
+      let img = document.createElement('img');
+      input.appendChild(img);
+      img.contentEditable = 'true'
+      tr.appendChild(img);
+      img.offsetParent;
+
+      // Since table's cell is selected by the following, it will show
+      // object resizer that is anonymous element.
+      window.getSelection().selectAllChildren(tr);
+      // Document.adoptNode will remove anonymous element of object resizer
+      // and it shouldn't cause crash
+      document.implementation.createDocument('', '').adoptNode(table);
+    </script>
+  </head>
+</html>
+
--- a/editor/libeditor/crashtests/crashtests.list
+++ b/editor/libeditor/crashtests/crashtests.list
@@ -73,8 +73,9 @@ load 1317704.html
 load 1317718.html
 load 1324505.html
 needs-focus load 1343918.html
 load 1345015.html
 load 1348851.html
 load 1350772.html
 load 1366176.html
 load 1375131.html
+load 1383755.html