"ASSERTION: GetPriorNode screwed up" with insertorderedlist

RESOLVED FIXED in mozilla16

Status

()

Core
Editor
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Jesse Ruderman, Assigned: ayg)

Tracking

(Blocks: 1 bug, {assertion, testcase})

Trunk
mozilla16
assertion, testcase
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Reporter)

Description

5 years ago
Created attachment 634652 [details]
testcase

###!!! ASSERTION: GetPriorNode screwed up: '!*outNode || IsDescendantOfEditorRoot(*outNode)', file editor/libeditor/html/nsHTMLEditor.cpp, line 4351
(Reporter)

Comment 1

5 years ago
Created attachment 634653 [details]
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
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
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 → ---
Take two: https://hg.mozilla.org/integration/mozilla-inbound/rev/8a3df3497e8f
Target Milestone: --- → mozilla16

Comment 7

5 years ago
https://hg.mozilla.org/mozilla-central/rev/8a3df3497e8f
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.