Closed Bug 766387 Opened 12 years ago Closed 12 years ago

"ASSERTION: GetPriorNode screwed up" with insertorderedlist

Categories

(Core :: DOM: Editor, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla16

People

(Reporter: jruderman, Assigned: ayg)

References

Details

(Keywords: assertion, testcase)

Attachments

(3 files)

Attached file testcase
###!!! ASSERTION: GetPriorNode screwed up: '!*outNode || IsDescendantOfEditorRoot(*outNode)', file editor/libeditor/html/nsHTMLEditor.cpp, line 4351
Attached file stack trace
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.
Assignee: nobody → ayg
Status: NEW → ASSIGNED
Attached patch Patch v1Splinter Review
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
Attachment #635653 - Flags: review?(ehsan)
Attachment #635653 - Flags: review?(ehsan) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/bac4434b31d2
Flags: in-testsuite+
OS: Mac OS X → All
Hardware: x86_64 → All
Target Milestone: --- → mozilla16
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.
Target Milestone: mozilla16 → ---
https://hg.mozilla.org/mozilla-central/rev/8a3df3497e8f
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.