blink渲染知识三- blocking and inlines

RenderBlock表明一个物体代表一个block,他内部的对象要被竖着排列。他内部的对象要么都是RenderBox,要么都是RenderLine.

RenderLine表明一个物体,这个物体从其外部来看,是要被放置到一个line内部的。他内部的物体必须全都是RenderLine.

为了满足上述原则,webkit会手动加入一些renderobject。

css标准里讲,一个Object的in-flowchildren说的是一个object的除了fixed和absoluted定位孩子之外的普通孩子。

一个对象可以说成是inlineblock, 意思是这个对象内部的孩子需要竖着排列,但是这个对象自己从外部来看要放置到一个line里。

Posted by DaveHyatt onThursday, August 9th, 2007 at 2:59 pm

In the previous entry I talked about the basic structure of a CSSbox. In this article I’m going to talk about subclasses ofRenderBox and about the concepts of block andinline.

A block flow is a box designed either to contain lines(e.g., a paragraph) or to contain other blocks that it stacksvertically. Example block flow elements in HTML are p and div.

An inline flow is an object that is designed to be part ofa line. Example inline flow elements in HTML are a, b,i and span.

In WebCore, there are three renderer classes that cover block andinline flows. RenderBlock, RenderInline andtheir common superclass RenderFlow.

RenderFlow.h
RenderBlock.h
RenderInline.h

An inline flow can be changed to a block flow (and vice versa)using the CSS display property.

div { display: inline }
span { display: block }

In addition to block and inline flows, there is another kind ofelement that can act as a block or inline: the replaced element. Areplaced element is an element whose rendering is unspecifiedby CSS. How the contents of the object render is left up to theelement itself. Examples of replaced elements are images, formcontrols, iframes, plugins and applets.

A replaced element can also be either block-level or inline-level.When a replaced element acts as a block, it will get stackedvertically as though it represents its own paragraph. When a replacedelement acts as an inline, it will be part of a line inside aparagraph. Replaced elements are inline by default.

Form controls are actually a strange special case. They are stillreplaced elements, but because they are implemented by the engine,controls actually ultimately subclass from RenderBlock.As a result, the concept of being replaced can’t really be confinedto a single common subclass, and is therefore represented as a bit onRenderObject instead. The isReplaced methodcan be used to ask if an object is a replaced element.

bool isReplaced() const

Images, plugins, frames and applets all inherit from a commonsubclass that implements replaced element behavior. This class isRenderReplaced.

RenderReplaced.h

TheInline Block

One of the most confusingly named objects in CSS is theinline-block. Inline blocks are block flows that are designedto sit on a line. In effect they are like inline replaced elements onthe outside, but on the inside they are block flows. The displayproperty in CSS can be used to create inline blocks. Inline blockswill report true if asked if they are replaced.

div { display: inline-block }
Tables

Tables in HTML are block-level by default. However they can alsobe made into inlines using the CSS display property with a value ofinline-table.

table { display: inline-table }

Again, from the outside an inline-table is like an inline replacedelement (and will return true from isReplaced), but on the inside theobject is still just a table.

In WebCore the RenderTable class represents a table.It inherits from RenderBlock for reasons that will be covered in thepositioning section later.

RenderTable.h

Text

Raw text is represented using the RenderText class.Text is always considered inline by WebCore, since it is alwaysplaced on lines.

RenderText.h

GettingBlock and Inline Information

The most basic method for obtaining block vs. inline status is theisInline function. This method asks if an object isdesigned to be part of a line. It does not care what the interior ofthe element is (e.g., text, image, an inline flow, an inline-block oran inline-table).

bool isInline() const

One of the common mistakes people make when working with therender tree is assuming that isInline means an object isalways an inline flow, text or an inline replaced element. Howeverbecause of inline-blocks and inline-tables, this method can returntrue even for these objects.

To ask if an object is actually a block or inline flow, thefollowing methods should be used.

bool isInlineFlow() const
bool isBlockFlow() const

These methods are essentially asking questions about the interiorof the object. An inline-block for example is still a block flow andnot an inline flow. It is inline on the outside, but on the inside itis a block flow.

The exact class type can be queried for blocks and inlines usingthe following methods.

bool isRenderBlock() const
bool isRenderInline() const

The isRenderBlock method is useful in the context ofpositioning, since both block flows and tables act as positionedobject containers.

To ask if an object is specifically an inline block or inlinetable, the isInlineBlockOrInlineTable method can beused.

bool isInlineBlockOrInlineTable() const

Childrenof Block Flows

Block flows have a simple invariant regarding their children thatthe render tree always obeys. That rule can be summarized as follows:

All in-flow children of a block flow must be blocks, or allin-flow children of a block flow must be inlines.

In other words, once you exclude floating and positioned elements,all of the children of a block flow in the render tree must returntrue from isInline or they must all return false fromisInline. The render tree will change its structure asneeded to preserve this invariant.

The childrenInline method is used to ask whether thechildren of a block flow are inlines or blocks.

bool childrenInline() const

Childrenof Inline Flows

Children of inline flows have an even simpler invariant that mustbe maintained.

All in-flow children of an inline flow must be inlines.

AnonymousBlocks

In order to preserve the block flow child invariant (only inlinechildren or only block children), the render tree will constructobjects called anonymous blocks. Consider the followingexample:

<div>
Some text
<div>
Some more text
</div>
</div>

In the above example, the outer div has two children: some textand another div. The first child is an inline, but the second childis a block. Because this combination of children violates theall-inline or all-block child rule, the render tree will construct ananonymous block flow to wrap the text. The render tree thereforebecomes:

<div>
<anonymous block>
Some text
</anonymous block>
<div>
Some more text
</div>
</div>

The isAnonymousBlock method can be used to ask if arenderer is an anonymous block flow.

bool isAnonymousBlock() const

Whenever a block flow has inline children and a block objectsuddenly tries to insert itself as a child, anonymous blocks will becreated as needed to wrap all of the inlines. Contiguous inlines willshare a single common anonymous block, so the number of anonymousblocks can be kept to a minimum. The makeChildrenNonInlinemethod in RenderBlock is the function that performs thisadjustment.

void makeChildrenNonInline(RenderObject *insertionPoint)

Blocksinside Inline Flows

One of the nastiest constructs you will see in HTML is when ablock is placed inside an inline flow. Here is an example:

<i>Italic only <b>italic and bold
<div>
Wow, a block!
</div>
<div>
Wow, another block!
</div>
More italic and bold text</b>
More italic text</i>

The two divs violate the invariant that all of the children of thebold element must be inlines. The render tree has to perform a rathercomplicated series of steps in order to fix up the tree. Threeanonymous blocks are constructed. The first block holds all of theinlines that come before the divs. The second anonymous block holdsthe divs. The third anonymous block holds all of the inlines thatcome after the divs.

<anonymous pre block>
<i>Italic only <b>italic and bold</b></i>
</anonymous pre block>
<anonymous middle block>
<div>
Wow, a block!
</div>
<div>
Wow, another block!
</div>
</anonymous middle block>
<anonymous post block>
<i><b>More italic and bold text</b> More
italic text</i>
</anonymous post block>

Notice that the bold and italic renderers had to split into tworender objects, since they are in both the anonymous pre block andthe anonymous post block. In the case of the bold DOM element, itschildren are in the pre block, but then continue into the middleblock and then finally continue into the post block. The render treeconnects these objects via a continuation chain.

RenderFlow* continuation() const
bool isInlineContinuation() const

The first bold renderer in the pre block is the one that can beobtained from the b DOM element using the element’srenderer() method. This renderer has as itscontinuation() the middle anonymous block. The middleanonymous block has as its continuation() the secondbold renderer. In this way code that needs to examine the renderersthat represent the children of the DOM element can still do sorelatively easily.

In the above example the i DOM element also split.Its children are all in the pre and post blocks, and therefore onlyone connection is needed. The italic renderer in the pre block setsits continuation() to the italic renderer in the postblock.

The function that performs the recursive splitting of inline flowsand that creates the continuation chain connections is calledsplitFlow and is in RenderInline.cpp.

You can follow any responses to this entry through the RSS2.0 feed. Both comments and pings are currently closed.







两路半桥LLC谐振变换器软开关Simulink仿真(模拟谐振参数不同、分裂电容) 内容概要:本文介绍了“两路半桥LLC谐振变换器软开关Simulink仿真”资源包,重点在于基于Simulink平台对两路半桥LLC谐振变换器进行高精度建模与动态仿真,特别考虑了谐振参数不一致及分裂电容等非理想工况对系统性能的影响。该仿真模型不仅涵盖了主电路拓扑、软开关实现机制与谐振网络设计,还深入分析了不同参数配置下系统的启动特性、稳态效率、动态响应及软开关条件的满足情况。通过参数扫描与对比仿真,帮助用户掌握LLC变换器的关键设计要素与优化方法,具备较强的工程指导价值和科研教学意义。; 适合人群:电力电子、电气工程及其自动化等相关专业的高校师生,以及从事高频开关电源、新能源变换器、车载充电机等领域的研发工程师和技术人员。; 使用场景及目标:① 掌握两路并联半桥LLC谐振变换器的建模与仿真方法;② 理解软开关技术在提升变换器效率与降低EMI方面的关键作用;③ 分析谐振参数偏差与分裂电容结构对系统均流特性、增益曲线及软开关范围的影响;④ 支持科研项目中的拓扑验证、控制策略开发与故障工况分析; 阅读建议:建议结合Simulink仿真模型与配套说明文档进行学习,重点关注谐振腔参数设置、驱动时序设计及软开关波形观测;可通过调整谐振电感、电容值或引入参数失配,观察系统行为变化,深入理解LLC变换器的稳定边界与优化设计原则。 立即下载

相关推荐

双向全桥CLLC谐振变换器仿真模型(Simulink仿真实现)

内容概要:本文系统介绍了双向全桥CLLC谐振变换器的Simulink仿真模型,重点阐述了变频控制、闭环仿真及其与多种电力电子拓扑(如维也纳整流器、DAB变换器、图腾柱PFC等)的联合仿真设计。资源包涵盖2.5kW双向全桥LLC、V2G电动汽车充放电系统、三相PFC、多相交错LLC等多种变换器的仿真案例,并深入展示了三电平VIENNA整流器在双闭环PI控制与SVPWM调制策略下,结合上下电容电压差值补偿实现中点电位平衡的先进控制方法。通过仿真验证,该策略不仅有效维持了800V直流母线电压的稳定,还在动态工况下显著提升了电容电压的均衡度,同时保持了较低的输入电流THD,充分体现了SVPWM与中点平衡控制协同优化的技术优势。; 适合人群:具备电力电子与自动控制理论基础,从事新能源发电、电动汽车、工业电源、微电网等领域的研究生、工程师及科研人员。; 使用场景及目标:① 学习并构建高频谐振变换器(如LLC、CLLC)的Simulink仿真模型,掌握其变频与混合控制策略;② 深入理解并应用中点电位平衡、双闭环PI控制、SVPWM调制等核心技术于VIENNA等三电平变换器中;③ 复现高水平期刊论文中的控制算法,服务于科研项目申报、学术论文撰写或工程产品开发。; 阅读建议:该资源为综合性仿真资料库,建议使用者结合自身研究方向(如电动汽车充电、新能源并网)选择对应案例进行精学,重点关注控制策略的设计逻辑、仿真参数的整定方法以及SVPWM与中点平衡的协同机制,并充分利用附带的计算书和参考文献深化理解,以实现从仿真模型到实际工程应用的顺利转化。

像素的一生—浏览器渲染流水线简述

点击上方前端Q,关注公众号回复加群,加入前端Q技术交流群提到浏览器不得不说Chrome,Chrome是Google发行的商业产品,而Chromium是一个开源版本的Chrome,两者很像...

LuckyWinty的博客 1502

全桥LLC谐振(变频+移相混合控制)变换器闭环仿真模型(Simulink仿真实现)

全桥LLC谐振(变频+移相混合控制)变换器闭环仿真模型(Simulink仿真实现)

《WebKit 技术内幕》学习之七(4): 渲染基础

一个RenderObject类的“paint”函数在绘制时可能会被多次调用,因为不同的绘制阶段(前面的一张图提到的)都需要调用它来绘制不同的部分,所以读者会发现上图右侧标记了在哪些阶段才会调用该绘制函数(或者是哪些阶段该函数不会被调用),至于这些阶段的顺序则是由RenderLayer对象中的调用过程来控制的。这里是一个大致的过程,下面是详细分析。细心的读者其实可以发现,这一过程需要一些内存方面的拷贝,这是因为网页的渲染和网页的显示是在两个不同的进程,而这些拷贝在下一章介绍的硬件加速渲染机制中可以避免。

jyl_sh的专栏 1239

Ubuntu技巧-Ubuntu远程访问之SSH反向代理

💡大家好,我是可夫小子,《小白玩转ChatGPT》专栏作者,关注AIGC、互联网和自媒体。要把内网的一台的Ubuntu服务器让外面也能访问,总共有三种可行的方案,前面已经介绍了两种方式,今天就来介绍更健壮稳定的方式——ssh反向代理。大概的框架图如下,今天就从服务器购买到设置,手把手的教程,让你花费100块以内,就拥有一个强大的「云服务器」。

可夫小子的频道 1153

Java对接快递鸟,查询快递物流信息

根据用户输入的订单号,我们的后台识别订单号并根据快递鸟查询快递API接口,实现自动查询的功能。下面是java版本的根据单号查询物流跟踪信息的详细示例代码。只需要下载就可以运行,(自己需要简单的修改)注:登录快递鸟用户管理后台后获得。登录快递鸟用户管理后台。

Roc的博客 960

WebKit渲染基础之Render树的建立

WebKit是一个渲染引擎,而不是一个浏览器,它专注于网页内容展示,其中渲染是其中核心的部分之一。这里着重于对渲染部分的基础进行一定程度的了解和认识,主要理解基于DOM树来介绍Render树和RenderLayer树的构建由来和方式。 那么什么是DOM?简单来说,DOM是对HTML或者XML等文档的一种结构化表示方法,通过这种方式,用户可以通过提供标准的接口来访问HTML页面中的任何元素的相

巴黎的妖 1543

SAP 发货在途库存管理:POD确认差异下的2种后续调整方案对比

本文详细解析了SAP发货在途库存管理中POD确认差异后的财务调整方案,对比了移动类型417和555 T两种处理方式的适用场景及财务影响。通过实际案例说明如何优化POD流程,减少库存差异损失,提升供应链管理效率。特别适合SAP SD模块用户及供应链管理人员参考。

chiman6219的博客 395

【浏览器渲染原理】渲染树构建之渲染树和DOM树的关系

在DOM树构建的同时,浏览器会构建渲染树(render tree)。渲染树的节点(渲染器),在Gecko中称为frame,而在webkit中称为renderer。渲染器是在文档解析和创建DOM节点后创建的,会计算DOM节点的样式信息。        在webkit中,renderer是由DOM节点调用attach()方法创建的。attach()方法计算了DOM节点的样式信息。Attach()是自

青青木屋 1万+

【计算机视觉】基于复杂环境下的车牌识别

本文针对复杂环境下(光照变化、车牌变形、噪声干扰)的车牌识别问题,提出了一套完整的优化方案。通过四个核心环节进行改进:1)采用CLAHE、同态滤波等技术优化光照处理;2)使用边缘检测和透视变换应对车牌变形;3)结合中值滤波和暗通道去噪算法消除干扰;4)改进字符分割与识别方法。文章提供了详细的Python实现代码,展示了从预处理到字符识别的完整流程,并通过多策略融合显著提升了复杂场景下的识别准确率。实验结果表明,该方法能有效应对各类复杂环境挑战,为实际应用提供了可靠解决方案。

2401_84149564的博客 1628

Genesis物理引擎实战指南:轻量级确定性刚体仿真核心

刚体物理仿真作为机器人控制、嵌入式运动学验证和确定性游戏开发的基础技术,其核心在于数值稳定性、跨平台可复现性与约束求解精度。本文围绕线性互补问题(LCP)求解、半隐式欧拉积分和零依赖C++实现三大关键技术展开,解析如何在无GUI、低算力环境下构建可单步调试、帧级可控的确定性仿真系统。重点覆盖碰撞检测数学建模、关节局部坐标系绑定、质量-惯性张量一致性校验等工程落地关键点,适用于STM32、树莓派及教育实验场景。内容深度结合Genesis Physics Engine的源码实践,直击‘穿模’‘NaN’‘关节发软

ciya3282的博客 1592

WEB前端底层知识之浏览器是如何工作的(4)--Render树与CSS解析

WEB前端底层知识之浏览器是如何工作的(4)--Render树与CSS解析    浏览器在构造DOM树的同时也在构造着另一棵树-Render Tree,与DOM树相对应暂且叫它Render树吧,我们知道DOM树为javascript提供了一些列的访问接口(DOM API),但这棵树是不对外的。它的主要作用就是把HTML按照一定的布局与样式显示出来,用到了CSS的相关知识。从MVC

wpnhwq2013的专栏 742

【WorkBuddy专栏36】从踩坑到上线——WorkBuddy代码开发避坑指南与部署完全手册

【WorkBuddy专栏36】从踩坑到上线——WorkBuddy代码开发避坑指南与部署完全手册

AI人人懂 1074

前端性能优化关键词:Render blocking resources

什么是Render blocking resources?根据前几篇提到的浏览器渲染过程,有了DOM 和 CSSOM 之后,浏览器才开始渲染。所以挡在渲染前面的资源都叫做阻塞渲染的资源。这些资源包括:HTML,当然了,没有DOM,就没什么可渲染的;CSS,根据浏览器渲染过程看到,没有CSSOM,也不会开始渲染;JavaScript,因为JS有可能改变页面内容和样式,所以浏览器会等待JS加载完成并解...

PlayerYK的专栏 854

【YOLOv11改进- 主干网络】YOLOv11+RepViT: 从ViT的角度重新审视Mobile的CNN助力YOLOv11有效涨点;

本文给大家带来的改进内容是在YOLOv11中更换主干网络为RepViT,助力YOLOv11有效涨点,论文通过集成轻量级 ViT 的高效架构设计,逐步增强了标准轻量级 CNN(即 MobileNetV3)的移动友好性。这最终产生了一个新的纯轻量级 CNN 系列的主干网络。

qq_41304809的博客 789

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

webkit 绘制部分代码解析

webkit进行最终绘制的逻辑是从frameview进行刷新调用        RenderLayer     RenderBlock     RenderBox 加入我们针对各个elemenet的定制的情况     下面我们看一个具体的调用的流程: #0  WebCore::RenderTheme::paint (this=0x24eed0, o=0xd15fa8, paintInf

东辉在线的专栏 5546

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

Chromium扩展(Extension)通信机制分析

Chromium的Extension由Page和Content Script组成。如果将Extension看作是一个App,那么Page和Content Script就是Extension的Module。既然是Module,就避免不了需要相互通信。也正是由于相互通信,使得它们形成一个完整的App。本文接下来就分析Extension的Page之间以及Page与Content Script之间的通信机制。

老罗的Android之旅 6万+

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

Chromium网页加载过程简要介绍和学习计划

Chromium加载网页的过程,需要Browser进程和Render进程协作完成。加载网页的过程由Browser进程发起,向服务器请求网页内容的过程也是由Browser进程完成。Render进程负责对下载回来的网页内容进行解析,解析之后得到一个DOM Tree。有了这个DOM Tree之后,Render进程就可以对网页进行渲染了。本文接下来就对上述过程涉及到的重要概念进行简要介绍以及制定学习计划。

老罗的Android之旅 3万+

Chromium浏览器之渲染引擎Blink

Blink是谷歌公司的浏览器Chromium使用的渲染引擎。 Blink处于一个包容性的开源社区里,它欢迎任何人分享其使命。 Blink是在一种抽象的平台上实现的, 因此本身不能运行。 Chromium Content module提供这个抽象平台运行所需的Blink的实现。 Content模块的开发有专门的文档描述。有关调试Blink一些提示和建议,请参阅入门Blink调试页面。

不积跬步无以至千里,不积小流无以成江海 5729

Chromium Chromium Blink

Google 宣布将在未来的 Google Chrome/Chromium 中使用基于 WebKit 的 fork Web 渲染引擎:Blink

lusic01的专栏 630

Chromium的Plugin进程启动过程分析

前面我们分析了Chromium的Render进程和GPU进程的启动过程,它们都是由Browser进程启动的。在Chromium中,还有一类进程是由Browser进程启动的,它们就是Plugin进程。顾名思义,Plugin进程是用来运行浏览器插件的。浏览器插件的作用是扩展网页功能,它们由第三方开发,安全性和稳定性都无法得到保证,因此运行在独立的进程中。本文接下来就详细分析Plugin进程的启动过程。

老罗的Android之旅 1万+

chromium:LoadUrl之后会发生那些事情之 blink UpdateLayers

一 综述 在Layout后,Blink会从DOM Tree创建好 LayoutTree,CompositedLayer,以及其后端存储GraphicsLayer。接下来需要做的事就是调用网页(失效区域)中所有LayoutObject的paint方法,将其绘制命令保存到context中。 二 blink绘制流程 Call Stack: #0  blink::LayoutBlock::pain

Fantasy_116的专栏 1224

Blink其实都在意料之中——Chromium Committer朱永盛访谈

朱永盛, Web技术和WebKit/Chromium社区的爱好者和贡献者。2010年之前,从事于XML和XSLT编译器的开发和优化工作。自2010年开始,参与开发过多个基于WebKit/Chromium的项目,一直对WebKit/Chromium开源社区保持关注和贡献,去年成为Chromium项目的Committer。\u0026#xD;\n作为QCon北京2013“跨终端的Web”的演讲嘉宾,朱...

啊啊啊啊2 823

chromium+blink网页加载流程

内容目录 1 加载网页的大致过程 1 2 加载网页详细过程 1 2.1.Browser准备加载 1 2.2.Render准备加载 2 2.3.browser的实际加载工作 3 2.3.1 browser开始加载request 3 2.3.2 http层的工作 3 2.3.2.1 收到responseheader 4 2.3.2.2 收到response

1112
上一篇: blink渲染知识(二) - webcore rendering basics
下一篇: blink渲染知识四 - layout basics
csshell2002
博客等级 码龄11年 30粉丝 41原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值