Rails Girls London - 19th-20th April 2013
.
|____home
| |____despo
<html> | |
<head> | |
<title>Marquee Fishtank</title> | |
<style> | |
#fishtank { | |
width: 350px; | |
background-color: aqua; | |
} | |
#fish1 { color: red } | |
#fish2 { color: orange } |
license: gpl-3.0 |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
NOTE: This is no longer an experiment! You can use the accessibility inspector in Chrome Devtools now, including a fantastic color contrast inspection tool. Read more: https://developers.google.com/web/updates/2018/01/devtools#a11y
Just like any good element inspector helps you debug styles, accessibility inspection in the browser can help you debug HTML and ARIA exposed for assistive technologies such as screen readers. There's a similar tool in Safari (and reportedly one in Edge) but I like the Chrome one best.
As an internal Chrome experiment, this tool differs from the Accessibility Developer Tools extension in that it has privileged Accessibility API access and reports more information as a result. You can still use the audit feature in the Chrome Accessibility Developer Tools, or you could use the aXe Chrome extension. :)
To enable the accessibility inspector in Chrome stable:
import SwiftUI | |
@main | |
struct MenuBarApp: App { | |
@NSApplicationDelegateAdaptor(StatusBarDelegate.self) var appDelegate | |
var body: some Scene { | |
WindowGroup { | |
ContentView() |