SlideShare a Scribd company logo
1 of 135
@gregwhitworth
{the pipeline}
ComposePaintLayoutStyleDOM
Content
Parsing
Network
{the pipeline}@gregwhitworth
JS
ComposePaintLayoutStyleDOM
Content
Parsing
Network
@gregwhitworth {the pipeline}
JS
Input
ComposePaintLayoutStyleDOM
Content
Parsing
Network
@gregwhitworth {the pipeline}
JS
Input
ComposePaintLayoutStyleDOMNetwork
@gregwhitworth {the pipeline}
Content
Parsing
{parsing}
.fancy-button {
background: green;
border: 3px solid red;
font-size: 1em;
}
@gregwhitworth {style}
Selector
.fancy-button
.fancy-button {
background: green;
border: 3px solid red;
font-size: 1em;
}
@gregwhitworth {style}
Selector Property Value
.fancy-button background-color rgb(0,255,0)
@gregwhitworth {style}
Selector Property Value
.fancy-button background-color rgb(0,255,0)
.fancy-button border-size 3px
.fancy-button border-color rgb(255,0,0)
.fancy-button border-style solid
.fancy-button {
background: green;
border: 3px solid red;
font-size: 1em;
}
.fancy-button {
background: green;
border: 3px solid red;
font-size: 1em;
}
@gregwhitworth {style}
Selector Property Value
.fancy-button background-color rgb(0,255,0)
.fancy-button border-size 3px
.fancy-button border-color rgb(255,0,0)
.fancy-button border-style solid
.fancy-button font-size 1em
{style}
{style:terminology}
@gregwhitworth {style}
Declared: What the author wrote
Value Types
width: 506.456789132456489787px
@gregwhitworth {style}
Specified: Declared + defaults
Value Types
width: auto
@gregwhitworth {style}
Computed: Resolution of specified
Value Types
font-size: 1em16px
@gregwhitworth {style}
Used: Result of layout calculations
Value Types
width: 50%300px
@gregwhitworth {style}
Actual: UA specific adjustments
Value Types
width: 506.456789132456489787px506.45px
{style:computation}
DOM Tree
Collection of
styles
Collection of
styles
Collection of
styles
Matching
Algorithm
@gregwhitworth {style}
The User Agent should have
everything resolved except
what requires layout
@gregwhitworth {style}
width: 1in;
Before After
@gregwhitworth {style}
width: 50%;
height: calc(10px + 2em);
border-color: currentColor;
height: 50vh;
width: 96px;
width: 50%;
height: 42px;
border-color: rgb(0,255,0);
height: 540px;
{style:cascade}
A score awarded to a selector
based on the count of tags,
classes, id’s, !important, &
attribute selectors used
@gregwhitworth {style}
Specificity
Inline styles win out over all
selectors unless an !important
was used
@gregwhitworth {style}
Specificity
• !Important
• Style Attribute
• ID
• Classes, Psuedo Classes, attr
• Elements & Psuedo Elements
@gregwhitworth {style}
Specificity
li 0 0 0 0 1
@gregwhitworth {style}
li 0 0 0 0 1
li.foo 0 0 0 1 1
@gregwhitworth {style}
li 0 0 0 0 1
li.foo 0 0 0 1 1
#comment li.foo.bar 0 0 1 2 1
@gregwhitworth {style}
li 0 0 0 0 1
li.foo 0 0 0 1 1
#comment li.foo.bar 0 0 1 2 1
<li style=“color: red”> 0 1 0 0 0
@gregwhitworth {style}
li 0 0 0 0 1
li.foo 0 0 0 1 1
#comment li.foo.bar 0 0 1 2 1
<li style=“color: red”> 0 1 0 0 0
color: red !important 1 0 0 0 0
@gregwhitworth {style}
bit.ly/css-short-selectors
@gregwhitworth {style}
“Keep your CSS selectors short”
by Harry Roberts
An origin is what determines
where the stylesheet is placed
within the cascade
@gregwhitworth {style}
Style Origins
User Agent
Author
User
3 currently specified origins
@gregwhitworth {style}
: Renders CSS
: Web Developer
: Person using site
1. User
2. Author
3. User Agent
Ordering in the cascade
@gregwhitworth {style}
.fancy-button {
background: green;
border: 3px solid red;
font-size: 1em;
}
Origin Selector Property Value Specificity
Author .fancy-button background-color rgb(0,255,0) 0,0,0,1,0
Author .fancy-button border-style Solid 0,0,0,1,0
Author .fancy-button border-size 3px 0,0,0,1,0
Author .fancy-button border-color rgb(255,0,0) 0,0,0,1,0
Author .fancy-button font-size 16px 0,0,0,1,0
Author div .fancy-button background-color rgb(255,255,0) 0,0,0,1,1
User * font-size 25px 1,0,0,0,0
div .fancy-button {
background: yellow;
}
@gregwhitworth {style}
.fancy-button {
background: green;
border: 3px solid red;
font-size: 1em;
}
Origin Selector Property Value Specificity
User * font-size 25px 1,0,0,0,0
Author .fancy-button background-color rgb(0,255,0) 0,0,0,1,0
Author .fancy-button border-style Solid 0,0,0,1,0
Author .fancy-button border-size 3px 0,0,0,1,0
Author .fancy-button border-color rgb(255,0,0) 0,0,0,1,0
Author .fancy-button font-size 16px 0,0,0,1,0
Author div .fancy-button background-color rgb(255,255,0) 0,0,0,1,1
div .fancy-button {
background: yellow;
}
@gregwhitworth {style}
.fancy-button {
background: green;
border: 3px solid red;
font-size: 1em;
}
Origin Selector Property Value Specificity
User * font-size 25px 1,0,0,0,0
Author div .fancy-button background-color rgb(255,255,0) 0,0,0,1,1
Author .fancy-button background-color rgb(0,255,0) 0,0,0,1,0
Author .fancy-button border-style Solid 0,0,0,1,0
Author .fancy-button border-size 3px 0,0,0,1,0
Author .fancy-button border-color rgb(255,0,0) 0,0,0,1,0
Author .fancy-button font-size 16px 0,0,0,1,0
div .fancy-button {
background: yellow;
}
@gregwhitworth {style}
.fancy-button {
background: green;
border: 3px solid red;
font-size: 1em;
}
Origin Selector Property Value Specificity
User * font-size 25px 1,0,0,0,0
Author div .fancy-button background-color rgb(255,255,0) 0,0,0,1,1
Author .fancy-button background-color rgb(0,255,0) 0,0,0,1,0
Author .fancy-button border-style Solid 0,0,0,1,0
Author .fancy-button border-size 3px 0,0,0,1,0
Author .fancy-button border-color rgb(255,0,0) 0,0,0,1,0
Author .fancy-button font-size 16px 0,0,0,1,0
div .fancy-button {
background: yellow;
}
@gregwhitworth {style}
Property Value
border-style Solid
border-size 3px
border-color rgb(255,0,0)
background-color rgb(255,255,0)
font-size 25px
.fancy-button
@gregwhitworth {style}
{layout}
{layout:terminology}
Block formatting context (BFC)
Floats, absolutely positioned elements, block
containers (such as inline-blocks, table-cells, and
table-captions) that are not block boxes, and block
boxes with 'overflow' other than 'visible' (except
when that value has been propagated to the
viewport) establish new block formatting contexts
for their contents.
@gregwhitworth {layout}
Block formatting context (BFC)
@gregwhitworth {layout}
Absolute
Positioned Box
This box creates a
new BFC
Containing block
The ancestor block that styles
are resolved against
@gregwhitworth {layout}
http://bit.ly/containing-block
@gregwhitworth {layout}
W3C CSS 2.2 Definition of
Containing Block
Containing Block
@gregwhitworth {layout}
position: fixed
Initial Containing block (ICB)
A rectangle that is computed
based on the top-most box or
page box.
@gregwhitworth {layout}
Initial Containing Block (ICB)
@gregwhitworth {layout}
The red dashed
box is the ICB
@gregwhitworth {layout}
LTR/RTL Writing Mode
INLINE
DIRECTION
INLINE
DIRECTION
Vertical Writing Mode
@gregwhitworth {layout}
LTR/RTL Writing Mode
BLOCK
DIRECTION
BLOCK
DIRECTION
Vertical Writing Mode
Box Model
Padding Box
Content Box
Border Box
Margin Box
@gregwhitworth {layout}
{layout:flow}
The flow
You move in document order
laying out each child in the
direction of the boxes
writing mode
@gregwhitworth {layout}
Float
@gregwhitworth {layout}
<body>
<div> <p>
DOM Tree
float: left;
text
node
<p>
text
node
Float
@gregwhitworth {layout}
<body>
<div> <p>
DOM Tree
float: left;
text
node
<p>
text
node
Float
@gregwhitworth {layout}
<body>
<div> <p>
DOM Tree
float: left;
text
node
<p>
text
node
{layout:box generation}
For each element in the DOM
there will be 0 or more boxes
in the box tree
@gregwhitworth {layout}
<body>
<div> <div>
DOM Tree
CSS Box
CSS Box
Box Tree
CSS Box
@gregwhitworth {layout}
<body>
<div> <div>
visibility: hidden;
DOM Tree
@gregwhitworth {layout}
CSS Box
CSS Box
Box Tree
CSS Box
<body>
<div> <div>
display: none;
DOM Tree
CSS Box
CSS Box
Box Tree
@gregwhitworth {layout}
<body>
<div> <div>
DOM Tree
CSS Box
CSS Box
Box Tree
CSS Box
visibility: hidden;
@gregwhitworth {layout}
When necessary, boxes will be
generated that are not in the
DOM, these are known as
anonymous boxes
@gregwhitworth {layout}
<body>
<div>
display: table-cell;
DOM Tree
CSS Box
Table Box
Box Tree
Table Grid
Box
CSS Box
@gregwhitworth {layout}
{layout:basic}
<body>
<p>
Hello World
</p>
</body>
HTML CSS
body {
width: 50px;
}
Basic Example
@gregwhitworth {layout}
DOM Tree
Basic Example
<body>
<p>
width: 50px
text
node
Box Tree
CSS Box
CSS Box
Line Box Line Box
Why are there 2 line boxes for
the 1 text node?
@gregwhitworth {layout}
Basic Example
Box Tree
CSS Box width: 50px
@gregwhitworth {layout}
<body>
Basic Example
Box Tree
CSS Box
CSS Box
@gregwhitworth {layout}
<body>
<p>
Basic Example
Box Tree
CSS Box
CSS Box
Line Box
Hello World
@gregwhitworth {layout}
<body>
<p>
Basic Example
Box Tree
CSS Box
CSS Box
Line Box
Hello World
@gregwhitworth {layout}
<body>
<p>
Basic Example
Box Tree
CSS Box
CSS Box
Line Box
Hello
World
Line Box
@gregwhitworth {layout}
<body>
<p>
{layout:content measure}
When your your inline
dimensions depends on its
contents.
Shrink-to-fit Context
@gregwhitworth {layout}
Lorem ipsum dolor sit
amet, consectetur ad
adipiscing elit. Nullam pellentesq
SHARE IT
@gregwhitworth {layout}
<article>
<button>
SHARE IT
</button>
<p>
Lorem ipsum dolor sit amet,
consectetur adipiscing elit. Nullam
pellentesq
</p>
</article>
HTML
CSS
article {
min-width: 400px;
max-width: 800px;
background: rgb(191,191,191);
padding: 5px;
}
button {
float: left;
background: orange;
padding: 3px 10px;
border: 2px solid blue;
margin: 5px;
}
p {margin: 0;}
@gregwhitworth {layout}
DOM Tree
<article>
<button> <p>
Box Tree
Text
node
Text
node
CSS Box
CSS Box CSS Box
Line Box LB LB LB
@gregwhitworth {layout}
min-width: 400px
max-width: 800px
padding: 5px
Box Tree
CSS Box
@gregwhitworth {layout}
<article>
Box Tree
CSS Box
CSS Box
Line Box
float: left
@gregwhitworth {layout}
<article>
<button>
Box Tree
CSS Box
Line Box
float: left
background: orange
padding: 3px 10px;
border: 2px solid blue;
margin: 5px;
@gregwhitworth {layout}
Box Tree
CSS Box
Line Box
SHARE IT
@gregwhitworth {layout}
Max Width
SHARE
IT
Min Width
115px
86px
Box Tree
CSS Box
CSS Box
Line Box
SHARE IT
@gregwhitworth {layout}
<article>
<button>
Box Tree
CSS Box
CSS Box CSS Box
Line Box Line Box
SHARE IT
@gregwhitworth {layout}
<article>
<button> <p>
Box Tree
CSS Box
CSS Box CSS Box
Line Box Line Box
@gregwhitworth {layout}
Lorem ipsum dolor sit
SHARE IT
amet, consectetur adi
<article>
<button> <p>
Box Tree
CSS Box
CSS Box CSS Box
Line Box LB LB
@gregwhitworth {layout}
Lorem ipsum dolor sit
amet, consectetur
SHARE IT
adipiscing elit. Nullam pell<article>
<button> <p>
Box Tree
CSS Box
CSS Box CSS Box
Line Box LB LB LB
@gregwhitworth {layout}
Lorem ipsum dolor sit
amet, consectetur
adipiscing elit. Nullam pellentesq
SHARE IT
<article>
<button> <p>
{layout:fragmentation}
A box—such as a page box,
column box, or region—that
contains a portion (or all) of a
fragmented flow.
Fragmentainer
@gregwhitworth {layout}
<body>
<div>
Lorem ipsum dolor sit amet,
consectetur adipiscing elit. Cras nibh
orci, tincidunt eget enim et,
pellentesque condimentum risus. Aenean
sollicitudin risus velit, quis tempor
leo malesuada vel. Donec consequat
aliquet mauris. Vestibulum ante ipsum
primis in faucibus
</div>
</body>
HTML
CSS
div {
columns: 2;
column-fill: auto;
height: 300px;
}
@gregwhitworth {layout}
velit, quis tempor leo
malesuada vel. Donec
consequat aliquet mauris.
Vestibulum ante ipsum primis
in faucibus
Lorem ipsum dolor sit amet,
consectetur adipiscing elit. Cras
nibh orci, tincidunt eget enim et,
pellentesque condimentum risus.
Aenean sollicitudin risus
@gregwhitworth {layout}
DOM Tree
<body>
<div>
Text
node
Box Tree
CSS Box
MultiCol
Box
CSS Box
LB LB LB
LBLB LB
CSS Box
LB LB LB
LB LB
Box Tree
CSS Box
@gregwhitworth {layout}
<body>
Box Tree
CSS Box
MultiCol
Box
@gregwhitworth {layout}
<body>
<div>
columns: 2
column-fill: auto;
height: 300px
Box Tree
CSS Box
MultiCol
Box
CSS Box
@gregwhitworth {layout}
Fragmentainer created
<body>
<div>
columns: 2
column-fill: auto;
height: 300px
Box Tree
CSS Box
MultiCol
Box
CSS Box
@gregwhitworth {layout}
Lorem ipsum dolor sit amet,
consectetur adipiscing elit. Cras
nibh orci, tincidunt eget enim et,
pellentesque condimentum risus.
Aenean sollicitudin risus
LB LB LB
LB LB
<body>
<div>
columns: 2
column-fill: auto;
height: 300px
Box Tree
CSS Box
MultiCol
Box
CSS Box
@gregwhitworth {layout}
LB LB LB
LBLB LB
CSS Box
<body>
<div>
Lorem ipsum dolor sit amet,
consectetur adipiscing elit. Cras
nibh orci, tincidunt eget enim et,
pellentesque condimentum risus.
Aenean sollicitudin risus
columns: 2
column-fill: auto;
height: 300px
@gregwhitworth {layout}
velit, quis tempor leo
malesuada vel. Donec
consequat aliquet mauris.
Vestibulum ante ipsum primis
in faucibus
Box Tree
CSS Box
MultiCol
Box
CSS Box
columns: 2
column-fill: auto;
height: 300px
LB LB LB
LBLB LB
CSS Box
LB LB LB
LB LB
<body>
<div>
Lorem ipsum dolor sit amet,
consectetur adipiscing elit. Cras
nibh orci, tincidunt eget enim et,
pellentesque condimentum risus.
Aenean sollicitudin risus
{paint}
@gregwhitworth {paint}
SHARE IT
@gregwhitworth {paint}
Step 1: Paint the elements background
@gregwhitworth {paint}
Step 2: Paint the element’s border
@gregwhitworth {paint}
Step 3: Paint the element’s content
@gregwhitworth {paint}
SHARE IT
Stacking Context (SC)
The order in which the
rendering tree is painted onto
the canvas is described by
stacking contexts
@gregwhitworth {paint}
Stacking Context (SC)
Stacking context layers
Actually it
sort of does
though?
@gregwhitworth {paint}
Stacking Context (SC)
¯_(ツ)_/¯
@gregwhitworth {paint}
@gregwhitworth {paint}
<body>
<div id="one">
Item 1
</div>
<div id="two">
Item 2
</div>
</body>
HTML CSS
div {
width: 300px;
height: 300px;
position: absolute;
background: blue;
z-index: 2;
}
#two {
background: green;
z-index: 1;
}
Box Tree
CSS Box
CSS Box CSS Box
Line Box
@gregwhitworth {paint}
Line Box
Item 1
Root Stacking Context
Stacking Context
<body>
<div> <div>
z-index: 2; z-index: 1;
Box Tree
CSS Box
CSS Box CSS Box
Line Box
@gregwhitworth {paint}
Line Box
Root Stacking Context
Stacking Context
z-index: 2; z-index: 1;
<body>
<div> <div>
Box Tree
CSS Box
CSS Box CSS Box
Line Box
@gregwhitworth {paint}
Line Box
Root Stacking Context
Stacking Context
z-index: 2; z-index: 1;
<body>
<div> <div>
Box Tree
CSS Box
CSS Box CSS Box
Line Box
@gregwhitworth {paint}
Line Box
Root Stacking Context
Item 2
Stacking Context
z-index: 2; z-index: 1;
<body>
<div> <div>
Box Tree
CSS Box
CSS Box CSS Box
Line Box
@gregwhitworth {paint}
Line Box
Root Stacking Context
Item 2
Stacking Context
z-index: 2; z-index: 1;
<body>
<div> <div>
Box Tree
CSS Box
CSS Box CSS Box
Line Box
@gregwhitworth {paint}
Line Box
Root Stacking Context
Item 1
Stacking Context
z-index: 2; z-index: 1;
<body>
<div> <div>
{paint:bounds}
<div></div>
HTML
CSS
div {
width: 400px;
height: 400px;
background: red;
box-shadow: black 20px 20px;
}
@gregwhitworth {paint}
Box Tree
CSS Box
width: 400px
height: 400px
box-shadow: black 20px 20px
Display Node
Disp Node
width: 420px
height: 420px
420px
420px
@gregwhitworth {paint}
{compose}
@gregwhitworth {compose}
Large Heading
@gregwhitworth {paint}
<div class="clippy">
</div>
HTML CSS
.clippy {
width: 100px;
height: 100px;
animation: pulse 1s infinite;
background: green;
}
@keyframes pulse {
0% {
transform: scale(1, 1);
}
50% {
transform: scale(2, 2)
}
100% {
transform: scale(1, 1);
}
}
@gregwhitworth {compose}
Large Heading
Root Composite Layer
@gregwhitworth {compose}
Large Heading
@gregwhitworth {compose}
Large Heading
{invalidation}
ComposeDOM
Content
Parsing
Network Style Layout Paint
JS
Input
@gregwhitworth {invalidation}
SHARE IT
CSS
button {
float: left;
background: orange;
padding: 3px 10px;
border: 2px solid blue;
}
button:hover {
background: green;
color: white;
}
@gregwhitworth {invalidation}
Hit Testing
Algorithm
Mouse
movement
Box Tree
button:hoverSHARE ITCompose
@gregwhitworth {invalidation}
Mouse move
ComposePaintLayoutStyleDOM
Content
Parsing
Network
Hit Testing
Algorithm
@gregwhitworth {invalidation}
@gregwhitworth {paint}
var moved = 0;
var tooFar = 500;
function move(el) {
if(moved <= tooFar) {
moved++;
el.style.marginLeft = moved + "px";
}
}
JS
@gregwhitworth {paint}
var moved = 0;
var tooFar = 500;
function move(el) {
if(moved <= tooFar) {
moved++;
el.style.marginLeft = moved + "px";
}
}
JS
@gregwhitworth {invalidation}
ComposePaintLayoutStyleDOM
Content
Parsing
Network
JS
@gregwhitworth {paint}
#move {
width: 300px;
height: 300px;
background: blue;
animation: move 1s;
}
@keyframes {
to {
transform: translateX(500px);
}
}
CSS
@gregwhitworth {invalidation}
ComposePaintLayoutStyleDOM
Content
Parsing
Network
{questions}
@gregwhitworth {questions}

More Related Content

What's hot

Terms of endearment - the ElasticSearch Query DSL explained
Terms of endearment - the ElasticSearch Query DSL explainedTerms of endearment - the ElasticSearch Query DSL explained
Terms of endearment - the ElasticSearch Query DSL explainedclintongormley
 
Programming Haskell Chapter8
Programming Haskell Chapter8Programming Haskell Chapter8
Programming Haskell Chapter8Kousuke Ruichi
 
Using Regular Expressions and Staying Sane
Using Regular Expressions and Staying SaneUsing Regular Expressions and Staying Sane
Using Regular Expressions and Staying SaneCarl Brown
 
The Ring programming language version 1.9 book - Part 52 of 210
The Ring programming language version 1.9 book - Part 52 of 210The Ring programming language version 1.9 book - Part 52 of 210
The Ring programming language version 1.9 book - Part 52 of 210Mahmoud Samir Fayed
 
Css+tutorial+in+bangla
Css+tutorial+in+banglaCss+tutorial+in+bangla
Css+tutorial+in+banglajessicaemily
 
The Ring programming language version 1.5.2 book - Part 42 of 181
The Ring programming language version 1.5.2 book - Part 42 of 181The Ring programming language version 1.5.2 book - Part 42 of 181
The Ring programming language version 1.5.2 book - Part 42 of 181Mahmoud Samir Fayed
 
Postgres is easier
Postgres is easierPostgres is easier
Postgres is easiergisborne
 
Chirp 2010: Too many secrets, but never enough: OAuth at Twitter
Chirp 2010: Too many secrets, but never enough: OAuth at TwitterChirp 2010: Too many secrets, but never enough: OAuth at Twitter
Chirp 2010: Too many secrets, but never enough: OAuth at TwitterTaylor Singletary
 
Compass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS DeveloperCompass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS DeveloperWynn Netherland
 
Normas apa y derechos de autor piktochart backup data (1)
Normas apa y derechos de autor   piktochart backup data (1)Normas apa y derechos de autor   piktochart backup data (1)
Normas apa y derechos de autor piktochart backup data (1)000409123
 
MongoDB .local Toronto 2019: Tips and Tricks for Effective Indexing
MongoDB .local Toronto 2019: Tips and Tricks for Effective IndexingMongoDB .local Toronto 2019: Tips and Tricks for Effective Indexing
MongoDB .local Toronto 2019: Tips and Tricks for Effective IndexingMongoDB
 
Data Exploration with Elasticsearch
Data Exploration with ElasticsearchData Exploration with Elasticsearch
Data Exploration with ElasticsearchAleksander Stensby
 
The Ring programming language version 1.2 book - Part 33 of 84
The Ring programming language version 1.2 book - Part 33 of 84The Ring programming language version 1.2 book - Part 33 of 84
The Ring programming language version 1.2 book - Part 33 of 84Mahmoud Samir Fayed
 
Doctype html publi
Doctype html publiDoctype html publi
Doctype html publiEddy_TKJ
 
Google Developers Experts Summit 2017 - CSS Layout
Google Developers Experts Summit 2017 - CSS Layout Google Developers Experts Summit 2017 - CSS Layout
Google Developers Experts Summit 2017 - CSS Layout Rachel Andrew
 
Round pegs and square holes
Round pegs and square holesRound pegs and square holes
Round pegs and square holesDaniel Greenfeld
 
The Ring programming language version 1.5.1 book - Part 41 of 180
The Ring programming language version 1.5.1 book - Part 41 of 180The Ring programming language version 1.5.1 book - Part 41 of 180
The Ring programming language version 1.5.1 book - Part 41 of 180Mahmoud Samir Fayed
 

What's hot (20)

Terms of endearment - the ElasticSearch Query DSL explained
Terms of endearment - the ElasticSearch Query DSL explainedTerms of endearment - the ElasticSearch Query DSL explained
Terms of endearment - the ElasticSearch Query DSL explained
 
Programming Haskell Chapter8
Programming Haskell Chapter8Programming Haskell Chapter8
Programming Haskell Chapter8
 
Using Regular Expressions and Staying Sane
Using Regular Expressions and Staying SaneUsing Regular Expressions and Staying Sane
Using Regular Expressions and Staying Sane
 
The Ring programming language version 1.9 book - Part 52 of 210
The Ring programming language version 1.9 book - Part 52 of 210The Ring programming language version 1.9 book - Part 52 of 210
The Ring programming language version 1.9 book - Part 52 of 210
 
Css+tutorial+in+bangla
Css+tutorial+in+banglaCss+tutorial+in+bangla
Css+tutorial+in+bangla
 
Speeding up Red Team engagements with carnivorall
Speeding up Red Team engagements with carnivorallSpeeding up Red Team engagements with carnivorall
Speeding up Red Team engagements with carnivorall
 
The Ring programming language version 1.5.2 book - Part 42 of 181
The Ring programming language version 1.5.2 book - Part 42 of 181The Ring programming language version 1.5.2 book - Part 42 of 181
The Ring programming language version 1.5.2 book - Part 42 of 181
 
Postgres is easier
Postgres is easierPostgres is easier
Postgres is easier
 
Chirp 2010: Too many secrets, but never enough: OAuth at Twitter
Chirp 2010: Too many secrets, but never enough: OAuth at TwitterChirp 2010: Too many secrets, but never enough: OAuth at Twitter
Chirp 2010: Too many secrets, but never enough: OAuth at Twitter
 
Compass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS DeveloperCompass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS Developer
 
Normas apa y derechos de autor piktochart backup data (1)
Normas apa y derechos de autor   piktochart backup data (1)Normas apa y derechos de autor   piktochart backup data (1)
Normas apa y derechos de autor piktochart backup data (1)
 
MongoDB .local Toronto 2019: Tips and Tricks for Effective Indexing
MongoDB .local Toronto 2019: Tips and Tricks for Effective IndexingMongoDB .local Toronto 2019: Tips and Tricks for Effective Indexing
MongoDB .local Toronto 2019: Tips and Tricks for Effective Indexing
 
Data Exploration with Elasticsearch
Data Exploration with ElasticsearchData Exploration with Elasticsearch
Data Exploration with Elasticsearch
 
The Ring programming language version 1.2 book - Part 33 of 84
The Ring programming language version 1.2 book - Part 33 of 84The Ring programming language version 1.2 book - Part 33 of 84
The Ring programming language version 1.2 book - Part 33 of 84
 
Data exchange formats
Data exchange formatsData exchange formats
Data exchange formats
 
Doctype html publi
Doctype html publiDoctype html publi
Doctype html publi
 
Elastic tire demo
Elastic tire demoElastic tire demo
Elastic tire demo
 
Google Developers Experts Summit 2017 - CSS Layout
Google Developers Experts Summit 2017 - CSS Layout Google Developers Experts Summit 2017 - CSS Layout
Google Developers Experts Summit 2017 - CSS Layout
 
Round pegs and square holes
Round pegs and square holesRound pegs and square holes
Round pegs and square holes
 
The Ring programming language version 1.5.1 book - Part 41 of 180
The Ring programming language version 1.5.1 book - Part 41 of 180The Ring programming language version 1.5.1 book - Part 41 of 180
The Ring programming language version 1.5.1 book - Part 41 of 180
 

Similar to The CSS rendering pipeline explained

CSS Dev Conf - Braces to Pixels
CSS Dev Conf - Braces to PixelsCSS Dev Conf - Braces to Pixels
CSS Dev Conf - Braces to PixelsGreg Whitworth
 
CSSO – compress CSS (english version)
CSSO – compress CSS (english version)CSSO – compress CSS (english version)
CSSO – compress CSS (english version)Roman Dvornov
 
Implementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 WorkshopImplementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 WorkshopShoshi Roberts
 
CSS for Developers
CSS for DevelopersCSS for Developers
CSS for DevelopersNascenia IT
 
Solving CSS Problems With eCSStender - An Event Apart - Chicago 2009
Solving CSS Problems With eCSStender - An Event Apart - Chicago 2009Solving CSS Problems With eCSStender - An Event Apart - Chicago 2009
Solving CSS Problems With eCSStender - An Event Apart - Chicago 2009Aaron Gustafson
 
Beyond CSS Architecture
Beyond CSS ArchitectureBeyond CSS Architecture
Beyond CSS Architecture拓樹 谷
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3 Wynn Netherland
 
CSS- Smacss Design Rule
CSS- Smacss Design RuleCSS- Smacss Design Rule
CSS- Smacss Design Rule皮馬 頑
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & CompassRob Davarnia
 
Even faster web sites presentation 3
Even faster web sites presentation 3Even faster web sites presentation 3
Even faster web sites presentation 3Felipe Lavín
 
HTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptHTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptraghavanp4
 
Introduction to css by programmerblog.net
Introduction to css by programmerblog.netIntroduction to css by programmerblog.net
Introduction to css by programmerblog.netProgrammer Blog
 
Learn to love CSS3 | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day DeutschlandLearn to love CSS3 | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day DeutschlandThemePartner
 
CSS3: Ripe and Ready
CSS3: Ripe and ReadyCSS3: Ripe and Ready
CSS3: Ripe and ReadyDenise Jacobs
 
Web Design Fundamentals
Web Design FundamentalsWeb Design Fundamentals
Web Design FundamentalsAhmed Faris
 
Learn to Love CSS3 [English]
Learn to Love CSS3 [English]Learn to Love CSS3 [English]
Learn to Love CSS3 [English]ThemePartner
 

Similar to The CSS rendering pipeline explained (20)

CSS Dev Conf - Braces to Pixels
CSS Dev Conf - Braces to PixelsCSS Dev Conf - Braces to Pixels
CSS Dev Conf - Braces to Pixels
 
CSSO – compress CSS (english version)
CSSO – compress CSS (english version)CSSO – compress CSS (english version)
CSSO – compress CSS (english version)
 
Implementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 WorkshopImplementing Awesome: An HTML5/CSS3 Workshop
Implementing Awesome: An HTML5/CSS3 Workshop
 
CSS for Developers
CSS for DevelopersCSS for Developers
CSS for Developers
 
Solving CSS Problems With eCSStender - An Event Apart - Chicago 2009
Solving CSS Problems With eCSStender - An Event Apart - Chicago 2009Solving CSS Problems With eCSStender - An Event Apart - Chicago 2009
Solving CSS Problems With eCSStender - An Event Apart - Chicago 2009
 
Web - CSS 1.pptx
Web - CSS 1.pptxWeb - CSS 1.pptx
Web - CSS 1.pptx
 
Beyond CSS Architecture
Beyond CSS ArchitectureBeyond CSS Architecture
Beyond CSS Architecture
 
Big Design Conference: CSS3
Big Design Conference: CSS3 Big Design Conference: CSS3
Big Design Conference: CSS3
 
CSS- Smacss Design Rule
CSS- Smacss Design RuleCSS- Smacss Design Rule
CSS- Smacss Design Rule
 
Getting Started with Sass & Compass
Getting Started with Sass & CompassGetting Started with Sass & Compass
Getting Started with Sass & Compass
 
Even faster web sites presentation 3
Even faster web sites presentation 3Even faster web sites presentation 3
Even faster web sites presentation 3
 
HTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.pptHTML Web Devlopment presentation css.ppt
HTML Web Devlopment presentation css.ppt
 
css.ppt
css.pptcss.ppt
css.ppt
 
css.ppt
css.pptcss.ppt
css.ppt
 
Introduction to css by programmerblog.net
Introduction to css by programmerblog.netIntroduction to css by programmerblog.net
Introduction to css by programmerblog.net
 
Learn to love CSS3 | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day DeutschlandLearn to love CSS3 | Joomla! Day Deutschland
Learn to love CSS3 | Joomla! Day Deutschland
 
CSS3: Ripe and Ready
CSS3: Ripe and ReadyCSS3: Ripe and Ready
CSS3: Ripe and Ready
 
Web Design Fundamentals
Web Design FundamentalsWeb Design Fundamentals
Web Design Fundamentals
 
Accelerated Stylesheets
Accelerated StylesheetsAccelerated Stylesheets
Accelerated Stylesheets
 
Learn to Love CSS3 [English]
Learn to Love CSS3 [English]Learn to Love CSS3 [English]
Learn to Love CSS3 [English]
 

Recently uploaded

Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineeringssuserb3a23b
 

Recently uploaded (20)

Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Odoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting ServiceOdoo Development Company in India | Devintelle Consulting Service
Odoo Development Company in India | Devintelle Consulting Service
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Software Coding for software engineering
Software Coding for software engineeringSoftware Coding for software engineering
Software Coding for software engineering
 

The CSS rendering pipeline explained

Editor's Notes

  1. Work on layout, we handle the CSS parsing, cascade and then creation of the box tree
  2. Goals: Understand the rendering pipeline and how your CSS can impact it Help when investigating issues with your layout Aid in building more performant pages by understanding how various approaches impact the pipeline
  3. Niels covered DOM tree creation yesterday during HTML day, so we’ll just stick to the CSS specific stuff
  4. Selector
  5. Selector
  6. Selector
  7. Selector
  8. For types that take type value-percentage you should only have auto, %, px
  9. a BFC understands how to position its children and its geometry is not affected by floats
  10. (ex: Floats, absolute position, table cells, flex & grid items)
  11. In order to know how big this box is, and to proceed with laying out the rest of the tree which requires the inline content to flow around that of the float, we need to measure the box with that of its content.
  12. We do a content measure pass by doing layout in unconstrained space.
  13. After the content measurement is done, the item is laid out using this information, but within the available space of that of its containing block. Since this is a float, we pass the space that is taken up by the float to that of its parent. This is done so the other inline content can take this into account when its their turn to lay out.
  14. We pass in the geometry of the exclusion area taken up by the float. This is done so the other inline content can take this geometry into account and flow around the float.
  15. The inline origin of this line box starts at the end of the inline end position of the float. Then it lays out as much text as it can, then backtracks – just like in our Hello World example.
  16. a positioned element with a z-index with a value other than auto or for example using opacity. Additionally there are partial stacking contexts, but we won’t be going into that today.
  17. The purpose of compositing is to take multiple composition layers that are filled with painted scenes and combine them into one.
  18. This slide shows the example of the animation
  19. Example CSS to achieve the pulsing effect
  20. Based on various heuristics, Clippy here is promoted to its own composite layer.
  21. So what does that mean to have it’s own layer, looking back at the rendering pipeline what paint produces is actually two images, rather than one. Both are placed into GPU memory
  22. Then compositing combines them together into one image
  23. Quick Question, What is at coordinate x: 45px y:75px?
  24. Quick Question, What is at coordinate x: 45px y:75px?
  25. Example CSS to achieve the pulsing effect
  26. Example CSS to achieve the pulsing effect
  27. Quick Question, What is at coordinate x: 45px y:75px?
  28. Example CSS to achieve the pulsing effect
  29. Quick Question, What is at coordinate x: 45px y:75px?