搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Part way through a particular web page, HTML stops being rendered

  • 3 回覆
  • 2 有這個問題
  • 1 次檢視
  • 最近回覆由 Voidsong

more options

I have an internal web page, and one of my users reported to me that it looked wrong in Firefox 5.0.

The page just has VERY simple HTML; it doesn't use CSS, but it has font tags with colors specified. The code has been generated by code, so it is completely uniform from line to line. Everything renders correctly for so many lines, and then all of a sudden the HTML stops rendering, and the remaining content of the file is displayed in plain text. You can easily View Source on the page and verify that the code is intact and correct. I am baffled by this issue that only seems to affect Firefox 5.o.

Although it's an internal web page, I've made a version of it publically available in case somebody would like to take a look at it. Any insight you have will be appreciated!

http://pulseofradio.com/public/posts/test.asp

I have an internal web page, and one of my users reported to me that it looked wrong in Firefox 5.0. The page just has VERY simple HTML; it doesn't use CSS, but it has font tags with colors specified. The code has been generated by code, so it is completely uniform from line to line. Everything renders correctly for so many lines, and then all of a sudden the HTML stops rendering, and the remaining content of the file is displayed in plain text. You can easily View Source on the page and verify that the code is intact and correct. I am baffled by this issue that only seems to affect Firefox 5.o. Although it's an internal web page, I've made a version of it publically available in case somebody would like to take a look at it. Any insight you have will be appreciated! http://pulseofradio.com/public/posts/test.asp

由 Voidsong 於 修改

被選擇的解決方法

I think you are not closing your FONT color tags correctly. For example:


<FONT face='arial' size=-1>6/13/2011 5:02:52 AM(EST): <STRONG><FONT COLOR='RED'>WUUQ </STRONG></FONT><FONT COLOR='BLACK'>logged in as: <STRONG><FONT COLOR='RED'>prepcw6 </STRONG></FONT><FONT COLOR='BLACK'> from <STRONG><FONT COLOR='RED'>66.18.36.6 </STRONG></FONT><FONT COLOR='BLACK'><HR>

When you start a run of BLACK, you aren't ending it. Each line ends with an opening FONT color tag. This results in deep nesting that apparently exceeds some threshold in Firefox.

Second, you've crossed the STRONG and FONT tags:


<STRONG><FONT>text node</STRONG></FONT>

This would be better written:


<STRONG><FONT>text node</FONT></STRONG>

For efficiency, if the STRONG tags are always red, you could use CSS and get rid of all the font color tags.


<style type="text/css"> body {color:black} strong {color:red} </style>
從原來的回覆中察看解決方案 👍 0

所有回覆 (3)

more options

選擇的解決方法

I think you are not closing your FONT color tags correctly. For example:


<FONT face='arial' size=-1>6/13/2011 5:02:52 AM(EST): <STRONG><FONT COLOR='RED'>WUUQ </STRONG></FONT><FONT COLOR='BLACK'>logged in as: <STRONG><FONT COLOR='RED'>prepcw6 </STRONG></FONT><FONT COLOR='BLACK'> from <STRONG><FONT COLOR='RED'>66.18.36.6 </STRONG></FONT><FONT COLOR='BLACK'><HR>

When you start a run of BLACK, you aren't ending it. Each line ends with an opening FONT color tag. This results in deep nesting that apparently exceeds some threshold in Firefox.

Second, you've crossed the STRONG and FONT tags:


<STRONG><FONT>text node</STRONG></FONT>

This would be better written:


<STRONG><FONT>text node</FONT></STRONG>

For efficiency, if the STRONG tags are always red, you could use CSS and get rid of all the font color tags.


<style type="text/css"> body {color:black} strong {color:red} </style>
more options

By the way, it's due to the new stricter HTML parser in Firefox 4+. To verify, you can turn it off. Please save any unfinished work first.

(1) In a new tab, type or paste about:config in the address bar and press Enter. Click the button promising to be careful.

(2) In the filter box, type or paste html5 and pause while the list is filtered

(3) Double-click html5.parser.enable to toggle it to false (it should turn bold).

Then return to the problem page and reload.

more options

Thank you. I knew the malformed HTML was not optimal (it had never been a priority to fix as it was just one of many poorly-coded legacy pages I inherited), but I was fascinated by the fact it worked in every other browser, and especially by the fact that it rendered fine most of the way down the page and then suddenly stopped! I appreciate your explaining that it had to do with the stricter HTML parser and/or exceeding a nesting threshold.

If only we lived in a world where all web browsers interpreted things the same...