Bug 51581 - Web Inspector: Pasting a style property with value should automatically split it into prop/value
Summary: Web Inspector: Pasting a style property with value should automatically split...
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: Alexander Pavlov (apavlov)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-23 22:07 PST by temp01
Modified: 2010-12-30 12:25 PST (History)
13 users (show)

See Also:


Attachments
[PATCH] Suggested solution (5.79 KB, patch)
2010-12-30 04:50 PST, Alexander Pavlov (apavlov)
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description temp01 2010-12-23 22:07:36 PST
1) Copy a style rule e.g. "color: red" (without quotes)
2) Double click in inspector/style panel to create a new rule
3) Try to paste style rule from 1)

Currently, pasting the rule puts the whole rule (including value) in the "property" column/input and that doesn't work. It should either get split into the two input boxes automatically or inspector should parse it as a whole rule when you hit enter (with blank value).
Comment 1 Alexander Pavlov (apavlov) 2010-12-30 04:50:22 PST
Created attachment 77672 [details]
[PATCH] Suggested solution
Comment 2 Pavel Feldman 2010-12-30 05:15:52 PST
Comment on attachment 77672 [details]
[PATCH] Suggested solution

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

> WebCore/inspector/front-end/StylesSidebarPane.js:1589
> +            var nameValue = data.split(":", 2);

If we are supporting pasting "name:value" snippets, why don't we support pasting
name1 : value1;
name2 : value2;
name3 : value3;
?
Comment 3 Alexander Pavlov (apavlov) 2010-12-30 05:58:50 PST
(In reply to comment #2)
> (From update of attachment 77672 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=77672&action=review
> 
> > WebCore/inspector/front-end/StylesSidebarPane.js:1589
> > +            var nameValue = data.split(":", 2);
> 
> If we are supporting pasting "name:value" snippets, why don't we support pasting
> name1 : value1;
> name2 : value2;
> name3 : value3;
> ?

It is not so easy to handle similar strings in the current editing infrastructure.

I also envision a small UX inconsistency: a single name:value pair pasted into a new property does not commit it but allows tweaking of the name/value. In multiline texts, all properties but the last one should be committed and hence there is no way to tweak them as needed.
Comment 4 Alexander Pavlov (apavlov) 2010-12-30 09:27:21 PST
Committing to http://svn.webkit.org/repository/webkit/trunk ...
        M       WebCore/ChangeLog
        M       WebCore/inspector/front-end/StylesSidebarPane.js
        M       WebCore/inspector/front-end/inspector.js
Committed r74799
Comment 5 WebKit Review Bot 2010-12-30 12:25:34 PST
http://trac.webkit.org/changeset/74799 might have broken Leopard Intel Debug (Tests)