WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WORKSFORME
Bug 24981
Crazy backspace/delete behavior
https://bugs.webkit.org/show_bug.cgi?id=24981
Summary
Crazy backspace/delete behavior
Julie Parent
Reported
2009-03-31 22:07:36 PDT
1. Go to
http://jparent.googlepages.com/brokenBackspace.html
or paste the following HTML into your favorite contentEditable region: <h3>heading</h3> other text 2. Put your cursor before the "o" in other 3. Hit backspace Result: The "o" stays where it is, the "t" moves onto the next line, and "her text" merges up onto the line with "heading". Html is: <h3>heading<span class="Apple-style-span" style="font-size: 16px; font-weight: normal; ">her text</span></h3>o<br>t Expected result: "other text" merges onto the line wiht "heading" Notes: * This also happens if you put the cursor after the "g" in heading and hit delete. * The problem is clearly with the whitespace before "other text". With only one whitespace, only the "o" gets left behind, with two whitespaces, the "ot" get left behind, with three whitespaces, "oth" get left behind, etc.
Attachments
Add attachment
proposed patch, testcase, etc.
Julie Parent
Comment 1
2009-04-10 13:18:38 PDT
I think this happens for all blocks. If you replace the <H3> in my example with a <DIV>, <OL><LI>, <BLOCKQUOTE> it also repros.
swethanagaraj
Comment 2
2009-05-19 00:10:33 PDT
Hi, I have been analysing the code for this bug, these are the observation made In Webkit\WebCore\editing\deleteselectioncommand.cpp -CompositeEditCommand::deleteTextFromNode(node, offset, count) method will remove the white-space from the string=" other text" and gives us string="other text", without space. but still the offSet value will be '3', which should be made to '0' before the call to VisiblePosition startOfParagraphToMove(m_downstreamEnd) method in mergeParagraphs() else from the 3rd postion of "other text" which is from 'h' it will merge with heading. so to reset the offset to zero , call m_upstreamStart = m_selectionToDelete.start() and m_downstreamEnd = m_selectionToDelete.end() method before making a call to VisiblePosition startOfParagraphToMove(m_downstreamEnd) in mergeParagraphs() this would eliminate the problem due to white-space.
Ryosuke Niwa
Comment 3
2009-07-14 16:28:27 PDT
I can't reproduce this bug. Maybe it has been fixed?
Julie Parent
Comment 4
2009-07-14 17:37:14 PDT
I can't repro anymore either. I'll mark as fixed.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug