Bug 1484693 - Fix some nits of test_resizers_resizing_elements.html r=m_kato
authorMasayuki Nakano <masayuki@d-toybox.com>
Wed, 22 Aug 2018 06:44:51 +0000
changeset 432754 2dd1517113c3b4b77ed0baf5313e9b0ae1a6a873
parent 432753 7bd181a54b142a70a058c3d42dc05b4e00aab259
child 432755 b59a431b833b30bbaf1060937f0bc9ab51b0bf91
push id34485
push usernerli@mozilla.com
push dateWed, 22 Aug 2018 09:48:16 +0000
treeherdermozilla-central@357d549504fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersm_kato
bugs1484693
milestone63.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 1484693 - Fix some nits of test_resizers_resizing_elements.html r=m_kato There are 2 bugs: One is a simple mistake. kTest is each item of the tests, kTests is array of all tests. When it needs to refer kTest.isAbsolutePosition, it referred kTests.isAbsolutePosiiton. Therefore, the test always failed to enable editing UI for absolute positioned element. The other is, this test requires to disable inline-table-editing UI (which is add or remove rows and columns). Note that even if the UI is disabled, resizers is available for <table> elements. Differential Revision: https://phabricator.services.mozilla.com/D3954
editor/libeditor/tests/test_resizers_resizing_elements.html
--- a/editor/libeditor/tests/test_resizers_resizing_elements.html
+++ b/editor/libeditor/tests/test_resizers_resizing_elements.html
@@ -20,16 +20,18 @@
 <script type="application/javascript">
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 SimpleTest.waitForFocus(async function() {
   document.execCommand("enableObjectResizing", false, true);
   ok(document.queryCommandState("enableObjectResizing"),
      "Object resizer should be enabled by the call of execCommand");
+  // Disable inline-table-editing UI for this test.
+  document.execCommand("enableInlineTableEditing", false, false);
 
   let outOfEditor = document.getElementById("clickaway");
 
   function cancel(e) { e.stopPropagation(); }
   let content = document.getElementById("content");
   content.addEventListener("mousedown", cancel);
   content.addEventListener("mousemove", cancel);
   content.addEventListener("mouseup", cancel);
@@ -214,27 +216,28 @@ SimpleTest.waitForFocus(async function()
     },
     { description: "Resiziers for absolute positioned <div>",
       innerHTML: "<div id=\"target\" style=\"position: absolute; top: 50px; left: 50px;\">positioned</div>",
       mayPreserveRatio: false,
       isAbsolutePosition: true,
     },
   ];
 
-  // Resizers for absolute positioned element are available only when
-  // enableAbsolutePositionEditing is enabled.  So, let's enable it
-  // during testing resizers for absolute positioned elements.
+  // Resizers for absolute positioned element and table element are available
+  // only when enableAbsolutePositionEditing or enableInlineTableEditing is
+  // enabled for each.  So, let's enable them during testing resizers for 
+  // absolute positioned elements or table elements.
   await SpecialPowers.pushPrefEnv({"set": [["editor.resizing.preserve_ratio", false]]});
   for (const kTest of kTests) {
-    document.execCommand("enableAbsolutePositionEditing", false, kTests.isAbsolutePosition);
+    document.execCommand("enableAbsolutePositionEditing", false, kTest.isAbsolutePosition);
     await doTest(kTest.description, false, kTest.innerHTML);
   }
   await SpecialPowers.pushPrefEnv({"set": [["editor.resizing.preserve_ratio", true]]});
   for (const kTest of kTests) {
-    document.execCommand("enableAbsolutePositionEditing", false, kTests.isAbsolutePosition);
+    document.execCommand("enableAbsolutePositionEditing", false, kTest.isAbsolutePosition);
     await doTest(kTest.description, kTest.mayPreserveRatio, kTest.innerHTML);
   }
   content.innerHTML = "";
   SimpleTest.finish();
 });
 </script>
 </pre>
 </body>