Skip to content

WebRender in Firefox

Markus Stange edited this page Oct 12, 2017 · 17 revisions

The process of updating WebRender

This process is described in README.webrende in mozilla-central.

Create a YAML testcase from an HTML testcase as rendered in Firefox

There is an environment variable for Firefox called ENABLE_WR_RECORDING which will cause Firefox to create binary recording files in the directory that you started Firefox from. These binary recordings can be converted into YAML frames using wrench.

  1. Start Firefox with ENABLE_WR_RECORDING=1, e.g.
    $ ENABLE_WR_RECORDING=1 mach run -P your-firefox-profile-that-has-webrender-enabled
  2. Open the website or testcase that you're interested in.
  3. Close Firefox.
  4. Locate the binary recording file. There's one per window, the filename has the pattern wr-record-<window number>.bin.
  5. Go to your clone of the webrender repository, or create a clone of it if you don't have one.
  6. Check out the revision of webrender that your Firefox is based on. This revision is recorded in the last line of gfx/doc/README.webrender in your Firefox checkout. (This is necessary because the binary recording format is unstable.)
  7. Go to the wrench directory in your webrender checkout, and run the following command:
$ cargo run --release -- --save yaml replay /path/to/wr-record-1.bin
  1. This might take a few minutes to compile.
  2. A window will open, and it will display the contents of the Firefox window that was recorded.
  3. Press the right arrow key until you see the frame that you're interested in. You can step forwards and backwards using the arrow keys (stepping backwards will show a warning).
  4. Press the escape key in order to close the wrench viewer, or step forwards until the end of the recording and watch wrench panic.
  5. Now there is a directory called yaml_frames inside the wrench directory that you're in. The yaml_frames directory contains one frame-<framenumber>.yml file per frame, and a res directory which contains image and font files.
  6. You can display just the frame that you care about using
$ cargo run --release -- show yaml_frames/frame-14.yaml
  1. If the frame is rendered with the wrong scale, try passing -p 1 or -p 2 to the command, e.g.
$ cargo run --release -- -p 1 show yaml_frames/frame-14.yaml
Clone this wiki locally