亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

ディレクトリ 検索
Attributes accesskey (attribute) class (attribute) contenteditable (attribute) contextmenu (attribute) data-* (attribute) dir (attribute) draggable (attribute) dropzone (attribute) Global attributes hidden (attribute) id (attribute) itemid (attribute) itemprop (attribute) itemref (attribute) itemscope (attribute) itemtype (attribute) lang (attribute) slot (attribute) spellcheck (attribute) style (attribute) tabindex (attribute) title (attribute) translate (attribute) Elements a abbr address area article aside audio b base bdi bdo blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 head header hr html i iframe img input input type="button" input type="checkbox" input type="color" input type="date" input type="datetime"-local input type="email" input type="file" input type="hidden" input type="image" input type="month" input type="number" input type="password" input type="radio" input type="range" input type="reset" input type="search" input type="submit" input type="tel" input type="text" input type="time" input type="url" input type="week" ins kbd label legend li link main map mark menu menuitem meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt rtc ruby s samp script section select slot small source span strong style sub summary sup table tbody td template textarea tfoot th thead time title tr track u ul var video wbr Miscellaneous Attributes Block-level elements CORS enabled image CORS settings attributes Element Inline elements Kinds of HTML content Link types Microdata Optimizing your pages for speculative parsing Preloading content Reference Supported media formats Using the application cache Obsolete acronym applet basefont big blink center command content dir element font frame frameset hgroup image input type="datetime" isindex keygen listing marquee nextid noframes plaintext strike tt xmp
テキスト

傳統(tǒng)上,在瀏覽器中,HTML解析器已經(jīng)在主線程上運行,并在</script>標記后被阻塞,直到腳本從網(wǎng)絡中檢索并執(zhí)行。Firefox 4及更高版本中的HTML解析器支持對主線程進行推測性解析。在腳本被下載和執(zhí)行時,它會提前解析。與Firefox 3.5和3.6中一樣,HTML解析器會為流中發(fā)現(xiàn)的腳本,樣式表和圖像啟動推測加載。但是,在Firefox 4及更高版本中,HTML解析器還推測性地運行HTML樹構建算法。好處在于,當推測成功時,不需要重新分析已經(jīng)掃描的用于腳本,樣式表和圖像的傳入文件的部分。不利的一面是,當投機失敗時,失去更多的工作。

這份文件可以幫助您避免那些使猜測失敗并減緩頁面加載速度的對象。

投機加載成功

只有一個規(guī)則可以使鏈接腳本,樣式表和圖像的投機加載成功:

  • 如果使用<base>元素來覆蓋頁面的基本URI,請將該元素放置在文檔的非腳本部分中。不要通過document.write()或添加它document.createElement()。

避免丟失tree builder的輸出

document.write()更改樹構建器狀態(tài)時,推測樹構建失敗,使得</script>標記之后的推測狀態(tài)在document.write()解析所有插入的內(nèi)容時不再成立。但是,只有不尋常的用途document.write()會造成麻煩。以下是要避免的事情:

  • 不要寫不平衡的樹。<script>document.write("<div>");</script>不好。<script>document.write("<div></div>");</script>沒問題。

  • 不要寫未完成的標記。<script>document.write("<div></div");</script>不好。

  • 不要以回車完成你的編碼。<script>document.write("Hello World!\r");</script>不好。<script>document.write("Hello World!\n");</script>沒問題。

  • 請注意,寫入平衡標簽可能會導致其他標簽被推斷,導致寫入不平衡。例如<script>document.write("<div></div>");</script>head元素內(nèi)部將被解釋為<script>document.write("</head><body><div></div>");</script>不平衡。

  • 不要格式化表格的一部分。<table><script>document.write("<tr><td>Hello World!</td></tr>");</script></table>不好。但是,<script>document.write("<table><tr><td>Hello World!</td></tr></table>");</script>沒關系。

  • TODO:其他格式化元素內(nèi)的document.write。

前の記事: 次の記事: