Bug 48658

Summary: Deleting contenteditable text to the left of a non-contenteditable span inserts unnecessary placeholder <br/>
Product: WebKit Reporter: Benjamin (Ben) Kalman <kalman>
Component: New BugsAssignee: Benjamin (Ben) Kalman <kalman>
Status: RESOLVED FIXED    
Severity: Normal CC: adele, commit-queue, darin, enrica, kalman, noel.gordon, pnormand, rniwa
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 48037    
Attachments:
Description Flags
Patch
none
Simple repro
none
Patch
none
Patch none

Description Benjamin (Ben) Kalman 2010-10-29 12:17:49 PDT
Deleting contenteditable text to the left of a non-contenteditable span inserts unnecessary placeholder <br/>
Comment 1 Benjamin (Ben) Kalman 2010-10-29 12:21:23 PDT
Created attachment 72367 [details]
Patch
Comment 2 Benjamin (Ben) Kalman 2010-10-29 12:22:41 PDT
Created attachment 72368 [details]
Simple repro
Comment 3 Benjamin (Ben) Kalman 2010-10-29 12:23:18 PDT
Repro attached -- highlight "hello " (i.e. including space) and delete.
Comment 4 Benjamin (Ben) Kalman 2010-10-29 12:25:33 PDT
Comment on attachment 72367 [details]
Patch

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

> WebCore/WebCore.exp.in:420
> +__ZN7WebCore16isEndOfParagraphERKNS_15VisiblePositionENS_8Position27EditingBoundaryCrossingRuleE

fyi I tried deleting these but linking fails with

Undefined symbols:
  "__ZN7WebCore16isEndOfParagraphERKNS_15VisiblePositionENS_8Position27EditingBoundaryCrossingRuleE", referenced from:
      -[WebFrame(WebPrivate) _smartInsertForString:replacingRange:beforeString:afterString:] in WebFrame.o
  "__ZN7WebCore18isStartOfParagraphERKNS_15VisiblePositionENS_8Position27EditingBoundaryCrossingRuleE", referenced from:
      -[WebFrame(WebPrivate) _smartInsertForString:replacingRange:beforeString:afterString:] in WebFrame.o
Comment 5 Benjamin (Ben) Kalman 2010-10-29 12:30:06 PDT
Created attachment 72371 [details]
Patch
Comment 6 Ryosuke Niwa 2010-10-29 12:35:43 PDT
Comment on attachment 72371 [details]
Patch

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

LGTM.

> LayoutTests/editing/deleting/5390681-expected.txt:-2
>  This tests for a bug where expansion for smart delete would not consider editable boundaries.  Only 'foo' should be deleted.  You should see ' bar'.  There is a bug: while the non-editable space isn't deleted, deletion inserts a placeholder when it shouldn't.
> -| <br>

You need to update the comment here.
Comment 7 Benjamin (Ben) Kalman 2010-10-29 13:46:21 PDT
Created attachment 72383 [details]
Patch
Comment 8 Ryosuke Niwa 2010-10-29 14:03:03 PDT
Comment on attachment 72383 [details]
Patch

LGTM.
Comment 9 WebKit Commit Bot 2010-10-29 14:47:11 PDT
Comment on attachment 72383 [details]
Patch

Clearing flags on attachment: 72383

Committed r70932: <http://trac.webkit.org/changeset/70932>
Comment 10 WebKit Commit Bot 2010-10-29 14:47:18 PDT
All reviewed patches have been landed.  Closing bug.
Comment 11 Darin Adler 2010-10-29 15:15:40 PDT
Normally to share an enum like this we’d move the enum into a header instead of including "Position.h" in a header like "visible_units.h".
Comment 12 Benjamin (Ben) Kalman 2010-11-01 13:20:29 PDT
Ok, happy to do that.  What is the standard practice here?
Comment 13 Darin Adler 2010-11-03 12:38:05 PDT
(In reply to comment #12)
> Ok, happy to do that.  What is the standard practice here?

Create the new header, add it to the build systems, put the enum in there, add includes to the appropriate source files.
Comment 14 Benjamin (Ben) Kalman 2010-11-16 16:02:45 PST
(In reply to comment #13)
> (In reply to comment #12)
> > Ok, happy to do that.  What is the standard practice here?
> 
> Create the new header, add it to the build systems, put the enum in there, add includes to the appropriate source files.

https://bugs.webkit.org/show_bug.cgi?id=49630
Comment 15 Philippe Normand 2011-11-11 06:48:00 PST
editing/pasteboard/paste-text-events.html
editing/pasteboard/copy-backslash-with-euc.html

Started to fail on GTK since this patch landed it seems.
Comment 16 Philippe Normand 2011-11-11 08:02:19 PST
(In reply to comment #15)
> editing/pasteboard/paste-text-events.html
> editing/pasteboard/copy-backslash-with-euc.html
> 
> Started to fail on GTK since this patch landed it seems.

Heh. Nevermind!