Bug 122897

Summary: Web Inspector: logged objects are highlighted in blue
Product: WebKit Reporter: Dave Coffin <dcoffin>
Component: Web InspectorAssignee: Antoine Quint <graouts>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, graouts, joepeck, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: http://cl.ly/RyyP
Attachments:
Description Flags
Screenshot of problem
none
a suggestion for nicer looking and easier to read highlighting
none
Patch
none
Screenshot showing result of patch
none
Patch
none
Patch for landing none

Description Dave Coffin 2013-10-16 08:57:20 PDT
Created attachment 214365 [details]
Screenshot of problem

When highlighting objects in the console output, the entire object is highlighted blue.
Comment 1 Radar WebKit Bug Importer 2013-10-16 08:58:23 PDT
<rdar://problem/15241424>
Comment 2 Antoine Quint 2013-10-16 09:24:22 PDT
This is due to being able to select multiple rows in the console log to copy to the clipboard.
Comment 3 Timothy Hatcher 2013-10-16 11:32:00 PDT
We did attempt to fix it though, but it regressed. It should not select the row if you are clicking and arrow to expand the object.
Comment 4 Dave Coffin 2013-10-16 11:53:49 PDT
Tim- you did fix it I suppose, but the area you have to click is like 2px, and when you expand it doesn't unhighlight. I guess I have a larger problem with the highlighting in general, its ugly and you lose all syntax highlighting. I've attached a suggestion for better selecting in the console (IMO).
Comment 5 Dave Coffin 2013-10-16 11:54:19 PDT
Created attachment 214381 [details]
a suggestion for nicer looking and easier to read highlighting
Comment 6 Joseph Pecoraro 2013-10-16 12:15:32 PDT
(In reply to comment #5)
> Created an attachment (id=214381) [details]
> a suggestion for nicer looking and easier to read highlighting

I've consistently complained about this behavior in the JS Console. I like this highlighting idea!
Comment 7 Timothy Hatcher 2013-10-16 12:36:15 PDT
We can give it a try. I would try: background-color: highlight; that would keep it user controllable and use the system selection color.
Comment 8 Antoine Quint 2013-10-17 00:54:30 PDT
(In reply to comment #7)
> We can give it a try. I would try: background-color: highlight; that would keep it user controllable and use the system selection color.

I'm not sure about "background-color: highlight", seems to me we would probably run in the issue of contrast between the background color and the syntax-highlighted objects logged to the console.
Comment 9 Antoine Quint 2013-10-17 02:09:24 PDT
Created attachment 214436 [details]
Patch
Comment 10 Antoine Quint 2013-10-17 02:10:35 PDT
<rdar://problem/13839762>
Comment 11 Antoine Quint 2013-10-17 02:13:46 PDT
Created attachment 214438 [details]
Screenshot showing result of patch
Comment 12 Timothy Hatcher 2013-10-17 08:57:25 PDT
(In reply to comment #8)
> (In reply to comment #7)
> > We can give it a try. I would try: background-color: highlight; that would keep it user controllable and use the system selection color.
> 
> I'm not sure about "background-color: highlight", seems to me we would probably run in the issue of contrast between the background color and the syntax-highlighted objects logged to the console.

It would be no different than a text selection (same color in fact).
Comment 13 Antoine Quint 2013-10-17 13:49:04 PDT
(In reply to comment #12)
> (In reply to comment #8)
> > (In reply to comment #7)
> > > We can give it a try. I would try: background-color: highlight; that would keep it user controllable and use the system selection color.
> > 
> > I'm not sure about "background-color: highlight", seems to me we would probably run in the issue of contrast between the background color and the syntax-highlighted objects logged to the console.
> 
> It would be no different than a text selection (same color in fact).

Updating the patch with "highlight".
Comment 14 Antoine Quint 2013-10-17 13:49:24 PDT
Created attachment 214501 [details]
Patch
Comment 15 Joseph Pecoraro 2013-10-17 13:58:30 PDT
Comment on attachment 214501 [details]
Patch

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

r=me

So we'll now get the light highlight everywhere? Does it look good everywhere? I think it'll be good, it'll especially be an improvement for DOMNode / Object interaction.

> Source/WebInspectorUI/UserInterface/Images/UserInputPromptPreviousSelected.svg:-1
> -<?xml version="1.0" encoding="utf-8"?>

Could you also remove these sag files from the Visual Studio project files? Lame, I know. But we don't need to be proactive adding files, just removing them =).

    shell> ack -a UserInputPromptPreviousSelected.svg
    WebInspectorUI.vcxproj/WebInspectorUI.vcxproj
    539:    <None Include="..\UserInterface\Images\UserInputPromptPreviousSelected.svg" />

    WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters
    1698:    <None Include="..\UserInterface\Images\UserInputPromptPreviousSelected.svg">
Comment 16 Antoine Quint 2013-10-17 14:04:08 PDT
(In reply to comment #15)
> (From update of attachment 214501 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=214501&action=review
> 
> r=me
> 
> So we'll now get the light highlight everywhere? Does it look good everywhere? I think it'll be good, it'll especially be an improvement for DOMNode / Object interaction.
> 
> > Source/WebInspectorUI/UserInterface/Images/UserInputPromptPreviousSelected.svg:-1
> > -<?xml version="1.0" encoding="utf-8"?>
> 
> Could you also remove these sag files from the Visual Studio project files? Lame, I know. But we don't need to be proactive adding files, just removing them =).
> 
>     shell> ack -a UserInputPromptPreviousSelected.svg
>     WebInspectorUI.vcxproj/WebInspectorUI.vcxproj
>     539:    <None Include="..\UserInterface\Images\UserInputPromptPreviousSelected.svg" />
> 
>     WebInspectorUI.vcxproj/WebInspectorUI.vcxproj.filters
>     1698:    <None Include="..\UserInterface\Images\UserInputPromptPreviousSelected.svg">

Will remove in commit.
Comment 17 Joseph Pecoraro 2013-10-17 14:04:13 PDT
Comment on attachment 214501 [details]
Patch

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

> Source/WebInspectorUI/UserInterface/LogContentView.css:-147
> -.console-messages:focus .console-group.collapsed .console-item.selected .console-group-title::before {
> -    background-image: -webkit-canvas(disclosure-triangle-small-closed-selected);
> -}

Ahh, optionally you're removing a lot of the only uses of -webkit-canvas foo-selected instances. You may be able to remove some of the specifications for CSS image generation from Main.js in WebInspector._generateDisclosureTriangleImages.

    WebInspector._generateDisclosureTriangleImages = function()
    {
        var specifications = {};
        specifications["normal"] = {fillColor: [0, 0, 0, 0.5]};
        specifications["normal-active"] = {fillColor: [0, 0, 0, 0.7]};
        specifications["selected"] = {fillColor: [255, 255, 255, 0.8]};
        specifications["selected-active"] = {fillColor: [255, 255, 255, 1]};

        generateColoredImagesForCSS("Images/DisclosureTriangleSmallOpen.svg", specifications, 13, 13, "disclosure-triangle-small-open-");
        generateColoredImagesForCSS("Images/DisclosureTriangleSmallClosed.svg", specifications, 13, 13, "disclosure-triangle-small-closed-");

        generateColoredImagesForCSS("Images/DisclosureTriangleTinyOpen.svg", specifications, 8, 8, "disclosure-triangle-tiny-open-");
        generateColoredImagesForCSS("Images/DisclosureTriangleTinyClosed.svg", specifications, 8, 8, "disclosure-triangle-tiny-closed-");
    }

It looks like you can entirely remove selected-active here. It is not used with disclosure-triangle's at all.
And you can avoid "selected" for the top two, but probably still need it for the bottom two.
Comment 18 Antoine Quint 2013-10-17 14:16:36 PDT
Created attachment 214508 [details]
Patch for landing
Comment 19 WebKit Commit Bot 2013-10-17 14:27:56 PDT
Comment on attachment 214508 [details]
Patch for landing

Clearing flags on attachment: 214508

Committed r157600: <http://trac.webkit.org/changeset/157600>
Comment 20 WebKit Commit Bot 2013-10-17 14:27:59 PDT
All reviewed patches have been landed.  Closing bug.
Comment 21 Timothy Hatcher 2013-10-18 10:56:12 PDT
Comment on attachment 214501 [details]
Patch

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

>> Source/WebInspectorUI/UserInterface/LogContentView.css:-147
>> -}
> 
> Ahh, optionally you're removing a lot of the only uses of -webkit-canvas foo-selected instances. You may be able to remove some of the specifications for CSS image generation from Main.js in WebInspector._generateDisclosureTriangleImages.
> 
>     WebInspector._generateDisclosureTriangleImages = function()
>     {
>         var specifications = {};
>         specifications["normal"] = {fillColor: [0, 0, 0, 0.5]};
>         specifications["normal-active"] = {fillColor: [0, 0, 0, 0.7]};
>         specifications["selected"] = {fillColor: [255, 255, 255, 0.8]};
>         specifications["selected-active"] = {fillColor: [255, 255, 255, 1]};
> 
>         generateColoredImagesForCSS("Images/DisclosureTriangleSmallOpen.svg", specifications, 13, 13, "disclosure-triangle-small-open-");
>         generateColoredImagesForCSS("Images/DisclosureTriangleSmallClosed.svg", specifications, 13, 13, "disclosure-triangle-small-closed-");
> 
>         generateColoredImagesForCSS("Images/DisclosureTriangleTinyOpen.svg", specifications, 8, 8, "disclosure-triangle-tiny-open-");
>         generateColoredImagesForCSS("Images/DisclosureTriangleTinyClosed.svg", specifications, 8, 8, "disclosure-triangle-tiny-closed-");
>     }
> 
> It looks like you can entirely remove selected-active here. It is not used with disclosure-triangle's at all.
> And you can avoid "selected" for the top two, but probably still need it for the bottom two.

Not completely. DOM tree and DataGrid use disclosure-triangle-tiny-open, which still has selected and active.
Comment 22 Joseph Pecoraro 2013-10-18 11:16:35 PDT
(In reply to comment #21)
> (From update of attachment 214501 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=214501&action=review
> 
> >> Source/WebInspectorUI/UserInterface/LogContentView.css:-147
> >> -}
> > 
> > Ahh, optionally you're removing a lot of the only uses of -webkit-canvas foo-selected instances. You may be able to remove some of the specifications for CSS image generation from Main.js in WebInspector._generateDisclosureTriangleImages.
> > 
> >     WebInspector._generateDisclosureTriangleImages = function()
> >     {
> >         var specifications = {};
> >         specifications["normal"] = {fillColor: [0, 0, 0, 0.5]};
> >         specifications["normal-active"] = {fillColor: [0, 0, 0, 0.7]};
> >         specifications["selected"] = {fillColor: [255, 255, 255, 0.8]};
> >         specifications["selected-active"] = {fillColor: [255, 255, 255, 1]};
> > 
> >         generateColoredImagesForCSS("Images/DisclosureTriangleSmallOpen.svg", specifications, 13, 13, "disclosure-triangle-small-open-");
> >         generateColoredImagesForCSS("Images/DisclosureTriangleSmallClosed.svg", specifications, 13, 13, "disclosure-triangle-small-closed-");
> > 
> >         generateColoredImagesForCSS("Images/DisclosureTriangleTinyOpen.svg", specifications, 8, 8, "disclosure-triangle-tiny-open-");
> >         generateColoredImagesForCSS("Images/DisclosureTriangleTinyClosed.svg", specifications, 8, 8, "disclosure-triangle-tiny-closed-");
> >     }
> > 
> > It looks like you can entirely remove selected-active here. It is not used with disclosure-triangle's at all.
> > And you can avoid "selected" for the top two, but probably still need it for the bottom two.
> 
> Not completely. DOM tree and DataGrid use disclosure-triangle-tiny-open, which still has selected and active.

I don't see anything using "selected-active".
And yep, I was only saying "-small-" could avoid "selected", but "-tiny-" does still need it.