Bug 146715 - Web Inspector: Pressing delete in the styles sidebar with no text causes text to become misaligned
Summary: Web Inspector: Pressing delete in the styles sidebar with no text causes text...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-07-07 23:59 PDT by Devin Rousso
Modified: 2015-07-08 11:37 PDT (History)
8 users (show)

See Also:


Attachments
Current Functionality (154.56 KB, video/quicktime)
2015-07-07 23:59 PDT, Devin Rousso
no flags Details
Patch (1.73 KB, patch)
2015-07-08 00:01 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2015-07-07 23:59:25 PDT
Created attachment 256362 [details]
Current Functionality

Instead of removing the first indent, pressing delete in an empty rule should not do anything.
Comment 1 Radar WebKit Bug Importer 2015-07-07 23:59:47 PDT
<rdar://problem/21720090>
Comment 2 Devin Rousso 2015-07-08 00:01:39 PDT
Created attachment 256363 [details]
Patch
Comment 3 Timothy Hatcher 2015-07-08 08:24:23 PDT
Comment on attachment 256363 [details]
Patch

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

> Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js:482
> +        if (change.origin !== "+delete" || (!change.to.line && !change.to.ch) || this._completionController.isShowingCompletions())

Does this happen if there is text or only empty? !change.to.line && !change.to.ch will still be true if there is text.
Comment 4 Devin Rousso 2015-07-08 10:32:41 PDT
Comment on attachment 256363 [details]
Patch

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

>> Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationTextEditor.js:482
>> +        if (change.origin !== "+delete" || (!change.to.line && !change.to.ch) || this._completionController.isShowingCompletions())
> 
> Does this happen if there is text or only empty? !change.to.line && !change.to.ch will still be true if there is text.

This is only supposed to happen if the cursor is on the first character of the first line, regardless of whether that line has text.  Since pressing delete removes all markers at the cursor's position, if the cursor is at the beginning of a line it will remove the checkbox marker as well as the newline at the beginning of that line.  On the first line, there is no previous line, so pressing delete would just remove the checkbox marker.  We don't want this to happen.
Comment 5 WebKit Commit Bot 2015-07-08 11:37:23 PDT
Comment on attachment 256363 [details]
Patch

Clearing flags on attachment: 256363

Committed r186517: <http://trac.webkit.org/changeset/186517>
Comment 6 WebKit Commit Bot 2015-07-08 11:37:27 PDT
All reviewed patches have been landed.  Closing bug.