aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/mozilla_web_developer_faq/index.html
blob: c009cbc1e6eb13ed92438bb938eedb9b1471f6fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
---
title: Mozilla Web开发人员 FAQ
slug: Mozilla_Web_Developer_FAQ
tags:
  - Web开发
translation_of: Mozilla/Mozilla_Web_Developer_FAQ
---
<p>This document answers questions that Web authors ask frequently specifically in connection with Mozilla and other Gecko-based browsers such as Firefox. There are links to more general Web authoring FAQs at the end of this document.
</p>
<h2 id=".E4.BB.80.E4.B9.88.E6.98.AF.E2.80.9C.E6.80.AA.E5.BC.82.E6.A8.A1.E5.BC.8F.E2.80.9D.EF.BC.8C.E4.BB.80.E4.B9.88.E6.98.AF.E2.80.9C.E6.A0.87.E5.87.86.E6.A8.A1.E5.BC.8F.E2.80.9D.EF.BC.9F" name=".E4.BB.80.E4.B9.88.E6.98.AF.E2.80.9C.E6.80.AA.E5.BC.82.E6.A8.A1.E5.BC.8F.E2.80.9D.EF.BC.8C.E4.BB.80.E4.B9.88.E6.98.AF.E2.80.9C.E6.A0.87.E5.87.86.E6.A8.A1.E5.BC.8F.E2.80.9D.EF.BC.9F"> 什么是“怪异模式”,什么是“标准模式”? </h2>
<p>Mozilla has two and a half layout modes: <a href="cn/Mozilla's_Quirks_Mode">Quirks, Almost Standards and Standards</a>. In the Standards mode Mozilla aims to treat documents authored in compliance with the <a class="external" href="http://www.w3.org/TR/#Recommendations">Recommendations</a> of the <a class="external" href="http://www.w3.org/">World Wide Web Consortium</a> according to the W3C Recommendations. In the Quirks mode—for the purpose of backwards compatibility—Mozilla mimics some behaviors of legacy browsers in ways that could cause W3C Recommendation-compliant documents to be handled against the W3C specifications. The Almost Standards mode is like the Standards mode except it addresses the issue of the <a href="#Why_are_there_gaps_between_image_rows_in_tables_when_the_layout_engine_is_in_the_Standards_mode.3F">next question</a> by rendering table cells with images in the traditional way. The mode is picked based on the doctype declaration (or the lack thereof) at the beginning of an HTML document.
</p>
<ul><li> The easiest way to make sure that the <i>Standards mode</i> is activated for HTML, is to use this doctype declaration:<br><code><span class="nowiki">&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;</span></code>
</li><li> The easiest way to make sure that the <i>Almost Standards mode</i> is activated for HTML, is to use this doctype declaration:<br><code><span class="nowiki">&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;</span></code>
</li></ul>
<p>The former declaration is for documents that don’t include any deprecated markup. The latter is for documents that may include deprecated markup. In either case the document should <a class="external" href="http://validator.w3.org/">validate</a> and be compatible with the CSS2 layout model.
</p><p>The easiest way to activate the <i>Quirks mode</i> for HTML is to omit the doctype declaration. However, authoring new documents that rely on quirks is discouraged.
</p><p>The Almost Standards mode was introduced in Mozilla 1.1 beta and Mozilla 1.0.1. In earlier versions the doctype declarations that now activate the Almost Standards mode activated the Standards mode.
</p><p>Doctype sniffing only applies to documents served as <code>text/html</code>. Documents sent as XML always activate the Standards layout mode. This includes documents sent as <code>application/xhtml+xml</code>. The consequence is that XHTML 1.0 Transitional documents are rendered in the Almost Standards mode when served as <code>text/html</code> under pretext of the Appendix C but in the Standards Mode when served as <code>application/xhtml+xml</code>.
</p><p>Since also <a class="external" href="http://hsivonen.iki.fi/doctype/">other contemporary browsers</a> have a standards mode, activating the Standards mode or the Almost Standards mode in other browsers as well (using the above-mentioned exact doctypes) is the best way to get consistent CSS layout results across different browsers. On the other hand, the quirks implemented in the quirks modes of different browsers vary from browser to browser.
</p>
<h2 id="Why_are_there_gaps_between_image_rows_in_tables_when_the_layout_engine_is_in_the_Standards_mode.3F" name="Why_are_there_gaps_between_image_rows_in_tables_when_the_layout_engine_is_in_the_Standards_mode.3F"> Why are there gaps between image rows in tables when the layout engine is in the Standards mode? </h2>
<p>In the CSS2 box layout model the default <a class="external" href="http://www.w3.org/TR/REC-CSS2/visudet.html#q15">vertical sizing</a> of layout boxes and the default <a href="cn/CSS/vertical-align">vertical alignment</a> of images is different from the behavior of old browsers. These aspects of the layout can be changed by explicitly setting the <code>display</code> CSS property of the images (and possible surrounding <code>&lt;a&gt;</code> elements) to <code>block</code>.
</p><p>If the table cells that contain only an image are marked with <code>&lt;td class="imgcell"&gt;</code>, the required CSS rule is: <code>.imgcell img, .imgcell a { display: block; }</code>
</p><p><a href="cn/Images%2c_Tables%2c_and_Mysterious_Gaps">Longer explanation…</a>
</p>
<h2 id="Why_are_there_still_gaps_even_between_text_rows_in_tables_when_the_layout_engine_is_in_the_Standards_mode_or_in_the_Almost_Standards_mode.3F" name="Why_are_there_still_gaps_even_between_text_rows_in_tables_when_the_layout_engine_is_in_the_Standards_mode_or_in_the_Almost_Standards_mode.3F"> Why are there still gaps even between text rows in tables when the layout engine is in the Standards mode or in the Almost Standards mode? </h2>
<p>In the Standards mode and in the Almost Standards mode Mozilla does not suppress the default margins of the first and last child element in table cells. Therefore, the default margins for paragraphs apply even with markup such as <code>&lt;td&gt;&lt;p&gt;foo&lt;/p&gt;&lt;/td&gt;</code>.
</p><p>Often the content of a cell in a table of tabular data does not constitute a paragraph. In that case, the easy solution is not to mark the contents of the cell as a paragraph.
</p><p>When the paragraph markup is called for but the default margins are unwanted, zero margins can be suggested using CSS.
</p>
<h2 id=".E4.B8.BA.E4.BB.80.E4.B9.88.E6.88.91.E7.9A.84.E6.A0.B7.E5.BC.8F.E8.A1.A8.E4.B8.8D.E8.83.BD.E6.AD.A3.E5.B8.B8.E5.B7.A5.E4.BD.9C.EF.BC.9F" name=".E4.B8.BA.E4.BB.80.E4.B9.88.E6.88.91.E7.9A.84.E6.A0.B7.E5.BC.8F.E8.A1.A8.E4.B8.8D.E8.83.BD.E6.AD.A3.E5.B8.B8.E5.B7.A5.E4.BD.9C.EF.BC.9F"> 为什么我的样式表不能正常工作? </h2>
<p>Here’s the check list:
</p>
<ul><li> Does the HTML document <a class="external" href="http://validator.w3.org/">validate</a>? Styling misnested markup may cause strange effects.
<ul><li> The <code>&lt;link&gt;</code> and <code>&lt;style&gt;</code> elements should be inside the <code>&lt;head&gt;</code> element. </li></ul>
</li><li> Does the CSS style sheet pass the <a class="external" href="http://jigsaw.w3.org/css-validator/">syntax check</a>? The <a class="external" href="http://www.w3.org/TR/CSS21/syndata.html#parsing-errors">CSS error handling rules</a> require erroneous parts to be ignored rather than fixed by guessing.
<ul><li> Lengths other than zero should be followed by a proper unit without a space between the number and the unit (eg. <code>1.2em</code>).
</li><li> The character to use between the property name and the value is the colon—not the equal sign. </li><li> HTML markup, such as <code>&lt;style&gt;</code>, does not belong in .css files. </li><li> <code>font-face</code> is not a real CSS property. The property is <code>font-family</code> and <code>@font-face</code> is an at-rule. </li><li> If <code>@import</code> is used, it should be the first thing in a CSS file.
</li><li> In Mozilla 1.8a4 and later (not in Firefox 1.0) CSS parsing errors are reported to the JavaScript console. </li></ul>
</li><li> Is the server sending the proper <code>Content-Type</code> header for CSS style sheets?
<ul><li> The correct type is <code>text/css</code>.
</li><li> In <a href="#What_are_the_Quirks_mode_and_the_Standards_mode.3F">the Standards mode and the Almost Standards mode</a> only style sheets with the correct type are applied.
</li><li> You can see the HTTP headers sent by the server by using the <a class="external" href="http://livehttpheaders.mozdev.org/">LiveHTTPHeaders</a> extension or by using the <a class="external" href="http://web-sniffer.net/">Web sniffer</a>.
</li></ul>
</li><li> Class names and ids are case-sensitive. </li><li> The element selectors are case-sensitive with XML. </li><li> Style sheet processing instructions are only allowed in the prolog of XML documents. Also, they only work in XML documents—not in documents served as <code>text/html</code>. </li><li> <code>width</code> and <code>height</code> do not apply to non-replaced inline elements such as (by default) <code>&lt;span&gt;</code>.
</li><li> <code>text-align: center;</code> centers inline content within a block. It does not (and should not) center the block box itself. A block is centered by setting its <code>margin-left</code> and <code>margin-right</code> to <code>auto</code> and its <code>width</code> to a value that makes the block narrower than its containing block.
</li></ul>
<p>It is also possible, although not very likely, that you are seeing a bug.
</p>
<h2 id=".E4.B8.BA.E4.BB.80.E4.B9.88JavaScript.E4.B8.8D.E8.83.BD.E5.B7.A5.E4.BD.9C.EF.BC.9F" name=".E4.B8.BA.E4.BB.80.E4.B9.88JavaScript.E4.B8.8D.E8.83.BD.E5.B7.A5.E4.BD.9C.EF.BC.9F"> 为什么JavaScript不能工作? </h2>
<p>Some proprietary document objects such as <code>document.all</code> and <code>document.layers</code> are not part of the W3C DOM and are not supported in Mozilla. (There is partial undetectable support for <code>document.all</code>, though, in newer versions of Mozilla. However, that functionality only exists for compatibility with sites authored specifically for IE. You should not rely on Mozilla’s <code>document.all</code> support on new pages.) The method <code>document.getElementById()</code> <a href="cn/Using_Web_Standards_in_your_Web_Pages/Using_the_W3C_DOM#Accessing_Elements_with_the_W3C_DOM">can be used instead</a>.
</p><p>In the Standards mode Mozilla does not generate implicit top-level JavaScript variable bindings for elements with the <code>id</code> or <code>name</code> attribute. The correct way to access an element by id is to call the <code>document.getElementById()</code> method with the id as a string as the argument.
</p><p>Also, old client sniffers can shut out new browsers. The point of having a common API (the W3C DOM) is interoperability, and checking for a particular browser defeats that purpose. When working with the DOM, it is better to check for the existence of the methods and objects you are planning on using. For example, the existence of <code>document.getElementById()</code> can be checked as follows:
</p>
<pre class="eval">if(document.getElementById) {
   /* code that uses document.getElementById() */
}
</pre>
<h2 id=".E4.B8.BA.E4.BB.80.E4.B9.88Mozilla.E4.B8.8D.E8.83.BD.E6.AD.A3.E5.B8.B8.E6.98.BE.E7.A4.BA.E6.88.91.E7.9A.84alt.E5.B7.A5.E5.85.B7.E6.8F.90.E7.A4.BA.EF.BC.9F" name=".E4.B8.BA.E4.BB.80.E4.B9.88Mozilla.E4.B8.8D.E8.83.BD.E6.AD.A3.E5.B8.B8.E6.98.BE.E7.A4.BA.E6.88.91.E7.9A.84alt.E5.B7.A5.E5.85.B7.E6.8F.90.E7.A4.BA.EF.BC.9F"> 为什么Mozilla不能正常显示我的<code>alt</code>工具提示? </h2>
<p>Contrary to a popular belief stemming from the behavior of a couple browsers running on the Windows platform, <code>alt</code> isn’t an abbreviation for ‘tooltip’ but for ‘<i>alt</i>ernative’. The value of the <code>alt</code> attribute is a textual <i>replacement</i> for the image and is displayed when the image isn’t.
</p><p>Mozilla doesn’t display the <code>alt</code> attribute as a tooltip, because it has been observed that doing so encourages authors to misuse the attribute.
</p>
<ul><li> When the alternative text is shown in a tooltip, some authors write bad <code>alt</code> texts, because they intend the text as auxiliary tooltip text and not as a replacement for the image. (‘Bad’ in the sense that the textual alternative is less useful for people who don’t see the image.)
</li><li> When the alternative text is shown in a tooltip, other authors don’t want to supply textual alternatives at all, because they <i>don’t want</i> tooltips to appear. (Again, making things harder for people who don’t see the image.)
</li></ul>
<p>There is <i>another</i> attribute that Mozilla shows as a tooltip: <code>title</code>. In fact, the HTML 4.01 specification suggests that the <code>title</code> attribute may be displayed as a tooltip. However, this particular display method is not required and some other browsers show the <code>title</code> attribute in the browser status bar, for example.
</p><p>At this point some people feel compelled to post a “But IE…” rant in the newsgroups or in Bugzilla. Please note that Mac IE 5 behaves in the same way as Mozilla when it comes to the <code>alt</code> and <code>title</code> attributes. Windows IE also shows the <code>title</code> attribute in a tooltip.
</p>
<h2 id="Does_Mozilla_support_downloadable_fonts.3F" name="Does_Mozilla_support_downloadable_fonts.3F"> Does Mozilla support downloadable fonts? </h2>
<p>Downloadable fonts are not supported.
</p><p>Downloadable fonts are usually used on sites using writing systems for which proper support has been missing in browsers in the past. These sites (for example some Indian sites) code the text in Latin gibberish and then use a font that to the browser and operating system seems to be a Latin font but has eg. Devanagari glyphs, so that when the Latin gibberish is rendered with the font it seems to a human reader to be intelligible text in some language. </p><p>Obviously, that kind of ad hockery falls apart when Unicode-savvy browsers come along and render Latin gibberish as Latin gibberish (since that’s what is coded in the file from the Unicode point of view). Instead of providing support for downloadable fonts, Mozilla is addressing the real issue: support for various Unicode ranges.
</p><p>However, there are still bugs related to support for Indic scripts on some platforms. For example, on Mac OS X Mozilla does not use the Devanagari font that comes with the system but can use a third-party font like TITUS Cyberbit.
</p><p>A <i>lot</i> of work has been put into Mozilla’s Unicode support. Supporting downloadable fonts in a cross-platform way would also be a <i>lot</i> of work and would potentially require navigating past a bunch of patents but the rewards would be small. For the purpose of rendering non-ISO-8859-1 characters Mozilla already provides Unicode support that, in the long run, is a lot better approach than using pseudo-Latin downloadable fonts separately on each site.
</p>
<h2 id=".E4.B8.BA.E4.BB.80.E4.B9.88symbol.2Fdingbat.E5.AD.97.E4.BD.93.E4.B8.8D.E8.83.BD.E5.B7.A5.E4.BD.9C.EF.BC.9F" name=".E4.B8.BA.E4.BB.80.E4.B9.88symbol.2Fdingbat.E5.AD.97.E4.BD.93.E4.B8.8D.E8.83.BD.E5.B7.A5.E4.BD.9C.EF.BC.9F"> 为什么symbol/dingbat字体不能工作? </h2>
<p>They are working. Characters in HTML 4 and XML documents are Unicode characters (even if the document has been encoded using a legacy encoding for transfer)—not font glyph indexes. </p><p><code>&lt;font face="Symbol"&gt;a&lt;/font&gt;</code> means the character LATIN SMALL LETTER A (U+0061) preferably displayed using the Symbol font. Since the Symbol font does not have glyph for that character, another font is used. If you mean α, you should use GREEK SMALL LETTER ALPHA (U+03B1). If you are using a legacy encoding that cannot represent that character, you can use a numeric character reference: <code>&amp;#945;</code>.
</p><p>Likewise, to use a dingbat, you should use the appropriate Unicode character instead of trying to apply a dingbat font to an ASCII character. For example, to represent ☺, you should use WHITE SMILING FACE (U+263A). </p>
<h2 id="Why_isn.E2.80.99t_Mozilla_rendering_my_page_as_I_intended.3F_So_my_page_isn.E2.80.99t_standards-compliant.2C_but_good_browsers_should_render_pages_as_the_author_intended_anyway.21" name="Why_isn.E2.80.99t_Mozilla_rendering_my_page_as_I_intended.3F_So_my_page_isn.E2.80.99t_standards-compliant.2C_but_good_browsers_should_render_pages_as_the_author_intended_anyway.21"> Why isn’t Mozilla rendering my page as I intended? So my page isn’t standards-compliant, but good browsers should render pages as the author intended anyway! </h2>
<p>Authors are supposed to communicate their intentions using the Web standards. Otherwise, finding out the intentions of each particular author would require psychic abilities which can’t be implemented in software. Even in cases where a human could deduce the intention, doing so in software would be very slow, bug-inducing, difficult and complicated.
</p><p>The usual counter argument is that there is no need to guess—Mozilla should do whatever browser <var>x</var> does (where <var>x</var> is the favorite non-Mozilla browser of whoever is presenting the counter argument). However, doing whatever browser <var>x</var> does in every conceivable case isn’t simple at all, even though it might appear to be simple when presented as a passing remark.
</p><p>Different people have different ideas about what <var>x</var> should be. The second problem is that Web authors are very creative in coming up with different ways of deviating from the standards. In fact, since the input to the browser can be of arbitrary length, there is no upper bound for the number of distinct ways of deviating from the standards. Therefore, it is impossible to test whether Mozilla reacts exactly like browser <var>x</var> to every possible input. (Likewise, there is no upper bound for the number of ways different features of the standards themselves can be combined, which makes software quality assurance challenging.)
</p><p>Also, the ways in which browser <var>x</var> reacts to some standards-incompliant input are not all intentional. Some of the reactions are due to unknown and unintentional interactions within a complex program. Even if you had the source code for browser <var>x</var>, you couldn’t change <i>anything</i> without risking changing one or more of the unknown and unintentional interactions within the program.
</p><p>The usual counter argument is that Mozilla doesn’t need to match the behavior of browser <var>x</var> in every possible case but only in the alleged <i>common</i> cases. However, it turns out Mozilla is doing that already. Mozilla’s Standards mode is, obviously, already compatible with other browsers that implement the same standards reasonably correctly. On the other hand, Mozilla’s quirks mode already accommodates common non-standardisms that are due to the behaviors of common legacy browsers.
</p><p>Instead of putting time and effort into reverse-engineering and cloning legacy browsers, it makes more sense to focus on implementing standards. Standards (when implemented by others as well) promote interoperability better than cloning legacy software bug by bug.
</p><p>Also, HTML was designed to adapt to different presentation media, so different presentations of the same document are to be expected. </p>
<h2 id="According_to_the_Accept_header.2C_Mozilla_prefers_application.2Fxhtml.2Bxml_over_text.2Fhtml._Should_I_serve_application.2Fxhtml.2Bxml_to_Mozilla.3F" name="According_to_the_Accept_header.2C_Mozilla_prefers_application.2Fxhtml.2Bxml_over_text.2Fhtml._Should_I_serve_application.2Fxhtml.2Bxml_to_Mozilla.3F"> According to the <code>Accept</code> header, Mozilla prefers <code>application/xhtml+xml</code> over <code>text/html</code>. Should I serve <code>application/xhtml+xml</code> to Mozilla? </h2>
<p>The preference for <code>application/xhtml+xml</code> was added to the <code>Accept</code> header in order to enable the serving of MathML to both Mozilla and IE with Apache without scripting back when the MathPlayer plug-in for IE did not handle <code>application/xhtml+xml</code>.
</p><p>If your document mixes MathML with XHTML, you should use <code>application/xhtml+xml</code>. If you’re developing XHTML Basic content for mobile devices and are serving it as <code>application/xhtml+xml</code>, you can serve it as <code>application/xhtml+xml</code> to Mozilla as well without taking special steps (except perhaps providing a different style sheet for the <code>handheld</code> and <code>screen</code> media).
</p><p>However, if you are using the usual HTML features (no MathML) and are serving your content as <code>text/html</code> to other browsers, there is no need to serve <code>application/xhtml+xml</code> to Mozilla. In fact, in versions prior to Gecko 1.9/Firefox 3, doing so would deprive the Mozilla users of incremental display, because incremental loading of XML documents has not been implemented in those versions. Serving valid HTML 4.01 as <code>text/html</code> ensures the widest browser and search engine support.
</p><p>There is a fad of serving <code>text/html</code> to IE but serving the same markup with no added value as <code>application/xhtml+xml</code> to Mozilla. This is usually done without a mechanism that would ensure the well-formedness of the served documents. Mechanisms that ensure well-formed output include serializing from a document tree object model (eg. DOM) and XSLT transformations that do not disable output escaping. When XHTML output has been retrofitted to a content management system that was not designed for XML from the ground up, the system usually ends up discriminating Mozilla users by serving tag soup labeled as XML to Mozilla (leading to a parse error) and serving the same soup labeled as tag soup to IE (not leading to a parse error).
</p>
<h2 id="MIME.E7.B1.BB.E5.9E.8B.E4.B8.BAapplication.2Fxhtml.2Bxml.E7.9A.84.E6.96.87.E6.A1.A3.E5.92.8C.E7.B1.BB.E5.9E.8B.E4.B8.BAtext.2Fhtml.E7.9A.84.E6.96.87.E6.A1.A3.EF.BC.8C.E6.9C.89.E4.BB.80.E4.B9.88.E4.B8.8D.E5.90.8C.EF.BC.9F" name="MIME.E7.B1.BB.E5.9E.8B.E4.B8.BAapplication.2Fxhtml.2Bxml.E7.9A.84.E6.96.87.E6.A1.A3.E5.92.8C.E7.B1.BB.E5.9E.8B.E4.B8.BAtext.2Fhtml.E7.9A.84.E6.96.87.E6.A1.A3.EF.BC.8C.E6.9C.89.E4.BB.80.E4.B9.88.E4.B8.8D.E5.90.8C.EF.BC.9F"> MIME类型为<code>application/xhtml+xml</code>的文档和类型为<code>text/html</code>的文档,有什么不同? </h2>
<ul><li> An XML parser (expat) is used instead of the tag soup parser.
<ul><li> Most well-formedness constraints are enforced. (Currently Mozilla does not catch character encoding errors, because the document is re-encoded using a lenient encoding converter before the document reaches the XML parser. This is a bug.) Despite common allegations to the contrary, the document is <i>not</i> checked for validity. </li><li> Externally defined character entities other than the five pre-defined ones (<code>&amp;lt;</code>, <code>&amp;gt;</code>, <code>&amp;amp;</code>, <code>&amp;quot;</code> and <code>&amp;apos;</code>) are only supported if the document references a public identifier for which there is a mapping in Mozilla’s pseudo-DTD catalog and the document has not been declared standalone. </li><li> In older versions of Mozilla as well as in old Mozilla-based products, there is no pseudo-DTD catalog and the use of externally defined character entities (other than the five pre-defined ones) leads to an XML parsing error. There are also other XHTML user agents that do not support externally defined character entities (other than the five pre-defined ones). Since non-validating XML processors are not required to support externally defined character entities (other than the five pre-defined ones), the use of externally defined character entities (other than the five pre-defined ones) is inherently unsafe in XML documents intended for the Web. The best practice is to use straight UTF-8 instead of entities. (Numeric character references are safe, too.) </li><li> <code>document.write()</code> is not supported. The stream that is going into the parser can’t be tampered with in mid-parse. </li><li> Things that look like XML comments are treated as XML comments—even inside <code>script</code> or <code>style</code> elements. </li><li> Elements need to be in the XHTML namespace in order to be treated as XHTML elements. </li><li> <code>meta</code> tags are not examined for character encoding information. </li><li> <code>tbody</code>, <code>head</code>, <code>body</code>, and <code>html</code> are not inferred if the tags are not explicitly present. </li><li> CDATA sections are supported. </li><li> XML empty element notation (<code>&lt;foo/&gt;</code>) is supported. </li><li> White space characters in attribute values are <a class="external" href="http://www.w3.org/TR/REC-xml/#AVNormalize">normalized</a> to spaces at parse time, so the original white space never makes it to the DOM. This affects data round tripping using hidden form <code>input</code>s.
</li></ul>
</li><li> In versions prior to Gecko 1.9/Firefox 3, the document is not loaded and rendered incrementally. That is, the document is displayed only after the entire document has been received and parsed. Contrary to a common misguided assertion, this is not done in response to a requirement set forth in any W3C specification. In particular, the XML specification does <i>not</i> require the entire document to be checked for errors before rendering can start. The lack of incremental loading and display is simply a bug (or a missing feature). This has been fixed in Gecko 1.9/Firefox 3. </li><li> The layout mode is the (Full) Standards Mode regardless of doctype. </li><li> CSS works according to the XML+CSS rules.
<ul><li> HTML-specific CSS exceptions do not apply. For example, the <code>body</code> element gets no special treatment. </li><li> CSS selectors are case-sensitive. </li></ul>
</li><li> The DOM is in the XML mode.
<ul><li> Namespace-aware variants of methods need to be used when working with elements (eg. <code>createElementNS()</code> instead of <code>createElement()</code>).
</li><li> In older versions of Mozilla, the <code>document</code> object does not implement the <code>HTMLDocument</code> interface. </li><li> Element and attribute names are not normalized to upper case.
</li><li> In older versions (including Firefox 1.0), content cannot be added using <code>innerHTML</code>. </li></ul>
</li><li> Other namespaces are supported.
<ul><li> MathML </li><li> Simple XLink </li><li> SVG (in SVG-enabled builds only) </li><li> XUL (Please note that XUL is Mozilla-specific and, therefore, using it on the public Web causes interoperabilty problems.)
</li></ul>
</li><li> <code>xml:base</code> is observed when following links. </li><li> Style sheets can be references using processing instructions.
</li></ul>
<h2 id=".E6.88.91.E6.B2.A1.E6.9C.89.E6.89.BE.E5.88.B0.E9.97.AE.E9.A2.98.E7.9A.84.E7.AD.94.E6.A1.88.EF.BC.8C.E6.88.91.E8.BF.98.E5.8F.AF.E4.BB.A5.E5.88.B0.E5.93.AA.E9.87.8C.E5.AF.BB.E6.89.BE.E5.B8.AE.E5.8A.A9.EF.BC.9F" name=".E6.88.91.E6.B2.A1.E6.9C.89.E6.89.BE.E5.88.B0.E9.97.AE.E9.A2.98.E7.9A.84.E7.AD.94.E6.A1.88.EF.BC.8C.E6.88.91.E8.BF.98.E5.8F.AF.E4.BB.A5.E5.88.B0.E5.93.AA.E9.87.8C.E5.AF.BB.E6.89.BE.E5.B8.AE.E5.8A.A9.EF.BC.9F"> 我没有找到问题的答案,我还可以到哪里寻找帮助? </h2>
<p>Try asking in the newsgroup relevant to your question in the comp.infosystems.www.authoring.* hierarchy or, if your question is about JavaScript/ECMAScript or the DOM, in comp.lang.javascript (after reading the group FAQs first, of course). Please do not ask Web authoring questions in the newsgroups intended for discussion about the development of Mozilla.
</p>
<ul><li> <a class="external" href="http://www.htmlhelp.com/faq/html/">comp.infosystems.www.authoring.html Web Authoring FAQ</a>
</li><li> <a class="external" href="http://css.nu/faq/ciwas-mFAQ.html">comp.infosystems.www.authoring.stylesheets FAQ</a>
</li><li> <a class="external" href="http://css.nu/faq/ciwas-aFAQ.html">ciwas stylesheet authoring FAQ</a>
</li><li> <a class="external" href="http://www.jibbering.com/faq/">comp.lang.javascript FAQ</a>
</li></ul>
<div class="originaldocinfo">
<h2 id=".E5.8E.9F.E5.A7.8B.E6.96.87.E6.A1.A3.E4.BF.A1.E6.81.AF" name=".E5.8E.9F.E5.A7.8B.E6.96.87.E6.A1.A3.E4.BF.A1.E6.81.AF"> 原始文档信息 </h2>
<ul><li> 作者: <a class="link-mailto" href="mailto:hsivonen@iki.fi">Henri Sivonen</a> (Please, no authoring questions to this address.)
</li><li> 最后更新时间: May 12, 2007
</li><li> 版权信息: Henri Sivonen
</li></ul>
</div>
{{ languages( { "ja": "ja/Mozilla_Web_Developer_FAQ", "en": "en/Mozilla_Web_Developer_FAQ" } ) }}