Bug 110918

Summary: Need API to control page underlay color
Product: WebKit Reporter: Conrad Shultz <conrad_shultz>
Component: WebKit Misc.Assignee: Conrad Shultz <conrad_shultz>
Status: RESOLVED FIXED    
Severity: Enhancement CC: andersca, anilsson, dglazkov, efidler, eric, esprehn+autocc, gyuyoung.kim, japhet, kdecker, mifenton, ojan.autocc, philn, rakuco, rwlbuis, sam, simon.fraser, thorton, tonikitoo, webkit-ews, webkit.review.bot, xan.lopez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
webkit-ews: commit-queue-
Patch
none
Patch none

Conrad Shultz
Reported 2013-02-26 15:44:14 PST
It would be useful for clients to have API to customize the background/underlay color displayed beneath the page, e.g. during rubber-banding.
Attachments
Patch (13.36 KB, patch)
2013-02-26 17:33 PST, Conrad Shultz
no flags
Patch (19.04 KB, patch)
2013-02-27 23:13 PST, Conrad Shultz
webkit-ews: commit-queue-
Patch (30.42 KB, patch)
2013-02-28 00:02 PST, Conrad Shultz
no flags
Patch (17.04 KB, patch)
2013-02-28 11:31 PST, Conrad Shultz
no flags
Conrad Shultz
Comment 1 2013-02-26 17:33:36 PST
Tim Horton
Comment 2 2013-02-26 17:44:52 PST
Comment on attachment 190402 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=190402&action=review > Source/WebKit2/WebProcess/WebPage/WebPage.cpp:1871 > +void WebPage::setUnderlayColor(const WebCore::Color& color) This file using namespace WebCore;s. Maybe some of the others too, but definitely this one.
Conrad Shultz
Comment 3 2013-02-27 13:09:09 PST
Comment on attachment 190402 [details] Patch Will submit a new version based on feedback.
Conrad Shultz
Comment 4 2013-02-27 23:13:38 PST
Early Warning System Bot
Comment 5 2013-02-27 23:19:04 PST
WebKit Review Bot
Comment 6 2013-02-27 23:19:25 PST
Comment on attachment 190662 [details] Patch Attachment 190662 [details] did not pass chromium-ews (chromium-xvfb): Output: http://webkit-commit-queue.appspot.com/results/16771916
Conrad Shultz
Comment 7 2013-02-28 00:02:06 PST
Simon Fraser (smfr)
Comment 8 2013-02-28 11:04:24 PST
Comment on attachment 190668 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=190668&action=review > Source/WebCore/page/ChromeClient.h:190 > + virtual Color underlayColor() const = 0; I think this should not be pure virtual, and can return Color() so you don't have to touch all the other clients. > Source/WebCore/platform/mac/ScrollbarThemeMac.mm:620 > + graphicsLayer->platformLayer().backgroundColor = backgroundColor.isValid() ? nsColor(backgroundColor).CGColor : cachedLinenBackgroundColor; I think this should use cachedCGColor(backgroundColor, ColorSpaceDeviceRGB).
Conrad Shultz
Comment 9 2013-02-28 11:27:55 PST
(In reply to comment #8) > (From update of attachment 190668 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=190668&action=review > > > Source/WebCore/page/ChromeClient.h:190 > > + virtual Color underlayColor() const = 0; > > I think this should not be pure virtual, and can return Color() so you don't have to touch all the other clients. Changed. > > > Source/WebCore/platform/mac/ScrollbarThemeMac.mm:620 > > + graphicsLayer->platformLayer().backgroundColor = backgroundColor.isValid() ? nsColor(backgroundColor).CGColor : cachedLinenBackgroundColor; > > I think this should use cachedCGColor(backgroundColor, ColorSpaceDeviceRGB). Good idea, changed. Will post a revised patch shortly.
Conrad Shultz
Comment 10 2013-02-28 11:31:37 PST
WebKit Review Bot
Comment 11 2013-02-28 16:49:09 PST
Comment on attachment 190766 [details] Patch Clearing flags on attachment: 190766 Committed r144397: <http://trac.webkit.org/changeset/144397>
WebKit Review Bot
Comment 12 2013-02-28 16:49:15 PST
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 13 2013-03-01 16:03:32 PST
Comment on attachment 190766 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=190766&action=review > Source/WebKit2/UIProcess/WebPageProxy.cpp:865 > + if (isValid()) > + m_process->send(Messages::WebPage::SetUnderlayColor(color), m_pageID); I don’t understand why the isValid() check here is a good idea. If we set the underlay color to an invalid color, then m_underlayColor gets set, but the other process is never told and is left with the old underlay color? That’s strange behavior. Seems we should send a SetUnderlayColor message to clear the underlay color if the new color is invalid.
Tim Horton
Comment 14 2013-03-01 16:08:58 PST
(In reply to comment #13) > (From update of attachment 190766 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=190766&action=review > > > Source/WebKit2/UIProcess/WebPageProxy.cpp:865 > > + if (isValid()) > > + m_process->send(Messages::WebPage::SetUnderlayColor(color), m_pageID); > > I don’t understand why the isValid() check here is a good idea. If we set the underlay color to an invalid color, then m_underlayColor gets set, but the other process is never told and is left with the old underlay color? That’s strange behavior. Seems we should send a SetUnderlayColor message to clear the underlay color if the new color is invalid. isValid checks if the WebProcess is valid, not the color (right?). If we try to send a message to !isValid() WebProcess, we crash. We've really gotta sort this out, because there are a bunch of WebPageProxy methods where it's easy to cause a crash by trying to do something from the UIProcess at the wrong time (especially post-WebProcess-crash).
Note You need to log in before you can comment on or make changes to this bug.