Skip to content

Instantly share code, notes, and snippets.

View fdecampredon's full-sized avatar

François de Campredon fdecampredon

  • Fadio IT
  • Marseille
View GitHub Profile
@paulirish
paulirish / what-forces-layout.md
Last active May 24, 2024 19:16
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

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.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@fdecampredon
fdecampredon / gist:9687b27904d1eb25757a
Last active August 29, 2015 14:09
possible rx-react events integration
// in this first option events handlers are just RxJs functor Subject
// those subject are passed down to the render function and are manually injected into
// the properties of react component
var RxReact = require('rx-react');
var React = require('react');