Last Comment Bug 766387 - "ASSERTION: GetPriorNode screwed up" with insertorderedlist
: "ASSERTION: GetPriorNode screwed up" with insertorderedlist
Status: RESOLVED FIXED
: assertion, testcase
Product: Core
Classification: Components
Component: Editor (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla16
Assigned To: :Aryeh Gregor (away until August 15)
:
Mentors:
Depends on:
Blocks: 336383
  Show dependency treegraph
 
Reported: 2012-06-19 16:35 PDT by Jesse Ruderman
Modified: 2012-06-26 01:59 PDT (History)
3 users (show)
ayg: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
testcase (466 bytes, text/html)
2012-06-19 16:35 PDT, Jesse Ruderman
no flags Details
stack trace (15.03 KB, text/plain)
2012-06-19 16:35 PDT, Jesse Ruderman
no flags Details
Patch v1 (10.05 KB, patch)
2012-06-22 00:32 PDT, :Aryeh Gregor (away until August 15)
ehsan: review+
Details | Diff | Review

Description Jesse Ruderman 2012-06-19 16:35:10 PDT
Created attachment 634652 [details]
testcase

###!!! ASSERTION: GetPriorNode screwed up: '!*outNode || IsDescendantOfEditorRoot(*outNode)', file editor/libeditor/html/nsHTMLEditor.cpp, line 4351
Comment 1 Jesse Ruderman 2012-06-19 16:35:26 PDT
Created attachment 634653 [details]
stack trace
Comment 2 :Aryeh Gregor (away until August 15) 2012-06-21 08:21:16 PDT
By amazing coincidence, this is perfect motivation for matching the editing spec's definition of "enabled":

"""
Among commands defined in this specification, those listed in Miscellaneous commands are always enabled, except for the cut command and the paste command. The other commands defined here are enabled if the active range is not null, its start node is either editable or an editing host, its end node is either editable or an editing host, and there is some editing host that is an inclusive ancestor of both its start node and its end node.
"""
http://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#enabled-commands

If we used that definition, most commands would be disabled in cases like this.  Then together with bug 760052, this will be fixed.
Comment 3 :Aryeh Gregor (away until August 15) 2012-06-22 00:32:45 PDT
Created attachment 635653 [details] [diff] [review]
Patch v1

This changes GetIsSelectionEditable() to match the spec for nsHTMLEditor (leaving nsEditor's definition unchanged).  That requires that some common ancestor of the endpoints be editable, which is not the case here, so we refuse to do anything.

Try: https://tbpl.mozilla.org/?tree=Try&rev=a67bf159fa2c
Comment 4 :Aryeh Gregor (away until August 15) 2012-06-23 23:58:26 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/bac4434b31d2
Comment 5 :Aryeh Gregor (away until August 15) 2012-06-24 00:34:06 PDT
Backed out for now: https://hg.mozilla.org/integration/mozilla-inbound/rev/e23e10a4638b

The crashtest here still crashed, because I landed this before bug 760052 (oops).  Will reland together with bug 760052.
Comment 6 :Aryeh Gregor (away until August 15) 2012-06-25 08:34:02 PDT
Take two: https://hg.mozilla.org/integration/mozilla-inbound/rev/8a3df3497e8f
Comment 7 Ed Morley [:emorley] 2012-06-26 01:59:08 PDT
https://hg.mozilla.org/mozilla-central/rev/8a3df3497e8f

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