Bug 118457

Summary: DeleteSelectionCommand does not handle correctly deletion with two consecutive BR element.
Product: WebKit Reporter: Enrica Casucci <enrica>
Component: HTML EditingAssignee: Enrica Casucci <enrica>
Status: RESOLVED FIXED    
Severity: Normal CC: rniwa, sam
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: Unspecified   
Attachments:
Description Flags
Test case
none
Patch simon.fraser: review+

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.