Bug 58025 - Web Inspector: Bugs in some corner cases in the text editor
Summary: Web Inspector: Bugs in some corner cases in the text editor
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-07 03:26 PDT by Andrey Adaikin
Modified: 2011-04-08 04:22 PDT (History)
11 users (show)

See Also:


Attachments
Patch (4.78 KB, patch)
2011-04-07 03:31 PDT, Andrey Adaikin
no flags Details | Formatted Diff | Diff
Patch (5.46 KB, patch)
2011-04-07 07:17 PDT, Andrey Adaikin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Adaikin 2011-04-07 03:26:00 PDT
1) The very last _empty_ line would not be deleted if you hit a Backspace on it, or the selection text to be deleted is extended to the very bottom of the editor.

2) An odd corner case: delete all source code from the editor, hit backspace on the only empty line, then add a character. In this case the browser will insert a TEXT node instead of a DIV node for a lineRow.
Comment 1 Andrey Adaikin 2011-04-07 03:31:50 PDT
Created attachment 88605 [details]
Patch
Comment 2 Yury Semikhatsky 2011-04-07 06:49:10 PDT
Comment on attachment 88605 [details]
Patch

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

> Source/WebCore/ChangeLog:7
> +

ChangeLog entry should briefly explain the change, please don't leave it empty.

> Source/WebCore/inspector/front-end/TextViewer.js:1145
> +        for (var lineRow = element; lineRow; lineRow = lineRow.parentElement) {

Why not use this loop exclusively without relying on the class name above?
Comment 3 Yury Semikhatsky 2011-04-07 06:49:49 PDT
Comment on attachment 88605 [details]
Patch

Also, please update copyright years in the files you edit.
Comment 4 Andrey Adaikin 2011-04-07 07:14:16 PDT
Comment on attachment 88605 [details]
Patch

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

>> Source/WebCore/ChangeLog:7
>> +
> 
> ChangeLog entry should briefly explain the change, please don't leave it empty.

done.

>> Source/WebCore/inspector/front-end/TextViewer.js:1145
>> +        for (var lineRow = element; lineRow; lineRow = lineRow.parentElement) {
> 
> Why not use this loop exclusively without relying on the class name above?

Because an element may not be attached to the this._container any more (e.g. after a DOMNodeRemoved event). The loop is to handle the odd case when the browser would insert a line-row without the "webkit-line-content" className right under the this._container.
Comment 5 Andrey Adaikin 2011-04-07 07:17:38 PDT
Created attachment 88629 [details]
Patch
Comment 6 Pavel Podivilov 2011-04-08 04:22:11 PDT
Comment on attachment 88629 [details]
Patch

Clearing flags on attachment: 88629

Committed r83285: <http://trac.webkit.org/changeset/83285>
Comment 7 Pavel Podivilov 2011-04-08 04:22:21 PDT
All reviewed patches have been landed.  Closing bug.