Bug 28187 - "Double-click to add" new style button does not always show up
Summary: "Double-click to add" new style button does not always show up
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL: http://webkit.org
Depends on:
Reported: 2009-08-11 14:20 PDT by Sam Weinig
Modified: 2009-08-12 09:43 PDT (History)
3 users (show)

See Also:

Quick Fix (6.00 KB, patch)
2009-08-11 14:49 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2009-08-11 14:20:10 PDT
On http://webkit.org, the "Double-click to add" button does not show up for the body element in the elements pane.
Comment 1 Joseph Pecoraro 2009-08-11 14:24:13 PDT
Seems to be due to "could not parse color" warnings.  I'll work on this right now.
Comment 2 Joseph Pecoraro 2009-08-11 14:39:56 PDT
Interesting.  The incoming CSS of:


Has the string "green" inside it and "green" swatch is (incorrectly) made for it:


WebInspector.Color is invoked if there was a swatch on the massaged CSS value, and it throws an error because it cannot parse the following as a valid color:


Since this affects the WebKit Nightly right now I will throw up a "quick fix" patch that catches the WebInspector.Color error and therefore takes us back to the expected old behavior with the swatch still incorrectly showing.  I'll then work on cleaning this up in general.
Comment 3 Joseph Pecoraro 2009-08-11 14:49:00 PDT
Created attachment 34597 [details]
Quick Fix

This is the quick fix for the Nightly Build.


I think a more optimal solution would be to avoid throwing an error at all. Instead something like WebInspector.Color.parseColor() factory method which would return either 'null' or a WebInspector.Color object.  That way we won't have to worry about any throw/catch.  Along with the other improvements mentioned previously, including:

  - swatch shows up accidentally
  - all swatches should be clickable to toggle colors
  - swatches should be clickable in shorthand properties
Comment 4 Eric Seidel (no email) 2009-08-12 09:43:34 PDT
Comment on attachment 34597 [details]
Quick Fix

Clearing flags on attachment: 34597

Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	WebCore/ChangeLog
	M	WebCore/inspector/front-end/StylesSidebarPane.js
Committed r47116
	M	WebCore/ChangeLog
	M	WebCore/inspector/front-end/StylesSidebarPane.js
r47116 = 339ebebf103c8020a3164de2578c2171389b539a (trunk)
No changes between current HEAD and refs/remotes/trunk
Resetting to the latest refs/remotes/trunk
Comment 5 Eric Seidel (no email) 2009-08-12 09:43:37 PDT
All reviewed patches have been landed.  Closing bug.