SlideShare a Scribd company logo
1 of 82
Download to read offline
Understanding
                        WebKit Rendering


                             Ariya Hidayat




Sunday, October 7, 12
whoami




Sunday, October 7, 12
Sunday, October 7, 12
WebKit




Sunday, October 7, 12
WebKit is Everywhere




Sunday, October 7, 12
Browser at a High Level


                                        User Interface




                                                                    Data Persistence
                                     Browser Engine




                                     Render Engine



                        Networking     JavaScript        Graphics
                           I/O           Engine           Stack




Sunday, October 7, 12
WebKit Components

                                              Render Engine
                                                  CSS
                                DOM                                  SVG



                    HTML                                                         Canvas

                                                 WebCore




                           Client Interface                JavaScript Engine (JSC/V8)



Sunday, October 7, 12
Platform Abstraction

                        Networking
                                     Thread         Geolocation    Timer
                           I/O

                                         Client Interface

                        Clipboard    Events           Theme       Graphics




                                        API Calls
                                         Events

                                             Port
                                      (Chrome, Safari, etc.)


Sunday, October 7, 12
Layout




Sunday, October 7, 12
From Contents to Pixels


                                                        DOM

                                                                       Render
                                                                       Layout
                                   HTML                 DOM
                   HTML
                                   Parser               Tree

                                                                       Render                 Paint
                                                                        Tree

                   Style            CSS                 Style
                  Sheets           Parser               Rules



                           http://www.html5rocks.com/en/tutorials/internals/howbrowserswork


Sunday, October 7, 12
DOM Tree


                        <html><body><p>Hello</p></body></html>



           HTMLDocument

                   HTMLBodyElement

                        HTMLParagraphElement           attributes, children, contents




Sunday, October 7, 12
HTML Parsing


                                                           tag

                                                         <html><body><p>Hello</p></body></html>
      Loader                         Tokenizer
                                                                        text



                                                                                              DOM Tree
  May come in chunks
                                          Tree Builder




                                                                          Section 12.2 in HTML Specification

          http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#parsing


Sunday, October 7, 12
DOM Tree vs Render Tree



            HTMLDocument                                    RenderRoot

                 HTMLBodyElement                                RenderBody

                        HTMLParagraphElement                           RenderText




                                There is no Render* for display:none



Sunday, October 7, 12
“Attach” Process

                        Historical: Node is invisible, attach it to the main view to make it visible



                                                          View




                                           1:1                               many:1
            Node/Element                             RenderObject                       RenderStyle
                                                 tree structure/navigation
              <div>42</div>                                                             computed style
                                                    metrics (box model)
                                                         hit testing


                                                                                           another tree structure



Sunday, October 7, 12
Sunday, October 7, 12
It’s a forest!




Sunday, October 7, 12
Effects of Style Recalc and Layout

      document.getElementById('box').style.top = '100px';




                                       Aggregated “dirty” area




      document.getElementById('box').style.backgroundColor = 'red';




                                               No layout necessary,
                                       metrics are not flagged as “changed”

Sunday, October 7, 12
Getting the Right Style
                                                                          Stylesheet List


          HTMLDocument
                                                                    p { color: blue }
                 HTMLBodyElement
                        HTMLParagraphElement


                  DOM Tree


                                                           RenderStyle




                CSS Style Selector: id, class, tags, ...




Sunday, October 7, 12
Minimizing Layout

                                             Element

                              clientHeight
                                                         focus()
                              clientLeft
                                                         getBoundingClientRect()
                              clientTop
                                                         getClientRects()
                              clientWidth
                                                         scrollByLines()
                              offsetHeight
                                                         scrollByPages()
                              offsetLeft
                                                         scrollHeight
                              offsetParent
                                                         scrollIntoView()
                              offsetTop
                                                         scrollIntoViewIfNeeded()
                              offsetWidth
                              scrollLeft
                              scrollTop
                              scrollWidth
                              innerText
                              outerText



                        http://gent.ilcore.com/2011/03/how-not-to-trigger-layout-in-webkit.html

    http://code.google.com/p/chromium/source/search?q=%22-%3EupdateLayoutIgnorePendingStylesheets()%22


Sunday, October 7, 12
Painting




Sunday, October 7, 12
Goals of Painting

       • “Visualize” all RenderObjects (again, tree traversal)


       • All painting commands go to GraphicsContext abstraction


       • Important
                                                  Optimizations
             • Clipped to the visible viewport


             • Back-to-front

                            Transparency &
                                clipping




Sunday, October 7, 12
CSS Painting: 10 Stages

                               http://www.w3.org/TR/CSS2/zindex.html

                        Appendix E. Elaborate description of Stacking Contexts




                                  •
                                   Background
                                  •
                                   Floats
                                  •
                                   Foreground
                                  •
                                   Selection                 Done by the render objects
                                  •
                                   Outline                      (in the render tree)




Sunday, October 7, 12
Graphics Abstraction

                                                       Chromium
                                                        Android               Qt
                                         Mac & iOS
           GraphicsContext



                                                            Skia

                                       CoreGraphics
                                                                           QPainter



                                                                   graphics stack




                    Native controls,
                                              RenderTheme
                  e.g. form elements

Sunday, October 7, 12
Painting Flow: Browser vs WebKit

                        Browser                                                           WebKit


                             User scrolls
                             the viewport

                                                      Request painting, GraphicsContext
                                                                                              Sometimes to the
                                                                                               backing store



                                                                       Style change


                                        Mark “dirty” area




Sunday, October 7, 12
Path is Everything




Sunday, October 7, 12
Stroke = Outline




                    Solid   Dashed   Dotted   Textured


Sunday, October 7, 12
Brush = Fill




             None       Solid   Gradient   Textured




Sunday, October 7, 12
Gradient = Non-uniform Pixel Values




Sunday, October 7, 12
Drawing Time: Solid vs Gradient



                         Only border

                                                    14x slower
                        Solid color fill   (depending on the dimension)

             Linear gradient fill

             Radial gradient fill




Sunday, October 7, 12
Path Approximation


                    Curves




                             Polygon




Sunday, October 7, 12
Antialiasing


                        Multiple levels of transparency




Sunday, October 7, 12
Transformation




                   Scaling
                                        Perspective
                             Rotation




Sunday, October 7, 12
Text Rasterization




Sunday, October 7, 12
Font Atlas


                        Buffer




                                 Bye




Sunday, October 7, 12
Simple to Complex



                                     ell o!
                                    H


                   Simple shape
                    Solid color       Curves
                                  Gradient brush
                                  Textured stroke
                                   Blur shadow
                                     Serif text
                                     Rotated



Sunday, October 7, 12
Simple to Complex



                                                           ell o!
                                                          H


                   Simple shape
                    Solid color                             Curves
                                                        Gradient brush
                                                        Textured stroke
                                                         Blur shadow
                                                           Serif text
                                  Make it as an image
                                                           Rotated



Sunday, October 7, 12
Hardware Acceleration




Sunday, October 7, 12
Game vs Web




Sunday, October 7, 12
Game


                                                          Text




                                                                 Textured
                                                                  objects
                        Animation




                               Transformation   Physics




Sunday, October 7, 12
Large Area, but Still Bounded




Sunday, October 7, 12
Web Page




                               Images

                        Text




Sunday, October 7, 12
Challenges




        Predictable contents (assets)   ✔
         Mostly text                          ✔
         Mostly images                  ✔
         Initial response                   immediate



Sunday, October 7, 12
SoC = System-on-a-Chip




                                CPU   GPU




Sunday, October 7, 12
GPU Workflow




                          Matrix




               Vertices            Rendered   Textured




Sunday, October 7, 12
Optimized for Games

                              “Fixed” geometry


                             Transformation


                             Textured triangles




                                     Parallelism




Sunday, October 7, 12
Powerful Capabilities




            http://epicgames.com/technology/   http://www.rage.com/
                        epic-citadel



Sunday, October 7, 12
http://www.trollquotes.org/619-super-spider-bat-troll-quote/
Sunday, October 7, 12
Fundamental Physical Limitations

       • Memory: Can’t store too much stuff


       • Speed: Quad-core CPU can do certain operations better


       • Bandwidth: Data transfer can be the bottleneck




Sunday, October 7, 12
Traffic Congestion




Sunday, October 7, 12
Efficient Use of GPU




                 Drawing      Backing     Layer &
                 primitives    stores   compositing


Sunday, October 7, 12
Maps




                        Tile




Sunday, October 7, 12
Pinch to Zoom




         when you pinch...




Sunday, October 7, 12
Responsive Interface



                                                 decoupled
                        Rendering

                                Processor

                                        User interaction


Sunday, October 7, 12
Rendering vs Interaction



                                                            Screen
                                    Backing Store
                        Rendering




     Web Page                                       User interaction




Sunday, October 7, 12
Checkerboard Pattern




Sunday, October 7, 12
Progressive Rendering


                        Fast but blurry




                                          Crisp but slow


Sunday, October 7, 12
Perceived Responsiveness


                        User pinches




                                                        Smooth scaled

                                   Blocky (but fast!)




Sunday, October 7, 12
Tiling System




                                 Texture upload


                          ....                ....



                    CPU                              GPU


Sunday, October 7, 12
Tile Transformation




            Panning = Translation   Zooming = Scaling

Sunday, October 7, 12
Checkerboard Pattern




Sunday, October 7, 12
Typical Animation




                        opacity, movement, scaling, rotation, ...




Sunday, October 7, 12
Principles of Fluid Animation



                             At the beginning, push as many
                        1
                            resources as possible to the GPU


                        2    During the animation, minimize
                                  CPU-GPU interaction




Sunday, October 7, 12
Immediate vs Retained
                                   At the beginning...

                                                    draw the shape onto a
                                                            buffer



                               For every animation tick...

                                                    blit the buffer at (x,
                  draw the shape at (x, y)
                                                              y)
                         x = x + 10
                                                          x = x + 10

                                                             Off main thread



Sunday, October 7, 12
Mechanics of Animation

                                         “Hey, this is good stuff. Cache it as texture




                        Initialization




                                            “Apply [operation] to texture #42.”




                    Animation step



Sunday, October 7, 12
Elements = Layer




Sunday, October 7, 12
Logical 3-D




Sunday, October 7, 12
Compositing By Force

                        -webkit-transform: translateZ(0)



                             Not needed for CSS

                                        .someid {
                        -webkit-animation-name: somekeyframeanimation;
                               -webkit-animation-duration: 7s;
                              -webkit-transform: translateZ(0);
                                            }


                                        Don’t do that

Sunday, October 7, 12
Magical Advice
                         Use translate3d for
                        hardware acceleration




Sunday, October 7, 12
Magical Advice
                         Use translate3d for
                        hardware acceleration




Sunday, October 7, 12
Debugging in Safari


              defaults write com.apple.Safari IncludeInternalDebugMenu 1




Sunday, October 7, 12
Compositing Indicators

                                Texture (number = upload)


                                   Composited layer



                                 No associated texture


                                     Container layer


                                        Overflow




Sunday, October 7, 12
Avoid Texture Reupload


                        No reupload                     Upload



                           Opacity
                           Position                Everything else!
                            Size
                          Animation



                                 “Hardware accelerated CSS”



Sunday, October 7, 12
Examples




Sunday, October 7, 12
Color Transition

                        @-webkit-keyframes box {
                            0% { -webkit-transform: background-color: blue; }
                          100% { -webkit-transform: background-color: green; }
                        }




                                         Need a new texture uploaded to
                                       the GPU for every in-between color


Sunday, October 7, 12
Color Transition: The Trick




                              Blended with




                                         http://jsfiddle.net/79AVn
Sunday, October 7, 12
Prepare and Reuse




                                   Hide the layer
                                     offscreen




                        Viewport




Sunday, October 7, 12
Timer Latency

                                                              Depending
                                                               on user




                        Animation end triggers the JavaScript callback
                          JavaScript code kicks the next animation


                                             Prepare both
                                         animation and hide the
                                              “wrong” one


Sunday, October 7, 12
Avoid Overcapacity




                                   ....        ....




                        Think of the GPU memory like a cache.




Sunday, October 7, 12
Conclusion




Sunday, October 7, 12
Rendering Aspects




Sunday, October 7, 12
There is No Silver Bullet




Sunday, October 7, 12
Thank You



                        ariya.hidayat@gmail.com



                        ariya.ofilabs.com



                        @AriyaHidayat




Sunday, October 7, 12

More Related Content

What's hot

Front end development best practices
Front end development best practicesFront end development best practices
Front end development best practicesKarolina Coates
 
Liferay hardening principles
Liferay hardening principlesLiferay hardening principles
Liferay hardening principlesAmbientia
 
Node.js 20버전에 변경된 점들.pdf
Node.js 20버전에 변경된 점들.pdfNode.js 20버전에 변경된 점들.pdf
Node.js 20버전에 변경된 점들.pdfSeung kyoo Park
 
React Architecture & Best Practices.pptx
React Architecture & Best Practices.pptxReact Architecture & Best Practices.pptx
React Architecture & Best Practices.pptxAleksandarKondov
 
FRONT-END WEB DEVELOPMENT WITH REACTJS
FRONT-END WEB DEVELOPMENT WITH REACTJSFRONT-END WEB DEVELOPMENT WITH REACTJS
FRONT-END WEB DEVELOPMENT WITH REACTJSTran Phong Phu
 
하이퍼레저 패브릭 데이터 구조
하이퍼레저 패브릭 데이터 구조하이퍼레저 패브릭 데이터 구조
하이퍼레저 패브릭 데이터 구조Logpresso
 
Elastic Stack 을 이용한 게임 서비스 통합 로깅 플랫폼 - elastic{on} 2019 Seoul
Elastic Stack 을 이용한 게임 서비스 통합 로깅 플랫폼 - elastic{on} 2019 SeoulElastic Stack 을 이용한 게임 서비스 통합 로깅 플랫폼 - elastic{on} 2019 Seoul
Elastic Stack 을 이용한 게임 서비스 통합 로깅 플랫폼 - elastic{on} 2019 SeoulSeungYong Oh
 
Hadoop Security Today & Tomorrow with Apache Knox
Hadoop Security Today & Tomorrow with Apache KnoxHadoop Security Today & Tomorrow with Apache Knox
Hadoop Security Today & Tomorrow with Apache KnoxVinay Shukla
 
Web Development with HTML5, CSS3 & JavaScript
Web Development with HTML5, CSS3 & JavaScriptWeb Development with HTML5, CSS3 & JavaScript
Web Development with HTML5, CSS3 & JavaScriptEdureka!
 
게임의 성공을 위한 Scalable 한 데이터 플랫폼 사례 공유 - 오승용, 데이터 플랫폼 리더, 데브시스터즈 ::: Games on AW...
게임의 성공을 위한 Scalable 한 데이터 플랫폼 사례 공유 - 오승용, 데이터 플랫폼 리더, 데브시스터즈 ::: Games on AW...게임의 성공을 위한 Scalable 한 데이터 플랫폼 사례 공유 - 오승용, 데이터 플랫폼 리더, 데브시스터즈 ::: Games on AW...
게임의 성공을 위한 Scalable 한 데이터 플랫폼 사례 공유 - 오승용, 데이터 플랫폼 리더, 데브시스터즈 ::: Games on AW...Amazon Web Services Korea
 
A Brief Introduction to React.js
A Brief Introduction to React.jsA Brief Introduction to React.js
A Brief Introduction to React.jsDoug Neiner
 
Build web apps with react js
Build web apps with react jsBuild web apps with react js
Build web apps with react jsdhanushkacnd
 

What's hot (20)

React Native
React NativeReact Native
React Native
 
React js
React jsReact js
React js
 
Front end development best practices
Front end development best practicesFront end development best practices
Front end development best practices
 
Liferay hardening principles
Liferay hardening principlesLiferay hardening principles
Liferay hardening principles
 
Its time to React.js
Its time to React.jsIts time to React.js
Its time to React.js
 
Reactjs
ReactjsReactjs
Reactjs
 
Bootstrap 5 basic
Bootstrap 5 basicBootstrap 5 basic
Bootstrap 5 basic
 
Node.js 20버전에 변경된 점들.pdf
Node.js 20버전에 변경된 점들.pdfNode.js 20버전에 변경된 점들.pdf
Node.js 20버전에 변경된 점들.pdf
 
React Architecture & Best Practices.pptx
React Architecture & Best Practices.pptxReact Architecture & Best Practices.pptx
React Architecture & Best Practices.pptx
 
FRONT-END WEB DEVELOPMENT WITH REACTJS
FRONT-END WEB DEVELOPMENT WITH REACTJSFRONT-END WEB DEVELOPMENT WITH REACTJS
FRONT-END WEB DEVELOPMENT WITH REACTJS
 
JavaScript JQUERY AJAX
JavaScript JQUERY AJAXJavaScript JQUERY AJAX
JavaScript JQUERY AJAX
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
하이퍼레저 패브릭 데이터 구조
하이퍼레저 패브릭 데이터 구조하이퍼레저 패브릭 데이터 구조
하이퍼레저 패브릭 데이터 구조
 
Elastic Stack 을 이용한 게임 서비스 통합 로깅 플랫폼 - elastic{on} 2019 Seoul
Elastic Stack 을 이용한 게임 서비스 통합 로깅 플랫폼 - elastic{on} 2019 SeoulElastic Stack 을 이용한 게임 서비스 통합 로깅 플랫폼 - elastic{on} 2019 Seoul
Elastic Stack 을 이용한 게임 서비스 통합 로깅 플랫폼 - elastic{on} 2019 Seoul
 
API documentation
API documentationAPI documentation
API documentation
 
Hadoop Security Today & Tomorrow with Apache Knox
Hadoop Security Today & Tomorrow with Apache KnoxHadoop Security Today & Tomorrow with Apache Knox
Hadoop Security Today & Tomorrow with Apache Knox
 
Web Development with HTML5, CSS3 & JavaScript
Web Development with HTML5, CSS3 & JavaScriptWeb Development with HTML5, CSS3 & JavaScript
Web Development with HTML5, CSS3 & JavaScript
 
게임의 성공을 위한 Scalable 한 데이터 플랫폼 사례 공유 - 오승용, 데이터 플랫폼 리더, 데브시스터즈 ::: Games on AW...
게임의 성공을 위한 Scalable 한 데이터 플랫폼 사례 공유 - 오승용, 데이터 플랫폼 리더, 데브시스터즈 ::: Games on AW...게임의 성공을 위한 Scalable 한 데이터 플랫폼 사례 공유 - 오승용, 데이터 플랫폼 리더, 데브시스터즈 ::: Games on AW...
게임의 성공을 위한 Scalable 한 데이터 플랫폼 사례 공유 - 오승용, 데이터 플랫폼 리더, 데브시스터즈 ::: Games on AW...
 
A Brief Introduction to React.js
A Brief Introduction to React.jsA Brief Introduction to React.js
A Brief Introduction to React.js
 
Build web apps with react js
Build web apps with react jsBuild web apps with react js
Build web apps with react js
 

Viewers also liked

WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolution
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 RevolutionWebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolution
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolutionjuanjosanchezpenas
 
WebKit and GStreamer
WebKit and GStreamerWebKit and GStreamer
WebKit and GStreamercalvaris
 
WebKit, HTML5 media and GStreamer on multiple platforms
WebKit, HTML5 media and GStreamer on multiple platforms WebKit, HTML5 media and GStreamer on multiple platforms
WebKit, HTML5 media and GStreamer on multiple platforms philn2
 
Introduction to QtWebKit
Introduction to QtWebKitIntroduction to QtWebKit
Introduction to QtWebKitAriya Hidayat
 
WebKit2 And You (GUADEC 2013)
WebKit2 And You (GUADEC 2013)WebKit2 And You (GUADEC 2013)
WebKit2 And You (GUADEC 2013)Igalia
 
FrontTalks: Вадим Макеев (Opera Software), «Зачем Опере Вебкит, или Опиум для...
FrontTalks: Вадим Макеев (Opera Software), «Зачем Опере Вебкит, или Опиум для...FrontTalks: Вадим Макеев (Opera Software), «Зачем Опере Вебкит, или Опиум для...
FrontTalks: Вадим Макеев (Opera Software), «Зачем Опере Вебкит, или Опиум для...Yandex
 
WebKit vs. the mobile Web
WebKit vs. the mobile WebWebKit vs. the mobile Web
WebKit vs. the mobile WebJosh Tumath
 
WebKit and Blink: open development powering the HTML5 revolution
WebKit and Blink: open development powering the HTML5 revolutionWebKit and Blink: open development powering the HTML5 revolution
WebKit and Blink: open development powering the HTML5 revolutionjuanjosanchezpenas
 
Measuring Web Performance - 自己満足で終わらないためのパフォーマンス計測 -
Measuring Web Performance - 自己満足で終わらないためのパフォーマンス計測 -Measuring Web Performance - 自己満足で終わらないためのパフォーマンス計測 -
Measuring Web Performance - 自己満足で終わらないためのパフォーマンス計測 -Koji Ishimoto
 
WebKitGtk+ Project
WebKitGtk+ ProjectWebKitGtk+ Project
WebKitGtk+ ProjectJoone Hur
 
Irfan e hidayat az ifadat imam e ahle sunnat
Irfan e hidayat az ifadat imam e ahle sunnatIrfan e hidayat az ifadat imam e ahle sunnat
Irfan e hidayat az ifadat imam e ahle sunnatMuhammad Tariq
 
Understanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile BrowsersUnderstanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile BrowsersAriya Hidayat
 
Presentasi narkoba2013
Presentasi narkoba2013Presentasi narkoba2013
Presentasi narkoba2013Kodrat Hidayat
 
[KOR][E-Kor-Seminar 2014][2/8] Webkit EFL (Ryuan)
[KOR][E-Kor-Seminar 2014][2/8] Webkit EFL (Ryuan)[KOR][E-Kor-Seminar 2014][2/8] Webkit EFL (Ryuan)
[KOR][E-Kor-Seminar 2014][2/8] Webkit EFL (Ryuan)EnlightenmentProject
 

Viewers also liked (20)

The WebKit project
The WebKit projectThe WebKit project
The WebKit project
 
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolution
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 RevolutionWebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolution
WebKit and Blink: Bridging the Gap Between the Kernel and the HTML5 Revolution
 
WebKit and GStreamer
WebKit and GStreamerWebKit and GStreamer
WebKit and GStreamer
 
WebKit, HTML5 media and GStreamer on multiple platforms
WebKit, HTML5 media and GStreamer on multiple platforms WebKit, HTML5 media and GStreamer on multiple platforms
WebKit, HTML5 media and GStreamer on multiple platforms
 
Introduction to QtWebKit
Introduction to QtWebKitIntroduction to QtWebKit
Introduction to QtWebKit
 
WebKit2 And You (GUADEC 2013)
WebKit2 And You (GUADEC 2013)WebKit2 And You (GUADEC 2013)
WebKit2 And You (GUADEC 2013)
 
FrontTalks: Вадим Макеев (Opera Software), «Зачем Опере Вебкит, или Опиум для...
FrontTalks: Вадим Макеев (Opera Software), «Зачем Опере Вебкит, или Опиум для...FrontTalks: Вадим Макеев (Opera Software), «Зачем Опере Вебкит, или Опиум для...
FrontTalks: Вадим Макеев (Opera Software), «Зачем Опере Вебкит, или Опиум для...
 
WebKit vs. the mobile Web
WebKit vs. the mobile WebWebKit vs. the mobile Web
WebKit vs. the mobile Web
 
פיתוח אפליקציות Webkit לדפדפנים סלולריים Ppt
פיתוח אפליקציות Webkit לדפדפנים סלולריים Pptפיתוח אפליקציות Webkit לדפדפנים סלולריים Ppt
פיתוח אפליקציות Webkit לדפדפנים סלולריים Ppt
 
WebKit and Blink: open development powering the HTML5 revolution
WebKit and Blink: open development powering the HTML5 revolutionWebKit and Blink: open development powering the HTML5 revolution
WebKit and Blink: open development powering the HTML5 revolution
 
Measuring Web Performance - 自己満足で終わらないためのパフォーマンス計測 -
Measuring Web Performance - 自己満足で終わらないためのパフォーマンス計測 -Measuring Web Performance - 自己満足で終わらないためのパフォーマンス計測 -
Measuring Web Performance - 自己満足で終わらないためのパフォーマンス計測 -
 
WebKit, why it matters (PDF version)
WebKit, why it matters (PDF version)WebKit, why it matters (PDF version)
WebKit, why it matters (PDF version)
 
WebKitGtk+ Project
WebKitGtk+ ProjectWebKitGtk+ Project
WebKitGtk+ Project
 
Guides To Analyzing WebKit Performance
Guides To Analyzing WebKit PerformanceGuides To Analyzing WebKit Performance
Guides To Analyzing WebKit Performance
 
Quran as guidance
Quran as guidanceQuran as guidance
Quran as guidance
 
Guidance from the noble Quran edited by shaykh mufti afzal hoosen elias
Guidance from the noble Quran edited by shaykh mufti afzal hoosen eliasGuidance from the noble Quran edited by shaykh mufti afzal hoosen elias
Guidance from the noble Quran edited by shaykh mufti afzal hoosen elias
 
Irfan e hidayat az ifadat imam e ahle sunnat
Irfan e hidayat az ifadat imam e ahle sunnatIrfan e hidayat az ifadat imam e ahle sunnat
Irfan e hidayat az ifadat imam e ahle sunnat
 
Understanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile BrowsersUnderstanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile Browsers
 
Presentasi narkoba2013
Presentasi narkoba2013Presentasi narkoba2013
Presentasi narkoba2013
 
[KOR][E-Kor-Seminar 2014][2/8] Webkit EFL (Ryuan)
[KOR][E-Kor-Seminar 2014][2/8] Webkit EFL (Ryuan)[KOR][E-Kor-Seminar 2014][2/8] Webkit EFL (Ryuan)
[KOR][E-Kor-Seminar 2014][2/8] Webkit EFL (Ryuan)
 

Similar to Understanding Webkit Rendering

Document Object Model
Document Object ModelDocument Object Model
Document Object Modelchomas kandar
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Modelchomas kandar
 
Integrate Spring MVC with RequireJS & Backbone.js & Spring Data JPA
Integrate Spring MVC with RequireJS & Backbone.js & Spring Data JPAIntegrate Spring MVC with RequireJS & Backbone.js & Spring Data JPA
Integrate Spring MVC with RequireJS & Backbone.js & Spring Data JPACheng Ta Yeh
 
Introduction to Web Programming
Introduction to Web ProgrammingIntroduction to Web Programming
Introduction to Web ProgrammingYnon Perek
 
Understanding the dom by Benedict Ayiko
Understanding the dom by Benedict AyikoUnderstanding the dom by Benedict Ayiko
Understanding the dom by Benedict AyikoDamalie Wasukira
 
Single page applications mit asp.net mvc und der asp.net web api
Single page applications mit asp.net mvc und der asp.net web apiSingle page applications mit asp.net mvc und der asp.net web api
Single page applications mit asp.net mvc und der asp.net web apiAlexander Zeitler
 
Custom Android Code Templates
Custom Android Code TemplatesCustom Android Code Templates
Custom Android Code Templatesmurphonic
 
Build and Deploy Sites Using Features
Build and Deploy Sites Using Features Build and Deploy Sites Using Features
Build and Deploy Sites Using Features Phase2
 
Polymer and web component
Polymer and web componentPolymer and web component
Polymer and web componentImam Raza
 
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Sadaaki HIRAI
 
Modular applications with montage components
Modular applications with montage componentsModular applications with montage components
Modular applications with montage componentsBenoit Marchant
 
Client Server 3.0 - 6 Ways JavaScript is Revolutionizing the Client/Server Re...
Client Server 3.0 - 6 Ways JavaScript is Revolutionizing the Client/Server Re...Client Server 3.0 - 6 Ways JavaScript is Revolutionizing the Client/Server Re...
Client Server 3.0 - 6 Ways JavaScript is Revolutionizing the Client/Server Re...Jesse Cravens
 
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考えるIt is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考えるSadaaki HIRAI
 
J Query(04 12 2008) Foiaz
J Query(04 12 2008) FoiazJ Query(04 12 2008) Foiaz
J Query(04 12 2008) Foiaztestingphase
 
Exploring Critical Rendering Path
Exploring Critical Rendering PathExploring Critical Rendering Path
Exploring Critical Rendering PathRaphael Amorim
 
Jdbc Dao it-slideshares.blogspot.com
Jdbc Dao it-slideshares.blogspot.comJdbc Dao it-slideshares.blogspot.com
Jdbc Dao it-slideshares.blogspot.comphanleson
 

Similar to Understanding Webkit Rendering (20)

Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Integrate Spring MVC with RequireJS & Backbone.js & Spring Data JPA
Integrate Spring MVC with RequireJS & Backbone.js & Spring Data JPAIntegrate Spring MVC with RequireJS & Backbone.js & Spring Data JPA
Integrate Spring MVC with RequireJS & Backbone.js & Spring Data JPA
 
Introduction to Web Programming
Introduction to Web ProgrammingIntroduction to Web Programming
Introduction to Web Programming
 
Understanding the dom by Benedict Ayiko
Understanding the dom by Benedict AyikoUnderstanding the dom by Benedict Ayiko
Understanding the dom by Benedict Ayiko
 
Single page applications mit asp.net mvc und der asp.net web api
Single page applications mit asp.net mvc und der asp.net web apiSingle page applications mit asp.net mvc und der asp.net web api
Single page applications mit asp.net mvc und der asp.net web api
 
Custom Android Code Templates
Custom Android Code TemplatesCustom Android Code Templates
Custom Android Code Templates
 
Build and Deploy Sites Using Features
Build and Deploy Sites Using Features Build and Deploy Sites Using Features
Build and Deploy Sites Using Features
 
IOC + Javascript
IOC + JavascriptIOC + Javascript
IOC + Javascript
 
Polymer and web component
Polymer and web componentPolymer and web component
Polymer and web component
 
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
 
Modular applications with montage components
Modular applications with montage componentsModular applications with montage components
Modular applications with montage components
 
ActiveDOM
ActiveDOMActiveDOM
ActiveDOM
 
Client Server 3.0 - 6 Ways JavaScript is Revolutionizing the Client/Server Re...
Client Server 3.0 - 6 Ways JavaScript is Revolutionizing the Client/Server Re...Client Server 3.0 - 6 Ways JavaScript is Revolutionizing the Client/Server Re...
Client Server 3.0 - 6 Ways JavaScript is Revolutionizing the Client/Server Re...
 
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考えるIt is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
It is not HTML5. but ... / HTML5ではないサイトからHTML5を考える
 
HTML literals, the JSX of the platform
HTML literals, the JSX of the platformHTML literals, the JSX of the platform
HTML literals, the JSX of the platform
 
J Query(04 12 2008) Foiaz
J Query(04 12 2008) FoiazJ Query(04 12 2008) Foiaz
J Query(04 12 2008) Foiaz
 
Exploring Critical Rendering Path
Exploring Critical Rendering PathExploring Critical Rendering Path
Exploring Critical Rendering Path
 
Jdbc Dao it-slideshares.blogspot.com
Jdbc Dao it-slideshares.blogspot.comJdbc Dao it-slideshares.blogspot.com
Jdbc Dao it-slideshares.blogspot.com
 
Web components
Web componentsWeb components
Web components
 

More from Ariya Hidayat

Understanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile BrowsersUnderstanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile BrowsersAriya Hidayat
 
JavaScript Parser Infrastructure for Code Quality Analysis
JavaScript Parser Infrastructure for Code Quality AnalysisJavaScript Parser Infrastructure for Code Quality Analysis
JavaScript Parser Infrastructure for Code Quality AnalysisAriya Hidayat
 
Build HTML5 App (Intel Elements 2011)
Build HTML5 App (Intel Elements 2011)Build HTML5 App (Intel Elements 2011)
Build HTML5 App (Intel Elements 2011)Ariya Hidayat
 
Hybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKitHybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKitAriya Hidayat
 
Analyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAnalyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAriya Hidayat
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitAriya Hidayat
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitAriya Hidayat
 
Efficient Graphics with Qt
Efficient Graphics with QtEfficient Graphics with Qt
Efficient Graphics with QtAriya Hidayat
 
Writing Tools using WebKit
Writing Tools using WebKitWriting Tools using WebKit
Writing Tools using WebKitAriya Hidayat
 

More from Ariya Hidayat (9)

Understanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile BrowsersUnderstanding Hardware Acceleration on Mobile Browsers
Understanding Hardware Acceleration on Mobile Browsers
 
JavaScript Parser Infrastructure for Code Quality Analysis
JavaScript Parser Infrastructure for Code Quality AnalysisJavaScript Parser Infrastructure for Code Quality Analysis
JavaScript Parser Infrastructure for Code Quality Analysis
 
Build HTML5 App (Intel Elements 2011)
Build HTML5 App (Intel Elements 2011)Build HTML5 App (Intel Elements 2011)
Build HTML5 App (Intel Elements 2011)
 
Hybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKitHybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKit
 
Analyzing the Performance of Mobile Web
Analyzing the Performance of Mobile WebAnalyzing the Performance of Mobile Web
Analyzing the Performance of Mobile Web
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKit
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKitHybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKit
 
Efficient Graphics with Qt
Efficient Graphics with QtEfficient Graphics with Qt
Efficient Graphics with Qt
 
Writing Tools using WebKit
Writing Tools using WebKitWriting Tools using WebKit
Writing Tools using WebKit
 

Recently uploaded

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Recently uploaded (20)

Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

Understanding Webkit Rendering

  • 1. Understanding WebKit Rendering Ariya Hidayat Sunday, October 7, 12
  • 6. Browser at a High Level User Interface Data Persistence Browser Engine Render Engine Networking JavaScript Graphics I/O Engine Stack Sunday, October 7, 12
  • 7. WebKit Components Render Engine CSS DOM SVG HTML Canvas WebCore Client Interface JavaScript Engine (JSC/V8) Sunday, October 7, 12
  • 8. Platform Abstraction Networking Thread Geolocation Timer I/O Client Interface Clipboard Events Theme Graphics API Calls Events Port (Chrome, Safari, etc.) Sunday, October 7, 12
  • 10. From Contents to Pixels DOM Render Layout HTML DOM HTML Parser Tree Render Paint Tree Style CSS Style Sheets Parser Rules http://www.html5rocks.com/en/tutorials/internals/howbrowserswork Sunday, October 7, 12
  • 11. DOM Tree <html><body><p>Hello</p></body></html> HTMLDocument HTMLBodyElement HTMLParagraphElement attributes, children, contents Sunday, October 7, 12
  • 12. HTML Parsing tag <html><body><p>Hello</p></body></html> Loader Tokenizer text DOM Tree May come in chunks Tree Builder Section 12.2 in HTML Specification http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#parsing Sunday, October 7, 12
  • 13. DOM Tree vs Render Tree HTMLDocument RenderRoot HTMLBodyElement RenderBody HTMLParagraphElement RenderText There is no Render* for display:none Sunday, October 7, 12
  • 14. “Attach” Process Historical: Node is invisible, attach it to the main view to make it visible View 1:1 many:1 Node/Element RenderObject RenderStyle tree structure/navigation <div>42</div> computed style metrics (box model) hit testing another tree structure Sunday, October 7, 12
  • 16. It’s a forest! Sunday, October 7, 12
  • 17. Effects of Style Recalc and Layout document.getElementById('box').style.top = '100px'; Aggregated “dirty” area document.getElementById('box').style.backgroundColor = 'red'; No layout necessary, metrics are not flagged as “changed” Sunday, October 7, 12
  • 18. Getting the Right Style Stylesheet List HTMLDocument p { color: blue } HTMLBodyElement HTMLParagraphElement DOM Tree RenderStyle CSS Style Selector: id, class, tags, ... Sunday, October 7, 12
  • 19. Minimizing Layout Element clientHeight focus() clientLeft getBoundingClientRect() clientTop getClientRects() clientWidth scrollByLines() offsetHeight scrollByPages() offsetLeft scrollHeight offsetParent scrollIntoView() offsetTop scrollIntoViewIfNeeded() offsetWidth scrollLeft scrollTop scrollWidth innerText outerText http://gent.ilcore.com/2011/03/how-not-to-trigger-layout-in-webkit.html http://code.google.com/p/chromium/source/search?q=%22-%3EupdateLayoutIgnorePendingStylesheets()%22 Sunday, October 7, 12
  • 21. Goals of Painting • “Visualize” all RenderObjects (again, tree traversal) • All painting commands go to GraphicsContext abstraction • Important Optimizations • Clipped to the visible viewport • Back-to-front Transparency & clipping Sunday, October 7, 12
  • 22. CSS Painting: 10 Stages http://www.w3.org/TR/CSS2/zindex.html Appendix E. Elaborate description of Stacking Contexts • Background • Floats • Foreground • Selection Done by the render objects • Outline (in the render tree) Sunday, October 7, 12
  • 23. Graphics Abstraction Chromium Android Qt Mac & iOS GraphicsContext Skia CoreGraphics QPainter graphics stack Native controls, RenderTheme e.g. form elements Sunday, October 7, 12
  • 24. Painting Flow: Browser vs WebKit Browser WebKit User scrolls the viewport Request painting, GraphicsContext Sometimes to the backing store Style change Mark “dirty” area Sunday, October 7, 12
  • 25. Path is Everything Sunday, October 7, 12
  • 26. Stroke = Outline Solid Dashed Dotted Textured Sunday, October 7, 12
  • 27. Brush = Fill None Solid Gradient Textured Sunday, October 7, 12
  • 28. Gradient = Non-uniform Pixel Values Sunday, October 7, 12
  • 29. Drawing Time: Solid vs Gradient Only border 14x slower Solid color fill (depending on the dimension) Linear gradient fill Radial gradient fill Sunday, October 7, 12
  • 30. Path Approximation Curves Polygon Sunday, October 7, 12
  • 31. Antialiasing Multiple levels of transparency Sunday, October 7, 12
  • 32. Transformation Scaling Perspective Rotation Sunday, October 7, 12
  • 34. Font Atlas Buffer Bye Sunday, October 7, 12
  • 35. Simple to Complex ell o! H Simple shape Solid color Curves Gradient brush Textured stroke Blur shadow Serif text Rotated Sunday, October 7, 12
  • 36. Simple to Complex ell o! H Simple shape Solid color Curves Gradient brush Textured stroke Blur shadow Serif text Make it as an image Rotated Sunday, October 7, 12
  • 38. Game vs Web Sunday, October 7, 12
  • 39. Game Text Textured objects Animation Transformation Physics Sunday, October 7, 12
  • 40. Large Area, but Still Bounded Sunday, October 7, 12
  • 41. Web Page Images Text Sunday, October 7, 12
  • 42. Challenges Predictable contents (assets) ✔ Mostly text ✔ Mostly images ✔ Initial response immediate Sunday, October 7, 12
  • 43. SoC = System-on-a-Chip CPU GPU Sunday, October 7, 12
  • 44. GPU Workflow Matrix Vertices Rendered Textured Sunday, October 7, 12
  • 45. Optimized for Games “Fixed” geometry Transformation Textured triangles Parallelism Sunday, October 7, 12
  • 46. Powerful Capabilities http://epicgames.com/technology/ http://www.rage.com/ epic-citadel Sunday, October 7, 12
  • 48. Fundamental Physical Limitations • Memory: Can’t store too much stuff • Speed: Quad-core CPU can do certain operations better • Bandwidth: Data transfer can be the bottleneck Sunday, October 7, 12
  • 50. Efficient Use of GPU Drawing Backing Layer & primitives stores compositing Sunday, October 7, 12
  • 51. Maps Tile Sunday, October 7, 12
  • 52. Pinch to Zoom when you pinch... Sunday, October 7, 12
  • 53. Responsive Interface decoupled Rendering Processor User interaction Sunday, October 7, 12
  • 54. Rendering vs Interaction Screen Backing Store Rendering Web Page User interaction Sunday, October 7, 12
  • 56. Progressive Rendering Fast but blurry Crisp but slow Sunday, October 7, 12
  • 57. Perceived Responsiveness User pinches Smooth scaled Blocky (but fast!) Sunday, October 7, 12
  • 58. Tiling System Texture upload .... .... CPU GPU Sunday, October 7, 12
  • 59. Tile Transformation Panning = Translation Zooming = Scaling Sunday, October 7, 12
  • 61. Typical Animation opacity, movement, scaling, rotation, ... Sunday, October 7, 12
  • 62. Principles of Fluid Animation At the beginning, push as many 1 resources as possible to the GPU 2 During the animation, minimize CPU-GPU interaction Sunday, October 7, 12
  • 63. Immediate vs Retained At the beginning... draw the shape onto a buffer For every animation tick... blit the buffer at (x, draw the shape at (x, y) y) x = x + 10 x = x + 10 Off main thread Sunday, October 7, 12
  • 64. Mechanics of Animation “Hey, this is good stuff. Cache it as texture Initialization “Apply [operation] to texture #42.” Animation step Sunday, October 7, 12
  • 65. Elements = Layer Sunday, October 7, 12
  • 67. Compositing By Force -webkit-transform: translateZ(0) Not needed for CSS .someid { -webkit-animation-name: somekeyframeanimation; -webkit-animation-duration: 7s; -webkit-transform: translateZ(0); } Don’t do that Sunday, October 7, 12
  • 68. Magical Advice Use translate3d for hardware acceleration Sunday, October 7, 12
  • 69. Magical Advice Use translate3d for hardware acceleration Sunday, October 7, 12
  • 70. Debugging in Safari defaults write com.apple.Safari IncludeInternalDebugMenu 1 Sunday, October 7, 12
  • 71. Compositing Indicators Texture (number = upload) Composited layer No associated texture Container layer Overflow Sunday, October 7, 12
  • 72. Avoid Texture Reupload No reupload Upload Opacity Position Everything else! Size Animation “Hardware accelerated CSS” Sunday, October 7, 12
  • 74. Color Transition @-webkit-keyframes box { 0% { -webkit-transform: background-color: blue; } 100% { -webkit-transform: background-color: green; } } Need a new texture uploaded to the GPU for every in-between color Sunday, October 7, 12
  • 75. Color Transition: The Trick Blended with http://jsfiddle.net/79AVn Sunday, October 7, 12
  • 76. Prepare and Reuse Hide the layer offscreen Viewport Sunday, October 7, 12
  • 77. Timer Latency Depending on user Animation end triggers the JavaScript callback JavaScript code kicks the next animation Prepare both animation and hide the “wrong” one Sunday, October 7, 12
  • 78. Avoid Overcapacity .... .... Think of the GPU memory like a cache. Sunday, October 7, 12
  • 81. There is No Silver Bullet Sunday, October 7, 12
  • 82. Thank You ariya.hidayat@gmail.com ariya.ofilabs.com @AriyaHidayat Sunday, October 7, 12