Bug 118457 - DeleteSelectionCommand does not handle correctly deletion with two consecutive BR element.
Summary: DeleteSelectionCommand does not handle correctly deletion with two consecutiv...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 528+ (Nightly build)
Hardware: All Unspecified
: P2 Normal
Assignee: Enrica Casucci
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-07-07 23:49 PDT by Enrica Casucci
Modified: 2013-07-08 19:49 PDT (History)
2 users (show)

See Also:


Attachments
Test case (147 bytes, text/html)
2013-07-07 23:49 PDT, Enrica Casucci
no flags Details
Patch (6.44 KB, patch)
2013-07-08 02:01 PDT, Enrica Casucci
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Enrica Casucci 2013-07-07 23:49:35 PDT
Created attachment 206220 [details]
Test case

Repro steps:

Open the attached test case (test2br.html).
Click on the empty line below the empty image box
Press backspace.

Expected:
the empty line is removed and the caret moves after the image.

Actual:
Nothing happens. The line is not removed and the caret remains in the same position.

<rdar://problem/14160912>
Comment 1 Enrica Casucci 2013-07-08 02:01:51 PDT
Created attachment 206224 [details]
Patch
Comment 2 Simon Fraser (smfr) 2013-07-08 19:25:03 PDT
Comment on attachment 206224 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=206224&action=review

> Source/WebCore/editing/DeleteSelectionCommand.cpp:312
> +    // when the two elements are sibling and should be false in a case like <div><br></div><br>.

…are siblings...

> LayoutTests/editing/deleting/delete-image-followed-by-two-br-expected.txt:1
> +CONSOLE MESSAGE: line 16: TypeError: 'undefined' is not a function (evaluating 'document.getElementsById("test")')

Should this be here?
Comment 3 Enrica Casucci 2013-07-08 19:32:23 PDT
(In reply to comment #2)
> (From update of attachment 206224 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=206224&action=review
> 
> > Source/WebCore/editing/DeleteSelectionCommand.cpp:312
> > +    // when the two elements are sibling and should be false in a case like <div><br></div><br>.
> 
> …are siblings...
Fixed.
> 
> > LayoutTests/editing/deleting/delete-image-followed-by-two-br-expected.txt:1
> > +CONSOLE MESSAGE: line 16: TypeError: 'undefined' is not a function (evaluating 'document.getElementsById("test")')
> 
> Should this be here?

No, it is a syntax error. Extra s in getElementById.
thanks for catching it.
Comment 4 Enrica Casucci 2013-07-08 19:49:37 PDT
Committed revision 152478.