https://bugzilla.wikimedia.org/show_bug.cgi?id=42219

Roan Kattouw <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #3 from Roan Kattouw <[email protected]> 2012-11-21 20:35:27 
UTC ---
There were actually two cases, with two different root causes.

If the last node in the document was not a paragraph, comment #2 applies: the
document is empty and the pre-annotations code was asking for annotations at
offset 0. This was fixed a while ago.

If the last node in the document was a paragraph (this is common), the document
wouldn't actually be emptied. Instead, all nodes would be removed except the
last paragraph, which gets stripped. So after removing "everything", we are
left with a document that only contains an empty paragraph. However, in the
model tree, this empty paragraph is truly empty and does not contain a
zero-length text node (most other empty paragraphs do have one).

Once you type a character, CE pawns it first, processing a transaction that
inserts a pawn in the paragraph. The transaction processor gets confused by the
lack of any content nodes in the paragraph, and issues a rebuild for the
contents of the paragraph, which fails spectacularly. The model tree ends up in
an inconsistent state with a text node being a direct child of the document
node and the paragraph node being gone. This then caused offset computations to
be off by one, which caused other parts of CE to do strange things, culminating
in an exception in openAnnotations(). When the exception occurs, the pawn
hasn't been unpawned yet, so there's pawn leakage.

Trevor has a commit queued up that will fix this.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to