[webkit-dev] SmartDelete incorrect?

Darin Adler darin at apple.com
Tue Feb 23 13:49:29 PST 2010

On Feb 22, 2010, at 6:47 PM, Ojan Vafai wrote:

> From the test:
> Tests: Smart delete when deleting the first word on a line.
> Expected Results: The first word and the space following the first word should be deleted.

That is the correct result. But you only get smart deletion you use double click.

> So, specifically, if I have "foo bar baz" and I select the word "foo" using cmd+shift+right, hitting delete will delete the space in WebKit, but *not* in TextEdit. If, however, I select the word "foo" using cmd+right, hitting delete does not delete the space in either app. The TextEdit behavior seems more predictable (and sane).

Command-shift-right selects a line, not a word. I think you mean option-shift-right.

You have a point.

Option-shift-right does not give you smart deletion behavior in Mac OS X NSTextView. Selecting words with double click does. The smart-delete-001.html test is testing a particular case of smart deletion and we do need a test for that fix. But it incorrectly depends on smart deletion mode being set when extending a selection by word. We probably need to turn this into two tests:

    1) Test that extending by word does *not* give you smart deletion.

    2) Test that double clicking at the beginning of a line to do smart deletion correctly deletes both the word and a space.

It might be tricky to write (2) because I don’t know of a way to make a selection that will result in smart deletion with DOM APIs. Maybe execCommand("SelectWord")?

    -- Darin

More information about the webkit-dev mailing list