如果你忘记关闭HTML标签,Chrome会验证你的代码,并尝试修复类似这样的问题。
我有一个大问题,因为我忘记了一个关闭的表单标签,Chrome没有正确关闭它,而是删除了下面的表单,而不是输入,只是表单标签。
当我查看源代码本身时,Form-Tag在那里,但不在控制台的Elements-Tab中。
因此,一开始,我认为这一定与某些JS删除此DOM-Node并设置DOM-Breakpoint来查找脚本有关。
长话短说,我花了几个小时才发现,没有JS删除我的表单,但Chrome自己认为:有一个缺失,所以我删除了一些其他的来修复它……
有没有可能看看Chrome是否会自动改变你的DOM?
谢谢!
发布于 2019-01-28 21:27:57
浏览器引擎确实做到了。他们使用字符串替换方法,尽管它发生在内部。
<div>
</div>> // mistake
<div> //missing end tag
<div></div>
---------------------------------------------------
Methods
file=file.stringreplace('>>', '>')
an uneven count will add the missing div just after the next beginning div and conditionally if the missing is not found by the end of the file:
file=file.stringreplace('
<div>', '</div>
<div>')在修复了丢失和损坏的标签之后,解析引擎会解析文件,然后可以通过打开和关闭标签作为GUI框架来设置屏幕GUI小部件。它通过向实际的div标记添加标记、分隔符来实现这一点,从而使它们很容易相互区分。
<div1s>
</div1e>
<div1s>//section columns
<div2s></div2e>
<div2s></div2e>
<div2s></div2e>
</div1e>
<div1s>Footer</div1e>
-----------------------------------------------------
The GUI Frame Tokens
for each "<dive1>"{
FrameCreate(CSS--ATTRIBUTES FROM ASSOCIATIVE ARRAYS--)
//the GUI Frame Widgets VERTICAL SECTIONS
}
//Next it finds the nested divs2 and embeds these into the thir parents above but with embedded Text Widgets also.
FrameTextBoxCreate(--CSS MATED ATTRIBUTES RULES--)
div3 etc------and so on.事实上,它是在Chrome窗口小部件组中,在其自定义的马赛克画布窗口小部件组,在WebView中,它们将被修复。
https://stackoverflow.com/questions/54393795
复制相似问题