Bug 56002

Summary: Web Inspector: [STYLES] Editing a property value adds a word for any property value that uses a paren
Product: WebKit Reporter: Alexander Pavlov (apavlov) <apavlov>
Component: Web Inspector (Deprecated)Assignee: Alexander Pavlov (apavlov) <apavlov>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Suggested fix pfeldman: review+

Description Alexander Pavlov (apavlov) 2011-03-09 02:00:04 PST
1. Open any page
2. Open the webinspector and pick and element
3. In the element style properties, try to add something like:
-webkit-transform: translateZ(0)

You'll notice that the moment you type the open parenthesis the word "initial" appears, greyed out. There is no way to remove that so by the time you're done typing you end up with:
-webkit-transform: translateZ(0)initial

If a property accepts color keywords, you can end up with the word "aliceblue" instead.

Upstreaming http://code.google.com/p/chromium/issues/detail?id=75302
Comment 1 Alexander Pavlov (apavlov) 2011-03-09 03:50:18 PST
Created attachment 85156 [details]
[PATCH] Suggested fix
Comment 2 Joseph Pecoraro 2011-03-09 09:49:19 PST
Would the suggestion still affect url()? If you input "url(i" it might suggest initial?
Any way to prevent that, or is it a separate bug I should file a new bug?
Comment 3 Alexander Pavlov (apavlov) 2011-03-10 05:28:18 PST
(In reply to comment #2)
> Would the suggestion still affect url()? If you input "url(i" it might suggest initial?
> Any way to prevent that, or is it a separate bug I should file a new bug?

I wouldn't call it a bug :) Frankly speaking, we do not parse the current value contents and only offer prefix-based suggestions with all keywords allowed in the current property values (and "initial" is one of the keywords). If that is a real nuisance, feel free to file a bug.
Comment 4 Alexander Pavlov (apavlov) 2011-03-10 05:29:29 PST
Committing to http://svn.webkit.org/repository/webkit/trunk ...
        M       Source/WebCore/ChangeLog
        M       Source/WebCore/inspector/front-end/StylesSidebarPane.js
Committed r80710
Comment 5 Joseph Pecoraro 2011-03-10 10:15:57 PST
(In reply to comment #3)
> (In reply to comment #2)
> > Would the suggestion still affect url()? If you input "url(i" it might suggest initial?
> > Any way to prevent that, or is it a separate bug I should file a new bug?
> 
> I wouldn't call it a bug :)

Sure, an enhancement. I filed:
<http://webkit.org/b/56118> Web Inspector: CSS Autocomplete Should Use More Contextual Information

The same can be done for JavaScript, but I think we already have some relevant bugs.
I had a patch for improving getElementById to autocomplete id's, but it never landed.
Comment 6 Alexander Pavlov (apavlov) 2011-03-10 10:27:21 PST
(In reply to comment #5)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > Would the suggestion still affect url()? If you input "url(i" it might suggest initial?
> > > Any way to prevent that, or is it a separate bug I should file a new bug?
> > 
> > I wouldn't call it a bug :)
> 
> Sure, an enhancement. I filed:
> <http://webkit.org/b/56118> Web Inspector: CSS Autocomplete Should Use More Contextual Information
> 
> The same can be done for JavaScript, but I think we already have some relevant bugs.
> I had a patch for improving getElementById to autocomplete id's, but it never landed.

Good thing -- can you share your thoughts with me, perhaps over email? I'm curious about to what extent you think the input should be analyzed.