博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
webkit笔记(关键字)
阅读量:4030 次
发布时间:2019-05-24

本文共 2975 字,大约阅读时间需要 9 分钟。

原文链接:

1. WebKit是一个用于web browsers处理web pages的布局渲染引擎。 
2. WebKit提供了多个类用于显示web元素,同时它还实现了很多浏览器属性和特性。比如, 
点击链接进行页面转向,页面前进与后退,管理历史访问记录等等。 
3. WebKit 核心功能: 
    a:) Loading -> Get the data. 
        * Very Complicated. 
        * Split between WebKit & WebCore 
            WebCore/loader 
            WebCore/platform/network 
            FrameLoaderClient 
        * Two paths :Frames VS Resources 
      ----------------------------------------- 
        Loading a Frame 
        * Mostly FrameLoader 
        * Policy Stage 
            Block Pop-ups 
            Cross-process Navigation 
        * Provisional Phase 
            Download or Commit 
        * Commited Phase 
            Start of Parsing 
       ----------------------------------------- 
        * Uses DocLoader & Cache 
        * DocLoader 
            Takes a URL 
            Talks to Cache or Loader 
            Returns CachedResource 
        * CachedResource 
            Handles callbacks 
            Produces object (image,Font...) 
     b:) Parsing -> Make a DOM Tree 
        * HTML VS XML 
            HTMLTokenizer & HTMLParser 
            XMLTokenizer(SAX-style) 
        * Elements from ElementFactory 
        * DNS Prefetch 
        * Pre-load scanning 
        * XSS-Auditor 
     c:) Data Structures 
        * Parsing 
            DOM Tree 
        * Layout 
            RenderObjectTree 
               -> All information required to paint 
               -> Owned by the DOM Tree 
               -> Only created for rendered content 
            RenderStyleTree 
               -> All CSS style information 
               -> Owned by the Render Tree 
               -> RenderObjects share styles 
               -> RenderStyles share data members 
            RenderLayerTree 
               -> Transparency,Masking 
               -> z-ordering 
               -> Overflow clip 
               -> Reflections,Shadows,Transforms 
               -> Positioned content 
               -> Textures on the GPU (iPhone) 
        * Line Layout 
            LineBox Tree 
               -> Held by a RenderBlock 
               -> List of RootLineBoxes,one per line 
               -> Sub-tree of InlineBoxes 
               (Each InlineBox has a RenderObject 
                RenderObject may have many InlineBoxes mapping to them) 
       d:) Layout -> Put stuff in the right place 
       e:) Paint 
             -> Only Render* class paint 
             -> GraphicsContext abstraction 
             -> RenderTheme for platform bits 
       f:) HTML Editing 
         * Hit Testing 
             -> Tree walk from the root layer 
             -> Multple phases 
             -> Every mouse move (:hover,onmousemove) 
         * Selection 
             -> positionForPoint 
             -> VisiblePosition 
             -> Selection is painted via a paint phase 
         * EditCommand 
             -> All editing logic 
             -> Holds undo state 
             -> Built into undo group trees 
            (Examples: 
                 InsertTextCommand() 
                 DeleteSelectionCommand() 
                 ApplyStyleCommand() 
                 SetNodeAttributeCommand()) 
         * Undo/Redo 
              -> Managed by Webkit/OS Layer 
              -> Build off of EditCommands 
              -> execCommand undo/redo 
         * DOM Binding 
         * JS Binding Objects 
               
         ------------------------------------------ 
(注意: Loading -> Source Text 
        Parsing -> DOM Tree 
        attach() -> RenderObject Tree 
        Style Resolution -> RenderStyles 
        Layout -> LineBoxes,Layers 
        ---------------------------------- 
        RenderObjectExamples: 
         -> RenderBoxModelObject (CSS) 
         -> RenderSVGModelObject 
         -> RenderBlock (<div>,<p>) 
         -> RenderInline (<span>,<b>,<i>) 
         -> RenderImage (<img>) 
         -> RenderText (#text) 
         -> RenderTableCell (<td>) 
        ----------------------------------- 
        From Controls 
         -> Rendered by WebCore 
         -> Shadow DOM Trees 
         -> Theme images from the OS 



) 
4. Webkit中的Tree  
     a:) DOM Tree 
     b:) Render Tree 
         * Holds 
           Style information,computed metrics 
           Links to Founts,Images,Subframes 
           Shadow DOM Trees 
         * Handles 
           Layout 
           Paint 
           Hit testing 

转载地址:http://dumbi.baihongyu.com/

你可能感兴趣的文章
部分笔试算法题整理
查看>>
Ubuntu 13.10使用fcitx输入法
查看>>
pidgin-lwqq 安装
查看>>
mint/ubuntu安装搜狗输入法
查看>>
C++动态申请数组和参数传递问题
查看>>
opencv学习——在MFC中读取和显示图像
查看>>
retext出现Could not parse file contents, check if you have the necessary module installed解决方案
查看>>
pyQt不同窗体间的值传递(一)——对话框关闭时返回值给主窗口
查看>>
linux mint下使用外部SMTP(如网易yeah.net)发邮件
查看>>
北京联通华为光猫HG8346R破解改桥接
查看>>
python使用win32*模块模拟人工操作——城通网盘下载器(一)
查看>>
python append 与浅拷贝
查看>>
Matlab与CUDA C的混合编程配置出现的问题及解决方案
查看>>
2017阿里内推笔试题--算法工程师(运筹优化)
查看>>
python自动化工具之pywinauto(零)
查看>>
python一句话之利用文件对话框获取文件路径
查看>>
PaperDownloader——文献命名6起来
查看>>
PaperDownloader 1.5.1——更加人性化的文献下载命名解决方案
查看>>
如何将PaperDownloader下载的文献存放到任意位置
查看>>
C/C++中关于动态生成一维数组和二维数组的学习
查看>>