SlideShare a Scribd company logo
1 of 69
Download to read offline
WebKit!
                 how the web is rendered




Levi Weintraub
me

Intel->Apple->Microsoft->Palm->HP->Google


     on and off on WebKit since 2006


          adventure motorcyclist
me

Intel->Apple->Microsoft->Palm->HP->Google


      on and off on WebKit since 2006


          adventure motorcyclist
adventure motorcyclist
Hi Dad!




          adventure motorcyclist
rendering engine
browser




rendering engine
3 primary rendering engines
primary rendering engines

Trident
primary rendering engines

Trident




Internet Explorer
primary rendering engines

Trident                Gecko




Internet Explorer
primary rendering engines

Trident                Gecko




Internet Explorer       Firefox
primary rendering engines

Trident                Gecko        WebKit




Internet Explorer       Firefox
primary rendering engines

Trident                Gecko           WebKit




Internet Explorer       Firefox     Chrome, Safari, iOS,
                                   Android, Qt, Blackberry,
                                    webOS, Kindle, etc.
Gecko           WebKit

        FREE!
Gecko              WebKit

           FREE!



 Firefox           Chromium
over 38%1




  1: StatCounter's Global March 2012 http://gs.statcounter.com
history
KHTML + Konquerer
19
     98
          KH
                TM
                      Lr
                            ele
                                   as
20                                    ed
     01
          W
               eb
                    Kit
20                        se
     02                      c  ret
          Ja                          ly
               va                          for
                    Sc                           ke
20                    rip                             db
     03                        tC                         yA
          W                        ore                             pp
               eb
                    Co                     rel                       le
                                               ea
                          re                        se
                               &                         d
                                    Sa
20                                     fa    ri r
     05                                           ele
          W                                             as
               eb                                            ed
                    Kit
                          op
                                en
                                     so
20                                         urc
     07                                           ed
          Sa
                far
                     i fo
20                         rW
     08                            ind
        G      oo                        ow
                 gle                          s
20                        Ch
     09                         rom
        C      hro                      er
                    me                    ele
20                          Be                      as
     10                        ta                       ed
          KD                          for                      for
                E                            Ma                      W
                     re-                            cO                  ind
                                                                              ow
                          int                            S                       s
                               eg
                                     rat                       X
                                         e                         an
20                                          sW                          dL
     12                                             eb                    inu
          W                                              Kit                    x
               eb                                              -W
??                  Kit
     ?                    do                                     eb
                                                                          Kit
                                mi
                                    na                                        2a
Pr                                       nt                                         nn
  ofi                                         we                                      ou
         t!!                                        bp                                   nc
                                                         lat                               ed
                                                             f  orm
anatomy of a WebKit browser
Embedding Application     pushes WebKit to do work
                           handles user input
   WebKit (component)


        WebCore



JavaScript
                Platform
 Engine
WebKit-based browser

  WebKit (component)       interface between
                           rendering engine and
                           embedding application
        WebCore



JavaScript
                Platform
 Engine
WebKit-based browser

   WebKit (component)


        WebCore                   application logic
                           loading            painting
                           parsing            event handling
JavaScript                 layout             editing
                Platform
 Engine                    style resolution   javascript bindings
WebKit-based browser

   WebKit (component)


        WebCore



JavaScript
               Platform   network stack
 Engine
                          graphics library
                          font engine
                          native widgets
                          abstraction of native components
WebKit-based browser

     WebKit (component)


          WebCore



 JavaScript
                   Platform
   Engine



V8 or JavaScriptCore
parses and executes page logic
allows DOM manipulation
WebCore
primary data structures

parsing & interface:
   DOM tree
layout and rendering:
   render object tree
   style tree
   layer tree
   line box tree
main flow
network engine



loading


              parser
loader



         parsing


                   DOM tree
parsing                            JavaScript
                               I
                            AP
                       M
                     DO




          DOM tree
                      att
                         ac
                           h




                                   render tree
DOM tree

representation of document
document API
shadow DOM
DOM tree
markup                   DOM representation
<html>                   HTMLDocument
 <body>                   HTMLHTMLElement
  <div>                    HTMLBodyElement
    foo                     HTMLDivElement
    <span>                   Text("foo")
    bar                      HTMLSpanElement
    </span>                   Text("bar")
  </div>
 </body>
</html>
DOM tree                       style
           att
              ac
                h




                 render tree
OK!
render forest

render object tree
layer tree
inline box tree
style tree
render object tree

owned by DOM tree
only exists for rendered content
responsible for layout and paint
answers DOM API measurement requests
12 paint phases!

block background          child outlines
child block background    self outline
child block backgrounds   selection
float                     collapsed table borders
foreground                text clip
outline                   mask
render object tree

owned by DOM tree
only exists for rendered content
responsible for layout and paint
answers DOM API measurement requests
render object tree
DOM representation         render objects
HTMLBodyElement             RenderBlock
 HTMLDivElement              RenderBlock
  Text("foo")                 RenderText("foo")
  HTMLSpanElement             RenderInline
   Text("bar")                 RenderText("bar")
anonymous blocks
DOM representation      render objects
HTMLBodyElement          RenderBlock
 HTMLDivElement           RenderBlock
  Text("foo")              RenderBlock(anonymous)
  HTMLSpanElement           RenderText("foo")
   Text("bar")              RenderInline
  HTMLDivElement             RenderText("bar")
    Text("baz")            RenderBlock
                            RenderText("baz")
style tree

contains all computed style values for renderers
owned by render object tree
RenderObjects share RenderStyles
RenderStyles share data members
render layer tree

like helper class for rendering
used for <video>, <canvas> with WebGL,
positioned, transformed, transparent, masked,
clipped, scrollable, or reflected elements
establishes coordinate space and z-ordering
at least one per document, sparsely maps to
renderers
render layer structure
                                 negative z-index list


                                   RenderLaye
                                    RenderLaye
                                       r
                                       Render
                                         r
                                        Layers



         RenderLayer
                                 positive z-index list


                                   RenderLaye
                                    RenderLaye
                                       r
                                       Render
                                         r
                                        Layers

         RenderObject



RenderObject      RenderObject
render layer painting
                                 negative z-index list


                                   RenderLaye
                                    RenderLaye
                                       r
                                       Render
                                         r
                                        Layers
                          1
         RenderLayer
                                 positive z-index list


                                   RenderLaye
                                    RenderLaye
                                       r
                                       Render
                                         r
                                        Layers

         RenderObject



RenderObject      RenderObject
render layer painting
                                  negative z-index list


                                    RenderLaye
                                     RenderLaye
                                        r
                                        Render
                                          r
                                         Layers
               2

         RenderLayer
                                  positive z-index list


                                    RenderLaye
                                     RenderLaye
                                        r
                                        Render
                                          r
                                         Layers

         RenderObject



RenderObject       RenderObject
render layer painting
                                 negative z-index list


                                   RenderLaye
                                    RenderLaye
                                       r
                                       Render
                                         r
                                        Layers



         RenderLayer      3
                                 positive z-index list


                                   RenderLaye
                                    RenderLaye
                                       r
                                       Render
                                         r
                                        Layers

         RenderObject



RenderObject      RenderObject
render layer painting, software

paint the intersection of the paint dirty rect with
all intersecting layers in order
all layers render into the same output buffer
render layer painting, hw accelerated

some RenderLayers have backing store GPU
texture
used for 3D transforms, <video>, <canvas>/
plugins with 3D, stacking contexts, or sub-
frames
dirtied RenderLayers paint to GPU texture
GPU composites textures onto final output
buffer
line box tree

owned by RenderBlock
one RootInlineBox per line
RootInlineBox has list of InlineBoxes in that line
each InlineBox has a RenderObject
a renderer may have many InlineBoxes
relies on RenderBlock for layout
line box tree
            Markup: <div>foo<b>bar</b><br>baz</div>

render tree                               line box tree
RenderBlock(div)                            RenderBlock(div)
 RenderText("foo")                           RootInlineBox
 RenderInline(b)                              InlineTextBox("foo")
  RenderText("bar")                           InlineFlowBox(b)
 RenderBR                                      InlineTextBox(b)
 RenderText("baz")                            InlineBox(br)
                                             RootInlineBox
                                              InlineTextBox("baz")
layout

changes to DOM marks renderers as dirty
layout before paint or measurement from JS
●   save old repaint rect
●   bring in updates from DOM
●   determine our preferred width
●   layout children to determine height
●   repaint difference between old and new rect
layout

changes to DOM marks renderers as dirty
layout before paint or measurement from JS
●   save old repaint rect
●   bring in updates from DOM
●   determine our preferred width
●   layout children to determine height
●   repaint difference between old and new rect
review of main flow

loader->parser->DOM tree->render tree
render tree:
●   RenderObject tree
●   RenderLayer tree
●   RenderStyle tree
●   InlineBoxTree
paint

animations, blinking carets, layout, etc. trigger
invalidations to embedder app
app collects rects, triggers paint
tree walk from root RenderLayer
RenderObjects and InlineBoxes paint
GraphicsContext abstraction
hit testing

constant during mouse move
multiple phases
tree walk from root RenderLayer
RenderLayer transforms into local coordinates
upcoming features

component model
sub-pixel layout
lots lots more
component model

based on shadow DOM
hides implementation
●   events re-targeted
●   shadow children inaccessible by regular
    DOM
defined interface
shadow DOM tree




                                       shadow boundary
   Do
     cu
        m
            en
              tt
                 re
                   e


             shadow host                                            shadow root




DOM child                  DOM child                     shadow child         shadow child
shadow render tree
       re
          nde
              rt
                re
                   e



                   shadow host




  shadow child               shadow child
integer layout

layout currently uses integers
fractional pixel values truncated
breaks at non-1:1 zoom
error accumulates
1.5x zoom is bad




150px * 1.5x = 225px
(15px * 1.5x) * 10 = 220px
sub-pixel layout

integers replaced by fixed-point unit
boxes snapped to pixel values
supports sub-pixel CSS values
error doesn't accumulate
multi-process browsers

centralized resources
●   networking
●   cache
●   compositor
●   plugins
safety through sandboxing
multiple main loops ≈ multi-core
chrome architecture
        network stack   browser process      file io




   GPU process


                         plugin process
                          plugin processes



 shared memory

gles2.0 instructions
                                                   render
     textures
                                                 processes
thanks!

     questions?


     http://webkit.org
     http://chromium.org
     leviw@chromium.org


Levi Weintraub

More Related Content

What's hot

Deep Dive async/await in Unity with UniTask(EN)
Deep Dive async/await in Unity with UniTask(EN)Deep Dive async/await in Unity with UniTask(EN)
Deep Dive async/await in Unity with UniTask(EN)Yoshifumi Kawai
 
【Unite 2018 Tokyo】Unityにおける疎結合設計 ~UIへの適用事例から学ぶ、テクニックとメリット~
【Unite 2018 Tokyo】Unityにおける疎結合設計 ~UIへの適用事例から学ぶ、テクニックとメリット~【Unite 2018 Tokyo】Unityにおける疎結合設計 ~UIへの適用事例から学ぶ、テクニックとメリット~
【Unite 2018 Tokyo】Unityにおける疎結合設計 ~UIへの適用事例から学ぶ、テクニックとメリット~UnityTechnologiesJapan002
 
【CEDEC2018】一歩先のUnityでのパフォーマンス/メモリ計測、デバッグ術
【CEDEC2018】一歩先のUnityでのパフォーマンス/メモリ計測、デバッグ術【CEDEC2018】一歩先のUnityでのパフォーマンス/メモリ計測、デバッグ術
【CEDEC2018】一歩先のUnityでのパフォーマンス/メモリ計測、デバッグ術Unity Technologies Japan K.K.
 
New Features of DotNet 6 Blazor WASM
New Features of DotNet 6 Blazor WASMNew Features of DotNet 6 Blazor WASM
New Features of DotNet 6 Blazor WASMShotaro Suzuki
 
Unityによるリアルタイム通信とMagicOnionによるC#大統一理論の実現
Unityによるリアルタイム通信とMagicOnionによるC#大統一理論の実現Unityによるリアルタイム通信とMagicOnionによるC#大統一理論の実現
Unityによるリアルタイム通信とMagicOnionによるC#大統一理論の実現Yoshifumi Kawai
 
rsyncのちょっとイイ話
rsyncのちょっとイイ話rsyncのちょっとイイ話
rsyncのちょっとイイ話Kazuhiro Oinuma
 
高度に最適化された移植可能なメモリマネージャ
高度に最適化された移植可能なメモリマネージャ高度に最適化された移植可能なメモリマネージャ
高度に最適化された移植可能なメモリマネージャDADA246
 
板ポリだけで めちゃカッコいい グラフィックスを出す!
板ポリだけで めちゃカッコいい グラフィックスを出す!板ポリだけで めちゃカッコいい グラフィックスを出す!
板ポリだけで めちゃカッコいい グラフィックスを出す!notargs
 
Direct x 11 입문
Direct x 11 입문Direct x 11 입문
Direct x 11 입문Jin Woo Lee
 
リアルタイムなゲームの開発でコンテナを使ってみたら簡単便利で激安だったのでオススメしたい
リアルタイムなゲームの開発でコンテナを使ってみたら簡単便利で激安だったのでオススメしたいリアルタイムなゲームの開発でコンテナを使ってみたら簡単便利で激安だったのでオススメしたい
リアルタイムなゲームの開発でコンテナを使ってみたら簡単便利で激安だったのでオススメしたいYutoNishine
 
Let's build a simple app with .net 6 asp.net core web api, react, and elasti...
Let's build a simple app with  .net 6 asp.net core web api, react, and elasti...Let's build a simple app with  .net 6 asp.net core web api, react, and elasti...
Let's build a simple app with .net 6 asp.net core web api, react, and elasti...Shotaro Suzuki
 
OSC2011 Tokyo/Fall 濃いバナ(virtio)
OSC2011 Tokyo/Fall 濃いバナ(virtio)OSC2011 Tokyo/Fall 濃いバナ(virtio)
OSC2011 Tokyo/Fall 濃いバナ(virtio)Takeshi HASEGAWA
 
remote Docker over SSHが熱い
remote Docker over SSHが熱いremote Docker over SSHが熱い
remote Docker over SSHが熱いHiroyuki Ohnaka
 
実環境にTerraform導入したら驚いた
実環境にTerraform導入したら驚いた実環境にTerraform導入したら驚いた
実環境にTerraform導入したら驚いたAkihiro Kuwano
 
【Unity道場 建築スペシャル2】点群ビジュアライゼーション
【Unity道場 建築スペシャル2】点群ビジュアライゼーション【Unity道場 建築スペシャル2】点群ビジュアライゼーション
【Unity道場 建築スペシャル2】点群ビジュアライゼーションUnityTechnologiesJapan002
 
【de:code 2020】 React Native で Windows アプリ開発 ~React Native for Windows~
【de:code 2020】 React Native で Windows アプリ開発 ~React Native for Windows~【de:code 2020】 React Native で Windows アプリ開発 ~React Native for Windows~
【de:code 2020】 React Native で Windows アプリ開発 ~React Native for Windows~日本マイクロソフト株式会社
 
Race condition
Race conditionRace condition
Race conditionhama7230
 
WebRTCの技術解説 第二版 公開版 本編
WebRTCの技術解説 第二版 公開版 本編WebRTCの技術解説 第二版 公開版 本編
WebRTCの技術解説 第二版 公開版 本編Contest Ntt-west
 
【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ
【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ
【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップUnite2017Tokyo
 

What's hot (20)

Deep Dive async/await in Unity with UniTask(EN)
Deep Dive async/await in Unity with UniTask(EN)Deep Dive async/await in Unity with UniTask(EN)
Deep Dive async/await in Unity with UniTask(EN)
 
【Unite 2018 Tokyo】Unityにおける疎結合設計 ~UIへの適用事例から学ぶ、テクニックとメリット~
【Unite 2018 Tokyo】Unityにおける疎結合設計 ~UIへの適用事例から学ぶ、テクニックとメリット~【Unite 2018 Tokyo】Unityにおける疎結合設計 ~UIへの適用事例から学ぶ、テクニックとメリット~
【Unite 2018 Tokyo】Unityにおける疎結合設計 ~UIへの適用事例から学ぶ、テクニックとメリット~
 
【CEDEC2018】一歩先のUnityでのパフォーマンス/メモリ計測、デバッグ術
【CEDEC2018】一歩先のUnityでのパフォーマンス/メモリ計測、デバッグ術【CEDEC2018】一歩先のUnityでのパフォーマンス/メモリ計測、デバッグ術
【CEDEC2018】一歩先のUnityでのパフォーマンス/メモリ計測、デバッグ術
 
New Features of DotNet 6 Blazor WASM
New Features of DotNet 6 Blazor WASMNew Features of DotNet 6 Blazor WASM
New Features of DotNet 6 Blazor WASM
 
Unityによるリアルタイム通信とMagicOnionによるC#大統一理論の実現
Unityによるリアルタイム通信とMagicOnionによるC#大統一理論の実現Unityによるリアルタイム通信とMagicOnionによるC#大統一理論の実現
Unityによるリアルタイム通信とMagicOnionによるC#大統一理論の実現
 
rsyncのちょっとイイ話
rsyncのちょっとイイ話rsyncのちょっとイイ話
rsyncのちょっとイイ話
 
Lazyk
LazykLazyk
Lazyk
 
高度に最適化された移植可能なメモリマネージャ
高度に最適化された移植可能なメモリマネージャ高度に最適化された移植可能なメモリマネージャ
高度に最適化された移植可能なメモリマネージャ
 
板ポリだけで めちゃカッコいい グラフィックスを出す!
板ポリだけで めちゃカッコいい グラフィックスを出す!板ポリだけで めちゃカッコいい グラフィックスを出す!
板ポリだけで めちゃカッコいい グラフィックスを出す!
 
Direct x 11 입문
Direct x 11 입문Direct x 11 입문
Direct x 11 입문
 
リアルタイムなゲームの開発でコンテナを使ってみたら簡単便利で激安だったのでオススメしたい
リアルタイムなゲームの開発でコンテナを使ってみたら簡単便利で激安だったのでオススメしたいリアルタイムなゲームの開発でコンテナを使ってみたら簡単便利で激安だったのでオススメしたい
リアルタイムなゲームの開発でコンテナを使ってみたら簡単便利で激安だったのでオススメしたい
 
Let's build a simple app with .net 6 asp.net core web api, react, and elasti...
Let's build a simple app with  .net 6 asp.net core web api, react, and elasti...Let's build a simple app with  .net 6 asp.net core web api, react, and elasti...
Let's build a simple app with .net 6 asp.net core web api, react, and elasti...
 
OSC2011 Tokyo/Fall 濃いバナ(virtio)
OSC2011 Tokyo/Fall 濃いバナ(virtio)OSC2011 Tokyo/Fall 濃いバナ(virtio)
OSC2011 Tokyo/Fall 濃いバナ(virtio)
 
remote Docker over SSHが熱い
remote Docker over SSHが熱いremote Docker over SSHが熱い
remote Docker over SSHが熱い
 
実環境にTerraform導入したら驚いた
実環境にTerraform導入したら驚いた実環境にTerraform導入したら驚いた
実環境にTerraform導入したら驚いた
 
【Unity道場 建築スペシャル2】点群ビジュアライゼーション
【Unity道場 建築スペシャル2】点群ビジュアライゼーション【Unity道場 建築スペシャル2】点群ビジュアライゼーション
【Unity道場 建築スペシャル2】点群ビジュアライゼーション
 
【de:code 2020】 React Native で Windows アプリ開発 ~React Native for Windows~
【de:code 2020】 React Native で Windows アプリ開発 ~React Native for Windows~【de:code 2020】 React Native で Windows アプリ開発 ~React Native for Windows~
【de:code 2020】 React Native で Windows アプリ開発 ~React Native for Windows~
 
Race condition
Race conditionRace condition
Race condition
 
WebRTCの技術解説 第二版 公開版 本編
WebRTCの技術解説 第二版 公開版 本編WebRTCの技術解説 第二版 公開版 本編
WebRTCの技術解説 第二版 公開版 本編
 
【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ
【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ
【Unite 2017 Tokyo】もっと気軽に、動的なコンテンツ配信を ~アセットバンドルの未来と開発ロードマップ
 

Viewers also liked

Pushing Python: Building a High Throughput, Low Latency System
Pushing Python: Building a High Throughput, Low Latency SystemPushing Python: Building a High Throughput, Low Latency System
Pushing Python: Building a High Throughput, Low Latency SystemKevin Ballard
 
Intro to Functional Programming
Intro to Functional ProgrammingIntro to Functional Programming
Intro to Functional ProgrammingHugo Firth
 
Анонимные записи в Haskell. Никита Волков
Анонимные записи в Haskell. Никита ВолковАнонимные записи в Haskell. Никита Волков
Анонимные записи в Haskell. Никита ВолковЮрий Сыровецкий
 
Category theory, Monads, and Duality in the world of (BIG) Data
Category theory, Monads, and Duality in the world of (BIG) DataCategory theory, Monads, and Duality in the world of (BIG) Data
Category theory, Monads, and Duality in the world of (BIG) Datagreenwop
 
Монады для барабанщиков. Антон Холомьёв
Монады для барабанщиков. Антон ХоломьёвМонады для барабанщиков. Антон Холомьёв
Монады для барабанщиков. Антон ХоломьёвЮрий Сыровецкий
 
Who's More Functional: Kotlin, Groovy, Scala, or Java?
Who's More Functional: Kotlin, Groovy, Scala, or Java?Who's More Functional: Kotlin, Groovy, Scala, or Java?
Who's More Functional: Kotlin, Groovy, Scala, or Java?Andrey Breslav
 
"Немного о функциональном программирование в JavaScript" Алексей Коваленко
"Немного о функциональном программирование в JavaScript" Алексей Коваленко"Немного о функциональном программирование в JavaScript" Алексей Коваленко
"Немного о функциональном программирование в JavaScript" Алексей КоваленкоFwdays
 
gevent at TellApart
gevent at TellApartgevent at TellApart
gevent at TellApartTellApart
 
London React August - GraphQL at The Financial Times - Viktor Charypar
London React August - GraphQL at The Financial Times - Viktor CharyparLondon React August - GraphQL at The Financial Times - Viktor Charypar
London React August - GraphQL at The Financial Times - Viktor CharyparReact London Community
 
Building a Simple Mobile-optimized Web App Using the jQuery Mobile Framework
Building a Simple Mobile-optimized Web App Using the jQuery Mobile FrameworkBuilding a Simple Mobile-optimized Web App Using the jQuery Mobile Framework
Building a Simple Mobile-optimized Web App Using the jQuery Mobile FrameworkSt. Petersburg College
 
Introduction to Storm
Introduction to Storm Introduction to Storm
Introduction to Storm Chandler Huang
 
CSS/SVG Matrix Transforms
CSS/SVG Matrix TransformsCSS/SVG Matrix Transforms
CSS/SVG Matrix TransformsMarc Grabanski
 
DNS Security Presentation ISSA
DNS Security Presentation ISSADNS Security Presentation ISSA
DNS Security Presentation ISSASrikrupa Srivatsan
 
Introduction to jQuery Mobile - Web Deliver for All
Introduction to jQuery Mobile - Web Deliver for AllIntroduction to jQuery Mobile - Web Deliver for All
Introduction to jQuery Mobile - Web Deliver for AllMarc Grabanski
 
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013mumrah
 
From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.Taras Matyashovsky
 
Cassandra Introduction & Features
Cassandra Introduction & FeaturesCassandra Introduction & Features
Cassandra Introduction & FeaturesDataStax Academy
 
Etsy Activity Feeds Architecture
Etsy Activity Feeds ArchitectureEtsy Activity Feeds Architecture
Etsy Activity Feeds ArchitectureDan McKinley
 

Viewers also liked (20)

Pushing Python: Building a High Throughput, Low Latency System
Pushing Python: Building a High Throughput, Low Latency SystemPushing Python: Building a High Throughput, Low Latency System
Pushing Python: Building a High Throughput, Low Latency System
 
Intro to Functional Programming
Intro to Functional ProgrammingIntro to Functional Programming
Intro to Functional Programming
 
Анонимные записи в Haskell. Никита Волков
Анонимные записи в Haskell. Никита ВолковАнонимные записи в Haskell. Никита Волков
Анонимные записи в Haskell. Никита Волков
 
Category theory, Monads, and Duality in the world of (BIG) Data
Category theory, Monads, and Duality in the world of (BIG) DataCategory theory, Monads, and Duality in the world of (BIG) Data
Category theory, Monads, and Duality in the world of (BIG) Data
 
Монады для барабанщиков. Антон Холомьёв
Монады для барабанщиков. Антон ХоломьёвМонады для барабанщиков. Антон Холомьёв
Монады для барабанщиков. Антон Холомьёв
 
Who's More Functional: Kotlin, Groovy, Scala, or Java?
Who's More Functional: Kotlin, Groovy, Scala, or Java?Who's More Functional: Kotlin, Groovy, Scala, or Java?
Who's More Functional: Kotlin, Groovy, Scala, or Java?
 
"Немного о функциональном программирование в JavaScript" Алексей Коваленко
"Немного о функциональном программирование в JavaScript" Алексей Коваленко"Немного о функциональном программирование в JavaScript" Алексей Коваленко
"Немного о функциональном программирование в JavaScript" Алексей Коваленко
 
gevent at TellApart
gevent at TellApartgevent at TellApart
gevent at TellApart
 
London React August - GraphQL at The Financial Times - Viktor Charypar
London React August - GraphQL at The Financial Times - Viktor CharyparLondon React August - GraphQL at The Financial Times - Viktor Charypar
London React August - GraphQL at The Financial Times - Viktor Charypar
 
Building a Simple Mobile-optimized Web App Using the jQuery Mobile Framework
Building a Simple Mobile-optimized Web App Using the jQuery Mobile FrameworkBuilding a Simple Mobile-optimized Web App Using the jQuery Mobile Framework
Building a Simple Mobile-optimized Web App Using the jQuery Mobile Framework
 
Introduction to Storm
Introduction to Storm Introduction to Storm
Introduction to Storm
 
CSS/SVG Matrix Transforms
CSS/SVG Matrix TransformsCSS/SVG Matrix Transforms
CSS/SVG Matrix Transforms
 
DNS Security Presentation ISSA
DNS Security Presentation ISSADNS Security Presentation ISSA
DNS Security Presentation ISSA
 
Introduction to jQuery Mobile - Web Deliver for All
Introduction to jQuery Mobile - Web Deliver for AllIntroduction to jQuery Mobile - Web Deliver for All
Introduction to jQuery Mobile - Web Deliver for All
 
HTML5 Essentials
HTML5 EssentialsHTML5 Essentials
HTML5 Essentials
 
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
 
From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.From cache to in-memory data grid. Introduction to Hazelcast.
From cache to in-memory data grid. Introduction to Hazelcast.
 
Cassandra Introduction & Features
Cassandra Introduction & FeaturesCassandra Introduction & Features
Cassandra Introduction & Features
 
Etsy Activity Feeds Architecture
Etsy Activity Feeds ArchitectureEtsy Activity Feeds Architecture
Etsy Activity Feeds Architecture
 
jQuery Essentials
jQuery EssentialsjQuery Essentials
jQuery Essentials
 

Similar to WebKit Rendering: How Browsers Display Web Pages

Redesigning The Library Experience
Redesigning The Library ExperienceRedesigning The Library Experience
Redesigning The Library ExperienceMichael Magoolaghan
 
Implementing OpenID
Implementing OpenIDImplementing OpenID
Implementing OpenIDUri Levanon
 
Open stack - Presenation by Thierry Carrez
Open stack - Presenation by Thierry CarrezOpen stack - Presenation by Thierry Carrez
Open stack - Presenation by Thierry CarrezeNovance
 
Unit2 Gear
Unit2 GearUnit2 Gear
Unit2 Gearmokhtar
 
Unit1 Screw Thread
Unit1 Screw ThreadUnit1 Screw Thread
Unit1 Screw Threadguestb9b7f4
 
Unit1 Screw Thread
Unit1 Screw ThreadUnit1 Screw Thread
Unit1 Screw Threadmokhtar
 

Similar to WebKit Rendering: How Browsers Display Web Pages (9)

Redesigning The Library Experience
Redesigning The Library ExperienceRedesigning The Library Experience
Redesigning The Library Experience
 
Implementing OpenID
Implementing OpenIDImplementing OpenID
Implementing OpenID
 
Pp booklet 2
Pp booklet 2Pp booklet 2
Pp booklet 2
 
Open stack - Presenation by Thierry Carrez
Open stack - Presenation by Thierry CarrezOpen stack - Presenation by Thierry Carrez
Open stack - Presenation by Thierry Carrez
 
Unit2 Gear
Unit2 GearUnit2 Gear
Unit2 Gear
 
Unit2 Gear
Unit2 GearUnit2 Gear
Unit2 Gear
 
Unit1 Screw Thread
Unit1 Screw ThreadUnit1 Screw Thread
Unit1 Screw Thread
 
Unit1 Screw Thread
Unit1 Screw ThreadUnit1 Screw Thread
Unit1 Screw Thread
 
Implementing OpenID
Implementing OpenIDImplementing OpenID
Implementing OpenID
 

Recently uploaded

Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 

Recently uploaded (20)

Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 

WebKit Rendering: How Browsers Display Web Pages

  • 1. WebKit! how the web is rendered Levi Weintraub
  • 2. me Intel->Apple->Microsoft->Palm->HP->Google on and off on WebKit since 2006 adventure motorcyclist
  • 3. me Intel->Apple->Microsoft->Palm->HP->Google on and off on WebKit since 2006 adventure motorcyclist
  • 5. Hi Dad! adventure motorcyclist
  • 11. primary rendering engines Trident Gecko Internet Explorer
  • 12. primary rendering engines Trident Gecko Internet Explorer Firefox
  • 13. primary rendering engines Trident Gecko WebKit Internet Explorer Firefox
  • 14. primary rendering engines Trident Gecko WebKit Internet Explorer Firefox Chrome, Safari, iOS, Android, Qt, Blackberry, webOS, Kindle, etc.
  • 15. Gecko WebKit FREE!
  • 16. Gecko WebKit FREE! Firefox Chromium
  • 17. over 38%1 1: StatCounter's Global March 2012 http://gs.statcounter.com
  • 20. 19 98 KH TM Lr ele as 20 ed 01 W eb Kit 20 se 02 c ret Ja ly va for Sc ke 20 rip db 03 tC yA W ore pp eb Co rel le ea re se & d Sa 20 fa ri r 05 ele W as eb ed Kit op en so 20 urc 07 ed Sa far i fo 20 rW 08 ind G oo ow gle s 20 Ch 09 rom C hro er me ele 20 Be as 10 ta ed KD for for E Ma W re- cO ind ow int S s eg rat X e an 20 sW dL 12 eb inu W Kit x eb -W ?? Kit ? do eb Kit mi na 2a Pr nt nn ofi we ou t!! bp nc lat ed f orm
  • 21. anatomy of a WebKit browser
  • 22. Embedding Application pushes WebKit to do work handles user input WebKit (component) WebCore JavaScript Platform Engine
  • 23. WebKit-based browser WebKit (component) interface between rendering engine and embedding application WebCore JavaScript Platform Engine
  • 24. WebKit-based browser WebKit (component) WebCore application logic loading painting parsing event handling JavaScript layout editing Platform Engine style resolution javascript bindings
  • 25. WebKit-based browser WebKit (component) WebCore JavaScript Platform network stack Engine graphics library font engine native widgets abstraction of native components
  • 26. WebKit-based browser WebKit (component) WebCore JavaScript Platform Engine V8 or JavaScriptCore parses and executes page logic allows DOM manipulation
  • 28. primary data structures parsing & interface: DOM tree layout and rendering: render object tree style tree layer tree line box tree
  • 31. loader parsing DOM tree
  • 32. parsing JavaScript I AP M DO DOM tree att ac h render tree
  • 33. DOM tree representation of document document API shadow DOM
  • 34. DOM tree markup DOM representation <html> HTMLDocument <body> HTMLHTMLElement <div> HTMLBodyElement foo HTMLDivElement <span> Text("foo") bar HTMLSpanElement </span> Text("bar") </div> </body> </html>
  • 35. DOM tree style att ac h render tree
  • 36.
  • 37.
  • 38. OK!
  • 39. render forest render object tree layer tree inline box tree style tree
  • 40. render object tree owned by DOM tree only exists for rendered content responsible for layout and paint answers DOM API measurement requests
  • 41. 12 paint phases! block background child outlines child block background self outline child block backgrounds selection float collapsed table borders foreground text clip outline mask
  • 42. render object tree owned by DOM tree only exists for rendered content responsible for layout and paint answers DOM API measurement requests
  • 43. render object tree DOM representation render objects HTMLBodyElement RenderBlock HTMLDivElement RenderBlock Text("foo") RenderText("foo") HTMLSpanElement RenderInline Text("bar") RenderText("bar")
  • 44. anonymous blocks DOM representation render objects HTMLBodyElement RenderBlock HTMLDivElement RenderBlock Text("foo") RenderBlock(anonymous) HTMLSpanElement RenderText("foo") Text("bar") RenderInline HTMLDivElement RenderText("bar") Text("baz") RenderBlock RenderText("baz")
  • 45. style tree contains all computed style values for renderers owned by render object tree RenderObjects share RenderStyles RenderStyles share data members
  • 46. render layer tree like helper class for rendering used for <video>, <canvas> with WebGL, positioned, transformed, transparent, masked, clipped, scrollable, or reflected elements establishes coordinate space and z-ordering at least one per document, sparsely maps to renderers
  • 47. render layer structure negative z-index list RenderLaye RenderLaye r Render r Layers RenderLayer positive z-index list RenderLaye RenderLaye r Render r Layers RenderObject RenderObject RenderObject
  • 48. render layer painting negative z-index list RenderLaye RenderLaye r Render r Layers 1 RenderLayer positive z-index list RenderLaye RenderLaye r Render r Layers RenderObject RenderObject RenderObject
  • 49. render layer painting negative z-index list RenderLaye RenderLaye r Render r Layers 2 RenderLayer positive z-index list RenderLaye RenderLaye r Render r Layers RenderObject RenderObject RenderObject
  • 50. render layer painting negative z-index list RenderLaye RenderLaye r Render r Layers RenderLayer 3 positive z-index list RenderLaye RenderLaye r Render r Layers RenderObject RenderObject RenderObject
  • 51. render layer painting, software paint the intersection of the paint dirty rect with all intersecting layers in order all layers render into the same output buffer
  • 52. render layer painting, hw accelerated some RenderLayers have backing store GPU texture used for 3D transforms, <video>, <canvas>/ plugins with 3D, stacking contexts, or sub- frames dirtied RenderLayers paint to GPU texture GPU composites textures onto final output buffer
  • 53. line box tree owned by RenderBlock one RootInlineBox per line RootInlineBox has list of InlineBoxes in that line each InlineBox has a RenderObject a renderer may have many InlineBoxes relies on RenderBlock for layout
  • 54. line box tree Markup: <div>foo<b>bar</b><br>baz</div> render tree line box tree RenderBlock(div) RenderBlock(div) RenderText("foo") RootInlineBox RenderInline(b) InlineTextBox("foo") RenderText("bar") InlineFlowBox(b) RenderBR InlineTextBox(b) RenderText("baz") InlineBox(br) RootInlineBox InlineTextBox("baz")
  • 55. layout changes to DOM marks renderers as dirty layout before paint or measurement from JS ● save old repaint rect ● bring in updates from DOM ● determine our preferred width ● layout children to determine height ● repaint difference between old and new rect
  • 56. layout changes to DOM marks renderers as dirty layout before paint or measurement from JS ● save old repaint rect ● bring in updates from DOM ● determine our preferred width ● layout children to determine height ● repaint difference between old and new rect
  • 57. review of main flow loader->parser->DOM tree->render tree render tree: ● RenderObject tree ● RenderLayer tree ● RenderStyle tree ● InlineBoxTree
  • 58. paint animations, blinking carets, layout, etc. trigger invalidations to embedder app app collects rects, triggers paint tree walk from root RenderLayer RenderObjects and InlineBoxes paint GraphicsContext abstraction
  • 59. hit testing constant during mouse move multiple phases tree walk from root RenderLayer RenderLayer transforms into local coordinates
  • 61. component model based on shadow DOM hides implementation ● events re-targeted ● shadow children inaccessible by regular DOM defined interface
  • 62. shadow DOM tree shadow boundary Do cu m en tt re e shadow host shadow root DOM child DOM child shadow child shadow child
  • 63. shadow render tree re nde rt re e shadow host shadow child shadow child
  • 64. integer layout layout currently uses integers fractional pixel values truncated breaks at non-1:1 zoom error accumulates
  • 65. 1.5x zoom is bad 150px * 1.5x = 225px (15px * 1.5x) * 10 = 220px
  • 66. sub-pixel layout integers replaced by fixed-point unit boxes snapped to pixel values supports sub-pixel CSS values error doesn't accumulate
  • 67. multi-process browsers centralized resources ● networking ● cache ● compositor ● plugins safety through sandboxing multiple main loops ≈ multi-core
  • 68. chrome architecture network stack browser process file io GPU process plugin process plugin processes shared memory gles2.0 instructions render textures processes
  • 69. thanks! questions? http://webkit.org http://chromium.org leviw@chromium.org Levi Weintraub