commit | 3b8f6c5af9e0de9c4ea2108061b5e99cbe8c8561 | [log] [tgz] |
---|---|---|
author | carlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc> | Tue Feb 26 09:55:42 2019 +0000 |
committer | carlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc> | Tue Feb 26 09:55:42 2019 +0000 |
tree | 0021d983d93bc141df791505b94d2d6168b1f60c | |
parent | 31736b1019aaef2d9cdd158e341c0eac71dbdd72 [diff] |
[WPE] Add API for webview background color configuration https://bugs.webkit.org/show_bug.cgi?id=192305 Source/WebCore: Reviewed by Michael Catanzaro. Adapt the FrameView API to allow a default non-white background color. * page/Frame.cpp: (WebCore::Frame::createView): Replace isTransparent argument with a background color one. * page/Frame.h: * page/FrameView.cpp: (WebCore::FrameView::recalculateBaseBackgroundColor): Use Color::transparent if m_isTransparent is true. (WebCore::FrameView::updateBackgroundRecursively): Allow the fallback background color to be non-white, this is used only in non-dark-mode-css build configurations. * page/FrameView.h: * testing/Internals.cpp: (WebCore::Internals::setViewIsTransparent): Use Color::transparent if transparent is true. Source/WebKit: Reviewed by Michael Catanzaro. In the case of WPE we need to send the background color to the web process to be used as the background color of the page. This patch adapts the GTK+ implementation to do the same, since it's a lot simpler. The patch also removes the SetDrawsBackground message in favor of the new SetBackgroundColor message that receives an optional color. * PlatformWPE.cmake: Add new WPE API for WebKitColor boxed type. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext): Remove background rendering and opacity handling. * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h: * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp: (WebKit::ThreadedCompositor::renderLayerTree): Remove drawsBakground and always clear the context with transparent color. * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h: * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): Replace drawsBackground with backgroundColor. (WebKit::WebPageCreationParameters::decode): Ditto. * Shared/WebPageCreationParameters.h: * SourcesWPE.txt: * UIProcess/API/glib/WebKitWebView.cpp: * UIProcess/API/gtk/WebKitWebViewGtk.cpp: (webkit_web_view_set_background_color): (webkit_web_view_get_background_color): * UIProcess/API/wpe/WebKitColor.cpp: Added. (webkit_color_copy): (webkit_color_free): (webkitColorToWebCoreColor): (webkitColorFillFromWebCoreColor): (webkit_color_parse): * UIProcess/API/wpe/WebKitColor.h: Added. * UIProcess/API/wpe/WebKitColorPrivate.h: Added. * UIProcess/API/wpe/WebKitWebView.h: Implement webkit_web_view_set_background_color API. * UIProcess/API/wpe/WebKitWebViewWPE.cpp: Ditto. (webkit_web_view_set_background_color): (webkit_web_view_get_background_color): * UIProcess/API/wpe/docs/wpe-0.1-sections.txt: Add new symbols. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::setDrawsBackground): Set a transparent background color when false is passed. (WebKit::WebPageProxy::setBackgroundColor): Send background color to the WebProcess. (WebKit::WebPageProxy::creationParameters): Replace drawsBackground with backgroundColor. * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::drawsBackground const): (WebKit::WebPageProxy::backgroundColor const): * UIProcess/cairo/BackingStoreCairo.cpp: (WebKit::BackingStore::incorporateUpdate): Remove GTK+ code to handle background color. * UIProcess/gtk/AcceleratedBackingStore.cpp: * UIProcess/gtk/AcceleratedBackingStore.h: Make paint() pure virtual and remove the implementation. * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp: (WebKit::AcceleratedBackingStoreWayland::paint): Dot not call AcceleratedBackingStore::paint() now that is pure virtual. * UIProcess/gtk/AcceleratedBackingStoreX11.cpp: (WebKit::AcceleratedBackingStoreX11::paint): Ditto. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Use background color as provided by the UIProcess when creating the FrameView. * WebProcess/WebPage/AcceleratedDrawingArea.cpp: * WebProcess/WebPage/AcceleratedDrawingArea.h: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp: * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h: * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp: (WebKit::ThreadedCoordinatedLayerTreeHost::setIsDiscardable): * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h: * WebProcess/WebPage/DrawingArea.h: * WebProcess/WebPage/DrawingAreaImpl.cpp: (WebKit::DrawingAreaImpl::display): Remove special case for transparent background. * WebProcess/WebPage/LayerTreeHost.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::setBackgroundColor): New API for background color configuration. Proxies to FrameView and DrawingArea. * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::backgroundColor const): Read-only access to the current background color. * WebProcess/WebPage/WebPage.messages.in: Replace SetDrawsBackground message with SetBackgroundColor. Source/WebKitLegacy/win: Patch by Philippe Normand <pnormand@igalia.com> on 2019-02-26 Reviewed by Michael Catanzaro. * WebCoreSupport/WebFrameLoaderClient.cpp: (WebFrameLoaderClient::transitionToCommittedForNewPage): Create FrameView with background color. Tools: Patch by Philippe Normand <pnormand@igalia.com> on 2019-02-26 Reviewed by Michael Catanzaro. * MiniBrowser/wpe/main.cpp: (main): Add a new option to configure the webview background color. Example: --bg-color=transparent. * TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp: (testWebViewBackgroundColor): Enable background color API tests for WPE. (beforeAll): Ditto. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@242082 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKit is a cross-platform web browser engine. On iOS and macOS, it powers Safari, Mail, iBooks, and many other applications.
Visit WebKit Feature Status page to see which Web API has been implemented, in development, or under consideration.
On macOS, download Safari Technology Preview to test the latest version of WebKit. On Linux, download Epiphany Technology Preview. On Windows, you'll have to build it yourself.
Once your bug is filed, you will receive email when it is updated at each stage in the bug life cycle. After the bug is considered fixed, you may be asked to download the latest nightly and confirm that the fix works for you.
On Windows, follow the instructions on our website.
Run the following command to clone WebKit's Git SVN repository:
git clone git://git.webkit.org/WebKit.git WebKit
or
git clone https://git.webkit.org/git/WebKit.git WebKit
If you want to be able to commit changes to the repository, or just want to check out branches that aren’t contained in WebKit.git, you will need track WebKit's Subversion repository. You can run the following command to configure this and other options of the new Git clone for WebKit development.
Tools/Scripts/webkit-patch setup-git-clone
For information about this, and other aspects of using Git with WebKit, read the wiki page.
If you don‘t want to use Git, run the following command to check out WebKit’s Subversion repository:
svn checkout https://svn.webkit.org/repository/webkit/trunk WebKit
Install Xcode and its command line tools if you haven't done so already:
xcode-select --install
Run the following command to build a debug build with debugging symbols and assertions:
Tools/Scripts/build-webkit --debug
For performance testing, and other purposes, use --release
instead.
You can open WebKit.xcworkspace
to build and debug WebKit within Xcode.
If you don't use a custom build location in Xcode preferences, you have to update the workspace settings to use WebKitBuild
directory. In menu bar, choose File > Workspace Settings, then click the Advanced button, select “Custom”, “Relative to Workspace”, and enter WebKitBuild
for both Products and Intermediates.
The first time after you install a new Xcode, you will need to run the following command to enable Xcode to build command line tools for iOS Simulator:
sudo Tools/Scripts/configure-xcode-for-ios-development
Without this step, you will see the error message: “target specifies product type ‘com.apple.product-type.tool’, but there’s no such product type for the ‘iphonesimulator’ platform.
” when building target JSCLLIntOffsetsExtractor
of project JavaScriptCore
.
Run the following command to build a debug build with debugging symbols and assertions for iOS:
Tools/Scripts/build-webkit --debug --ios-simulator.
For production builds:
cmake -DPORT=GTK -DCMAKE_BUILD_TYPE=RelWithDebInfo -GNinja ninja sudo ninja install
For development builds:
Tools/gtk/install-dependencies Tools/Scripts/update-webkitgtk-libs Tools/Scripts/build-webkit --gtk --debug
For more information on building WebKitGTK+, see the wiki page.
For production builds:
cmake -DPORT=WPE -DCMAKE_BUILD_TYPE=RelWithDebInfo -GNinja ninja sudo ninja install
For development builds:
Tools/wpe/install-dependencies Tools/Scripts/update-webkitwpe-libs Tools/Scripts/build-webkit --wpe --debug
For building WebKit on Windows, see the wiki page.
Run the following command to launch Safari with your local build of WebKit:
Tools/Scripts/run-safari --debug
The run-safari
script sets the DYLD_FRAMEWORK_PATH
environment variable to point to your build products, and then launches /Applications/Safari.app
. DYLD_FRAMEWORK_PATH
tells the system loader to prefer your build products over the frameworks installed in /System/Library/Frameworks
.
To run other applications with your local build of WebKit, run the following command:
Tools/Scripts/run-webkit-app <application-path>
Run the following command to launch iOS simulator with your local build of WebKit:
run-safari --debug --ios-simulator
In both cases, if you have built release builds instead, use --release
instead of --debug
.
If you have a development build, you can use the run-minibrowser script, e.g.:
run-minibrowser --debug --wpe
Pass one of --gtk
, --jsc-only
, or --wpe
to indicate the port to use.
Congratulations! You’re up and running. Now you can begin coding in WebKit and contribute your fixes and new features to the project. For details on submitting your code to the project, read Contributing Code.