Skip to content

Commit 724f046

Browse files
committed
Refactor Introduction
Rip out a lot of Introduction.md into it's own articles.
1 parent 2f7a9d1 commit 724f046

File tree

9 files changed

+588
-566
lines changed

9 files changed

+588
-566
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Bug Tracking
2+
3+
## Overview
4+
5+
[bugs.webkit.org](https://bugs.webkit.org/) hosted is the primary bug tracking tool we use.
6+
We use bugzilla to file bugs, and then perform code review using GitHub.
7+
8+
### Filing a bug and editing bugs
9+
10+
To [file a new WebKit bug](https://bugs.webkit.org/enter_bug.cgi), see [reporting bugs](https://webkit.org/reporting-bugs/).
11+
12+
To edit an existing bug, you may need [editbug-bits](https://webkit.org/bugzilla-bits/).
13+
14+
### Code review
15+
Code reviews are done on GitHub when a pull request is made. See [Submitting a pull request](#submitting-a-pull-request).
16+
17+
### Security Bugs
18+
19+
Security bugs have their own components in [bugs.webkit.org](https://bugs.webkit.org/).
20+
We’re also working on a new policy to delay publishing tests for security fixes until after the fixes have been widely deployed.
21+
22+
_***Do not post a patch or describe a security bug in a bug that is not in security component of bugs.webkit.org.***_
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# Building WebKit
2+
3+
## Building macOS Port
4+
5+
Install Xcode and its command line tools if you haven't done so already:
6+
7+
1. **Install Xcode** Get Xcode from https://developer.apple.com/downloads. To build WebKit for OS X, Xcode 5.1.1 or later is required. To build WebKit for iOS Simulator, Xcode 7 or later is required.
8+
2. **Install the Xcode Command Line Tools** In Terminal, run the command: `xcode-select --install`
9+
10+
Run the following command to build a debug build with debugging symbols and assertions:
11+
12+
```
13+
Tools/Scripts/build-webkit --debug
14+
```
15+
16+
For performance testing, and other purposes, use `--release` instead.
17+
18+
## Using Xcode
19+
20+
You can open `WebKit.xcworkspace` to build and debug WebKit within Xcode.
21+
22+
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.
23+
24+
## Embedded Builds
25+
26+
iOS, tvOS and watchOS are all considered embedded builds. The first time after you install a new Xcode, you will need to run:
27+
28+
```
29+
sudo Tools/Scripts/configure-xcode-for-embedded-development
30+
```
31+
32+
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`.
33+
34+
Run the following command to build a debug build with debugging symbols and assertions for embedded simulators:
35+
36+
```
37+
Tools/Scripts/build-webkit --debug --<platform>-simulator
38+
```
39+
40+
or embedded devices:
41+
```
42+
Tools/Scripts/build-webkit --debug --<platform>-device
43+
```
44+
45+
where `platform` is `ios`, `tvos` or `watchos`.
46+
47+
## Building the GTK+ Port
48+
49+
For production builds:
50+
51+
```
52+
cmake -DPORT=GTK -DCMAKE_BUILD_TYPE=RelWithDebInfo -GNinja
53+
ninja
54+
sudo ninja install
55+
```
56+
57+
For development builds:
58+
59+
```
60+
Tools/gtk/install-dependencies
61+
Tools/Scripts/update-webkitgtk-libs
62+
Tools/Scripts/build-webkit --gtk --debug
63+
```
64+
65+
For more information on building WebKitGTK+, see the [wiki page](https://trac.webkit.org/wiki/BuildingGtk).
66+
67+
## Building the WPE Port
68+
69+
For production builds:
70+
71+
```
72+
cmake -DPORT=WPE -DCMAKE_BUILD_TYPE=RelWithDebInfo -GNinja
73+
ninja
74+
sudo ninja install
75+
```
76+
77+
For development builds:
78+
79+
```
80+
Tools/wpe/install-dependencies
81+
Tools/Scripts/update-webkitwpe-libs
82+
Tools/Scripts/build-webkit --wpe --debug
83+
```
84+
85+
## Building Windows Port
86+
87+
For building WebKit on Windows, see the [WebKit on Windows page](https://webkit.org/webkit-on-windows/).
88+
89+
## Running WebKit
90+
91+
### With Safari and Other macOS Applications
92+
93+
Run the following command to launch Safari with your local build of WebKit:
94+
95+
```
96+
Tools/Scripts/run-safari --debug
97+
```
98+
99+
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`.
100+
101+
To run other applications with your local build of WebKit, run the following command:
102+
103+
```
104+
Tools/Scripts/run-webkit-app <application-path>
105+
```
106+
107+
### iOS Simulator
108+
109+
Run the following command to launch iOS simulator with your local build of WebKit:
110+
111+
```
112+
run-safari --debug --ios-simulator
113+
```
114+
115+
In both cases, if you have built release builds instead, use `--release` instead of `--debug`.
116+
117+
### Linux Ports
118+
119+
If you have a development build, you can use the run-minibrowser script, e.g.:
120+
121+
```
122+
run-minibrowser --debug --wpe
123+
```
124+
125+
Pass one of `--gtk`, `--jsc-only`, or `--wpe` to indicate the port to use.
126+
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Contributing Code to WebKit
2+
3+
WebKit has a rigorous code contribution process and policy in place to maintain the quality of code.
4+
5+
### Coding style
6+
7+
Code you write must follow WebKit’s [coding style guideline](https://webkit.org/contributing-code/#code-style-guidelines).
8+
You can run `Tools/Scripts/check-webkit-style` to check whether your code follows the coding guidelines or not
9+
(it can report false positives or false negatives).
10+
If you use `Tools/Scripts/webkit-patch upload` to upload your patch,
11+
it automatically runs the style checker against the code you changed so there is no need to run `check-webkit-style` separately.
12+
13+
Some older parts of the codebase do not follow these guidelines.
14+
If you are modifying such code, it is generally best to clean it up to comply with the current guidelines.
15+
16+
### Convenience Tools
17+
18+
`Tools/Scripts/webkit-patch` provides a lot of utility functions like applying the latest patch on [bugs.webkit.org](https://bugs.webkit.org/) (`apply-from-bug`)
19+
and uploading a patch (`upload --git-commit=<commit hash>`) to a [bugs.webkit.org](https://bugs.webkit.org/) bug.
20+
Use `--all-commands` to the list of all commands this tool supports.
21+
22+
### Regression Tests
23+
24+
Once you have made a code change, you need to run the aforementioned tests (layout tests, API tests, etc...)
25+
to make sure your code change doesn’t break existing functionality.
26+
These days, uploading a patch on [bugs.webkit.org](https://bugs.webkit.org/) triggers the Early Warning System (a.k.a. EWS)
27+
28+
For any bug fix or a feature addition, there should be a new test demonstrating the behavior change caused by the code change.
29+
If no such test can be written in a reasonable manner (e.g. the fix for a hard-to-reproduce race condition),
30+
then the reason writing a tests is impractical should be explained in the accompanying commit message.
31+
32+
Any patch which introduces new test failures or performance regressions may be reverted.
33+
It’s in your interest to wait for the Early Warning System to fully build and test your patch on all relevant platforms.
34+
35+
### Commit messages
36+
37+
Commit messages serve as change logs, providing historical documentation for all changes to the WebKit project.
38+
Running `git-webkit setup` configures your git hooks to properly generate commit messages.
39+
40+
The first line shall contain a short description of the commit message (this should be the same as the Summary field in Bugzilla).
41+
On the next line, enter the Bugzilla URL.
42+
Below the "Reviewed by" line, enter a detailed description of your changes.
43+
There will be a list of files and functions modified at the bottom of the commit message.
44+
You are encouraged to add comments here as well. (See the commit below for reference).
45+
Do not worry about the “Reviewed by NOBODY (OOPS!)” line, GitHub will update this field upon merging.
46+
47+
```
48+
Allow downsampling when invoking Remove Background or Copy Subject
49+
https://bugs.webkit.org/show_bug.cgi?id=242048
50+
51+
Reviewed by NOBODY (OOPS!).
52+
53+
Soft-link `vk_cgImageRemoveBackgroundWithDownsizing` from VisionKitCore, and call into it to perform
54+
background removal when performing Remove Background or Copy Subject, if available. On recent builds
55+
of Ventura and iOS 16, VisionKit will automatically reject hi-res (> 12MP) images from running
56+
through subject analysis; for clients such as WebKit, this new SPI allows us to opt into
57+
downsampling these large images, instead of failing outright.
58+
59+
* Source/WebCore/PAL/pal/cocoa/VisionKitCoreSoftLink.h:
60+
* Source/WebCore/PAL/pal/cocoa/VisionKitCoreSoftLink.mm:
61+
* Source/WebCore/PAL/pal/spi/cocoa/VisionKitCoreSPI.h:
62+
* Source/WebKit/Platform/cocoa/ImageAnalysisUtilities.h:
63+
* Source/WebKit/Platform/cocoa/ImageAnalysisUtilities.mm:
64+
(WebKit::requestBackgroundRemoval):
65+
66+
Refactor the code so that we call `vk_cgImageRemoveBackgroundWithDownsizing` if it's available, and
67+
otherwise fall back to `vk_cgImageRemoveBackground`.
68+
69+
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
70+
(-[WKContentView doAfterComputingImageAnalysisResultsForBackgroundRemoval:]):
71+
(-[WKContentView _completeImageAnalysisRequestForContextMenu:requestIdentifier:hasTextResults:]):
72+
(-[WKContentView imageAnalysisGestureDidTimeOut:]):
73+
* Source/WebKit/UIProcess/mac/WebContextMenuProxyMac.mm:
74+
(WebKit::WebContextMenuProxyMac::appendMarkupItemToControlledImageMenuIfNeeded):
75+
(WebKit::WebContextMenuProxyMac::getContextMenuFromItems):
76+
77+
Additionally, remove the `cropRect` completion handler argument, since the new SPI function no
78+
longer provides this information. The `cropRect` argument was also unused after removing support for
79+
revealing the subject, in `249582@main`.
80+
```
81+
82+
The “No new tests. (OOPS!)” line will appear if `git webkit commit` did not detect the addition of new tests.
83+
If your patch does not require test cases (or test cases are not possible), remove this line and explain why you didn’t write tests.
84+
Otherwise all changes require test cases which should be mentioned in the commit message.

0 commit comments

Comments
 (0)