diff --git a/dom/events/ContentEventHandler.cpp b/dom/events/ContentEventHandler.cpp index 2e86d7e7e73..4556b107bc7 100644 --- a/dom/events/ContentEventHandler.cpp +++ b/dom/events/ContentEventHandler.cpp @@ -267,7 +267,7 @@ static uint32_t CountNewlinesInNativeLength(nsIContent* aContent, return 0; } // For automated tests, we should abort on debug build. - NS_ABORT_IF_FALSE( + MOZ_ASSERT( (aNativeLength == UINT32_MAX || aNativeLength <= text->GetLength() * 2), "aNativeLength is unexpected value"); const uint32_t xpLength = text->GetLength(); diff --git a/editor/libeditor/html/tests/mochitest.ini b/editor/libeditor/html/tests/mochitest.ini index b8ed9aab3a9..2ff15ae6883 100644 --- a/editor/libeditor/html/tests/mochitest.ini +++ b/editor/libeditor/html/tests/mochitest.ini @@ -98,6 +98,7 @@ skip-if = toolkit == 'android' || e10s skip-if = os != "win" [test_bug966552.html] skip-if = os != "win" +[test_bug998188.html] [test_contenteditable_focus.html] [test_dom_input_event_on_htmleditor.html] [test_keypress_untrusted_event.html] diff --git a/editor/libeditor/html/tests/test_bug998188.html b/editor/libeditor/html/tests/test_bug998188.html new file mode 100644 index 00000000000..2d167f0bd6e --- /dev/null +++ b/editor/libeditor/html/tests/test_bug998188.html @@ -0,0 +1,52 @@ + + + + + Test for Bug 998188 + + + + + +Mozilla Bug 998188 +

+ +
abc
+
+
+
+ + diff --git a/testing/mochitest/tests/SimpleTest/ChromeUtils.js b/testing/mochitest/tests/SimpleTest/ChromeUtils.js index 0b4085493b7..ac2a376679f 100644 --- a/testing/mochitest/tests/SimpleTest/ChromeUtils.js +++ b/testing/mochitest/tests/SimpleTest/ChromeUtils.js @@ -33,25 +33,6 @@ function synthesizeQueryTextContent(aOffset, aLength, aWindow) aOffset, aLength, 0, 0); } -/** - * Synthesize a query caret rect event. - * - * @param aOffset The caret offset. 0 means left side of the first character - * in the selection root. - * @param aWindow Optional (If null, current |window| will be used) - * @return An nsIQueryContentEventResult object. If this failed, - * the result might be null. - */ -function synthesizeQueryCaretRect(aOffset, aWindow) -{ - var utils = _getDOMWindowUtils(aWindow); - if (!utils) { - return nullptr; - } - return utils.sendQueryContentEvent(utils.QUERY_CARET_RECT, - aOffset, 0, 0, 0); -} - /** * Synthesize a query text rect event. * diff --git a/testing/mochitest/tests/SimpleTest/EventUtils.js b/testing/mochitest/tests/SimpleTest/EventUtils.js index 932eb72b2e3..92437b3caab 100644 --- a/testing/mochitest/tests/SimpleTest/EventUtils.js +++ b/testing/mochitest/tests/SimpleTest/EventUtils.js @@ -988,6 +988,25 @@ function synthesizeQuerySelectedText(aWindow) return utils.sendQueryContentEvent(utils.QUERY_SELECTED_TEXT, 0, 0, 0, 0); } +/** + * Synthesize a query caret rect event. + * + * @param aOffset The caret offset. 0 means left side of the first character + * in the selection root. + * @param aWindow Optional (If null, current |window| will be used) + * @return An nsIQueryContentEventResult object. If this failed, + * the result might be null. + */ +function synthesizeQueryCaretRect(aOffset, aWindow) +{ + var utils = _getDOMWindowUtils(aWindow); + if (!utils) { + return null; + } + return utils.sendQueryContentEvent(utils.QUERY_CARET_RECT, + aOffset, 0, 0, 0); +} + /** * Synthesize a selection set event. *