Closed
Bug 200417
Opened 22 years ago
Closed 22 years ago
backspace, enter keys have no visible impact
Categories
(Core :: DOM: Editor, defect, P1)
Core
DOM: Editor
Tracking
()
RESOLVED
FIXED
mozilla1.4final
People
(Reporter: barrowma, Assigned: KaiE)
Details
(Keywords: topembed+, Whiteboard: EDITORBASE+, edt_b3, edt_c3, edt_x3)
Attachments
(3 files, 1 obsolete file)
270 bytes,
text/html
|
Details | |
2.31 KB,
patch
|
mozeditor
:
review+
sfraser_bugs
:
superreview+
sspitzer
:
approval1.4+
|
Details | Diff | Splinter Review |
2.30 KB,
patch
|
Details | Diff | Splinter Review |
The attached sample seems to have content which confuses the backspace and enter
keys.
To reproduce:
1. open the attachment in the editor
2. place caret at the start of the last line ("AFTER")
3. Hit Backspace: preceding newline will be deleted and "AFTER" will move up
4. Hit Backspace again: "AFTER" stays put **This is the bug** (in some cases,
caret will move up, but "AFTER" never moves)
5. With caret still on the same line as "AFTER", hit Backspace again: preceding
newline will be deleted and "AFTER" will move up to the "FOOBAR More stuff." line
6. Hit Enter: "AFTER" moves down, as expected
7. Hit Enter again: nothing happens, "AFTER" stays put **This is the bug too**
Reporter | ||
Comment 1•22 years ago
|
||
Reporter | ||
Updated•22 years ago
|
Whiteboard: EDITORBASE
Reporter | ||
Comment 2•22 years ago
|
||
Possibly related to bug 200418. Also possibly related to bug 192320.
Reporter | ||
Comment 3•22 years ago
|
||
I can reproduce on Linux build from 3/29/2003, so looks like it is NOT related
to the fix for bug 192320 (i.e., this bug existed before and after that fix landed).
Assignee | ||
Comment 4•22 years ago
|
||
Confirming, this is not caused by that other checkin.
I can reproduce this bug even with Mozilla 1.0
Updated•22 years ago
|
Keywords: topembed+
Whiteboard: EDITORBASE → EDITORBASE, edt_b3, edt_c3, edt_x3
Comment 6•22 years ago
|
||
This bug is because the code that merges the paragraphs on delete is not
detecting the invisible <br> at the end of the upper paragraph. A trailing br
in a block has no effect, but of course when the blocks are merged it is no
longer trailing. I have to detect this and delete it.
Comment 7•22 years ago
|
||
editorbase+
Whiteboard: EDITORBASE, edt_b3, edt_c3, edt_x3 → EDITORBASE+, edt_b3, edt_c3, edt_x3
Assignee | ||
Comment 8•22 years ago
|
||
I retested this bug. I see a small improvement.
The initial comment reports two bugs, step 4 and step 7.
I still see the bug in step 4, but step 7 works with the latest trunk.
Assignee | ||
Comment 9•22 years ago
|
||
Joe, your assessment was correct. This patch fixes the problem.
Assignee | ||
Comment 10•22 years ago
|
||
While working on this bug, I found bug 204017, which uses a similar testcase,
but without the disturbing whitespace, which this bug cares for. However, bug
204017 is seen with both testcases.
Assignee | ||
Updated•22 years ago
|
Attachment #122178 -
Flags: review?(jfrancis)
Comment 11•22 years ago
|
||
is the patch looking good for this? are we trying to land for 1.4 final or 1.5
Assignee | ||
Updated•22 years ago
|
Attachment #122178 -
Flags: review?(jfrancis)
Assignee | ||
Comment 12•22 years ago
|
||
Setting target milestone to 1.4 beta, because I don't see a 1.4 final milestone.
Priority: -- → P1
Target Milestone: --- → mozilla1.4beta
Assignee | ||
Comment 13•22 years ago
|
||
Just for completeness: In comment 10 I talked about the wrong bug number, what I
meant was bug 204016 - however that bug is invalid.
Assignee | ||
Comment 14•22 years ago
|
||
Yesterday I talked with Joe about this bug and the patch, who gave me very
helpful review comments.
To summarize: He thinks the approach is right, but we should improve the patch
to cover more scenarios. Patch v1 would not help if there are several
consecutive text nodes. Joe suggests to use nsWSRunObject and the
Start/EndReasonNodes it provides.
Joe was concerned the routine might now be slower because of using
nsWSRunObject, but it would be ok if it doesn't get called too often for any
given editor action. I think that is the case, since only JoinBlocks calls it.
It doesn't look like JoinBlocks is called more than once for an action.
I'm attaching a new patch that implements the suggestion. It fixes the bug for
me, too.
The idea is: Construct an nsWSRunObject using the after-the-last-node position
in the given block. Internally that object will search for the nodes that
separate the whitespace runs. A break is a whitespace run. mStartNode terminates
the run looking backwards. If the start reason is eBreak, it means, there is are
no visible nodes between the input position and the found start node, meaning
the break node at the end is invisble, because it is at the end of the block.
The patch also changes the logic for searching backwards from a given position,
using the same strategy.
Assignee | ||
Comment 15•22 years ago
|
||
Attachment #122178 -
Attachment is obsolete: true
Assignee | ||
Updated•22 years ago
|
Attachment #122572 -
Flags: review?(jfrancis)
Assignee | ||
Updated•22 years ago
|
Target Milestone: mozilla1.4beta → mozilla1.4final
Updated•22 years ago
|
QA Contact: sairuh → beppe
Comment 16•22 years ago
|
||
Comment on attachment 122572 [details] [diff] [review]
Patch v2
looks good.
Attachment #122572 -
Flags: review?(jfrancis) → review+
Assignee | ||
Updated•22 years ago
|
Attachment #122572 -
Flags: superreview?(sfraser)
Updated•22 years ago
|
Attachment #122572 -
Flags: superreview?(sfraser) → superreview+
Comment 17•22 years ago
|
||
Looking at a test build, I see minor 'jumping' in the edited text as the two
paragraphs in the test case are merged into a single paragraph during the
backspace. I don't see any issues using the enter key.
The jumping is minor compared to the existing behaviour.
Assignee | ||
Comment 18•22 years ago
|
||
The "jumping" you mention is not introduced by this patch.
You can see the same jumping with a trunk build, without the patch.
Assignee | ||
Comment 19•22 years ago
|
||
Comment on attachment 122572 [details] [diff] [review]
Patch v2
Requesting approval for 1.4 final checkin, for this editor behaviour
correctness fix.
Attachment #122572 -
Flags: approval1.4?
Comment 20•22 years ago
|
||
adding some QA, so they know to keep an eye out for 1.4 regressions.
Comment 21•22 years ago
|
||
Comment on attachment 122572 [details] [diff] [review]
Patch v2
a=sspitzer
one comment:
+ nsCOMPtr<nsIDOMNode> aTestNode;
+ PRInt32 aTestOffset = 0;
the aFoo notation is for arguments, not locals.
see http://www.mozilla.org/hacking/mozilla-style-guide.html#Visual
Attachment #122572 -
Flags: approval1.4? → approval1.4+
Updated•22 years ago
|
OS: Windows XP → All
Hardware: PC → All
Assignee | ||
Comment 22•22 years ago
|
||
According to Seth's request, I have renamed the variables.
No other changes in this patch.
Assignee | ||
Comment 23•22 years ago
|
||
fixed on trunk
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•