Bug 110512 - Change default background color of a dragged image
Summary: Change default background color of a dragged image
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Shawn Singh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-21 14:16 PST by Shawn Singh
Modified: 2013-03-05 16:13 PST (History)
9 users (show)

See Also:


Attachments
Patch (1.78 KB, patch)
2013-02-21 14:22 PST, Shawn Singh
no flags Details | Formatted Diff | Diff
Use Color::transparent (1.75 KB, patch)
2013-02-21 14:28 PST, Shawn Singh
no flags Details | Formatted Diff | Diff
retrying ews bots (1.74 KB, patch)
2013-02-25 12:50 PST, Shawn Singh
no flags Details | Formatted Diff | Diff
Patch (4.17 KB, patch)
2013-03-05 14:40 PST, Shawn Singh
no flags Details | Formatted Diff | Diff
Patch for landing (4.31 KB, patch)
2013-03-05 15:45 PST, Shawn Singh
no flags Details | Formatted Diff | Diff
Patch for landing (4.30 KB, patch)
2013-03-05 15:56 PST, Shawn Singh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Shawn Singh 2013-02-21 14:16:01 PST
Most of the time, dragged images did not care what the background color of their nodeImage was.  However, now in some cases, this background color actually matters because the drag image becomes a webkit composited layer and paints with that color.  So, we should change this color to completely transparent.

dcheng@ can you please make sure what I said above is correct =)   Also, I did some archaeology and I think the original change was made in https://bugs.webkit.org/show_bug.cgi?id=43449 -- hopefully that may jog your memory if there really is an important reason why opaque white was chosen. There's no particular platform or other port that especially needs opaque white to paint the drag images correctly, is there?

Patch coming in a moment.
Comment 1 Daniel Cheng 2013-02-21 14:18:39 PST
Yes, that's the right patch. I already looked at it yesterday, but I still don't really remember the exact reason for picking a white background.
Comment 2 Shawn Singh 2013-02-21 14:22:39 PST
Created attachment 189601 [details]
Patch
Comment 3 Daniel Cheng 2013-02-21 14:24:08 PST
Comment on attachment 189601 [details]
Patch

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

> Source/WebCore/page/Frame.cpp:1082
> +    m_view->setBaseBackgroundColor(colorWithOverrideAlpha(Color::black, 0.0));

Perhaps just use Color::transparent?
Comment 4 Shawn Singh 2013-02-21 14:28:53 PST
Created attachment 189602 [details]
Use Color::transparent
Comment 5 Build Bot 2013-02-21 15:03:26 PST
Comment on attachment 189602 [details]
Use Color::transparent

Attachment 189602 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://queues.webkit.org/results/16692349

New failing tests:
svg/custom/empty-className-baseVal-crash.html
Comment 6 Shawn Singh 2013-02-21 15:53:55 PST
Still requesting review...

before patch + after patch layout tests seem the same on my mac desktop.  The ews bot failures are from the tree, very unlikely from this patch.
Comment 7 Simon Fraser (smfr) 2013-02-21 17:37:17 PST
Can you give specific examples of content that shows the problem you're trying to fix?
Comment 8 Shawn Singh 2013-02-21 23:25:10 PST
(In reply to comment #7)
> Can you give specific examples of content that shows the problem you're trying to fix?

The original chromium-side bug report is https://code.google.com/p/chromium/issues/detail?id=177036  - you can see the screenshot on the first post there.  For other reasons, the drag image is chosen to be larger than the image itself.  As I understand the situation, there's no way to reproduce this in a reduced test / layout test, since it's a uniqueness of chrome os that recycles the draggable image back into another webview for the ui.  At least, I think that's how it works.
Comment 9 Shawn Singh 2013-02-25 12:50:32 PST
Created attachment 190108 [details]
retrying ews bots
Comment 10 Shawn Singh 2013-02-28 15:34:28 PST
Is there any update to review?  tony@ I think you may have reviewed some dragging related patches in the past; could you please take a look?   Thanks in advance.
Comment 11 Tony Chang 2013-03-04 13:30:08 PST
Comment on attachment 190108 [details]
retrying ews bots

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

Looks like this code originally came from Chromium's WebKit port and was refactored in r96339 to be used by Gtk+ as well.

Can you describe how to manually see the difference here?  Maybe you can upload a test case to the bug or add manual test to the ManualTests directory?

> Source/WebCore/ChangeLog:10
> +        Reviewed by NOBODY (OOPS!).

This goes below the bug line.  See the other entries in the ChangeLog.

> Source/WebCore/ChangeLog:13
> +        This behavior is needed for chrome OS, the background color for
> +        nodeImage doesn't show up at all when dragging for other ports; so

Please mention that this change does not impact Mac or Win due to the #if.
Comment 12 Shawn Singh 2013-03-05 10:45:09 PST
Comment on attachment 190108 [details]
retrying ews bots

Thanks for review, removing r=? for now, I'll try to have a new patch soon.
Comment 13 Shawn Singh 2013-03-05 10:47:29 PST
(In reply to comment #11)
> (From update of attachment 190108 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=190108&action=review
> 
> Looks like this code originally came from Chromium's WebKit port and was refactored in r96339 to be used by Gtk+ as well.
> 
> Can you describe how to manually see the difference here?

hshi@ uploaded a nice manual test on the chromium side - https://code.google.com/p/chromium/issues/detail?id=177036 - I'll create a webkit manual test based off that for the next patch.

Tony@ in the mean-time, did you have any further thoughts about  comments #39 and #40, point (2) ?

thanks
Comment 14 Shawn Singh 2013-03-05 14:40:34 PST
Created attachment 191569 [details]
Patch
Comment 15 Shawn Singh 2013-03-05 14:42:34 PST
> > Source/WebCore/ChangeLog:13
> > +        This behavior is needed for chrome OS, the background color for
> > +        nodeImage doesn't show up at all when dragging for other ports; so
> 
> Please mention that this change does not impact Mac or Win due to the #if.

Actually I did not understand what you mean here...  does this comment still apply to the latest patch?

Latest patch is complete this time, including a Manual test.
Comment 16 Tony Chang 2013-03-05 15:05:01 PST
(In reply to comment #15)
> > > Source/WebCore/ChangeLog:13
> > > +        This behavior is needed for chrome OS, the background color for
> > > +        nodeImage doesn't show up at all when dragging for other ports; so
> > 
> > Please mention that this change does not impact Mac or Win due to the #if.
> 
> Actually I did not understand what you mean here...  does this comment still apply to the latest patch?

Sorry, by Mac and Win I mean Apple Mac and Apple Win due to "#if !PLATFORM(MAC) && !PLATFORM(WIN)" a few lines up.
Comment 17 Tony Chang 2013-03-05 15:05:59 PST
Comment on attachment 191569 [details]
Patch

LGTM, please update the ChangeLog before landing.
Comment 18 Shawn Singh 2013-03-05 15:45:12 PST
Created attachment 191587 [details]
Patch for landing
Comment 19 WebKit Review Bot 2013-03-05 15:53:46 PST
Comment on attachment 191587 [details]
Patch for landing

Rejecting attachment 191587 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=webkit-commit-queue.appspot.com', '--bot-id=gce-cq-03', 'validate-changelog', '--non-interactive', 191587, '--port=chromium-xvfb']" exit_code: 1 cwd: /mnt/git/webkit-commit-queue

/mnt/git/webkit-commit-queue/ChangeLog neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive).

Full output: http://webkit-commit-queue.appspot.com/results/17048199
Comment 20 Shawn Singh 2013-03-05 15:56:03 PST
Created attachment 191590 [details]
Patch for landing
Comment 21 WebKit Review Bot 2013-03-05 16:13:31 PST
Comment on attachment 191590 [details]
Patch for landing

Clearing flags on attachment: 191590

Committed r144841: <http://trac.webkit.org/changeset/144841>
Comment 22 WebKit Review Bot 2013-03-05 16:13:36 PST
All reviewed patches have been landed.  Closing bug.