Bug 20238 - Minor bugs with style editing in the Inspector
Summary: Minor bugs with style editing in the Inspector
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Minor
Assignee: Timothy Hatcher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-30 19:46 PDT by Timothy Hatcher
Modified: 2008-07-30 21:05 PDT (History)
1 user (show)

See Also:


Attachments
Proposed patch (6.97 KB, patch)
2008-07-30 19:47 PDT, Timothy Hatcher
aroben: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Hatcher 2008-07-30 19:46:09 PDT
The scroll position stays where it was when editing a string that was longer than the editing input area.

The text shifts when entering and exiting editing mode.

Child elements are sometimes not restored for shorthands.

Shorthands are not always expanded again after editing.

Color swatches should be hidden when editing.
Comment 1 Adam Roben (:aroben) 2008-07-30 19:46:59 PDT
Maybe we should have separate bugs for each of these issues?
Comment 2 Timothy Hatcher 2008-07-30 19:47:09 PDT
Created attachment 22572 [details]
Proposed patch
Comment 3 Adam Roben (:aroben) 2008-07-30 19:51:11 PDT
Comment on attachment 22572 [details]
Proposed patch

-        // Lie about out children to prevent toggling on click.
+        this.wasExpanded = this.expanded;
+
+        // Lie about our children to prevent expanding on double click and to collapse shorthands.
+        this.reallyHasChildren = this.hasChildren;
         this.hasChildren = false;
 
         if (!selectElement)
@@ -563,23 +564,26 @@ WebInspector.StylePropertyTreeElement.prototype = {
 
         window.getSelection().setBaseAndExtent(selectElement, 0, selectElement, 1);
 
-        WebInspector.startEditing(this.listItemElement, this.editingCommitted.bind(this), this.editingCancelled.bind(this), wasExpanded);
+        WebInspector.startEditing(this.listItemElement, this.editingCommitted.bind(this), this.editingCancelled.bind(this));

I guess you could pass the information along in the context parameter to startEditing instead of storing it on this. That would save you from having to delete the properties later. But it doesn't matter too much either way.

r=me!
Comment 4 Adam Roben (:aroben) 2008-07-30 19:51:29 PDT
Oh, don't forget to mention the bug number in the URL.
Comment 5 Timothy Hatcher 2008-07-30 21:05:12 PDT
Landed in r35472.