Closed Bug 649797 Opened 13 years ago Closed 13 years ago

ASSERTION: How come our status is not clear?: 'mLastKeypressEventWasTrusted == eTriUnset', file editor/libeditor/base/nsEditor.cpp, line 5411

Categories

(Core :: DOM: Editor, defect)

x86
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla6

People

(Reporter: MatsPalmgren_bugz, Assigned: ehsan.akhgari)

Details

(Keywords: assertion)

Attachments

(2 files)

###!!! 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
Attached file 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.
Assignee: nobody → ehsan
Status: NEW → ASSIGNED
Attached patch Patch (v1)Splinter Review
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.
Attachment #527429 - Flags: review?(roc)
http://hg.mozilla.org/mozilla-central/rev/942f57ba8946
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla6
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: