Last Comment Bug 649797 - ASSERTION: How come our status is not clear?: 'mLastKeypressEventWasTrusted == eTriUnset', file editor/libeditor/base/nsEditor.cpp, line 5411
: ASSERTION: How come our status is not clear?: 'mLastKeypressEventWasTrusted =...
Status: RESOLVED FIXED
: assertion
Product: Core
Classification: Components
Component: Editor (show other bugs)
: Trunk
: x86 Windows 7
: -- normal (vote)
: mozilla6
Assigned To: :Ehsan Akhgari (busy, don't ask for review please)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-13 14:07 PDT by Mats Palmgren (:mats)
Modified: 2011-04-21 07:28 PDT (History)
1 user (show)
ehsan: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Assertion stack (18.15 KB, text/plain)
2011-04-20 16:51 PDT, :Ehsan Akhgari (busy, don't ask for review please)
no flags Details
Patch (v1) (2.18 KB, patch)
2011-04-20 16:56 PDT, :Ehsan Akhgari (busy, don't ask for review please)
roc: review+
Details | Diff | Review

Description Mats Palmgren (:mats) 2011-04-13 14:07:56 PDT
###!!! ASSERTION: How come our status is not clear?: 'mLastKeypressEventWasTrusted == eTriUnset', file editor/libeditor/base/nsEditor.cpp, line 5411

Win7 mochitest-3.  The assertion occurs when running the test
editor/libeditor/text/tests/test_bug600570.html

http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1302718998.1302722064.25540.gz&fulltext=1
Comment 1 :Ehsan Akhgari (busy, don't ask for review please) 2011-04-20 16:51:54 PDT
Created attachment 527427 [details]
Assertion stack

This is the stack under which this assertion occurs.  What's happening is that in the test we press control+V <http://mxr.mozilla.org/mozilla-central/source/editor/libeditor/text/tests/test_bug600570.html?force=1#61> which triggers a paste, which also triggers an input event, and the input event handler causes another trusted kepress event: <http://mxr.mozilla.org/mozilla-central/source/editor/libeditor/text/tests/test_bug600570.html?force=1#49> under this JS stack:

0 synthesizeKey(aWindow = [object Window @ 0x117885bc0 (native @ 0x1235bbe78)], aEvent = [object Object], aKey = "A") ["http://mochi.test:8888/tests/SimpleTest/EventUtils.js":421]
    keyDownDefaultHappened = true
    modifiers = 8
    charCode = 65
    keyCode = 65
    utils = [object WindowUtils @ 0x126b362f0 (native @ 0x123b83850)]
    this = [object Window @ 0x117885bc0 (native @ 0x1235bbe78)]
1 anonymous([object Event @ 0x12825adb0 (native @ 0x1230285a0)]) ["http://mochi.test:8888/tests/editor/libeditor/text/tests/test_bug600570.html":49]
    res = undefined
    afterPaste = undefined
    this = [object HTMLTextAreaElement @ 0x117896af0 (native @ 0x1282c2670)]
2 synthesizeKey(aWindow = [object Window @ 0x117885bc0 (native @ 0x1235bbe78)], aEvent = [object Object], aKey = "V") ["http://mochi.test:8888/tests/SimpleTest/EventUtils.js":421]
    keyDownDefaultHappened = true
    modifiers = 8
    charCode = 86
    keyCode = 86
    utils = [object WindowUtils @ 0x126b362f0 (native @ 0x123b83850)]
    this = [object Window @ 0x117885bc0 (native @ 0x1235bbe78)]
3 anonymous() ["http://mochi.test:8888/tests/editor/libeditor/text/tests/test_bug600570.html":61]
    this = [object Window @ 0x117885bc0 (native @ 0x1235bbe78)]
4 wait(failureFn = [function], successFn = [function], expectedVal = "aaa
") ["http://mochi.test:8888/tests/SimpleTest/SimpleTest.js":492]
    data = "aaa
"
    xferable = [xpconnect wrapped nsITransferable @ 0x105c95020 (native @ 0x1242ec6e0)]
    this = [object Window @ 0x117885bc0 (native @ 0x1235bbe78)]
5 anonymous() ["http://mochi.test:8888/tests/SimpleTest/SimpleTest.js":506]
    this = [object Window @ 0x117885bc0 (native @ 0x1235bbe78)]
6 wait(failureFn = [function], successFn = [function], expectedVal = "aaa
-waitForClipboard-known-value") ["http://mochi.test:8888/tests/SimpleTest/SimpleTest.js":492]
    data = "aaa
-waitForClipboard-known-value"
    xferable = [xpconnect wrapped nsITransferable @ 0x12825f040 (native @ 0x105c9d680)]
    this = [object Window @ 0x117885bc0 (native @ 0x1235bbe78)]
7 anonymous(aFailureFn = [function], aSuccessFn = [function], aSetupFn = [function], aExpectedVal = "aaa
") ["http://mochi.test:8888/tests/SimpleTest/SimpleTest.js":507]
    cbHelperSvc = [xpconnect wrapped nsIClipboardHelper @ 0x126b428a0 (native @ 0x123b4b000)]
    preExpectedVal = "aaa
-waitForClipboard-known-value"
    wait = [function]
    reset = [function]
    cbSvc = [xpconnect wrapped nsIClipboard @ 0x1242e4df0 (native @ 0x1210c9ec0)]
    this = [object Object]
8 anonymous([object Window @ 0x117885bc0 (native @ 0x1235bbe78)], 189) ["http://mochi.test:8888/tests/editor/libeditor/text/tests/test_bug600570.html":63]
    afterSetValue = [object HTMLCanvasElement @ 0x1277eb738 (native @ 0x121081a60)]
    t = [object HTMLTextAreaElement @ 0x117896af0 (native @ 0x1282c2670)]
    this = [object Window @ 0x117885bc0 (native @ 0x1235bbe78)]

This is not something that we should worry about in the real world though, since there is no way for an event handler to generated trusted events on web pages.  I guess I'll just rewrite the test to not trigger this assertion.
Comment 2 :Ehsan Akhgari (busy, don't ask for review please) 2011-04-20 16:56:47 PDT
Created attachment 527429 [details] [diff] [review]
Patch (v1)

I avoided indentation adjustment to make the patch easier to read.  Also, the spellcheck=false is needed because otherwise, spellchecker would kick in before our callback is run, which would make the afterPaste screenshot different due to spellcheck underlines.
Comment 3 :Ehsan Akhgari (busy, don't ask for review please) 2011-04-21 07:28:18 PDT
http://hg.mozilla.org/mozilla-central/rev/942f57ba8946

Note You need to log in before you can comment on or make changes to this bug.