W3C home > Mailing lists > Public > www-amaya-dev@w3.org > May 2000

Re: backspace after enter

From: Irene VATTON <Irene.Vatton@inrialpes.fr>
Date: Fri, 26 May 2000 11:41:28 +0200
Message-Id: <200005260941.LAA15060@tahiti.inrialpes.fr>
To: "Mcdowell, Bryon" <Bryon.Mcdowell@ca.com>
cc: www-amaya-dev@w3.org
> There is an error in the code that handles the Backspace key.  
> 
> Here is how to recreate it:
> 1) Create a new HTML document
> 2) Type some text
> 3) Hit the Enter key
> 4) Hit the Backspace key
> 
> Notice the placement of the cursor; it is one space to the left of where it
> should be.  I looked at the code for TtcDeletePreviousChar(...) which
> handles this case.  There is a flag called moveAfter that causes the
> undesired cursor movement.  The problem is that I don't completely
> understand the conditions that sets this flag.  Can anyone shed some light
> on this for me?

I guess this problem was already solved in the CVS version. It didn't come
from this piece of code but from the function LocateSelectionInView
The variable moveAfter is set to TRUE when the current selection points to
a box which is neither a text nor an empty box.
If you have "<b>AAAAA</b><a>xxxx,/a>BBBB" and the anchor is selected, the 
instruction
"ContentEditing (TEXT_SUP)" removes the current contents of the
selection (<a>xxxx,/a>) then moves the selection to the beginning of the next 
element
(BBBB). As it's a delete previous we have to call the function TtcPreviousChar 
for
moving to the end of the previous element (<b>AAAAA</b>)

> 
> Code from TtcDeletePreviousChar(...):
> 
>  /* delete the current selection instead of the previous char */
> CloseTextInsertion ();
> /* by default doen't change the selection after the delete */
> moveAfter = FALSE
> if (pViewSel->VsBox != NULL)
> {
> 	moveAfter = (pViewSel->VsBox->BxAbstractBox->AbLeafType != LtText ||
> 		pViewSel->VsBox->BxAbstractBox->AbVolume == 0);
> 	ContentEditing (TEXT_SUP);
> }
> if (moveAfter)
> 	TtcPreviousChar (document, view);
> 
> 
> Thanks again,
> 
> Bryon McDowell
> bryon.mcdowell@cai.com
> 

-- 
     Irene.
Received on Friday, 26 May 2000 05:42:54 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:31:04 UTC