235
edits
(Created page with '<div style="color:red">This is just a draft and may change!</div> Basically, the [https://developer.mozilla.org/En/Developer_Guide/Coding_Style Mozilla C++ coding style guide r…') |
|||
| Line 57: | Line 57: | ||
} | } | ||
} | } | ||
=== XML/XUL === | |||
==== Indent is two spaces per nesting level ==== | |||
<element> | |||
<element> | |||
<element/> | |||
</element> | |||
</element> | |||
==== Sort XUL attributes ==== | |||
XUL attributes should come in this rough order: | |||
<element id="menu_showMessagePane" | |||
label="&showMessagePaneCmd.label;" | |||
accesskey="&showMessagePaneCmd.accesskey;" | |||
key="key_toggleMessagePane" | |||
random_other_attributes="put 'em here!" | |||
oncommand="MsgToggleMessagePane(true);"/> | |||
Especially, id should be first, label/accesskey/key should go together and handlers should be last. | |||
==== One attribute per line when folding ==== | |||
If the XML element definition (vastly) exceeds the 80 columns limit, it should be wrapped. In this case, put each attribute onto its own line and align them vertically: | |||
<!-- Fine! --> | |||
<element id="menu_showMessagePane" type="checkbox"/> | |||
<!-- Bad! Don't do this! --> | |||
<element id="menu_showMessagePane" type="checkbox" random_other_attribute1="1" random_other_attribute2="1" random_other_attribute3="1"/> | |||
<!-- Fine! --> | |||
<element id="menu_showMessagePane" | |||
type="checkbox" | |||
random_other_attribute1="1" | |||
random_other_attribute2="1" | |||
random_other_attribute3="1"/> | |||
<div style="text-align: right">''This page is maintained by [mailto:mnyromyr@tprac.de Karsten "Mnyromyr" Düsterloh].''</div> | <div style="text-align: right">''This page is maintained by [mailto:mnyromyr@tprac.de Karsten "Mnyromyr" Düsterloh].''</div> | ||
edits