-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
428b03c
commit e52b74e
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
date: 2024-06-11 | ||
authors: Patrick Brosset | ||
title: Highlight areas that the browser engine re-paints | ||
tags: ["tip", "perf", "highlighter", "browser:edge", "browser:chrome", "browser:safari"] | ||
--- | ||
|
||
When you scroll through a webpage, or when parts of the webpage change, the browser engine sometimes needs to repaint parts of the page. The process of converting the layout and style information into pixels on the screen is specific to each browser engine, but it can be quite expensive in terms of performance, especially when the repainted areas are large and when repaints occur often. | ||
|
||
Use **Paint flashing** in DevTools if you suspect that your webpage is slow because of frequent and large repaints. **Paint flashing** highlights the areas of the webpage that the browser engine repaints, making it possible for you to visually identify the problematic areas. | ||
|
||
**Warning**: using **Paint flashing** may not be suitable for people prone to photosensitive epilepsy. | ||
|
||
## In Chrome and Edge | ||
|
||
1. Open DevTools. | ||
1. Open the **Rendering** tool. | ||
1. Select the **Paint flashing** checkbox. | ||
1. Interact with the webpage to see the areas that the browser engine repaints. | ||
|
||
As the browser engine repaints areas of the page, these areas get highlighted in a different color: | ||
|
||
![Paint flashing in Edge](../../assets/img/highlighted-repainted-areas.png) | ||
|
||
## In Safari | ||
|
||
1. Open the Web Inspector. | ||
1. Go to the **Elements** tool. | ||
1. Click the **Paint flashing** button in the toolbar. | ||
|
||
## In Firefox | ||
|
||
Unfortunately, Firefox no longer has a built-in paint flashing tool. This is due to the new rendering engine (WebRender) that Firefox uses, and which doesn't support paint flashing. See [Paint flashing DevTools for WebRender](https://bugzilla.mozilla.org/show_bug.cgi?id=1612922) on Bugzilla if you want to follow the updates on this feature. |