aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/mozilla/tech
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/mozilla/tech')
-rw-r--r--files/zh-cn/mozilla/tech/index.html7
-rw-r--r--files/zh-cn/mozilla/tech/toolkit_api/extisessionstorage/index.html48
-rw-r--r--files/zh-cn/mozilla/tech/toolkit_api/index.html18
-rw-r--r--files/zh-cn/mozilla/tech/viewing_and_searching_mozilla_source_code_online/index.html26
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/glue/index.html71
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/guide/arrays/index.html573
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/guide/creating_components/an_overview_of_xpcom/index.html535
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/guide/creating_components/building_the_weblock_ui/index.html297
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/guide/creating_components/component_internals/index.html217
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/guide/creating_components/creating_the_component_code/index.html727
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/guide/creating_components/finishing_the_component/index.html337
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/guide/creating_components/index.html278
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/guide/creating_components/packaging_weblock/index.html136
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/guide/creating_components/preface/index.html83
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/guide/creating_components/resources/index.html10
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/guide/creating_components/setting_up_the_gecko_sdk/index.html204
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/guide/creating_components/starting_weblock/index.html1104
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/guide/creating_components/using_xpcom_components/index.html311
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/guide/creating_components/using_xpcom_utilities_to_make_things_easier/index.html388
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/guide/hashtables/index.html282
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/guide/index.html15
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/guide/internal_strings/index.html809
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/index.html44
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/interfacing_with_the_xpcom_cycle_collector/index.html141
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/language_bindings/components.utils.cloneinto/index.html290
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/language_bindings/components.utils.getglobalforobject/index.html41
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/language_bindings/index.html20
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/language_bindings/javaxpcom/index.html49
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/language_bindings/javaxpcom/使用javaxpcom在java应用程序中嵌入mozilla/index.html65
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/language_bindings/javaxpcom/开发/index.html26
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/language_bindings/pyxpcom/index.html67
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/language_bindings/xpconnect/index.html67
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/observer_notifications/index.html880
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/glue_classes/index.html16
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/glue_classes/nscomptr/getting_started_guide/index.html478
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/glue_classes/nscomptr/index.html56
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/index.html14
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/interface/index.html11
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiaccessibleprovider/index.html45
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiclipboard/index.html91
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiclipboardhelper/index.html65
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiconsoleservice/index.html215
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/interface/nsidirectoryserviceprovider/index.html65
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/interface/nsidomclientrect/index.html92
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/interface/nsifile/index.html828
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/interface/nsifilepicker/index.html376
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/interface/nsihttpchannel/index.html365
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiidleservice/index.html119
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/interface/nsilocalfile/index.html478
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiprocess/index.html283
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiprompt/index.html55
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/interface/nsipromptservice/index.html696
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiscriptableunicodeconverter/index.html609
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/interface/nsisyncmessagesender/index.html65
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/interface/nsitimer/index.html285
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/interface/nsitraceablechannel/index.html71
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiuri/index.html407
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/reference/interface/nsixmlhttprequest/index.html90
-rw-r--r--files/zh-cn/mozilla/tech/xpcom/setting_http_request_headers/index.html261
-rw-r--r--files/zh-cn/mozilla/tech/xpidl/index.html502
-rw-r--r--files/zh-cn/mozilla/tech/xpidl/syntax/index.html127
-rw-r--r--files/zh-cn/mozilla/tech/xpidl/xpidl/index.html58
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/acceltext/index.html23
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/accesskey/index.html43
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/activetitlebarcolor/index.html19
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/align/index.html54
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/allowevents/index.html30
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/allownegativeassertions/index.html18
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/autocheck/index.html24
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/autoscroll/index.html12
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/buttonaccesskeyaccept/index.html20
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/buttonlabelextra1/index.html19
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/buttonlabelextra2/index.html19
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/buttons/index.html28
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/checked/index.html24
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/class/index.html23
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/coalesceduplicatearcs/index.html17
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/collapsed/index.html27
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/command/index.html30
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/container/index.html18
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/control/index.html23
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/crop/index.html37
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/description/index.html23
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/dir/index.html39
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/disabled/index.html38
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/flex/index.html23
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/href/index.html24
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/id/index.html41
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/image.onload/index.html12
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/image/index.html25
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/increment/index.html15
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/index.html304
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/label/index.html41
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/max/index.html20
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/menuitem.key/index.html23
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/menuitem.name/index.html38
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/menuitem.type/index.html28
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/min/index.html16
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/name/index.html16
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/onpopupshowing/index.html21
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/onpopupshown/index.html21
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/orient/index.html16
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/pending/index.html15
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/persist/index.html24
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/selected/index.html28
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/selectedindex/index.html15
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/tabindex/index.html18
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/validate/index.html27
-rw-r--r--files/zh-cn/mozilla/tech/xul/attribute/value/index.html30
-rw-r--r--files/zh-cn/mozilla/tech/xul/broadcaster/index.html91
-rw-r--r--files/zh-cn/mozilla/tech/xul/browser/index.html409
-rw-r--r--files/zh-cn/mozilla/tech/xul/button/index.html528
-rw-r--r--files/zh-cn/mozilla/tech/xul/checkbox/index.html329
-rw-r--r--files/zh-cn/mozilla/tech/xul/command/index.html105
-rw-r--r--files/zh-cn/mozilla/tech/xul/deprecated_defunct_markup/index.html50
-rw-r--r--files/zh-cn/mozilla/tech/xul/dialog/index.html364
-rw-r--r--files/zh-cn/mozilla/tech/xul/events/index.html497
-rw-r--r--files/zh-cn/mozilla/tech/xul/image/index.html145
-rw-r--r--files/zh-cn/mozilla/tech/xul/index.html79
-rw-r--r--files/zh-cn/mozilla/tech/xul/key/index.html166
-rw-r--r--files/zh-cn/mozilla/tech/xul/label/index.html298
-rw-r--r--files/zh-cn/mozilla/tech/xul/list_of_commands/index.html196
-rw-r--r--files/zh-cn/mozilla/tech/xul/listbox/index.html480
-rw-r--r--files/zh-cn/mozilla/tech/xul/listheader/index.html180
-rw-r--r--files/zh-cn/mozilla/tech/xul/menu/index.html370
-rw-r--r--files/zh-cn/mozilla/tech/xul/menubar/index.html113
-rw-r--r--files/zh-cn/mozilla/tech/xul/menuitem/index.html575
-rw-r--r--files/zh-cn/mozilla/tech/xul/menulist/index.html509
-rw-r--r--files/zh-cn/mozilla/tech/xul/menupopup/index.html324
-rw-r--r--files/zh-cn/mozilla/tech/xul/menuseparator/index.html435
-rw-r--r--files/zh-cn/mozilla/tech/xul/method/extra1/index.html15
-rw-r--r--files/zh-cn/mozilla/tech/xul/method/focus/index.html15
-rw-r--r--files/zh-cn/mozilla/tech/xul/method/getbrowserfortab/index.html15
-rw-r--r--files/zh-cn/mozilla/tech/xul/method/getbutton/index.html15
-rw-r--r--files/zh-cn/mozilla/tech/xul/method/increase/index.html21
-rw-r--r--files/zh-cn/mozilla/tech/xul/method/index.html170
-rw-r--r--files/zh-cn/mozilla/tech/xul/method/reset/index.html15
-rw-r--r--files/zh-cn/mozilla/tech/xul/method/stop/index.html15
-rw-r--r--files/zh-cn/mozilla/tech/xul/namespaces/index.html73
-rw-r--r--files/zh-cn/mozilla/tech/xul/popup/index.html23
-rw-r--r--files/zh-cn/mozilla/tech/xul/property/accessibletype/index.html183
-rw-r--r--files/zh-cn/mozilla/tech/xul/property/accesskey/index.html21
-rw-r--r--files/zh-cn/mozilla/tech/xul/property/browser.preferences/index.html15
-rw-r--r--files/zh-cn/mozilla/tech/xul/property/buttons/index.html10
-rw-r--r--files/zh-cn/mozilla/tech/xul/property/command/index.html21
-rw-r--r--files/zh-cn/mozilla/tech/xul/property/crop/index.html21
-rw-r--r--files/zh-cn/mozilla/tech/xul/property/defaultvalue/index.html15
-rw-r--r--files/zh-cn/mozilla/tech/xul/property/disabled/index.html21
-rw-r--r--files/zh-cn/mozilla/tech/xul/property/image/index.html21
-rw-r--r--files/zh-cn/mozilla/tech/xul/property/index.html266
-rw-r--r--files/zh-cn/mozilla/tech/xul/property/label/index.html21
-rw-r--r--files/zh-cn/mozilla/tech/xul/property/labelelement/index.html21
-rw-r--r--files/zh-cn/mozilla/tech/xul/property/markupdocumentviewer/index.html15
-rw-r--r--files/zh-cn/mozilla/tech/xul/property/max/index.html15
-rw-r--r--files/zh-cn/mozilla/tech/xul/property/menuitem.control/index.html21
-rw-r--r--files/zh-cn/mozilla/tech/xul/property/parentcontainer/index.html21
-rw-r--r--files/zh-cn/mozilla/tech/xul/property/selected/index.html18
-rw-r--r--files/zh-cn/mozilla/tech/xul/property/selectedindex/index.html21
-rw-r--r--files/zh-cn/mozilla/tech/xul/property/selecteditem/index.html21
-rw-r--r--files/zh-cn/mozilla/tech/xul/property/selectionstart/index.html16
-rw-r--r--files/zh-cn/mozilla/tech/xul/property/spinbuttons/index.html15
-rw-r--r--files/zh-cn/mozilla/tech/xul/property/tabindex/index.html21
-rw-r--r--files/zh-cn/mozilla/tech/xul/property/textbox.value/index.html15
-rw-r--r--files/zh-cn/mozilla/tech/xul/property/value/index.html21
-rw-r--r--files/zh-cn/mozilla/tech/xul/radio/index.html379
-rw-r--r--files/zh-cn/mozilla/tech/xul/radiogroup/index.html275
-rw-r--r--files/zh-cn/mozilla/tech/xul/script/index.html117
-rw-r--r--files/zh-cn/mozilla/tech/xul/statusbar/index.html131
-rw-r--r--files/zh-cn/mozilla/tech/xul/style/index.html6
-rw-r--r--files/zh-cn/mozilla/tech/xul/style/menuitem-iconic/index.html16
-rw-r--r--files/zh-cn/mozilla/tech/xul/style/menuitem-non-iconic/index.html16
-rw-r--r--files/zh-cn/mozilla/tech/xul/tabbox/index.html156
-rw-r--r--files/zh-cn/mozilla/tech/xul/template_guide/index.html68
-rw-r--r--files/zh-cn/mozilla/tech/xul/textbox/index.html653
-rw-r--r--files/zh-cn/mozilla/tech/xul/toolbarpalette/index.html103
-rw-r--r--files/zh-cn/mozilla/tech/xul/toolbars/creating_toolbar_buttons/index.html183
-rw-r--r--files/zh-cn/mozilla/tech/xul/toolbars/custom_toolbar_button/index.html332
-rw-r--r--files/zh-cn/mozilla/tech/xul/toolbars/index.html65
-rw-r--r--files/zh-cn/mozilla/tech/xul/toolbox/index.html6
-rw-r--r--files/zh-cn/mozilla/tech/xul/tree/index.html512
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/adding_buttons/index.html98
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/adding_event_handlers/index.html161
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/adding_html_elements/index.html113
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/adding_labels_and_images/index.html40
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/adding_more_elements/index.html115
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/adding_style_sheets/index.html10
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/anonymous_content/index.html166
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/box_model_details/index.html6
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/content_panels/index.html63
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/creating_a_skin/index.html177
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/creating_a_window/index.html116
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/creating_an_installer/index.html98
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/creating_dialogs/index.html6
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/document_object_model/index.html220
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/element_positioning/index.html254
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/features_of_a_window/index.html6
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/grids/index.html175
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/groupboxes/index.html85
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/index.html171
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/input_controls/index.html110
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/introduction/index.html70
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/introduction_to_rdf/index.html109
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/list_controls/index.html133
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/localization/index.html296
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/manifest_files/index.html113
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/modifying_a_xul_interface/index.html118
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/modifying_the_default_skin/index.html63
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/more_button_features/index.html216
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/more_event_handlers/index.html183
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/more_menu_features/index.html108
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/more_wizards/index.html64
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/numeric_controls/index.html78
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/popup_menus/index.html6
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/progress_meters/index.html58
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/property_files/index.html97
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/rdf_datasources/index.html267
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/scroll_bars/index.html9
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/scrolling_menus/index.html45
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/simple_menu_bars/index.html159
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/splitters/index.html85
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/stack_positioning/index.html30
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/stacks_and_decks/index.html71
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/styling_a_tree/index.html12
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/tabboxes/index.html125
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/templates/index.html77
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/the_box_model/index.html39
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/the_chrome_url/index.html74
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/toolbars/index.html101
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/trees/index.html8
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/using_spacers/index.html111
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/using_xbl_from_stylesheets/index.html223
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/xbl介绍/index.html104
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/xpcom_接口/index.html179
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/xul_structure/index.html43
-rw-r--r--files/zh-cn/mozilla/tech/xul/tutorial/更多的按钮特性/index.html68
-rw-r--r--files/zh-cn/mozilla/tech/xul/vbox/index.html130
-rw-r--r--files/zh-cn/mozilla/tech/xul/window/index.html281
-rw-r--r--files/zh-cn/mozilla/tech/xul/xul_reference/index.html20
238 files changed, 0 insertions, 33095 deletions
diff --git a/files/zh-cn/mozilla/tech/index.html b/files/zh-cn/mozilla/tech/index.html
deleted file mode 100644
index 2e4f7a5d64..0000000000
--- a/files/zh-cn/mozilla/tech/index.html
+++ /dev/null
@@ -1,7 +0,0 @@
----
-title: Mozilla 私有技术
-slug: Mozilla/Tech
-translation_of: Mozilla/Tech
----
-<p>Mozilla has several technologies used as components of its projects. These are documented here. (flesh out this text).</p>
-<p>{{LandingPageListSubpages}}</p>
diff --git a/files/zh-cn/mozilla/tech/toolkit_api/extisessionstorage/index.html b/files/zh-cn/mozilla/tech/toolkit_api/extisessionstorage/index.html
deleted file mode 100644
index 7d49c345e7..0000000000
--- a/files/zh-cn/mozilla/tech/toolkit_api/extisessionstorage/index.html
+++ /dev/null
@@ -1,48 +0,0 @@
----
-title: extISessionStorage
-slug: Mozilla/Tech/Toolkit_API/extISessionStorage
-translation_of: Mozilla/Tech/Toolkit_API/extISessionStorage
----
-<p></p>
-<p></p><div class="blockIndicator standardNote">
-<p>该条目记录了 <a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Thunderbird/Releases/3">Thunderbird 3</a> 引入的新特性</p>
-</div><p></p>
-<p><br> <code>extISessionStorage</code> 允许一个扩展程序存储数据,该数据会在应用程序的整个生命周期内可用(比如浏览器). <code>extISessionStorage</code> 被定义在 <code><a href="https://dxr.mozilla.org/mozilla-central/source/toolkit/components/exthelper/extIApplication.idl" rel="custom">toolkit/components/exthelper/extIApplication.idl</a></code>.</p>
-<p>通过XPCOM服务实现的 <a class="internal" href="/zh-cn/Toolkit_API/extIApplication" title="zh-cn/Toolkit API/extIApplication"><code>extIApplication</code></a>: 查看相关指南在 <a class="internal" href="/zh-cn/Toolkit_API/FUEL" title="zh-cn/FUEL">FUEL</a> (Firefox), <a class="internal" href="/zh-cn/Thunderbird/STEEL" title="zh-cn/Thunderbird/STEEL">STEEL</a> (Thunderbird) 和 <a class="internal" href="/zh-cn/Toolkit_API/SMILE" title="zh-cn/SeaMonkey/SMILE">SMILE</a> (SeaMonkey) 页面.</p>
-<h2 id="Method_overview" name="Method_overview">方法概述</h2>
-<p>这些方法通常是通过Application.storage来访问的.</p>
-<table class="standard-table"> <tbody> <tr> <th>返回值类型</th> <th>方法</th> </tr> <tr> <td><code>boolean</code></td> <td><code><a href="#has.28.29">has</a>(in AString aName)</code></td> </tr> <tr> <td><code>void</code></td> <td><code><a href="#set.28.29">set</a>(in AString aName, in nsIVariant aValue)</code></td> </tr> <tr> <td><code>nsIVariant</code></td> <td><code><a href="#get.28.29">get</a>(in AString aName, in nsIVariant aDefaultValue)</code></td> </tr> </tbody>
-</table>
-<h2 id="Attributes" name="Attributes">属性</h2>
-<table class="standard-table"> <tbody> <tr> <td class="header">属性名</td> <td class="header">类型</td> <td class="header">描述</td> </tr> <tr> <td><code>events</code></td> <td><code>readonly attribute extIEvents</code></td> <td>The events object for the storage supports: "change"</td> </tr> </tbody>
-</table>
-<h2 id="Methods" name="Methods">方法</h2>
-<h3 id="has.28.29" name="has.28.29">has()</h3>
-<p>判断一个指定名称的存储项是否已经存在.</p>
-<pre class="eval">boolean has(in AString aName)
-</pre>
-<h6 id="Parameters" name="Parameters">参数</h6>
-<dl> <dt><code>aName</code></dt> <dd>存储项名称</dd>
-</dl>
-<h6 id="Return_value" name="Return_value">返回值</h6>
-<p>如果这个存储项已经存在,则返回true,否则返回false.</p>
-<h3 id="set.28.29" name="set.28.29">set()</h3>
-<p>为一个指定名称的存储项赋值.</p>
-<pre class="eval">void set(in AString aName, in nsIVariant aValue)
-</pre>
-<h6 id="Parameters_2" name="Parameters_2">参数</h6>
-<dl> <dt><code>aName</code></dt> <dd>存储项名称</dd> <dt><code>aValue</code></dt> <dd>任意类型的值</dd>
-</dl>
-<h6 id="Return_value_2" name="Return_value_2">返回值</h6>
-<p>无</p>
-<h3 id="get.28.29" name="get.28.29">get()</h3>
-<p>获取一个指定名称的存储项的值.如果该存储项不存在,则返回一个默认值.</p>
-<pre class="eval">nsIVariant get(in AString aName, in nsIVariant aDefaultValue)
-</pre>
-<h6 id="Parameters_3" name="Parameters_3">参数</h6>
-<dl> <dt><code>aName</code></dt> <dd>存储项名称</dd>
-</dl>
-<h6 id="Return_value_3" name="Return_value_3">返回值</h6>
-<p>指定存储项的值或者一个默认的返回值.</p><h2 id="See_also" name="See_also">相关链接</h2>
-<p> <a class="internal" href="/zh-cn/Toolkit_API/FUEL" title="zh-cn/FUEL">FUEL</a> (Firefox), <a class="internal" href="/zh-cn/Thunderbird/STEEL" title="zh-cn/Thunderbird/STEEL">STEEL</a> (Thunderbird) and <a class="internal" href="/zh-cn/Toolkit_API/SMILE" title="zh-cn/SeaMonkey/SMILE">SMILE</a> (SeaMonkey)</p>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/toolkit_api/index.html b/files/zh-cn/mozilla/tech/toolkit_api/index.html
deleted file mode 100644
index 7ba5906994..0000000000
--- a/files/zh-cn/mozilla/tech/toolkit_api/index.html
+++ /dev/null
@@ -1,18 +0,0 @@
----
-title: Toolkit API
-slug: Mozilla/Tech/Toolkit_API
-translation_of: Mozilla/Tech/Toolkit_API
----
-<p> </p>
-<p><b>Mozilla Toolkit</b> 是建立在<a href="cn/Gecko">Gecko</a>上的应用程序接口集(APIs),用来提供对XUL应用的高级服务. 这些服务包含:</p>
-<ul>
- <li>Profile 管理</li>
- <li>Chrome 注册</li>
- <li>浏览历史</li>
- <li>扩展和主题管理</li>
- <li>应用更新服务</li>
- <li>安全模式</li>
-</ul>
-<h3 id=".E6.9B.B4.E5.A4.9A.E4.BF.A1.E6.81.AF" name=".E6.9B.B4.E5.A4.9A.E4.BF.A1.E6.81.AF">更多信息</h3>
-<p>下面的开发者页面包含特别主题的例子和讨论:</p>
-<p><a href="cn/XUL">XUL</a>; <a href="cn/XUL_Overlays">XUL Overlays</a>; <a href="cn/Extensions">Developing Extensions</a>; <a href="cn/XULRunner">XULRunner</a>; <a href="cn/Themes">Developing Themes</a>; <a href="cn/DOM">DOM</a>; <a href="cn/RDF">RDF</a>; <a href="cn/Storage">Storage</a>; <a href="cn/Help_Viewer">Creating Help Documentation</a></p>
diff --git a/files/zh-cn/mozilla/tech/viewing_and_searching_mozilla_source_code_online/index.html b/files/zh-cn/mozilla/tech/viewing_and_searching_mozilla_source_code_online/index.html
deleted file mode 100644
index 80965735d2..0000000000
--- a/files/zh-cn/mozilla/tech/viewing_and_searching_mozilla_source_code_online/index.html
+++ /dev/null
@@ -1,26 +0,0 @@
----
-title: 在线搜索并浏览Mozilla源代码
-slug: Mozilla/Tech/Viewing_and_searching_Mozilla_source_code_online
-tags:
- - 开发Mozilla
- - 需要更新
-translation_of: Mozilla/Tech/Viewing_and_searching_Mozilla_source_code_online
----
-<p>托管在Mercurial资源库中的所有Mozilla项目的源代码都可以使用<a href="https://searchfox.org/">Searchfox</a>在线搜索和查看,Searchfox是一个运行在AWS上的快速索引搜索引擎。</p>
-
-<p>请勿通过Searchfox下载源码;你可以通过下载<a href="https://wiki.developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Source_Code/Downloading_Source_Archives#Download">tarball</a>或使用<a href="https://wiki.developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Source_Code/Mercurial">Mercurial。</a></p>
-
-<p>Searchfox索引多个分支和模块。</p>
-
-<p>值得注意的几个Searchfox 有:</p>
-
-<ul>
- <li><a class="link-https" href="https://hg.mozilla.org/mozilla-central/">"mozilla-central"</a> 包含当前的 Firefox 和 Gecko 开发。发行版本是从这个版本库分支出来的。也称为 "Trunk "或 "nightly"。</li>
- <li><a class="external" href="https://searchfox.org/comm-central/source">"comm-central"</a> 包含当前Thunderbird、SeaMonkey和Calendar的开发。也包含mozilla-central的镜像。从这个版本库中发布分支。</li>
-</ul>
-
-<p><a href="/en/Mozilla_Source_Code_Directory_Structure" title="en/Mozilla_Source_Code_Directory_Structure">Mozilla 源代码目录结构</a> 在每个源码目录树中拥有一段简短的描述。</p>
-
-<div class="note">
-<p>你既可以浏览每个特定版本的源码,也可以下载他们. 每个版本连着源码,都<a href="https://archive.mozilla.org/pub/">在这</a>归档</p>
-</div>
diff --git a/files/zh-cn/mozilla/tech/xpcom/glue/index.html b/files/zh-cn/mozilla/tech/xpcom/glue/index.html
deleted file mode 100644
index 58bfdc731e..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/glue/index.html
+++ /dev/null
@@ -1,71 +0,0 @@
----
-title: XPCOM Glue
-slug: Mozilla/Tech/XPCOM/Glue
-tags:
- - XPCOM
- - 所有分类
-translation_of: Mozilla/Tech/XPCOM/Glue
----
-<p>The XPCOM Glue is a static library which component developers and embedders can link against. It allows developers to link only against the frozen XPCOM method symbols and maintain compatibility with multiple versions of XPCOM.</p>
-<h3 id="Compiling_or_linking_against_XPCOM_headers" name="Compiling_or_linking_against_XPCOM_headers">Compiling or linking against XPCOM headers</h3>
-<p>There are three ways to compile/link against XPCOM headers/libraries:</p>
-<h4 id="Frozen_linkage:_dependent_glue_.28dependent_on_xpcom.dll.29" name="Frozen_linkage:_dependent_glue_.28dependent_on_xpcom.dll.29">Frozen linkage: dependent glue (dependent on xpcom.dll)</h4>
-<p>Code which wishes to use only frozen symbols but can tolerate a load-time dependency on xpcom.dll should link against xpcom.lib and xpcomglue_s.lib. This is the case for XPCOM components.</p>
-<h4 id="Frozen_linkage:_standalone_glue_.28no_DLL_dependencies.29" name="Frozen_linkage:_standalone_glue_.28no_DLL_dependencies.29">Frozen linkage: standalone glue (no DLL dependencies)</h4>
-<p>Embedding code which wishes to use only frozen symbols and cannot tolerate a load-time dependency on &lt;tt&gt;xpcom.dll&lt;/tt&gt; should &lt;tt&gt;#define XPCOM_GLUE 1&lt;/tt&gt; while compiling, and link against &lt;tt&gt;xpcomglue.lib&lt;/tt&gt;. It should
- <i>
- not</i>
- link against &lt;tt&gt;xpcomglue_s.lib&lt;/tt&gt; or &lt;tt&gt;xpcom.lib&lt;/tt&gt;.</p>
-<p>In order to use XPCOM, the embedding application first needs to find where the XPCOM runtime is located. This is typically done using <a href="cn/GRE_GetGREPathWithProperties">GRE_GetGREPathWithProperties</a>. Then, the code must call <a href="cn/XPCOMGlueStartup">XPCOMGlueStartup</a>, which will dynamically link against the XPCOM runtime. Only then can the embedding application initialize and use XPCOM.</p>
-<p>This linkage strategy is used when an embedder needs to bootstrap an embedding app by finding a compatible <a href="cn/GRE">GRE</a>. Extension or XULRunner application components should use the dependent glue.</p>
-<p>Embedders using the standalone glue typically also need to avoid linking against NSPR as well.</p>
-<p>Emlak ilanlar</p>
-<h4 id="Using_Mozilla_internal_linkage" name="Using_Mozilla_internal_linkage">Using Mozilla internal linkage</h4>
-<p>Mozilla internal code defines MOZILLA_INTERNAL_API while compiling and links against xpcom.lib and xpcom_core.lib. In almost all cases embedders should *not* use internal linkage. Components using internal linkage will have shared-library dependencies against non-frozen symbols in the XPCOM libraries, and will not work with any other versions of XPCOM other than the one it was compiled against.</p>
-<p>Internal linkage will be unavailable to extension authors in XULRunner 1.9 (Firefox 3) because the nonfrozen symbols will not be exported from libxul. Extension and application authors currently using internal linkage should read the guide on <a href="cn/Migrating_from_Internal_Linkage_to_Frozen_Linkage">Migrating from Internal Linkage to Frozen Linkage</a>.</p>
-<h3 id="Threadsafe_nsISupports_implementations" name="Threadsafe_nsISupports_implementations">Threadsafe nsISupports implementations</h3>
-<p>When using glue libraries from Gecko 1.8 or later, a special step needs to be taken to use <code>NS_IMPL_THREADSAFE_ISUPPORTS
- <i>
- n</i>
- </code>. This is because it forces a dependency on the NSPR library, which can otherwise be avoided. As described in <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=299664" title="FIXED: add support for MOZ_USE_NSPR w/ XPCOM_GLUE">bug 299664</a>, the preprocessor symbol <code>XPCOM_GLUE_USE_NSPR</code> needs to be defined.</p>
-<h3 id="Sample_Compiler.2FLinker_Flags" name="Sample_Compiler.2FLinker_Flags">Sample Compiler/Linker Flags</h3>
-<p>Code compiled using XPCOM headers should always &lt;tt&gt;#include "xpcom-config.h"&lt;/tt&gt; from the SDK, to ensure that XPCOM #defines are correct.</p>
-<table class="fullwidth-table">
- <tbody>
- <tr>
- <th rowspan="2">Linking Strategy</th>
- <th rowspan="2">Compiler Flags</th>
- <th colspan="3">Linker Flags</th>
- </tr>
- <tr>
- <th>Windows</th>
- <th>Mac</th>
- <th>Linux</th>
- </tr>
- <tr>
- <td>Dependent Glue</td>
- <td>&lt;tt style="white-space: pre"&gt;#include "xpcom-config.h"&lt;/tt&gt;</td>
- <td>&lt;tt&gt;-LIBPATH:<var>c:/path/to/sdk/lib</var> xpcomglue_s.lib xpcom.lib nspr4.lib&lt;/tt&gt;</td>
- <td>&lt;tt&gt;-L<var>/path/to/sdk/lib</var> -L<var>/path/to/sdk/bin</var> -Wl,-executable-path,<var>/path/to/sdk/bin</var> -lxpcomglue_s -lxpcom -lnspr4&lt;/tt&gt;</td>
- <td>&lt;tt&gt;-L<var>/path/to/sdk/lib</var> -L<var>/path/to/sdk/bin</var> -Wl,-rpath-link,<var>/path/to/sdk/bin</var> -lxpcomglue_s -lxpcom -lnspr4&lt;/tt&gt;</td>
- </tr>
- <tr>
- <td>Standalone Glue</td>
- <td>&lt;tt style="white-space: pre"&gt;#include "xpcom-config.h"<br>
- #define XPCOM_GLUE 1&lt;/tt&gt;</td>
- <td>&lt;tt&gt;-LIBPATH:<var>c:/path/to/sdk/lib</var> xpcomglue.lib&lt;/tt&gt;</td>
- <td>&lt;tt&gt;-L<var>/path/to/sdk/lib</var> -lxpcomglue&lt;/tt&gt;</td>
- <td>&lt;tt&gt;-L<var>/path/to/sdk/lib</var> -lxpcomglue&lt;/tt&gt;</td>
- </tr>
- </tbody>
-</table>
-<h4 id="Notes" name="Notes">Notes</h4>
-<ul>
- <li>Never link against xpcomglue.lib and xpcomglue_s.lib at the same time.</li>
- <li>Never link against xpcomglue.lib and xpcom.lib at the same time.</li>
- <li>These instructions are for Mozilla 1.8 and above. When using a SDK from Mozilla 1.7 or earlier, you must define MOZILLA_STRICT_API when using any form of the glue.</li>
-</ul>
-<h3 id="See_Also" name="See_Also">See Also</h3>
-<ul>
- <li><a href="cn/Using_the_Gecko_SDK">Using the Gecko SDK</a></li>
-</ul>
diff --git a/files/zh-cn/mozilla/tech/xpcom/guide/arrays/index.html b/files/zh-cn/mozilla/tech/xpcom/guide/arrays/index.html
deleted file mode 100644
index 53939ba6c0..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/guide/arrays/index.html
+++ /dev/null
@@ -1,573 +0,0 @@
----
-title: Array
-slug: Mozilla/Tech/XPCOM/Guide/Arrays
-tags:
- - XPCOM
- - 所有分类
-translation_of: Mozilla/Tech/XPCOM/Guide/Arrays
----
-<p> </p>
-<h2 id="Introduction" name="Introduction">Introduction</h2>
-<h4 id="Array_types" name="Array_types">Array types</h4>
-<p>Mozilla has many array classes because each array is optimized for a particular usage pattern. This guide describes the available arrays as well as the enumerator classes that can be used to get to them. In this document the term Array refers to a container for multiple objects with a numeric, zero-based index.</p>
-<p>The standard array classes are:</p>
-<ul>
- <li><code><a href="#nsIArray_.2F_nsIMutableArray">nsIArray</a></code> - a scriptable container for scriptable XPCOM objects. This array is read-only, and the interface does not provide any methods that will allow adding and removing members.</li>
- <li><code>nsIMutableArray</code> - a scriptable container for scriptable XPCOM objects, which allows addition and removal of member objects. This interface actually derives from nsIArray.</li>
- <li><code>nsCOMArray<span class="nowiki">&lt;T&gt;</span></code> - a C++ class which provides a typesafe, reference-counted container for pointers to a single type of COM object. This class is more or less a wrapper around nsVoidArray and thus shares most of its semantics.</li>
- <li><code>nsTArray<span class="nowiki">&lt;T&gt;</span></code> - a C++ class which provides a typesafe container for objects or primitive types (pointers, integers, etc). The objects must define a default constructor and a copy constructor. To use <code>IndexOf</code> without providing a comparator, they must also define an <code>operator==</code>. For sorting without providing a comparator they must define an <code><span class="nowiki">operator&lt;</span></code>. Note that this class differs from the other array types by using unsigned indices.</li>
- <li><code>nsVoidArray</code> - a C++ class which provides a generic container for any objects using the generic void * type.</li>
- <li><code>nsStringArray</code> / <code>nsCStringArray</code> - a set of C++ classes for holding lists of string objects. Derived from nsVoidArray</li>
- <li><code>nsAutoVoidArray</code> - a version of nsVoidArray which includes 8 entries of internal storage for the array data.</li>
- <li><code>nsSmallVoidArray</code> - a replacement for nsVoidArray which is optimized to hold zero or one element.</li>
-</ul>
-<p>This handy chart may make it easier to understand the different arrays:</p>
-<table class="fullwidth-table">
- <tbody>
- <tr>
- <th>Class</th>
- <th>Data Type</th>
- <th>Scriptable?</th>
- <th>Typesafe?</th>
- <th>Can be modified?</th>
- <th>Built in buffer?</th>
- <th>Ownership</th>
- </tr>
- <tr class="even">
- <td><code><a href="#nsIArray_.2F_nsIMutableArray">nsIArray</a></code></td>
- <td>XPCOM object</td>
- <td>Yes</td>
- <td>No</td>
- <td>No</td>
- <td>No</td>
- <td>Reference Counted, Weak/Strong</td>
- </tr>
- <tr class="odd">
- <td><code>nsIMutableArray</code></td>
- <td>XPCOM object</td>
- <td>Yes</td>
- <td>No</td>
- <td>Yes</td>
- <td>No</td>
- <td>Reference Counted, Weak/Strong</td>
- </tr>
- <tr class="even">
- <td><code>nsCOMArray&lt;T&gt;</code></td>
- <td>XPCOM object</td>
- <td>No</td>
- <td>Yes</td>
- <td>Yes*</td>
- <td>No</td>
- <td>Reference Counted, Strong</td>
- </tr>
- <tr class="odd">
- <td><code>nsTArray&lt;T&gt;</code></td>
- <td>Any that has a default constructor and copy constructor</td>
- <td>No</td>
- <td>Yes</td>
- <td>Yes*</td>
- <td>No</td>
- <td>Can hold objects directly, in which case it owns them. When holding pointers, doesn't own the pointer.</td>
- </tr>
- <tr class="even">
- <td><code>nsVoidArray</code></td>
- <td>Any</td>
- <td>No</td>
- <td>No</td>
- <td>Yes*</td>
- <td>No</td>
- <td>Weak / None</td>
- </tr>
- <tr class="odd">
- <td><code>nsStringArray</code><br>
- <code>nsCStringArray</code></td>
- <td><code>nsString</code><br>
- <code>nsCString</code></td>
- <td>No</td>
- <td>Yes</td>
- <td>Yes*</td>
- <td>No</td>
- <td>Private (copies strings)</td>
- </tr>
- <tr class="even">
- <td><code>nsAutoVoidArray</code></td>
- <td>Any</td>
- <td>No</td>
- <td>No</td>
- <td>Yes*</td>
- <td>Yes</td>
- <td>Weak / None</td>
- </tr>
- <tr class="odd">
- <td><code>nsSmallVoidArray</code></td>
- <td>Any</td>
- <td>No</td>
- <td>No</td>
- <td>Yes*</td>
- <td>No</td>
- <td>Weak / None</td>
- </tr>
- <tr class="even">
- <td><code>nsISupportsArray</code></td>
- <td>XPCOM Object</td>
- <td>Yes</td>
- <td>No</td>
- <td>Yes*</td>
- <td>No</td>
- <td>Reference Counted, Strong</td>
- </tr>
- </tbody>
-</table>
-<p>(*) Note: Concrete C++ arrays can be made read-only by declaring them const. For example:</p>
-<pre class="eval">// HandleList cannot modify the array because of const
-void HandleList(const nsVoidArray&amp;);
-</pre>
-<h4 id="In-place_enumeration" name="In-place_enumeration">In-place enumeration</h4>
-<p>Most of the arrays presented here provide callback-style means to enumerate members of an array. Instead of incrementally accessing each element of the array by its index, the arrays provide a way to pass in a callback function that will be called for each element in the array.</p>
-<p>For most concrete C++ classes like <code>nsVoidArray</code> and <code>nsCOMArray&lt;T&gt;</code>, indexing should be faster than the callback-style enumeration, because accessing an indexed member of such an array is usually very fast, while enumeration has slight function call overhead. In the case of scriptable arrays like nsIArray however, the enumeration mechanism is often preferred because it avoids the AddRef / Release overhead that comes from accessing each object.</p>
-<p>The only functional drawback to in-place enumeration is that you cannot manipulate the array itself during the enumeration. For example, you should not delete elements of an array during the enumeration as this will often confuse the loop which is enumerating the array.</p>
-<h4 id="Enumerators" name="Enumerators">Enumerators</h4>
-<p>Most arrays provide access to an object which is used to enumerate members of the array. These Enumerators maintain state about the current position in the array. Enumerators are used to access the elements in an ordered way, without relying on the underlying array type. These enumerators include:</p>
-<ul>
- <li><code>nsISimpleEnumerator</code> - an enumerator for COM objects.</li>
- <li><code>nsIStringEnumerator</code> / <code>nsIUTF8StringEnumerator</code> - enumerators for strings</li>
-</ul>
-<h4 id="Obsolete_arrays_.2F_enumerators" name="Obsolete_arrays_.2F_enumerators">Obsolete arrays / enumerators</h4>
-<p>There are some deprecated classes which <b>should not be used by new code</b>.</p>
-<ul>
- <li><code>nsISupportsArray</code> - obsoleted by <code><a href="#nsIArray_.2F_nsIMutableArray">nsIArray</a></code>, use that instead.</li>
- <li><code>nsIEnumerator</code> - obsoleted by <code>nsISimpleEnumerator</code>, use that instead.</li>
- <li><code>nsIBidirectionalEnumerator</code> - obsoleted by <code>nsISimpleEnumerator</code>, use that instead.</li>
- <li><code>nsVoidArray</code> - <code>nsTArray<span class="nowiki">&lt;T&gt;</span></code> is preferred. Using <code>nsAutoVoidArray</code> is still ok, since that saves an allocation over using <code>nsTArray<span class="nowiki">&lt;T&gt;</span>(8)</code>.</li>
-</ul>
-<h2 id="Which_Array_should_I_use.3F" name="Which_Array_should_I_use.3F">Which Array should I use?</h2>
-<p>Do not use <code>nsISupportsArray</code>; it is deprecated.</p>
-<p>Does your array need to be scriptable? If so, use <code>nsIArray</code>.</p>
-<p>Example: an array attribute in an IDL file would be <code>nsIArray</code>.</p>
-<p>Will your array store non-refcounted objects and need automatic resizing? If so, use <code>nsTArray<span class="nowiki">&lt;T&gt;</span></code>.</p>
-<p>Example: an array of integers or an array of strings.</p>
-<p>Will your array store non-refcounted objects and be a fixed size? If so, just use a native C++ array unless you need the enumeration options on <code>nsTArray<span class="nowiki">&lt;T&gt;</span></code>.</p>
-<p>Example: an array of error message static const char* pointers.</p>
-<p>Are all the things you are storing interface pointers to instances of the same interface? If so, use <code>nsCOMArray</code>.</p>
-<p>Example: a content node's list of <code>nsIContent</code> children.</p>
-<p>Otherwise use <code>nsIArray</code> and make liberal use of <code>QueryElementAt()</code>.</p>
-<p>The point of <code>nsCOMArray</code> is that it's a template, and all the pointers in it must be pointers to the same type; it's nice to be able to use it because you get type-safety and don't have to spend time and code QIing (like you have to with <code>nsIArray</code>).</p>
-<h2 id="Array_Guidelines" name="Array_Guidelines">Array Guidelines</h2>
-<p>Here are a few simple rules which will keep your code clean and your developers happy:</p>
-<ul>
- <li>Use typesafe arrays like <code>nsCOMArray<span class="nowiki">&lt;T&gt;</span></code> <code>nsTArray<span class="nowiki">&lt;T&gt;</span></code> wherever possible.</li>
- <li>Avoid all obsolete arrays and enumerators.</li>
- <li>Avoid creating temporary arrays.</li>
-</ul>
-<h2 id="Scriptable_Arrays" name="Scriptable_Arrays">Scriptable Arrays</h2>
-<h3 id="nsIArray_.2F_nsIMutableArray" name="nsIArray_.2F_nsIMutableArray">nsIArray / nsIMutableArray</h3>
-<h4 id="Usage" name="Usage">Usage</h4>
-<p><code>nsIArray</code> is useful if you need to pass arrays of COM objects through interfaces or require a scriptable array. It can hold strong or weak references to its container objects. This basic interface only allows querying of existing elements in the array. The methods that modify the array have been broken out into <code>nsIMutableArray</code>.</p>
-<p>An <code>nsIArray</code> implementation can be created from C++ with the function <code>NS_NewArray(nsIMutableArray**);</code>. The created array implements <code>nsIMutableArray</code> and <code>nsIArray</code>. Since <code>nsIArray</code> derives from <code>nsIMutableArray</code>, the resulting array can be cast to a read-only array.</p>
-<pre class="eval">void GetList(nsIArray** aResult) {
- nsCOMPtr&lt;nsIMutableArray&gt; array;
- NS_NewArray(getter_AddRefs(array));
-
- // append some elements
- ...
-
- // return it to the caller
- *aResult = array;
- NS_ADDREF(*aResult);
-}
-</pre>
-<h4 id="Access_to_elements" name="Access_to_elements">Access to elements</h4>
-<p>Since <code>nsIArray</code> is a regular XPCOM object, its interfaces follows the standard conventions of ownership. Access to specific elements is through <code>QueryElementAt</code>, which is similar to <code>QueryInterface</code>, but it takes a specific index.</p>
-<pre class="eval">void NotifyObservers(nsIArray* aArray) {
- PRUint32 length;
- aArray-&gt;GetLength(&amp;length);
- for (PRUint32 i=0; i&lt;length; ++i) {
- nsCOMPtr&lt;nsIMyObserver&gt; element;
- aArray-&gt;QueryElementAt(i, NS_GET_IID(nsIElement),
- getter_AddRefs(element));
- element-&gt;Observe();
- }
-}
-</pre>
-<p>A simpler option is to use the helper <code>do_QueryElementAt</code> which is typesafe.</p>
-<pre class="eval">void NotifyObservers(nsIArray* aArray) {
- PRUint32 length;
- aArray-&gt;GetLength(&amp;length);
- for (PRUint32 i=0; i&lt;length; ++i) {
- nsCOMPtr&lt;nsIMyObserver&gt; element =
- do_QueryElementAt(aArray, i);
- element-&gt;Observe();
- }
-}
-</pre>
-<h4 id="Passing_as_a_parameter" name="Passing_as_a_parameter">Passing as a parameter</h4>
-<p>Since <code>nsIArray</code> is an XPCOM object, it should be passed as a pointer. To distinguish between read-only arrays and writable arrays, you should make sure to pass a nsIArray or <code>nsIMutableArray</code> as appropriate.</p>
-<p>When the array can or should be modified, then use nsIMutableArray:</p>
-<pre class="eval">// array is read-only because it uses nsIArray
-void PrintSize(nsIArray* elements) {
- PRUint32 count;
- elements-&gt;GetLength(&amp;count);
- printf("There are %d elements.\n", count);
-}
-
-// using nsIMutableArray, so callee may modify
-void TweakArray(nsIMutableArray* elements) {
- elements-&gt;RemoveElementAt(0);
- elements-&gt;AppendElement(newElement, PR_FALSE);
-}
-</pre>
-<p>While it is usually possible to call <code>QueryInterface</code> on an <code>nsIArray</code> to get access to the <code>nsIMutableArray</code> interface, this is against convention and it should be avoided.</p>
-<pre class="eval">// no need for the double-pointer, and this violates XPCOM rules
-// which expect acess to a new object
-void TweakArray(nsIMutableArray** elements) {
- // ugh, extra indirection!
- *elements-&gt;RemoveElementAt(0);
- *elements-&gt;AppendElement(newElement, PR_FALSE);
-}
-</pre>
-<h4 id="In-place_enumeration_2" name="In-place_enumeration_2">In-place enumeration</h4>
-<p>When accessing all members of an <code>nsIArray</code>, in-place enumeration is preferred over indexed access. However, I seem to have forgotten to implement that. Good thing the interface is under review. Sorry!</p>
-<h4 id="Enumerators_2" name="Enumerators_2">Enumerators</h4>
-<p>Creating an enumerator from an <code>nsIArray</code> is easy. The method <code>Enumerate()</code> returns a <code>nsISimpleEnumerator</code> which accesses all the elements in the array. Often, simply accessing an array by index, using <code>QueryElementAt</code> is faster. See the section on Enumerators to learn when to properly use enumerators.</p>
-<p>For example, if you need to iterate an array returned from another object, you might use <code>Enumerate()</code>.</p>
-<pre class="eval">...
-// get the array
-nsCOMPtr&lt;nsIArray&gt; array;
-foo-&gt;GetElements(getter_AddRefs(array));
-
-// make an enumerator
-nsCOMPtr&lt;nsISimpleEnumerator&gt; enumerator;
-array-&gt;Enumerate(getter_AddRefs(enumerator));
-
-// now enumerate the elements
-...
-</pre>
-<h2 id="Typesafe_Arrays" name="Typesafe_Arrays">Typesafe Arrays</h2>
-<h3 id="nsCOMArray.3CT.3E" name="nsCOMArray.3CT.3E">nsCOMArray&lt;T&gt;</h3>
-<p><code>nsCOMArray&lt;T&gt;</code> is a typesafe wrapper around <code>nsVoidArray</code>, so it has a similar API. It enforces both typesafety and XPCOM reference counting by keeping an owning reference to each element in the array.</p>
-<h4 id="Usage_2" name="Usage_2">Usage</h4>
-<p>It is most often used as a member of a C++ class to store a list of well-typed XPCOM objects. It is also usually declared as an inline member rather than a pointer. As a class member, <code>nsCOMArray&lt;T&gt;</code> is preferred over <code>nsIArray</code> when access to the array is confined to the class itself.</p>
-<p>For example, here is its use in a class:</p>
-<pre class="eval">class NodeContainer {
-public:
- void AddNode(nsINode* node);
-
-private:
- nsCOMArray&lt;nsINode&gt; mNodes;
-};
-
-// typesafety of mNodes ensures that we only append an nsINode*
-void NodeContainer::AddNode(nsINode* node) {
- mNodes.AppendObject(node);
-}
-
-</pre>
-<p><code>nsCOMArray&lt;T&gt;</code> can also be declared on the stack to collect a temporary list of objects and manipulate them. When the object goes out of scope, all its members are released.</p>
-<pre class="eval">void ProcessVisibleItems()
-{
- // temporary stack-based nsCOMArray
- nsCOMArray&lt;nsIFoo&gt; fooItems;
- GetCompleteList(fooItems);
-
- // now filter out non visible objects
- // doing this backwards
- PRUint32 i = fooItems.Count();
- while (i &gt; 0) {
- --i;
- PRBool isVisible;
- fooItems[i]-&gt;GetIsVisible(&amp;isVisible);
- if (!isVisible) {
- fooItems.RemoveObjectAt(i);
- }
- }
-
- // now deal with the processed list
- ProcessList(fooItems);
-
- // fooItems will release all its members
- // when it goes out of scope
-}
-</pre>
-<h4 id="Access_to_elements_2" name="Access_to_elements_2">Access to elements</h4>
-<p><code>nsCOMArray&lt;T&gt;</code> is a concrete C++ class, and so the [] operator is used to access its members. When using the [] operator, the reference count is unchanged. This allows direct processing of array elements without worrying about calling <code>Release()</code>.</p>
-<p>For example, this code calls the same method on each member:</p>
-<pre class="eval">void NotifyObservers(const nsCOMArray&lt;nsIMyObserver&gt;&amp; observers) {
- // Using [] doesn't leak!
- for (PRInt32 i = observers.Count() - 1; i &gt;= 0 ; i--)
- observers[i]-&gt;Observe();
-}
-</pre>
-<p>Be careful with this though, you could end up with a weak pointer if you're converting from non-nsCOMArray code.</p>
-<pre class="eval">// old version, relied on automatic addref
-// mElements is an nsISupportsArray*
-void GetFirstObject(nsIElement** aResult) {
- // no need to call NS_ADDREF - this does it for you
- mElements-&gt;QueryElementAt(0, NS_GET_IID(nsIElement),
- (void**)aResult);
-}
-
-// new version, make sure to call NS_ADDREF()
-// mElements is now a nsCOMArray&lt;nsIElement&gt;
-void GetFirstObject(nsIElement** aResult) {
- *aResult = mElements[0];
- NS_ADDREF(*aResult);
-}
-</pre>
-<h4 id="Passing_as_a_parameter_2" name="Passing_as_a_parameter_2">Passing as a parameter</h4>
-<p>When passing <code>nsCOMArray&lt;T&gt;</code> among functions, the convention is to pass by reference. Also be sure to use const if you want to enforce that the array is read-only.</p>
-<p>Here is an example with a read-only and a writable array:</p>
-<pre class="eval">// array is read-only because of const
-void PrintSize(const nsCOMArray&lt;nsIElements&gt;&amp; elements) {
- printf("There are %d elements.\n", elements.Count());
-}
-
-// no const, so we can modify the array
-void TweakArray(nsCOMArray&lt;nsIElement&gt;&amp; elements, nsIElement* newElement) {
- elements.RemoveObjectAt(0);
- elements.AppendObject(newElement);
-}
-</pre>
-<h4 id="In-place_enumeration_3" name="In-place_enumeration_3">In-place enumeration</h4>
-<p>The callback-based enumeration in <code>nsCOMArray&lt;T&gt;</code> is about as fast as, if not faster than, standard loop-based iteration. The callback mechanism can be useful when integrating with existing callback-style code however.</p>
-<p>One particularly nice thing about the callback mechanism is that it is typesafe. For instance:</p>
-<pre class="eval">PR_CALLBACK PRBool getFirstVisible(nsIElement* element, void* closure) {
- PRBool isVisible;
- element-&gt;IsVisible(&amp;isVisible);
-
- // stop at first object
- if (isVisible) {
- NS_STATIC_CAST(ClosureObject*,closure)-&gt;element = element;
- return PR_FALSE;
- }
- return PR_TRUE;
-}
-
-...
-// enumerate to find the object
-ClosureObject closureObject = { 0 };
-if (!mElements.EnumerateForwards(getFirstVisible, closureObject))
- processElement(closureObject-&gt;element);
-...
-</pre>
-<h4 id="Enumerators_3" name="Enumerators_3">Enumerators</h4>
-<p>A <code>nsISimpleEnumerator</code> can be created to provide access to a <code>nsCOMArray&lt;T&gt;</code>. When the enumerator is created, it takes a snapshot of the elements in the array, so that the enumerator can outlive the array.</p>
-<p>To create the enumerator, use <code>NS_NewArrayEnumerator(nsISimpleEnumerator**, const nsCOMArray&lt;T&gt;&amp;)</code>. For example:</p>
-<pre class="eval">// mElements is an nsCOMArray&lt;nsIElement&gt;
-nsFoo::GetElements(nsISimpleEnumerator** aResult) {
- return NS_NewArrayEnumerator(aResult, mElements);
-}
-</pre>
-<h3 id="nsTArray.3CT.3E" name="nsTArray.3CT.3E">nsTArray&lt;T&gt;</h3>
-<p><code>nsTArray&lt;T&gt;</code> is a typesafe array for holding various objects. It can be used to hold objects directly, not just pointers to objects.</p>
-<h4 id="Usage_3" name="Usage_3">Usage</h4>
-<p>It is most often used as a member of a C++ class to store a list of well-typed objects. It is also usually declared as an inline member rather than a pointer. As a class member, <code>nsTArray&lt;T&gt;</code> is preferred over <code>nsVoidArray</code>.</p>
-<p>For example, here is its use in a class:</p>
-<pre class="eval">class MediaList {
-public:
- void AddMedium(const nsString&amp; aMedium);
-
-private:
- nsTArray&lt;nsString&gt; mMedia;
-};
-
-// typesafety of mMedia ensures that we only append an nsString
-void NodeContainer::AddMedium(const nsString&amp; aMedium) {
- mMedia.AppendElement(aMedium);
-}
-
-</pre>
-<p><code>nsTArray&lt;T&gt;</code> can also be declared on the stack to collect a temporary list of objects and manipulate them. When the object goes out of scope, all its members have their destructors called. Note that if the <code>nsTArray&lt;T&gt;</code> holds pointers to objects, the objects will not be deleted (and hence not have their destructors called).</p>
-<pre class="eval">void ProcessVisibleItems()
-{
- // temporary stack-based nsTArray
- nsTArray&lt;FooStruct&gt; fooItems;
- GetCompleteList(fooItems);
-
- // now filter out non visible objects
- // doing this backwards
- PRUint32 i = fooItems.Length();
- while (i &gt; 0) {
- --i;
- PRBool isVisible;
- fooItems[i]-&gt;GetIsVisible(&amp;isVisible);
- if (!isVisible) {
- fooItems.RemoveElementAt(i);
- }
- }
-
- // now deal with the processed list
- ProcessList(fooItems);
-
- // fooItems will call the destructors of all the FooStruct objects
- // when it goes out of scope
-}
-</pre>
-<h4 id="Access_to_elements_3" name="Access_to_elements_3">Access to elements</h4>
-<p><code>nsTArray&lt;T&gt;</code> is a concrete C++ class, and so the [] operator is used to access its members.</p>
-<p>For example, this code calls the same method on each member:</p>
-<pre class="eval">void NotifyObservers(const nsTArray&lt;ObserverClass*&gt;&amp; observers) {
- for (PRUint32 i = observers.Length(); i &gt; 0 ; ) {
- --i;
- observers[i]-&gt;Observe();
- }
-}
-</pre>
-<h4 id="Passing_as_a_parameter_3" name="Passing_as_a_parameter_3">Passing as a parameter</h4>
-<p>When passing <code>nsTArray&lt;T&gt;</code> among functions, the convention is to pass by reference. Also be sure to use <code>const</code> if you want to enforce that the array is read-only.</p>
-<p>Here is an example with a read-only and a writable array:</p>
-<pre class="eval">// array is read-only because of const
-void PrintSize(const nsTArray&lt;nsElement&gt;&amp; elements) {
- printf("There are %d elements.\n", elements.Length());
-}
-
-// no const, so we can modify the array
-void TweakArray(nsTArray&lt;nsElement&gt;&amp; elements,
- const nsElement&amp; newElement) {
- elements.RemoveElementAt(0);
- elements.AppendElement(newElement);
-}
-</pre>
-<h4 id="In-place_enumeration_4" name="In-place_enumeration_4">In-place enumeration</h4>
-<p>There are no enumerator objects that work on an <code>nsTArray&lt;T&gt;</code>.</p>
-<h2 id="C.2B.2B_Arrays" name="C.2B.2B_Arrays">C++ Arrays</h2>
-<h3 id="nsVoidArray" name="nsVoidArray">nsVoidArray</h3>
-<p><code>nsVoidArray</code> is a concrete C++ class that allows for storage of any arbitrary object. The base type for all objects is void *. When converting to/from a void *, use <code>NS_STATIC_CAST</code> to ensure that no const-ness is lost.</p>
-<p>Note that <code>nsVoidArray</code> defines no semantics of ownership of its objects. Depending on its use, the array may either own the objects that it points to, or its member may be pointers to existing objects that are owned by another data structure. Because nsVoidArray itself does not define any ownership rules, it is up to the consumer to know when it is appropriate to free objects out of the array.</p>
-<p>This implies that when an <code>nsVoidArray</code> goes out of scope, seperate code must free any memory that is semantically owned by the array. This should always be documented in the declaration of the array instance.</p>
-<p><code>nsCOMArray&lt;T&gt;</code> was designed to eliminate some of the overhead of using nsVoidArray when using COM objects. If your code is using <code>nsVoidArray</code> to keep references to COM objects, consider converting it to <code>nsCOMArray&lt;T&gt;</code>.</p>
-<h4 id="Usage_4" name="Usage_4">Usage</h4>
-<p><code>nsVoidArray</code> is often used as a member variable in a class. Remember to document ownership!</p>
-<pre class="eval">struct FooElement {
- ...
-};
-
-class nsFoo : nsIFoo {
- ...
- virtual ~nsFoo();
- ...
-
- private:
- // mElements owns a list of FooElement structs,
- // which must be deleted when this object goes away
- nsVoidArray mElements;
-
- // mVisibleElements contains weak (non-owning) references
- // to elements in mElements, and does not need to be cleaned up
- nsVoidArray mVisibleElements;
-};
-
-nsFoo::~nsFoo() {
- // mVisibleElements is fine, but
- // don't forget to clean up mElements!
- PRUint32 i, count = mElements.Count();
- for (i=0; i&lt;count; ++i)
- delete NS_STATIC_CAST(FooElement*, mElements[i]);
- }
-
-</pre>
-<p>As you can see, <code>nsVoidArray</code> has some context-specific overhead to make sure memory is cleaned up appropriately.</p>
-<h4 id="Access_to_elements_4" name="Access_to_elements_4">Access to elements</h4>
-<p>The [] operator is used to access member variables. Don't forget to use <code>NS_STATIC_CAST()</code>.</p>
-<pre class="eval">for (i=0; i&lt;count; ++i) {
- FooElement* element = NS_STATIC_CAST(FooElement*,mElements[i]);
- // now manipulate element
-}
-
-</pre>
-<h4 id="Passing_as_a_parameter_4" name="Passing_as_a_parameter_4">Passing as a parameter</h4>
-<p>Like other concrete C++ classes, passing by reference using the &amp; syntax is preferred.</p>
-<h4 id="In-place_enumeration_5" name="In-place_enumeration_5">In-place enumeration</h4>
-<h4 id="Enumerators_4" name="Enumerators_4">Enumerators</h4>
-<h3 id="nsStringArray_.2F_nsCStringArray" name="nsStringArray_.2F_nsCStringArray">nsStringArray / nsCStringArray</h3>
-<h4 id="Usage_5" name="Usage_5">Usage</h4>
-<h4 id="Access_to_elements_5" name="Access_to_elements_5">Access to elements</h4>
-<h4 id="Passing_as_a_parameter_5" name="Passing_as_a_parameter_5">Passing as a parameter</h4>
-<h4 id="In-place_enumeration_6" name="In-place_enumeration_6">In-place enumeration</h4>
-<h4 id="Enumerators_5" name="Enumerators_5">Enumerators</h4>
-<h3 id="nsAutoVoidArray" name="nsAutoVoidArray">nsAutoVoidArray</h3>
-<h4 id="Usage_6" name="Usage_6">Usage</h4>
-<h4 id="Access_to_elements_6" name="Access_to_elements_6">Access to elements</h4>
-<h4 id="Passing_as_a_parameter_6" name="Passing_as_a_parameter_6">Passing as a parameter</h4>
-<h4 id="In-place_enumeration_7" name="In-place_enumeration_7">In-place enumeration</h4>
-<h4 id="Enumerators_6" name="Enumerators_6">Enumerators</h4>
-<h3 id="nsSmallVoidArray" name="nsSmallVoidArray">nsSmallVoidArray</h3>
-<h4 id="Usage_7" name="Usage_7">Usage</h4>
-<h4 id="Access_to_elements_7" name="Access_to_elements_7">Access to elements</h4>
-<h4 id="Passing_as_a_parameter_7" name="Passing_as_a_parameter_7">Passing as a parameter</h4>
-<h4 id="In-place_enumeration_8" name="In-place_enumeration_8">In-place enumeration</h4>
-<h4 id="Enumerators_7" name="Enumerators_7">Enumerators</h4>
-<h2 id="Enumerators_8" name="Enumerators_8">Enumerators</h2>
-<p>Enumerators are very simple, structure-free objects for visiting each member of a set of objects. The enumerators are used as a generic interface for arrays, hashtables, and other constructs which contain one or more objects. When designing public interfaces, enumerators are the preferred mechanism for accessing these structures because they hide the details of the implementation behind the interface.</p>
-<h3 id="nsISimpleEnumerator" name="nsISimpleEnumerator">nsISimpleEnumerator</h3>
-<p><code>nsISimpleEnumerator</code> is a generic enumerator for enumerating a list of any XPCOM object. There are many implementations of <code>nsISimpleEnumerator</code>, including one that enumerates <code>nsIArray</code> objects, and another one for <code>nsCOMArray</code>. It is very common for other interfaces which support <code>nsISimpleEnumerator</code> to make their own implementations.</p>
-<h3 id="nsIStringEnumerator" name="nsIStringEnumerator">nsIStringEnumerator</h3>
-<p>String enumerators provide an easy way to pass a list of strings around with minimal copying. Both unicode strings and UTF8-encoded strings are supported. For more information about the different types of strings, see the String Guide.</p>
-<p>String enumerators can be created from <code>nsStringArray</code> or <code>nsCStringArray</code> objects. The implementation of the string enumerator interfaces for <code>nsStringArray</code> and <code>nsCStringArray</code> supports conversion between UTF8 and Unicode, and can be QueryInterface'd back and forth between <code>nsIStringEnumerator</code> and <code>nsIUTF8StringEnumerator</code>.</p>
-<p>To create an nsIStringEnumerator for an <code>nsStringArray</code>, you can use one of the variations of <code>NS_NewStringEnumerator</code>. There are also corresponding enumerators and helpers for UTF8 strings. In the examples below, <code>NS_NewUTF8StringEnumerator</code> can be used along with <code>nsIUTF8StringEnumerator</code> and <code>nsCStringArray</code>.</p>
-<p>This first example demonstrates the case where a class which owns an <code>nsStringArray</code>, and are returns an <code>nsIStringEnumerator</code> to a caller. You can use the variation of <code>NS_NewStringEnumerator</code> that ensures the owner of the array outlives the enumerator. This is necessary because nsStringArray is not reference counted. Without holding a reference to the owner, the enumerator could be left with a dangling pointer to a deleted <code>nsStringArray</code>.</p>
-<pre class="eval">class nsFoo : nsIFoo {
-...
-private:
- nsStringArray mElementNames;
-};
-
-nsFoo::GetElementNames(nsIStringEnumerator** aResult)
-{
- // pass in "this" to make sure the enumerator
- // holds a reference to "this"
- return NS_NewStringEnumerator(aResult, mElementNames, this);
-}
-</pre>
-<p>One variant of <code>NS_NewStringEnumerator</code> does not require an owner, but should only be used when the lifetime of the enumerator is known to be shorter than that of the array. Often this is used when a method must take a <code>nsIStringEnumerator</code> rather than an <code>nsStringArray</code>, due to some sort of interface constraint.</p>
-<pre class="eval">class nsFoo : nsIFoo {
- ...
- // when ProcessElements returns, the enumerator is at the
- // end of the list, and can be released.
- NS_IMETHODIMP ProcessNames(nsIStringEnumerator*);
- private:
-
- nsStringArray mElementNames;
-};
-
-...
-nsCOMPtr&lt;nsIStringEnumerator&gt; enumerator;
-NS_NewStringEnumerator(getter_AddRefs(enumerator), mElementNames);
-
-// now call a method on "this" that has a known behavior
-ProcessNames(enumerator);
-// now enumerator is used up, and can be released
-...
-</pre>
-<p>The last version of <code>nsIStringEnumerator</code> takes ownership of an <code>nsStringArray</code> and is responsible for freeing the array when the enumerator is used up.</p>
-<pre class="eval">void GetNames(nsIStringEnumerator** aResult)
-{
- nsStringArray *resultArray = new nsStringArray;
- resultArray-&gt;AppendString(str1);
- resultArray-&gt;AppendString(str2);
-
- // enumerator will free resultArray
- return NS_NewAdoptingStringEnumerator(aResult, resultArray);
-}
-</pre>
-<p>As noted above, these implementations of <code>nsIStringEnumerator</code> can also be QueryInterface'd between nsIStringEnumerator and <code>nsIUTF8StringEnumerator</code>. The implementations will properly convert back and forth between UTF8 and Unicode. To ensure that you get the right implementation and the conversion is done in the right direction, make sure that you call the version of <code>NS_NewStringEnumerator</code> or <code>NS_NewUTF8StringEnumerator</code> that corresponds to the array type, not the enumerator type.</p>
-<p>For example, if a class has an internal <code>nsCStringArray</code> of UTF8 strings, but needs to implement an interface which returns an nsIStringEnumerator, it should use <code>NS_NewStringEnumerator</code>:</p>
-<pre class="eval">class nsFoo : nsIFoo {
- ...
- NS_IMETHOD GetStrings(nsIStringEnumerator** aResult);
-</pre>
-<pre class="eval"> private:
- nsCStringArray mElementNames;
-};
-
-NS_IMETHODIMP
-nsFoo::GetStrings(nsIStringEnumerator** aResult) {
- nsresult rv;
- nsCOMPtr&lt;nsIUTF8StringEnumerator&gt; enumerator
- rv = NS_NewUTF8StringEnumerator(getter_AddRefs(enumerator),
- mElementNames, this);
- return CallQueryInterface(enumerator, aResult);
-}
-</pre>
-<h2 id="Obsolete_Arrays_and_Enumerators" name="Obsolete_Arrays_and_Enumerators">Obsolete Arrays and Enumerators</h2>
-<h3 id="nsISupportsArray" name="nsISupportsArray">nsISupportsArray</h3>
-<h3 id="nsIEnumerator_.28includes_nsIBidirectionalEnumerator.29" name="nsIEnumerator_.28includes_nsIBidirectionalEnumerator.29">nsIEnumerator (includes nsIBidirectionalEnumerator)</h3>
diff --git a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/an_overview_of_xpcom/index.html b/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/an_overview_of_xpcom/index.html
deleted file mode 100644
index 64bf41704f..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/an_overview_of_xpcom/index.html
+++ /dev/null
@@ -1,535 +0,0 @@
----
-title: 创建_XPCOM_组件/XPCOM_简介
-slug: Mozilla/Tech/XPCOM/Guide/Creating_components/An_Overview_of_XPCOM
-tags:
- - XPCOM
- - 所有分类
-translation_of: Mozilla/Tech/XPCOM/Guide/Creating_components/An_Overview_of_XPCOM
----
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/创建_XPCOM_组件:前言" style="float: left;">« 上一页</a><a href="/zh-CN/docs/创建_XPCOM_组件:使用_XPCOM_组件">下一页 »</a></p>
-</div><p></p>
-
-<p>这是一本关于 XPCOM 的书. 这本书是以编写一个 XPCOM 组件的方式来组织的, 但是这个过程涵盖了 XPCOM 组件模型主要的出发点, 概念和术语.</p>
-
-<p>本章以 XPCOM 的快速导览开始, 简单介绍了 XPCOM 和组件开发的基本概念和技术. 本章的大部分内容从一个很高的角度介绍了这些概念, 这些概念将在创建一个称为 <strong>WebLock</strong> 的 Mozilla 组件过程中逐渐透彻的讲述.</p>
-
-<h3 id="XPCOM_.E8.A7.A3.E5.86.B3.E6.96.B9.E6.A1.88" name="XPCOM_.E8.A7.A3.E5.86.B3.E6.96.B9.E6.A1.88">XPCOM 解决方案</h3>
-
-<p>Cross Platform Component Object Module (XPCOM) 是一个允许开发人员把一个大的工程划分成小的模块的框架. 这些小模块称为<em>组件</em>, 它们在运行时刻组装在一起.</p>
-
-<p>XPCOM 的目标是使软件的不同部分分别开发, 相互独立. 为了是应用的不同组件之间能够互操作, XPCOM 把组件的<em>实现</em>与<em>接口</em>(后面讨论<a href="#接口">接口</a>)分开. 同时 XPCOM 还提供了加载和操纵这些组件的库和工具以及服务, 以帮助开发人员编写跨平台的代码和组件版本管理; 因此组件可以在不破坏应用或者重新生成应用的同时被替换被更新. 通过使用 XPCOM, 开发人员创建的组件可以在不同的应用中被重用, 或者替换当前应用中的组件以改变应用的功能.</p>
-
-<p>XPCOM 不只提供组件软件开发的支持, 它同时提供一个开发平台的大多数功能的支持:</p>
-
-<ul>
- <li>组件管理</li>
- <li>文件抽象</li>
- <li>对象消息传递</li>
- <li>内存管理</li>
-</ul>
-
-<p>我们将在后面的章节中详细讨论上面的条目, 但是现在, 仅仅把 XPCOM 想象成一个 <em>组件开发平台</em>, 它提供了上面的这些特性.</p>
-
-<h3 id="Gecko" name="Gecko">Gecko</h3>
-
-<p>XPCOM 尽管在许多方面类似于 Microsoft COM, 但 XPCOM 被设计成主要应用于应用层. XPCOM 的最重要的应用是 <em>Gecko</em>, 一个开源的, 遵循标准的, 嵌入式 web 浏览器和 工具包.</p>
-
-<p>XPCOM 是访问 Gecko 库和嵌入或扩展 Gecko 的方法. 本书着重于后者 - 扩展 Gecko - 但是本书中描述的基本思想对嵌入 Gecko 的开发人员也很重要.</p>
-
-<p>Gecko 应用在许多 internet 程序中, 主要是浏览器. 包括 Gateway/AOL Instant AOL device 和 Nokia Media Terminal. Gecko 最近还被应用于的 Compuserve 客户端, AOL for Mac OS X, Netscape 7, 当然还包括 Mozilla 客户端. Gecko 是目前而言主流的开源浏览器.</p>
-
-<h3 id=".E7.BB.84.E4.BB.B6" name=".E7.BB.84.E4.BB.B6">组件</h3>
-
-<p>XPCOM 允许把一个大的工程分解为一些小部分. 这些小部分称为组件, 通常是一些小的可重用的二进制库(在 Windows 下表现为一个 DLL (动态联接库), Unix 下为一个 DSO (分布式共享对象), 这些二进制库可以包含一个或多个组件. 当多个相关组件被封装到一个二进制库, 这个库也称为<em>模块</em>.</p>
-
-<p>把软件划分成不同的组件可以使开发和维护工作变得更容易. 除了这个好处, 模块化组件化的编程还有下面的优势:</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">优点</td>
- <td class="header">描述</td>
- </tr>
- <tr>
- <td>重用</td>
- <td>模块化的代码可以在其他应用和环境中被重用.</td>
- </tr>
- <tr>
- <td>更新</td>
- <td>在不需要重新编译整个应用的情况下更新组件.</td>
- </tr>
- <tr>
- <td>性能</td>
- <td>代码按照模块化组织, 模块就不必要立刻被加载, 而是以 "lazy" 方式加载, 或者根本不需要加载. 这样就可以提升应用的整体性能.</td>
- </tr>
- <tr>
- <td>维护</td>
- <td>甚至在不更新组件的情况下, 按照模块化的方式设计应用也能够使你对感兴趣的部分的维护变得更容易.</td>
- </tr>
- </tbody>
-</table>
-
-<p>Mozilla 有几百万行代码, 没有那个人能够彻底搞明白整个代码的细节. 面对这样的一个系统, 最好的方式是把它划分成一些小的, 更容易管理的部分; 同时使用组件模型来编程, 把相关组件组织到各个模块中去. 比如说, Mozilla 的网络库就包含了 HTTP, FTP, 及其他协议的组件, 这些组件被塞到一个单独的库里. 这个库就是网络模块, 也就是通常所说的 "necko."</p>
-
-<p>但是把事物划分开来并不一定就好, 有许多事物作为一个整体组织起来才是最好的方式, 或者根本就不能划分开来. 比如说, 一个小孩就可能不吃没有果酱的三明志, 对于他来说, 果酱和三明志是缺一不可的整体. 同样的情形也会存在于某些软件中, 某些需要紧耦合的仅仅在内部使用的部分就并不需要费力去把它拆开成为小的模块.</p>
-
-<p>Gecko 中的 HTTP (超文本传输协议)  组件并不会暴露它内部的类, 它是作为一个整体来使用. 组件内部的事物不应该暴露给 XPCOM. 在 Mozilla 早期的开发中, 有些组件的创建并不适当, 但是随着开发的深入, 这些部分会被逐渐移出 XPCOM.</p>
-
-<h3 id=".E6.8E.A5.E5.8F.A3" name=".E6.8E.A5.E5.8F.A3">接口</h3>
-
-<p>把软件划分成组件通常一个好的解决方法, 但是我们该怎么做呢? 基本的思路是按照功能进行划分, 理解这些功能块之间的如何进行通信. 这些组件之间的通信通道就构成了各个组件的边界, 这些边界形式的描述为<em>接口</em>.</p>
-
-<p>接口并不是编程中的一个新的概念. 从我们的第一个 "HelloWorld" 程序开始我们就一直在不知不觉的使用它, 这里的接口就存在于我们的应用程序和打印程序之间. 应用程序使用 <code>stdio</code> 库提供的接口来把 "hello world" 字符串打印到屏幕上. XPCOM 与 "HelloWorld" 程序的不同之处在于 XPCOM 会在运行时刻找到这个屏幕打印的功能, 而 XPCOM 事前根本就不需要在编译的时刻了解 <code>stdio</code> 库提供了什么东西.</p>
-
-<p>接口允许开发人员把功能的具体实现<em>封装</em>在组件内部, 而客户程序不需要了解这个功能是如何实现的, 它只需要使用它就行了.</p>
-
-<div class="side-note">
-<p><span id="%E6%8E%A5%E5%8F%A3%E4%B8%8E%E6%8C%89%E7%85%A7%E5%A5%91%E7%BA%A6(Contract)%E7%BC%96%E7%A8%8B"><a id="%E6%8E%A5%E5%8F%A3%E4%B8%8E%E6%8C%89%E7%85%A7%E5%A5%91%E7%BA%A6(Contract)%E7%BC%96%E7%A8%8B"></a><strong>接口与按照契约(Contract)编程</strong></span></p>
-
-<p>一个接口在组件与客户程序之间达成契约. 并没有任何强制措施保证认同这个契约, 但是忽略它会是致命的. 在基于组件的编程中, 组件保证它提供的接口是<em>不变的</em> - 不同版本的组件都要提供同样的访问方法 - 这就与使用它的客户程序达成了一种契约. 从这种角度来说, 基于组件的编程通常也称为<em>按照契约编程</em>.</p>
-</div>
-
-<h4 id=".E6.8E.A5.E5.8F.A3.E4.B8.8E.E5.B0.81.E8.A3.85" name=".E6.8E.A5.E5.8F.A3.E4.B8.8E.E5.B0.81.E8.A3.85">接口与封装</h4>
-
-<p>组件边界之间的抽象对软件的可维护性与可重用性是致关重要的. 举个例子来说, 考虑下面一个没有很好封装的类. 在下面的例子中, 使用可自由访问的 public 的初始化方法可能会出问题.</p>
-
-<p><span id="SomeClass%E7%B1%BB%E5%88%9D%E5%A7%8B%E5%8C%96"><a id="SomeClass%E7%B1%BB%E5%88%9D%E5%A7%8B%E5%8C%96"></a><strong>SomeClass类初始化</strong></span></p>
-
-<pre>class SomeClass
-{
- public:
- // Constructor
- SomeClass();
-
- // Virtual Destructor
- virtual ~SomeClass();
-
- // init method
- void Init();
-
- void DoSomethingUseful();
-};
-</pre>
-
-<p>系统要工作正常, 客户程序员必须注意到组件程序员建立的潜规则. 这就是这个未很好封装的类的契约: 这是一套关于何时该调用一个方法, 调用这个方法之前应该做什么的规则. 这个规则可能指出 <code>DoSomethingUseful</code> 方法只能在调用 <code>Init()</code> 之后被使用. <code>DoSomethingUseful</code> 方法可能会做某些检查工作以保证条件满足 - <code>Init</code> 已经被调用.</p>
-
-<p>除了在代码中给出注释告诉客户程序员关于 <code>Init()</code> 规则之外, 程序员可以使他的契约更明晰. 首先对象的构造函数可以封装起来, 然后向客户程序员提供一个声明 <code>DoSomethingUseful</code> 方法的<em>虚基类</em>. 通过这种方式, 构造函数和初始化函数被隐藏起来. 在这种<em>半封装</em>条件下, 这个类只向客户程序暴露一些良好定义的可调用方法(或者称为接口). 一旦按照这种方式封装一个类, 客户程序只能看到的是下面的接口:</p>
-
-<p><span id="SomeInterface%E5%B0%81%E8%A3%85"><a id="SomeInterface%E5%B0%81%E8%A3%85"></a><strong>SomeInterface封装</strong></span></p>
-
-<pre>class SomeInterface
-{
- public:
- virtual void DoSomethingUseful() = 0;
-};
-</pre>
-
-<p>实现类就可以从这个虚基类派生, 实现接口的功能. 客户程序使用类厂(factory pattern)模式来创建对象(参看<a href="#类厂">类厂</a>), 而封装类的内部实现. XPCOM 以这种方式把客户程序屏蔽在组件的内部工作之外, 而客户程序也只依赖于提供所需要功能的接口.</p>
-
-<h4 id="nsISupports_.E5.9F.BA.E6.8E.A5.E5.8F.A3" name="nsISupports_.E5.9F.BA.E6.8E.A5.E5.8F.A3"><code>nsISupports</code> 基接口</h4>
-
-<p>组件与基于接口的编程的两个最基本的问题是: 一个是<em>组件生存期</em>, 也称为<em>对象所属关系</em>; 另一个是<em>接口查询</em>, 它是在运行时刻确定接口能够提供哪些接口. 这一节介绍基接口 <code>nsISupports</code> - 它是 XPCOM 中所有接口的父接口, 它提供了上面两个问题的解决方案.</p>
-
-<h5 id=".E5.AF.B9.E8.B1.A1.E6.89.80.E5.B1.9E.E5.85.B3.E7.B3.BB" name=".E5.AF.B9.E8.B1.A1.E6.89.80.E5.B1.9E.E5.85.B3.E7.B3.BB">对象所属关系</h5>
-
-<p>在 XPCOM 中, 由于组件可以实现任意多的不同接口, 接口必须是<em>引用计数的</em>. 组件在内部跟踪客户程序对它的接口引用了多少次, 当接口计数为零的时候组件就会卸载它自己.</p>
-
-<p>当一个组件创建后, 组件内部有一个整数在跟踪这个引用计数值. 客户程序实例化组件就会自动对这个引用计数加一; 在组件的整个生存期内, 引用计数或加或减, 总是大于零的. 如果在某个时刻, 所有的客户程序对该组件都失去了兴趣, 引用计数减到零, 组件就会卸载自己.</p>
-
-<p>客户程序使用相关接口是一个非常直接的过程. XPCOM 有一些工具让我们更方便的使用接口, 我们会在后面讲述. 如果客户程序在使用接口的时候忘记对接口的引用计数进行相关操作, 就会对组件的维护工作带来某些问题. 此时, 由于组件的引用计数始终不为零, 它就永远不会释放, 从而导致内存泄漏. 引用计数系统就象 XPCOM 的许多其他事物一样, 是客户与组件之间的契约. 如果遵守这些契约, 就会工作得很正常, 反之不然. 由创建接口指针的函数负责对初始化的接口引用加1, 这个引用也称为<em>所属引用</em>.</p>
-
-<div class="side-note">
-<p><span id="XPCOM%E4%B8%AD%E7%9A%84%E6%8C%87%E9%92%88"><a id="XPCOM%E4%B8%AD%E7%9A%84%E6%8C%87%E9%92%88"></a><strong>XPCOM中的指针</strong></span></p>
-
-<p>XPCOM 中的<em>指针</em>术语指的是接口指针. 它与常规指针相比有细微的差别, 毕竟它们都指向的是某个内存区域. 但是 XPCOM 指针指向的都是从 nsISupports 基接口派生而来的接口实现, 这个基接口包括三个基本的方法: <code>AddRef</code>, <code>Release</code>, 和 <code>QueryInterface</code>.</p>
-</div>
-
-<p><code>nsISupports</code> 接口提供了对接口查询与引用计数基本的支持. 这个接口的成员方法包括: <code>QueryInterface</code>, <code>AddRef</code>, 和 <code>Release</code>. 这些方法提供了从一个对象获取正确接口的基本方法, 加引用计数, 释放不再使用的对象. <code>nsISupports</code> 接口的声明如下:</p>
-
-<p><span id="%3Ccode%3EnsISupports%3C/code%3E_%E6%8E%A5%E5%8F%A3"><a id="%3Ccode%3EnsISupports%3C/code%3E_%E6%8E%A5%E5%8F%A3"></a><strong><code>nsISupports</code> 接口</strong></span></p>
-
-<pre>class Sample: public nsISupports
-{
- private:
- nsrefcnt mRefCnt;
- public:
- Sample();
- virtual ~Sample();
-
- NS_IMETHOD QueryInterface(const nsIID &amp;aIID, void **aResult);
- NS_IMETHOD_(nsrefcnt) AddRef(void);
- NS_IMETHOD_(nsrefcnt) Release(void);
-};
-</pre>
-
-<p>接口中使用的各种数据类型见<a href="#XPCOM_类型">XPCOM 类型</a>一节. <code>nsISupports</code> 接口的实现代码如下:</p>
-
-<p><span id="%3Ccode%3EnsISupports%3C/code%3E_%E6%8E%A5%E5%8F%A3%E5%AE%9E%E7%8E%B0"><a id="%3Ccode%3EnsISupports%3C/code%3E_%E6%8E%A5%E5%8F%A3%E5%AE%9E%E7%8E%B0"></a><strong><code>nsISupports</code> 接口实现</strong></span></p>
-
-<pre>Sample::Sample()
-{
- // initialize the reference count to 0
- mRefCnt = 0;
-}
-Sample::~Sample()
-{
-}
-
-// typical, generic implementation of QI
-NS_IMETHODIMP Sample::QueryInterface(const nsIID &amp;aIID,
- void **aResult)
-{
- if (aResult == NULL) {
- return NS_ERROR_NULL_POINTER;
- }
- *aResult = NULL;
- if (aIID.Equals(kISupportsIID)) {
- *aResult = (void *) this;
- }
- if (*aResult == NULL) {
- return NS_ERROR_NO_INTERFACE;
- }
- // add a reference
- AddRef();
- return NS_OK;
-}
-
-NS_IMETHODIMP_(nsrefcnt) Sample::AddRef()
-{
- return ++mRefCnt;
-}
-
-NS_IMETHODIMP_(nsrefcnt) Sample::Release()
-{
- if (--mRefCnt == 0) {
- delete this;
- return 0;
- }
- // optional: return the reference count
- return mRefCnt;
-}
-</pre>
-
-<h5 id=".E5.AF.B9.E8.B1.A1.E6.8E.A5.E5.8F.A3.E7.9A.84.E5.8F.91.E7.8E.B0" name=".E5.AF.B9.E8.B1.A1.E6.8E.A5.E5.8F.A3.E7.9A.84.E5.8F.91.E7.8E.B0">对象接口的发现</h5>
-
-<p><em>继承</em>是面向对象编程中另一个非常重要的话题. 继承是通过一个类派生另一个类的方法. 当一个类继承另一个类, 继承类可以<em>重载</em>基类的缺省动作, 而不需要拷贝基类的代码, 从而创建更加专有的类. 如下所示:</p>
-
-<p><span id="%E7%AE%80%E5%8D%95%E7%B1%BB%E7%BB%A7%E6%89%BF"><a id="%E7%AE%80%E5%8D%95%E7%B1%BB%E7%BB%A7%E6%89%BF"></a><strong>简单类继承</strong></span></p>
-
-<pre>class Shape
-{
- private:
- int m_x;
- int m_y;
-
- public:
- virtual void Draw() = 0;
- Shape();
- virtual ~Shape();
-};
-
-class Circle : public Shape
-{
- private:
- int m_radius;
- public:
- virtual Draw();
- Circle(int x, int y, int radius);
- virtual ~Circle();
-};
-</pre>
-
-<p><code>Circle</code> 从 <code>Shape</code> 类派生. <code>Circle</code> 本身也是一个 <code>Shape</code>, 但是 <code>Shape</code> 并不一定是 <code>Circle</code>. 在这种情况下, <code>Shape</code> 是<em>基类</em>, <code>Circle</code> 是 <code>Shape</code> 的子类.</p>
-
-<p>在 XPCOM 中, 所有的类都派生自 <code>nsISupports</code> 接口, 这样所有的对象都提供 <code>nsISupports</code>接口, 但是这些对象是更专有的类, 在运行时刻必须能找到它. 比如说在<a href="#简单类继承">简单类继承</a>例子中, 如果对象是一个 <code>Circle</code>, 你就可以调用 <code>Shape</code> 类的方法. 就是为什么在 XPCOM 中, 所有的对象都派生自 <code>nsISupports</code> 接口: 它允许客户程序根据需要发现和访问不同的接口.</p>
-
-<p>在 C++ 中, 我们可以使用 <code>dynamic_cast&lt;&gt;</code> 来把一个 <code>Shape</code> 对象的指针强制转化成一个 <code>Circle</code> 指针, 如果不能转化就抛出异常. 但是在 XPCOM 中, 由于性能开销和平台兼容性问题, 采用 RTTI (运行时刻类型信息) 的方法是不行的.</p>
-
-<div class="side-note">
-<p><span id="XPCOM_%E4%B8%AD%E7%9A%84%E5%BC%82%E5%B8%B8"><a id="XPCOM_%E4%B8%AD%E7%9A%84%E5%BC%82%E5%B8%B8"></a><strong>XPCOM 中的异常</strong></span></p>
-
-<p>XPCOM 并不直接支持 C++ 的异常处理. 在 XPCOM 中, 所有的异常必须在组件内部处理, 而不能跨越接口的边界. 然后接口方法返回一个 <code>nsresult</code> 错误值(这些错误码请参考 <a href="/cn/XPCOM_API_Reference" title="cn/XPCOM_API_Reference">XPCOM API Reference</a>). 客户程序根据这些错误码进行"异常"处理.</p>
-</div>
-
-<p>XPCOM 没有采用 C++ RTTI 机制来实现对象指针的动态转化, 它使用 <code>QueryInterface</code> 方法来把一个对象指针 cast 成正确的接口指针.</p>
-
-<p>每个接口使用称为 "uuidgen" 的工具来生成专有ID. 这个 ID 是一个全局唯一的 128-bit 值. 在接口的语境中, 这个 ID 又称为 <em>IID</em>. (组件语境中, 这个 ID 代表的是一个契约)</p>
-
-<p>当客户程序想查询一个对象是否支持某个接口, 它把接口的 IID 值传递给这个对象的 <code>QueryInterface</code> 方法. 如果对象支持这个接口, 它就会对自己的引用计数加1, 然后返回指向那个专有接口的指针. 反之, 如果不支持这个接口, 它会返回一个错误码.</p>
-
-<pre>class nsISupports {
- public:
- long QueryInterface(const nsIID &amp; uuid,
- void **result) = 0;
- long AddRef(void) = 0;
- long Release(void) = 0;
-};
-</pre>
-
-<p><code>QueryInterface</code> 的第一个参数是一个 <code>nsIID</code> 类型的引用, 它封装了 IID. <code>nsIID</code> 类有三种方法: <code>Equals</code>, <code>Parse</code>, 和 <code>ToString</code>. <code>Equals</code> 在接口查询中是最重要的, 它用来比较两个 <code>nsIID</code> 对象是否相同.</p>
-
-<p>在客户以 IID 调用 <code>nsISupports</code> 接口的 <code>QueryInterface</code> 方法时, 我们必须保证返回一个有效的 result 参数(在<a href="/cn/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier" title="cn/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier">Using XPCOM Utilities to Make Things Easier</a> 一章中, 我们将看到怎样更方便的实现一个 <code>nsIID</code> 类). <code>QueryInterface</code> 方法应该支持该组件所有接口的查询.</p>
-
-<p>在 <code>QueryInterface</code> 方法的实现中, IID 参数与组件支持 <code>nsIID</code> 类进行比较. 如果匹配, 对象的 <code>this</code> 指针转化为 <code>void</code> 指针, 引用计数加1, 把 <code>void</code> 指针返回给客户程序.</p>
-
-<p>在上面的例子中, 仅仅使用 C 方式的类型转化就足够了. 但是在把 <code>void</code> 指针 cast 成接口指针的时候, 还有更多的问题, 因为返回的接口指针必须与 vtable (virtual table) 相对应. 当出现菱形多重继承的时候, 可能这种接口转化就会有问题.</p>
-
-<h3 id="XPCOM_.E7.9A.84ID" name="XPCOM_.E7.9A.84ID">XPCOM 的ID</h3>
-
-<p>除了上一节中的接口 IID, XPCOM 还使用两种 ID 来区分类与组件.</p>
-
-<div class="side-note">
-<p><span id="XPCOM_ID%E7%B1%BB"><a id="XPCOM_ID%E7%B1%BB"></a><strong>XPCOM ID类</strong></span></p>
-
-<p><code>nsIID</code> 类实际上是一种 <code>nsID</code> 类. 其他的 <code>nsID</code>, CID 和 IID, 分别指的是一个实体类和一个专有的接口.</p>
-
-<p><code>nsID</code> 类提供 <code>Equals</code> 类似的方法, 来比较 ID. 请参考 <a href="/cn/Creating_XPCOM_Components/Creating_the_Component_Code#Identifiers_in_XPCOM" title="cn/Creating_XPCOM_Components/Creating_the_Component_Code#Identifiers_in_XPCOM">Identifiers in XPCOM</a> 一节, 其中对 <code>nsID</code> 类有更多的讨论.</p>
-</div>
-
-<h4 id="CID" name="CID">CID</h4>
-
-<p>CID 是一个唯一的 128-bit 值, 类似于 IID, 它用于全局标识唯一的类或者组件. <code>nsISupports</code> 的 CID 就象:</p>
-
-<p><code>00000000-0000-0000-c000-000000000046</code></p>
-
-<p>由于 CID 比较长, 通常我们都使用#define来定义它:</p>
-
-<pre>#define SAMPLE_CID \
-{ 0x777f7150, 0x4a2b, 0x4301, \
-{ 0xad, 0x10, 0x5e, 0xab, 0x25, 0xb3, 0x22, 0xaa}}
-</pre>
-
-<p>我们将会看到许多 <code>NS_DEFINE_CID</code> 的定义. 下面的宏用 CID 定义了一个静态变量:</p>
-
-<pre>static NS_DEFINE_CID(kWebShellCID, NS_WEB_SHELL_CID);
-</pre>
-
-<p>CID 有时也称为<em>类 ID</em>. 如果一个类实现了多个接口, 当CID 在该类发布后, 就与该类的 IID 一起被冻结了.</p>
-
-<h4 id=".E5.A5.91.E7.BA.A6_ID" name=".E5.A5.91.E7.BA.A6_ID">契约 ID</h4>
-
-<p>契约 ID 是一个用于访问组件的可读(to humen)的字符串. 一个 CID 或者一个契约 ID 可以用于从一个组件管理器获取组件. 下面是一个用于 LDAP 操作组件的契约 ID:</p>
-
-<pre>"@mozilla.org/network/ldap-operation;1"
-</pre>
-
-<p>契约 ID 的格式是: 用斜杠分开的组件的<em>域</em>, <em>模块</em>, <em>组件名</em>, <em>版本号</em>.</p>
-
-<p>与 CID 类似, 契约 ID 指的是组件实现而不是接口. 但是契约 ID 并不像CID那样,被限定为某个专有实现, 它更通用. 一个契约 ID 只是指明需要实现的一组接口,可以通过任意数量的CID满足这个需要. 契约 ID 与 CID 的这种不同, 使得组件重写成为可能.</p>
-
-<h3 id=".E7.B1.BB.E5.8E.82" name=".E7.B1.BB.E5.8E.82">类厂</h3>
-
-<p>把代码划分成组件, 客户代码通常使用 <code>new</code> 操作符来构造实例对象:</p>
-
-<pre>SomeClass* component = new SomeClass();
-</pre>
-
-<p>这种模式或多或少地需要客户对组件有一定的了解,至少要知道组件的大小. <em>类厂设计模式</em>此时可以用来封装对象的构造过程. 类厂模式的目的是在不暴露对象的实现和初始化的前提下创建对象. 在 <code>SomeClass</code> 例子中, 可以按照类厂模式把 <code>SomeClass</code> 对象的构造和初始化封装在 <code>New_SomeInterface</code> 函数中:</p>
-
-<p><span id="%E5%B0%81%E8%A3%85%E6%9E%84%E9%80%A0%E5%87%BD%E6%95%B0"><a id="%E5%B0%81%E8%A3%85%E6%9E%84%E9%80%A0%E5%87%BD%E6%95%B0"></a><strong>封装构造函数</strong></span></p>
-
-<pre>int New_SomeInterface(SomeInterface** ret)
-{
- // create the object
- SomeClass* out = new SomeClass();
- if (!out) return -1;
-
- // init the object
- if (out-&gt;Init() == FALSE)
- {
- delete out;
- return -1;
- }
-
- // cast to the interface
- *ret = static_cast&lt;SomeInterface*&gt;(out);
- return 0;
-}
-</pre>
-
-<p>类厂本身是一个管理组件实例化的类. 在 XPCOM 中, 类厂要实现 <code>nsIFactory</code> 接口, 它们就象上面的代码一样要使用类厂设计模式来封装对象的构造和初始化.</p>
-
-<p><a href="#封装构造函数">封装构造函数</a> 的例子是一个简单的无状态的类厂版本, 实际的编程要复杂一些, 一般的类厂都需要保存状态. 类厂至少应该保存那些对象已经被创建了的信息. 如果类厂管理的实例被存放在一个动态联接库中, 还需要知道什么时候可以卸载这个动态联接库. 当类厂保存了这样的信息, 就可以向类厂查询一个对象是否已经被创建.</p>
-
-<p>另一个需要保存的信息是关于<em>单件(singleton)</em>. 如果一个类厂已经创建了一个单件类型的类, 后续的创建该单件的函数调用将返回已经创建的对象. 尽管有更好的工具和方式来管理单件(在讨论 <code>nsIServiceManager</code> 会看到), 开发人员可能仍然需要通过这种方式来保证只有一个单件对象被创建.</p>
-
-<p>厂模式可以完全利用函数来做, 状态可以保存在全局变量中; 但是使用类的方式来实现厂模式还有更多的好处. 其一是: 我们可以管理从 <code>nsISupports</code> 接口派生而来的类厂本身的生存期. 当我们试图把多个类厂划分成一组, 然后确定是否能卸载这一组类厂的时候, 这一点非常重要. 另一个好处是: 类厂可以引入其他需要支持的接口. 在我们后面讨论 <code>nsIClassInfo</code> 接口的时候, 我们会看到某些类厂使用这个接口支持信息查询, 诸如这个对象是用什么语言写的, 对象支持的接口等等. 这种派生自 <code>nsISupports</code> 的 "future-proofing" 特性非常关键.</p>
-
-<h4 id="XPIDL_.E4.B8.8E.E7.B1.BB.E5.9E.8B.E5.BA.93" name="XPIDL_.E4.B8.8E.E7.B1.BB.E5.9E.8B.E5.BA.93">XPIDL 与类型库</h4>
-
-<p>定义接口的简单而强劲的方法是使用<em>接口定义语言</em>(IDL) - 这实际上是在一个跨平台而语言无关开发环境下定义接口的需求. XPCOM 使用的是源自于 CORBA OMG 接口定义语言(IDL)的变体, 称为 XPIDL, 来定义接口, XPIDL 可以定义接口的方法, 属性, 常量, 以及接口继承.</p>
-
-<p>采用 XPIDL 定义接口还存在一些缺陷. 它不支持多继承, 同时 XPIDL 定义的方法名不能相同,你不能有两个相同名字但是所接受的参数不同的函数. - 不能像 C++ 语言的成员函数一样通过参数不同重载, 毕竟接口同时要支持类似于 C 这样的语言.</p>
-
-<pre>void FooWithInt(in int x);
-void FooWithString(in string x);
-void FooWithURI(in nsIURI x);
-</pre>
-
-<p>然而尽管有这些问题, XPIDL 的功能仍然是非常强大的. XPIDL 能自动生成以 <em>.xpt</em> 为后缀的<em>类型库</em>, 或者说 typelibs. 类型库是接口的二进制表示, 它向非 C++ 语言提供接口的访问与控制. 非 C++ 语言通过类型库来了解接口支持哪些方法, 如何调用这些方法, 这称为 <em>XPConnect</em>. XPConnect 是 XPCOM 向类似于 JavaScript 这样的语言提供组件访问的 Wrapper. 参看<a href="/cn/Creating_XPCOM_Components/Using_XPCOM_Components#Connecting_to_Components_from_the_Interface" title="cn/Creating_XPCOM_Components/Using_XPCOM_Components#Connecting_to_Components_from_the_Interface">Connecting to Components from the Interface</a>获取更多关于 XPConnect 的信息.</p>
-
-<p>从其他类型的语言访问接口, 常常说成是接口被<em>反射(reflected)</em>到这种语言. 每一个被反射的接口必须提供相应的类型库. 当前可以使用 C, C++, 和 JavaScript 来编写组件.</p>
-
-<div class="side-note">
-<p><span id="%E4%BD%BF%E7%94%A8%E5%85%B6%E4%BB%96%E8%AF%AD%E8%A8%80%E7%BC%96%E5%86%99%E7%BB%84%E4%BB%B6"><a id="%E4%BD%BF%E7%94%A8%E5%85%B6%E4%BB%96%E8%AF%AD%E8%A8%80%E7%BC%96%E5%86%99%E7%BB%84%E4%BB%B6"></a><strong>使用其他语言编写组件</strong></span></p>
-
-<p>在使用其他语言创建组件的时候, 不需要利用 XPCOM 提供给 C++ 程序员的工具(诸如一些宏, 智能指针等等, 我们可以方便的利用到这种语言本身来创建组件. 比如说, 基于 Python 的 XPCOM 组件可以从 JavaScript 来调用.</p>
-
-<p>参看 <a href="/cn/Creating_XPCOM_Components/Resources" title="cn/Creating_XPCOM_Components/Resources">Resources</a> 获取更多使用其他语言来创建组件的信息.</p>
-</div>
-
-<p>所有的 XPCOM 接口都用 XPIDL 语法来定义. <em>xpidl 编译器</em>会从这个 IDL 文件产生类型库和 C++ 头文件. 在<a href="/cn/Creating_XPCOM_Components/Starting_WebLock#Defining_the_WebLock_Interface_in_XPIDL" title="cn/Creating_XPCOM_Components/Starting_WebLock#Defining_the_WebLock_Interface_in_XPIDL">Defining the WebLock Interface in XPIDL</a> 一节详细描述了 XPIDL 语法.</p>
-
-<h3 id="XPCOM_.E6.9C.8D.E5.8A.A1" name="XPCOM_.E6.9C.8D.E5.8A.A1">XPCOM 服务</h3>
-
-<p>当客户需要某个组件提供的功能的时候, 通常都是<em>实例化</em>一个新的组件对象. 比如说, 客户程序需要某些处理文件, 这里每个组件就代表一个文件, 客户可能会同时处理多个这样的组件.</p>
-
-<p>但是在某些情况下对象表示的是一种<em>服务</em>, 这种服务只能有一个拷贝(尽管会有多个服务同时运行). 每次客户程序访问服务提供的功能时, 客户程序都是与同一个服务实例在打交道. 比如说, 一个用户查询公司的电话号码数据库, 数据库作为一个<em>对象</em>对用户来说都是同一的. 如若不然的话, 就需要维护两个数据库拷贝, 这种开销将非常大, 而且还存在数据内容不一致的问题. 单件设计模式就是提供系统中需要的这种单点访问功能.</p>
-
-<p>XPCOM 不仅提供了对组件的支持和管理服务, 它还包含了许多编写跨平台组件所需要的其他服务. 其中包括: 跨平台文件抽象, 向 XPCOM 开发人员提供同一而强大的文件访问功能. 目录服务, 提供应用和特定系统定位信息. 内存管理, 保证所有对象使用同样的内存分配器. 事件通知机制, 允许传递简单消息. 本教程将在后面展现如何使用这些服务, <a href="/cn/XPCOM_API_Reference" title="cn/XPCOM_API_Reference">XPCOM API Reference</a> 一节有完整的接口索引列表.</p>
-
-<h3 id="XPCOM_.E7.B1.BB.E5.9E.8B" name="XPCOM_.E7.B1.BB.E5.9E.8B">XPCOM 类型</h3>
-
-<p>XPCOM 声明了许多数据类型和简单宏, 这些东西将在我们后面的例子中看到. 大多数的宏都是简单的重定义, 下一节我们会描述一些最常用的数据类型.</p>
-
-<h4 id=".E6.96.B9.E6.B3.95.E7.B1.BB.E5.9E.8B" name=".E6.96.B9.E6.B3.95.E7.B1.BB.E5.9E.8B">方法类型</h4>
-
-<p>下面的类型用在 XPCOM 方法调用的参数和返回值定义中.</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>NS_IMETHOD</code></td>
- <td>声明方法返回值. XPCOM 的方法缺省的返回值声明.</td>
- </tr>
- <tr>
- <td><code>NS_IMETHODIMP</code></td>
- <td>方法实现返回值. XPCOM 方法函数返回的时候缺省采用这种类型的返回值.</td>
- </tr>
- <tr>
- <td><code>NS_IMETHODIMP_(type)</code></td>
- <td>特定类型的方法实现返回值. 诸如 <code>AddRef</code> 和 <code>Release</code> 的方法不返回缺省类型, 这种返回值的不一致虽然有点不舒服, 但是必需的.</td>
- </tr>
- <tr>
- <td><code>NS_IMPORT</code></td>
- <td>共享库内部使用的符号局部声明</td>
- </tr>
- <tr>
- <td><code>NS_EXPORT</code></td>
- <td>共享库导出的符号声明.</td>
- </tr>
- </tbody>
-</table>
-
-<h4 id=".E5.BC.95.E7.94.A8.E8.AE.A1.E6.95.B0" name=".E5.BC.95.E7.94.A8.E8.AE.A1.E6.95.B0">引用计数</h4>
-
-<p>下面的宏提供对引用计数的基本操作.</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>NS_ADDREF</code></td>
- <td>调用 <code>nsISupports</code> 对象的 <code>AddRef</code> 方法.</td>
- </tr>
- <tr>
- <td><code>NS_IF_ADDREF</code></td>
- <td>与上一个方法类似, 不同之处在于这个宏在<code>AddRef之前</code>会检查对象指针是否为空(虚函数指针).</td>
- </tr>
- <tr>
- <td><code>NS_RELEASE</code></td>
- <td>调用 <code>nsISupports</code> 对象的 <code>Release</code> 方法.</td>
- </tr>
- <tr>
- <td><code>NS_IF_RELEASE</code></td>
- <td>与上一个方法类似, 不同之处在于这个宏<code>在调用Release</code>之前会检查空指针.</td>
- </tr>
- </tbody>
-</table>
-
-<h3 id=".E7.8A.B6.E6.80.81.E7.A0.81" name=".E7.8A.B6.E6.80.81.E7.A0.81">状态码</h3>
-
-<p>下面的宏测试状态码.</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>NS_FAILED</code></td>
- <td>如果传递的状态码为失败, 则返回真.</td>
- </tr>
- <tr>
- <td><code>NS_SUCCEEDED</code></td>
- <td>如果传递的状态码为成功, 则返回真.</td>
- </tr>
- </tbody>
-</table>
-
-<h3 id=".E5.8F.98.E9.87.8F.E6.98.A0.E5.B0.84" name=".E5.8F.98.E9.87.8F.E6.98.A0.E5.B0.84">变量映射</h3>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>nsrefcnt</code></td>
- <td>缺省的引用计数类型, 是一个 32-bit 整数.</td>
- </tr>
- <tr>
- <td><code>nsresult</code></td>
- <td>缺省数据类型, 是一个 32-bit 整数.</td>
- </tr>
- <tr>
- <td><code>nsnull</code></td>
- <td>缺省 null 类型.</td>
- </tr>
- </tbody>
-</table>
-
-<h3 id=".E9.80.9A.E7.94.A8_XPCOM_.E9.94.99.E8.AF.AF.E7.A0.81" name=".E9.80.9A.E7.94.A8_XPCOM_.E9.94.99.E8.AF.AF.E7.A0.81">通用 XPCOM 错误码</h3>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>NS_ERROR_NOT_INITIALIZED</code></td>
- <td>如果实例未初试化, 返回该值.</td>
- </tr>
- <tr>
- <td><code>NS_ERROR_ALREADY_INITIALIZED</code></td>
- <td>如果实例已初试化, 返回该值.</td>
- </tr>
- <tr>
- <td><code>NS_ERROR_NOT_IMPLEMENTED</code></td>
- <td>如果方法未实现, 返回该值.</td>
- </tr>
- <tr>
- <td><code>NS_ERROR_NO_INTERFACE</code></td>
- <td>如果组件不支持某种类型接口, 返回该值.</td>
- </tr>
- <tr>
- <td><code>NS_ERROR_NULL_POINTER</code></td>
- <td>如果指针指向 <code>nsnull</code>, 返回该值 .</td>
- </tr>
- <tr>
- <td><code>NS_ERROR_FAILURE</code></td>
- <td>如果某个方法失效, 返回该值, 这时一个通用的错误值.</td>
- </tr>
- <tr>
- <td><code>NS_ERROR_UNEXPECTED</code></td>
- <td>如果一个未预料的错误发生, 返回该值.</td>
- </tr>
- <tr>
- <td><code>NS_ERROR_OUT_OF_MEMORY</code></td>
- <td>如果无法进行内存分配, 返回该值.</td>
- </tr>
- <tr>
- <td><code>NS_ERROR_FACTORY_NOT_REGISTERED</code></td>
- <td>如果一个请求的类型未注册, 返回该值.</td>
- </tr>
- </tbody>
-</table>
-
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/创建_XPCOM_组件:前言" style="float: left;">« 上一页</a><a href="/zh-CN/docs/创建_XPCOM_组件:使用_XPCOM_组件">下一页 »</a></p>
-</div> <p></p><div class="licenseblock">
-<p>Copyright (c) 2003 by Doug Turner and Ian Oeschger. This material may be distributed only subject to the terms and conditions set forth in the <a class="external" href="http://www.opencontent.org/openpub/" rel="noopener">Open Publication License</a>, v1.02 or later. Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. Distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder.</p>
-</div><p></p>
-
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/building_the_weblock_ui/index.html b/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/building_the_weblock_ui/index.html
deleted file mode 100644
index 51f544fb16..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/building_the_weblock_ui/index.html
+++ /dev/null
@@ -1,297 +0,0 @@
----
-title: Building the WebLock UI
-slug: Mozilla/Tech/XPCOM/Guide/Creating_components/Building_the_WebLock_UI
-tags:
- - XPCOM
- - 所有分类
-translation_of: Mozilla/Tech/XPCOM/Guide/Creating_components/Building_the_WebLock_UI
----
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/Creating_XPCOM_Components:Finishing_the_Component" style="float: left;">« 上一页</a><a href="/zh-CN/docs/Creating_XPCOM_Components:Packaging_WebLock">下一页 »</a></p>
-</div><p></p>
-
-<p>到目前为止我们建立了一个可以安装到Gecko应用中的组件。你所使用的XPCOM接口和工具是通用的跨平台的,可以被Gecko Runtime Environment或者任何Mozilla1.2以后任何基于Gecko的应用(这时GRE已经可用)。</p>
-
-<p>本章,我们将建立<strong>WebLock</strong>组件的用户接口,这就意味着添加到<em>现有的</em> Mozilla 浏览器<sup><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/Building_the_WebLock_UI#endnote_other-mozlike-browsers">[other-mozlike-browsers]</a></sup>. 他使用 <abbr title="XML UI Language">XUL</abbr>, 这是一个Gecko知道如何呈现用户界面的XML语言, 同时它也跟特定的Mozilla用户界面交互, 为此它要把自己作为UI的扩展安装起来. Specifically, the user interface we create in this chapter will be<em>overlaid</em> into the statusbar of the browser component, where it will provide a small icon the user can click to access the web lock interface.</p>
-
-<p><span id="WebLock_Indicator_in_Browser"><a id="WebLock_Indicator_in_Browser"></a><strong>WebLock Indicator in Browser</strong></span></p>
-
-<p><img alt="Image:web-lock-ui.png"></p>
-
-<h3 id="User_Interface_Package_List" name="User_Interface_Package_List">User Interface Package List</h3>
-
-<p>本章所描述的用户界面包括4个文件:</p>
-
-<ul>
- <li><code>webLockOverlay.xul</code> is the file that defines the little status icon in the browser.</li>
- <li><code>weblock.xul</code> defines the web lock manager dialog.</li>
- <li><code>weblock.css</code> provides style rules for both of the XUL files.</li>
- <li><code>weblock.js</code> provides JavaScript functions for both of the XUL files.</li>
-</ul>
-
-<p>下面章节描述每个文件的功能。. In the following chapter we'll describe how you can take these files and create a<em>package</em> , an installable archive that includes the <strong>WebLock</strong> component and the new UI.</p>
-
-<p>因为这些步骤 (特别是 overlay section) 与Mozilla非常相关, the chapter is divided up into a couple of different sections. 第二部分, <a href="#XUL">XUL</a>, 描述XML-based 用户接口语言 (XUL) 以及他如何创建一个对话框访问<strong>WebLock</strong> 组件和它的服务. 第三部分, <a href="#Overlaying_New_User_Interface_Into_Mozilla">Overlaying New User Interface Into Mozilla</a>, 描述如何建立一个overlay到浏览器以便Mozilla build能访问这个对话框. 在overlay section, 我们讨论如何从Mozilla导入scripts, images, 和其他资源到你的 UI, 这会是比较复杂的部分.</p>
-
-<p>If the <strong>WebLock</strong> component is being installed in Mozilla or another Gecko-based browser, then this third section shows you how to create the entry point in the browser for controlling the web locking. If you are planning on deploying the <strong>WebLock</strong> component in some other application, you'll have to devise a different means of access (e.g., native widgetry that instantiates and controls the <strong>WebLock</strong> component).</p>
-
-<h3 id="Client_Code_Overview" name="Client_Code_Overview">Client Code Overview</h3>
-
-<p>在我们开始实际用户界面以前,我们应该首先建立访问<strong>WebLock</strong>组件和它的接口来控制browser的Web locking的客户代码.</p>
-
-<p>首先, it's important to be able to 表达Lock的基本状态as soon as it's loaded. 如同安全网页icon, weblock icon 在browser右下角,提示browser是否当前是锁定的. Since the <strong>WebLock</strong> component is always initialized as unlocked, we can have the 客户代码 - 接口中的JavaScript代码 - 表达并跟踪状态 as the user manipulates the <code>iWebLock</code> interface. A boolean <code>wLocked</code> variable can do this:</p>
-
-<pre>// initialize the wLocked variable as unlocked
-var wLocked = 0;
-</pre>
-
-<p>Then the functions that get called from the interface and call through to the <code>lock</code> and <code>unlock</code> methods of the <strong>WebLock</strong> component must also adjust this variable accordingly:</p>
-
-<pre>function wLock()
-{
- // check to see if locking is on or off
- weblock.lock();
- wLocked = 1;
-}
-
-function wUnLock()
-{
- // check to see if locking is on or off
- weblock.unlock();
- wLocked = 0;
-}
-</pre>
-
-<p>这些函数的前提是<strong>WebLock</strong> 组件对于 JavaScript可见,in the form of the <code>weblock</code> object being used in the snippets above. As you can see, <code>weblock</code> is initialized as a global JavaScript variable, available in the scope of these functions and others:</p>
-
-<pre>var weblock = Components.classes["@dougt/weblock"]
- .getService()
- .QueryInterface(Components.interfaces.iWebLock);
-</pre>
-
-<p>In addition to this basic setup, you must also write JavaScript that uses the <code>AddSite</code> method to add new sites to the white list. This is a bit more complicated, because it requires that you work with the currently loaded page or provide other UI (e.g., a textfield where you can enter an arbitrary URL) for specifying URLs. In the <a href="#XUL">XUL</a> section we'll go into how the user interface is defined. This section describes the functions that are called from the interface and how they interact with the <strong>WebLock</strong> component.</p>
-
-<p>The URL that the <code>AddSite</code> method expects is a string, so we can pass a string directly in from the user interface, or we can do a check on the string and verify that it's a valid URL. In this tutorial, focusing as it is on the <strong>WebLock</strong> functionality (rather than the UI), we'll assume the strings we get from the UI itself are URLs we actually want to write to the white list:</p>
-
-<pre>function addThisSite()
-{
- var tf = document.getElementById("dialog.input");
- // weblock is global and declared above
- weblock.AddSite(tf.value);
-}
-</pre>
-
-<p>这段javascript可以直接被 XUL widget调用, where the input string is retrieved as the <code>value</code> property of the <code>textbox</code> element.</p>
-
-<p>你还需要建立一个函数当用户点击weblock icon的时候来显示<strong>WebLock</strong> 窗口. That function uses the <code>openDialog</code> method from the <code>window</code> object and takes the URL to the XUL file in which the dialog is defined:</p>
-
-<pre>function loadWebLock()
-{
- window.openDialog("chrome://weblock/weblock.xul");
-}
-</pre>
-
-<h3 id="XUL" name="XUL">XUL</h3>
-
-<p>The entire user interface of the Mozilla browser and all of the applications that go with it, including the mail client, the IRC client, and others, have been defined in an XML language called XUL. Elements in the XUL markup map to widgets in the interface that Gecko renders in a fairly straightforward way - so, for instance, the root element of an application window is the element <code>&lt;window/&gt;</code>, the root element of the dialog we'll be creating here is <code>&lt;dialog/&gt;</code>, and so forth. Within a XUL application file, elements like <code>&lt;button/&gt;</code>, <code>menu/&gt;</code>, and <code>checkbox/&gt;</code> can be hooked up to an event model, to scripts, and to the XPCOM interfaces that carry out a lot of the browser functionality in Mozilla.</p>
-
-<p>In <a href="cn/Creating_XPCOM_Components/Using_XPCOM_Components">Using XPCOM Components</a> you saw how XPCOM objects are reflected into the interface layer as JavaScript objects. In this chapter, now that we've created the <strong>WebLock</strong> component and made it available to XPCOM, we create the UI that actually instantiates the <strong>WebLock</strong> component and uses its methods to control page loading in the browser.</p>
-
-<p>In the previous section, we outlined the JavaScript that interacts with the <strong>WebLock</strong> component. In this section, we are going to create the XUL interface that calls the JavaScript methods when the user interacts with it.</p>
-
-<h4 id="The_XUL_Document" name="The_XUL_Document">The XUL Document</h4>
-
-<p>The first thing to do is create the actual XUL document in which the user interface for the dialog and the events that initiate interaction with the web locking are defined. At the top of all XUL documents, an XML declaration is followed by the root element for the document, which is usually <code>&lt;window/&gt;</code> 对于对话框,也可以是<code>&lt;dialog/&gt;</code>. The "shell" for the XUL file, then, looks like this:</p>
-
-<pre>&lt;?xml version="1.0"?&gt;
-&lt;?xml-stylesheet href="chrome://global/skin/" type="text/css"?&gt;
-
-&lt;dialog id="weblock_ui"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- title="Web Lock Manager"
- persist="screenX screenY"
- screenX="24" screenY="24"&gt;
-
-&lt;/dialog&gt;
-</pre>
-
-<p>注意这部分XUL文件也包含了stylesheet declaration, which imports CSS rules and applies them to particular parts of the interface. In Gecko, CSS 被用来几乎控制所有的XUL界面表现 - its color, position, style, and to some extent its behavior as well. The web lock manager dialog does not deviate from the look of a standard dialog, so it can use a single declaration to import the "global" skin from the browser and make it available to the widgets you define in <code>weblock.xul</code>.</p>
-
-<p>You can save this first, 最外层的web lock dialog部分称为<code>weblock.xul</code>, 你要把它放在附录B所描述的安装包里.</p>
-
-<div class="side-note">
-<p>注意这个文件包含了当用户/管理员点击web locking icon的时候弹出的对话框. 这部分UI - 需要动态地装载到Mozilla runtime - 在<a href="#Overlaying_New_User_Interface_Into_Mozilla">Overlaying New User Interface Into Mozilla</a>.</p>
-</div>
-
-<p>描述</p>
-
-<p>最终的对话框看起来是.</p>
-
-<p><span id="Web_Lock_Manager_Dialog"><a id="Web_Lock_Manager_Dialog"></a><strong>Web Lock Manager Dialog</strong></span></p>
-
-<p><img alt="Image:Weblock-sitelist-ui.png"></p>
-
-<p>As you can see, it's a simple interface, providing just enough widgetry to lock and unlock the browser and to add new sites to the list. The entire XUL file for the web lock manager dialog is defined in <a href="#weblock.xul">weblock.xul</a> below.</p>
-
-<h4 id="The_Locking_UI" name="The_Locking_UI">The Locking UI</h4>
-
-<p>Once you have the basic XUL wrapper set up for your interface, the next step is to define that part of the interface that locks and unlocks the browser. One of the most efficient ways to expose this is to use radio buttons, which allow the user to toggle a particulart state, as the figure above illustrates.</p>
-
-<p>In XUL individual <code>&lt;radio/&gt;</code> elements are contained within a parent element called <code>&lt;radiogroup/&gt;</code>. Grouping radio elements together creates the toggling UI by requiring that one or another of the elements be selected, but not both.</p>
-
-<p>The XUL that defines the radiogroup in the web lock manager dialog is this:</p>
-
-<pre>&lt;radiogroup&gt;
- &lt;radio label="lock"/&gt;
- &lt;radio label="unlock" selected="true"/&gt;
-&lt;/radiogroup&gt;
-</pre>
-
-<p>Since the <strong>WebLock</strong> component always starts up in the unlocked position, you can add the <code>selected="true"</code> attribute and value on the unlock radio button and reset it dynamically as the user takes action.</p>
-
-<h4 id="Site_Adding_UI" name="Site_Adding_UI">Site Adding UI</h4>
-
-<p>The next step is to create that part of the user interface that lets you add a new site to the white list. There are other, more sophisticated ways to do this; you may also want to include some UI that lets you view the white list or edit it as a list. In this part of the tutorial, however, we only provide the means of adding an URL provided as a string (which is not checked for validity) and passing it through to the <code>AddSite</code> API we defined in the earlier part of the tutorial.</p>
-
-<pre>&lt;separator class="thin"/&gt;
-
-&lt;hbox align="center"&gt;
- &lt;textbox id="url.input" flex="1"/&gt;
- &lt;button label="Add this URL" oncommand="addThisSite();"/&gt;
-&lt;/hbox&gt;
-</pre>
-
-<p>This snippet introduces a couple of new general layout widgets in XUL. The separator that appears at the top of this snippet creates a little divider between widgets like the kind you see in menus that divide sets of functionality available there. The parent of the textbox that users enter an URL into is something called an <code>&lt;hbox/&gt;</code>, which is a layout widget - often invisible - that controls the way its child elements are rendered. In this case the <code>&lt;hbox/&gt;</code> centers the textbox and the button children, and it orients them horizontally (in contrast to the <code>&lt;vbox/&gt;</code>, which orients its children vertically).</p>
-
-<p>Notice also that when it's clicked, the button executes a JavaScript function called <code>addThisSite()</code>, which we've already defined in the <code>weblock.js</code> file in <a href="#Client_Code_Overview">Client Code Overview</a> above.</p>
-
-<h4 id="weblock.xul" name="weblock.xul"><code>weblock.xul</code></h4>
-
-<pre>&lt;?xml version="1.0"?&gt;
-&lt;?xml-stylesheet href="chrome://global/skin/" type="text/css"?&gt;
-
-&lt;dialog id="weblock_mgg"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- title="Web Lock Manager"
- style="width: 30em;"
- persist="screenX screenY"
- screenX="24" screenY="24"&gt;
-
- &lt;script src="chrome://weblock/content/weblock.js"/&gt;
-
- &lt;hbox&gt;
- &lt;separator orient="vertical" class="thin"/&gt;
- &lt;vbox flex="1"&gt;
- &lt;separator class="thin"/&gt;
- &lt;hbox align="center"&gt;
- &lt;textbox id="dialog.input" flex="1"/&gt;
- &lt;button label="Add this URL"
- oncommand="addThisSite();"/&gt;
- &lt;/hbox&gt;
- &lt;hbox align="center"&gt;
- &lt;radiogroup onchange="toggleLock();"&gt;
- &lt;radio label="lock"/&gt;
- &lt;radio label="unlock"/&gt;
- &lt;/radiogroup&gt;
- &lt;spacer flex="1"/&gt;
- &lt;/hbox&gt;
- &lt;/vbox&gt;
- &lt;/hbox&gt;
-
-&lt;/dialog&gt;
-</pre>
-
-<h3 id="Overlaying_New_User_Interface_Into_Mozilla" name="Overlaying_New_User_Interface_Into_Mozilla">Overlaying New User Interface Into Mozilla</h3>
-
-<p>你已经有了一个可以跟<strong>WebLock</strong>组件交互的对话框, 但是你怎么把它装到browser中? 然后你怎么访问它呢? 当安装和准备好以后,<strong>WebLock</strong> 组件已经可以用了: XPCOM finds it and adds it to the list of registered components, and then WebLock observes the XPCOM startup event and initializes itself.</p>
-
-<p>But you still have to add your new UI into the browser so it can call the component, and the Mozilla overlay mechanism is the way to do this. Overlays 是 XUL文件可以用来注册他们自己以便动态地嵌入到Browser UI合适的位置.</p>
-
-<h4 id="webLockOverlay.xul" name="webLockOverlay.xul"><code>webLockOverlay.xul</code></h4>
-
-<p>The XUL that defines the new icon is small: 这是一个调用JavaScript function来装载前面我们定义的<code>weblock.xul</code> 文件的小图表. The icon is actually a separate <code>&lt;statusbarpanel/&gt;</code> element that gets overlaid into the main browser, along with some JavaScript and some CSS to control the behavior and appearance of the element, respectively. Here is that XUL file in its entirety:</p>
-
-<p><span id="The_WebLock_Overlay"><a id="The_WebLock_Overlay"></a><strong>The WebLock Overlay</strong></span></p>
-
-<pre>&lt;?xml version="1.0"?&gt;
-&lt;?xml-stylesheet href="chrome://navigator/content/weblock.css" type="text/css"?&gt;
-
-&lt;overlay id="weblockOverlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;
-
- &lt;script type="application/x-javascript"
- src="chrome://weblock/content/weblock.js"/&gt;
-
- &lt;statusbar id="status-bar"&gt;
- &lt;statusbarpanel class="statusbarpanel-iconic"
- id="weblock-status"
- insertbefore="offline-status"
- oncommand="loadWebLock();"
- status="none"/&gt;
- &lt;/statusbar&gt;
-
-&lt;/overlay&gt;
-</pre>
-
-<p>文件的根元素不是<code>&lt;window/&gt;</code> 而是<code>&lt;overlay/&gt;</code>. In overlays 被 XUL elements用来把他们和其他元素相区分的<code>id</code>属性被设置称为browser中他们要嵌入部分的值. In this case, the weblock <code>&lt;statusbarpanel/&gt;</code> appears as a child of the <code>&lt;statusbar/&gt;</code> element with <code>id</code> "status-bar". This <code>id</code> is the same one used by the <code>&lt;statusbar/&gt;</code> in <code>navigator.xul</code>, which means that the overlay mechanism will merge the new UI here (i.e., the weblock statusbarpanel) and the UI already defined within that browser <code>&lt;statusbar/&gt;</code> at runtime.</p>
-
-<h3 id="Other_Resources" name="Other_Resources">Other Resources</h3>
-
-<p>这部分描述剩下的需要添加和打包到<strong>WebLock</strong>组件来提供web locking用户界面的文件。</p>
-
-<div class="side-note">
-<p><span id="Other_Front_End_Resources"><a id="Other_Front_End_Resources"></a><strong>Other Front End Resources</strong></span></p>
-
-<p>在某些UI包中, 本地化 resources are also defined. These include DTDs in which the language in which the UI is labelled can be extracted into external files, which are swapped with DTDs for other languages. For example, user interface packages often include an English DTD that defines labels and strings for button and menus and other elements in the interface. When the user selects a different<em>language pack</em> , all of the English that's been externalized in these files is dynamically replaced with the new choice. In addition to DTDs, the localization parts of a user interface may also include string bundles in which strings that are used in the interface JavaScript can be similarly replaced. 有一些技术通过单独的文件来提供这种功能. 包含<em>bindings</em> in XML files,<em>metadata</em> in RDF files, whole collections of CSS files called<em>skins</em> , and others.</p>
-</div>
-
-<h4 id="weblock.css" name="weblock.css">weblock.css</h4>
-
-<p>The following style rules are defined in <code>weblock.css</code>, a CSS file that is loaded by the overlay and applied to the icon in the browser that reflects the current status of the web lock and provides access to the web lock manager dialog.</p>
-
-<pre>statusbarpanel#weblock-status
-{
- list-style-image: url("chrome://weblock/wlock.gif");
-}
-
-statusbarpanel#weblock-status[status="locked"]
-{
- list-style-image: url("chrome://weblock/wl-lock.gif");
-}
-
-statusbarpanel#weblock-status[status="unlocked"]
-{
- list-style-image: url("chrome://weblock/wl-un.gif");
-}
-</pre>
-
-<p>The style rules are distinguished by the state of the <code>status</code> attribute on the element in the XUL with the <code>id</code> "weblock-status." As you can see above, when the status of the element is set to "locked", the image <code>wl-lock.gif</code> is used to show the state, and when the web locking is unlocked, it uses <code>wl-un.gif</code>. (Note: We include three images to represent the state of the weblock, but <code>wlock.gif</code> and <code>wl-lock.gif</code> are identical, since weblock is presumed to be unlocked when it's loaded. This tutorial makes use of only two different states, but you can further customize the look of the weblock using the three images if you wish.)</p>
-
-<p>Since the presentation of the weblock manager dialog itself doesn't require any special styles, these are all the rules you need in the <code>weblock.css</code>. Note that the <code>weblock.xul</code> file in which the manager is defined imports only the global skin:</p>
-
-<pre>&lt;?xml-stylesheet href="chrome://global/skin/" type="text/css"?&gt;
-</pre>
-
-<p>Save <code>weblock.css</code> in your working directory.</p>
-
-<p>You should now have the four files listed at the top of this chapter as the "packing list" for the <strong>WebLock</strong> package (see <a href="#User_Interface_Package_List">User Interface Package List</a>). Don't worry for now about where these files are. 下一章, <a href="cn/Creating_XPCOM_Components/Packaging_WebLock">Packaging WebLock</a>, 我们讨论如何打包这些文件以便 <strong>WebLock</strong> 组件或者别的资源利用它们.</p>
-
-<h4 id="Image_Resources" name="Image_Resources">Image Resources</h4>
-
-<p>如果你学习本教程并且希望使用<strong>WebLock</strong>组件在statusbar中的图片,你可以从 <a class="external" href="http://www.brownhen.com/weblock下载他们和其他" rel="freelink">http://www.brownhen.com/weblock下载他们和其他</a><strong>weblock</strong>相关资源. The GIF files that represent the various states are:</p>
-
-<ul>
- <li><code>wlock.gif</code></li>
- <li><code>wl-lock.gif</code></li>
- <li><code>wl-un.gif</code></li>
-</ul>
-
-<ol>
- <li><div class="blockIndicator note"><strong>Note:</strong> other-mozlike-browsers</div> 或者你可能会很喜欢这些东西. 还有一些基于 Gecko的browsers ,例如Beonex 和 IBM Web Browser 也会共享很多Mozilla用户界面成分, 你也可能装载 <strong>WebLock</strong> 组件和用户界面到其中. 不过请注意, <strong>WebLock</strong>有可能还不能保证完全安装到Mozilla Firefox,因为firefox有一些新的变化 (这本书是2003的版本).</li>
-</ol>
-
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/Creating_XPCOM_Components:Finishing_the_Component" style="float: left;">« 上一页</a><a href="/zh-CN/docs/Creating_XPCOM_Components:Packaging_WebLock">下一页 »</a></p>
-</div> <p></p><div class="licenseblock">
-<p>Copyright (c) 2003 by Doug Turner and Ian Oeschger. This material may be distributed only subject to the terms and conditions set forth in the <a class="external" href="http://www.opencontent.org/openpub/" rel="noopener">Open Publication License</a>, v1.02 or later. Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. Distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder.</p>
-</div><p></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/component_internals/index.html b/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/component_internals/index.html
deleted file mode 100644
index d29da9a71d..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/component_internals/index.html
+++ /dev/null
@@ -1,217 +0,0 @@
----
-title: Component Internals
-slug: Mozilla/Tech/XPCOM/Guide/Creating_components/Component_Internals
-translation_of: Mozilla/Tech/XPCOM/Guide/Creating_components/Component_Internals
----
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/创建_XPCOM组件/使用XPCOM组件" style="float: left;">« 上一页</a><a href="/zh-CN/docs/Creating_XPCOM_Components/Creating_the_Component_Code">下一页 »</a></p>
-</div> 前几章以组件使用者的角度介绍了XPCOM 组件, 本章将以软件开发者的角度讨论XPCOM.您可以继续阅读以明白XPCOM的一般实现方式, 或者您也可以跳到下一章, 在下一章,以WebLock为例向一步一步您介绍 组件的开发过程。 <span class="comment">XXX mediawiki...</span><span class="comment">XXX sucks</span><p></p>
-
-<h3 id="Creating_Components_in_C.2B.2B" name="Creating_Components_in_C.2B.2B">使用C++创建组件</h3>
-
-<p>让我们开始研究怎样用c++创建XPCOM组件. 最常见的组件是以C++编写并编译成共享库(如Windows平台的DLL或者Unix平台的DSO)。</p>
-
-<p>The illustration below shows the basic relationship between the shared library containing the component implementation code you write and the XPCOM framework itself. In this diagram, the outer boundary is that of the module, the shared library in which a component is defined.</p>
-
-<p><span id="A_Component_in_the_XPCOM_Framework"><a id="A_Component_in_the_XPCOM_Framework"></a><strong>A Component in the XPCOM Framework</strong></span></p>
-
-<p><img alt="Image:component-internals-framework.png" class="internal" src="/@api/deki/files/615/=Component-internals-framework.png"></p>
-
-<p>When you build a component or module and compile it into a library, it must export a single method named <code>NSGetModule</code>. This <code>NSGetModule</code> function is the entry point for accessing the library. It gets called during registration and unregistration of the component, and when XPCOM wants to discover what interfaces or classes the module/library implements. In this chapter we will outline this entire process.</p>
-
-<p>As <a href="#A_Component_in_the_XPCOM_Framework">A Component in the XPCOM Framework</a> illustrates, in addition to the <code>NSGetModule</code> entry point, there are <code>nsIModule</code> and <code>nsIFactory</code> interfaces that control the actual creation of the component, and also the string and XPCOM glue parts, which we'll discuss in some detail in the next section (see <a href="/en/Creating_XPCOM_Components/Component_Internals#XPCOM_Glue" title="en/Creating_XPCOM_Components/Component_Internals#XPCOM_Glue">XPCOM Glue</a>). These latter supply ease-of-development utilities like smart pointers, generic modules support, and simple string implementations. The largest and possibly most complex part of a component is the code specific to the component itself.</p>
-
-<div class="side-note">
-<p><span id="But_Where_Are_the_Components?"><a id="But_Where_Are_the_Components?"></a><strong>But Where Are the Components?</strong></span></p>
-
-<p>Components reside in modules, and those modules are defined in shared library files that typically sit in the <em>components</em> directory of an XPCOM application.</p>
-
-<p>A set of default libraries stored in this components directory makes up a typical Gecko installation, providing functionality that consists of networking, layout, composition, a cross-platform user interface, and others.</p>
-
-<p>Another, even more basic view of this relationship of components to the files and interfaces that define them is shown in <a href="/en/Creating_XPCOM_Components/Creating_the_Component_Code" title="en/Creating_XPCOM_Components/Creating_the_Component_Code">Onion Peel View of XPCOM Component Creation</a> in the next chapter. The component is an abstraction sitting between the actual module in which it is implemented and the objects that its factory code creates for use by clients.</p>
-</div>
-
-<h3 id="XPCOM_Initialization" name="XPCOM_Initialization">XPCOM Initialization</h3>
-
-<p>To understand why and when your component library gets called, it is important to understand the XPCOM initalization process. When an application starts up, that application may <em>initialize</em> XPCOM. The sequence of events that kicks off this XPCOM initialization may be triggered by user action or by the application startup itself. A web browser that embeds Gecko, for example, may initialize XPCOM at startup through the embedding APIs. Another application may delay this startup until XPCOM is needed for the first time. In either case, the initialization sequence within XPCOM is the same.</p>
-
-<p>XPCOM starts when the application makes a call to initialize it. Parameters passed to this startup call allow you to configure some aspects of XPCOM, including the customization of location of specific directories. The main purpose of the API at this point is to change which <em>components</em> directory XPCOM searches when it looks for XPCOM components. This is how the API is used, for example, in the <em>Gecko Runtime Environment</em> (GRE).</p>
-
-<div class="side-note">
-<p><span id="XPCOM_Startup"><a id="XPCOM_Startup"></a><strong>XPCOM Startup</strong></span></p>
-
-<p>The six basic steps to XPCOM startup are as follows:</p>
-
-<ol>
- <li>Application starts XPCOM.</li>
- <li>XPCOM sends a notification that it's beginning startup.</li>
- <li>XPCOM finds and processes the <em>component manifest</em> (see <a href="#Component_Manifests">Component Manifests</a> below).</li>
- <li>XPCOM finds and processes the <em>type library manifest</em> (see <a href="#Type_Library_Manifests">Type Library Manifests</a> below).</li>
- <li>If there are new components, XPCOM registers them:
- <ol>
- <li>XPCOM calls autoregistration start.</li>
- <li>XPCOM registers new components.</li>
- <li>XPCOM calls autoregistration end.</li>
- </ol>
- </li>
- <li>Complete XPCOM startup: XPCOM notifies that it's begun.</li>
-</ol>
-
-<p>Component manifests and type library manifests are described in the following section, <a href="#XPCOM_Registry_Manifests">XPCOM Registry Manifests</a>.</p>
-</div>
-
-<h4 id="XPCOM_Registry_Manifests" name="XPCOM_Registry_Manifests">XPCOM Registry Manifests</h4>
-
-<p>XPCOM uses special files called manifests to track and persist information about the components to the local system. There are two types of manifests that XPCOM uses to track components:</p>
-
-<h5 id="Component_Manifests" name="Component_Manifests">Component Manifests</h5>
-
-<p>When XPCOM first starts up, it looks for the <em>component manifest</em>, which is a file that lists all registered components, and stores details on exactly what each component can do. XPCOM uses the component manifest to determine which components have been overridden. Starting with Mozilla 1.2, this file is named <code>compreg.dat</code> and exists in the <em>components</em> directory, but there are efforts to move it out of this location to a less application-centric (and thus more user-centric) location. Any Gecko-based application may choose to locate it elsewhere. XPCOM reads this file into an in-memory database.</p>
-
-<div class="side-note">
-<p><span id="Component_Manifests"><a id="Component_Manifests"></a><strong>Component Manifests</strong></span></p>
-
-<p>The component manifest is a mapping of files to components and components to classes. It specifies the following information:</p>
-
-<ul>
- <li>Location on disk of registered components with file size</li>
- <li>Class ID to Location Mapping</li>
- <li>Contract ID to Class ID Mapping</li>
-</ul>
-
-<p>The component manifest maps component files to unique identifiers for the specific implementations (class IDs), which in turn are mapped to more general component identifiers (contract IDs).</p>
-</div>
-
-<h5 id="Type_Library_Manifests" name="Type_Library_Manifests">Type Library Manifests</h5>
-
-<p>Another important file that XPCOM reads in is the <em>type library manifest</em> file. This file is also located in the <em>components</em> directory and is named <code>xpti.dat</code>. It includes the location and search paths of all type library files on the system. This file also lists all known interfaces and links to the type library files that define these interface structures. These type library files are at the core of XPCOM scriptablity and the binary component architecture of XPCOM.</p>
-
-<div class="side-note">
-<p><span id="Type_Library_Manifests"><a id="Type_Library_Manifests"></a><strong>Type Library Manifests</strong></span></p>
-
-<p>Type library manifests contain the following information:</p>
-
-<ul>
- <li>location of all type library files</li>
- <li>mapping of all known interfaces to type libraries where these structures are defined</li>
-</ul>
-</div>
-
-<p>Using the data in these two manifests, XPCOM knows exactly which component libraries have been installed and what implementations go with which interfaces. Additionally, it relates the components to the type libraries in which the binary representations of the interfaces they support are defined.</p>
-
-<p>The next section describes how to hook into the XPCOM startup and registration process and make the data about your component available in these manifests, so that your component will be found and registered at startup.</p>
-
-<h4 id="Registration_Methods_in_XPCOM" name="Registration_Methods_in_XPCOM">Registration Methods in XPCOM</h4>
-
-<div class="side-note">
-<p><span id="What_Is_XPCOM_Registration?"><a id="What_Is_XPCOM_Registration?"></a><strong>What Is XPCOM Registration?</strong></span></p>
-
-<p>In a nutshell, registration is the process that makes XPCOM aware of your component(s). As this section and the next describe, you can register your component explicitly during installation, or with the <code>regxpcom</code> program, or you can use the autoregistration methods in the Service Manager to find and register components in a specified components directory:</p>
-
-<ul>
- <li>XPInstall APIs</li>
- <li><code>regxpcom</code> command-line tool</li>
- <li><code>nsIComponentRegistrar</code> APIs from Service Manager</li>
-</ul>
-
-<p>The registration process is fairly involved. This section introduces it in terms of XPCOM initialization, and the next chapter describes what you have to do in your component code to register your component with XPCOM.</p>
-</div>
-
-<p>Once the manifest files are read in, XPCOM checks to see if there are any components that need to be registered. There are two supported ways to go about registering your XPCOM component. The first is to use <em>XPInstall</em>, which is an installation technology that may or may not come with a Gecko application and provides interfaces for registering your component during installation. Another, more explicit way to register your component is to run the application <code>regxpcom</code>, which is built as part of Mozilla and is also available in the Gecko SDK. <code>regxpcom</code> registers your component in the default component registry.</p>
-
-<p>A Gecko embedding application may also provide its own way of registering XPCOM components using the interface that is in fact used by both XPInstall and <code>regxpcom</code>, <code>nsIComponentRegistrar</code>. An application, for example, could provide a "registration-less" component directory whose components are automatically registered at startup and unregistered at shutdown. Component discovery does not currently happen automatically in non-debug builds of Gecko, however.</p>
-
-<p>When the registration process begins, XPCOM broadcasts to all registered observers a notification that says XPCOM has begun the registration of new components. After all components are registered, another notification is fired saying that XPCOM is done with the registration step. The <code>nsIObserver</code> interface that handles this notification is discussed in <a href="/en/Creating_XPCOM_Components/Starting_WebLock" title="en/Creating_XPCOM_Components/Starting_WebLock">Starting WebLock</a>.</p>
-
-<p>Once registration is complete and the notifications have fired, XPCOM is ready to be used by the application. If XPCOM registered your component, then it will be available to other parts of the XPCOM system. The <a href="#XPCOM_Initialization">XPCOM Initialization</a> section in this chapter describes registration in more detail.</p>
-
-<h4 id="Autoregistration" name="Autoregistration">Autoregistration</h4>
-
-<p>The term <em>autoregistration</em> is sometimes used synonymously with registration in XPCOM. In the <a href="#What_Is_XPCOM_Registration?">What Is XPCOM Registration?</a> note, we describe the three ways you can register components with XPCOM. Sometimes, applications use the <code>nsIComponentRegistrar</code> interface and create their own code for watching a particular directory and registering new components that are added there, which is what's often referred to as <em>autoregistration</em>. You should always know what the installation and registration requirements are for the applications that will be using your component.</p>
-
-<h4 id="The_Shutdown_Process" name="The_Shutdown_Process">The Shutdown Process</h4>
-
-<p>When the application is ready to shutdown XPCOM, it calls <code>NS_ShutdownXPCOM</code>. When that method is called, the following sequence of events occurs:</p>
-
-<ol>
- <li>XPCOM fires a shutdown notification to all registered observers.</li>
- <li>XPCOM closes down the Component Manager, the Service Manager and associated services.</li>
- <li>XPCOM frees all global services.</li>
- <li>NS_ShutdownXPCOM returns and the application may exit normally.</li>
-</ol>
-
-<div class="side-note">
-<p><span id="The_Unstoppable_Shutdown"><a id="The_Unstoppable_Shutdown"></a><strong>The Unstoppable Shutdown</strong></span></p>
-
-<p>Note that shutdown observation is unstoppable. In other words, the event you observe cannot be used to implement something like a "Are you sure you want to Quit?" dialog. Rather, the shutdown event gives the component or embedding application a last chance to clean up any leftovers before they are released. In order to support something like an "Are you sure you want to quit" dialog, the application needs to provide a higher-level event (e.g., <code>startShutdown()</code>) which allows for cancellation.</p>
-
-<p>Note also that XPCOM services may deny you access once you have received the shutdown notification. It is possible that XPCOM will return an error if you access the <code>nsIServiceManager</code> at that point, for example, so you may have to keep a reference-counted pointer to the service you are interested in using during this notification.</p>
-</div>
-
-<h4 id="Component_Loaders" name="Component_Loaders">Component Loaders</h4>
-
-<p>Components can be written in many languages. So far this book has been focusing on "native components," shared libraries exporting a <code>NSGetModule</code> symbol. But if there is a <em>component loader</em> for Javascript installed, then you can also write a JavaScript component.</p>
-
-<p>To register, unregister, load and manage various component types, XPCOM abstracts the interface between the XPCOM component and XPCOM with the Component Loader. This loader is responsible for initialization, loading, unloading, and supporting the <code>nsIModule</code> interface on behalf of each component. It is the Component Loader's responsibility to provide scriptable component support.</p>
-
-<p>When building a "native" component, the component loader looks for an exported symbol from the components shared library. "Native" here includes any language that can generate a platform native dynamically loaded library. Scripting languages and other "non-native" languages usually have no way to build native libraries. In order to have "non-native" XPCOM components work, XPCOM must have a special component loader which knows how to deal with these type of components.</p>
-
-<p>XPConnect, for example, provides a component loader that makes the various types, including the interfaces and their parameters, available to JavaScript. Each language supported by XPCOM must have a component loader.</p>
-
-<h4 id="Three_parts_of_a_XPCOM_Component_Library" name="Three_parts_of_a_XPCOM_Component_Library">Three parts of a XPCOM Component Library</h4>
-
-<p>XPCOM is like an onion<span class="comment">or a parfait! Everybody likes parfaits</span>. XPCOM components have at least three layers. From the innermost and moving outward these layers include:</p>
-
-<ul>
- <li>The core XPCOM object</li>
- <li>The factory code</li>
- <li>The module code</li>
-</ul>
-
-<p>The core XPCOM object is the object that will implement the functionality you need. For example, this is the object that may start a network download and implement interfaces that will listen to the progress. Or the object may provide a new content type handler. Whatever it does, this object is at the core of the XPCOM component, and the other layers are supporting it, plugging it into the XPCOM system. A single library may have many of these core objects.</p>
-
-<p>One layer above the core object is the factory code. The factory object provides a basic abstraction of the core XPCOM object. <a href="/en/Creating_XPCOM_Components/An_Overview_of_XPCOM" title="en/Creating_XPCOM_Components/An_Overview_of_XPCOM">An Overview of XPCOM</a> discussed the factory design pattern that's used in a factory object. At this layer of the XPCOM Component Library, the factory objects are factories for the core XPCOM objects of the layer below.</p>
-
-<p>One more layer outward is the module code. The module interface provides yet another abstraction - this time of the factories - and allows for multiple factory objects. From the outside of the component library, there is only the single entry point, <code>NSGetModule()</code>. This point of entry may fan out to any number of factories, and from there, to any number of XPCOM objects.</p>
-
-<p>The factory design pattern in XPCOM is represented by the <code>nsIFactory</code> interface. The module layer is represented by the <code>nsIModule</code> interface. Most component libraries only need these two interfaces, along with the <code>nsISupports</code> interface, to have XPCOM load, recognize, and use their core object code.</p>
-
-<p>In the next section, we'll be writing the code that actually compiles into a component library, and you will see how each layer is implemented and how each interface is used. Following this initial, verbose demonstration of the APIs, we will introduce a faster more generic way of implementing the module and factory code using macros, which can make components much easier to create.</p>
-
-<h3 id="XPCOM_Glue" name="XPCOM_Glue">XPCOM Glue</h3>
-
-<p>XPCOM contains a lot of stuff. Most XPCOM interfaces are not frozen and are only meant to be used by the Gecko internals and not by clients. XPCOM provides many data structures from linked lists to <a class="external" href="http://en.wikipedia.org/wiki/AVL_tree">AVL trees</a>. It's tempting to reuse <code>nsVoidArray</code> or another publicly available class instead of writing your own linked list, but this may prove to be a fatal mistake. The class can change at any time and give you unexpected behavior.</p>
-
-<p>XPCOM makes for a very open environment. At runtime you can acquire any service or component by merely knowing a CID or Contract ID along with an IID. At last count there were over 1300 interfaces defined in XPIDL. Of those 1300 interfaces, less than 100 were frozen, which means that a developer is likely to stumble upon useful interfaces that aren't frozen. Unless an interface is explicitly marked "FROZEN" in the IDL comments, your component may possibly break or crash along with a version change.</p>
-
-<h4 id="The_Glue_Library" name="The_Glue_Library">The Glue Library</h4>
-
-<p>In general, you should avoid any interfaces, symbols in XPCOM, or other part of Gecko libraries that aren't frozen. However, there are some unfrozen tools in XPCOM that are used so often they are practically required parts of component programming.</p>
-
-<p>The smart pointer class, <code>nsCOMPtr</code>, for example, which makes reference counting less tedious and error-prone, is not actually frozen, and neither is <code>nsDebug</code>, a class for aiding in tracking down bugs, nor is <code>nsMemory</code>, a class to ensure that everyone uses the same heap, generic factory, and module. Instead of asking every developer to find and copy these various files into their own application, XPCOM provides a single library of "not-ready-to-freeze-but-really-helpful" classes that you can link into your application, as the following figure demonstrates.</p>
-
-<p><span id="XPCOM_Glue_and_Tools"><a id="XPCOM_Glue_and_Tools"></a><strong>XPCOM Glue and Tools</strong></span></p>
-
-<p><img alt="Image:xpcom-glue-tools.png" class="internal" src="/@api/deki/files/978/=Xpcom-glue-tools.png"></p>
-
-<p>This is the glue library. It provides a bridge, or "glue" layer, between your component and XPCOM.</p>
-
-<p>A version of the glue library is built into XPCOM, and when your component uses it, it links a snapshot of this library: it includes a copy of these unfrozen classes directly, which allows the XPCOM library version to change without affecting the software. There is a slight footprint penalty to linking directly, but this gives your component freedom to work in any recent environment. If footprint is a big issue in your component or application, you can trim out the pieces you don't need.</p>
-
-<h4 id="XPCOM_String_Classes" name="XPCOM_String_Classes">XPCOM String Classes</h4>
-
-<p>The base string types that XPCOM uses are <code>nsAString</code> and <code>nsACString</code>. These classes are described in the Mozilla String Guide (see <a href="/en/Creating_XPCOM_Components/Resources#Gecko_Resources" title="en/Creating_XPCOM_Components/Resources#Gecko_Resources">Gecko Resources</a>).</p>
-
-<p>The string classes that implement these abstract classes are another set of helpful, unfrozen classes in XPCOM. Most components and embedding applications need to link to some string class or other in order to utilize certain Gecko APIs, but the string code that Mozilla uses is highly complex and even more expensive than the glue code in terms of footprint (~100k). <code>nsEmbedString</code> and <code>nsEmbedCString</code> are available as very lightweight string implementations for component development, especially in small embedded applications. This string implementation does the bare minimum to support the <code>nsAString</code>/<code>nsACString</code> functionality.</p>
-
-<p>In your own component, you can go "slim" and restrict yourself to the <code>nsEmbedString</code> or go "hog wild" and use any of the the other strings. WebLock restricts itself to using the simple <code>nsEmbedString</code> family of classes.</p>
-
-<p><span id="String_Classes_and_XPCOM"><a id="String_Classes_and_XPCOM"></a><strong>String Classes and XPCOM</strong></span></p>
-
-<p><img alt="Image:strings-in-xpcom.png" class="internal" src="/@api/deki/files/867/=Strings-in-xpcom.png"></p>
-
-<p>The glue library provides stub functions for the public functions that XPCOM provides (see <code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/build/nsXPCOM.h" rel="custom">xpcom/build/nsXPCOM.h</a></code>). When the glue library is initialized, it dynamically loads these symbols from the XPCOM library, which allows the component to avoid linking directly with the XPCOM library. You shouldn't have to link to the XPCOM library to create a XPCOM component - in fact, if your component has to, then something is wrong. </p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/Creating_XPCOM_Components/Using_XPCOM_Components" style="float: left;">« 上一页</a><a href="/zh-CN/docs/Creating_XPCOM_Components/Creating_the_Component_Code">下一页 »</a></p>
-</div><p></p><div class="licenseblock">
-<p>Copyright (c) 2003 by Doug Turner and Ian Oeschger. This material may be distributed only subject to the terms and conditions set forth in the <a class="external" href="http://www.opencontent.org/openpub/" rel="noopener">Open Publication License</a>, v1.02 or later. Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. Distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder.</p>
-</div><p></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/creating_the_component_code/index.html b/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/creating_the_component_code/index.html
deleted file mode 100644
index a4aa535eca..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/creating_the_component_code/index.html
+++ /dev/null
@@ -1,727 +0,0 @@
----
-title: Creating the Component Code
-slug: Mozilla/Tech/XPCOM/Guide/Creating_components/Creating_the_Component_Code
-tags:
- - XPCOM
- - 所有分类
-translation_of: Mozilla/Tech/XPCOM/Guide/Creating_components/Creating_the_Component_Code
----
-<p> </p>
-
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/Creating_XPCOM_Components:Component_Internals" style="float: left;">« 上一页</a><a href="/zh-CN/docs/Creating_XPCOM_Components:Using_XPCOM_Utilities_to_Make_Things_Easier">下一页 »</a></p>
-</div><p></p>
-
-<p>这一章叙述处理你的组件和XPCOM之间关联的基本代码。让组件被找到和注册是这个章节的目的。在后续章节中,我们开始建立<strong>WebLock</strong>组件本身的功能。</p>
-
-<p>注:有些部分采用英汉对照的方式。避免翻译的不准确!</p>
-
-<div class="side-note">
-<p><span id="Use_the_Calculator_(After_Learning_Long_Division)"><a id="Use_the_Calculator_(After_Learning_Long_Division)"></a><strong>Use the Calculator (After Learning Long Division)</strong></span></p>
-
-<p>You have to write a fair amount of code to create a component library that gets loaded into XPCOM. 一个XPCOM组件起码要实现三个XPCOM要求的接口, 通常还有其他一些. 这一章包含了可能你不会需要的更多代码,不过<a href="/cn/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier" title="cn/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier">Using XPCOM Utilities to Make Things Easier</a>会教你一些更简单和优雅的使用通用宏建立XPCOM组件的方式, 本章主要讲述基本的内容。 As in grade school when you learned long division, better tools like calculators come <em>after</em> you figure out what's actually happening. In this case, the long-hand implementation gives us an opportunity to talk about various features of XPCOM.</p>
-</div>
-
-<h3 id="What_We.27ll_Be_Working_On" name="What_We.27ll_Be_Working_On">What We'll Be Working On</h3>
-
-<p>The component we'll be working on in this book controls a special mode in your browser that prevents users from leaving the current domain or a set of safe domains. Once enabled, this weblock mode is password protected and persists until it is turned off by the password holder. It can be used to make the browser into a safe viewer for children, or for targeted "kiosk browsing," where the content is restricted to a particular server. <a href="#Web_Lock_User_Interface">Web Lock User Interface</a> shows the icon that is used to activate the web lock mode (leftmost in the status bar) once you have installed the <strong>WebLock</strong> component and the extra user interface.</p>
-
-<h3 id="接下来的内容"> 接下来的内容</h3>
-
-<p>文章后续的内容,将向读者描述一个使浏览器处在受控模式(web lock mode)的组件,该组件采用密码保护的方式防止用户从当前域或者一组安全的域中离开。这个组件可以使用在为未成年人提供受限内容或者是在一些小型电子浏览器中防止页面跳出特定服务内容。在用户安装了WebLock组件和额外的用户接口后,在状态栏的最左边,如图<a href="#Web_Lock_User_Interface">Web Lock User Interface</a>,可以用图标来激活受控模式(web lock mode)</p>
-
-<p><span id="Web_Lock_User_Interface"><a id="Web_Lock_User_Interface"></a><strong>Web Lock User Interface</strong></span></p>
-
-<p><img alt="Image:web-lock-ui.png" class="internal" src="/@api/deki/files/2727/=Web-lock-ui.png"></p>
-
-<p>实际上组件<strong>WebLock</strong>做的大多数事情是准备组件本身,找到需要的XPCOM接口, 并且挂接到现有的Gecko Browser功能.</p>
-
-<h3 id="Component_Registration" name="Component_Registration">Component Registration 组件注册</h3>
-
-<p>All XPCOM components - whether they're stored in shared libraries (DLLs, DSOs or dylibs), JavaScript files, or some other file - need to be <em>registered</em> before they can be used. Registration is a process that happens in all XPCOM applications, whether they're embedded Gecko clients, Mozilla, Netscape 7, Compuserve, or any other software that uses XPCOM. Registration provides the information that applications need in order to use components properly.</p>
-
-<p>所有的XPCOM 组件- 无论是存储在shared libraries (<abbr title="Dynamic Link Library (Windows)">DLLs</abbr>, <abbr title="Dynamic Shared Object (Linux)">DSOs</abbr> 还是 <abbr title="Dynamically linked library (OS X)">dylibs</abbr>), JavaScript文件,或者其他文件 - 使用前需要被<em>注册. </em>使用XPCOM的Gecko clients, Mozilla, Netscape 7, Compuserve, 或者其他程序,都需要注册,才能获得合适的组件信息。</p>
-
-<p>The <strong>WebLock</strong> component must do a number of things to register itself. Specifically, the component library has to contain implementations for the component-related interfaces described in this chapter: <code>nsIModule</code> and <code>nsIFactory</code>, which are entry points for your implementation code.</p>
-
-<p>想要注册 WebLock 组件必须做许多事情. 特别是, 组件库需要包含本章介绍的组件定义的接口: <code>nsIModule</code> and <code>nsIFactory</code>, 这是你的代码入口.</p>
-
-<p>Once your component implements these interfaces, the rest of the registration process itself is simple. Applications typically use <code>regxpcom</code>, described in the next section.</p>
-
-<p>如果你的组件实现了这些接口,注册将变的很容易. 应用中通常使用<code>regxpcom</code>注册, 在下一节描述.</p>
-
-<h4 id="regxpcom_.E7.A8.8B.E5.BA.8F" name="regxpcom_.E7.A8.8B.E5.BA.8F"><code>regxpcom</code> 程序</h4>
-
-<p>一个明确的注册组件方法是运行<code>regxpcom</code>. 不带任何参数启动<code>regxpcom</code>时, 程序把组件注册在缺省的组件注册表. 我们建议你如果是运行应用, 你可以拷贝你的组件到对应程序安装目录下的<code>components</code>目录. 拷贝好以后,运行<code>regxpcom</code>将注册包含你的组件在内的所有那个目录中的组件.</p>
-
-<p><code>regxpcom</code>在1.4 或更高版本有一些新的参数. 参看 <code>regxpcom 加&lt;code&gt;-h</code> 选项。</p>
-
-<h4 id=".E5.8F.A6.E5.A4.96.E7.9A.84.E6.B3.A8.E5.86.8C.E6.96.B9.E6.B3.95" name=".E5.8F.A6.E5.A4.96.E7.9A.84.E6.B3.A8.E5.86.8C.E6.96.B9.E6.B3.95">另外的注册方法</h4>
-
-<p>Gecko embedding 应用可能提供其他注册组件的方法. XPInstall, 是一个跨平台的安装技术,Mozilla用来安装浏览器和其他组件,这是一个选择。参看<a href="/cn/Creating_XPCOM_Components/Packaging_WebLock" title="cn/Creating_XPCOM_Components/Packaging_WebLock">Packaging WebLock</a>. 你可以询问你想要扩展的应用的作者看是否有其他扩展方法.</p>
-
-<h3 id="WebLock_Module_.E6.BA.90.E4.BB.A3.E7.A0.81.E6.A6.82.E8.A7.88" name="WebLock_Module_.E6.BA.90.E4.BB.A3.E7.A0.81.E6.A6.82.E8.A7.88">WebLock Module 源代码概览</h3>
-
-<p>As we mentioned in the previous section, components have layers. There are three main parts to every XPCOM component. From the innermost and moving outward, the first object is the XPCOM object. This is the object that contains the business logic, that implements functionality such as starting a network download, implementing interfaces that listen to the download progress, or providing a new content type handler. In <strong>Weblock</strong>, this is the part that brings together various Gecko services and prevents users from leaving the list of acceptable domains. In a way, the factory and module layers are glue to plug the XPCOM object into the larger XPCOM system.</p>
-
-<p>在前面的章节我们提到,组件是分层的.每一个XPCOM组件都有三部分.从内到外, 第一个对象是XPCOM对象. 这个对象包含了交互逻辑, 负责载入network, 执行一个监听载入过程或新content type的接口。. 在<strong>Weblock</strong>中, 这部分综合了各种Gecko服务并且防止用户离开允许的一些domain. In a way, the factory and module layers are glue to plug the XPCOM object into the larger XPCOM system.</p>
-
-<p>One layer above the object itself is the <code>nsIFactory</code> object. This object provides basic abstraction of the XPCOM object itself. As you can see in <span class="lang lang-en"><a href="/en/Creating_XPCOM_Components/Creating_the_Component_Code#Onion_Peel_View_of_XPCOM_Component_Creation" title="en/Creating_XPCOM_Components/Creating_the_Component_Code#Onion_Peel_View_of_XPCOM_Component_Creation"><font color="#638fa2">Onion Peel View of XPCOM Component Creation</font></a> </span>, the main accessor for the XPCOM object is <code>CreateInstance</code>, which is expected to return the object that matches a given CID and IID pair.</p>
-
-<p>XPCOM的上层是 <code>nsIFactory</code> 对象. nsIFactory是对XPCOM的基本抽象. 如同你在 <a href="#Onion_Peel_View_of_XPCOM_Component_Creation">Onion Peel View of XPCOM Component Creation</a>中看到的, 通过CreateInstance与XPCOM对象进行交互, 返回一个匹配给定的CID 和IID 的两个对象.</p>
-
-<p>Moving another layer outward is the <code>nsIModule</code>. This interface provides yet another abstraction of the <code>nsIFactory</code> object, and may allow for multiple <code>nsIFactory</code> objects. The key to this interface is that the return type of <code>getClassObject</code> does not have to be an <code>nsIFactory</code>. Instead, the <code>nsIModule</code> can ask for implementation details about the XPCOM object. This is very useful if the caller is required to know information about the component like its threading module, whether or not it's a singleton, its implementation language, and so forth. The interface used in this case is <code>nsIClassInfo</code>. Starting from the outside in, <span class="lang lang-en"><a href="/en/Creating_XPCOM_Components/Creating_the_Component_Code#Onion_Peel_View_of_XPCOM_Component_Creation" title="en/Creating_XPCOM_Components/Creating_the_Component_Code#Onion_Peel_View_of_XPCOM_Component_Creation"><font color="#638fa2">Onion Peel View of XPCOM Component Creation</font></a> </span>represents the sequence for constructing an XPCOM object.</p>
-
-<p>最外层是<code>nsIModule对象</code>. 他提供了对<code>nsIFactory</code> 的进一步抽象, 而且可能允许多个<code>nsIFactory</code>对象. 关键点是这个接口的方法<code>getClassObject</code>返回的不一定非要是<code>nsIFactory</code>. <code>nsIModule</code> 也可以用来询问 XPCOM 对象的细节. This is very useful if the caller is required to know information about the component like its threading module, whether or not it's a singleton, its implementation language, and so forth. 这是可以使用接口<code>nsIClassInfo</code>. 从外到内, <a href="#Onion_Peel_View_of_XPCOM_Component_Creation">Onion Peel View of XPCOM Component Creation</a> 表示了建立XPCOM对象的顺序.</p>
-
-<p><span id="Onion_Peel_View_of_XPCOM_Component_Creation"><a id="Onion_Peel_View_of_XPCOM_Component_Creation"></a><strong>Onion Peel View of XPCOM Component Creation</strong></span></p>
-
-<p><img alt="Image:xpcom-is-an-onion.png" class="internal" src="/@api/deki/files/2732/=Xpcom-is-an-onion.png"></p>
-
-<p>Before we begin looking at the various parts of the component and how they'll be implemented in the source, let's look at the module in <code>weblock.cpp</code> as a whole to see where we're going. The source we're referring to is listed in its entirety at the end of this chapter (see <a href="/cn/Creating_XPCOM_Components/Creating_the_Component_Code#webLock1.cpp" title="cn/Creating_XPCOM_Components/Creating_the_Component_Code#webLock1.cpp">webLock1.cpp</a>).</p>
-
-<p><strong>WebLock</strong> 组件的源代码包含三个类. 为了让<strong>WebLock</strong>组件工作在 Mozilla中, 你要为<strong>WebLock</strong>组件建立一个接口, <code>iWebLock</code>, where the actual work specific to the the web locking features happens. 建立 <code>WebLockModule</code> 实现<code>nsIModule</code>接口, 你也要建立 <code>WebLockFactory</code>实现 <code>nsIFactory</code>来建立一个为你的客户处理组件实例的工厂. These three interface implementations - of the component functionality, of the <code>nsIModule</code> interface, and of the <code>nsIFactory</code> interface that creates and manages instances for clients - are the basic sets of code you need to write to create an XPCOM component.</p>
-
-<div class="side-note">
-<p><span id="Basic_Structure_of_the_WebLock_Component_Source"><a id="Basic_Structure_of_the_WebLock_Component_Source"></a><strong>Basic Structure of the WebLock Component Source</strong></span></p>
-
-<p>The <code>weblock1.cpp</code> source file that defines these classes and the code you need to create a basic component has the following structure:</p>
-
-<pre class="eval"> * required includes and constants
- * <strong>WebLock</strong>: public <code>iWebLock</code>
- * <strong>WebLockFactory</strong>: public <code>nsIFactory</code>
- * <strong>WebLockModule</strong>: public <code>nsIModule</code>
-</pre>
-
-<p>在XPCOM中, 所有这些类要实现 <code>nsISupports</code>.</p>
-</div>
-
-<h3 id=".E6.9B.B4.E8.BF.9B.E4.B8.80.E6.AD.A5:_.E9.9C.80.E8.A6.81.E7.9A.84_Includes_and_Constants" name=".E6.9B.B4.E8.BF.9B.E4.B8.80.E6.AD.A5:_.E9.9C.80.E8.A6.81.E7.9A.84_Includes_and_Constants">更进一步: 需要的 Includes and Constants</h3>
-
-<p>Let's take a look at the first several lines of code in the component and discuss what they mean in XPCOM. The includes and definitions at the top of an XPCOM source file can give you an idea about some of the data types and techniques we'll be discussing more in the upcoming chapters.</p>
-
-<p>介绍一下XPCOM的component代码里面前几行的意思。</p>
-
-<p>例如,<code>MOZILLA_STRICT_API</code>是一个变量,它用来遮蔽某些私有的、非XPCOM的头文件。 For example, <code>MOZILLA_STRICT_API</code> is a variable that shields you from certain private, non-XPCOM headers. For example, including <a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/components/nsIComponentManager.idl" rel="custom">nsIComponentManager.idl</a> without <code>MOZILLA_STRICT_API</code> defined will include the following headers, which are not supported across versions (unfrozen):</p>
-
-<ul>
- <li><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/glue/nsComponentManagerUtils.h" rel="custom">nsComponentManagerUtils.h</a></li>
- <li><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/components/nsComponentManagerObsolete.h" rel="custom">nsComponentManagerObsolete.h</a></li>
-</ul>
-
-<p>These variables are picked up by files that do not specify themselves as <code>MOZILLA_STRICT_API</code>.</p>
-
-<p><span id="Includes_and_Constants_in_%3Ccode%3Eweblock1.cpp%3C/code%3E"><a id="Includes_and_Constants_in_%3Ccode%3Eweblock1.cpp%3C/code%3E"></a><strong>Includes and Constants in <code>weblock1.cpp</code></strong></span></p>
-
-<pre>#include &lt;stdio.h&gt;
-
-// may be defined at the project level
-// in the makefile
-#define MOZILLA_STRICT_API
-
-#include "nsIModule.h"
-#include "nsIFactory.h"
-
-#include "nsIComponentManager.h"
-#include "nsIComponentRegistrar.h"
-
-// use classes to handle IIDs
-// classes provide methods for comparison: Equals, etc.
-static const nsIID kIModuleIID = NS_IMODULE_IID;
-static const nsIID kIFactoryIID = NS_IFACTORY_IID;
-static const nsIID kISupportsIID = NS_ISUPPORTS_IID;
-static const nsIID kIComponentRegistrarIID = NS_ICOMPONENTREGISTRAR_IID;
-
-
-// generate unique ID here with uuidgen
-#define SAMPLE_CID \
-{ 0x777f7150, 0x4a2b, 0x4301, \
-{ 0xad, 0x10, 0x5e, 0xab, 0x25, 0xb3, 0x22, 0xaa}}
-
-static const nsCID kSampleCID = SAMPLE_CID;
-</pre>
-
-<p><code>nsIModule.h</code> and <code>nsIFactory.h</code> are required to build your module successfully. They define the module and factory interfaces, and they contain a couple of important macros as well (see the following chapter for information about using these macros). The two other includes, <code>nsIComponentManager.h</code> and <code>nsIComponentRegistrar.h</code>, provide functions such as <code>RegisterFactoryLocation</code> that are required to implement the module and factory classes in your code.</p>
-
-<h4 id=".E6.A0.87.E8.AF.86.E7.AC.A6_in_XPCOM" name=".E6.A0.87.E8.AF.86.E7.AC.A6_in_XPCOM">标识符 in XPCOM</h4>
-
-<p>一组 <code>nsIID</code> 变量实际上是一些处理XPCOM用来支持客户和组件之间关系的128-bit标识符. The variable <code>kIFactoryIID</code>, for example, provides methods like <code>Equals()</code> that can be used to facilitate comparisons in the code, as in the following example from the Mozilla source:</p>
-
-<p><span id="Using_Class_Methods_to_Handle_Identifiers"><a id="Using_Class_Methods_to_Handle_Identifiers"></a><strong>Using Class Methods to Handle Identifiers</strong></span></p>
-
-<pre>if (aIID.Equals(NS_GET_IID(nsISupports)))
-{
- *aInstancePtr = (void*)(nsISupports*)this;
- NS_ADDREF_THIS();
- return NS_OK;
-}
-</pre>
-
-<p>最后, <code>SAMPLE_CID</code> 是一个唯一标示组件的 CID . 所有的XPCOM中使用的128-bit数字 - 类和接口 IDs - 都是 UUIDs的例子, or <em>universal unique identifiers</em>, which were discussed in <a href="/cn/Creating_XPCOM_Components/What_is_XPCOM%3f#Object_Interface_Discovery" title="cn/Creating_XPCOM_Components/What_is_XPCOM?#Object_Interface_Discovery">Object Interface Discovery</a>.</p>
-
-<div class="side-note">
-<p>Generating CIDs</p>
-
-<p>为组件建立一个CID,你可以使用大多数Unix版本以及Miscrosoft Visual C++都包含的<code>uuidgen</code> 工具. <code>uuidgen</code> is a command-line tool that returns a unique 128-bit number when you call it with no arguments:</p>
-
-<pre>$ uuidgen
-ce32e3ff-36f8-425f-94be-d85b26e634ee
-</pre>
-
-<p>On Windows, a program called <code>guidgen.exe</code> does the same thing and also provides a graphical user interface if you'd rather point and click. Or you can use one of the special "bots" on IRC in <a class="link-irc" href="irc://irc.mozilla.org/mozilla">#developers</a>, where you can also get help from human beings.</p>
-
-<pre>irc irc.mozilla.org
-/join #developers
-/msg mozbot uuid
-</pre>
-
-<p>This command makes the bot generate and return a UUID, which you can then copy into your component source code.</p>
-</div>
-
-<p>Now that we've looked at the preliminaries, it's time to discuss the classes that this module provides and the way that they define the relationships of the component in XPCOM.</p>
-
-<h4 id="Coding_for_the_Registration_Process" name="Coding_for_the_Registration_Process">Coding for the Registration Process</h4>
-
-<p>当 XPCOM 第一次发现你的组件(via XPInstall or <code>regxpcom</code>, both of which are discussed in <a href="#Component_Installation_Overview">Component Installation Overview</a>), 第一件事是装载你的库并找到符号<code>NSGetModule</code>. 当这个专用的入口被调用, 它被传送XPCOM's Component Manager和组件存在的共享库位置.</p>
-
-<p>Component Manager是一个是XPCOM实现的用来包含建立对象和提供一些所有组件的综合信息的接口。磁盘的位置是通过另外一个接口 <code>nsIFile</code>传送的. This interface is XPCOM's abstraction of files and directories. An <code>nsIFile</code> object is usually a file or directory on a local volume, but it may represent something on a network volume as well.</p>
-
-<pre>nsresult NSGetModule(nsIComponentManager *servMgr,
- nsIFile* location,
- nsIModule** result);
-</pre>
-
-<p>XPCOM 需要成功调用 <code>NSGetModule</code>并返回接口<code>nsIModule</code>. 当你写一个 XPCOM 组件, 你实现了 <code>nsIModule</code> to do all of the necessary registration, unregistration, and object creation. <code>nsIModule</code> 有4个方法必须实现.<code>nsIModule</code> has four methods that must be implemented.</p>
-
-<h4 id="The_Registration_Methods" name="The_Registration_Methods">The Registration Methods</h4>
-
-<p>Two closely related registration methods are declared below.</p>
-
-<pre>NS_IMETHOD RegisterSelf(nsIComponentManager *aCompMgr,
- nsIFile *aLocation,
- const char *aLoaderStr,
- const char *aType) = 0;
-
-NS_IMETHOD UnregisterSelf(nsIComponentManager *aCompMgr,
- nsIFile *aLocation,
- const char *aLoaderStr) = 0;
-</pre>
-
-<p><code>RegisterSelf</code> 在组件第一次被XPCOM注册的时候调用. 他只执行一次, which gives you a chance to add any one time setup functionality. The <code>RegisterSelf</code> 允许你的组件告诉XPCOM 你将支持什么功能. 注意所有你在 <code>RegisterSelf</code> 中做的都应该在 <code>UnregisterSelf</code>中撤销.</p>
-
-<p>首先, <code>NSGetModule</code>入口从你的库中被调用, 返回一个指向<code>nsIModule</code>的实现. 然后XPCOM调用<code>RegisterSelf</code>, passing parameters that we'll examine here.</p>
-
-<h5 id="The_RegisterSelf_Method" name="The_RegisterSelf_Method">The RegisterSelf Method</h5>
-
-<p>The first parameter is the <code>nsIComponentManager</code>, which provides a kind of entry point into managing the registration process. 你可以调用<code>QueryInterface</code> 来查找访问下面所述的其他组件管理接口.</p>
-
-<div class="side-note">
-<p><span id="The_Many_Faces_of_the_XPCOM_Component_Manager"><a id="The_Many_Faces_of_the_XPCOM_Component_Manager"></a><strong>The Many Faces of the XPCOM Component Manager</strong></span></p>
-
-<p>三个主要的组件管理接口, <code>nsIComponentManager</code>, <code>nsIServiceManager</code>, and <code>nsIComponentRegistrar</code>, are described below:</p>
-
-<ul>
- <li><code>nsIComponentManager</code> - 建立组件并且返回组件实现细节。</li>
- <li><code>nsIServiceManager</code> - 提供访问单根组件并且返回单根状态信息。</li>
- <li><code>nsIComponentRegistrar</code> - 注册和注销工厂和组件;处理自动注册和发现已经注册的组件列表。</li>
-</ul>
-</div>
-
-<p>Your <code>RegisterSelf</code> method may call <code>QueryInterface</code> on the <code>nsIComponentManager</code> interface parameter to obtain the <code>nsIComponentRegistrar</code> or <code>nsIServiceManager</code>. <code>nsIServiceManager</code> can be used to obtain a singleton service, which can be useful if you have to register with a service other than the <code>nsIComponentRegistrar</code> if necessary. For example, you may want to get the service that is responsible for an event you want to be notified about. See <a href="/cn/Creating_XPCOM_Components/Starting_WebLock#Getting_Called_at_Startup" title="cn/Creating_XPCOM_Components/Starting_WebLock#Getting_Called_at_Startup">Getting Called at Startup</a> for an example of this.</p>
-
-<p>第二个参数<code>RegisterSelf</code>是正在注册组件的位置. This parameter is useful when the component needs to know where it has been installed or registered - as, for example, when other files must be stored or accessed relative to the component. This method is only called once, so you have to persist the location if you are going to use it later.</p>
-
-<p>The next two parameters are usually passed into the <code>nsIComponentRegistrar</code> methods and used by XPCOM to determine how to handle the component's registration. The <code>aLoaderStr</code> parameter, which is opaque and should not be modified, distinguishes components that are loaded from the same location specified by the <code>nsIFile</code> parameter. A single ZIP archive may store several XPCOM components, where every component in the archive has the same <code>nsIFile</code> parameter but the <code>aLoaderStr</code> parameter can be used to refer to the location within the ZIP archive.</p>
-
-<p>The last parameter specifies what kind of loader to use on the component. This is reserved as an optimization, for the most part, but it can be a useful way to extend XPCOM. Since XPCOM already knows internally what kind of file it has just loaded and called <code>RegisterSelf</code> on, passing this value to the registration methods is a shortcut for determining what kind of component is being registered.</p>
-
-<h5 id="nsIComponentRegistrar_Methods" name="nsIComponentRegistrar_Methods">nsIComponentRegistrar Methods</h5>
-
-<p>为了告诉XPCOM这个组件库实现了什么,调用方法:</p>
-
-<pre>NS_IMETHOD RegisterFactoryLocation(const nsCID &amp; aClass,
- const char *aClassName,
- const char *aContractID,
- nsIFile *aFile,
- const char *aLoaderStr,
- const char *aType) = 0;
-</pre>
-
-<p>The last three parameters are the same as the three passed into the <code>RegisterSelf</code> method of <code>nsIModule</code> objects. All you have to do is forward these parameters from your <code>RegisterSelf</code> call into this method, leaving just the first three parameters.</p>
-
-<p>For any class that implements an XPCOM interface, the implementation must have a class identifier if it is to be shared with other parts of code via XPCOM. This identifier, called a CID, uniquely specifies the implementation. This CID can be created via the tool <code>uuidgen</code> on most operating systems, as in <a href="#The_Many_Faces_of_the_XPCOM_Component_Manager">The Many Faces of the XPCOM Component Manager</a> above. Given a CID and an IID, you can refer to any class in XPCOM. Consider the following:</p>
-
-<p><span id="Referencing_Objects_by_ID"><a id="Referencing_Objects_by_ID"></a><strong>Referencing Objects by ID</strong></span></p>
-
-<p><img alt="Image:referencing-objects-by-id.png" class="internal" src="/@api/deki/files/2676/=Referencing-objects-by-id.png"></p>
-
-<p>In this case, you have two implementations of the <code>nsISupports</code> interface. Each implementation has a separate CID. The interface also as an IID which is the same for both implementations. When specifying implementation A, the two required pieces of information are the CID of A and the IID of the interface that A supports. The code to register such an object is simple:</p>
-
-<pre>NS_IMETHODIMP
-SampleModule::RegisterSelf(nsIComponentManager *aCompMgr,
- nsIFile* aPath,
- const char* registryLocation,
- const char* componentType)
-{
- printf("Hello Mozilla Registration!\n\n");
- nsIComponentRegistrar* compReg = nsnull;
- nsresult rv =
- aCompMgr-&gt;QueryInterface(kIComponentRegistrarIID,(void**)&amp; compReg);
- if (NS_FAILED(rv))
- return rv;
- rv = compReg-&gt;RegisterFactoryLocation(kSampleCID,
- "Sample Class",
- nsnull,
- aPath,
- registryLocation,
- componentType);
- compReg-&gt;Release();
- return rv;
-}
-</pre>
-
-<p>Unregistration follows the same logic. To unregister, all you have to do is pass the CID and the file which is passed into <code>UnregisterSelf</code>.</p>
-
-<h4 id=".E5.BB.BA.E7.AB.8B.E4.BD.A0.E7.9A.84.E7.BB.84.E4.BB.B6.E7.9A.84.E4.B8.80.E4.B8.AA.E5.AE.9E.E4.BE.8B" name=".E5.BB.BA.E7.AB.8B.E4.BD.A0.E7.9A.84.E7.BB.84.E4.BB.B6.E7.9A.84.E4.B8.80.E4.B8.AA.E5.AE.9E.E4.BE.8B">建立你的组件的一个实例</h4>
-
-<p>上面的例子用了 CID, 一旦注册以后,任何使用 XPCOM 的客户都可以访问你的组件,通过contract ID or CID. (Note that <code>RegisterSelf</code> method above does not register a contract ID - it simply passes null. This prevents clients from ever accessing the component with a contract ID.)</p>
-
-<p>为了让其他人访问, 你要公开组件包括它支持的接口的 CID 和/或者 contract ID. 上面的例子中,某人可能通过下面的方法建立一个 <strong>Sample</strong>对象 :</p>
-
-<pre>nsIComponentManager* compManager; // assume initialized
-
-nsISupports* sample;
-compManager-&gt;CreateInstance(kSampleCID,
- nsnull,
- kISupportsIID,
- (void**)&amp;sample);
-</pre>
-
-<p>In the above snippet, we assume that the component manager has been initialized. In many cases this value is passed in or easily accessible. 如果还没有建立组件管理者,你总可以调用<code>NS_GetComponentManager()</code>来建立它. <a href="/cn/XPCOM_API_Reference" title="cn/XPCOM_API_Reference">XPCOM API Reference</a>中列出了一些全局的XPCOM方法.</p>
-
-<p>The first parameter of the call to <code>CreateInstance</code> specifies the component the client code is looking for, which is the same value passed to <code>RegisterFactoryLocation</code>. The next parameter is for aggregation, which the <strong>WebLock</strong> component does not support. The third parameter is the interface used to talk to the component. The last parameter is the out variable which will contain a valid object if and only if the method succeeds<sup><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/Creating_the_Component_Code#endnote_non-null-out">[non-null-out]</a></sup>. The implementation of <code>CreateInstance</code> will ensure that the result will support the passed IID, <code>kISupportsIID</code>. The type of the variable <code>sample</code> should match the IID passed in as <code>kISupportsIID</code>.</p>
-
-<p>当 <code>CreateInstance</code> 被调用, XPCOM 查询所有的注册组件来匹配CID. XPCOM然后会装载对应的匹配 CID的组件,如果他还没有被装载的话. XPCOM 然后调用库的 <code>NSGetModule</code>. 最后它调用模块上的 <code>GetClassObject</code>. 这个方法是你来实现的,返回匹配 CID/IID 对的<code>nsIFactory</code>. To prepare your component code, you need to create a factory object for each object that you have registered with XPCOM.</p>
-
-<p>The main function that must be implemented in the <code>nsIFactory</code> interface is <code>CreateInstance</code>. The implementation follows a simple algorithm:</p>
-
-<ol>
- <li>Create the raw object.</li>
- <li>If that fails, return an out of memory error code.</li>
- <li>Call <code>QueryInterface</code> on the new object.</li>
- <li>If that fails, null the out param and free the new object.</li>
- <li>Return the <code>nsresult</code> value from <code>QueryInterface</code>.</li>
-</ol>
-
-<p>Often, you don't have to create the object first because the factory implicitly knows what IIDs are supported. When this is not the case, however, doing it this way further abstracts the factories from their concrete classes. If you have a factory that knows every IID supported by the concrete base class, for example, then when you go to add a new supported interface you add this IID comparison in both the factory and the <code>QueryInterface</code> implementation in the concrete class.</p>
-
-<pre>NS_IMETHODIMP
-SampleFactory::CreateInstance(nsISupports *aOuter,
- const nsIID &amp; iid,
- void * *result)
-{
- if (!result)
- return NS_ERROR_INVALID_ARG;
-
- Sample* sample = new Sample();
- if (!sample)
- return NS_ERROR_OUT_OF_MEMORY;
-
- nsresult rv = sample-&gt;QueryInterface(iid, result);
-
- if (NS_FAILED(rv)) {
- *result = nsnull;
- delete sample;
- }
-
- return rv;
-}
-</pre>
-
-<h3 id="webLock1.cpp" name="webLock1.cpp"><code>webLock1.cpp</code></h3>
-
-<p>Before any of the improvements and XPCOM tools we describe in the following chapter are brought in, the source code for the <strong>WebLock</strong> component that implements all the necessary interfaces looks like this.</p>
-
-<pre>#include &lt;stdio.h&gt;
-
-#define MOZILLA_STRICT_API
-
-#include "nsIModule.h"
-#include "nsIFactory.h"
-
-#include "nsIComponentManager.h"
-#include "nsIComponentRegistrar.h"
-
-static const nsIID kIModuleIID = NS_IMODULE_IID;
-static const nsIID kIFactoryIID = NS_IFACTORY_IID;
-static const nsIID kISupportsIID = NS_ISUPPORTS_IID;
-static const nsIID kIComponentRegistrarIID = NS_ICOMPONENTREGISTRAR_IID;
-
-
-#define SAMPLE_CID \
-{ 0x777f7150, 0x4a2b, 0x4301, \
-{ 0xad, 0x10, 0x5e, 0xab, 0x25, 0xb3, 0x22, 0xaa}}
-
-static const nsCID kSampleCID = SAMPLE_CID;
-
-class Sample: public nsISupports {
- private:
- nsrefcnt mRefCnt;
- public:
- Sample();
- virtual ~Sample();
-
- NS_IMETHOD QueryInterface(const nsIID &amp;aIID, void **aResult);
- NS_IMETHOD_(nsrefcnt) AddRef(void);
- NS_IMETHOD_(nsrefcnt) Release(void);
-
-};
-
-Sample::Sample()
-{
- mRefCnt = 0;
-}
-
-Sample::~Sample()
-{
-}
-
-NS_IMETHODIMP
-Sample::QueryInterface(const nsIID &amp;aIID,
- void **aResult)
-{
- if (aResult == NULL) {
- return NS_ERROR_NULL_POINTER;
- }
- *aResult = NULL;
- if (aIID.Equals(kISupportsIID)) {
- *aResult = (void *) this;
- }
- if (*aResult == NULL) {
- return NS_ERROR_NO_INTERFACE;
- }
- AddRef();
- return NS_OK;
-}
-
-NS_IMETHODIMP_(nsrefcnt) Sample::AddRef()
-{
- return ++mRefCnt;
-}
-
-NS_IMETHODIMP_(nsrefcnt) Sample::Release()
-{
- if (--mRefCnt == 0) {
- delete this;
- return 0;
- }
- return mRefCnt;
-}
-
-
-
-// factory implementation class for component
-class SampleFactory: public nsIFactory{
- private:
- nsrefcnt mRefCnt;
- public:
- SampleFactory();
- virtual ~SampleFactory();
-
- NS_IMETHOD QueryInterface(const nsIID &amp;aIID, void **aResult);
- NS_IMETHOD_(nsrefcnt) AddRef(void);
- NS_IMETHOD_(nsrefcnt) Release(void);
-
- NS_IMETHOD CreateInstance(nsISupports *aOuter, const nsIID &amp; iid, void * *result);
- NS_IMETHOD LockFactory(PRBool lock);
-
-};
-
-SampleFactory::SampleFactory()
-{
- mRefCnt = 0;
-}
-SampleFactory::~SampleFactory()
-{
-}
-
-NS_IMETHODIMP
-SampleFactory::QueryInterface(const nsIID &amp;aIID,
- void **aResult)
-{
- if (aResult == NULL) {
- return NS_ERROR_NULL_POINTER;
- }
- *aResult = NULL;
- if (aIID.Equals(kISupportsIID)) {
- *aResult = (void *) this;
- }
- else if (aIID.Equals(kIFactoryIID)) {
- *aResult = (void *) this;
- }
-
- if (*aResult == NULL) {
- return NS_ERROR_NO_INTERFACE;
- }
- AddRef();
- return NS_OK;
-}
-
-NS_IMETHODIMP_(nsrefcnt) SampleFactory::AddRef()
-{
- return ++mRefCnt;
-}
-
-NS_IMETHODIMP_(nsrefcnt) SampleFactory::Release()
-{
- if (--mRefCnt == 0) {
- delete this;
- return 0;
- }
- return mRefCnt;
-}
-
-
-NS_IMETHODIMP
-SampleFactory::CreateInstance(nsISupports *aOuter,
- const nsIID &amp; iid,
- void * *result)
-{
- if (!result)
- return NS_ERROR_INVALID_ARG;
-
- Sample* sample = new Sample();
- if (!sample)
- return NS_ERROR_OUT_OF_MEMORY;
-
- nsresult rv = sample-&gt;QueryInterface(iid, result);
-
- if (NS_FAILED(rv)) {
- *result = nsnull;
- delete sample;
- }
-
- return rv;
-}
-
-
-NS_IMETHODIMP
-SampleFactory::LockFactory(PRBool lock)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-
-
-
-
-
-// Module implementation
-class SampleModule : public nsIModule
-{
- public:
- SampleModule();
- virtual ~SampleModule();
-
- // nsISupports methods:
- NS_IMETHOD QueryInterface(const nsIID &amp; uuid, void * *result);
- NS_IMETHOD_(nsrefcnt) AddRef(void);
- NS_IMETHOD_(nsrefcnt) Release(void);
-
- // nsIModule methods:
- NS_IMETHOD GetClassObject(nsIComponentManager *aCompMgr,
- const nsCID &amp; aClass,
- const nsIID &amp; aIID,
- void * *aResult);
- NS_IMETHOD RegisterSelf(nsIComponentManager *aCompMgr,
- nsIFile *aLocation,
- const char *aLoaderStr,
- const char *aType);
- NS_IMETHOD UnregisterSelf(nsIComponentManager *aCompMgr,
- nsIFile *aLocation,
- const char *aLoaderStr);
- NS_IMETHOD CanUnload(nsIComponentManager *aCompMgr,
- PRBool *_retval);
-
- private:
- nsrefcnt mRefCnt;
-};
-
-
-//----------------------------------------------------------------------
-
-SampleModule::SampleModule()
-{
- mRefCnt = 0;
-}
-
-SampleModule::~SampleModule()
-{
-}
-
-
-// nsISupports implemention
-NS_IMETHODIMP_(nsrefcnt)
-SampleModule::AddRef(void)
-{
- return ++mRefCnt;
-}
-
-
-NS_IMETHODIMP_(nsrefcnt)
-SampleModule::Release(void)
-{
- if (--mRefCnt == 0) {
- mRefCnt = 1; /* stabilize */
- delete this;
- return 0;
- }
- return mRefCnt;
-}
-
-NS_IMETHODIMP
-SampleModule::QueryInterface(REFNSIID aIID,
- void** aInstancePtr)
-{
- if (!aInstancePtr)
- return NS_ERROR_NULL_POINTER;
-
- nsISupports* foundInterface;
-
- if (aIID.Equals(kIModuleIID)) {
- foundInterface = (nsIModule*) this;
- }
- else if ( aIID.Equals(kISupportsIID) ) {
- foundInterface = (nsISupports*) this;
- }
- else {
- foundInterface = 0;
- }
-
- if (foundInterface) {
- foundInterface-&gt;AddRef();
- *aInstancePtr = foundInterface;
- return NS_OK;
- }
-
- *aInstancePtr = foundInterface;
- return NS_NOINTERFACE;
-}
-
-
-// Create a factory object for creating instances of aClass.
-NS_IMETHODIMP
-SampleModule::GetClassObject(nsIComponentManager *aCompMgr,
- const nsCID&amp; aClass,
- const nsIID&amp; aIID,
- void** result)
-{
-
- if (!kSampleCID.Equals(aClass))
- return NS_ERROR_FACTORY_NOT_REGISTERED;
-
- if (!result)
- return NS_ERROR_INVALID_ARG;
-
- SampleFactory* factory = new SampleFactory();
- if (!factory)
- return NS_ERROR_OUT_OF_MEMORY;
-
- nsresult rv = factory-&gt;QueryInterface(aIID, result);
-
- if (NS_FAILED(rv)) {
- *result = nsnull;
- delete factory;
- }
-
- return rv;
-}
-
-
-//----------------------------------------
-
-
-NS_IMETHODIMP
-SampleModule::RegisterSelf(nsIComponentManager *aCompMgr,
- nsIFile* aPath,
- const char* registryLocation,
- const char* componentType)
-{
-
- nsIComponentRegistrar* compReg = nsnull;
-
- nsresult rv =
- aCompMgr-&gt;QueryInterface(kIComponentRegistrarIID, (void**)&amp;compReg);
- if (NS_FAILED(rv))
- return rv;
-
- rv = compReg-&gt;RegisterFactoryLocation(kSampleCID,
- "Sample Class",
- nsnull,
- aPath,
- registryLocation,
- componentType);
-
- compReg-&gt;Release();
-
- return rv;
-}
-
-NS_IMETHODIMP
-SampleModule::UnregisterSelf(nsIComponentManager* aCompMgr,
- nsIFile* aPath,
- const char* registryLocation)
-{
-
- nsIComponentRegistrar* compReg = nsnull;
-
- nsresult rv = aCompMgr-&gt;QueryInterface(kIComponentRegistrarIID, (void**)&amp;compReg);
- if (NS_FAILED(rv))
- return rv;
-
- rv = compReg-&gt;UnregisterFactoryLocation(kSampleCID, aPath);
-
- compReg-&gt;Release();
-
- return rv;
-}
-
-NS_IMETHODIMP
-SampleModule::CanUnload(nsIComponentManager *aCompMgr, PRBool *okToUnload)
-{
- *okToUnload = PR_FALSE; // we do not know how to unload.
- return NS_OK;
-}
-
-//----------------------------------------------------------------------
-
-extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *servMgr,
- nsIFile* location,
- nsIModule** return_cobj)
-{
- nsresult rv = NS_OK;
-
- // Create and initialize the module instance
- SampleModule *m = new SampleModule();
- if (!m) {
- return NS_ERROR_OUT_OF_MEMORY;
- }
-
- // Increase refcnt and store away nsIModule interface to m in return_cobj
- rv = m-&gt;QueryInterface(kIModuleIID, (void**)return_cobj);
- if (NS_FAILED(rv)) {
- delete m;
- }
- return rv;
-}
-</pre>
-
-<ol>
- <li><div class="blockIndicator note"><strong>Note:</strong> non-null-out</div> The <code>CreateInstance</code> method guarantees that if the out variable is non-null, it is valid.</li>
-</ol>
-
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/Creating_XPCOM_Components:Component_Internals" style="float: left;">« 上一页</a><a href="/zh-CN/docs/Creating_XPCOM_Components:Using_XPCOM_Utilities_to_Make_Things_Easier">下一页 »</a></p>
-</div> <p></p><div class="licenseblock">
-<p>Copyright (c) 2003 by Doug Turner and Ian Oeschger. This material may be distributed only subject to the terms and conditions set forth in the <a class="external" href="http://www.opencontent.org/openpub/" rel="noopener">Open Publication License</a>, v1.02 or later. Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. Distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder.</p>
-</div><p></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/finishing_the_component/index.html b/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/finishing_the_component/index.html
deleted file mode 100644
index 3be93d89f5..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/finishing_the_component/index.html
+++ /dev/null
@@ -1,337 +0,0 @@
----
-title: Finishing the Component
-slug: Mozilla/Tech/XPCOM/Guide/Creating_components/Finishing_the_Component
-tags:
- - XPCOM
- - 所有分类
-translation_of: Mozilla/Tech/XPCOM/Guide/Creating_components/Finishing_the_Component
----
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/Creating_XPCOM_Components:Starting_WebLock" style="float: left;">« 上一页</a><a href="/zh-CN/docs/Creating_XPCOM_Components:Building_the_WebLock_UI">下一页 »</a></p>
-</div><p></p>
-
-<p>At this point you have created most of the infrastructure of the component. The component will be recognized by XPCOM and registered with the Category Manager so that it starts up when XPCOM initializes. When the component starts up, it populates a list of URLs read in from a file stored next to the Gecko binary on the local system.</p>
-
-<h3 id="Using_Frozen_Interfaces" name="Using_Frozen_Interfaces">Using Frozen Interfaces</h3>
-
-<p>The core functionality of blocking sites is still missing, however. The interfaces needed to block certain URLs from loading are not frozen, and there is still some debate about how exactly this functionality should be exposed to embedders and component developers, so the APIs are not ready to be published. This puts you in the same situation as many developers using Mozilla - you want to use some specific functionality, but the interfaces seem to change on a daily basis.</p>
-
-<p>All of the Mozilla source code is publicly available, and interfaces can be used easily enough. Grab the right headers, use the Component or Service Manager to access the interface you want, and the XPCOM object(s) that implement that interface will do your bidding. With this huge amount of flexibility, however, you lose compatibility. If you use "stuff" that isn't frozen, that stuff is subject to change in future versions of Gecko.</p>
-
-<p>If you want to be protected against changes in Gecko, you must only use interfaces and APIs that are clearly marked as FROZEN. The marking is made in the comments above the interface declaration. For example, take a look at the <code>nsIServiceManager</code>:</p>
-
-<pre>/**
- * The nsIServiceManager manager interface provides a means to obtain
- * global services in an application. The service manager depends
- * on the repository to find and instantiate factories to obtain
- * services.
- *
- * Users of the service manager must first obtain a pointer to the
- * global service manager by calling NS_GetServiceManager. After that,
- * they can request specific services by calling GetService.
- * When they are finished they can NS_RELEASE() the service as usual.
- *
- * A user of a service may keep references to particular services
- * indefinitely and only must call Release when it shuts down.
- *
- * @status FROZEN
- */
-</pre>
-
-<p>These frozen interfaces and functions are part of the Gecko SDK. The rule of thumb is that interfaces outside of the SDK are considered "experimental" or unfrozen. See the following sidebar for information about how frozen and unfrozen interfaces can affect your component development, and for technical details about how interface changes beneath your code can cause havoc.</p>
-
-<div class="side-note">
-<p><span id="The_Danger_of_Using_Unfrozen_Interfaces"><a id="The_Danger_of_Using_Unfrozen_Interfaces"></a><strong>The Danger of Using Unfrozen Interfaces</strong></span></p>
-
-<p>Suppose that you need to use the interface <code>nsIFoo</code> that isn't frozen. You build your component using this interface, and it works great with the version of Gecko that you have tested against. However, some point in the future, the <code>nsIFoo</code> interface requires a major change, and methods are reordered, some are added, others are removed. Moreover, since this interface was never supposed to be used by clients other than Gecko or Mozilla, the maintainers of the interface don't know that it's being used, and don't change the IID of the interface. When your component runs in a version of Gecko in which this interface is updated, your method calls will be routed through a different v-table than the one the component expected, most likely resulting in a crash.</p>
-
-<p>Below, the component is compiled against a version of the <code>nsIFoo</code> interface that has three methods. The component calls the method <code>TestA</code> and passes an integer, 10. This works fine in any Gecko installation where a contract guarantees that the interface that was compiled against has the same signature. However, when this same component is used in a Gecko installation where this interface has changed, the method <code>TestA</code> does not exist in the <code>nsIFoo</code> interface; the first entry in the v-table is in fact <code>IsPrime()</code>. When this method call is made, the code execution treats the <code>IsPrime</code> method as <code>TestA</code>. Needless to say, this is a bad thing. Furthermore, there is no way easy way to realize this error at runtime.</p>
-
-<p><img alt="Image:vtable-of-altered-interface.png"></p>
-
-<p>Gecko developers could change the interface's IID, and some do. This can prevent many errors like this. But unfrozen interfaces are not supported in any formal way, and relying upon a different IID for any change in the interface is not a good idea either.</p>
-
-<p>When using frozen interfaces, you are guaranteed compatibility with future versions of Gecko. The only trouble occurs when the compiler itself changes its v-table layout, which can happen when the compiler changes its ABI. For example, in 2002 the GNU Compiler Collection (GCC), version 3.2 changed the C++ ABI, and this caused problems between libraries compiled with GCC 3.2 and applications compiled with an earlier version and vice versa. Similar problems occurred with GCC 4.0, which underwent similar ABI changes.</p>
-</div>
-
-<p>Before attempting to use unfrozen interfaces, you should contact the developers who are responsible for the code you're trying to use (i.e.,<em><a class="external" href="http://www.mozilla.org/owners.html">module owners</a></em> ) and ask them how best to do what you are trying to do. Be as precise you possibly can. They may be able to suggest a supported alternative, or they may be able to notify you about pending changes.</p>
-
-<p>The interface that we need for this project is something called <code>nsIContentPolicy</code>. At the time this book was written, this interface was under review. An interface reaches this state when a group of module owners and peers are actively engaged in discussion about how best to expose it. Usually there are only minor changes to interfaces marked with such a tag. Even with interfaces marked "under review," however, it's still a good idea to contact the module owners responsible for the interfaces you are interested in using.</p>
-
-<h4 id="Copying_Interfaces_into_Your_Build_Environment" name="Copying_Interfaces_into_Your_Build_Environment">Copying Interfaces into Your Build Environment</h4>
-
-<p>To get and implement interfaces that are not part of Gecko in your component, simply create a new directory in the Gecko SDK named <code>unfrozen</code>. Copy the headers and IDL files that you need from the <code><a href="https://dxr.mozilla.org/mozilla-central/source/content/base/public" rel="custom">content/base/public</a></code> source directory of the Gecko build into this new directory. (For <strong>WebLock</strong>, all you need are the headers for <code>nsIContentPolicy</code> and the <code>nsIContentPolicy.idl</code>.) Then, using the same steps you used to create the <code>Weblock.h</code>, create a header from this IDL file using the xpidl compiler. Once you have these interface and header files, you can modify the <code>WebLock</code> class to implement the <code>nsIContentPolicy</code> interface. The Weblock class will then support four interfaces: <code>nsISupports</code>, <code>nsIObserver</code>, <code>nsIContentPolicy</code>, and <code>iWeblock</code>.</p>
-
-<p><img alt="Image:weblock-implemented-ifaces.png"></p>
-
-<p><span id="%3Ccode%3EWebLock%3C/code%3E_Interfaces"><a id="%3Ccode%3EWebLock%3C/code%3E_Interfaces"></a><strong><code>WebLock</code> Interfaces</strong></span></p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">Interface Name</td>
- <td class="header">Defined by</td>
- <td class="header">Status</td>
- <td class="header">Summary</td>
- </tr>
- <tr>
- <td><code>nsISupports</code></td>
- <td>XPCOM</td>
- <td>Frozen</td>
- <td>Provides interface discovery, and object reference counting</td>
- </tr>
- <tr>
- <td><code>nsIObserver</code></td>
- <td>XPCOM</td>
- <td>Frozen</td>
- <td>Allows messaging passing between objects</td>
- </tr>
- <tr>
- <td><code>nsIContentPolicy</code></td>
- <td>Content</td>
- <td>Not Frozen</td>
- <td>Interface for policy control mechanism</td>
- </tr>
- <tr>
- <td><code>iWeblock</code></td>
- <td>Web Lock</td>
- <td>Not Frozen</td>
- <td>Enables and disables Weblock. Also, provides access to the URL that are whitelisted.</td>
- </tr>
- </tbody>
-</table>
-
-<h4 id="Implementing_the_nsIContentPolicy_Interface" name="Implementing_the_nsIContentPolicy_Interface">Implementing the <code>nsIContentPolicy</code> Interface</h4>
-
-<p>To implement the new interface, you must <code>#include</code> the unfrozen <code><a class="internal" href="/en/nsIContentPolicy" title="en/nsIContentPolicy">nsIContentPolicy</a></code>, and you must also make sure the build system can find the file you've brought over. The location of the file and the steps for adding that location to the build system vary depending on how you build this component.</p>
-
-<p>Once you have made sure that your component builds with the new header file, you must derive the <code>Weblock</code> class from the interface <code>nsIContentPolicy</code>, which you can do by simply adding a public declaration when defining the class. At the same time, you can add the macro <code>NS_DECL_NSICONTENTPOLICY</code> to the class declaration that provides all of the methods defined in the interface nsIContentPolicy. The updated <code>WebLock</code> class looks as follows:</p>
-
-<pre>class WebLock: public nsIObserver, public iWeblock, public nsIContentPolicy
-{
- public:
- WebLock();
- virtual ~WebLock();
-
- NS_DECL_ISUPPORTS
- NS_DECL_NSIOBSERVER
- NS_DECL_IWEBLOCK
- NS_DECL_NSICONTENTPOLICY
-
- private:
- urlNode* mRootURLNode;
- PRBool mLocked;
-};
-</pre>
-
-<p>Remember to change the <code>nsISupports</code> implementation macro to include <code>nsIContentPolicy</code> so that other parts of Gecko will know <strong>WebLock</strong> supports the <code>nsIContentPolicy</code> interface without modifying this macro.</p>
-
-<pre>NS_IMPL_ISUPPORTS3(WebLock, nsIObserver, iWeblock, nsIContentPolicy);
-</pre>
-
-<h4 id="Receiving_Notifications" name="Receiving_Notifications">Receiving Notifications</h4>
-
-<p>To receive notifications, you must register as a new category. You have already registered as a category to receive startup notification. This time, the category name to use is "content-policy". To add the <strong>WebLock</strong> component to this category, modify the <code>WebLockRegistration</code> callback function so that it looks like this:</p>
-
-<pre>static NS_METHOD WebLockRegistration(nsIComponentManager *aCompMgr,
- nsIFile *aPath,
- const char *registryLocation,
- const char *componentType,
- const nsModuleComponentInfo *info)
-{
- nsresult rv;
- nsCOMPtr&lt;nsIServiceManager&gt; servman = do_QueryInterface((nsISupports*)aCompMgr, &amp;rv);
- if (NS_FAILED(rv))
- return rv;
-
- nsCOMPtr&lt;nsICategoryManager&gt; catman;
- servman-&gt;GetServiceByContractID(NS_CATEGORYMANAGER_CONTRACTID,
- NS_GET_IID(nsICategoryManager),
- getter_AddRefs(catman));
- if (NS_FAILED(rv))
- return rv;
-
- char* previous = nsnull;
- rv = catman-&gt;AddCategoryEntry("xpcom-startup",
- "WebLock",
- WebLock_ContractID,
- PR_TRUE,
- PR_TRUE,
- &amp;previous);
- if (previous)
- nsMemory::Free(previous);
-
- rv = catman-&gt;AddCategoryEntry("content-policy",
- "WebLock",
- WebLock_ContractID,
- PR_TRUE,
- PR_TRUE,
- &amp;previous);
- if (previous)
- nsMemory::Free(previous);
- return rv;
-}
-</pre>
-
-<p>This code adds a new category entry under the topic "content-policy," and it calls <code>AddCategoryEntry</code> in the same way we did in <a href="cn/Creating_XPCOM_Components/Starting_WebLock#Registering_for_Notifications">Registering for Notifications</a>. A similar step is required for unregistration.</p>
-
-<h3 id="Implementing_the_nsIContentPolicy" name="Implementing_the_nsIContentPolicy">Implementing the <code>nsIContentPolicy</code></h3>
-
-<p>At this point, you can take the <strong>WebLock</strong> component and install it into a Gecko installation. When the component is loaded, Gecko calls the <code>nsIContentPolicy</code> implementation in <strong>WebLock</strong> on every page load, and this prevents pages from displaying by returning the proper value when the load method is called.</p>
-
-<p>The web locking policy that we are going to put into place is quite simple: for every load request that comes through, we will ensure that the URI is in the list of "good" URLs on the white list.</p>
-
-<div class="side-note">
-<p>If you care to extend this implementation so that the list of URLs is held remotely on a server somewhere - as might be the case when the <strong>WebLock</strong> component is used in a corporate intranet, for example - there are Networking APIs in Gecko that will support this. Or you could implement the web lock so that instead of blocking any site, the component would simply log all URLs that are loaded. In any case, the process to make the XPCOM component is the same.</p>
-</div>
-
-<p>The method that handles the check before page loading and the only method we care about in our own implementation of <code>nsIContentPolicy</code> is <code>ShouldLoad()</code>. The other method on the <code>nsIContentPolicy</code> interface is for blocking processing of specific elements in a document, but our policy is more restrictive: if the URL isn't on the white list, the entire page should be blocked. In the <strong>WebLock</strong> component, the <code>ShouldLoad</code> method looks like this:</p>
-
-<pre>NS_IMETHODIMP WebLock::ShouldLoad(PRInt32 contentType,
- nsIURI *contentLocation,
- nsISupports *ctxt,
- nsIDOMWindow *window,
- PRBool *_retval)
-</pre>
-
-<h4 id="Uniform_Resource_Locators" name="Uniform_Resource_Locators">Uniform Resource Locators</h4>
-
-<p>The method passes in an interface pointer of type <code>nsIURI</code>, which is based on the Uniform Resource Identifier, or URI. This type is defined by the <a class="external" href="http://www.w3.org/">World Wide Web Consortium</a> as:</p>
-
-<ul>
- <li>The naming scheme of the mechanism used to access the resource.</li>
- <li>The name of the machine hosting the resource.</li>
- <li>The name of the resource itself, given as a path.</li>
-</ul>
-
-<p>In this context, URIs are the strings used refer to places or things on the web. This specific form of URI is called a Uniform Resource Locator, or URL. See the <a class="external" href="http://www.w3.org/TR/REC-html40/intro/intro.html">intro to the HTML 4 specification</a> for more information about URIs and URLs.</p>
-
-<p>Gecko encapsulates these identifiers into two interfaces, <code>nsIURI</code> and <code>nsIURL</code>. You can <code>QueryInterface</code> between these two interfaces. The networking library, Necko, deals only with these interfaces when handling requests. When you want to download a file using Necko, for example, all you probably have is a string that represents the URI of the file. When you pass that string to Necko, it creates an object that implements at least the <code>nsIURI</code> interface (and perhaps other interfaces as well).</p>
-
-<p>Currently, the <strong>WebLock</strong> implementation of the <code>ShouldLoad</code> method compares the in parameter with each string in the white list. But it only should do this comparison for remote URLs, because we don't want to block the application from loading local content that it requires, like files it gets via the <code><a class="external" rel="freelink">resource://</a></code> protocol. If URIs of this kind are blocked, then Gecko will not be able to start up, so we'll restrict the content policy to the HTTP and FTP protocols.</p>
-
-<p>Instead of extracting the string <code>spec</code> out of the <code>nsIURI</code> to do a string comparison, which would require you to do the parsing yourself, you can compare the <code>nsIURI</code> objects with each other, as in the following section. This ensures that the URLs are canonical before they are compared.</p>
-
-<h4 id="Checking_the_White_List" name="Checking_the_White_List">Checking the White List</h4>
-
-<p>The <strong>WebLock</strong> implementation of the <code>ShouldLoad</code> method starts by extracting the scheme of the incoming <code>nsIURI</code>. If the scheme isn't "http", "https", or "ftp", it immediately returns true, which continues the loading process unblocked.</p>
-
-<p>These three are the only kinds of URI that <strong>Weblock</strong> will try to block. When it has one, it walks the linked list and creates a new <code>nsIURI</code> object for each string URL in the list. From each object, <code>ShouldLoad()</code> extracts the host and compares it to the URI. If they match, the component allows the load to continue by returning true. If these two strings do not match, then the component returns return false and blocks the load.</p>
-
-<div class="side-note">
-<p><span id="URI_Caching"><a id="URI_Caching"></a><strong>URI Caching</strong></span></p>
-
-<p>Caching the URI would make this method implementation much faster by avoiding the need to create and destroy so many objects. This points out an important drawback of XPCOM, which is that you cannot create an object on the stack.</p>
-
-<p>Creating this many objects is OK in a tight loop if the buffer of memory that holds the contents of the URLs is guaranteed to be valid for the lifetime of the object. But regardless of how optimized the implementation is with respect to is memory usage, a heap allocation will be made for every XPCOM object created.</p>
-</div>
-
-<p>The string comparison with the URL type "http", "https", and "ftp" looks like this:</p>
-
-<pre>nsEmbedCString scheme;
-contentLocation-&gt;GetScheme(scheme);
-
-if (strcmp("http", scheme.get())  != 0 &amp;&amp;
- strcmp("https", scheme.get()) != 0 &amp;&amp;
- strcmp("ftp", scheme.get())  != 0)
-{
- // this isn't a type of URI that we deal with.
- *_retval = PR_TRUE;
- return NS_OK;
-}
-</pre>
-
-<h4 id="Creating_nsIURI_Objects" name="Creating_nsIURI_Objects">Creating <code>nsIURI</code> Objects</h4>
-
-<p>To create an <code>nsIURI</code>, use <code>nsIIOService</code>. <code>nsIIOService</code> is the part of the networking library ("necko") that's responsible for kicking off network requests, managing protocols such as http, ftp, or file, and creating <code>nsIURI</code>s. Necko offers tremendous network functionality, but all the <strong>WebLock</strong> component needs is to create the <code>nsIURI</code> object that can be compared with the URIs on the white list.</p>
-
-<p>Use the Service Manager to acquire the <code>nsIIOService</code>. Since this object is going to be used for the life of the component, it can also be cached. A good place to get an <code>nsIIOService</code> is in the component's <code>Observe()</code> method, which already has a pointer to the <code>Service Manager</code>. The code for getting the IO service from the Service Manager looks like this:</p>
-
-<pre>// Get a pointer to the IOService
-rv = servMan-&gt;GetServiceByContractID("@mozilla.org/network/io-service;1",
- NS_GET_IID(nsIIOService),
- getter_AddRefs(mIOService));
-</pre>
-
-<p>Once you have this interface pointer, you can easily create <code>nsIURI</code> objects from a string, as in the following snippet:</p>
-
-<pre>nsCOMPtr&lt;nsIURI&gt; uri;
-nsEmbedCString urlString(node-&gt;urlString);
-mIOService-&gt;NewURI(urlString,
- nsnull,
- nsnull,
- getter_AddRefs(uri));
-</pre>
-
-<p>This code wraps a C-string with a <code>nsEmbedCString</code>, which you'll recall is a string class that many of the Gecko APIs require. See <a href="cn/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier#String_Classes_in_XPCOM">String Classes in XPCOM</a> for more information about strings.</p>
-
-<p>Once the URL string is wrapped in a <code>nsEmbedCString</code>, it can be passed to the method <code>NewURI</code>. This method expects to parse the incoming string and create an object which implements an <code>nsIURI</code> interface. The two <code>nsnull</code> parameters passed to <code>NewURI</code> are used to specify the charset of the string and any base URI to use, respectively. We are assuming here that the charset of the URL string is <a href="cn/UTF-8">UTF-8</a>, and also assuming that every URL string is absolute. See the <a class="external" href="http://www.w3.org/TR/REC-html40/intro/intro.html">intro to the HTML 4 specification</a> for more information about relative URLs.</p>
-
-<p>Here is the complete implementation of the <code>ShouldLoad()</code> method:</p>
-
-<pre>NS_IMETHODIMP
-WebLock::ShouldLoad(PRInt32 contentType,
- nsIURI *contentLocation,
- nsISupports *ctxt,
- nsIDOMWindow *window,
- PRBool *_retval)
-{
- if (!contentLocation)
- return NS_ERROR_FAILURE;
-
-
- nsEmbedCString scheme;
- contentLocation-&gt;GetScheme(scheme);
-
- if (strcmp("http", scheme.get())  != 0 &amp;&amp;
- strcmp("https", scheme.get()) != 0 &amp;&amp;
- strcmp("ftp", scheme.get())  != 0)
- {
- // this isn't a type of URI that we deal with
- *_retval = PR_TRUE;
- return NS_OK;
- }
-
- nsEmbedCString hostToLoad;
- contentLocation-&gt;GetHost(hostToLoad);
-
- // Assume failure. Do not allow this nsIURI to load.
- *_retval = PR_FALSE;
-
- nsresult rv;
-
- urlNode* node = mRootURLNode;
- PRBool match = PR_FALSE;
-
- while (node)
- {
- nsCOMPtr&lt;nsIURI&gt; uri;
- nsEmbedCString urlString(node-&gt;urlString);
- rv = mIOService-&gt;NewURI(urlString, nsnull, nsnull, getter_AddRefs(uri));
-
- // if anything bad happens, just abort
- if (NS_FAILED(rv))
- return rv;
-
- nsEmbedCString host;
- uri-&gt;GetHost(host);
-
- if (strcmp(hostToLoad.get(), host.get()) == 0)
- {
- // match found. Allow this nsIURI to load
- *_retval = PR_TRUE;
- return NS_OK;
- }
- node = node-&gt;next;
- }
- return NS_OK;
-}
-</pre>
-
-<p>At this point, all of the backend work is complete. You can of course improve this backend in many ways, but this example presents the basic creation of what is commonly referred to as a "browser helper object" like <strong>WebLock</strong>. The next chapter looks at how to tie this into the front end - specifically, how to use XPConnect to access and control this component from JavaScript in the user interface.</p>
-
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/Creating_XPCOM_Components:Starting_WebLock" style="float: left;">« 上一页</a><a href="/zh-CN/docs/Creating_XPCOM_Components:Building_the_WebLock_UI">下一页 »</a></p>
-</div> <p></p><div class="licenseblock">
-<p>Copyright (c) 2003 by Doug Turner and Ian Oeschger. This material may be distributed only subject to the terms and conditions set forth in the <a class="external" href="http://www.opencontent.org/openpub/" rel="noopener">Open Publication License</a>, v1.02 or later. Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. Distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder.</p>
-</div><p></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/index.html b/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/index.html
deleted file mode 100644
index 13fd6aff60..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/index.html
+++ /dev/null
@@ -1,278 +0,0 @@
----
-title: 创建_XPCOM_组件
-slug: Mozilla/Tech/XPCOM/Guide/Creating_components
-tags:
- - XPCOM
- - 'XPCOM:索引'
- - 所有分类
-translation_of: Mozilla/Tech/XPCOM/Guide/Creating_components
----
-<p> </p>
-
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/创建_XPCOM_组件:前言">下一页 »</a></p>
-</div><p></p>
-
-<h3 id=".E5.89.8D.E8.A8.80" name=".E5.89.8D.E8.A8.80"><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%89%8D%E8%A8%80" title="cn/创建_XPCOM_组件/前言">前言</a></h3>
-
-<dl>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%89%8D%E8%A8%80#.E8.B0.81.E8.AF.A5.E8.AF.BB.E8.BF.99.E6.9C.AC.E4.B9.A6" title="cn/创建_XPCOM_组件/前言#.E8.B0.81.E8.AF.A5.E8.AF.BB.E8.BF.99.E6.9C.AC.E4.B9.A6">谁该读这本书</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%89%8D%E8%A8%80#.E6.9C.AC.E6.95.99.E7.A8.8B.E7.9A.84.E7.BB.84.E7.BB.87" title="cn/创建_XPCOM_组件/前言#.E6.9C.AC.E6.95.99.E7.A8.8B.E7.9A.84.E7.BB.84.E7.BB.87">本教程的组织</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%89%8D%E8%A8%80#.E6.8C.89.E7.85.A7.E4.BE.8B.E5.AD.90.E6.9D.A5.E5.AD.A6.E4.B9.A0" title="cn/创建_XPCOM_组件/前言#.E6.8C.89.E7.85.A7.E4.BE.8B.E5.AD.90.E6.9D.A5.E5.AD.A6.E4.B9.A0">按照例子来学习</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%89%8D%E8%A8%80#.E6.9C.AC.E4.B9.A6.E7.9A.84.E4.BD.93.E4.BE.8B" title="cn/创建_XPCOM_组件/前言#.E6.9C.AC.E4.B9.A6.E7.9A.84.E4.BD.93.E4.BE.8B">本书的体例</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%89%8D%E8%A8%80#.E8.87.B4.E8.B0.A2" title="cn/创建_XPCOM_组件/前言#.E8.87.B4.E8.B0.A2">致谢</a></dd>
-</dl>
-
-<h3 id="XPCOM_.E7.AE.80.E4.BB.8B" name="XPCOM_.E7.AE.80.E4.BB.8B"><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/XPCOM_%E7%AE%80%E4%BB%8B" title="cn/创建_XPCOM_组件/XPCOM_简介">XPCOM 简介</a></h3>
-
-<dl>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/XPCOM_%E7%AE%80%E4%BB%8B#XPCOM_.E8.A7.A3.E5.86.B3.E6.96.B9.E6.A1.88" title="cn/创建_XPCOM_组件/XPCOM_简介#XPCOM_.E8.A7.A3.E5.86.B3.E6.96.B9.E6.A1.88">XPCOM 解决方案</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/XPCOM_%E7%AE%80%E4%BB%8B#Gecko" title="cn/创建_XPCOM_组件/XPCOM_简介#Gecko">Gecko</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/XPCOM_%E7%AE%80%E4%BB%8B#.E7.BB.84.E4.BB.B6" title="cn/创建_XPCOM_组件/XPCOM_简介#.E7.BB.84.E4.BB.B6">组件</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/XPCOM_%E7%AE%80%E4%BB%8B#.E6.8E.A5.E5.8F.A3" title="cn/创建_XPCOM_组件/XPCOM_简介#.E6.8E.A5.E5.8F.A3">接口</a>
- <dl>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/XPCOM_%E7%AE%80%E4%BB%8B#.E6.8E.A5.E5.8F.A3.E4.B8.8E.E5.B0.81.E8.A3.85" title="cn/创建_XPCOM_组件/XPCOM_简介#.E6.8E.A5.E5.8F.A3.E4.B8.8E.E5.B0.81.E8.A3.85">接口与封装</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/XPCOM_%E7%AE%80%E4%BB%8B#nsISupports_.E5.9F.BA.E6.8E.A5.E5.8F.A3" title="cn/创建_XPCOM_组件/XPCOM_简介#nsISupports_.E5.9F.BA.E6.8E.A5.E5.8F.A3"><code>nsISupports</code> 基接口</a></dd>
- </dl>
- </dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/XPCOM_%E7%AE%80%E4%BB%8B#XPCOM_.E7.9A.84ID" title="cn/创建_XPCOM_组件/XPCOM_简介#XPCOM_.E7.9A.84ID">XPCOM 的ID</a>
- <dl>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/XPCOM_%E7%AE%80%E4%BB%8B#CID" title="cn/创建_XPCOM_组件/XPCOM_简介#CID">CID</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/XPCOM_%E7%AE%80%E4%BB%8B#.E5.A5.91.E7.BA.A6_ID" title="cn/创建_XPCOM_组件/XPCOM_简介#.E5.A5.91.E7.BA.A6_ID">契约 ID</a></dd>
- </dl>
- </dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/XPCOM_%E7%AE%80%E4%BB%8B#.E7.B1.BB.E5.8E.82" title="cn/创建_XPCOM_组件/XPCOM_简介#.E7.B1.BB.E5.8E.82">类厂</a>
- <dl>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/XPCOM_%E7%AE%80%E4%BB%8B#XPIDL_.E4.B8.8E.E7.B1.BB.E5.9E.8B.E5.BA.93" title="cn/创建_XPCOM_组件/XPCOM_简介#XPIDL_.E4.B8.8E.E7.B1.BB.E5.9E.8B.E5.BA.93">XPIDL 与类型库</a></dd>
- </dl>
- </dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/XPCOM_%E7%AE%80%E4%BB%8B#XPCOM_.E6.9C.8D.E5.8A.A1" title="cn/创建_XPCOM_组件/XPCOM_简介#XPCOM_.E6.9C.8D.E5.8A.A1">XPCOM 服务</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/XPCOM_%E7%AE%80%E4%BB%8B#XPCOM_.E7.B1.BB.E5.9E.8B" title="cn/创建_XPCOM_组件/XPCOM_简介#XPCOM_.E7.B1.BB.E5.9E.8B">XPCOM 类型</a>
- <dl>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/XPCOM_%E7%AE%80%E4%BB%8B#.E6.96.B9.E6.B3.95.E7.B1.BB.E5.9E.8B" title="cn/创建_XPCOM_组件/XPCOM_简介#.E6.96.B9.E6.B3.95.E7.B1.BB.E5.9E.8B">方法类型</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/XPCOM_%E7%AE%80%E4%BB%8B#.E5.BC.95.E7.94.A8.E8.AE.A1.E6.95.B0" title="cn/创建_XPCOM_组件/XPCOM_简介#.E5.BC.95.E7.94.A8.E8.AE.A1.E6.95.B0">引用计数</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/XPCOM_%E7%AE%80%E4%BB%8B#.E7.8A.B6.E6.80.81.E7.A0.81" title="cn/创建_XPCOM_组件/XPCOM_简介#.E7.8A.B6.E6.80.81.E7.A0.81">状态码</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/XPCOM_%E7%AE%80%E4%BB%8B#.E5.8F.98.E9.87.8F.E6.98.A0.E5.B0.84" title="cn/创建_XPCOM_组件/XPCOM_简介#.E5.8F.98.E9.87.8F.E6.98.A0.E5.B0.84">变量映射</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/XPCOM_%E7%AE%80%E4%BB%8B#.E9.80.9A.E7.94.A8_XPCOM_.E9.94.99.E8.AF.AF.E7.A0.81" title="cn/创建_XPCOM_组件/XPCOM_简介#.E9.80.9A.E7.94.A8_XPCOM_.E9.94.99.E8.AF.AF.E7.A0.81">通用 XPCOM 错误码</a></dd>
- </dl>
- </dd>
-</dl>
-
-<h3 id=".E4.BD.BF.E7.94.A8_XPCOM_.E7.BB.84.E4.BB.B6" name=".E4.BD.BF.E7.94.A8_XPCOM_.E7.BB.84.E4.BB.B6"><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E4%BD%BF%E7%94%A8_XPCOM_%E7%BB%84%E4%BB%B6" title="cn/创建_XPCOM_组件/使用_XPCOM_组件">使用 XPCOM 组件</a></h3>
-
-<dl>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E4%BD%BF%E7%94%A8_XPCOM_%E7%BB%84%E4%BB%B6#.E7.BB.84.E4.BB.B6.E7.9A.84.E4.BE.8B.E5.AD.90" title="cn/创建_XPCOM_组件/使用_XPCOM_组件#.E7.BB.84.E4.BB.B6.E7.9A.84.E4.BE.8B.E5.AD.90">组件的例子</a>
-
- <dl>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E4%BD%BF%E7%94%A8_XPCOM_%E7%BB%84%E4%BB%B6#Cookie_.E7.AE.A1.E7.90.86.E5.99.A8" title="cn/创建_XPCOM_组件/使用_XPCOM_组件#Cookie_.E7.AE.A1.E7.90.86.E5.99.A8">Cookie 管理器</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E4%BD%BF%E7%94%A8_XPCOM_%E7%BB%84%E4%BB%B6#WebBrowserFind_.E7.BB.84.E4.BB.B6" title="cn/创建_XPCOM_组件/使用_XPCOM_组件#WebBrowserFind_.E7.BB.84.E4.BB.B6"><strong>WebBrowserFind</strong> 组件</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E4%BD%BF%E7%94%A8_XPCOM_%E7%BB%84%E4%BB%B6#WebLock_.E7.BB.84.E4.BB.B6" title="cn/创建_XPCOM_组件/使用_XPCOM_组件#WebLock_.E7.BB.84.E4.BB.B6"><strong>WebLock</strong> 组件</a></dd>
- </dl>
- </dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E4%BD%BF%E7%94%A8_XPCOM_%E7%BB%84%E4%BB%B6#Mozilla_.E4.B8.AD.E4.BD.BF.E7.94.A8.E7.9A.84.E7.BB.84.E4.BB.B6" title="cn/创建_XPCOM_组件/使用_XPCOM_组件#Mozilla_.E4.B8.AD.E4.BD.BF.E7.94.A8.E7.9A.84.E7.BB.84.E4.BB.B6">Mozilla 中使用的组件</a>
- <dl>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E4%BD%BF%E7%94%A8_XPCOM_%E7%BB%84%E4%BB%B6#.E6.9F.A5.E6.89.BE_Mozilla_.E7.BB.84.E4.BB.B6" title="cn/创建_XPCOM_组件/使用_XPCOM_组件#.E6.9F.A5.E6.89.BE_Mozilla_.E7.BB.84.E4.BB.B6">查找 Mozilla 组件</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E4%BD%BF%E7%94%A8_XPCOM_%E7%BB%84%E4%BB%B6#.E5.9C.A8_Cpp_.E4.BB.A3.E7.A0.81.E4.B8.AD.E4.BD.BF.E7.94.A8_XPCOM_.E7.BB.84.E4.BB.B6" title="cn/创建_XPCOM_组件/使用_XPCOM_组件#.E5.9C.A8_Cpp_.E4.BB.A3.E7.A0.81.E4.B8.AD.E4.BD.BF.E7.94.A8_XPCOM_.E7.BB.84.E4.BB.B6">在 Cpp 代码中使用 XPCOM 组件</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E4%BD%BF%E7%94%A8_XPCOM_%E7%BB%84%E4%BB%B6#XPConnect:_.E5.9C.A8.E8.84.9A.E6.9C.AC.E4.B8.AD.E4.BD.BF.E7.94.A8_XPCOM_.E7.BB.84.E4.BB.B6" title="cn/创建_XPCOM_组件/使用_XPCOM_组件#XPConnect:_.E5.9C.A8.E8.84.9A.E6.9C.AC.E4.B8.AD.E4.BD.BF.E7.94.A8_XPCOM_.E7.BB.84.E4.BB.B6">XPConnect: 在脚本中使用 XPCOM 组件</a></dd>
- </dl>
- </dd>
-</dl>
-
-<h3 id=".E7.BB.84.E4.BB.B6.E5.86.85.E5.B9.95" name=".E7.BB.84.E4.BB.B6.E5.86.85.E5.B9.95"><a href="/cn/Creating_XPCOM_Components/Component_Internals" title="cn/Creating_XPCOM_Components/Component_Internals">组件内幕</a></h3>
-
-<dl>
- <dd><a href="/cn/Creating_XPCOM_Components/Component_Internals#.E7.94.A8Cpp.E4.B9.A6.E5.86.99.E7.BB.84.E4.BB.B6" title="cn/Creating_XPCOM_Components/Component_Internals#.E7.94.A8Cpp.E4.B9.A6.E5.86.99.E7.BB.84.E4.BB.B6">用Cpp书写组件</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Component_Internals#XPCOM.E5.88.9D.E5.A7.8B.E5.8C.96" title="cn/Creating_XPCOM_Components/Component_Internals#XPCOM.E5.88.9D.E5.A7.8B.E5.8C.96">XPCOM初始化</a>
- <dl>
- <dd><a href="/cn/Creating_XPCOM_Components/Component_Internals#XPCOM.E6.B3.A8.E5.86.8C.E6.8F.8F.E8.BF.B0" title="cn/Creating_XPCOM_Components/Component_Internals#XPCOM.E6.B3.A8.E5.86.8C.E6.8F.8F.E8.BF.B0">XPCOM注册描述</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Component_Internals#XPCOM.E6.B3.A8.E5.86.8C.E7.9A.84.E6.96.B9.E6.B3.95" title="cn/Creating_XPCOM_Components/Component_Internals#XPCOM.E6.B3.A8.E5.86.8C.E7.9A.84.E6.96.B9.E6.B3.95">XPCOM注册的方法</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Component_Internals#.E8.87.AA.E5.8A.A8.E6.B3.A8.E5.86.8C" title="cn/Creating_XPCOM_Components/Component_Internals#.E8.87.AA.E5.8A.A8.E6.B3.A8.E5.86.8C">自动注册</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Component_Internals#The_Shutdown_Process" title="cn/Creating_XPCOM_Components/Component_Internals#The_Shutdown_Process">The Shutdown Process</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Component_Internals#XPCOM.E7.BB.84.E4.BB.B6.E5.BA.93.E7.9A.84.E4.B8.89.E4.B8.AA.E9.83.A8.E5.88.86" title="cn/Creating_XPCOM_Components/Component_Internals#XPCOM.E7.BB.84.E4.BB.B6.E5.BA.93.E7.9A.84.E4.B8.89.E4.B8.AA.E9.83.A8.E5.88.86">XPCOM组件库的三个部分</a></dd>
- </dl>
- </dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Component_Internals#XPCOM_Glue" title="cn/Creating_XPCOM_Components/Component_Internals#XPCOM_Glue">XPCOM Glue</a>
- <dl>
- <dd><a href="/cn/Creating_XPCOM_Components/Component_Internals#The_Glue_Library" title="cn/Creating_XPCOM_Components/Component_Internals#The_Glue_Library">The Glue Library</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Component_Internals#XPCOM_String_Classes" title="cn/Creating_XPCOM_Components/Component_Internals#XPCOM_String_Classes">XPCOM String Classes</a></dd>
- </dl>
- </dd>
-</dl>
-
-<h3 id=".E5.BB.BA.E7.AB.8B.E7.BB.84.E4.BB.B6.E4.BB.A3.E7.A0.81" name=".E5.BB.BA.E7.AB.8B.E7.BB.84.E4.BB.B6.E4.BB.A3.E7.A0.81"><a href="/cn/Creating_XPCOM_Components/Creating_the_Component_Code" title="cn/Creating_XPCOM_Components/Creating_the_Component_Code">建立组件代码</a></h3>
-
-<dl>
- <dd><a href="/cn/Creating_XPCOM_Components/Creating_the_Component_Code#.E6.88.91.E4.BB.AC.E5.B0.86.E5.81.9A.E4.BB.80.E4.B9.88" title="cn/Creating_XPCOM_Components/Creating_the_Component_Code#.E6.88.91.E4.BB.AC.E5.B0.86.E5.81.9A.E4.BB.80.E4.B9.88">我们将做什么</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Creating_the_Component_Code#.E7.BB.84.E4.BB.B6.E6.B3.A8.E5.86.8C" title="cn/Creating_XPCOM_Components/Creating_the_Component_Code#.E7.BB.84.E4.BB.B6.E6.B3.A8.E5.86.8C">组件注册</a>
- <dl>
- <dd><a href="/cn/Creating_XPCOM_Components/Creating_the_Component_Code#The_regxpcom_Program" title="cn/Creating_XPCOM_Components/Creating_the_Component_Code#The_regxpcom_Program">The <code>regxpcom</code> Program</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Creating_the_Component_Code#.E5.85.B6.E4.BB.96.E7.9A.84.E6.B3.A8.E5.86.8C.E9.80.94.E5.BE.84" title="cn/Creating_XPCOM_Components/Creating_the_Component_Code#.E5.85.B6.E4.BB.96.E7.9A.84.E6.B3.A8.E5.86.8C.E9.80.94.E5.BE.84">其他的注册途径</a></dd>
- </dl>
- </dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Creating_the_Component_Code#.E6.A6.82.E8.A7.88WebLock_Module_Source" title="cn/Creating_XPCOM_Components/Creating_the_Component_Code#.E6.A6.82.E8.A7.88WebLock_Module_Source">概览<strong>WebLock</strong> Module Source</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Creating_the_Component_Code#.E6.B7.B1.E5.BA.A6.E6.8C.96.E6.8E.98:_.E9.9C.80.E8.A6.81.E7.9A.84Includes.E5.92.8C.E5.B8.B8.E9.87.8F" title="cn/Creating_XPCOM_Components/Creating_the_Component_Code#.E6.B7.B1.E5.BA.A6.E6.8C.96.E6.8E.98:_.E9.9C.80.E8.A6.81.E7.9A.84Includes.E5.92.8C.E5.B8.B8.E9.87.8F">深度挖掘: 需要的Includes和常量</a>
- <dl>
- <dd><a href="/cn/Creating_XPCOM_Components/Creating_the_Component_Code#XPCOM.E4.B8.AD.E7.9A.84.E6.A0.87.E8.AF.86.E7.AC.A6" title="cn/Creating_XPCOM_Components/Creating_the_Component_Code#XPCOM.E4.B8.AD.E7.9A.84.E6.A0.87.E8.AF.86.E7.AC.A6">XPCOM中的标识符</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Creating_the_Component_Code#.E6.B3.A8.E5.86.8C.E8.BF.87.E7.A8.8B.E7.9A.84.E4.BB.A3.E7.A0.81" title="cn/Creating_XPCOM_Components/Creating_the_Component_Code#.E6.B3.A8.E5.86.8C.E8.BF.87.E7.A8.8B.E7.9A.84.E4.BB.A3.E7.A0.81">注册过程的代码</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Creating_the_Component_Code#.E6.B3.A8.E5.86.8C.E7.94.A8.E7.9A.84.E6.96.B9.E6.B3.95" title="cn/Creating_XPCOM_Components/Creating_the_Component_Code#.E6.B3.A8.E5.86.8C.E7.94.A8.E7.9A.84.E6.96.B9.E6.B3.95">注册用的方法</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Creating_the_Component_Code#.E5.BB.BA.E7.AB.8B.E4.BD.A0.E7.9A.84.E7.BB.84.E4.BB.B6.E7.9A.84.E6.8E.A5.E5.8F.A3" title="cn/Creating_XPCOM_Components/Creating_the_Component_Code#.E5.BB.BA.E7.AB.8B.E4.BD.A0.E7.9A.84.E7.BB.84.E4.BB.B6.E7.9A.84.E6.8E.A5.E5.8F.A3">建立你的组件的接口</a></dd>
- </dl>
- </dd>
- <dd><a href="/cn/Creating_XPCOM_Components/%E5%BB%BA%E7%AB%8B%E7%BB%84%E4%BB%B6%E4%BB%A3%E7%A0%81#webLock1.cpp" title="cn/Creating_XPCOM_Components/建立组件代码#webLock1.cpp"><code>webLock1.cpp</code></a></dd>
-</dl>
-
-<h3 id=".E4.BD.BF.E7.94.A8XPCOM.E5.B7.A5.E5.85.B7.E7.B1.BB.E8.AE.A9.E4.BA.8B.E6.83.85.E5.8F.98.E5.BE.97.E7.AE.80.E5.8D.95" name=".E4.BD.BF.E7.94.A8XPCOM.E5.B7.A5.E5.85.B7.E7.B1.BB.E8.AE.A9.E4.BA.8B.E6.83.85.E5.8F.98.E5.BE.97.E7.AE.80.E5.8D.95"><a href="/cn/%E5%88%9B%E5%BB%BAXPCOM%E7%BB%84%E4%BB%B6/%E4%BD%BF%E7%94%A8XPCOM%E5%B7%A5%E5%85%B7%E7%B1%BB%E8%AE%A9%E4%BA%8B%E6%83%85%E5%8F%98%E5%BE%97%E7%AE%80%E5%8D%95" title="cn/创建XPCOM组件/使用XPCOM工具类让事情变得简单">使用XPCOM工具类让事情变得简单</a></h3>
-
-<dl>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BAXPCOM%E7%BB%84%E4%BB%B6/%E4%BD%BF%E7%94%A8XPCOM%E5%B7%A5%E5%85%B7%E7%B1%BB%E8%AE%A9%E4%BA%8B%E6%83%85%E5%8F%98%E5%BE%97%E7%AE%80%E5%8D%95#XPCOM_.E5.AE.8F" title="cn/创建XPCOM组件/使用XPCOM工具类让事情变得简单#XPCOM_.E5.AE.8F">XPCOM 宏</a>
-
- <dl>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BAXPCOM%E7%BB%84%E4%BB%B6/%E4%BD%BF%E7%94%A8XPCOM%E5%B7%A5%E5%85%B7%E7%B1%BB%E8%AE%A9%E4%BA%8B%E6%83%85%E5%8F%98%E5%BE%97%E7%AE%80%E5%8D%95#.E9.80.9A.E7.94.A8XPCOM.E6.A8.A1.E5.9D.97.E5.AE.8F" title="cn/创建XPCOM组件/使用XPCOM工具类让事情变得简单#.E9.80.9A.E7.94.A8XPCOM.E6.A8.A1.E5.9D.97.E5.AE.8F">通用XPCOM模块宏</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BAXPCOM%E7%BB%84%E4%BB%B6/%E4%BD%BF%E7%94%A8XPCOM%E5%B7%A5%E5%85%B7%E7%B1%BB%E8%AE%A9%E4%BA%8B%E6%83%85%E5%8F%98%E5%BE%97%E7%AE%80%E5%8D%95#.E5.9F.BA.E6.9C.AC.E5.AE.9E.E7.8E.B0.E5.AE.8F" title="cn/创建XPCOM组件/使用XPCOM工具类让事情变得简单#.E5.9F.BA.E6.9C.AC.E5.AE.9E.E7.8E.B0.E5.AE.8F">基本实现宏</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BAXPCOM%E7%BB%84%E4%BB%B6/%E4%BD%BF%E7%94%A8XPCOM%E5%B7%A5%E5%85%B7%E7%B1%BB%E8%AE%A9%E4%BA%8B%E6%83%85%E5%8F%98%E5%BE%97%E7%AE%80%E5%8D%95#.E5.A3.B0.E6.98.8E.E5.AE.8F" title="cn/创建XPCOM组件/使用XPCOM工具类让事情变得简单#.E5.A3.B0.E6.98.8E.E5.AE.8F">声明宏</a></dd>
- </dl>
- </dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BAXPCOM%E7%BB%84%E4%BB%B6/%E4%BD%BF%E7%94%A8XPCOM%E5%B7%A5%E5%85%B7%E7%B1%BB%E8%AE%A9%E4%BA%8B%E6%83%85%E5%8F%98%E5%BE%97%E7%AE%80%E5%8D%95#webLock2.cpp" title="cn/创建XPCOM组件/使用XPCOM工具类让事情变得简单#webLock2.cpp"><code>webLock2.cpp</code></a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BAXPCOM%E7%BB%84%E4%BB%B6/%E4%BD%BF%E7%94%A8XPCOM%E5%B7%A5%E5%85%B7%E7%B1%BB%E8%AE%A9%E4%BA%8B%E6%83%85%E5%8F%98%E5%BE%97%E7%AE%80%E5%8D%95#XPCOM.E4.B8.AD.E7.9A.84.E5.AD.97.E7.AC.A6.E4.B8.B2.E7.B1.BB" title="cn/创建XPCOM组件/使用XPCOM工具类让事情变得简单#XPCOM.E4.B8.AD.E7.9A.84.E5.AD.97.E7.AC.A6.E4.B8.B2.E7.B1.BB">XPCOM中的字符串类</a>
- <dl>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BAXPCOM%E7%BB%84%E4%BB%B6/%E4%BD%BF%E7%94%A8XPCOM%E5%B7%A5%E5%85%B7%E7%B1%BB%E8%AE%A9%E4%BA%8B%E6%83%85%E5%8F%98%E5%BE%97%E7%AE%80%E5%8D%95#.E4.BD.BF.E7.94.A8.E5.AD.97.E7.AC.A6.E4.B8.B2" title="cn/创建XPCOM组件/使用XPCOM工具类让事情变得简单#.E4.BD.BF.E7.94.A8.E5.AD.97.E7.AC.A6.E4.B8.B2">使用字符串</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BAXPCOM%E7%BB%84%E4%BB%B6/%E4%BD%BF%E7%94%A8XPCOM%E5%B7%A5%E5%85%B7%E7%B1%BB%E8%AE%A9%E4%BA%8B%E6%83%85%E5%8F%98%E5%BE%97%E7%AE%80%E5%8D%95#nsEmbedString_.E5.92.8C_nsEmbedCString" title="cn/创建XPCOM组件/使用XPCOM工具类让事情变得简单#nsEmbedString_.E5.92.8C_nsEmbedCString"><code>nsEmbedString</code> 和 <code>nsEmbedCString</code></a></dd>
- </dl>
- </dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BAXPCOM%E7%BB%84%E4%BB%B6/%E4%BD%BF%E7%94%A8XPCOM%E5%B7%A5%E5%85%B7%E7%B1%BB%E8%AE%A9%E4%BA%8B%E6%83%85%E5%8F%98%E5%BE%97%E7%AE%80%E5%8D%95#.E6.99.BA.E8.83.BD.E6.8C.87.E9.92.88" title="cn/创建XPCOM组件/使用XPCOM工具类让事情变得简单#.E6.99.BA.E8.83.BD.E6.8C.87.E9.92.88">智能指针</a></dd>
-</dl>
-
-<h3 id=".E5.BC.80.E5.A7.8BWebLock" name=".E5.BC.80.E5.A7.8BWebLock"><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock" title="cn/创建_XPCOM_组件/开始WebLock">开始<strong>WebLock</strong></a></h3>
-
-<dl>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#.E5.90.AF.E5.8A.A8.E6.97.B6.E8.A2.AB.E8.B0.83.E7.94.A8" title="cn/创建_XPCOM_组件/开始WebLock#.E5.90.AF.E5.8A.A8.E6.97.B6.E8.A2.AB.E8.B0.83.E7.94.A8">启动时被调用</a>
-
- <dl>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#.E6.B3.A8.E5.86.8C.E5.88.B0.E6.B6.88.E6.81.AF" title="cn/创建_XPCOM_组件/开始WebLock#.E6.B3.A8.E5.86.8C.E5.88.B0.E6.B6.88.E6.81.AF">注册到消息</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#.E8.AE.BF.E9.97.AECategory_Manager" title="cn/创建_XPCOM_组件/开始WebLock#.E8.AE.BF.E9.97.AECategory_Manager">访问Category Manager</a></dd>
- </dl>
- </dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#.E6.8F.90.E4.BE.9BWebLock.E8.AE.BF.E9.97.AE" title="cn/创建_XPCOM_组件/开始WebLock#.E6.8F.90.E4.BE.9BWebLock.E8.AE.BF.E9.97.AE">提供<strong>WebLock</strong>访问</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#.E5.BB.BA.E7.AB.8BWebLock.E7.BC.96.E7.A8.8B.E6.8E.A5.E5.8F.A3" title="cn/创建_XPCOM_组件/开始WebLock#.E5.BB.BA.E7.AB.8BWebLock.E7.BC.96.E7.A8.8B.E6.8E.A5.E5.8F.A3">建立<strong>WebLock</strong>编程接口</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#.E5.9C.A8XPIDL.E4.B8.AD.E5.AE.9A.E4.B9.89WebLock.E6.8E.A5.E5.8F.A3" title="cn/创建_XPCOM_组件/开始WebLock#.E5.9C.A8XPIDL.E4.B8.AD.E5.AE.9A.E4.B9.89WebLock.E6.8E.A5.E5.8F.A3">在XPIDL中定义<strong>WebLock</strong>接口</a>
- <dl>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#XPIDL.E4.B9.A6.E5.86.99.E6.A0.BC.E5.BC.8F" title="cn/创建_XPCOM_组件/开始WebLock#XPIDL.E4.B9.A6.E5.86.99.E6.A0.BC.E5.BC.8F">XPIDL书写格式</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#.E8.84.9A.E6.9C.AC.E5.8C.96.E6.8E.A5.E5.8F.A3" title="cn/创建_XPCOM_组件/开始WebLock#.E8.84.9A.E6.9C.AC.E5.8C.96.E6.8E.A5.E5.8F.A3">脚本化接口</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#.E5.AE.9E.E7.8E.B0nsISupports" title="cn/创建_XPCOM_组件/开始WebLock#.E5.AE.9E.E7.8E.B0nsISupports">实现<code>nsISupports</code></a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#Web_Locking_.E6.8E.A5.E5.8F.A3" title="cn/创建_XPCOM_组件/开始WebLock#Web_Locking_.E6.8E.A5.E5.8F.A3">Web Locking 接口</a></dd>
- </dl>
- </dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#.E5.AE.9E.E7.8E.B0WebLock" title="cn/创建_XPCOM_组件/开始WebLock#.E5.AE.9E.E7.8E.B0WebLock">实现<strong>WebLock</strong></a>
- <dl>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#.E5.A3.B0.E6.98.8E.E5.AE.8F" title="cn/创建_XPCOM_组件/开始WebLock#.E5.A3.B0.E6.98.8E.E5.AE.8F">声明宏</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#.E5.9C.A8XPCOM.E4.B8.AD.E8.A1.A8.E8.BE.BE.E8.BF.94.E5.9B.9E.E5.80.BC" title="cn/创建_XPCOM_组件/开始WebLock#.E5.9C.A8XPCOM.E4.B8.AD.E8.A1.A8.E8.BE.BE.E8.BF.94.E5.9B.9E.E5.80.BC">在XPCOM中表达返回值</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#XPIDL.E4.BB.A3.E7.A0.81.E7.94.9F.E6.88.90" title="cn/创建_XPCOM_组件/开始WebLock#XPIDL.E4.BB.A3.E7.A0.81.E7.94.9F.E6.88.90">XPIDL代码生成</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#.E4.BB.8E.E5.AE.A2.E6.88.B7.E7.AB.AF.E8.8E.B7.E5.8F.96WebLock_Service" title="cn/创建_XPCOM_组件/开始WebLock#.E4.BB.8E.E5.AE.A2.E6.88.B7.E7.AB.AF.E8.8E.B7.E5.8F.96WebLock_Service">从客户端获取WebLock Service</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#.E5.AE.9E.E7.8E.B0iWebLock.E6.8E.A5.E5.8F.A3" title="cn/创建_XPCOM_组件/开始WebLock#.E5.AE.9E.E7.8E.B0iWebLock.E6.8E.A5.E5.8F.A3">实现<code>iWebLock</code>接口</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#The_Directory_Service" title="cn/创建_XPCOM_组件/开始WebLock#The_Directory_Service">The Directory Service</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#.E7.94.A8nsIFile.E6.94.B9.E5.8F.98.E8.B7.AF.E5.BE.84" title="cn/创建_XPCOM_组件/开始WebLock#.E7.94.A8nsIFile.E6.94.B9.E5.8F.98.E8.B7.AF.E5.BE.84">用<code>nsIFile</code>改变路径</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#.E7.94.A8nsIFile.E6.93.8D.E4.BD.9C.E6.96.87.E4.BB.B6" title="cn/创建_XPCOM_组件/开始WebLock#.E7.94.A8nsIFile.E6.93.8D.E4.BD.9C.E6.96.87.E4.BB.B6">用<code>nsIFile</code>操作文件</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#.E7.94.A8nsILocalFile.E8.AF.BB.E5.8F.96.E6.95.B0.E6.8D.AE" title="cn/创建_XPCOM_组件/开始WebLock#.E7.94.A8nsILocalFile.E8.AF.BB.E5.8F.96.E6.95.B0.E6.8D.AE">用<code>nsILocalFile</code>读取数据</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#.E5.A4.84.E7.90.86White_List_Data" title="cn/创建_XPCOM_组件/开始WebLock#.E5.A4.84.E7.90.86White_List_Data">处理White List Data</a></dd>
- </dl>
- </dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#iWebLock.E6.96.B9.E6.B3.95.E5.88.97.E4.B8.BE" title="cn/创建_XPCOM_组件/开始WebLock#iWebLock.E6.96.B9.E6.B3.95.E5.88.97.E4.B8.BE"><code>iWebLock</code>方法列举</a>
- <dl>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#Lock_.E5.92.8C_Unlock" title="cn/创建_XPCOM_组件/开始WebLock#Lock_.E5.92.8C_Unlock"><code>Lock</code> and <code>Unlock</code></a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#AddSite" title="cn/创建_XPCOM_组件/开始WebLock#AddSite"><code>AddSite</code></a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#RemoveSite" title="cn/创建_XPCOM_组件/开始WebLock#RemoveSite"><code>RemoveSite</code></a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#SetSites" title="cn/创建_XPCOM_组件/开始WebLock#SetSites"><code>SetSites</code></a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#GetNext" title="cn/创建_XPCOM_组件/开始WebLock#GetNext"><code>GetNext</code></a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#GetSites" title="cn/创建_XPCOM_组件/开始WebLock#GetSites"><code>GetSites</code></a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BC%80%E5%A7%8BWebLock#HasMoreElements" title="cn/创建_XPCOM_组件/开始WebLock#HasMoreElements"><code>HasMoreElements</code></a></dd>
- </dl>
- </dd>
-</dl>
-
-<h3 id="Finishing_the_Component" name="Finishing_the_Component"><a href="/cn/Creating_XPCOM_Components/Finishing_the_Component" title="cn/Creating_XPCOM_Components/Finishing_the_Component">Finishing the Component</a></h3>
-
-<dl>
- <dd><a href="/cn/Creating_XPCOM_Components/Finishing_the_Component#Using_Frozen_Interfaces" title="cn/Creating_XPCOM_Components/Finishing_the_Component#Using_Frozen_Interfaces">Using Frozen Interfaces</a>
-
- <dl>
- <dd><a href="/cn/Creating_XPCOM_Components/Finishing_the_Component#Copying_Interfaces_Into_Your_Build_Environment" title="cn/Creating_XPCOM_Components/Finishing_the_Component#Copying_Interfaces_Into_Your_Build_Environment">Copying Interfaces Into Your Build Environment</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Finishing_the_Component#Implementing_the_nsIContentPolicy_Interface" title="cn/Creating_XPCOM_Components/Finishing_the_Component#Implementing_the_nsIContentPolicy_Interface">Implementing the <code>nsIContentPolicy</code> Interface</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Finishing_the_Component#Receiving_Notifications" title="cn/Creating_XPCOM_Components/Finishing_the_Component#Receiving_Notifications">Receiving Notifications</a></dd>
- </dl>
- </dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Finishing_the_Component#Implementing_the_nsIContentPolicy" title="cn/Creating_XPCOM_Components/Finishing_the_Component#Implementing_the_nsIContentPolicy">Implementing the <code>nsIContentPolicy</code></a>
- <dl>
- <dd><a href="/cn/Creating_XPCOM_Components/Finishing_the_Component#Uniform_Resource_Locators" title="cn/Creating_XPCOM_Components/Finishing_the_Component#Uniform_Resource_Locators">Uniform Resource Locators</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Finishing_the_Component#Checking_the_White_List" title="cn/Creating_XPCOM_Components/Finishing_the_Component#Checking_the_White_List">Checking the White List</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Finishing_the_Component#Creating_nsIURI_Objects" title="cn/Creating_XPCOM_Components/Finishing_the_Component#Creating_nsIURI_Objects">Creating <code>nsIURI</code> Objects</a></dd>
- </dl>
- </dd>
-</dl>
-
-<h3 id="Building_the_WebLock_UI" name="Building_the_WebLock_UI"><a href="/cn/Creating_XPCOM_Components/Building_the_WebLock_UI" title="cn/Creating_XPCOM_Components/Building_the_WebLock_UI">Building the <strong>WebLock</strong> UI</a></h3>
-
-<dl>
- <dd><a href="/cn/Creating_XPCOM_Components/Building_the_WebLock_UI#User_Interface_Package_List" title="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#User_Interface_Package_List">User Interface Package List</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Building_the_WebLock_UI#Client_Code_Overview" title="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#Client_Code_Overview">Client Code Overview</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Building_the_WebLock_UI#XUL" title="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#XUL">XUL</a>
- <dl>
- <dd><a href="/cn/Creating_XPCOM_Components/Building_the_WebLock_UI#The_XUL_Document" title="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#The_XUL_Document">The XUL Document</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Building_the_WebLock_UI#The_Locking_UI" title="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#The_Locking_UI">The Locking UI</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Building_the_WebLock_UI#Site_Adding_UI" title="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#Site_Adding_UI">Site Adding UI</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Building_the_WebLock_UI#weblock.xul" title="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#weblock.xul"><code>weblock.xul</code></a></dd>
- </dl>
- </dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Building_the_WebLock_UI#Overlaying_New_User_Interface_Into_Mozilla" title="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#Overlaying_New_User_Interface_Into_Mozilla">Overlaying New User Interface Into Mozilla</a>
- <dl>
- <dd><a href="/cn/Creating_XPCOM_Components/Building_the_WebLock_UI#webLockOverlay.xul" title="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#webLockOverlay.xul"><code>webLockOverlay.xul</code></a></dd>
- </dl>
- </dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Building_the_WebLock_UI#Other_Resources" title="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#Other_Resources">Other Resources</a>
- <dl>
- <dd><a href="/cn/Creating_XPCOM_Components/Building_the_WebLock_UI#weblock.css" title="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#weblock.css"><code>weblock.css</code></a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Building_the_WebLock_UI#Image_Resources" title="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#Image_Resources">Image Resources</a></dd>
- </dl>
- </dd>
-</dl>
-
-<h3 id=".E6.89.93.E5.8C.85_WebLock" name=".E6.89.93.E5.8C.85_WebLock"><a href="/cn/Creating_XPCOM_Components/Packaging_WebLock" title="cn/Creating_XPCOM_Components/Packaging_WebLock">打包 WebLock</a></h3>
-
-<dl>
- <dd><a href="/cn/Creating_XPCOM_Components/Packaging_WebLock#Component_Installation_Overview" title="cn/Creating_XPCOM_Components/Packaging_WebLock#Component_Installation_Overview">组件安装预览</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Packaging_WebLock#Archiving_Resources" title="cn/Creating_XPCOM_Components/Packaging_WebLock#Archiving_Resources">资源归档</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Packaging_WebLock#The_WebLock_Installation_Script" title="cn/Creating_XPCOM_Components/Packaging_WebLock#The_WebLock_Installation_Script"><strong>WebLock</strong> 安装脚本</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Packaging_WebLock#The_WebLock_Trigger_Script" title="cn/Creating_XPCOM_Components/Packaging_WebLock#The_WebLock_Trigger_Script"><strong>WebLock</strong> 跟踪脚本</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Packaging_WebLock#Distributing_Your_Component" title="cn/Creating_XPCOM_Components/Packaging_WebLock#Distributing_Your_Component">分发你的组件</a></dd>
-</dl>
-
-<h3 id=".E9.99.84.E5.BD.95_A_-_.E5.BB.BA.E7.AB.8B_Gecko_SDK" name=".E9.99.84.E5.BD.95_A_-_.E5.BB.BA.E7.AB.8B_Gecko_SDK"><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BB%BA%E7%AB%8B_Gecko_SDK" title="cn/创建_XPCOM_组件/建立_Gecko_SDK">附录 A - 建立 Gecko SDK</a></h3>
-
-<dl>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BB%BA%E7%AB%8B_Gecko_SDK#.E4.B8.8B.E8.BD.BD.E5.92.8C.E5.BB.BA.E7.AB.8B_SDK" title="cn/创建_XPCOM_组件/建立_Gecko_SDK#.E4.B8.8B.E8.BD.BD.E5.92.8C.E5.BB.BA.E7.AB.8B_SDK">下载和建立 SDK</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BB%BA%E7%AB%8B_Gecko_SDK#.E7.BC.96.E8.AF.91.E4.B8.80.E4.B8.AA_Microsoft_Visual_Cpp_.E5.B7.A5.E7.A8.8B" title="cn/创建_XPCOM_组件/建立_Gecko_SDK#.E7.BC.96.E8.AF.91.E4.B8.80.E4.B8.AA_Microsoft_Visual_Cpp_.E5.B7.A5.E7.A8.8B">编译一个 Microsoft Visual Cpp 工程</a>
- <dl>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BB%BA%E7%AB%8B_Gecko_SDK#.E5.88.9B.E5.BB.BA.E4.B8.80.E4.B8.AA.E6.96.B0.E7.9A.84.E5.B7.A5.E7.A8.8B" title="cn/创建_XPCOM_组件/建立_Gecko_SDK#.E5.88.9B.E5.BB.BA.E4.B8.80.E4.B8.AA.E6.96.B0.E7.9A.84.E5.B7.A5.E7.A8.8B">创建一个新的工程</a></dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BB%BA%E7%AB%8B_Gecko_SDK#.E6.8A.8A_Gecko_SDK_.E6.B7.BB.E5.8A.A0.E5.88.B0.E5.B7.A5.E7.A8.8B.E8.AE.BE.E7.BD.AE" title="cn/创建_XPCOM_组件/建立_Gecko_SDK#.E6.8A.8A_Gecko_SDK_.E6.B7.BB.E5.8A.A0.E5.88.B0.E5.B7.A5.E7.A8.8B.E8.AE.BE.E7.BD.AE">把 Gecko SDK 添加到工程设置</a></dd>
- </dl>
- </dd>
- <dd><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BB%BA%E7%AB%8B_Gecko_SDK#Unix_.E4.B8.8B.E7.9A.84.E4.B8.80.E4.B8.AA_Makefile" title="cn/创建_XPCOM_组件/建立_Gecko_SDK#Unix_.E4.B8.8B.E7.9A.84.E4.B8.80.E4.B8.AA_Makefile">Unix 下的一个 Makefile</a></dd>
-</dl>
-
-<h3 id=".E9.99.84.E5.BD.95B_-_.E8.B5.84.E6.BA.90" name=".E9.99.84.E5.BD.95B_-_.E8.B5.84.E6.BA.90"><a href="/cn/Creating_XPCOM_Components/Resources" title="cn/Creating_XPCOM_Components/Resources">附录B - 资源</a></h3>
-
-<dl>
- <dd><a href="/cn/Creating_XPCOM_Components/Resources#WebLock_Resources" title="cn/Creating_XPCOM_Components/Resources#WebLock_Resources">WebLock 资源</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Resources#Gecko_Resources" title="cn/Creating_XPCOM_Components/Resources#Gecko_Resources">Gecko 资源</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Resources#XPCOM_Resources" title="cn/Creating_XPCOM_Components/Resources#XPCOM_Resources">XPCOM 资源</a></dd>
- <dd><a href="/cn/Creating_XPCOM_Components/Resources#General_Development_Resources" title="cn/Creating_XPCOM_Components/Resources#General_Development_Resources">General Development 资源</a></dd>
-</dl>
-
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/创建_XPCOM_组件:前言">下一页 »</a></p>
-</div> <p></p><div class="licenseblock">
-<p>Copyright (c) 2003 by Doug Turner and Ian Oeschger. This material may be distributed only subject to the terms and conditions set forth in the <a class="external" href="http://www.opencontent.org/openpub/" rel="noopener">Open Publication License</a>, v1.02 or later. Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. Distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder.</p>
-</div><p></p>
-
-<p> </p>
-
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/packaging_weblock/index.html b/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/packaging_weblock/index.html
deleted file mode 100644
index 3a7744ec03..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/packaging_weblock/index.html
+++ /dev/null
@@ -1,136 +0,0 @@
----
-title: Packaging WebLock
-slug: Mozilla/Tech/XPCOM/Guide/Creating_components/Packaging_WebLock
-tags:
- - XPCOM
- - 所有分类
-translation_of: Mozilla/Tech/XPCOM/Guide/Creating_components/Packaging_WebLock
----
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/Creating_XPCOM_Components:Building_the_WebLock_UI" style="float: left;">« 上一页</a><a href="/zh-CN/docs/创建_XPCOM_组件:建立_Gecko_SDK">下一页 »</a></p>
-</div><p></p>
-
-<p>这是教程最后一部分, 我们将把所有的web所有的组件成分打包成可安装到其他应用中的形式 - the library itself, the type library, the header file, and the user interface resources. The first section, <a href="#Component_Installation_Overview">Component Installation Overview</a>, describes the general installation process in Mozilla. The following sections describe the steps you can take to organize the <strong>WebLock</strong> component for distribution and installation.</p>
-
-<div class="side-note">
-<p>请注意: 这个教程主要是关注组件开发本身, 所以这部分描述有关打包和安装到Gecko的过程是很简单的. 如果你希望了解详细的打包和安装组件到基于Gecko应用的信息,应该参考http://www.mozilla.org/projects/xpinstall.</p>
-</div>
-
-<h3 id="Component_Installation_Overview" name="Component_Installation_Overview">Component Installation Overview</h3>
-
-<p>XPInstall是一组JavaScript APIs用来建立安装脚本. 使用XPInstall,你可以为装载到Gecko-based应用,Mozilla extensions,或者individual components的组件建立web-based安装脚本. <strong>WebLock</strong> component安装脚本也可以用来注册组件到browser(see <a href="cn/Creating_XPCOM_Components/Component_Internals#Registration_Methods_in_XPCOM">Registration Methods in XPCOM</a> for more information on registration).</p>
-
-<p>下面的例子安装脚本使用了Mozilla XPInstall技术来操作安装并且以高层次Javascript对象的方式来跟Mozilla's<em>chrome registry</em> 交互。</p>
-
-<div class="side-note">
-<p><span id="What_Is_the_Chrome_Registry?"><a id="What_Is_the_Chrome_Registry?"></a><strong>What Is the Chrome Registry?</strong></span></p>
-
-<p>Like the Windows registry, the chrome registry is a database of information about applications, skins, and other extensions that have been installed in a Gecko application. Since Mozilla and other Gecko-based applications are cross-platform, this database is abstracted above the operating system or any particular platform's registry.</p>
-
-<p>The chrome registry lives in a series of RDF/XML files in the application directory of Mozilla and other Gecko-based browsers, where new installs, user configurable data, skins, and other information are related to one another and the application itself.</p>
-</div>
-
-<p>XPInstall中的JavaScript APIs <code>Install</code> 对象下载包含了安装文件的JAR并且调用注册方法来告诉 Mozilla 新的组件和用来调用<strong>WebLock</strong>组件的UI. <a href="#WebLock_Installation_Script">WebLock Installation Script</a> 是完整的<em>trigger installation script</em> , 可以从网页触发. 文件被存储在JAR file <code>weblock.jar</code>, 这是一个简单的ZIP文件,以XPI结尾,有时候也可能包含一个内部的安装脚本<code>install.js</code>.</p>
-
-<p>一旦你把组件和<strong>Weblock</strong>相关资源正确打包(see the following section, <a href="#Archiving_Resources">Archiving Resources</a>), <strong>WebLock</strong>安装脚本是一个简单的事情(see <a href="#The_WebLock_Installation_Script">The WebLock Installation Script</a>).</p>
-
-<h3 id="Archiving_Resources" name="Archiving_Resources">Archiving Resources</h3>
-
-<p>Once you have compiled all the resources that make up the <strong>WebLock</strong> component and the files that make up the user interface that will be added to the browser, you can place these within a subdirectory called <code>weblock</code>.</p>
-
-<p>Place the entire subdirectory into a ZIP archive and name the archive <code>weblock.xpi</code>. The archive, its subdirectory structure, and its contents should look like this:</p>
-
-<p><span id="%3Ccode%3Eweblock.xpi%3C/code%3E_Archive_Viewed_in_WinZIP"><a id="%3Ccode%3Eweblock.xpi%3C/code%3E_Archive_Viewed_in_WinZIP"></a><strong><code>weblock.xpi</code> Archive Viewed in WinZIP</strong></span></p>
-
-<p><img alt="Image:weblock-zipped-package.png"></p>
-
-<p>Note that the top level of the archive holds the <code>install.js</code> installation file, an RDF manifest for the package as a whole, and the component files (<code>weblock.xpt</code> and <code>weblock4.dll</code>). The component files are copied to the components directory of the Gecko application, and the weblock subdirectory gets copied over into the chrome subdirectory, where its UI resources can be added dynamically to the XUL-based Gecko application.</p>
-
-<p>The next section shows how this process of downloading, copying and registering the necessary files from the XPI can be achieved with an XPInstall installation script.</p>
-
-<h3 id="The_WebLock_Installation_Script" name="The_WebLock_Installation_Script">The <strong>WebLock</strong> Installation Script</h3>
-
-<p>安装脚本是一个存储在XPI中的JavaScript文件. 他必须在包的根目录 (i.e., <code>weblock.xpi</code>) itself. 一旦触发 (see <a href="#The_WebLock_Trigger_Script">The WebLock Trigger Script</a>), 安章脚本将:</p>
-
-<ul>
- <li>downloads the <strong>WebLock</strong> component and places it in the <code>components</code> directory</li>
- <li>copies the <code>weblock</code> subdirectory in the Mozilla chrome application subdirectory</li>
- <li>registers both the component and the UI</li>
-</ul>
-
-<p>The XPInstall API提供了一些核心方法<sup><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/Packaging_WebLock#endnote_essential-methods">[essential-methods]</a></sup>例如 <code>initInstall</code>, <code>registerChrome</code>, <code>addFile</code>, and others.</p>
-
-<p><span id="WebLock_Installation_Script"><a id="WebLock_Installation_Script"></a><strong>WebLock Installation Script</strong></span></p>
-
-<pre>// initialize the installation
-var err = initInstall("WebLock", "weblock", 1.0);
-
-var componentsDir = getFolder("Components");
-var cf = getFolder("Chrome");
-
-// add the DLL and say where it'll go
-addFile("weblock.dll", 1.0, "weblock.dll", componentsDir, "");
-
-// add the typelib also
-addFile("weblock.xpt", "1.0", "weblock.xpt", componentsDir, "");
-
-// add the weblock subdirectory of the XPI and specify that
-// it be installed in the chrome application directory
-err = addDirectory("weblock", "1.0", "", chromeDir, "");
-
-// ? have to register component here or with regxpcom?
-
-// register the new UI with the mozilla chrome registry
-
-registerChrome(CONTENT, getFolder(cf,"weblock.xpi"),"weblock");
-registerChrome(SKIN, getFolder(cf, "weblock.xpi"),"weblock");
-
-// perform the installation if there are no errors
-if (err==SUCCESS)
- performInstall();
-else
- cancelInstall(err);
-</pre>
-
-<h3 id="The_WebLock_Trigger_Script" name="The_WebLock_Trigger_Script">The <strong>WebLock</strong> Trigger Script</h3>
-
-<p>The <code>trigger script</code> is the script placed on a web page that actually initiates an XPInstall installation and calls the installation script that appears in the XPI. The following HTML specifies a complete webpage in which the trigger script is defined as a JavaScript function, <code>installWebLock</code>, that gets called when the user clicks the hyperlink.</p>
-
-<pre>&lt;html&gt;
-&lt;title&gt;WebLock Installation&lt;/title&gt;
-&lt;script type="text/javascript"&gt;
-/*
- * Trigger function that downloads the XPI so the
- * install.js file inside can be read and executed
- */
-function installWebLock()
-{
- weblock_xpi = {'WebLock Extension': 'weblock.xpi'};
- InstallTrigger.install(weblock_xpi);
-}
-&lt;/script&gt;
-
-&lt;h1&gt;Install WebLock&lt;/h1&gt;
-
-&lt;p&gt;&lt;a href="#" onclick="installWebLock();"&gt;install weblock&lt;/a&gt;&lt;/p&gt;
-
-&lt;/html&gt;
-</pre>
-
-<h3 id="Distributing_Your_Component" name="Distributing_Your_Component">Distributing Your Component</h3>
-
-<p>Once you have the component packaged properly and the necessary installation and trigger scripts, you are ready to distribute your component so others can install it in their Gecko applications.</p>
-
-<p>In Mozilla and Netscape browsers, XPInstall makes this process especially easy by providing the file format (XPI) and the necessary installation scripts for doing a web-based installation. As <a href="#WebLock_Installation_Script">WebLock Installation Script</a> demonstrates, XPInstall uses special keywords to refer to common installation directories such as <code>components</code> in a generalized, cross-platform way.</p>
-
-<p>If you are installing <strong>WebLock</strong> in an Gecko-based application for which XPInstall is not available, then you will have to devise a separate installation scheme. We leave this as an exercise for the reader.</p>
-
-<ol>
- <li><div class="blockIndicator note"><strong>Note:</strong> install-object-methods</div> The methods are available on the main <code>Install</code> object, which is implied in the script below in the same way that the <code>window</code> object is implied in JavaScript manipulation of the DOM of a web page. In other words, the fragment <code>initInstall()</code> from the script is equivalent to <code>Install.initInstall()</code>.</li>
-</ol>
-
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/Creating_XPCOM_Components:Building_the_WebLock_UI" style="float: left;">« 上一页</a><a href="/zh-CN/docs/创建_XPCOM_组件:建立_Gecko_SDK">下一页 »</a></p>
-</div><p></p><div class="licenseblock">
-<p>Copyright (c) 2003 by Doug Turner and Ian Oeschger. This material may be distributed only subject to the terms and conditions set forth in the <a class="external" href="http://www.opencontent.org/openpub/" rel="noopener">Open Publication License</a>, v1.02 or later. Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. Distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder.</p>
-</div><p></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/preface/index.html b/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/preface/index.html
deleted file mode 100644
index 0710f0a701..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/preface/index.html
+++ /dev/null
@@ -1,83 +0,0 @@
----
-title: 前言
-slug: Mozilla/Tech/XPCOM/Guide/Creating_components/Preface
-tags:
- - XPCOM
- - 所有分类
-translation_of: Mozilla/Tech/XPCOM/Guide/Creating_components/Preface
----
-<p> </p>
-
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/创建_XPCOM_组件:XPCOM_简介">下一页 »</a></p>
-</div>这本书是关于 Gecko, 以及如何创建基于 Gecko 的 <a href="/cn/XPCOM" title="cn/XPCOM">XPCOM</a> 组件. 尽管本书的重点是放在把你的 C++ 代码制作成一个使用 Gecko 的组件的步骤之上, 我们还希望这个过程能够讨论到所有构建 XPCOM 的相关工具, 技巧和技术. 因此本书的安排上是作为一个参考书, 使读者能够自己创建组件, 学习不同的 XPCOM 内容. 比如说, 导言中包含了什么是组件的讨论; 第一章中你可以编译基本的源码并注册到 Mozilla 中, 由此讨论了组件于模块之间的关系, 以及一般的注册过程.<p></p>
-
-<p>每章的开始会给出这一章的主要内容. Sidebar sections are included to highlight technical details. 在本书的结尾, 如果能够达到本书的目的的话, 读者应该学会如何创建一个组件, Gecko 中的 XPCOM 组件框架.</p>
-
-<h3 id=".E8.B0.81.E8.AF.A5.E8.AF.BB.E8.BF.99.E6.9C.AC.E4.B9.A6" name=".E8.B0.81.E8.AF.A5.E8.AF.BB.E8.BF.99.E6.9C.AC.E4.B9.A6">谁该读这本书</h3>
-
-<p><a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6" title="cn/创建_XPCOM_组件">创建 XPCOM 组件</a> 是为 C++ 开发人员而写. 尽管你可能会使用 <a href="/cn/JavaScript" title="cn/JavaScript">JavaScript</a>, <a href="/cn/C" title="cn/C">C</a> 或其他的语言来创建 XPCOM 组件, 组件管理的实现是采用 C++, 许多关于如何创建 XPCOM 组件的讨论也是从 C++ 语言开始的. 然而并不要求读者是一个 C++ 语言的专家, 你需要了解的是基本的 C++ 继承和封装的思想, 我们在书中将尽可能的解释这些 C++ 语言的特性的使用. 由于 Mozilla 使用 JavaScript 脚本语言来访问 XPCOM 组件, 所以熟悉 JavaScript 会很有帮助.</p>
-
-<p>XPCOM 是 Cross Platform Component Object Model (跨平台组件模型)的缩写. 就象它的名字暗示的, XPCOM 类似于 Microsoft 的 COM. 开发 MS COM 的经验大多都可以被应用到 XPCOM. 然而本书假设读者对 COM 一无所知, 本书将包含关于 COM 基本思想的介绍.</p>
-
-<p>本书将描述一个控制浏览动作的 XPCOM 组件的制作过程. 尽管 XPCOM 的多数应用环境与 web 浏览并没有关系, 但是 XPCOM 现在的主要客户应用是 Gecko, 一个开源的, 遵循标准的嵌入式 web 浏览器, 所以它是最简单的, 而且是最实用的展示 XPCOM 功能的例子. 本教程中关于组件的详细描述在这里 <a href="/cn/Creating_XPCOM_Components/Creating_the_Component_Code#What_We.27ll_Be_Working_On" title="cn/Creating_XPCOM_Components/Creating_the_Component_Code#What_We.27ll_Be_Working_On">What We'll Be Working On</a>.</p>
-
-<h3 id=".E6.9C.AC.E6.95.99.E7.A8.8B.E7.9A.84.E7.BB.84.E7.BB.87" name=".E6.9C.AC.E6.95.99.E7.A8.8B.E7.9A.84.E7.BB.84.E7.BB.87">本教程的组织</h3>
-
-<p>下面的列表给出了编制一个称为 <strong>WebLock</strong> 的 XPCOM 组件的整体步骤, 这个组件向基于 Gecko 的浏览器提供了阻止网站访问的功能. 每个步骤都有各自的章节, 在各个章节中会讨论相关的内容.</p>
-
-<ul>
- <li>创建组件的通用模块.</li>
- <li>使用 C++ 宏, 特殊的字符串类以及智能指针来优化代码.</li>
- <li>为组件定义功能; 为这个功能创建一个 <a href="/cn/XPIDL" title="cn/XPIDL">XPIDL</a> 接口; 生成实现代码, 规格定制的 <strong>WebLock</strong> 接口.</li>
- <li>完整实现 <strong>WebLock</strong> 组件: <code>nsIContentPolicy</code>, 文件 I/O, 加锁等.</li>
- <li>创建 WebLock 组件用户接口.</li>
- <li>为发布和安装 <strong>WebLock</strong> 打包.</li>
-</ul>
-
-<h3 id=".E6.8C.89.E7.85.A7.E4.BE.8B.E5.AD.90.E6.9D.A5.E5.AD.A6.E4.B9.A0" name=".E6.8C.89.E7.85.A7.E4.BE.8B.E5.AD.90.E6.9D.A5.E5.AD.A6.E4.B9.A0">按照例子来学习</h3>
-
-<p>安装 XPCOM 到本地机器上的方法有很多, 如果你已经编译了 Mozilla 1.2 或更高的版本源码, 你就已经有了 XPCOM 框架. 如果你还没有下载 Mozilla 源码, 更简单的方法是下载 Gecko SDK, 它包含了 XPCOM 组件框架的库和工具.</p>
-
-<p>如果有了上面的工具, 你就可以编译自己的组件, 并把这个组件添加到 Gecko 库中. 我们这里讨论的 <strong>WebLock</strong> 组件是一个实用的浏览器扩展, 编译它需要 1.2 或更高版本的 Gecko SDK / Mozilla 源码.</p>
-
-<p>本书假设你使用的是 SDK, 下载 SDK, 编译, 和获取可用于编成的 Gecko 组件的方法在本书的附录, <a href="/cn/%E5%88%9B%E5%BB%BA_XPCOM_%E7%BB%84%E4%BB%B6/%E5%BB%BA%E7%AB%8B_Gecko_SDK" title="cn/创建_XPCOM_组件/建立_Gecko_SDK">建立 Gecko SDK</a>.</p>
-
-<h3 id=".E6.9C.AC.E4.B9.A6.E7.9A.84.E4.BD.93.E4.BE.8B" name=".E6.9C.AC.E4.B9.A6.E7.9A.84.E4.BD.93.E4.BE.8B">本书的体例</h3>
-
-<p>下面列出的是格式化文档的习惯,他们用于本书中特定的信息类型并且让信息检索变得简单。目标是使用尽量少的格式类型,同时能辨别不同的信息类型。</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">Format</td>
- <td class="header">Description</td>
- </tr>
- <tr>
- <td><strong>bold</strong></td>
- <td><strong>component names</strong> 显示为粗题文字</td>
- </tr>
- <tr>
- <td><code>monospace</code></td>
- <td><code>code listings</code>, <code>interface names</code> 和 <code>members</code> of interfaces (e.g., <code>createInstance()</code>) 用monospaced 字体表达. 代码行放在不同的box内. 此外, <code>filenames</code> 和 <code>directories</code> 也用 monospaced 字体.</td>
- </tr>
- <tr>
- <td><em>italic</em></td>
- <td><em>variables</em> appear in italic. 重要的条目和新的概念第一次在文本中出现的时候也应该是斜体字。这些条目通常会立刻有进一步的解释,或者读者可以在本书的某个地方找到详细的解释。</td>
- </tr>
- <tr>
- <td>link</td>
- <td>References to other sections and to figures and tables are links to those sections.</td>
- </tr>
- </tbody>
-</table>
-
-<h3 id=".E8.87.B4.E8.B0.A2" name=".E8.87.B4.E8.B0.A2">致谢</h3>
-
-<p>Thanks to Peter Lubczynski, John Gaunt, Ellen Evans, and Alec Flett for technical reviews. A special thanks goes to Darin Fisher for his very acute observations, close reading, and attention to detail. </p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/创建_XPCOM_组件:XPCOM_简介">下一页 »</a></p>
-</div><p></p><div class="licenseblock">
-<p>Copyright (c) 2003 by Doug Turner and Ian Oeschger. This material may be distributed only subject to the terms and conditions set forth in the <a class="external" href="http://www.opencontent.org/openpub/" rel="noopener">Open Publication License</a>, v1.02 or later. Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. Distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder.</p>
-</div><p></p>
-
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/resources/index.html b/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/resources/index.html
deleted file mode 100644
index b23e6eb4c2..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/resources/index.html
+++ /dev/null
@@ -1,10 +0,0 @@
----
-title: 资源
-slug: Mozilla/Tech/XPCOM/Guide/Creating_components/Resources
-translation_of: Mozilla/Tech/XPCOM/Guide/Creating_components/Resources
----
-<p><a href="cn/Link_title">Link title</a>
- <i>
- Italic text</i>
-</p>
-<pre class="script">Insert formula here</pre>
diff --git a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/setting_up_the_gecko_sdk/index.html b/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/setting_up_the_gecko_sdk/index.html
deleted file mode 100644
index 3e8c8516e2..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/setting_up_the_gecko_sdk/index.html
+++ /dev/null
@@ -1,204 +0,0 @@
----
-title: 建立 Gecko SDK
-slug: Mozilla/Tech/XPCOM/Guide/Creating_components/Setting_up_the_Gecko_SDK
-tags:
- - XPCOM
- - 所有分类
-translation_of: Mozilla/Tech/XPCOM/Guide/Creating_components/Setting_up_the_Gecko_SDK
----
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/Creating_XPCOM_Components:Packaging_WebLock" style="float: left;">« 上一页</a><a href="/zh-CN/docs/Creating_XPCOM_Components:Resources">下一页 »</a></p>
-</div><p></p>
-
-<p>这一章提供建立 Gecko SDK 的基本方法, 下面会告诉开发人员如何下载和组织 Gecko SDK, 如何象 <em>WebLock</em> 一样创建一个新的组件工程.</p>
-
-<h3 id=".E4.B8.8B.E8.BD.BD.E5.92.8C.E5.BB.BA.E7.AB.8B_SDK" name=".E4.B8.8B.E8.BD.BD.E5.92.8C.E5.BB.BA.E7.AB.8B_SDK">下载和建立 SDK</h3>
-
-<p>Gecko SDK 提供了编译 XPCOM 组件所需要的所有的工具, 头文件和库. SDK 现在有 Windows 和 Linux 两个版本, 其他操作系统上的 SDK 正在开发. SDK 在下面的地址下载:</p>
-
-<ul>
- <li>Linux: <a class="external" href="http://ftp.mozilla.org/pub/mozilla/releases/mozilla1.4a/gecko-sdk-i686-pc-linux-gnu-1.4a.tar.gz" rel="freelink">http://ftp.mozilla.org/pub/mozilla/r...nu-1.4a.tar.gz</a></li>
- <li>Windows: <a class="external" href="http://ftp.mozilla.org/pub/mozilla/releases/mozilla1.4a/gecko-sdk-win32-1.4a.zip" rel="freelink">http://ftp.mozilla.org/pub/mozilla/r...win32-1.4a.zip</a></li>
-</ul>
-
-<p>注意版号要大于1.4a. 可以在下面的地址获取更新的 SDK 版本 <a class="external" href="http://ftp.mozilla.org/pub/mozilla/releases/" rel="freelink">http://ftp.mozilla.org/pub/mozilla/releases/</a>.</p>
-
-<p>一旦你下载了SDK, 你可以解压缩到任何合适的目录. 在本附录中, 我们建立Windows Gecko SDK 到 <code>c:\gecko-sdk\</code>. 如果你选择其他的位置, 记得调整这里描述的设置指向这个位置(e.g., in the <a href="#建立一个Microsoft_visual_cpp工程">建立一个Microsoft visual cpp工程</a> 章节) .</p>
-
-<p>当你解压缩SDK,它的目录结构看起来应该是:</p>
-
-<p><span id="Layout_of_the_Extracted_SDK"><a id="Layout_of_the_Extracted_SDK"></a><strong>Layout of the Extracted SDK</strong></span></p>
-
-<p><img alt="Image:sdk-layout.png" class="internal" src="/@api/deki/files/2682/=Sdk-layout.png"></p>
-
-<p>目录分别代表SDK中的不同模块。例如网络通讯的所有头文件放在<code>necko</code>目录中,而所有XPCOM需要的头文件则放在 XPCOM 目录中。 这个目录结构使得编译脚本变得比较复杂(因为会产生很多include路径)但是他帮助把SKD的部分组织得更有条例。</p>
-
-<p>两组顶级头文件是比较特别的。<code>mozilla-config.h</code>列出了SDK中使用的所有define,在你的文件中包含着个头文件会保证你创建的组件和Gecko库使用的相同的define。注意<code>mozilla-config.h</code>可能需要在你的组件代码中第一个被include.</p>
-
-<p>每一个模块的目录都分成三个子目录:</p>
-
-<p><span id="Module_Subdirectories"><a id="Module_Subdirectories"></a><strong>Module Subdirectories</strong></span></p>
-
-<p><img alt="Image:module-directory-subdirs.png" class="internal" src="/@api/deki/files/2669/=Module-directory-subdirs.png"></p>
-
-<p><code>bin</code>目录包含了静态库,动态库, 和一些可能会在开发中使用的tools。<code>idl</code>目录包含了模块所公开的公共的IDL文件。<code>includes</code>目录包含了你的组件使用的C++头文件。</p>
-
-<p>现在我们应该提到XPCOM公开的一组二进制代码文件。下面的列表罗列了可执行的Windows文件名:</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">Application Name</td>
- <td class="header">Description of functionality</td>
- </tr>
- <tr>
- <td><code>regxpcom.exe</code></td>
- <td>Registers or Unregisters components with XPCOM</td>
- </tr>
- <tr>
- <td><code>xpidl.exe</code></td>
- <td>Generates typelib and C++ headers from XPIDL</td>
- </tr>
- <tr>
- <td><code>xpt_dump.exe</code></td>
- <td>Prints out information about a given typelib</td>
- </tr>
- <tr>
- <td><code>xpt_link.exe</code></td>
- <td>Combines multiple typelibs into a single typelib</td>
- </tr>
- </tbody>
-</table>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">Library Name</td>
- <td class="header">Description of functionality</td>
- </tr>
- <tr>
- <td><code>xpcomglue.lib</code></td>
- <td>XPCOM Glue library to be used by xpcom components.</td>
- </tr>
- </tbody>
-</table>
-
-<h3 id=".E7.BC.96.E8.AF.91.E4.B8.80.E4.B8.AA_Microsoft_Visual_Cpp_.E5.B7.A5.E7.A8.8B" name=".E7.BC.96.E8.AF.91.E4.B8.80.E4.B8.AA_Microsoft_Visual_Cpp_.E5.B7.A5.E7.A8.8B">编译一个 Microsoft Visual Cpp 工程</h3>
-
-<p>一担你建立了Gecko SDK,你可以创建一个Miscrosoft visual c++项目来处理你基于SDK的组件开发。</p>
-
-<h4 id=".E5.88.9B.E5.BB.BA.E4.B8.80.E4.B8.AA.E6.96.B0.E7.9A.84.E5.B7.A5.E7.A8.8B" name=".E5.88.9B.E5.BB.BA.E4.B8.80.E4.B8.AA.E6.96.B0.E7.9A.84.E5.B7.A5.E7.A8.8B">创建一个新的工程</h4>
-
-<p>启动Visual c++以后,从文件菜单重选择new。然后在新建对话框中选择"Win32 Dynamic-Link Library"。 使用对话框右边的栏目输入你的项目和位置。(这个例子使用了 "SampleGeckoProject"作为问兼并,位置是<code>C:\</code> ).</p>
-
-<p><span id="New_Dialog"><a id="New_Dialog"></a><strong>New Dialog</strong></span></p>
-
-<p><img alt="Image:new-vcpp-project.png" class="internal" src="/@api/deki/files/2671/=New-vcpp-project.png"></p>
-
-<p>选择OK. 在出现的Win32 Dynamic-Link Library 对话框里, 你可以选择缺省的 "An Empty DLL Project" 作为DLL的类型.</p>
-
-<p><img alt="Image:vcpp-dll-dialog.png" class="internal" src="/@api/deki/files/2690/=Vcpp-dll-dialog.png"></p>
-
-<p>选择Finish. Microsoft Studio 将根据你的设定建立一个新的项目并且展开项目开发视图。</p>
-
-<h4 id=".E6.8A.8A_Gecko_SDK_.E6.B7.BB.E5.8A.A0.E5.88.B0.E5.B7.A5.E7.A8.8B.E8.AE.BE.E7.BD.AE" name=".E6.8A.8A_Gecko_SDK_.E6.B7.BB.E5.8A.A0.E5.88.B0.E5.B7.A5.E7.A8.8B.E8.AE.BE.E7.BD.AE">把 Gecko SDK 添加到工程设置</h4>
-
-<p>为了build使用Gecko的所有信息,你还需要进一步修改项目使得它知道在哪里取得Gecko SDK。为了编辑项目设置, 从项目菜单种选择Settings (or press Alt-F7).</p>
-
-<p>大部分你在下面步骤中所做的修改方法都适用于所有项目设置的修改(包括Debug和Optimize)。选择从Setting菜单中选择"All Configurations",出现一个下拉菜单:</p>
-
-<p><img alt="Image:vcpp-project-settings.png" class="internal" src="/@api/deki/files/2692/=Vcpp-project-settings.png"></p>
-
-<p>在C/C++ tab,选择Preprocessor组。在这个窗口里你要添加到Gecko SDK的include路径,以及两个 preprocessor defines:</p>
-
-<ul>
- <li><code>XPCOM_GLUE</code></li>
- <li><code>MOZILLA_STRICT_API</code></li>
-</ul>
-
-<p>最起码你要加上include <code>nspr</code>, <code>embedstring</code> 和 <code>string</code> <code>include</code>目录, 和<code>xpcom</code> <code>include</code> 子目录. 如果你的组件适用其他SDK的部分(例如Necko), 你也要添加指向他们的路径.</p>
-
-<p>假定你使用例子项目的路径,这些路径看起来会是:</p>
-
-<ul>
- <li><code>c:\gecko-sdk\embedstring\include</code></li>
- <li><code>c:\gecko-sdk\xpcom\include</code></li>
- <li><code>c:\gecko-sdk\nspr\include</code></li>
- <li><code>c:\gecko-sdk\string\include</code></li>
-</ul>
-
-<p><img alt="Image:vcpp-project-settings-includes.png" class="internal" src="/@api/deki/files/2691/=Vcpp-project-settings-includes.png"></p>
-
-<p>在C++ language组, 禁止异常处理. 正如在 <a href="/cn/XPCOM%E6%A6%82%E8%A7%88/XPCOM%E4%B8%AD%E7%9A%84%E5%BC%82%E5%B8%B8" title="cn/XPCOM概览/XPCOM中的异常">XPCOM中的异常</a>章节所表明的, 异常处理不支持跨越Interface, 所以使用这个功能将可能在开发中引起问题。</p>
-
-<p><strong>WebLock</strong> 组件需要引用必要的库文件以使用XPCOM Glue. 为添加这些库文件,选择Link tab, 然后选择Input category. 在这个面板上不要连接到 <code>nspr</code>, <code>embedstring</code>和<code>xpcom</code>中的子目录<code>include</code> ,而改用<code>bin</code>子目录.</p>
-
-<p>我们也会连接到一些Object/library 模块中的库:</p>
-
-<ul>
- <li><code>nspr4.lib</code></li>
- <li><code>plds4.lib</code></li>
- <li><code>plc4.lib</code></li>
- <li><code>embedstring.lib</code></li>
- <li><code>xpcomglue.lib</code></li>
-</ul>
-
-<p>这些设定看起来会是:</p>
-
-<p><img alt="Image:vcpp-project-settings.png" class="internal" src="/@api/deki/files/2692/=Vcpp-project-settings.png"></p>
-
-<p>最后一个你需要让Gecko SDK在你的项目中设定成功的修改是"Use run-time library" 设定为 "Multithreaded DLL." 因为这个设置是根据其他设定而确定的,你<strong>必须设定Release configuration run-time library 为 release multithreaded DLL runtime, 并且Debug configuration 设定为 the debug multithreaded dll runtime</strong> (这个需要澄清一下):</p>
-
-<p><img alt="Image:vcpp-runtime-settings.png" class="internal" src="/@api/deki/files/2693/=Vcpp-runtime-settings.png"></p>
-
-<p>完成所有这些设定后,选择OK. 这就完成了项目设定并且让你的项目能包含和编译XPCOM组件.</p>
-
-<h3 id="Unix_.E4.B8.8B.E7.9A.84.E4.B8.80.E4.B8.AA_Makefile" name="Unix_.E4.B8.8B.E7.9A.84.E4.B8.80.E4.B8.AA_Makefile">Unix 下的一个 Makefile</h3>
-
-<p>Linux 下不采用工程而采用 <code>Makefile</code> 来组织代码. <code>Makefile</code> 中放置编译环境中的编译选项, 包括使用 Gecko SDK 编译的路径和配置更新等.</p>
-
-<p>下面是一个使用 SDK 来编译的 <code>Makefile</code>, 这里对 <code>Makefile</code> 的详细用法不做解释. 它与 Visual C++ 的工程(<a href="#Building_a_Microsoft_Visual_Cpp_Project">Building a Microsoft Visual Cpp Project</a>)相类似, 关于 Makefile 的命令请参看 <a class="external" href="http://www.gnu.org/manual/make/">Make 手册</a>.</p>
-
-<p><span id="Gecko_SDK_%E4%B8%8B%E7%9A%84%E4%B8%80%E4%B8%AA_Makefile_%E4%BE%8B%E5%AD%90"><a id="Gecko_SDK_%E4%B8%8B%E7%9A%84%E4%B8%80%E4%B8%AA_Makefile_%E4%BE%8B%E5%AD%90"></a><strong>Gecko SDK 下的一个 Makefile 例子</strong></span></p>
-
-<pre>CXX = c++
-
-CPPFLAGS += -fno-rtti \
- -fno-exceptions \
- -shared
-
-# Change this to point at your Gecko SDK directory.
-GECKO_SDK_PATH = /home/dougt/gecko-sdk
-
-# GCC only define which allows us to not have to #include mozilla-config
-# in every .cpp file. If your not using GCC remove this line and add
-# #include "mozilla-config.h" to each of your .cpp files.
-GECKO_CONFIG_INCLUDE = -include mozilla-config.h
-
-GECKO_DEFINES = -DXPCOM_GLUE -DMOZILLA_STRICT_API
-
-GECKO_INCLUDES = -I $(GECKO_SDK_PATH) \
- -I $(GECKO_SDK_PATH)/xpcom/include \
- -I $(GECKO_SDK_PATH)/nspr/include \
- -I $(GECKO_SDK_PATH)/string/include \
- -I $(GECKO_SDK_PATH)/embedstring/include
-
-GECKO_LDFLAGS = -L $(GECKO_SDK_PATH)/xpcom/bin -lxpcomglue \
- -L $(GECKO_SDK_PATH)/nspr/bin -lnspr4 \
- -L $(GECKO_SDK_PATH)/nspr/bin -lplds4 \
- -L $(GECKO_SDK_PATH)/embedstring/bin/ -lembedstring
-
-build:
- $(CXX) -o MozShim.so $(GECKO_CONFIG_INCLUDE) $(GECKO_DEFINES) $(GECKO_INCLUDES) $(GECK\
-O_LDFLAGS) $(CPPFLAGS) $(CXXFLAGS) MozShim.cpp
- chmod +x MozShim.so
-
-clean:
- rm MozShim.so
-</pre>
-
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/Creating_XPCOM_Components:Packaging_WebLock" style="float: left;">« 上一页</a><a href="/zh-CN/docs/Creating_XPCOM_Components:Resources">下一页 »</a></p>
-</div> <p></p><div class="licenseblock">
-<p>Copyright (c) 2003 by Doug Turner and Ian Oeschger. This material may be distributed only subject to the terms and conditions set forth in the <a class="external" href="http://www.opencontent.org/openpub/" rel="noopener">Open Publication License</a>, v1.02 or later. Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. Distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder.</p>
-</div><p></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/starting_weblock/index.html b/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/starting_weblock/index.html
deleted file mode 100644
index 65efd53a72..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/starting_weblock/index.html
+++ /dev/null
@@ -1,1104 +0,0 @@
----
-title: 开始WebLock
-slug: Mozilla/Tech/XPCOM/Guide/Creating_components/Starting_WebLock
-tags:
- - XPCOM
- - 所有分类
-translation_of: Mozilla/Tech/XPCOM/Guide/Creating_components/Starting_WebLock
----
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/Creating_XPCOM_Components:Using_XPCOM_Utilities_to_Make_Things_Easier" style="float: left;">« 上一页</a><a href="/zh-CN/docs/Creating_XPCOM_Components:Finishing_the_Component">下一页 »</a></p>
-</div><p></p>
-
-<p>在本章,我们开始设计和实现网络锁定功能本身。我们已经建立了实现多数通用组件功能的模块(例如注册)。这章将关注实际操作网页锁定的功能。</p>
-
-<h3 id="Getting_Called_at_Startup" name="Getting_Called_at_Startup">Getting Called at Startup</h3>
-
-<p>没有人是一个孤岛,组件也一样。你所建立的例子组件到目前为止还没有任何功能。当他被注册以后,他没做任何事情。</p>
-
-<p>为了当某些事件发生的时候被启动或者通知到,例子组件需要挂接到Mozilla,或者覆盖一个现存组件,或者注册到一些事件上面。<strong>WebLock</strong>用后面的方式在Gecko Profile Startup发生的时候被调用。当Gecko应用启动的时候,注册的组件被创建或者通过通用观察者接口被提醒<code>nsIObserver</code>。</p>
-
-<p><em>Observer</em>是一些对象,他们当特定的事件发生的时候被通知。使用这种机制提供了一个相互不必了解而可以在对象之间传送信息的机制。</p>
-
-<p>通常,一个对象会通知一系列观察者。例如一个对象被创建的时候它的<code>observe</code>方法被调用,或者它可以注册当XPCOM关闭的时候被通知。这个接口的核心是<code>observe</code>方法。</p>
-
-<pre>void observe(in nsISupports aSubject,
- in string aTopic,
- in wstring aData);
-</pre>
-
-<p>实际上ovserver方法的参数没有什么限制。这些参数根据事件的类型变化。例如,XPCOM关闭的时候,aSubject和aData被定义,aTopic被定义为“xpcom-shotdown’,如果你的对象希望注册到这些事件上面,他首先要实现nsIObserver接口,一旦你完成这些,实现nsIObserverService的observer服务将会利用接口通知你的对象,如下所示:</p>
-
-<p><span id="The_Observer_Interfaces"><a id="The_Observer_Interfaces"></a><strong>The Observer Interfaces</strong></span></p>
-
-<p><img alt="Image:observation-overview.png"></p>
-
-<p>上图表现了observer服务管理了所有<code>nsIObserver</code>对象的列表. 当通知产生的时候,<code>nsIObserverService</code>把呼叫者从<code>NotifyObserver()</code>发送出的消息传送给<code>nsIObserver</code>的<code>Observe()</code>方法。这是一个让不同的类解藕的办法。<code>nsIObserver</code>是一个通用的接口,用来在两个或多个对象间传递信息,而不必定义一个特定的冻结接口,它也是XPCOM建立扩展的一个方式。</p>
-
-<p>WebLock组件对<code>nsIObserver</code>接口的实现和对<code>nsIFactory</code>接口是类似的。<span class="comment">XXX what is Example 2?</span>下面的例子2中,你改变一个类的定义为支持<code>nsIObserver</code>接口并且改变<code>NS_IMPL_ISUPOORTS1</code>,从而<code>QueryInterface</code>实现知道组件也支持<code>nsIObserver</code>。启动的时候被通知的<code>WebLock</code>类定义如下:</p>
-
-<pre>class WebLock: public nsIObserver {
- public:
- WebLock();
- virtual ~WebLock();
-
- NS_DECL_ISUPPORTS
- NS_DECL_NSIOBSERVER
-};
-
-NS_IMPL_ISUPPORTS1(WebLock, nsIObserver);
-</pre>
-
-<p><code>Observe()</code>最简单的实现仅仅是比较字符串<code>aTopic</code>和对象所接受事件所定义的值. 如果相匹配, 你可以按照你的方式处理事件. 如果对象仅仅注册到一个消息上, 那你可以忽略字符串 <code>aTopic</code> 而仅仅处理事件. 换句话说,对于对象所没有注册的事件,<code>Observe</code> 方法不应该被调用。</p>
-
-<pre>NS_IMETHODIMP
-WebLock::Observe(nsISupports *aSubject,
- const char *aTopic,
- const PRUnichar *aData)
-{
- return NS_OK;
-}
-</pre>
-
-<p>从observer service来的消息可能是间接的. 直接获得来自observer service的消息的方法是初始化一个<code>nsIObserver</code> 对象. 大多数情况下这样是可以的,但是要注意当你通过这个消息建立组件的情况. 因为组件还没有被建立,所以不存在初始化的 <code>nsIObserver</code> 对象可以用来传递给 <code>nsIObserverService</code>, 组件代码在他被装载以前不能做什么.</p>
-
-<h4 id=".E6.B3.A8.E5.86.8C.E5.88.B0.E6.B6.88.E6.81.AF" name=".E6.B3.A8.E5.86.8C.E5.88.B0.E6.B6.88.E6.81.AF">注册到消息</h4>
-
-<p><code>nsIObserverService</code> 接口有处理注册和注销一个<code>nsIObserver</code>对象的方法. 这两个方法用来动态添加或者删除一个notification topic上的observer. 但是 <strong>WebLock</strong> 要被自动初始化和添加到observer service, 这就意味着需要一些数据持久化。(不管怎么说, 我们需要组件在程序每次启动的时候也启动).</p>
-
-<p>This is where a new service that manages sets of related data comes in handy. This service, the <code>nsICategoryService</code>, is what XPCOM and Gecko embedding applications use to persist lists of <code>nsIObserver</code> components that want to have startup notification.</p>
-
-<p>The <code>nsICategoryService</code> maintains sets of name-value pairs like the one below.</p>
-
-<p><span id="The_Category_Manager"><a id="The_Category_Manager"></a><strong>The Category Manager</strong></span></p>
-
-<p><img alt="Image:category-manager-table.png"></p>
-
-<p>Every category is identified by a string that represents the name of the category. Each category contains a set of name-value pairs. For example, you might have a category named "Important People" in which the name-value pairs would be names and phone numbers. The format of the name-value pair is left up to you.</p>
-
-<p>This data structure is more than enough to support the persisting of components that what to be started up. The category name also maps nicely onto the notion of a notification "topic." The topic name could be something like "xpcom-startup", for instance, and the name-value pair could contain the contract IDs required to create the components requesting startup. In fact, this is exactly how categories are used to handle registration with XPCOM for startup notification. You will see the code which does this in the next section.</p>
-
-<h4 id="Getting_Access_to_the_Category_Manager" name="Getting_Access_to_the_Category_Manager">Getting Access to the Category Manager</h4>
-
-<p>Two fields in the <code>nsModuleComponentInfo</code> structure introduced in the last section are addresses for registration and unregistration callbacks. The first callback is called when the component's <code>nsIModule::RegisterSelf</code> method is called. This callback allows the component to execute any one-time registration code it may need. The inverse of this function is the unregistration callback, where it's a good idea to undo whatever the registration function did. The two functions look like this:</p>
-
-<pre>static NS_METHOD
-WebLockRegistration(nsIComponentManager *aCompMgr,
- nsIFile *aPath,
- const char *registryLocation,
- const char *componentType,
- const nsModuleComponentInfo *info);
-
-static NS_METHOD
-WebLockUnregistration(nsIComponentManager *aCompMgr,
- nsIFile *aPath,
- const char *registryLocation,
- const nsModuleComponentInfo *info);
-</pre>
-
-<p>The names of the functions can be anything you wish. Both functions are passed the Component Manager and the path to the component, including the opaque <code>registryLocation</code>. These are also parameters in the <code>nsIModule</code> implementation in <span class="comment">XXX what is Example 1? link to it here</span>Example 1. In addition to these parameters, the callback functions are passed the <code>nsModuleComponentInfo</code> struct, which is the same structure initially passed into <code>NS_IMPL_NSGETMODULE</code>.</p>
-
-<p>During registration, the registration callback is where you get the <code>nsICategoryManager</code>. Once you have it, you can add the component to the category of components that get started automatically. As a service, the <code>nsICategoryManager</code> is accessible via the <code>nsIServiceManager</code>. Also note that the <code>nsIComponentManager</code> is passed into the callback. Since the object that implements the <code>nsIComponentManager</code> interface also implements <code>nsIServiceManager</code>, all you have to do is <code>QueryInterface</code> the <code>nsIComponentManager</code> to <code>nsIServiceManager</code> to get the Service Manager. You can then use the Service Manager to add the component to the category:</p>
-
-<pre>nsresult rv;
-
-nsCOMPtr&lt;nsIServiceManager&gt; servman =
- do_QueryInterface((nsISupports*)aCompMgr, &amp;rv);
-
-if (NS_FAILED(rv))
- return rv;
-</pre>
-
-<div class="side-note">
-<p><span id="%3Ccode%3Edo_QueryInterface%3C/code%3E"><a id="%3Ccode%3Edo_QueryInterface%3C/code%3E"></a><strong><code>do_QueryInterface</code></strong></span></p>
-
-<p>The previous code uses the special <code>nsCOMPtr</code> function <code>do_QueryInterface</code> that lets you <code>QueryInterface</code> without having to worry about reference counting, error handling, and other overhead. The <code>do_QueryInterface</code> knows what interface to <abbr title="QueryInterface">QI</abbr> to based on the <code>nsCOMPtr</code> that is being assigned into. We could have just as easily have used the raw <code>QueryInterface()</code> method, but using <code>nsCOMPtr</code> is much more economical (see <a href="cn/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier#Smart_Pointers">Smart Pointers</a>).</p>
-</div>
-
-<p>Once you have a <code>nsIServiceManager</code> reference, you can ask it for the service you are interested in. This process is similar to using <code>CreateInstance</code> from the <code>nsIComponentManager</code>, but there is no aggregation parameter since the object has already been constructed.</p>
-
-<pre>nsCOMPtr&lt;nsICategoryManager&gt; catman;
-rv = servman-&gt;GetServiceByContractID(NS_CATEGORYMANAGER_CONTRACTID,
- NS_GET_IID(nsICategoryManager),
- getter_AddRefs(catman));
-if (NS_FAILED(rv))
- return rv;
-</pre>
-
-<p>There are two service getters on the <code>nsIServiceManager</code> interface: one that takes a CID and another interface that takes a Contract ID. Here we'll use the latter. The first parameter to the <code>GetServiceByContractID</code> is of course the contract ID, which is defined in the <code>nsXPCOM.h</code> header file. The next parameter is a nifty macro that returns the IID for the interface name that you pass in. The last parameter assigns an out interface pointer to a <code>nsCOMPtr</code>. Assuming there weren't any unexpected errors, the variable <code>catman</code> holds the <code>nsICategoryManager</code> interface pointer, which you can use to add the component as a startup observer by calling a method on the <code>nsICategoryManager</code>.</p>
-
-<p>The next step is to figure out which parameters to pass to the method. There is a category name and a name-value pair, but since the name-value pair meaning is category-specific, you need to figure out which category to use.</p>
-
-<p>There are two startup notifications, both of which create the observer if it isn't already created. The first is provided by XPCOM. This notification will occur during initialization of XPCOM, where all XPCOM services are guaranteed to be available during the calls. Embedding applications may provide other notifications.</p>
-
-<p><span id="Common_XPCOM_Notifications"><a id="Common_XPCOM_Notifications"></a><strong>Common XPCOM Notifications</strong></span></p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">Category</td>
- <td class="header">Name</td>
- <td class="header">Value</td>
- <td class="header">Creates Component</td>
- </tr>
- <tr>
- <td>xpcom-startup</td>
- <td>Any</td>
- <td>Contract ID</td>
- <td>Yes</td>
- </tr>
- <tr>
- <td>xpcom-shutdown</td>
- <td>Any</td>
- <td>Contract ID</td>
- <td>No</td>
- </tr>
- <tr>
- <td>xpcom-autoregistration</td>
- <td>Any</td>
- <td>Contract ID</td>
- <td>No</td>
- </tr>
- <tr>
- <td>app-startup</td>
- <td>Any</td>
- <td>service, Contract ID</td>
- <td>*</td>
- </tr>
- </tbody>
-</table>
-
-<p>The table above summarizes the popular persistent notifications registered through the category manager. The name of the category itself is a well defined string, but the name-value pairs can be anything.</p>
-
-<p>When naming your component in the category, take care to use something that means something and doesn't muddy up the namespace. In this case, "WebLock" is unique and provides context to anyone looking at the category. The value of the name-value part is expected to be the contract ID of the component.</p>
-
-<p>Since every category can define the name-value pairs, the application "app-startup" category can support not only services but component instances as well. For the app-startup notification, you must explicitly pass the string "service," prior to the component's Contract ID. If you do not, the component will be created and then released after the notification, which may cause the component to be deleted.</p>
-
-<p>In short, to register the <strong>WebLock</strong> component as an xpcom-startup observer, do the following:</p>
-
-<pre>char* previous = nsnull;
-rv = catman-&gt;AddCategoryEntry("xpcom-startup",
- "WebLock",
- WebLock_ContractID,
- PR_TRUE, // persist category
- PR_TRUE, // replace existing
- &amp;previous);
-if (previous)
- nsMemory::Free(previous); // free the memory the replaced value might have used
-</pre>
-
-<p>The unregistration, which should occur in the unregistration callback, looks like this:</p>
-
-<pre>rv = catman-&gt;DeleteCategoryEntry("xpcom-startup",
- "WebLock",
- PR_TRUE); // persist
-</pre>
-
-<p>A complete code listing for registering <strong>WebLock</strong> as a startup observer follows:</p>
-
-<pre>#define MOZILLA_STRICT_API
-
-#include "nsIGenericFactory.h"
-
-#include "nsCOMPtr.h"
-#include "nsXPCOM.h"
-#include "nsIServiceManager.h"
-#include "nsICategoryManager.h"
-
-#include "nsMemory.h"
-
-#include "nsIObserver.h"
-
-#include "nsEmbedString.h"
-
-#define WebLock_CID \
-{ 0x777f7150, 0x4a2b, 0x4301, \
-{ 0xad, 0x10, 0x5e, 0xab, 0x25, 0xb3, 0x22, 0xaa}}
-
-#define WebLock_ContractID "@dougt/weblock"
-
-class WebLock: public nsIObserver
-{
- public:
- WebLock();
- virtual ~WebLock();
-
- NS_DECL_ISUPPORTS
- NS_DECL_NSIOBSERVER
-};
-
-WebLock::WebLock()
-{
- NS_INIT_ISUPPORTS();
-}
-
-WebLock::~WebLock()
-{
-}
-
-NS_IMPL_ISUPPORTS1(WebLock, nsIObserver);
-
-NS_IMETHODIMP
-WebLock::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData)
-{
- return NS_OK;
-}
-
-static NS_METHOD WebLockRegistration(nsIComponentManager *aCompMgr,
- nsIFile *aPath,
- const char *registryLocation,
- const char *componentType,
- const nsModuleComponentInfo *info)
-{
- nsresult rv;
-
- nsCOMPtr&lt;nsIServiceManager&gt; servman = do_QueryInterface((nsISupports*)aCompMgr, &amp;rv);
- if (NS_FAILED(rv))
- return rv;
-
- nsCOMPtr&lt;nsICategoryManager&gt; catman;
- rv = servman-&gt;GetServiceByContractID(NS_CATEGORYMANAGER_CONTRACTID,
- NS_GET_IID(nsICategoryManager),
- getter_AddRefs(catman));
-
- if (NS_FAILED(rv))
- return rv;
-
- char* previous = nsnull;
- rv = catman-&gt;AddCategoryEntry("xpcom-startup",
- "WebLock",
- WebLock_ContractID,
- PR_TRUE,
- PR_TRUE,
- &amp;previous);
- if (previous)
- nsMemory::Free(previous);
-
- return rv;
-}
-
-static NS_METHOD WebLockUnregistration(nsIComponentManager *aCompMgr,
- nsIFile *aPath,
- const char *registryLocation,
- const nsModuleComponentInfo *info)
-{
- nsresult rv;
-
- nsCOMPtr&lt;nsIServiceManager&gt; servman = do_QueryInterface((nsISupports*)aCompMgr, &amp;rv);
- if (NS_FAILED(rv))
- return rv;
-
- nsCOMPtr&lt;nsICategoryManager&gt; catman;
- rv = servman-&gt;GetServiceByContractID(NS_CATEGORYMANAGER_CONTRACTID,
- NS_GET_IID(nsICategoryManager),
- getter_AddRefs(catman));
- if (NS_FAILED(rv))
- return rv;
-
- rv = catman-&gt;DeleteCategoryEntry("xpcom-startup",
- "WebLock",
- PR_TRUE);
-
- return rv;
-}
-
-NS_GENERIC_FACTORY_CONSTRUCTOR(WebLock)
-
-static const nsModuleComponentInfo components[] =
-{
- {
- "WebLock",
- WebLock_CID,
- WebLock_ContractID,
- WebLockConstructor,
- WebLockRegistration,
- WebLockUnregistration
- }
-};
-
-NS_IMPL_NSGETMODULE(WebLockModule, components)
-</pre>
-
-<h3 id="Providing_Access_to_WebLock" name="Providing_Access_to_WebLock">Providing Access to <strong>WebLock</strong></h3>
-
-<p>At this point, the component will be called when XPCOM starts up. <strong>WebLock</strong> has already implemented the <code>nsISupports</code>, <code>nsIFactory</code>, <code>nsIModule</code>, and <code>nsIObserver</code> interfaces that handle generic component functionality including being initialized at startup. And it speaks to the Component Manager, Service Manager, Category Manager, and the Component Registrar to register itself properly with XPCOM.</p>
-
-<p>The next step is to expose additional functionality to Gecko applications and other clients to query and control the <strong>WebLock</strong> component. For example, the user interface needs to be able to enable and disable the web locking functionality, see what sites are in the whitelist, and add or remove sites from that list. WebLock needs to provide an API, and it needs to hook into Gecko in order to implement the actual locking functionality.</p>
-
-<p>译: 下一步是expose另外的功能以使得Gecko应用以及其它clients查询和控制WebLock组件. 例如, user interface(用户接口)要有能力去允许或者禁止web locking(web锁定)功能, 查看哪些站点在白名单列表中, 并向列表中添加或移除站点. WebLock需要提供一个API并挂接到Gecko中进而实现实际的locking功能.</p>
-
-<div class="side-note">
-<p><span id="The_WebLock_User_Interface"><a id="The_WebLock_User_Interface"></a><strong>The WebLock User Interface</strong></span></p>
-
-<p>The <strong>WebLock</strong> component in this tutorial uses XUL to define the additional browser UI in a cross-platform way, and XUL uses JavaScript to access and control XPCOM components, but Gecko's pluggable UI allows any user interface to call into Gecko and the components you create as easily as you can from XUL. See <a href="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#XUL">XUL</a> for a discussion of how XUL interacts with JavaScript and XPCOM.</p>
-
-<p>在这个教程中<strong>WebLock</strong>组件使用XUL来定义跨平台的浏览器UI, XUL使用JavaScript来访问和控制XPCOM组件, 但Gecko的可挂接UI也允许任何user interface调用Gecko和你所创建的组件, 就如同XUL一样容易. <a href="cn/Creating_XPCOM_Components/Building_the_WebLock_UI#XUL">XUL</a>讨论了XUL如何与JavaScript和XPCOM交互.</p>
-</div>
-
-<h3 id="Creating_the_WebLock_Programming_Interface" name="Creating_the_WebLock_Programming_Interface">Creating the WebLock Programming Interface</h3>
-
-<p>Design is one of the hardest parts of any programming problem. The question the interface for the <strong>WebLock</strong> component must answer is: How should <strong>WebLock</strong> look to the outside world? What, in other words, is the interaction of clients with the <strong>WebLock</strong> component? In this section, we enumerate the basic functionality the component should expose and create the single interface that organizes and provides this functionality.</p>
-
-<p>译: 设计是任何编程问题中最困难的部分之一. 问题是<strong>WebLock</strong>组件必须要回答一些问题: <strong>WebLock</strong>应该如何look to外面的世界? 换言之, 什么是clients与<strong>WebLock</strong>的交互? 在这部分列举了组件应该expose的基本功能和create一个组织和提供这些功能的接口.</p>
-
-<p>Instead of starting with the implementation, developers use XPIDL (see <a href="cn/Creating_XPCOM_Components/An_Overview_of_XPCOM#XPIDL_and_Type_Libraries">XPIDL and Type Libraries</a> for more information about XPIDL) to define the interface to the component: how the functionality should be organized, expressed, and exposed to its clients.</p>
-
-<p>译: 开发人员应该使用XPIDL(see <a href="cn/Creating_XPCOM_Components/An_Overview_of_XPCOM#XPIDL_and_Type_Libraries">XPIDL and Type Libraries</a> for more information about XPIDL)为组件定义接口(定义功能应该如何被组织, 描述和暴露给它的clients)做为开始, 而不应该从实现开始.</p>
-
-<p>In general, the <strong>WebLock</strong> service interface needs to include the following functionality:</p>
-
-<p>译: 通常, <strong>WebLock</strong>服务接口要包括以下功能:</p>
-
-<ul>
- <li><code>Lock</code> - Enable web locking so that any browser in the Gecko application is restricted to the white list of website domains.</li>
-</ul>
-
-<p>        译: <code>Lock</code> - 允许web locking, 这样任何Gecko应用中的浏览器被限定只能访问白名单中的web站点域.</p>
-
-<ul>
- <li><code>Unlock</code> - Disable web locking. This should allow any browser in the Gecko application to browse any website regardless of the white list.</li>
-</ul>
-
-<p>        译: <code>Unlock</code> - 禁止web locking. 允许Gecko应该中的浏览器访问任何web站点, 而不去管白名单列表.</p>
-
-<ul>
- <li><code>AddSite</code> - Add the current URL to the white list.</li>
-</ul>
-
-<p>        译: <code>AddSite</code> - 添加当前URL到白名单列表.</p>
-
-<ul>
- <li><code>RemoveSite</code> - Remove the current URL from the white list.</li>
-</ul>
-
-<p>        译: <code>RemoveSite</code> - 从白名单列表中移除当前URL.</p>
-
-<ul>
- <li><code>EnumerateSites</code> - Allows the enumeration of all sites in the white list. <code>EnumerateSites</code> might be used in the user interface to provide something like an editable listbox of all sites in the white list.</li>
-</ul>
-
-<p>        译: <code>EnumerateSites</code> - 允许列举出所有白名单中的站点. <code>EnumerateSites</code>可能会被user         interface(用户接口/用户界面)所提供的例如显示所有白名单列表的可编辑列表框控件所使用.</p>
-
-<p>Even this simple outline presents some ambiguity, however. It's certainly not enough to spell out the interface for the <strong>WebLock</strong> component in this way. For example, <code>AddSite</code> is supposed to add the current URL to the white list, but is the URL an input parameter to the method, is it the topmost web page in the Gecko application, or is it something more random-a URL picked from global history or that's been given context in some other way?</p>
-
-<p>As a strongly typed and implementation-agnostic language, XPIDL requires that you be quite specific about the APIs, the list of parameters, their order, and their types. XPIDL requires that you spell it all out, in other words. And it's this formality that makes the interfaces in XPCOM effective contracts between services and clients.</p>
-
-<p>The next section shows the interface of the <strong>WebLock</strong> component, <code>iWebLock</code>, in XPIDL. Once the interface has been described in the XPIDL language, the interface file can be used to generate the header files needed for the implementation code, the binary type library files that let you use the interface of the <strong>WebLock</strong> component from JavaScript, and even <span class="comment">broken link</span><a href="cn/Javadoc">javadoc</a> style HTML documentation.</p>
-
-<h3 id="Defining_the_Weblock_Interface_in_XPIDL" name="Defining_the_Weblock_Interface_in_XPIDL">Defining the <strong>Weblock</strong> Interface in XPIDL</h3>
-
-<p>Most interfaces in the XPCOM world are described in XPIDL. The XPIDL file for the <code>iWebLock</code> interface can be used to generate the C++ header file, which you'll need to implement the interface in the component and also a type library that makes the component accessible from JavaScript or other interpreted languages. In Mozilla, JavaScript is the bridge between components and the XUL-based user interface.</p>
-
-<p>译: 在XPCOM世界里大多数接口都是用XPIDL描述的. <code>iWebLock</code>接口的XPIDL文件可以被用来生成C++ header file(你需要它来在组件中实现接口和用来使组件在JavaScript和其它的解译型语言中可访问的类型库). 在Mozilla中, JavaScript是组件与基于XUL的user interface之间的桥梁.</p>
-
-<p>The XPIDL Syntax (XPIDL语法)</p>
-
-<p>The XPIDL syntax is a mix of C++ and Java, and of course it's very much like the OMG IDL upon which it is closely based. The XPIDL for <code>iWebLock</code> appears below:</p>
-
-<p><span id="iWebLock"><a id="iWebLock"></a><strong>iWebLock</strong></span></p>
-
-<pre>#include "nsISupports.idl"
-interface nsISimpleEnumerator;
-[scriptable, uuid(ea54eee4-9548-4b63-b94d-c519ffc91d09)]
-interface iWeblock : nsISupports
-{
- void lock();
- void unlock();
-
- // assume strings are UTF-8
- void addSite(in string url);
- void removeSite(in string url);
- attribute nsISimpleEnumerator sites;
-};
-</pre>
-
-<p>The first line includes the file <code>nsISupports.idl</code>, which defines the <code>nsISupports</code> interface from which all XPCOM interfaces must derive, and makes it possible for the <code>iWebLock</code> interface to subclass that base interface.</p>
-
-<pre>#include "nsISupports.idl"
-</pre>
-
-<p>The next line of the XPIDL is a forward declaration of the interface <code>nsISimpleEnumerator</code>. Again, this is similar to the forward declare in C++ (except that C++ does not have the <code>interface</code> keyword seen here).</p>
-
-<pre>interface nsISimpleEnumerator;
-</pre>
-
-<p>See the <a href="cn/Creating_XPCOM_Components/Resources#XPCOM_Resources">XPCOM resources</a> for more information about the XPIDL syntax.</p>
-
-<h4 id="Scriptable_Interfaces" name="Scriptable_Interfaces">Scriptable Interfaces</h4>
-
-<p>The third line in <a href="#iWebLock">iWebLock</a> is more complex. The first thing it says is that <code>iWebLock</code> will be<em>scriptable</em> .</p>
-
-<pre>[scriptable, uuid(ea54eee4-9548-4b63-b94d-c519ffc91d09)]
-</pre>
-
-<p>The rest of the line provides a UUID for this interface. Recall that every interface has a unique number that is assigned to it. In the case of interfaces, the identifier is an IID. In the case of the components, which also require unique identifiers, the identifier is the CID.</p>
-
-<h4 id="Subclassing_nsISupports" name="Subclassing_nsISupports">Subclassing <code>nsISupports</code></h4>
-
-<p>The next line in <a href="#iWebLock">iWebLock</a> names the interface and defines its base interface. <code>iWeblock</code> derives from <code>nsISupports</code>. XPIDL has no way to define multiple inheritance - something that all scriptable objects must deal with.</p>
-
-<pre>interface iWebLock : nsISupports
-</pre>
-
-<h4 id="The_Web_Locking_Interface" name="The_Web_Locking_Interface">The Web Locking Interface</h4>
-
-<p>The body of the block (the stuff between the curly braces) defines the methods and attributes of our interface. There are basically two functional sets on this interface. The first section of the interface controls whether or not <strong>WebLock</strong> checks to see if a web page can be loaded. If locked, <strong>WebLock</strong> will prevent sites not on the white list from loading.</p>
-
-<pre> void lock();
- void unlock();
-</pre>
-
-<p>This interface does not enforce any policy with respect to how the user enables or disables this feature. This allows maximum flexibility in the implementation. Any place in the application can acquire this interface via the Service Manager and call <code>unlock</code> or <code>lock</code>. For example, the user interface may bring up a dialog asking the user for a password before calling <code>unlock</code>. Another area of code, such as a "Profile Manager" that starts up and lets users choose which profile to use, may unconditionally call <code>unlock</code> on such a component when switching a profile.</p>
-
-<p>The next set of functionality manages the white list where acceptable domains are stored:</p>
-
-<pre> void addSite(in string url);
- void removeSite(in string url);
- attribute nsISimpleEnumerator sites;
-</pre>
-
-<p>Operations in this set - <code>add</code>, <code>remove</code>, and <code>enumerate</code> - will be called from a user interface that manages the white list and adds the current website to the white list. There is no policy applied to what sites get added or removed to this list, or who can remove a site.</p>
-
-<p>The most interesting method definition is the enumerator. First of all, it does not look like a method at all:</p>
-
-<pre>attribute nsISimpleEnumerator sites;
-</pre>
-
-<p>This line defines an attribute in the interface. In C++, this is considered a public variable and "compiled" into a <code>Get</code> method (e.g., <code>getSites</code>). If an attribute is not marked <code>readonly</code>, then both <code>Get</code> and <code>Set</code> methods are generated.</p>
-
-<p>The getter created by this attribute returns a <code>nsISimpleEnumerator</code> interface pointer. This interface allows you to pass a list of elements between interfaces. It has two methods: <code>hasMoreElements()</code> and <code>getNext()</code>.</p>
-
-<pre>[scriptable, uuid(D1899240-F9D2-11D2-BDD6-000064657374)]
-interface nsISimpleEnumerator : nsISupports
-{
- /**
- * Called to determine whether or not the enumerator has
- * any elements that can be returned via getNext(). This method
- * is generally used to determine whether or not to initiate or
- * continue iteration over the enumerator, though it can be
- * called without subsequent getNext() calls. Does not affect
- * internal state of enumerator.
- *
- * @see getNext()
- * @return PR_TRUE if there are remaining elements in the enumerator.
- * PR_FALSE if there are no more elements in the enumerator.
- */
- boolean hasMoreElements();
-
- /**
- * Called to retrieve the next element in the enumerator. The "next"
- * element is the first element upon the first call. Must be
- * preceded by a call to hasMoreElements() which returns PR_TRUE.
- * This method is generally called within a loop to iterate over
- * the elements in the enumerator.
- *
- * @see hasMoreElements()
- * @return NS_OK if the call succeeded in returning a non-null
- * value through the out parameter.
- * NS_ERROR_FAILURE if there are no more elements
- * to enumerate.
- * @return the next element in the enumeration.
- */
- nsISupports getNext();
-};
-</pre>
-
-<h3 id="Implementing_WebLock" name="Implementing_WebLock">Implementing <strong>WebLock</strong></h3>
-
-<p>Once you have defined the interfaces that the component will implement, you can begin to write the implementation code that will actually carry out the web locking functionality.</p>
-
-<p>The <strong>WebLock</strong> component implements three interfaces:</p>
-
-<ul>
- <li><code>nsISupports</code></li>
- <li><code>nsIObserver</code></li>
- <li><code>iWebLock</code></li>
-</ul>
-
-<p><code>nsISupports</code> is the base interface that all XPCOM objects must implement. The <code>nsIObserver</code> interface is for listening to various events that Gecko generates. Finally, the <code>iWebLock</code> interface is the interface that actually controls the web locking functionality. The first two have already been implemented as part of the generic module code. Recall from <a href="cn/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier">Using XPCOM Utilities to Make Things Easier</a> that implementing these basic interfaces can be easy and straightforward if you use the macros and other utilities that XPCOM provides.</p>
-
-<h4 id="Declaration_Macros" name="Declaration_Macros">Declaration Macros</h4>
-
-<p>The class declaration for the <code>WebLock</code> class that implements these three interfaces is as follows:</p>
-
-<pre>class WebLock: public nsIObserver, public iWebLock
-{
- public:
- WebLock();
- virtual ~WebLock();
-
- NS_DECL_ISUPPORTS
- NS_DECL_NSIOBSERVER
- NS_DECL_IWEBLOCK
-};
-</pre>
-
-<p>Note that we derive from the <code>nsIObserver</code> interface as well as the <code>iWeblock</code> class. We do not need to explicitly derive from <code>nsISupports</code> as both of these two other interfaces are already subclasses of <code>nsISupports</code>:</p>
-
-<p><span id="Interface_Hierarchy_for_WebLock"><a id="Interface_Hierarchy_for_WebLock"></a><strong>Interface Hierarchy for WebLock</strong></span></p>
-
-<p><img alt="Image:weblock-interface-hierarchy.png"></p>
-
-<p>The body of the class declaration uses declaration macros that are generated from an XPIDL interface file. Every header generated from an XPIDL file has a similar macro that defines all the methods in that interface. This makes changes to the interface when designing a bit simpler, as you do not have to modify any class declarations.</p>
-
-<p>There are times, of course, when you cannot use these macros-as when two interfaces share the same method signatures. In these cases you have to manually declare the methods in your class. But in practice, manually declaring class methods in XPCOM is the exception and not the rule. The <code>NS_DECL_IWEBLOCK</code> declaration macro expands into the following:</p>
-
-<pre> NS_IMETHOD Lock(void);
- NS_IMETHOD Unlock(void);
- NS_IMETHOD AddSite(const char *url);
- NS_IMETHOD RemoveSite(const char *url);
- NS_IMETHOD GetSites(nsISimpleEnumerator * *aSites);
- NS_IMETHOD SetSites(nsISimpleEnumerator *aSites);
-</pre>
-
-<h4 id="Representing_Return_Values_in_XPCOM" name="Representing_Return_Values_in_XPCOM">Representing Return Values in XPCOM</h4>
-
-<p>The code sample above is the C++ version of the <code>iWebLock</code> interface methods. The return result of XPCOM methods generated from XPIDL is always of the type <code>nsresult</code>, and the small macro used in these expansions, <code>NS_IMETHOD</code>, actually represents that return type. <code>nsresult</code> is returned even when in XPIDL you specify that the method return a <code>void</code>. If you require the return result to be something else, the methods are not truly XPCOM methods. If you really want to change the return result type you can use a special flag in your XPIDL that denotes this (see <a class="external" href="http://www.mozilla.org/scriptable/xpidl/">the XPIDL reference</a>). However, we suggest that you simply add an out parameter to the method.</p>
-
-<h4 id="XPIDL_Code_Generation" name="XPIDL_Code_Generation">XPIDL Code Generation</h4>
-
-<p>The XPIDL compiler also generates a stub implementation of the interface in a commented section of the generated header file, in which each method returns <code>NS_ERROR_NOT_IMPLEMENTED</code>. If you copy the stub implementation from the header file into the source, then rename the dummy class name ("<code>_MYCLASS_</code>") to the <code>WebLock</code> class name already defined, you should be able to compile the source successfully.</p>
-
-<h4 id="Getting_the_WebLock_Service_from_a_Client" name="Getting_the_WebLock_Service_from_a_Client">Getting the WebLock Service from a Client</h4>
-
-<p>At this point, you can install the XPCOM component and have other systems use it. The component doesn't do anything useful, of course, but you have written enough of the code to have it recognized and accessed as a component in XPCOM. The code snippet below illustrates how to get the <strong>WebLock</strong> service when the component is present:</p>
-
-<pre>nsCOMPtr&lt;nsIServiceManager&gt; servMan;
-nsresult rv = NS_GetServiceManager(getter_AddRefs(servMan));
-if (NS_FAILED(rv))
-{
- printf("ERROR: XPCOM error [%x].\n", rv);
- return -1;
-}
-nsCOMPtr&lt;iWebLock&gt; weblock;
-rv = servMan-&gt;GetServiceByContractID("@dougt/weblock",
- NS_GET_IID(iWeblock),
- getter_AddRefs(weblock));
-
-if (NS_FAILED(rv))
-{
- printf("ERROR: XPCOM obtaining service [%x].\n", rv);
- return -1;
-}
-</pre>
-
-<h4 id="Implementing_the_iWebLock_Interface_.28.E5.AE.9E.E7.8E.B0iWebLock.E6.8E.A5.E5.8F.A3.29" name="Implementing_the_iWebLock_Interface_.28.E5.AE.9E.E7.8E.B0iWebLock.E6.8E.A5.E5.8F.A3.29">Implementing the <code>iWebLock</code> Interface (实现iWebLock接口)</h4>
-
-<p>Once the interface is defined, you can focus on implementing the web lock startup functionality itself. The <strong>WebLock</strong> component starts automatically when XPCOM is started up because it's been registered as a category in XPCOM. When <strong>WebLock</strong> is called, one of the first things it wants to do is read in a file that lists the <abbr title="Uniform Resource Locator">URLs</abbr> that the browser is allowed to load. This file can exist anywhere on the local system, but we've placed it next to the application to keep things simple. The first step in this implementation phase, then, is to create the functionality that accesses this <strong>WebLock</strong> white list and uses its data to determine which domains are allowed and which are to be blocked. For this, we need to use the file interfaces available in XPCOM.</p>
-
-<p>一旦接口已被定义, 那你的重点应该放在实现web lock的功能上. 当XPCOM运行后WebLock组件也会被自动运行, 因为它已经被注册成为一个XPCOM中的category. 当WebLock被调用时, 它应该做的第一个事情就是读取一个文件, 这个文件列出了允许被浏览器加载的URLs. 这个文件可以位于本地系统中的任何位置, 但我们需要将其放置在距应用程序不远的地方以便操作起来简单一些. 接下来在实现阶段的第一步是实现两个功能, 一是访问WebLock的白名单, 二是使用这些数据去决定哪些域是被允许, 以及哪些是应该被拦截的. 为此, 我们需要使用XPCOM中的文件接口.</p>
-
-<h5 id="File_Interfaces" name="File_Interfaces">File Interfaces</h5>
-
-<p>Files and directories are abstracted and encapsulated by interfaces. There are a few reasons for not using strings to represent file locations, but the most important one is that not all file systems can be represented by a series of characters separated by a slash. On the Macintosh platform, for example, files are represented as a triplet - two numbers and one string - so using a string on the Macintosh does not adequately identify files on that operating system.</p>
-
-<p>文件和目录是通过接口来抽象和封装的. 这里有几个原因说明为什么不使用字符串来表示文件位置, 但更重要的一点是并不是所有的文件系统都能够表示成斜线所分割的字符序列. 例如, 在Macintosh(Apple的系统)平台上, 文件被表示成一个triplet(意思是由三个部分组成), 两个数字一个字符串, 因此在Macintosh系统上使用字符串并不能充分在标识文件.</p>
-
-<p><code>nsIFile</code>, the file interface in XPCOM, provides most of the functionally that file handling requires. That interface includes members representing the file name, file attributes, permissions, existence, and others. A related interface called <code>nsILocalFile</code> provides access to operations specific to local files, but the <code>nsIFile</code> functionality is adequate for the <strong>WebLock</strong> component.</p>
-
-<p>nsIFile, XPCOM中的文件接口, 提供了大多数操作文件所必须的功能. 这个接口中所包含的成员描述了文件的名字, 属性, 权限, 是否存在等等. 与之相关的接口nsILocalFile提供 操作特定的本地文件, 不过nsIFile的功能对于WebLock组件来说已经足够了.</p>
-
-<p><span id="File_Interface_Hierarchy"><a id="File_Interface_Hierarchy"></a><strong>File Interface Hierarchy</strong></span></p>
-
-<p><img alt="Image:file-iface-hierarchy.png"></p>
-
-<div class="side-note">
-<p><span id="Remote_Files_and_nsIFile"><a id="Remote_Files_and_nsIFile"></a><strong>Remote Files and nsIFile</strong></span></p>
-
-<p>It is not inconceivable for remote files to be represented by the <code>nsIFile</code> interface. Someone could write an <code>nsIFile</code> implementation that represented FTP files on some server. The existing code would need to change very little for a <strong>WebLock</strong> implementation to take advantage of files that do not actually exist on disk. This kind of implementation does not exist, but this expandability shows some of the flexibility that interface-based programming can provide.</p>
-
-<p>并不难想象, 为远程文件使用nsIFile接口来表示它. 某人可以写一个nsIFile的实现用以表示一些服务器上的FTP文件. 已经存在的代码必须要做一些效小的修改以使WebLock的实现可以接受实际上并不是存在于磁盘上的文件. 这种类型的实现虽然还并不存在, 但至少这种扩展性可以显现出一些基于接口的编程带来的灵活性.</p>
-
-<p>The <a href="cn/XPCOM_API_Reference">XPCOM API Reference</a> contains detailed information on <code>nsIFile</code> and other XPCOM interfaces.</p>
-</div>
-
-<h4 id="The_Directory_Service_.28.E7.9B.AE.E5.BD.95.E6.9C.8D.E5.8A.A1.29" name="The_Directory_Service_.28.E7.9B.AE.E5.BD.95.E6.9C.8D.E5.8A.A1.29">The Directory Service (目录服务)</h4>
-
-<p>The file interfaces are most useful when you can use them to find and manipulate files that are relative to the application. The Directory Service provides directory and file locations in a cross platform uniform way to make this easier. This service, available as <code>nsIDirectoryService</code>, stores the location of various common system locations, such as the the directory containing the running process, the user's <code>HOME</code> directory, and others. It can be expanded so that applications and components can define and store their own special locations - an application plugin directory, for example, preference files and/or directories, or other application specific paths. For example, to expose the location of the "white list" file containing all of the URLs that are safe for <strong>WebLock</strong>, you can add its location to the <code>nsDirectoryService</code>, which clients can then query for this infomation.</p>
-
-<p>文件接口较有助于当你使用它们去查找和操作与应用相关的文件. 目录服务提供了跨平台的目录与文件定位的统一方法, 这使得进行这种操作变得容易. 这个服务(利用nsIDirectoryService)存储了各种各样通用系统区域的位置, 例如像是包括了正在运行的程序的目录, 用户的HOME目录等等. 因此它可以被扩展为应用程序和组件能够定义并且存储它们自己的特定位置(应用程序插件目录), 例如, 用户自定义的文件和目录, 或者其它的应用程序的特定路径. 比如指定一个"white list"所在的位置, 它包括了所有对于WebLock来讲是安全的URLs, 你可以将这个位置添加到nsDirectoryService中, 使客户端接下来可以查询到这个信息.</p>
-
-<p>The Directory Service implements the <code>nsIProperties</code> interface, which allows you to <code>Get()</code>, <code>Set()</code>, and <code>Undefine()</code> interface pointers. In the case of <strong>WebLock</strong>, these interface pointers will be <code>nsIFile</code> objects.</p>
-
-<p>目录服务实现了nsIProperties接口, 它允许你Get(), Set()以及Undefine()接口指针. 在WebLock中这些接口指针是nsIFile对象.</p>
-
-<pre>[scriptable, uuid(78650582-4e93-4b60-8e85-26ebd3eb14ca)]
-interface nsIProperties : nsISupports
-{
- /**
- * Gets a property with a given name.
- * 用给定的名字(name)取得一个属性(property)
- *
- * @return NS_ERROR_FAILURE if a property with that
- * name doesn't exist.
- * 如果给定名字的属性不存在, 函数返回NS_ERROR_FAILURE
- * @return NS_ERROR_NO_INTERFACE if the
- * found property fails to QI to the
- * given iid.
- * 如果取得的属性在以给定的iid于QI方法上调用失败,
- * 函数返回NS_ERROR_NO_INTERFACE
- */
- void get(in string prop,
- in nsIIDRef iid,
- [iid_is(iid),retval] out nsQIResult result);
-
- /**
- * Sets a property with a given name to a given value.
- * 用给定的名字和给定的值为设置一个属性
- */
- void set(in string prop, in nsISupports value);
-
- /**
- * Returns true if the property with the given name exists.
- * 如果与给定名字的属性存在, 返回true
- */
- boolean has(in string prop);
-
- /**
- * Undefines a property. 取消一个属性的定义
- * @return NS_ERROR_FAILURE if a property with that name doesn't
- * already exist.
- * 如果给定名字的属性还不存在, 那么函数返回NS_ERROR_FAILURE
- */
- void undefine(in string prop);
-
- /**
- * Returns an array of the keys.
- * 返回一个key的集合
- */
- void getKeys(out PRUint32 count,
- [array, size_is(count), retval] out string keys);
-};
-</pre>
-
-<p><span id="Directory_Service_Hierarchy"><a id="Directory_Service_Hierarchy"></a><strong>Directory Service Hierarchy</strong></span></p>
-
-<p><img alt="Image:directoryservice-iface-hierarchy.png"></p>
-
-<p>There are two steps involved to find directories or files with the Directory Service (<code>nsIDirectoryService</code>). You must know the string key (or property) that refers to the location you are interested in, which is published in the file <code>nsDirectoryServiceDefs.h</code> that comes with the Gecko SDK (for a listing of these locations, see the <a href="cn/XPCOM_API_Reference">XPCOM API Reference</a>). The string key for the directory containing the application executable is <code>NS_XPCOM_CURRENT_PROCESS_DIR</code>. Given this key, you can acquire the directory service, call <code>Get()</code>, and pass the key. In the example below, <code>appDir</code> will point to the directory that contains the executable.</p>
-
-<p>这里有两个步骤有关于通过目录服务(nsIDirectoryService)查找目录或文件. 你必须要知道字符串键(或叫属性)用以引用你所想要的位置, 字符串键(或叫属性)被公开于随Gecko SDK一起提供的nsDirectoryServiceDefs.h文件中(可参见<a href="cn/XPCOM_API_Reference">XPCOM API Reference</a>以得到这些位置的一个列表). 包含可执行程序的目录的字符串键是NS_XPCOM_CURRENT_PROCESS_DIR. 给定这个键, 你就可以通过调用Get()并将键传递到函数中以获得目录服务. 在下面的实例中, appDir将指向一个包含了可执行程序的目录.</p>
-
-<pre>nsCOMPtr&lt;nsIServiceManager&gt; servMan;
-nsresult rv = NS_GetServiceManager(getter_AddRefs(servMan));
-if (NS_FAILED(rv)) return -1;
-
-nsCOMPtr&lt;nsIProperties&gt; directoryService;
-rv = servMan-&gt;GetServiceByContractID(NS_DIRECTORY_SERVICE_CONTRACTID,
- NS_GET_IID(nsIProperties),
- getter_AddRefs(directoryService));
-
-if (NS_FAILED(rv)) return -1;
-
-nsCOMPtr&lt;nsIFile&gt; appDir;
-rv = directoryService-&gt;Get(NS_XPCOM_CURRENT_PROCESS_DIR,
- NS_GET_IID(nsIFile),
- getter_AddRefs(appDir));
-
-if (NS_FAILED(rv)) return -1;
-</pre>
-
-<p>Most of the useful functionality is exposed by the <code>nsIProperties</code> interface, but the directory service also implements <code>nsIDirectoryService</code>. This interface allows you to extend and override <code>nsIFile</code> objects registered with the directory service. There are currently two ways to add a file location to the directory service: directly and using the delayed method. The direct method is to add a new <code>nsIFile</code> object using the <code>nsIProperties</code> interface, in which case you pass the <code>nsIFile</code> object as an <code>nsISupports</code> to the <code>Set()</code> method of the <code>nsIProperties</code> interface.</p>
-
-<p>大多数有用的功能都是通过nsIProperties接口所提供, 但目录服务还实现了nsIDirectoryService. nsIDirectoryService接口允许利用目录服务你去扩展和重写nsIFile对象的注册. 当前有两种方法添加一个文件位置到目录服务中:立即的与延迟的两种方法. 立即的方法是使用nsIProperties接口添加一个新的nsIFile对象, 在这种情况下你要把nsIFile对象当成一个nsISupports传递给nsIProperties接口的Set()函数.</p>
-
-<p>In the delayed method, you register to be a callback that can provide an <code>nsIFile</code>. To do this, you must get the implementation like we did above. When you have it, <code>QueryInterface</code> for the <code>nsIDirectoryService</code> interface. In this interface, there is a function which allows you to register an <code>nsIDirectoryServiceProvider</code> interface. The interface callback looks like this:</p>
-
-<pre>[scriptable, uuid(bbf8cab0-d43a-11d3-8cc2-00609792278c)]
-interface nsIDirectoryServiceProvider: nsISupports
-{
-/**
-* getFile
-*
-* Directory Service calls this when it gets the first request for
-* a prop or on every request if the prop is not persistent.
-*
-* @param prop The symbolic name of the file.
-* @param persistent TRUE - The returned file will be cached by Directory
-* Service. Subsequent requests for this prop will
-* bypass the provider and use the cache.
-* FALSE - The provider will be asked for this prop
-* each time it is requested.
-*
-* @return The file represented by the property.
-*
-*/
-nsIFile getFile(in string prop, out PRBool persistent);
-};
-</pre>
-
-<h4 id="Modifying_Paths_with_nsIFile" name="Modifying_Paths_with_nsIFile">Modifying Paths with <code>nsIFile</code></h4>
-
-<p>The directory service returns an <code>nsIFile</code> object, but that object points to the application directory and not the file itself. To modify this <code>nsIFile</code> so that it points to the file, you must call the <code>Append</code> method of the <code>nsIFile</code>. <code>Append</code> adds the input string to the path already specified in the <code>nsIFile</code>. On Unix, for example, calling <code>Append("b")</code> on an <code>nsIFile</code> modifies that <code>nsIFile</code> representing <code>/u/home/dougt/a</code> to point to <code>/u/home/dougt/a/b</code>. The next operation on the <code>nsIFile</code> returns results associated with the "b" path. If "a" wasn't a directory, further operations would fail, even if the initial <code>Append</code> was successful. This is why <code>Append</code> is considered a string operation.</p>
-
-<p>目录服务返回一个nsIFile对象, 但nsIFile对象指向的是应用程序目录而并不是文件. 因此为了修改nsIFile对象以指向文件你必须要调用nsIFile的Append函数. Append函数将字符串输入参数追加到已经被指定到nsIFile的路径里. 例如在Unix里, 在一个nsIFile上调用Append("b")将使nsIFile从指向/u/home/dougt/a修改为指向/u/home/dougt/a/b. 在nsIFile上的后续操作返回的结果将是关于"b"这个路径的. 如果"a"不是一个目录, 那么进一步的操作将会失败, 尽管对于Append函数的调用是成功的. 这就是为什么Append函数被认为是对字符串的操作(不进行目录路径的有效性验证).</p>
-
-<p>The <strong>WebLock</strong> component manipulates a file named <code>weblock.txt</code>. The following snippet adjusts the <code>theFile</code> object representing that file:</p>
-
-<p>WebLock组件操作名为weblock.txt的文件, 以下程序片段调整了theFile对象以表示那个文件:</p>
-
-<pre>nsEmbedCString fileName("weblock.txt");
-appDir-&gt;AppendNative(fileName);
-</pre>
-
-<h4 id="Manipulating_Files_with_nsIFile" name="Manipulating_Files_with_nsIFile">Manipulating Files with <code>nsIFile</code></h4>
-
-<p>Once you have an <code>nsIFile</code> object pointing to the file that you're interested in, you can open it and read its contents into memory. There are many ways to do this: You can use Standard ANSI File I/O, or NSPR (see <a href="#The_Netscape_Portable_Runtime_Library">The Netscape Portable Runtime Library</a> below for a brief description of NSPR), or you can use the networking APIs that Gecko provides.</p>
-
-<div class="side-note">
-<p><span id="The_Netscape_Portable_Runtime_Library"><a id="The_Netscape_Portable_Runtime_Library"></a><strong>The Netscape Portable Runtime Library</strong></span></p>
-
-<p>The<em>Netscape Portable Runtime Library</em> (NSPR) is a platform-independent library that sits below XPCOM. As a layer of abstraction above the operating system, the NSPR allows Gecko applications to be platform independent by providing the following system-level facilities:</p>
-
-<ul>
- <li>Threads</li>
- <li>Thread synchronization</li>
- <li>File and network I/O</li>
- <li>Timing and intervals</li>
- <li>Memory management</li>
- <li>Shared library linking</li>
-</ul>
-
-<p>The NSPR is included in the Gecko SDK.</p>
-</div>
-
-<p>To keep things as simple as possible, we'll read the file into memory using standard ANSI file I/O, but for examples and information about how to use<em>necko</em> , the Gecko networking libraries, see <a class="external" href="http://www.mozilla.org/projects/netlib/" rel="freelink">http://www.mozilla.org/projects/netlib/</a>.</p>
-
-<h4 id="Using_nsILocalFile_for_Reading_Data" name="Using_nsILocalFile_for_Reading_Data">Using <code>nsILocalFile</code> for Reading Data</h4>
-
-<p>An <code>nsIFile</code> object returned from the directory service may also implement the <code>nsILocalFile</code> interface, which has a method that will return a <code>FILE</code> pointer that can be used in <code>fread()</code>. To implement the actual read, you need to allocate a buffer the length of the file, use the <code>nsILocalFile</code> interface pointer to obtain a <code>FILE *</code>, use this result with <code>fread</code>, and close the file pointer.</p>
-
-<p>The following code loads the contents of the file referenced by the <code>nsIFile</code> object <code>theFile</code> into the buffer <code>buf</code>:</p>
-
-<pre>nsCOMPtr&lt;nsILocalFile&gt; localFile = do_QueryInterface(theFile);
-if (!localFile)
- return -1;
-
-PRBool exists;
-rv = theFile-&gt;Exists(&amp;exists);
-if (NS_FAILED(rv))
- return -1;
-
-char *buf = NULL;
-
-if (exists)
-{
- // determine file size:
- PRUint32 fs, numread;
- PRInt64 fileSize;
- rv = theFile-&gt;GetFileSize(&amp;fileSize);
- if (NS_FAILED(rv))
- return -1;
-
- // Converting 64 bit value to unsigned int
- LL_L2UI(fs, fileSize);
-
- FILE* openFile;
- rv = localFile-&gt;OpenANSIFileDesc("rw", &amp;openFile);
- if (NS_FAILED(rv))
- return -1;
-
- char *buf = (char *)malloc((fs+1) * sizeof(char));
- if (!buf)
- return -1;
-
- numread = fread(buf, sizeof(char), fs, openFile);
-
- if (numread != fs)
- // do something useful.
-
- // ...
-}
-
-if (buf)
- free(buf);
-</pre>
-
-<p>The first line of the code calls <code>QueryInterface</code> on <code>theFile</code>, and if that succeeds assigns the new interface pointer to <code>localFile</code>. If the <code>QueryInterface</code> call fails, <code>localFile</code> will have a value of <code>NULL</code>.</p>
-
-<div class="side-note">
-<p>Note that the out parameter of the method <code>GetFileSize</code> is a 64-bit integer. The type of this variable is <code>PRInt64</code>, but this type is not represented as a primitive on all platforms. On some platforms, <code>PRInt64</code> is a <code>struct</code> with two fields - a high and a low 32-bit integer. So operations on this type must use special macros that do the right thing on each platform. On Windows or Linux, for example, it is possible to multiply a <code>PRInt64</code> by a long like this:</p>
-
-<pre>PRInt64 x = 1, y = 2;
-y = x * 2;
-</pre>
-
-<p>However, this same snippet will not compile on a platform like Macintosh OS 9, where you need to use macros to perform the calculation:</p>
-
-<pre>PRInt64 x, y, two;
-LL_I2L(x, 1);
-LL_I2L(y, 2);
-LL_I2L(two, 2);
-LL_MUL(y, x, two);
-</pre>
-
-<p>A full listing of NSPR's <code>long long</code> support can be found at <a class="external" href="http://www.mozilla.org/projects/nspr/" rel="freelink">http://www.mozilla.org/projects/nspr/</a>.</p>
-
-<p>The <strong>WebLock</strong> component doesn't have to deal with files that are longer than 2<sup>32</sup> bytes. Truncating this value to whatever can fit into a 32-bit unsigned integer may not work for every application, but in this case it doesn't really matter.</p>
-</div>
-
-<h4 id="Processing_the_White_List_Data" name="Processing_the_White_List_Data">Processing the White List Data</h4>
-
-<p>There are various ways to process the file data itself. The file <code>weblock.txt</code> consists of URL tokens separated by return characters, which makes them easy to read into a data structure.</p>
-
-<p>The white list file can be read in as soon as the component starts up (i.e., as <strong>WebLock</strong> intercepts the startup notification in the <code>Observe</code> method of the <code>nsIObserver</code> interface that we implement). Since we have only registered to receive a notification when XPCOM starts up, it's a safe assumption that <code>Observe</code> will only be called during the startup event, so we can read the file data in the callback.</p>
-
-<p>After you've read the data into memory, you need to store it in some way to make data access quick and efficient.</p>
-
-<div class="side-note">
-<p><span id="URL_Checking"><a id="URL_Checking"></a><strong>URL Checking</strong></span></p>
-
-<p>The way in which URL checking is implemented in the <strong>WebLock</strong> component is not at all optimal. The <strong>WebLock</strong> component manages a simple linked list of URL strings. A linear search through the data in the white list may not be terribly bad if the number of URLs is under a couple of dozen, but it decays as the list grows. There's also a large bottleneck in the network request. URL data is accessed as in the diagram below:</p>
-
-<p><img alt="Image:urldata-access-in-weblock.png"></p>
-
-<p>You might construct hash values for each of the URL strings instead, or add them to some kind of database. But we leave optimizations and real-world performance for web locking to the reader.</p>
-</div>
-
-<h3 id="iWebLock_Method_by_Method" name="iWebLock_Method_by_Method"><code>iWebLock</code> Method by Method</h3>
-
-<p>The implementation of the <code>iWeblock</code> interface is straightforward. <strong>WebLock</strong> is designed so that the user interface notifies this service when we should go into lock mode. During this time, any new URL request that is not in our list of "good" URLs will be denied. Through scriptable access to the <code>iWebLock</code> interface, the user interface can also add, remove, and enumerate the list of URLs that it knows about.</p>
-
-<h4 id="Lock_and_Unlock" name="Lock_and_Unlock"><code>Lock</code> and <code>Unlock</code></h4>
-
-<p>The <code>lock</code> and <code>unlock</code> methods simply set a Boolean representing state in the object. This Boolean value will be used later to determine if we should be denying URL requests:</p>
-
-<pre>/* void lock (); */
-NS_IMETHODIMP
-WebLock::Lock()
-{
- mLocked = PR_TRUE;
- return NS_OK;
-}
-
-/* void unlock (); */
-NS_IMETHODIMP WebLock::Unlock()
-{
- mLocked = PR_FALSE;
- return NS_OK;
-}
-</pre>
-
-<h4 id="AddSite" name="AddSite"><code>AddSite</code></h4>
-
-<p>For <code>AddSite</code>, we add a new node to our linked list. The link list nodes contain a <code>char*</code> which points to the string URL that we care about and, of course, a pointer to the next element in the list.</p>
-
-<div class="side-note">
-<p><span id="%3Ccode%3EnsMemory%3C/code%3E_for_Cross-component_Boundaries"><a id="%3Ccode%3EnsMemory%3C/code%3E_for_Cross-component_Boundaries"></a><strong><code>nsMemory</code> for Cross-component Boundaries</strong></span></p>
-
-<p>WebLock maintains ownership of all the memory it allocates, so you can use just about any allocator that you want for <strong>WebLock</strong>, but this is not always the case. In other places, where allocated buffers cross interface boundaries, you must ensure that the correct allocator is used - namely <code>nsMemory</code> - so that the allocators can match the allocation with the deallocation.</p>
-
-<p>Suppose you call <code>malloc</code> from object A and pass this buffer to another object B, for example. But if object B is using a special allocator that does garbage collection, then when object B deletes a buffer allocated by object A's allocator, the results are unpredictable: probably an assertion will be raised, possibly a memory leak, or a crash. The <code>nsMemory</code> class is a wrapper around the <code>nsIMemory</code> interface, whose only implementation is part of XPCOM. When you use <code>nsMemory</code>, you are guaranteed to be using this same memory allocator in all cases, and this avoids the problem described here.</p>
-</div>
-
-<h4 id="RemoveSite" name="RemoveSite"><code>RemoveSite</code></h4>
-
-<p><code>RemoveSite</code> deletes a node from the linked list:</p>
-
-<pre>// a simple link list.
-struct urlNode
-{
- char* urlString;
- struct urlNode* next;
-};
-
-/* void addSite (in string url); */
-NS_IMETHODIMP
-WebLock::AddSite(const char *url)
-{
- // we don't special-case duplicates here
- urlNode* node = (urlNode*) malloc(sizeof(urlNode));
- node-&gt;urlString = strdup(url);
- node-&gt;next = mRootURLNode;
- mRootURLNode = node;
-
- return NS_OK;
-}
-
-/* void removeSite (in string url); */
-NS_IMETHODIMP
-WebLock::RemoveSite(const char *url)
-{
- // find our entry.
- urlNode* node = mRootURLNode;
- urlNode* prev = nsnull;
-
- while (node) // test this!
- {
- if (strcmp(node-&gt;urlString, url) == 0)
- {
- free(node-&gt;urlString);
- if (prev)
- prev-&gt;next = node-&gt;next;
- free(node);
- return NS_OK;
- }
- prev = node;
- node = node-&gt;next;
- }
-
- return NS_ERROR_FAILURE;
-}
-</pre>
-
-<h4 id="SetSites" name="SetSites"><code>SetSites</code></h4>
-
-<p>The purpose of <code>SetSites</code> is to allow clients to pass an enumeration, or set, of URL strings to add to the white list of URLs. <code>SetSites</code> uses an <code>nsISimpleEnumerator</code> and shows how primitive data can be passed as an <code>nsISupports</code> object. The <code>nsISimpleEnumerator</code> interface is shown in <a href="#The_Web_Locking_Interface">The Web Locking Interface</a>.</p>
-
-<p>The first method returns a Boolean if there are more elements in the set. Internally, the object knows the number of elements it has in its enumeration, and every time a client calls <code>getNext</code>, it decrements a counter - or adjusts a pointer to the next element. When the counter goes to zero or the pointer points to a non-element, <code>hasMoreElements</code> will return false.</p>
-
-<p>There is no way to reset an <code>nsISimpleEnumerator</code>. For example, you can't re-enumerate the set. If you need random access to the elements in a <code>nsISimpleEnumerator</code>, you can read them from the <code>nsISimpleEnumerator</code>, store them in an array, and access them there. The <code>getNext</code> method returns a <code>nsISupports</code> interface pointer.</p>
-
-<p>When you want to pass primitive data types like numbers, strings, characters, <code>void *</code>, and others, the solution is to use one of the <code>nsISupportsPrimitive</code> interfaces. These interfaces wrap primitive data types and derive from <code>nsISupports</code>. This allows types like the strings that represent URLs in the <strong>WebLock</strong> component to be passed though methods that take an <code>nsISupports</code> interface pointer. This becomes clear when when you see the implementation of <code>SetSites</code>:</p>
-
-<pre>NS_IMETHODIMP
-WebLock::SetSites(nsISimpleEnumerator * aSites)
-{
- PRBool more = PR_TRUE;
- while (more)
- {
- nsCOMPtr&lt;nsISupports&gt; supports;
- aSites-&gt;GetNext(getter_AddRefs(supports));
-
- nsCOMPtr&lt;nsISupportsCString&gt; supportsString = do_QueryInterface(supports);
-
- if (supportsString)
- {
- nsEmbedCString url;
- supportsString-&gt;GetData(url);
- AddSite(url.get());
- }
-
- aSites-&gt;HasMoreElements(&amp;more);
- }
-
- return NS_OK;
-}
-</pre>
-
-<h4 id="GetNext" name="GetNext"><code>GetNext</code></h4>
-
-<p><code>GetNext</code> is called with the <code>nsCOMPtr</code> of an <code>nsISupportsCString</code>. <code>nsCOMPtr</code>s are nice because they do whatever <code>QueryInterface</code> calls are necessary under the hood. For example, we know that the <code>GetNext</code> method takes an <code>nsISupports</code> object, but we may not be sure whether the return result supports the interface we want, <code>nsISupportsCString</code>. But after <code>GetNext</code> returns, the <code>nsCOMPtr</code> code takes the out parameter from <code>GetNext</code> and tries to <code>QueryInterface</code> it to the <code>nsCOMPtr</code>'s type. In this case, if the out parameter of <code>GetData</code> does not return something that is <code>QueryInterface</code>-able to an <code>nsISupportsCString</code>, the variable will be set to <code>null</code>. Once you know that you have an <code>nsISupportsCString</code>, you can grab the data from the primitive supports interface.</p>
-
-<p>To get something you can pass into the <code>AddSite</code> method, you need to convert from an <code>nsEmbedCString</code> to a <code>const char*</code>. To do this, you can take advantage of the <code>nsEmbedCString</code> described in <a href="cn/Creating_XPCOM_Components/Using_XPCOM_Utilities_to_Make_Things_Easier#String_Classes_in_XPCOM">String Classes in XPCOM</a>.</p>
-
-<h4 id="GetSites" name="GetSites"><code>GetSites</code></h4>
-
-<p>The implementation of <code>GetSites</code> is more involved. You must construct an implementation of <code>nsISimpleEnumerator</code> and return it when <code>GetSites</code> is called. The class needs to walk the list of <code>urlNode</code>'s for every call to <code>GetNext</code>, so it makes sense for the constructor itself to take an <code>urlNode</code>:</p>
-
-<pre>class myEnumerator : public nsISimpleEnumerator
-{
- public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSISIMPLEENUMERATOR
-
- myEnumerator(urlNode* node) {
- NS_INIT_ISUPPORTS()
- mNode = node;
- }
- virtual ~myEnumerator(void) {}
-
- protected:
- urlNode* mNode;
- nsCOMPtr&lt;nsIComponentManager&gt; mCompMgr;
-};
-
-NS_IMPL_ISUPPORTS1(myEnumerator, nsISimpleEnumerator);
-</pre>
-
-<p>The <code>myEnumerator</code> class is going to implement the <code>nsISupports</code> interface and also <code>nsISimpleEnumerator</code>. The only state that it needs to maintain is the current URL node - the one that will be return on the next call to <code>GetNext</code>. There is also an <code>nsCOMPtr</code> to the <code>nsIComponentManager</code>, which is used in every call to <code>GetNext</code> so that you can create <code>nsISupportsCString</code> objects and cache the interface pointer as an optimization.</p>
-
-<h4 id="HasMoreElements" name="HasMoreElements"><code>HasMoreElements</code></h4>
-
-<p><code>HasMoreElements</code> is simple. All you need to do is make sure that <code>mNode</code> isn't <code>null</code>:</p>
-
-<pre>NS_IMETHODIMP
-myEnumerator::HasMoreElements(PRBool* aResult)
-{
- if (!aResult)
- return NS_ERROR_NULL_POINTER;
-
- if (!mNode) {
- *aResult = PR_FALSE;
- return NS_OK;
- }
-
- *aResult = PR_TRUE;
- return NS_OK;
-}
-</pre>
-
-<p><code>GetNext</code> needs to create an <code>nsISupportsCString</code> so that you can pass the URL string out through the <code>nsISupports</code> parameter. You must also move <code>mNode</code> to point to the next <code>urlNode</code>.</p>
-
-<pre>static NS_DEFINE_CID(kSupportsCStringCID, NS_SUPPORTS_CSTRING_CID);
-
-NS_IMETHODIMP
-myEnumerator::GetNext(nsISupports** aResult)
-{
- if (!aResult)
- return NS_ERROR_NULL_POINTER;
-
- *aResult = nsnull;
-
- if (!mNode)
- return NS_ERROR_FAILURE;
-
- if (!mCompMgr)
- {
- NS_GetComponentManager(getter_AddRefs(mCompMgr));
- if (!mCompMgr)
- return NS_ERROR_UNEXPECTED;
- }
-
- nsISupportsCString* stringSupports;
- mCompMgr-&gt;CreateInstance(kSupportsCStringCID,
- nsnull,
- NS_GET_IID(nsISupportsCString),
- (void**)&amp;stringSupports);
- if (!stringSupports)
- return NS_ERROR_UNEXPECTED;
-
- nsEmbedCString str(mNode-&gt;urlString);
- stringSupports-&gt;SetData(str);
-
- *aResult = stringSupports; // addref'ed above.
-
- mNode = mNode-&gt;next;
-
- return NS_OK;
-}
-</pre>
-
-<p>在实际的<code>GetSites</code>呼叫中, 你需要做的就是产生一个<code>myEnumerator</code>实例并且返回它.</p>
-
-<p>此前,我们建立了一个类并且把它注册到组件管理器。当一个客户端需要获取某个接口的实现时,实际上的对象建立过程隐藏在XPCOM代码中。 但是其中, 你要初始化你自己的<code>nsISimpleEnumerator</code>实现. 这是一个简单的事情,但是你需要注意<code>NS_ADDREF</code>.</p>
-
-<pre>NS_IMETHODIMP
-WebLock::GetSites(nsISimpleEnumerator * *aSites)
-{
- myEnumerator* enumerator = new myEnumerator(mRootURLNode);
- if (!enumerator)
- return NS_ERROR_OUT_OF_MEMORY;
-
- NS_ADDREF(*aSites = enumerator);
- return NS_OK;
-}
-</pre>
-
-<div class="side-note">
-<p><span id="AddRef,_Releasing,_and_Deleting_Objects"><a id="AddRef,_Releasing,_and_Deleting_Objects"></a><strong>AddRef, Releasing, and Deleting Objects</strong></span></p>
-
-<p>永远不要忘记调用你通过<code>new</code>建立的XPCOM对象的<code>AddRef</code>方法。所有的代码或者活动组件都应该有一个起码一个引用计数。忘记这点可能引起麻烦。</p>
-
-<p>一个相关的警示试你不要忘记永远不要用<code>delete</code>删除一个XPCOM. 当系统的一部分不是释放而是删除一个XPCOM对象的时候,可能会引起几个小时的资源搜索并且引起崩溃。</p>
-</div>
-
-<p>注意上面的实现中,当其他的线程访问链接表的时候<code>myEnumerator</code> 可能变得非法。枚举仅仅表现了访问URL字符串链接表的一个方法。如果你需要枚举成为URL字符串链表的一个快照,你需要重构这个实现让枚举持有一个链表的copy。</p>
-
-<p>当组件中止的时候,你也需要把链表写到磁盘里并且释放空间。我们把这个作为练习留给读者。</p>
-
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/Creating_XPCOM_Components:Using_XPCOM_Utilities_to_Make_Things_Easier" style="float: left;">« 上一页</a><a href="/zh-CN/docs/Creating_XPCOM_Components:Finishing_the_Component">下一页 »</a></p>
-</div> <p></p><div class="licenseblock">
-<p>Copyright (c) 2003 by Doug Turner and Ian Oeschger. This material may be distributed only subject to the terms and conditions set forth in the <a class="external" href="http://www.opencontent.org/openpub/" rel="noopener">Open Publication License</a>, v1.02 or later. Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. Distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder.</p>
-</div><p></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/using_xpcom_components/index.html b/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/using_xpcom_components/index.html
deleted file mode 100644
index a0a5b301ba..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/using_xpcom_components/index.html
+++ /dev/null
@@ -1,311 +0,0 @@
----
-title: 创建_XPCOM_组件/使用_XPCOM_组件
-slug: Mozilla/Tech/XPCOM/Guide/Creating_components/Using_XPCOM_Components
-tags:
- - XPCOM
- - 所有分类
-translation_of: Mozilla/Tech/XPCOM/Guide/Creating_components/Using_XPCOM_Components
----
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/创建_XPCOM_组件:XPCOM_简介" style="float: left;">« 上一页</a><a href="/zh-CN/docs/Creating_XPCOM_Components:Component_Internals">下一页 »</a></p>
-</div><p></p>
-
-<p>创建一个新的 XPCOM 组件, 特别是在我们设计一个供别人使用的组件接口的时候, 最好方式是参照已有的组件. 我们在编写 <a href="cn/Creating_XPCOM_Components/Starting_WebLock">Starting WebLock</a> 这个例子的时候, 也是这么做的.</p>
-
-<p>Mozilla 浏览器应用是复杂的, 模块化的 XPCOM 客户程序. 实际上, 基本上所有与浏览器相关的功能都被定义成了组件的形式, 包括网页间的跳转, 窗口管理, cookie 管理, 书签, 安全, 搜索, 润色等等的其他功能, 这些功能都是由组件的接口提供的. Mozilla<em>就是</em>一堆 XPCOM 组件.</p>
-
-<p>本章将讨论 Mozilla 是如何使用象 CookieManager 这样的 XPCOM 对象, 然后根据这些例子我们定义 WebLock 组件的访问接口.</p>
-
-<h3 id=".E7.BB.84.E4.BB.B6.E7.9A.84.E4.BE.8B.E5.AD.90" name=".E7.BB.84.E4.BB.B6.E7.9A.84.E4.BE.8B.E5.AD.90">组件的例子</h3>
-
-<p>可以在这里 <a href="cn/XPCOM_API_Reference">XPCOM API Reference</a> 找到下面要描述的组件. 我们要了解的是象本节中所给出的组件是如何被 Mozilla 浏览器获取和使用的.</p>
-
-<h4 id="Cookie_.E7.AE.A1.E7.90.86.E5.99.A8" name="Cookie_.E7.AE.A1.E7.90.86.E5.99.A8">Cookie 管理器</h4>
-
-<p>Cookie 管理是以组件形式向 Mozilla 浏览器提供支持的众多组件之一, 这些组件可以被重用在需要类似功能的应用中. 当用户通过 Cookie 管理器对话框来观察, 组织, 或者删除 cookies 的时候, Cookie 管理器在背后默默的工作. <a href="#Cookie_管理器对话框">Cookie 管理器对话框</a>负责向用户提供 Cookie 管理器的 UI 界面<sup><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/Using_XPCOM_Components#endnote_cookie-manager-ui">[cookie-manager-ui]</a></sup>.</p>
-
-<p><span id="Cookie_%E7%AE%A1%E7%90%86%E5%99%A8%E5%AF%B9%E8%AF%9D%E6%A1%86"><a id="Cookie_%E7%AE%A1%E7%90%86%E5%99%A8%E5%AF%B9%E8%AF%9D%E6%A1%86"></a><strong>Cookie 管理器对话框</strong></span></p>
-
-<p><img alt="Image:cookie_mgr_dlog.png"></p>
-
-<p>对话框是用 XUL (XML UI 语言) 和 JavaScript 语言编写, 使用称为<em>XPConnect</em> 的组件无缝连接到 Cookie 管理器组件(参看下面的 <a href="#从接口连接到组件">从接口连接到组件</a>). XUL 只是一种暴露 Cookie 管理器功能的方式, 但是却是 Mozilla 环境下最有用的方式之一.</p>
-
-<p>CookieManager 组件的功能通过 <code>nsICookieManager</code> 接口提供, 接口的方法如下:</p>
-
-<p><span id="%3Ccode%3EnsICookieManager%3C/code%3E_%E6%8E%A5%E5%8F%A3"><a id="%3Ccode%3EnsICookieManager%3C/code%3E_%E6%8E%A5%E5%8F%A3"></a><strong><code>nsICookieManager</code> 接口</strong></span></p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>removeAll</code></td>
- <td>删除 cookie 列表中所有的 cookies.</td>
- </tr>
- <tr>
- <td><code>enumerator</code></td>
- <td>通过 cookie 列表枚举.</td>
- </tr>
- <tr>
- <td><code>remove</code></td>
- <td>从列表中删除某个 cookie .</td>
- </tr>
- </tbody>
-</table>
-
-<p>XPCOM 中所有的接口必须固定, 虽然组件对接口的实现会有所变化. 接口都是<em>public</em> 的, 相对的, 接口实现是 private 的<sup><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/Using_XPCOM_Components#endnote_private-xpcom-interfaces">[private-xpcom-interfaces]</a></sup>. 当用户选中 cookie 列表中的一个 cookie, 点击 Remove 按钮, <code>nsICookieManager</code> 接口的 <code>Remove</code> 方法被调用. CookieManager 组件执行该函数, 选中的组件就被删除了.</p>
-
-<p>下面的<a href="#从_JavaScript_中访问_CookieManager_组件">从 JavaScript 中访问 CookieManager 组件</a>代码, 展示了如何从 JavaScript 中调用 <code>Remove()</code> 方法:</p>
-
-<p><span id="%E4%BB%8E_JavaScript_%E4%B8%AD%E8%AE%BF%E9%97%AE_CookieManager_%E7%BB%84%E4%BB%B6"><a id="%E4%BB%8E_JavaScript_%E4%B8%AD%E8%AE%BF%E9%97%AE_CookieManager_%E7%BB%84%E4%BB%B6"></a><strong>从 JavaScript 中访问 CookieManager 组件</strong></span></p>
-
-<pre>// xpconnect to cookiemanager
-// get the cookie manager component in JavaScript
-var cmgr = Components.classes["@mozilla.org/cookiemanager;1"]
- .getService();
-cmgr = cmgr.QueryInterface(Components.interfaces.nsICookieManager);
-
-// called as part of a largerDeleteAllCookies() function
-function FinalizeCookieDeletions() {
- for (var c=0; c&lt;deletedCookies.length; c++) {
- cmgr.remove(deletedCookies[c].host,
- deletedCookies[c].name,
- deletedCookies[c].path);
- }
- deletedCookies.length = 0;
-}
-</pre>
-
-<div class="side-note">
-<p><span id="%E4%BB%8E%E6%8E%A5%E5%8F%A3%E8%BF%9E%E6%8E%A5%E5%88%B0%E7%BB%84%E4%BB%B6"><a id="%E4%BB%8E%E6%8E%A5%E5%8F%A3%E8%BF%9E%E6%8E%A5%E5%88%B0%E7%BB%84%E4%BB%B6"></a><strong>从接口连接到组件</strong></span></p>
-
-<p>Mozilla 中使用的从 JavaScript 访问 XPCOM 组件的技术称为<em>XPConnect</em>, XPConnect 也是一个组件.</p>
-
-<p>XPConnect 把应用程序代码与 Mozilla 浏览器, 基于 Gecko 的 XUL, 和象 xpcshell 这样的 JavaScript 环境绑定在一起.</p>
-
-<p>xpcshsell 是 Mozilla 内嵌的 XPCOM 工具, 它是 JavaScript 的命令行解释器.</p>
-
-<p>参看 <a class="external" href="http://www.mozilla.org/scriptable/" rel="freelink">http://www.mozilla.org/scriptable/</a>, 获取更多关于 XPConnect 和 JavaScript 的信息.</p>
-</div>
-
-<p>上面展现的技术当然并不是 XPCOM 的全部, 但是却是一个重要的方面. XPCOM 强加的契约打开了一扇通往<em>二进制互操作</em>技术的大门. - 这是一种能够在运行时刻访问, 使用, 重用 XPCOM 组件的技术, 这种技术能够保证用某种语言编写的组件能够被其他的语言所访问.</p>
-
-<p>在 Mozilla 浏览器中, 组件常常通过接口在 JavaScript 中访问, 搜索 Mozilla 的源代码, 会发现 CookieManager 组件<em>只是</em>在 JavaScript 中被调用. 在本教程中, 我们也使用这种方式来访问它<sup><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/Using_XPCOM_Components#endnote_教程中使用的_coocki_管理器">[教程中使用的 coocki 管理器]</a></sup>.</p>
-
-<div class="side-note">
-<p><span id="JavaScript_%E4%B8%8E_Mozilla"><a id="JavaScript_%E4%B8%8E_Mozilla"></a><strong>JavaScript 与 Mozilla</strong></span></p>
-
-<p>JavaScript 是 Mozilla 浏览器的喉舌, 它把自己与 XPCOM 紧紧地绑定在一起. XPCOM 的这种<em>可扩展</em>能力 - 从 XPConnect 绑定的语言中访问组件的能力, 是 XPCOM 的一个关键属性.</p>
-</div>
-
-<h4 id="WebBrowserFind_.E7.BB.84.E4.BB.B6" name="WebBrowserFind_.E7.BB.84.E4.BB.B6"><code>WebBrowserFind</code> 组件</h4>
-
-<p>组件的应用是广泛的: 在浏览这样的高级应用中, 会有 <code>nsWebBrowserFind</code> 这样的接口, 它提供 <code>find()</code> 和 <code>findNext()</code> 方法用于在网页上查找特定内容. 在一些低级应用中, 会提供数据管理这样的功能. 虽然 Mozilla 并不能将所有的 API 都写成 XPCOM 组件的形式, 但是绝大多数浏览器的典型功能都是用 XPCOM 的组件形式实现的, 因此可以被嵌入和扩展.</p>
-
-<p>除了 CookieManager 组件, 这里还要介绍一个 WebBrowserFind 组件. 它实现的 <code>nsIWebBrowserFind</code> 接口见下表 <a href="#nsIWebBrowserFind_接口">nsIWebBrowserFind 接口</a>.</p>
-
-<p><span id="nsIWebBrowserFind_%E6%8E%A5%E5%8F%A3"><a id="nsIWebBrowserFind_%E6%8E%A5%E5%8F%A3"></a><strong>nsIWebBrowserFind 接口</strong></span></p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>findNext</code></td>
- <td>找到字符串出现的下一个位置.</td>
- </tr>
- <tr>
- <td><code>findBackwards</code></td>
- <td>布尔类型属性值, 控制 <code>findNext()</code> 方法向前/向后搜索.</td>
- </tr>
- <tr>
- <td><code>searchFrames</code></td>
- <td>布尔类型属性值, 标识是否搜索当前页面的子框(subframes).</td>
- </tr>
- <tr>
- <td><code>matchCase</code></td>
- <td>布尔类型属性值, 标识是否按照大小写匹配搜索网页.</td>
- </tr>
- <tr>
- <td><code>entireWord</code></td>
- <td>布尔类型属性值, 标识是否匹配整个词.</td>
- </tr>
- </tbody>
-</table>
-
-<p>一旦我们使用接口来获的了某个组件, 我们就可以询问该组件是否支持其他的接口. 这种基本服务由 <code>nsISupports</code> 接口提供, 会由所有的 XPCOM 组件继承; 它允许我们查询组件的接口, 并在接口之间进行切换; 它展现了 XPCOM 的<em>运行时刻确定类型</em>的能力. 它由 <code>QueryInterface</code> 方法实现, 我们将在后面<a href="cn/Creating_XPCOM_Components/%e4%bb%80%e4%b9%88%e6%98%af_XPCOM%3f">什么是 XPCOM?</a>一章中介绍. <a href="cn/XPCOM_API_Reference">XPCOM API Reference</a> 中提供了完整的 XPCOM 组件的索引.</p>
-
-<h4 id="WebLock_.E7.BB.84.E4.BB.B6" name="WebLock_.E7.BB.84.E4.BB.B6"><strong>WebLock</strong> 组件</h4>
-
-<p>现在我们把 <strong>WebLock</strong> 组件看成另一个 XPCOM 组件的例子. 在面向对象编程中, 通常是先设计接口 - 首先定义要提供的功能, 而不是考虑如何实现这些功能. 因此我们把实现这个组件的细节问题放到下一章, 这一章先考虑从外部如何看待这个组件. - 即定义 WebLock 组件的接口.</p>
-
-<p><span id="IWebLock_%E6%8E%A5%E5%8F%A3"><a id="IWebLock_%E6%8E%A5%E5%8F%A3"></a><strong>IWebLock 接口</strong></span></p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>lock</code></td>
- <td>锁定浏览器到当前站点, 或者是磁盘上保存的某个白名单上的站点.</td>
- </tr>
- <tr>
- <td><code>unlock</code></td>
- <td>解开浏览器锁定, 开放访问所有站点.</td>
- </tr>
- <tr>
- <td><code>addSite</code></td>
- <td>添加一个新的站点到白名单.</td>
- </tr>
- <tr>
- <td><code>removeSite</code></td>
- <td>从白名单上删除某个站点.</td>
- </tr>
- <tr>
- <td><code>sites</code></td>
- <td>枚举白名单上的站点.</td>
- </tr>
- </tbody>
-</table>
-
-<p>WebLock 组件就是要实现上面接口定义的功能. 它在浏览器启动的时候, 注册自己. 当用户或者管理员点击浏览器上的 weblock 图标时, 类厂会创建对象实例.</p>
-
-<h3 id="Mozilla_.E4.B8.AD.E4.BD.BF.E7.94.A8.E7.9A.84.E7.BB.84.E4.BB.B6" name="Mozilla_.E4.B8.AD.E4.BD.BF.E7.94.A8.E7.9A.84.E7.BB.84.E4.BB.B6">Mozilla 中使用的组件</h3>
-
-<p>那么我们应该如何获得组件, 然后如何在 Mozilla 中使用它呢? 我们在前面已经看到了一小段 JavaScript 代码, 但是我们并没有解释一般情况下该如何获得 XPCOM 组件.</p>
-
-<p>这一节讨论 Mozilla 中实际使用的组件例子. 本节分成三部分: 一部分是关于该如何在 Mozilla 上找到组件. 其他两个部分是关于该如何访问这些组件.</p>
-
-<h4 id=".E6.9F.A5.E6.89.BE_Mozilla_.E7.BB.84.E4.BB.B6" name=".E6.9F.A5.E6.89.BE_Mozilla_.E7.BB.84.E4.BB.B6">查找 Mozilla 组件</h4>
-
-<p>本书试图向读者提供关于 XPCOM 组件和当前冻结的接口的索引信息. <a class="external" href="http://www.mozilla.org/projects/embedding/">Mozilla 嵌入工程</a>跟踪了当前冻结的接口.</p>
-
-<p>Mozilla 包含了 Gecko 提供的查找和显示组件信息的工具 -<em>XPCOM 组件观察器</em><a class="external" href="http://lxr.mozilla.org/">LXR</a>.</p>
-
-<p>提供 XPCOM 组件信息的主要问题是, Mozilla 接口在不断的发展, 试图选择一个冻结的断面是困难的. 组件观察器的实现并没有考虑组件是否已被冻结, 在 LXR 中我们会发现, 被冻结的接口会在头部标记 <code>@status frozen</code>.</p>
-
-<h5 id="XPCOM_.E7.BB.84.E4.BB.B6.E8.A7.82.E5.AF.9F.E5.99.A8" name="XPCOM_.E7.BB.84.E4.BB.B6.E8.A7.82.E5.AF.9F.E5.99.A8">XPCOM 组件观察器</h5>
-
-<p><a class="external" href="http://www.hacksrus.com/~ginda/cview">组件观察器</a> 是一个可选安装的浏览器插件.</p>
-
-<p><span id="XPCOM_%E7%BB%84%E4%BB%B6%E8%A7%82%E5%AF%9F%E5%99%A8"><a id="XPCOM_%E7%BB%84%E4%BB%B6%E8%A7%82%E5%AF%9F%E5%99%A8"></a><strong>XPCOM 组件观察器</strong></span></p>
-
-<p><img alt="Image:using-component-viewer.png"></p>
-
-<p>在上面的图中, 左列显示的是以<em>gtx</em> 字符串搜索契约 ID 得到的组件子集, 右列是左列选中组件实现的接口.</p>
-
-<p>XPCOM 观察器在获取组件的大致信息的时候非常有用, 但是要知道组件观察器显示的是<em>所有</em>的组件, 有些组件并不稳定, 组件的接口可能会在后续版本中变化, 所以要慎重选取我们自己工程中使用的组件.</p>
-
-<p><span class="comment">XXX mediawiki is t3h suxx0r</span> <span class="comment">XXX give me my C++</span></p>
-
-<h4 id=".E5.9C.A8_Cpp_.E4.BB.A3.E7.A0.81.E4.B8.AD.E4.BD.BF.E7.94.A8_XPCOM_.E7.BB.84.E4.BB.B6" name=".E5.9C.A8_Cpp_.E4.BB.A3.E7.A0.81.E4.B8.AD.E4.BD.BF.E7.94.A8_XPCOM_.E7.BB.84.E4.BB.B6">在 Cpp 代码中使用 XPCOM 组件</h4>
-
-<p>XPConnect 把对 XPCOM 组件作为 JavaScript 对象, 使得对 XPCOM 组件的访问变得非常简单, 从 C++ 代码中访问 XPCOM 要复杂一些.</p>
-
-<p><a href="#从_Cpp_代码管理_Cookies">从 Cpp 代码管理 Cookies</a> 以 C++ 代码重新实现了<a href="#从_JavaScript_中访问_CookieManager_组件">从 JavaScript 中访问 CookieManager 组件</a>的功能.</p>
-
-<p><span id="%E4%BB%8E_Cpp_%E4%BB%A3%E7%A0%81%E7%AE%A1%E7%90%86_Cookies"><a id="%E4%BB%8E_Cpp_%E4%BB%A3%E7%A0%81%E7%AE%A1%E7%90%86_Cookies"></a><strong>从 Cpp 代码管理 Cookies</strong></span></p>
-
-<pre>nsCOMPtr&lt;nsIServiceManager&gt; servMan;
-nsresult rv = NS_GetServiceManager(getter_AddRefs(servMan));
-if (NS_FAILED(rv))
- return -1;
-
-nsCOMPtr&lt;nsICookieManager&gt; cookieManager;
-rv = servMan-&gt;GetServiceByContractID("@mozilla.org/cookiemanager",
- NS_GET_IID(nsICookieManager),
- getter_AddRefs(cookieManager));
-
-if (NS_FAILED(rv))
- return -1;
-
-PRUint32 len;
-deletedCookies-&gt;GetLength(&amp;len);
-
-for (int c=0; c&lt;len; c++)
- cookieManager-&gt;Remove(deletedCookies[c].host,
- deletedCookies[c].name,
- deletedCookies[c].path,
- PR_FALSE);
-</pre>
-
-<p><span class="comment">XXX: In the original document, there were only the first three parameters to the |Remove| call. I added |PR_TRUE| as a fourth parameter because the interface seems to require it: <a class="external" href="http://lxr.mozilla.org/mozilla/source/netwerk/cookie/public/nsICookieManager.idl#64" rel="freelink">http://lxr.mozilla.org/mozilla/sourc...Manager.idl#64</a> This problem also appears in the JavaScript version below, and I've added |false| as a fourth parameter there as well.</span></p>
-
-<p>如果我们的应用是用 C++ 编写, <a href="#从_Cpp_代码管理_Cookies">从 Cpp 代码管理 Cookies</a> 这段代码向我们提供了很好的模板.</p>
-
-<h4 id="XPConnect:_.E5.9C.A8.E8.84.9A.E6.9C.AC.E4.B8.AD.E4.BD.BF.E7.94.A8_XPCOM_.E7.BB.84.E4.BB.B6" name="XPConnect:_.E5.9C.A8.E8.84.9A.E6.9C.AC.E4.B8.AD.E4.BD.BF.E7.94.A8_XPCOM_.E7.BB.84.E4.BB.B6">XPConnect: 在脚本中使用 XPCOM 组件</h4>
-
-<p>在本章开始我们讨论了CookieManager组件,他提供了一个很好的例子来说明如何使用javascript访问组件.在下面的代码片断里你可以看到如何通过getService()方法创建一个CookieManager组件对象,并且通过它提供的功能来让我们从用户界面来读取和删除cookies.</p>
-
-<p><span id="Managing_Cookies_from_JavaScript"><a id="Managing_Cookies_from_JavaScript"></a><strong>Managing Cookies from JavaScript</strong></span></p>
-
-<pre>var cmgr = Components.classes["@mozilla.org/cookiemanager;1"]
- .getService();
-cmgr = cmgr.QueryInterface(Components.interfaces.nsICookieManager);
-
-function loadCookies() {
- // load cookies into a table
- var enumerator = cmgr.enumerator;
- var count = 0;
- var showPolicyField = false;
- while (enumerator.hasMoreElements()) {
- var nextCookie = enumerator.getNext();
- nextCookie = nextCookie.QueryInterface(Components.interfaces.nsICookie);
- /* .... */
-}
-function FinalizeCookieDeletions() {
- for (var c=0; c&lt;deletedCookies.length; c++) {
- cmgr.remove(deletedCookies[c].host,
- deletedCookies[c].name,
- deletedCookies[c].path,
- false);
- }
- deletedCookies.length = 0;
-}
-</pre>
-
-<p><span class="comment">XXX: In the original document, there were only the first three parameters to the |remove| call. I added |false| as a fourth parameter because the interface seems to require it: <a class="external" href="http://lxr.mozilla.org/mozilla/source/netwerk/cookie/public/nsICookieManager.idl#64" rel="freelink">http://lxr.mozilla.org/mozilla/sourc...Manager.idl#64</a> This problem also appears in the C++ version above, and I've added |PR_FALSE| as a fourth parameter there as well.</span></p>
-
-<p>除了CookieManager被调用的方法以外(也就是<code>cookiemanager.remove</code>(他会映射到<code>remove()</code><a href="#The_&lt;code>nsICookieManager&lt;/code>_Interface">The <code>nsICookieManager</code> Interface</a>),请注意那些在Javascript中反映XPCOM组件的专门的XPConnect对象和方法。</p>
-
-<p><code>Components</code> 是用来控制到组件连接的JavaScript对象, 而<code>classes</code> 是一组所有你可以根据契约ID来查询的对象。为了在Javascript中实例化XPCOM组件,你创建一个新的<code>Component</code>对象同时传入你所需要查询的组件契约ID,返回的可能是一个singleton或者一个实例。</p>
-
-<pre>var cmgr = Components.classes["@mozilla.org/cookiemanager;1"]
- .getService();
-</pre>
-
-<p><code>cookiemanager</code> 对象的结果提供组件的所有在IDL中编译好然后编译到类型库中的方法的入口。 使用CookieManager组件, 你可以写如下的代码来完成从系统中清除所有cookies的操作:</p>
-
-<pre>cmgr = Components.classes["@mozilla.org/cookiemanager;1"]
- .getService();
-cmgr = cmgr.QueryInterface(Components.interfaces.nsICookieManager);
-
-// delete all cookies
-function trashEm() {
- cmgr.removeAll();
-}
-</pre>
-
-<p>这个例子所展示的另外一个关键的XPConnect特性的是可以在所有从XPCOM映射到javascript的对象上执行的<code>QueryInterface</code>方法。如同在C++中, 你可以使用这个方法询问给定对象的别的接口。</p>
-
-<div class="side-note">
-<p><span id="Services_Versus_Regular_Instances"><a id="Services_Versus_Regular_Instances"></a><strong>Services Versus Regular Instances</strong></span></p>
-
-<p>到底让客户把你的组件作为一个实例还是服务是一个设计问题,你应当在你的组件文挡中进行描述。实际上,例子中通过方法<code>createInstance()调用</code><code>getService()</code>方法的方法实际上也可以是对组件对象调用并且缓存结果,并让他做为一个singlenton而不是实例。</p>
-
-<p>用来建立服务的singleton设计模式在<a href="cn/Creating_XPCOM_Components/What_is_XPCOM%3f#XPCOM_Services">XPCOM Services</a>进行描述。</p>
-</div>
-
-<p>请记住,<code>QueryInterface</code>让你查询一个对象所支持的接口。在<a href="#The_&lt;code>nsICookieManager&lt;/code>_Interface">The <code>nsICookieManager</code> Interface</a>的代码片断中, <code>QueryInterface</code>方法被用来从eunumerator中获得<code>nsICookie</code>接口,从而, 比如说, JavaScript代码就可以获得每个cookie的<code>value</code>和<code>name</code>属性。</p>
-
-<ol>
- <li><div class="blockIndicator note"><strong>Note:</strong> cookie-manager-ui</div> 注意接口不是组件的一部分. XPCOM通过Mozilla's Cross Platform Front End (XPFE)和其他的用户接口使使用CookieManager这样的组件变得容易,但是组件本身并不提供自身的UI。</li>
-</ol>
-
-<ol>
- <li><div class="blockIndicator note"><strong>Note:</strong> private-xpcom-interfaces</div>这方面也有例外. 一些XPCOM接口也可以是private并且不是作为公用的. Private接口和在IDL中公开的接口要求有所不同。</li>
-</ol>
-
-<ol>
- <li><div class="blockIndicator note"><strong>Note:</strong> cookie-manager-in-tutorial</div> CookieManager组件用来支持本教程所描述的网页所定功能。</li>
-</ol>
-
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/创建_XPCOM_组件:XPCOM_简介" style="float: left;">« 上一页</a><a href="/zh-CN/docs/Creating_XPCOM_Components:Component_Internals">下一页 »</a></p>
-</div> <p></p><div class="licenseblock">
-<p>Copyright (c) 2003 by Doug Turner and Ian Oeschger. This material may be distributed only subject to the terms and conditions set forth in the <a class="external" href="http://www.opencontent.org/openpub/" rel="noopener">Open Publication License</a>, v1.02 or later. Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. Distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder.</p>
-</div><p></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/using_xpcom_utilities_to_make_things_easier/index.html b/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/using_xpcom_utilities_to_make_things_easier/index.html
deleted file mode 100644
index 98bb510dd8..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/guide/creating_components/using_xpcom_utilities_to_make_things_easier/index.html
+++ /dev/null
@@ -1,388 +0,0 @@
----
-title: 创建XPCOM组件/使用XPCOM工具类让事情变得简单
-slug: >-
- Mozilla/Tech/XPCOM/Guide/Creating_components/Using_XPCOM_Utilities_to_Make_Things_Easier
-tags:
- - XPCOM
- - 所有分类
-translation_of: >-
- Mozilla/Tech/XPCOM/Guide/Creating_components/Using_XPCOM_Utilities_to_Make_Things_Easier
----
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/Creating_XPCOM_Components:Creating_the_Component_Code" style="float: left;">« 上一页</a><a href="/zh-CN/docs/Creating_XPCOM_Components:Starting_WebLock">下一页 »</a></p>
-</div><p></p>
-
-<p>本章回顾你已经在教程第一部分建立的代码 (see <a href="cn/Creating_XPCOM_Components/Creating_the_Component_Code#webLock1.cpp">webLock1.cpp</a> in the previous chapter) 并且使用 XPCOM 工具类让代码更容易更有效. 同时,介绍一个在XPCOM和Gecko API中广泛使用基本的字符串类型.</p>
-
-<p>作为起点,第一部分描述可以替代<code>webLock1.cpp</code>中的很多代码的<em>C++ 宏</em> . 很多用来完成软件组织和组件注册的代码都可以缩减为精简的数据结构和宏代码.</p>
-
-<h3 id="XPCOM_Macros" name="XPCOM_Macros">XPCOM Macros</h3>
-
-<p>XPCOM 架构包含了一系列宏让C++开发变得简单. 尽管有某些重叠(例如,高层的宏可以用其他的宏来组织),他们通常可以组织成如下的类别.</p>
-
-<h4 id="Generic_XPCOM_Module_Macros" name="Generic_XPCOM_Module_Macros">Generic XPCOM Module Macros</h4>
-
-<p>The work in the <a href="cn/Creating_XPCOM_Components/Creating_the_Component_Code">previous chapter</a> was useful in setting up the generic component code. But there are only a few places in that code that are unique to the <strong>WebLock</strong> component, and it was a lot of typing. To write a different component library, you could copy the listing at the end of the chapter, change very little, and paste it into a new project. To avoid these kinds of redundancies, to regulate the way generic code is written, and to save typing, XPCOM provides<em>generic module macros</em> that expand into the module code you've already seen.</p>
-
-<p>Since these macros expand into "generic" implementations, they may not offer as much flexibility as you have when you are writing your own implementation. But they have the advantage of allowing much more rapid development. To get an idea about how much can be handled with the macros described in this section, compare the code listing in <a href="#weblock2.cpp">weblock2.cpp</a> at the end of the chapter with <a href="cn/Creating_XPCOM_Components/Creating_the_Component_Code#webLock1.cpp">webLock1.cpp</a> in the previous chapter.</p>
-
-<p>The module macros include one set of macros that define the exported <code>NSGetModule</code> entry point, the required <code>nsIModule</code> implementation code and another that creates a generic factory for your implementation class. Used together, these macros can take care of a lot of the component implementation code and leave you working on the actual logic for your component.</p>
-
-<div class="side-note">
-<p>Note that all of the macros described in this section are similar but are used in slightly different situations. Some differ only in whether or not a method is called when the module is created and/or destroyed. <a href="#XPCOM_Module_Macros">XPCOM Module Macros</a> lists the macros discussed in this section.</p>
-</div>
-
-<p><span id="XPCOM_Module_Macros"><a id="XPCOM_Module_Macros"></a><strong>XPCOM Module Macros</strong></span></p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">Macro</td>
- <td class="header">Description</td>
- </tr>
- <tr>
- <td><code>NS_IMPL_NSGETMODULE(name, components)</code></td>
- <td>Implements the <code>nsIModule</code> interface with the module name of <code>name</code> and the component list in <code>components</code>.</td>
- </tr>
- <tr>
- <td><code>NS_IMPL_NSGETMODULE_WITH_CTOR(name, components, ctor)</code></td>
- <td>Same as above but allows for a special function to be called when the module is created.</td>
- </tr>
- <tr>
- <td><code>NS_IMPL_NSGETMODULE_WITH_DTOR(name, components, dtor)</code></td>
- <td>Same as the first macro but allows for a special function to be called when the module is destroyed.</td>
- </tr>
- <tr>
- <td><code>NS_IMPL_NSGETMODULE_WITH_CTOR_DTOR(name, components, ctor, dtor)</code></td>
- <td>This combines the last two macros so that you can define functions to be called at the construction and destruction of the module object.</td>
- </tr>
- </tbody>
-</table>
-
-<h5 id="Module_Implementation_Macros" name="Module_Implementation_Macros">Module Implementation Macros</h5>
-
-<p>The general case is to use <code>NS_IMPL_NSGETMODULE</code>, which doesn't take any callbacks, but all the macros follow the same general pattern. All of these macros work on an array of structures represented by the <code>components</code> parameter. Each structure describes a CID that is to be registered with XPCOM.</p>
-
-<p>The first parameter for each of these macros is an arbitrary string that names the module. In a debugging environment, this string will be printed to the screen when the component library is loaded or unloaded. You should pick a name that makes sense and helps you keep track of things. The four required parts<sup><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/Using_XPCOM_Utilities_to_Make_Things_Easier#endnote_other-parts">[other-parts]</a></sup> of the structure contain the following information:</p>
-
-<ul>
- <li>A human readable class name</li>
- <li>the class ID (CID)</li>
- <li>the contract ID (an optional but recommended argument)</li>
- <li>a constructor for the given object</li>
-</ul>
-
-<pre>static const nsModuleComponentInfo components[] =
-{
- { "Pretty Class Name",
- CID,
- CONTRACT_ID,
- Constructor
- },
- // ...
-};
-</pre>
-
-<p>The important thing to note in the fictitious listing above is that it can support multiple components in a module. Modules such as the networking libraries in Gecko ("necko") have over 50 components declared in a single <code>nsModuleComponentInfo</code> array like this.</p>
-
-<p>The first entry of the <code>nsModuleComponentInfo</code> above is the name of the component. Though it isn't used that much internally at the present time, this name should be something that meaningfully describes the module.</p>
-
-<p>The second entry of the <code>nsModuleComponentInfo</code> is the CID. The usual practice is to put the class ID (CID) into a <code>#define</code> and use the define to declare the CID in the components list. Many CIDs take the following form:</p>
-
-<pre>#define NS_IOSERVICE_CID \
-{ /* 9ac9e770-18bc-11d3-9337-00104ba0fd40 */ \
- 0x9ac9e770, \
- 0x18bc, \
- 0x11d3, \
- {0x93, 0x37, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40} \
-}
-</pre>
-
-<p>The next entry is the Contract ID string, which is also usually defined in a <code>#define</code> in a header file.</p>
-
-<p>These three entries constitute the required parameters for the <code>RegisterFactoryLocation</code> method we looked at in the prior chapter. When you use these implementation macros, you must declare a constructor for the object, and this keeps you from having to write a factory object.</p>
-
-<h5 id="Factory_Macros" name="Factory_Macros">Factory Macros</h5>
-
-<p>The factory macro makes it easy to write factory implementations. Given the class name <code>ConcreteClass</code>, the factory macro declaration is:</p>
-
-<pre>NS_GENERIC_FACTORY_CONSTRUCTOR(ConcreteClass)
-</pre>
-
-<p>This results in a function called <code>ConcreteClassConstructor</code> that can be used in the <code>nsModuleComponentInfo</code> structure.</p>
-
-<pre>#include "nsIGenericFactory.h"
-
-static const nsModuleComponentInfo components[] =
-{
- { "Pretty Class Name",
- SAMPLE_CID,
- "@company.com/sample",
- SampleConstructor
- }
-}
-
-NS_IMPL_NSGETMODULE(nsSampleModule, components)
-</pre>
-
-<p>Most of the components in the Mozilla browser client use this approach.</p>
-
-<h4 id="Common_Implementation_Macros" name="Common_Implementation_Macros">Common Implementation Macros</h4>
-
-<p>Every XPCOM object implements <code>nsISupports</code>, but writing this implementation over and over is tedious. Unless you have very special requirements for managing reference counting or handling interface discovery, the<em>implementation macros</em> that XPCOM provides can be used. Instead of implementing the <code>nsISupports</code> yourself, <code>NS_IMPL_ISUPPORTS1</code> can expand to the implementation of <code>AddRef</code>, <code>Release</code>, and <code>QueryInterface</code> for any object.</p>
-
-<pre>NS_IMPL_ISUPPORTS1(classname, interface1)
-</pre>
-
-<p>Also, if you implement more than one interface, you can simply change the <code>1</code> in the macro to the number of interfaces you support and list the interfaces, separated by commas. For example:</p>
-
-<pre>NS_IMPL_ISUPPORTS2(classname, interface1, interface2)
-NS_IMPL_ISUPPORTSn(classname, interface1, ..., interfacen)
-</pre>
-
-<p>These macros automatically add the <code>nsISupports</code> entry for you, so you don't need to do something like this:</p>
-
-<pre class="eval">NS_IMPL_ISUPPORTS2(classname, interface1, <strong>nsISupports</strong>)
-</pre>
-
-<p><br>
- Take a close look at the above example. Note that it uses the actual name of the interface and not an IID. Inside the macro, the interface name expands to <code>NS_GET_IID()</code>, which is another macro that extracts the IID from the generated header of the interface. When an interface is written in XPIDL, the headers include static declarations of their IIDs. On any interface that is generated by XPIDL, you can call <code>NS_GET_IID()</code> to obtain the IID which is associated with that interface.</p>
-
-<pre>// returns a reference to a shared nsIID object\
-static const nsIID iid1 = NS_GET_IID(nsISupports);
-
-// constructs a new nsIID object
-static const nsIID iid2 = NS_ISUPPORTS_IID;
-</pre>
-
-<p>In order to use <code>NS_IMPL_ISUPPORTSn</code>, you must be sure that a member variable of type <code>nsrefcnt</code> is defined and named <code>mRefCnt</code> in your class. But why even bother when you can use another macro?</p>
-
-<h4 id="Declaration_Macros" name="Declaration_Macros">Declaration Macros</h4>
-
-<p><code>NS_DECL_NSISUPPORTS</code> declares <code>AddRef</code>, <code>Release</code>, and <code>QueryInterface</code> for you, and it also defines the <code>mRefCnt</code> required by <code>NS_IMPL_ISUPPORTS</code>. Furthermore, <code>NS_DECL_</code> appended with any interface name in all caps will declare all of the methods of that interface for you. For example, <code>NS_DECL_NSIFOO</code> will declare all of the methods of <code>nsIFoo</code> provided that it exists and that <code>nsIFoo.h</code> was generated by the XPIDL compiler. Consider the following real class:</p>
-
-<pre>class myEnumerator : public nsISimpleEnumerator
-{
- public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSISIMPLEENUMERATOR
-
- myEnumerator();
- virtual ~myEnumerator() {}
-};
-</pre>
-
-<p>The declaration of this <code>nsISimpleEnumerator</code> class doesn't include any methods other than the contructor and destructor. Instead, the class uses the <code>NS_DECL_</code> macro<sup><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/Using_XPCOM_Utilities_to_Make_Things_Easier#endnote_nsISupports-warning">[nsISupports-warning]</a></sup>.</p>
-
-<p>Using these declaration macros not only saves a tremendous amount of time when you're writing the code, it can also save time if you make changes to your IDL file, since the C++ header file will then automatically include the updated list of methods to be supported.</p>
-
-<div class="side-note">
-<p>The <code>NS_INIT_ISUPPORTS</code> macro is also a bit of a special case. Historically, it gets called in the constructor for your class and sets <code>mRefCnt</code> to zero. However, a change in XPCOM that occurred before Mozilla 1.3 makes <code>NS_INIT_ISUPPORTS</code> no longer necessary: <code>mRefCnt</code>'s type has been changed from an integer to a class that provides its own auto-initialization. If you are building with versions earlier than Mozilla 1.3, this macro is still required.</p>
-</div>
-
-<p>The following table summarizes the macro usage in this portion of the <code>weblock.cpp</code> source file:</p>
-
-<p><span id="Common_XPCOM_Macros"><a id="Common_XPCOM_Macros"></a><strong>Common XPCOM Macros</strong></span></p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>NS_IMPL_ISUPPORTSn</code></td>
- <td>Implements <code>nsISupports</code> for a given class with <code>n</code> number of interfaces</td>
- </tr>
- <tr>
- <td><code>NS_DECL_ISUPPORTS</code></td>
- <td>Declares methods of <code>nsISupports</code> including <code>mRefCnt</code></td>
- </tr>
- <tr>
- <td><code>NS_INIT_ISUPPORTS</code></td>
- <td>Initializes <code>mRefCnt</code> to zero. Must be called in class's constructor</td>
- </tr>
- <tr>
- <td><code>NS_GET_IID</code></td>
- <td>Returns the IID given the name of an interface. Interface must be generated by XPIDL</td>
- </tr>
- </tbody>
-</table>
-
-<p>Using the macros described here, the code for the <strong>WebLock</strong> component has gone from around 340 lines of code to just under 40. Clearly from a code maintenance point of view, this kind of reduction is outstanding. The entire source file with these macros included appears in <a href="#weblock2.cpp">weblock2.cpp</a>.</p>
-
-<h3 id="weblock2.cpp" name="weblock2.cpp">weblock2.cpp</h3>
-
-<p>The listing below shows the generic module code from <a href="cn/Creating_XPCOM_Components/Creating_the_Component_Code#webLock1.cpp">webLock1.cpp</a> using the macros described in this chapter:</p>
-
-<p><span id="weblock2.cpp"><a id="weblock2.cpp"></a><strong>weblock2.cpp</strong></span></p>
-
-<pre>#include "nsIGenericFactory.h"
-#include "nsISupportsUtils.h"
-
-#define SAMPLE_CID \
-{ 0x777f7150, 0x4a2b, 0x4301, \
-{ 0xad, 0x10, 0x5e, 0xab, 0x25, 0xb3, 0x22, 0xaa}}
-
-class Sample: public nsISupports
-{
- public:
- Sample();
- virtual ~Sample();
-
- NS_DECL_ISUPPORTS
-};
-
-Sample::Sample()
-{
- // note: in newer versions of Gecko (1.3 or later)
- // you don't have to do this:
- NS_INIT_ISUPPORTS();
-}
-
-Sample::~Sample()
-{
-}
-
-NS_IMPL_ISUPPORTS1(Sample, nsISupports);
-
-NS_GENERIC_FACTORY_CONSTRUCTOR(Sample);
-
-static const nsModuleComponentInfo components[] =
-{
- { "Pretty Class Name",
- SAMPLE_CID,
- "@company.com/sample",
- SampleConstructor
- }
-};
-
-NS_IMPL_NSGETMODULE(nsSampleModule, components)
-</pre>
-
-<h3 id="String_Classes_in_XPCOM" name="String_Classes_in_XPCOM">String Classes in XPCOM</h3>
-
-<p>Strings are usually thought of as linear sequences of characters. In C++, the string literal "XPCOM", for example, consists of 6 consecutive bytes, where `X' is at byte offset zero and a null character is at byte offset 5. Other kinds of strings like "wide" strings use two bytes to represent each character, and are often used to deal with Unicode strings.</p>
-
-<p>The string classes in XPCOM are not just limited to representing a null terminated sequence of characters, however. They are fairly complex because they support the Gecko layout engine and other subsystems that manage large chunks of data. Additionally, in some versions of Mozilla the string classes support sequences of characters broken up into multiple fragments (fragments which may or may not be null terminated)<sup><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/Using_XPCOM_Utilities_to_Make_Things_Easier#endnote_nulls-in-strings">[nulls-in-strings]</a></sup>.</p>
-
-<p>All string classes in XPCOM derive from one of two abstract classes<sup><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Guide/Creating_components/Using_XPCOM_Utilities_to_Make_Things_Easier#endnote_other-string-classes">[other-string-classes]</a></sup>: <code>nsAString</code> and <code>nsACString</code>. The former handles double byte characters, and the latter tends to be used in more general circumstances, but both of these classes define the functionality of a string. You can see these classes being passed as arguments in many of the XPCOM interfaces we'll look at in the following chapters.</p>
-
-<h4 id="Using_Strings" name="Using_Strings">Using Strings</h4>
-
-<p>Explaining how all the string classes work is outside the scope of this book, but we can show you how to use strings in the <strong>WebLock</strong> component. The first thing to note is that the string classes themselves are not frozen, which means that you should not link against them when you can avoid it.</p>
-
-<p>Linking the full string library (<code>.lib</code> or <code>.a</code>) into a component may raise its footprint by more than 100k (on Windows), which in many cases is an unacceptable gain (see the <a href="cn/XPCOM_string_guide">XPCOM string guide</a>). For <strong>WebLock</strong>, where the string classes need to be only wrappers around already existing string data, trading advanced functionality for a much smaller footprint is the right way to go. The <strong>WebLock</strong> string classes don't need to append, concatenate, search, or do any other real work on the string data; they just need to represent <code>char*</code> and other data and pass them to methods that expect an <code>nsACString</code>.</p>
-
-<h4 id="nsEmbedString_and_nsEmbedCString" name="nsEmbedString_and_nsEmbedCString"><code>nsEmbedString</code> and <code>nsEmbedCString</code></h4>
-
-<p>The strings used in this tutorial are <code>nsEmbedString</code> and <code>nsEmbedCString</code>, which implement the <code>nsAString</code> abstract class and the <code>nsACString</code> abstract classes, respectively. This first example shows an <code>nsEmbedCString</code> being used to pass an <code>nsACString</code> to a method that's not expected to modify the string.</p>
-
-<pre>// in IDL: method(in ACString thing);
-
-char* str = "How now brown cow?";
-nsEmbedCString data(str);
-rv = object-&gt;Method(data);
-</pre>
-
-<p>In this next example, the method is going to set the value of the string - as it might need to do when it returns the name of the current user or the last viewed URL.</p>
-
-<pre>// in IDL: attribute ACString data;
-
-nsEmbedCString data;
-method-&gt;GetData(data);
-
-// now to extract the data from the url class:
-
-const char* aStringURL = data.get();
-</pre>
-
-<p>Note that the memory pointed to by <code>aStringURL</code> after the call to <code>url.get()</code> is owned by the URL string object. If you need to keep this string data around past the lifetime of the string object, you must make a copy.</p>
-
-<div class="side-note">
-<p><span id="String_Size"><a id="String_Size"></a><strong>String Size</strong></span></p>
-
-<p>The examples above illustrate the use of the single byte string class, <code>nsEmbedCString</code>. The double byte version, <code>nsEmbedString</code>, has the same functionality but the constructor takes <code>nsAString</code> and the .get() method returns the type <code>PRUnichar*</code>. Note that <code>PRUnichar</code> is a two byte value. In the coming chapters, you'll see examples that use this version in the <strong>WebLock</strong> component.</p>
-</div>
-
-<h3 id="Smart_Pointers" name="Smart_Pointers">Smart Pointers</h3>
-
-<p>All of the interfaces that you've seen so far are reference counted. Leaking a reference by not releasing an object, as the code below demonstrates, can be a major problem.</p>
-
-<pre>{
- nsISupports* value = nsnull;
- object-&gt;method(&amp;value);
- if (!value) return;
-
- // ...
-
- if (NS_FAILED(error))
- return; // &lt;------------ leaks |value|
- //...
-
- NS_RELEASE(value); // release our reference
-}
-</pre>
-
-<p>A method returns an <code>nsISupports</code> interface pointer that has been reference counted before it is returned (assuming it wasn't <code>nsnull</code>). If you handle an error condition by returning prematurely, whatever value points at will leak-it will never be deleted. This is a trivial fix in this example, but in real code, this can easily happen in <code>goto</code> constructs, or in deep nesting with early <code>return</code>s.</p>
-
-<p>Having more than one interface pointer that needs to be released when a block goes out of scope begs for a tool that can aid the developer. In XPCOM, this tool is the <code>nsCOMPtr</code>, or<em>smart pointer</em> class, which can save you countless hours and simplify your code when you're dealing with interface pointers. Using smart pointers, the code above can be simplified to:</p>
-
-<pre>{
- nsCOMPtr&lt;nsISupports&gt; value;
- object-&gt;method(getter_AddRefs(value));
- if (!value) return;
-
- // ...
-
- if (NS_FAILED(error))
- return;
- // ...
-}
-</pre>
-
-<p>The style or syntax may be unfamilar, but smart pointers are worth learning and using because they simplify the task of managing references. <code>nsCOMPtr</code> is a C++ template class that acts almost exactly like raw pointers, that can be compared and tested, and so on. When you pass them to a getter, you must do something special, however: You must wrap the variable with the function <code>getter_AddRefs</code>, as in the example above.</p>
-
-<p>You cannot call the <code>nsISupports</code> <code>AddRef</code> or <code>Release</code> methods on a <code>nsCOMPtr</code>. But this restriction is desirable, since the <code>nsCOMPtr</code> is handling reference counting for you. If for some reason you need to adjust the reference count, you must assign the <code>nsCOMPtr</code> to a new variable and <code>AddRef</code> that. This is a common pattern when you have a local <code>nsCOMPtr</code> in a function and you must pass back a reference to it, as in the following:</p>
-
-<pre>SomeClass::Get(nsISupports** aResult)
-{
- if (!aResult)
- return NS_ERROR_NULL_POINTER;
-
- nsCOMPtr&lt;nsISupports&gt; value;
- object-&gt;method(getter_AddRefs(value));
-
- *aResult = value.get();
- NS_IF_ADDREF(*aResult);
- return NS_OK;
-}
-</pre>
-
-<p>The first thing that this method does is check to see that the caller passed a valid address. If not, it doesn't even try to continue. Next, it calls another method on an object that is presumed to exist in this context. You can call a <code>.get()</code> method on the <code>nsCOMPtr</code> and have it returned for use as a raw pointer. This raw pointer can then be assigned to a variable and have its reference updated by <code>NS_IF_ADDREF</code>. Be very careful with the result of <code>.get()</code>, however. You should never call <code>Release</code> on this result because it may result in a crash. Instead, to explicitly release the object being held by a <code>nsCOMPtr</code>, you can assign zero to that pointer.</p>
-
-<p>Another nice feature of smart pointers - the part that makes them smart - is that you can <code>QueryInterface</code> them quite easily. For example, there are two interfaces for representing a file on a file system, the <code>nsIFile</code> and <code>nsILocalFile</code>, and they are both implemented by an object. Although we haven't formally introduced these two interfaces, the next code sample shows how simple it is to switch between these two interface:</p>
-
-<pre>SomeClass::DoSomething(nsIFile* aFile)
-{
- if (!aFile)
- return NS_ERROR_NULL_POINTER;
-
- nsresult rv;
- nsCOMPtr&lt;nsILocalFile&gt; localFile = do_QueryInterface(aFile, &amp;rv);
- // ...
-}
-</pre>
-
-<p>If the <code>QueryInterface</code> is successful, <code>localFile</code> will be non-null, and <code>rv</code> will be set to <code>NS_OK</code>. If <code>QueryInterface</code> fails, <code>localFile</code> will be null, and <code>rv</code> will be set to a specific error code corresponding to the reason for the failure. In this construct, the result code <code>rv</code> is an optional parameter. If you don't care what the error code is, you can simply drop it from the function call.</p>
-
-<p>From this point on, we'll be using <code>nsCOMPtr</code>s as much as possible in <strong>WebLock</strong>. For a complete listing of smart pointer functionality, see <a class="external" href="http://www.mozilla.org/projects/xpcom/nsCOMPtr/">mozilla.org's <code>nsCOMPtr</code> documentation</a><span class="comment">XXX this should be in devmo</span>.</p>
-
-<ol>
- <li><div class="blockIndicator note"><strong>Note:</strong> other-parts</div> This section discusses the main parameters of this structure. For a complete listing of all available options you can look at the complete reference in the <a href="cn/XPCOM_API_Reference">XPCOM API Reference</a>.</li>
- <li><div class="blockIndicator note"><strong>Note:</strong> nsISupports-warning</div> Note that <code>NS_DECL_ISUPPORTS</code> doesn't obey the general rule in which every interface has a declaration macro of the form <code>NS_DECL_INTERFACENAME</code>, where <code>INTERFACENAME</code> is the name of the interface being compiled.</li>
- <li><div class="blockIndicator note"><strong>Note:</strong> nulls-in-strings</div> The string classes may also support embedded nulls.</li>
- <li><div class="blockIndicator note"><strong>Note:</strong> other-string-classes</div> There are other abstract string classes, but they are outside the scope of this book.</li>
-</ol>
-
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/Creating_XPCOM_Components:Creating_the_Component_Code" style="float: left;">« 上一页</a><a href="/zh-CN/docs/Creating_XPCOM_Components:Starting_WebLock">下一页 »</a></p>
-</div> <p></p><div class="licenseblock">
-<p>Copyright (c) 2003 by Doug Turner and Ian Oeschger. This material may be distributed only subject to the terms and conditions set forth in the <a class="external" href="http://www.opencontent.org/openpub/" rel="noopener">Open Publication License</a>, v1.02 or later. Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. Distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder.</p>
-</div><p></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/guide/hashtables/index.html b/files/zh-cn/mozilla/tech/xpcom/guide/hashtables/index.html
deleted file mode 100644
index 24740b535c..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/guide/hashtables/index.html
+++ /dev/null
@@ -1,282 +0,0 @@
----
-title: Hashtables
-slug: Mozilla/Tech/XPCOM/Guide/Hashtables
-tags:
- - XPCOM
- - 所有分类
-translation_of: Mozilla/Tech/XPCOM/Guide/Hashtables
----
-<p> </p>
-<h2 id="What_Is_a_Hashtable.3F" name="What_Is_a_Hashtable.3F">What Is a Hashtable?</h2>
-<p>A hashtable is a data construct that stores a set of <b>items</b>. Each item has a <b>key</b> that identifies the item. Items are found, added, and removed from the hashtable by using the key. Hashtables may seem like <a href="cn/XPCOM_array_guide">arrays</a>, but there are important differences:</p>
-<p>哈希表是一个存储一系列<b>元素</b>的数据结构。每个元素都由一个<b>关键字</b>来标识。元素可以通过关键字来进行查找,添加,删除操作。哈希表非常类似<a href="cn/XPCOM_array_guide">arrays</a>,但是也有一些很大的区别。</p>
-<table class="standard-table">
- <tbody>
- <tr>
- <th> </th>
- <th class="header">数组</th>
- <th class="header">哈希表</th>
- </tr>
- <tr>
- <td class="header">关键字:</td>
- <td>
- <i>
- 整数:</i>
- arrays are always keyed on integers, and must be contiguous. 数组必须用整数作为关键字,而且每两个元素之间必须相邻接</td>
- <td>
- <i>
- 任意类型:</i>
- almost any datatype can be used as key, including strings, integers, XPCOM interface pointers, IIDs, and almost anything else. Keys can be disjunct (i.e. you can store entries with keys 1, 5, and 3000). 任意类型都可以作为关键字,包括字符串,整数,XPCOM接口指针,IIDs等等。关键字之间可以不在一起(例如,你可以用1,5,和3000来作为关键字。)</td>
- </tr>
- <tr>
- <td class="header">查询时间:</td>
- <td>
- <i>
- O(1):</i>
- lookup time is a simple constant。查找时间是个简单的定值</td>
- <td>
- <i>
- O(1):</i>
- lookup time is mostly-constant, but the constant time can be larger than an array lookup。查找时间几乎是定值,但是比数组慢点。</td>
- </tr>
- <tr>
- <td class="header">排序:</td>
- <td>
- <i>
- sorted:</i>
- stored sorted; enumerated in a sorted fashion.</td>
- <td>
- <i>
- unsorted:</i>
- stored unsorted; cannot be enumerated in a sorted manner.</td>
- </tr>
- <tr>
- <td class="header">插入/删除:</td>
- <td>
- <i>
- O(n):</i>
- adding and removing items from a large array can be time-consuming</td>
- <td>
- <i>
- O(1):</i>
- adding and removing items from hashtables is a quick operation</td>
- </tr>
- <tr>
- <td class="header">浪费空间:</td>
- <td>
- <i>
- none:</i>
- Arrays are packed structures, so there is no wasted space.</td>
- <td>
- <i>
- some:</i>
- hashtables are not packed structures; depending on the implementation, there may be significant wasted memory.</td>
- </tr>
- </tbody>
-</table>
-<p>In their implementation, hashtables take the key and apply a mathematical <b>hash function</b> to <b>randomize</b> the key and then use the hash to find the location in the hashtable. Good hashtable implementations will automatically resize the hashtable in memory if extra space is needed, or if too much space has been allocated.</p>
-<h2 id="When_Should_I_Use_a_Hashtable.3F" name="When_Should_I_Use_a_Hashtable.3F">When Should I Use a Hashtable?</h2>
-<p>Hashtables are useful for</p>
-<ul>
- <li>sets of data that need swift <b>random access</b>;</li>
- <li>with <b>non-integral keys</b> or <b>non-contiguous integral keys</b>;</li>
- <li>or where <b>items will be frequently added or removed</b>.</li>
-</ul>
-<p>Hashtables should
- <i>
- not</i>
- be used for</p>
-<ul>
- <li>Sets that need to be <b>sorted</b>;</li>
- <li>Very small datasets (less than 12-16 items);</li>
- <li>Data that does not need random access.</li>
-</ul>
-<p>In these situations, an array, a linked-list, or various tree data structures are more efficient.</p>
-<h2 id="Mozilla.27s_Hashtable_Implementations" name="Mozilla.27s_Hashtable_Implementations">Mozilla's Hashtable Implementations</h2>
-<p>Mozilla has several hashtable implementations, which have been tested and, tuned, and hide the inner complexities of hashtable implementations:</p>
-<ul>
- <li><code><a href="#PLDHash_.28JSDHash.29">PLDHash</a></code> - low-level C API; stores keys and data in one large memory structure; uses the heap efficiently; client must declare an "entry class" and may not hold onto entry pointers.</li>
- <li><code><a href="#PLHashTable">PLHashTable</a></code> - low-level C API; entry class pointers are constant; more efficient for large entry structures; often wastes memory making many small heap allocations.</li>
- <li><code><a href="#nsTHashtable">nsTHashtable</a></code> - low-level C++ wrapper around <code>PLDHash</code>; generates callback functions and handles most casting automagically. Client writes their own entry class which can include complex key and data types.</li>
- <li><code><a href="#nsBaseHashtable_and_friends:_nsDataHashtable.2C_nsInterfaceHashtable.2C_and_nsClassHashtable">nsDataHashtable/nsInterfaceHashtable/nsClassHashtable</a></code> - high-level C++ wrappers around <code>PLDHash</code>; simplifies the common usage pattern mapping a simple keytype to a simple datatype; client does not need to declare or manage an entry class; <code><b>nsDataHashtable</b></code> datatype is a scalar such as <code>RUint32</code>; <code><b>nsInterfaceHashtable</b></code> datatype is an interface; <code><b>nsClassHashtable</b></code> datatype is a class pointer owned by the hashtable.</li>
-</ul>
-<h3 id="Which_Hashtable_Should_I_Use.3F" name="Which_Hashtable_Should_I_Use.3F">Which Hashtable Should I Use?</h3>
-<table class="standard-table">
- <tbody>
- <tr>
- <th class="header" colspan="2" rowspan="2"> </th>
- <th class="header" colspan="5">Key Type:</th>
- </tr>
- <tr>
- <th class="header">integer</th>
- <th class="header">String/CString</th>
- <th class="header">nsID</th>
- <th class="header">nsISupports*</th>
- <th class="header">Complex</th>
- </tr>
- <tr>
- <td class="header" rowspan="8">Data Type:</td>
- <td class="header">None (Hash Set)</td>
- <td><code>nsInt32HashSet</code></td>
- <td><code>ns(C)StringHashSet</code></td>
- <td colspan="3"><code>nsTHashtable&lt;...&gt;</code></td>
- </tr>
- <tr>
- <td class="header" rowspan="2">Simple (PRUint32)</td>
- <td colspan="4"><code>nsDataHashtable</code></td>
- <td rowspan="6"><code>nsTHashtable&lt;...&gt;</code></td>
- </tr>
- <tr>
- <td><code>&lt;nsUint32HashKey,<br>
- PRUint32&gt;</code></td>
- <td><code>&lt;ns(C)StringHashKey,<br>
- PRUint32&gt;</code></td>
- <td><code>&lt;nsIDHashKey,<br>
- PRUint32&gt;</code></td>
- <td><code>&lt;nsISupportsHashKey,<br>
- PRUint32&gt;</code></td>
- </tr>
- <tr>
- <td class="header" rowspan="2">Interface (nsISupports)</td>
- <td colspan="4"><code>nsInterfaceHashtable</code></td>
- </tr>
- <tr>
- <td><code>&lt;nsUint32HashKey,<br>
- nsISupports&gt;</code></td>
- <td><code>&lt;ns(C)StringHashKey,<br>
- nsISupports&gt;</code></td>
- <td><code>&lt;nsIDHashKey,<br>
- nsISupports&gt;</code></td>
- <td><code>&lt;nsISupportsHashKey,<br>
- nsISupports&gt;</code></td>
- </tr>
- <tr>
- <td class="header" rowspan="2">Class (nsString*)</td>
- <td colspan="4"><code>nsClassHashtable</code></td>
- </tr>
- <tr>
- <td><code>&lt;nsUint32HashKey,<br>
- nsString&gt;</code></td>
- <td><code>&lt;ns(C)StringHashKey,<br>
- nsString&gt;</code></td>
- <td><code>&lt;nsIDHashKey,<br>
- nsString&gt;</code></td>
- <td><code>&lt;nsISupportsHashKey,<br>
- nsString&gt;</code></td>
- </tr>
- <tr>
- <td class="header">Complex<br>
- (structures, etc.)</td>
- <td colspan="5"><code>nsTHashtable&lt;...&gt;</code></td>
- </tr>
- </tbody>
-</table>
-<h3 id="PLDHash_.28JSDHash.29" name="PLDHash_.28JSDHash.29">PLDHash (JSDHash)</h3>
-<p><code>PLDHash</code> and <code>JSDHash</code> are the same thing; one is linked from the XPCOM libraries, the other from the JS libraries. <code>JSDHash</code> is used extensively in the SpiderMonkey JS engine.</p>
-<p>The <code>PLDHash</code> implementation is a fairly low-level implementation, written in C. It is extremely flexible, but requires some time to understand and use. A basic guide is included here, but you should read most of <code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/glue/pldhash.h" rel="custom">xpcom/glue/pldhash.h</a></code> if you intend to use <code>PLDHash</code>. The C++ wrappers for <code>PLDHash</code> (see below) are often much easier and safer to use in C++ code, as many potential casting errors are easily avoided.</p>
-<p>You must declare an <b>entry struct</b> type, deriving from <a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/glue/pldhash.h#81" rel="custom">&lt;code&gt;PLDHashEntryHdr&lt;/code&gt;</a>. This entry struct should contain whatever data you wish to store in the hashtable (any pointer or fixed-length data type). <b>Note:</b> because of the double-hashing implementation, entries may move in memory when the hashtable is altered. If you need entry pointers to remain constant, you may want to consider using <code><a href="#PLHashTable">PLHashTable</a></code> instead.</p>
-<p>You must also initialize a <a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/glue/pldhash.h#312" rel="custom">&lt;code&gt;PLDHashTableOps&lt;/code&gt;</a> structure. This serves similarly to a vtable in C++, with pointers to appropriate user-defined functions that initialize, compare, and match entries. Because <code>PLDHash</code> does not know what datatype your key is, all functions that work with keys are declared using <code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/glue/pldhash.h#354" rel="custom">const void*</a></code>, and your client code must cast these pointers to the appropriate type.</p>
-<p>PLDHashTables can be allocated on the stack or the heap:</p>
-<ul>
- <li>When allocated on the stack, or as a C++ class member, the table must be initialized using <code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/glue/pldhash.h#427" rel="custom">PL_DHashTableInit</a></code>, and finalized using <code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/glue/pldhash.h#459" rel="custom">PL_DHashTableFinish</a></code>;</li>
- <li>When allocated on the heap, use <code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/glue/pldhash.h#410" rel="custom">PL_NewDHashTable</a></code> and <code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/glue/pldhash.h#420" rel="custom">PL_DHashTableDestroy</a></code> to allocate and delete the table.</li>
-</ul>
-<h3 id="PLHashTable" name="PLHashTable">PLHashTable</h3>
-<p><code>PLHashTable</code> is a part of NSPR. The header file can be found at <code><code><a href="https://dxr.mozilla.org/mozilla-central/source/nsprpub/lib/ds/plhash.h" rel="custom">nsprpub/lib/ds/plhash.h</a></code></code>. In general, <code><a href="#PLDHash_.28JSDHash.29">PLDHash</a></code> is a better solution than <code>PLHashTable</code>, because <code>PLHashTable</code> makes many heap allocations.</p>
-<p>There are two situations where <code>PLHashTable</code> may be preferable to <code>PLDHash</code>:</p>
-<ul>
- <li>You need entry-pointers to remain constant.</li>
- <li>The entries stored in the table are very large (larger than 12 words). <code>PLDHash</code> does not handle large entry structures efficiently.</li>
-</ul>
-<h3 id="nsTHashtable" name="nsTHashtable">nsTHashtable</h3>
-<p><code>nsTHashtable</code> is a C++ template that wraps <code>PLDHash</code>. It hides many of the complexities of <code>PLDHash</code> (callback functions, the ops structure, etc). You should read <code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/glue/nsTHashtable.h" rel="custom">xpcom/glue/nsTHashtable.h</a></code>.</p>
-<p>To use <code>nsTHashtable</code>, you must declare an entry-class in a <a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/glue/nsTHashtable.h#65" rel="custom">pre-defined format</a>. This entry class contains the key and the data that you are hashing (just like <code>PLDHash</code>, above). It also declares functions that manipulate the key. In most cases, the functions of this entry class can be entirely inline. For examples of entry classes, see the declarations at <code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/glue/nsHashKeys.h" rel="custom">xpcom/glue/nsHashKeys.h</a></code>.</p>
-<p>The template parameter is the entry class. You must use the <code>Init()</code> function to initalize the table properly. At this point, use the functions <code>PutEntry/GetEntry/RemoveEntry</code> to alter the hashtable. <code>EnumerateEntries</code> will do enumeration, but beware that the enumeration will occur in a seemingly-random order (no sorting).</p>
-<ul>
- <li><code>nsTHashtable</code>s can be allocated on the stack, as class members, or on the heap.</li>
- <li>Entry pointers can and do change when items are added to the hashtable, or removed. Do not keep long-lasting pointers to entries.</li>
- <li>because of this, <code>nsTHashtable</code> is not inherently thread-safe. If you use a hashtable in a multi-thread environment, you must provide locking as appropriate.</li>
-</ul>
-<p>Before using <code>nsTHashtable</code>, see if <code>nsBaseHashtable</code> and relatives will work for you. They are much easier to use, because you do not have to declare an entry class. If you are hashing a simple key type to a simple data type, they are generally a better choice.</p>
-<h3 id="nsBaseHashtable_and_friends:_nsDataHashtable.2C_nsInterfaceHashtable.2C_and_nsClassHashtable" name="nsBaseHashtable_and_friends:_nsDataHashtable.2C_nsInterfaceHashtable.2C_and_nsClassHashtable">nsBaseHashtable and friends: nsDataHashtable, nsInterfaceHashtable, and nsClassHashtable</h3>
-<p>These C++ templates provide a high-level interface for using hashtables that hides most of the complexities of <code>PLDHash</code>. They provide the following features:</p>
-<ul>
- <li>hashtable operations can be completed without using an entry class, making code easier to read;</li>
- <li>optional thread-safety: the hashtable can manage a read-write lock around the table;</li>
- <li>predefined key classes provide automatic cleanup of strings/interfaces</li>
- <li><code>nsInterfaceHashtable</code> and <code>nsClassHashtable</code> automatically release/delete data pointers to avoid leaks.</li>
-</ul>
-<p><code>nsBaseHashtable</code> is not used directly; choose one of the three derivative classes based on the data type you want to store. The <code>KeyClass</code> is taken from <code>nsHashKeys.h</code> and is the same for all three classes:</p>
-<ul>
- <li><code>nsDataHashtable&lt;KeyClass,
- <i>
- DataType</i>
- &gt;</code> - <code>DataType</code> is a simple type such as <code>PRUint32</code> or <code>PRBool</code>.</li>
- <li><code>nsInterfaceHashtable&lt;KeyClass,
- <i>
- Interface</i>
- &gt;</code> - <code>Interface</code> is an XPCOM interface such as <code>nsISupports</code> or <code>nsIDOMNode</code></li>
- <li><code>nsClassHashtable&lt;KeyClass,
- <i>
- T</i>
- &gt;</code> - <code>T</code> is any C++ class. The hashtable stores a pointer to the class, and deletes it when the entry is removed.</li>
-</ul>
-<p>The important files to read are <code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/glue/nsBaseHashtable.h" rel="custom">xpcom/glue/nsBaseHashtable.h</a></code> and <code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/glue/nsHashKeys.h" rel="custom">xpcom/glue/nsHashKeys.h</a></code>. These classes can be used on the stack, as a class member, or on the heap. Initialize using the <code>Init()</code> function; you can specify whether you need thread-safety at this time. Use the <code>Put()</code>, <code>Get()</code>, and <code>Remove()</code> methods to alter the table.</p>
-<p>There are two enumeration functions:</p>
-<ul>
- <li><code>EnumerateRead()</code> performs a read-only enumeration, where entries cannot be changed or removed;</li>
- <li><code>Enumerate()</code> performs a read-write enumeration, where entries may be changed or removed as necessary.</li>
-</ul>
-<h3 id="Using_nsTHashtable_as_a_hash-set" name="Using_nsTHashtable_as_a_hash-set">Using nsTHashtable as a hash-set</h3>
-<p>A hash set only tracks the existence of keys: it does not associate data with the keys. This can be done using <code>nsTHashtable&lt;nsSomeHashKey&gt;</code>. The appropriate entries are GetEntry and PutEntry.</p>
-<h2 id="Future_Plans" name="Future_Plans">Future Plans</h2>
-<h3 id="nsISimpleEnumerator_support" name="nsISimpleEnumerator_support">nsISimpleEnumerator support</h3>
-<p>The (obsolete) <code>nsHashtable</code> has a wrapper that exposes an <code>nsISimpleEnumerator</code> on its items. I will add this support to the various <code>nsBaseHashtable</code> classes as well, as needed.</p>
-<h2 id="Hash_Functions" name="Hash_Functions">Hash Functions</h2>
-<p>All of the above hashtables need a <a class="external" href="http://www.nist.gov/dads/HTML/hash.html">Hash Function</a>. This function converts the key into a semi-unique integer. The mozilla codebase already contains hash functions for most key types, including narrow and wide strings, pointers, and most binary data:</p>
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>void*<br>
- (or nsISupports*)</code></td>
- <td>cast using <code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/base/nscore.h#443" rel="custom">NS_PTR_TO_INT32</a></code></td>
- </tr>
- <tr>
- <td><code>char*</code> string</td>
- <td rowspan="2"><code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/ds/nsCRT.h#228" rel="custom">nsCRT::HashCode()</a></code></td>
- </tr>
- <tr>
- <td><code>PRUnichar*</code> string</td>
- </tr>
- <tr>
- <td><code>nsAString</code></td>
- <td rowspan="2"><code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/glue/nsTHashtable.cpp#41" rel="custom">HashString()</a></code></td>
- </tr>
- <tr>
- <td><code>nsACString</code></td>
- </tr>
- <tr>
- <td><code>nsID&amp;</code></td>
- <td><code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/glue/nsHashKeys.h#227" rel="custom">nsIDHashKey::HashKey()</a></code></td>
- </tr>
- </tbody>
-</table>
-<p>Writing a good hash function is well beyond the scope of this document, and has been discussed extensively in computer-science circles for many years. There are many different types of hash functions. Mozilla has tuned a good general-purpose hash algorithm for strings and <code>nsID</code>.</p>
-<h2 id="Mozilla.27s_Old.2FObsolete.2FDeprecated.2FDecrepit_Hashtables" name="Mozilla.27s_Old.2FObsolete.2FDeprecated.2FDecrepit_Hashtables">Mozilla's Old/Obsolete/Deprecated/Decrepit Hashtables</h2>
-<h3 id="nsHashtable" name="nsHashtable">nsHashtable</h3>
-<p><code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/ds/nsHashtable.h" rel="custom">nsHashtable</a></code> was a C++ wrapper around <code>PLHashTable</code>, and now wraps <code>PLDHash</code>. The design of the key classes is not optimal, however, and <code>nsHashtable</code> has been deprecated in favor of <code>nsDataHashtable</code> and friends.</p>
-<h3 id="nsObjectHashtable" name="nsObjectHashtable">nsObjectHashtable</h3>
-<p><code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/ds/nsHashtable.h#163" rel="custom">nsObjectHashtable</a></code> is a form of <code>nsHashtable</code>. It has been replaced by <code>nsClassHashtable</code>.</p>
-<h3 id="nsSupportsHashtable" name="nsSupportsHashtable">nsSupportsHashtable</h3>
-<p><code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/ds/nsHashtable.h#193" rel="custom">nsSupportsHashtable</a></code> is a form of <code>nsHashtable</code>. It has been replaced by <code>nsInterfaceHashtable</code>.</p>
-<h3 id="nsHashSets" name="nsHashSets">nsHashSets</h3>
-<p><code>nsHashSets</code> has predefined hash sets for common keys, which are trivially easy to use. See <code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/ds/nsHashSets.h" rel="custom">xpcom/ds/nsHashSets.h</a></code>. This functionality has been replaced by <code>nsTHashtable&lt;nsSomeHashKey&gt;</code>.</p>
-<h3 id="nsDoubleHashtable" name="nsDoubleHashtable">nsDoubleHashtable</h3>
-<p><code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/ds/nsDoubleHashtable.h" rel="custom">nsDoubleHashtable</a></code> is the (obsolete) precursor to <code>nsTHashtable</code>. It uses macros instead of C++ templates.</p>
-<div class="originaldocinfo">
- <h2 id="Original_Document_Information" name="Original_Document_Information">Original Document Information</h2>
- <ul>
- <li>Author(s): Benjamin Smedberg &lt;<a class="link-mailto" href="mailto:benjamin@smedbergs.us" rel="freelink">benjamin@smedbergs.us</a>&gt;</li>
- </ul>
-</div>
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/guide/index.html b/files/zh-cn/mozilla/tech/xpcom/guide/index.html
deleted file mode 100644
index 385888d9fb..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/guide/index.html
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: XPCOM 指南
-slug: Mozilla/Tech/XPCOM/Guide
-tags:
- - Landing
- - Mozilla
- - XPCOM
-translation_of: Mozilla/Tech/XPCOM/Guide
----
-<p> </p>
-<p><span class="seoSummary" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px;">本文提供了关于 XPCOM 的说明和使用文档,包括如何在你的工程中使用,如何为你的 Firefox 扩展等构建 XPCOM 组件。</span></p>
-<p></p><div class="row topicpage-table">
- <div class="section"><dl><dl><dt class="landingPageList"><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Guide/Arrays">Array</a></dt><dd class="landingPageList"></dd><dt class="landingPageList"><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Guide/Hashtables">Hashtables</a></dt><dd class="landingPageList"></dd><dt class="landingPageList"><a href="/zh-CN/docs/How_to_Build_an_XPCOM_Component_in_Javascript">How to Build an XPCOM Component in Javascript</a></dt><dd class="landingPageList"></dd></dl></dl></div>
- <div class="section"><dl><dt class="landingPageList"><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Guide/Internal_strings">Strings</a></dt><dd class="landingPageList"></dd><dt class="landingPageList"><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Guide/Creating_components">创建_XPCOM_组件</a></dt><dd class="landingPageList"></dd></dl></div>
- </div><p></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/guide/internal_strings/index.html b/files/zh-cn/mozilla/tech/xpcom/guide/internal_strings/index.html
deleted file mode 100644
index fe5806168f..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/guide/internal_strings/index.html
+++ /dev/null
@@ -1,809 +0,0 @@
----
-title: Strings
-slug: Mozilla/Tech/XPCOM/Guide/Internal_strings
-tags:
- - XPCOM
- - 所有分类
-translation_of: Mozilla/Tech/XPCOM/Guide/Internal_strings
----
-<p> </p>
-<h2 id="Preface" name="Preface">Preface</h2>
-<div>
- <p>by Alec Flett<br>
- Thanks to David Baron for <a class="external" href="http://dbaron.org/mozilla/coding-practices">actual docs</a>,<br>
- Peter Annema for lots of direction,<br>
- Myk Melez for some more docs, and<br>
- David Bradley for a diagram<br>
- Revised by Darin Fisher for Mozilla 1.7<br>
- Revised by Jungshik Shin to clarify character encoding issues</p>
-</div>
-<p>This guide will attempt to document the plethora of string classes, and hopefully provide an answer to the age old question, "what string class should I use here?"</p>
-<div style="border: solid thin steelblue; padding: 0.5em;">
- <p>If you are a Mozilla embedder or if you are writing an XPCOM component that will be distributed separately from the Mozilla code base, then this string guide is most likely not for you! Provided you are developing against Mozilla 1.7 or later, you should instead be using the new minimal <a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/glue/nsStringAPI.h" rel="custom">Mozilla string API</a> and in particular the <a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/string/public/nsEmbedString.h" rel="custom">nsEmbedString</a> class.</p>
-</div>
-<p>In a hurry? Go check out the <a href="cn/XPCOM/String_Quick_Reference">String Quick-Reference</a> (<a class="external" href="http://www.mozilla.org/projects/xpcom/string-quickref.html">). </a></p>
-<h2 id="Introduction" name="Introduction"><a class="external" href="http://www.mozilla.org/projects/xpcom/string-quickref.html">Introduction </a></h2>
-<p><a class="external" href="http://www.mozilla.org/projects/xpcom/string-quickref.html">The string classes are a library of C++ classes which are used to manage buffers of unicode and single-byte character strings. They reside in the mozilla codebase in the <code></code></a><code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/string" rel="custom">xpcom/string</a></code> directory. </p>
-<p><a class="external" href="http://www.mozilla.org/projects/xpcom/string-quickref.html">Abstract (interface) classes begin with "nsA" and concrete classes simply begin with "ns". Classes with a "<code>CString</code>" in the name store 8-bit bytes (<code>char</code>'s) which may refer to single byte ASCII strings, or multibyte Unicode strings encoded in UTF-8 or a (multibyte or single byte) legacy character encoding (e.g. ISO-8859-1, Shift_JIS, GB2312, KOI8-R). All other classes simply have "<code>String</code>" in their name and refer to 16-bit strings made up of <code>PRUnichar</code>'s, For example: <code>nsAString</code> is an abstract class for storing Unicode characters in UTF-16 encoding, and <code>nsDependentCString</code> is a concrete class which stores a 8-bit string. Every 16-bit string class has an equivalent 8-bit string class. For example: <code>nsCString</code> is the 8-bit string class which corresponds to <code>nsString</code>. </a></p>
-<p><a class="external" href="http://www.mozilla.org/projects/xpcom/string-quickref.html">8-bit and 16-bit string classes have completely separate base classes, but share the same APIs. As a result, you cannot assign a 8-bit string to a 16-bit string without some kind of conversion helper class or routine. For the purpose of this document, we will refer to the 16-bit string classes in class documentation. It is safe to assume that every 16-bit class has an equivalent 8-bit class. </a></p>
-<h2 id="String_Guidelines" name="String_Guidelines"><a class="external" href="http://www.mozilla.org/projects/xpcom/string-quickref.html">String Guidelines </a></h2>
-<p><a class="external" href="http://www.mozilla.org/projects/xpcom/string-quickref.html">Follow these simple rules in your code to keep your fellow developers, reviewers, and users happy. </a></p>
-<ul>
- <li><a class="external" href="http://www.mozilla.org/projects/xpcom/string-quickref.html">Avoid </a><code><a href="#Unicode_Conversion_ns.2ACString_vs._ns.2AString">*WithConversion</a></code> functions at all costs: <code>AssignWithConversion</code>, <code>AppendWithConversion</code>, <code>EqualsWithConversion</code>, etc</li>
- <li>Use the most abstract string class that you can. Usually this is:
- <ul>
- <li><code><a href="#The_Abstract_Classes">nsAString</a></code> for function parameters</li>
- <li><code><a href="#The_Concrete_Classes_-_which_classes_to_use_when">nsString</a></code> for member variables</li>
- <li><a href="#The_Concrete_Classes_-_which_classes_to_use_when"><code>nsAutoString</code> or <code>nsXPIDLString</code></a> for local (stack-based) variables</li>
- </ul>
- </li>
- <li>Use <a href="#Literal_Strings"><code>NS_LITERAL_[C]STRING</code> / <code>NS_NAMED_LITERAL_[C]STRING</code></a> to represent literal strings (i.e. "foo") as nsAString-compatible objects.</li>
- <li>Use <a href="#String_Concatenation">string concatenation</a> (i.e. the "+" operator) when combining strings.</li>
- <li>Use <code><a href="#Raw_Character_Pointers">nsDependentString</a></code> when you have a raw character pointer that you need to convert to an nsAString-compatible string.</li>
- <li>Use <code><a href="#Substrings_.28string_fragments.29">Substring()</a></code> to extract fragments of existing strings.</li>
- <li>Use <a href="#Iterators">iterators</a> to parse and extract string fragments.</li>
-</ul>
-<h2 id="The_Abstract_Classes" name="The_Abstract_Classes">The Abstract Classes</h2>
-<p>Every string class derives from <code>nsAString</code> (or <code>nsACString</code>). This class provides the fundamental interface for access and manipulation of strings. While concrete classes derive from <code>nsAString</code>, <code>nsAString</code> itself cannot be instantiated.</p>
-<p>This is very similar to the idea of an "interface" that mozilla uses to describe abstract object descriptions in the rest of the codebase. In the case of interfaces, class names begin with "nsI" where "I" refers to "Interface". In the case of strings, abstract classes begin with "nsA" and the "A" means "Abstract".</p>
-<p>There are a number of abstract classes which derive from <code>nsAString</code>. These abstract subclasses also cannot be instantiated, but they describe a string in slightly more detail than <code>nsAString</code>. They guarantee that the underlying implementation behind the abstract class provides specific capabilities above and beyond <code>nsAString</code>.</p>
-<p>The list below describes the main base classes. Once you are familiar with them, see the appendix describing What Class to Use When.</p>
-<ul>
- <li><b><code>nsAString</code></b>: the abstract base class for all strings. It provides an API for assignment, individual character access, basic manipulation of characters in the string, and string comparison. This class corresponds to the XPIDL <code>AString</code> parameter type.</li>
- <li><b><code>nsSubstring</code></b>: the common base class for all of the string classes. Provides optimized access to data within the string. A <code>nsSubstring</code> is not necessarily null-terminated. (For backwards compatibility, <code>nsASingleFragmentString</code> is a typedef for this string class.)</li>
- <li><b><code>nsString</code></b>: builds on <code>nsSubstring</code> by guaranteeing a null-terminated storage. This allows for a method (<code>.get()</code>) to access the underlying character buffer. (For backwards compatibility, <code>nsAFlatString</code> is a typedef for this string class.)</li>
-</ul>
-<p>The remainder of the string classes inherit from either <code>nsSubstring</code> or <code>nsString</code>. Thus, every string class is compatible with <code>nsAString</code>.</p>
-<p>It's important to note that <code>nsSubstring</code> and <code>nsAString</code> both represent a contiguous array of characters that are not necessarily null-terminated. One might ask then ask why two different yet similar string classes need to exist. Well, <code>nsSubstring</code> exists primarily as an optimization since <code>nsAString</code> must retain binary compatibility with the frozen <code>nsAString</code> class that shipped with Mozilla 1.0. Up until the release of Mozilla 1.7, <code>nsAString</code> was capable of representing a string broken into multiple fragments. The cost associated with supporting multi-fragment strings was high and offered limited benefits. It was decided to eliminate support for multi-fragment strings in an effort to reduce the complexity of the string classes and improve performance. See <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=231995" title='FIXED: Exploring nsAString "defragmentation"'>bug 231995</a> for more details.</p>
-<p>Though <code>nsSubstring</code> provides a more efficient interface to its underlying buffer than <code>nsAString</code>, <code>nsAString</code> is still the most commonly used class for parameter passing. This is because it is the string class corresponding to <code>AString</code> in XPIDL. Therefore, this string guide will continue to discuss the string classes with an emphasis on <code>nsAString</code>.</p>
-<p>Since every string derives from <code>nsAString</code> (or <code>nsACString</code>), they all share a simple API. Common read-only methods:</p>
-<ul>
- <li><b><code>.Length()</code></b> - the number of code units (bytes for 8-bit string classes and PRUnichar's for 16-bit string classes) in the string.</li>
- <li><b><code>.IsEmpty()</code></b> - the fastest way of determining if the string has any value. Use this instead of testing <code>string.Length</code> == 0</li>
- <li><b><code>.Equals(string)</code></b> - TRUE if the given string has the same value as the current string.</li>
-</ul>
-<p>Common methods that modify the string:</p>
-<ul>
- <li><b><code>.Assign(string)</code></b> - Assigns a new value to the string.</li>
- <li><b><code>.Append(string)</code></b> - Appends a value to the string.</li>
- <li><b><code>.Insert(string, position)</code></b> - Inserts the given string before the code unit at position.</li>
- <li><b><code>.Truncate(length)</code></b> - shortens the string to the given length.</li>
-</ul>
-<p>Complete documentation can be found in the <a href="#Appendix_B_-_nsAString_Reference">Appendix</a>.</p>
-<h3 id="Read-only_strings" name="Read-only_strings">Read-only strings</h3>
-<p>The <code>const</code> attribute on a string determines if the string is writable. If a string is defined as a <code>const nsAString</code> then the data in the string cannot be manipulated. If one tries to call a non-<code>const</code> method on a <code>const</code> string the compiler will flag this as an error at build time.</p>
-<p>For example:</p>
-<pre class="eval">void nsFoo::ReverseCharacters(nsAString&amp; str) {
- ...
- str.Assign(reversedStr); // modifies the string
-}
-</pre>
-<p>This should not compile, because you're assigning to a <code>const</code> class:</p>
-<pre class="eval">void nsFoo::ReverseCharacters(const nsAString&amp; str) {
- ...
- <b>str.Assign(reversedStr);</b>
-}
-</pre>
-<h3 id="As_function_parameters" name="As_function_parameters">As function parameters</h3>
-<p>It is recommended that you use the most abstract interface possible as a function parameter, instead of using concrete classes. The convention is to use C++ references (the '&amp;' character) instead of pointers (the '*' character) when passing string references around. For example:</p>
-<pre class="eval">// abstract reference
-nsFoo::PrintString(<b>const nsAString&amp;</b> str) {..}
-
-// using a concrete class!
-nsFoo::PrintString(<b>const nsString&amp;</b> str) {..}
-
-// using a pointer!
-nsFoo::PrintString(<b>const nsAString*</b> str) {..}
-</pre>
-<p>The abstract classes are also sometimes used to store temporary references to objects. You can see both of these uses in <a href="#Common_Patterns">Common Patterns</a>, below.</p>
-<p><b>NOTE:</b> While using abstract string classes increases the re-usability of your methods, it also incurs a codesize and performance penalty. Therefore, when writing methods that will only ever be used within the confines of your source file or module, it is better to use <b><code>const nsSubstring&amp;</code></b> for input parameters and <b><code>nsString&amp;</code></b> for output parameters. --Darin</p>
-<h2 id="The_Concrete_Classes_-_which_classes_to_use_when" name="The_Concrete_Classes_-_which_classes_to_use_when">The Concrete Classes - which classes to use when</h2>
-<p>The concrete classes are for use in code that actually needs to store string data. The most common uses of the concrete classes are as local variables, and members in classes or structs. Whereas the abstract classes differ in storage mechansim, for the most part the concrete classes differ in storage policy.</p>
-<p>The following is a list of the most common concrete classes. Once you are familiar with them, see the appendix describing <a href="#Appendix_A_-_What_class_to_use_when">What Class to Use When.</a></p>
-<ul>
- <li><code><b>nsString / nsCString</b></code>- a null-terminated string whose buffer is allocated on the heap. Destroys its buffer when the string object goes away.</li>
- <li><code><b>nsAutoString / nsCAutoString</b></code>- derived from <code>nsString</code>, a string which owns a 64 code unit buffer in the same storage space as the string itself. If a string less than 64 code units is assigned to an <code>nsAutoString</code>, then no extra storage will be allocated. For larger strings, a new buffer is allocated on the heap.</li>
- <li><code><b>nsXPIDLString / nsXPIDLCString</b></code>- derived from <code>nsString</code>, this class supports the <code>getter_Copies()</code> operator which allows easy access to XPIDL <code>out wstring / string</code> parameters. This class also supports the notion of a null-valued buffer, whereas <code>nsString</code>'s buffer is never null.</li>
- <li><code><b>nsDependentString</b></code>- derived from <code>nsString</code>, this string does
- <i>
- not</i>
- own its buffer. It is useful for converting a raw string (<code>const PRUnichar*</code> or <code>const char*</code>) into a class of type <code>nsAString</code>.</li>
- <li><code><b>nsPrintfCString</b></code>- derived from <code>nsCString</code>, this string behaves like an <code>nsCAutoString</code>. The constructor takes parameters which allows it to construct a 8-bit string from a <code>printf</code>-style format string and parameter list.</li>
- <li><code><b>NS_LITERAL_STRING/NS_NAMED_LITERAL_STRING</b></code>- these convert a literal string (such as "abc") to a <code>nsString</code> or a subclass of <code>nsString</code>. On platforms supporting double-byte string literals (e.g., MSVC++ or GCC with the -fshort-wchar option), these are simply macros around the <code>nsDependentString</code> class. They are slightly faster than just wrapping them with an <code>nsDependentString</code> because they use the compiler to calculate their length, and they also hide the messy cross-platform details of non-byte literal strings.</li>
-</ul>
-<p>There are also a number of concrete classes that are created as a side-effect of helper routines, etc. You should avoid direct use of these classes. Let the string library create the class for you.</p>
-<ul>
- <li><code><b>nsSubstringTuple</b></code> - created via <a href="#String_Concatenation">string concatenation</a></li>
- <li><code><b>nsDependentSubstring</b></code> - created through <a href="#Substrings_.28string_fragments.29">Substring</a></li>
- <li><code><b>nsPromiseFlatString</b></code> - created through <code><b><a href="#Raw_Character_Pointers">PromiseFlatString()</a></b></code></li>
-</ul>
-<p>Of course, there are times when it is necessary to reference these string classes in your code, but as a general rule they should be avoided.</p>
-<h2 id="Iterators" name="Iterators">Iterators</h2>
-<p>Iterators are objects that retain a reference to a position in a string. In some ways they are like a number which refers to an index in an array, or a character-pointer that refers to a position in a character string. They also provide a syntactic means to distinguish between reading and writing to a string.</p>
-<p>Iterators are most often used to extract substrings of a string. They provide the capability to modify the contents of a string, but often helper routines, or the string's own methods are quicker at complex string transformations.</p>
-<p>Iterators are declared from the string class which they are iterating:</p>
-<pre class="eval">nsAString::const_iterator start, end; // reading-only iterators for nsAString
-nsString::iterator substr_start, substr_end; // writing iterators for nsString
-</pre>
-<p>Iterators are initialized with one of 4 methods on the string you wish to reference:</p>
-<pre class="eval">// let's read from 'str'
-str.BeginReading(start); // initialize 'start' to the beginning of 'str'
-str.EndReading(end); // 'end' will be at the end of the string
-
-// say we also want to write to 'url'
-url.BeginWriting(substr_start);
-url.EndWriting(substr_end);
-</pre>
-<p>You can access the code unit that an iterator points to with the dereference operator *.</p>
-<pre class="eval">if (*start == '[')
- printf("Starts with a bracket\n");
-</pre>
-<p>Note in the above examples, that '<code>end</code>' and '<code>substr_end</code>' will actually point to the code unit past the end of the string, so you should never dereference the direct result of <code>.EndReading()</code>.</p>
-<p>You can test if two iterators point to the same position with == or !=. You can advance iterators with ++. Putting the ++ before your iterator is preferred, and will prevent creation of a temporary iterator.</p>
-<pre class="eval">while (start != end) // iterate through the whole string
- ++start;
-</pre>
-<p>You can effectively write to a string with writing iterators (as opposed to const-iterators):</p>
-<pre class="eval">// change all * to !
-while (substr_start != substr_end) {
- if (*substr_start == '*')
- *substr_start = '!';
- ++substr_start;
-}
-</pre>
-<p>With the patch for <a class="external" href="http://bugzilla.mozilla.org/show_bug.cgi?id=231995">bug 231995</a>, this loop is now as efficient as iterating with raw character pointers.</p>
-<h2 id="Helper_Classes_and_Functions" name="Helper_Classes_and_Functions">Helper Classes and Functions</h2>
-<h3 id="Searching_strings_-_looking_for_substrings.2C_characters.2C_etc." name="Searching_strings_-_looking_for_substrings.2C_characters.2C_etc.">Searching strings - looking for substrings, characters, etc.</h3>
-<p><code>FindInReadable()</code> is the replacement for the old <code>string.Find(..)</code>. The syntax is:</p>
-<pre class="eval">PRBool FindInReadable(const nsAString&amp; pattern,
- nsAString::const_iterator start, nsAString::const_iterator end,
- nsStringComparator&amp; aComparator = nsDefaultStringComparator());
-</pre>
-<p>To use this, <code>start</code> and <code>end</code> should point to the beginning and end of a string that you would like to search. If the search string is found, <code>start</code> and <code>end</code> will be adjusted to point to the beginning and end of the found pattern. The return value is PR_TRUE or PR_FALSE, indicating whether or not the string was found.</p>
-<p>An example:</p>
-<pre class="eval">const nsAString&amp; str = GetSomeString();
-nsAString::const_iterator start, end;
-
-str.BeginReading(start);
-str.EndReading(end);
-
-NS_NAMED_LITERAL_STRING(valuePrefix, "value=");
-
-if (FindInReadable(valuePrefix, start, end)) {
- // end now points to the character after the pattern
- valueStart = end;
-
-}
-</pre>
-<h3 id="Memory_Allocation_-_how_to_avoid_it.2C_which_methods_to_use" name="Memory_Allocation_-_how_to_avoid_it.2C_which_methods_to_use">Memory Allocation - how to avoid it, which methods to use</h3>
-<p>The preferred method to allocate a new character buffer (<code>PRUnichar*</code>/<code>char*</code>) from an existing string is with one of the following methods:</p>
-<ul>
- <li><code><b>PRUnichar* ToNewUnicode(
- <i>
- nsAString&amp;</i>
- )</b></code> - Allocates a <code>PRUnichar*</code>buffer from an <code>nsAString</code>.</li>
- <li><code><b>char *ToNewCString(
- <i>
- nsACString&amp;</i>
- )</b></code> - Allocates a <code>char*</code>buffer from an <code>nsACString</code>. Note that this method will also work on nsAStrings, but it will do an implicit <a href="#Lossy_Conversion">lossy conversion</a>. This function should only be used if the input is known to be strictly ASCII. Often a conversion to UTF-8 is more appropriate. See <code><b>ToNewUTF8String</b></code> below.</li>
- <li><code><b>char* ToNewUTF8String(
- <i>
- nsAString&amp;</i>
- )</b></code> - Allocates a new <code>char*</code> buffer containing the UTF-8 encoded version of the given nsAString. See <a href="#Unicode_Conversion_ns.2ACString_vs._ns.2AString">Unicode Conversion</a> for more details.</li>
-</ul>
-<p>These methods return a buffer allocated using XPCOM's allocator (<code>nsMemory::Alloc</code>) instead of the traditional allocator (<code>malloc</code>, etc.). You should use <code>nsMemory::Free</code> to deallocate the result when you no longer need it.</p>
-<h3 id="Substrings_.28string_fragments.29" name="Substrings_.28string_fragments.29">Substrings (string fragments)</h3>
-<p>It is very simple to refer to a substring of an existing string without actually allocating new space and copying the characters into that substring. <code>Substring()</code> is the preferred method to create a reference to such a string.</p>
-<pre class="eval">void ProcessString(const nsAString&amp; str) {
- const nsAString&amp; firstFive = Substring(str, 0, 5);
- // firstFive is now a string representing the first 5 characters
-}
-</pre>
-<h2 id="Unicode_Conversion_ns.2ACString_vs._ns.2AString" name="Unicode_Conversion_ns.2ACString_vs._ns.2AString">Unicode Conversion ns*CString vs. ns*String</h2>
-<p>Strings can be
- <i>
- stored</i>
- in two basic formats: 8-bit code unit (byte/<code>char</code>) strings, or 16-bit code unit (<code>PRUnichar</code>) strings. Any string class with a capital "C" in the classname contains 8-bit bytes. These classes include <code>nsCString</code>, <code>nsDependentCString</code>, and so forth. Any string class
- <i>
- without</i>
- the "C" contains 16-bit code units.</p>
-<p>A 8-bit string can be in one of many character encodings while a 16-bit string is always in UTF-16. The most common encodings are:</p>
-<ul>
- <li>ASCII - 8-bit encoding for basic English-only strings. Each ASCII value is stored in exactly one byte in the array.</li>
- <li><a class="external" href="http://www.unicode.org/glossary/#UCS_2">UCS2</a> - 16-bit encoding for a
- <i>
- subset</i>
- of Unicode, <a class="external" href="http://www.unicode.org/glossary/#BMP">BMP</a>. The Unicode value of a character stored in UCS2 is stored in exactly one 16-bit <code>PRUnichar</code> in a string class.</li>
- <li><a class="external" href="http://www.faqs.org/rfcs/rfc3629.html">UTF-8</a> - 8-bit encoding for Unicode characters. Each Unicode characters is stored in up to 4 bytes in a string class. UTF-8 is capable of representing the entire Unicode character repertoire, and it efficiently maps to <a class="external" href="http://www.unicode.org/glossary/#UTF_32">UTF-32</a>.</li>
- <li><a class="external" href="http://www.unicode.org/glossary/#UTF_16">UTF-16</a> - 16-bit encoding for Unicode storage, backwards compatible with UCS2. The Unicode value of a character stored in UTF-16 may require
- <i>
- one or two</i>
- 16-bit <code>PRUnichar</code>s in a string class. The contents of <code>nsAString</code> always has to be regarded as in this encoding instead of UCS2. UTF-16 is capable of representing the entire Unicode character repertoire, and it efficiently maps to UTF-32. (Win32 W APIs and Mac OS X natively use UTF-16.)</li>
-</ul>
-<p>In addition, there are literally hundreds of encodings that are provided by internationalization libraries. Access to these libraries may be part of the application (such as <code>nsICharsetConversionManager</code> in Mozilla) or built into the operating system (such as <code>iconv()</code> in UNIX operating systems and <code>MultiByteToWideChar</code>/<code>WideCharToMultiByte</code> on Windows).</p>
-<p>When working with existing code, it is important to examine the current usage of the strings that you are manipulating, to determine the correct conversion mechanism.</p>
-<p>When writing new code, it can be confusing to know which storage class and encoding is the most appropriate. There is no single answer to this question, but there are a few important guidelines:</p>
-<ul>
- <li><b>Is the string always ASCII?</b> First and foremost, you need to determine what kinds of values will be stored in the string. If the strings are always internal, ASCII strings such as "left", "true", "background" and so forth, then straight C-strings are probably the way to go.</li>
- <li><b>If the string is ASCII, will it be compared to, assigned to, or otherwise interact with non-ASCII strings?</b> When assigning or comparing an 8-bit ASCII value (in)to a 16-bit UCS2 string, an "inflation" needs to happen at runtime. If your strings are small enough (say, less than 64 bytes) then it may make sense to store your string in a 16-bit unicode class as well, to avoid the extra conversion. The tradeoff is that your ASCII string takes up twice as much space as a 16-bit Unicode string than it would as an 8-bit string.</li>
- <li><b>Is the string usually ASCII, but needs to support unicode?</b> If your string is most often ASCII but needs to be able to store Unicode characters, then UTF-8 may be the right encoding. ASCII characters will still be stored in 8-bit storage but other Unicode characters will take up 2 to 4 bytes. However if the string ever needs to be compared or assigned to a 16-bit string, a runtime conversion will be necessary.</li>
- <li><b>Are you storing large strings of non-ASCII data?</b> Up until this point, UTF-8 might seem like the ideal encoding. The drawback is that for most non-European characters (such as Chinese, Indian and Japanese) in BMP, UTF-8 takes 50% more space than UTF-16. For characters in plane 1 and above, both UTF-8 and UTF-16 take 4 bytes.</li>
- <li><b>Do you need to manipulate the contents of a Unicode string?</b> One problem with encoding Unicode characters in UTF-8 or other 8-bit storage formats is that the actual Unicode character can span multiple bytes in a string. In most encodings, the actual number of bytes varies from character to character. When you need to iterate over each character, you must take the encoding into account. This is vastly simplified when iterating 16-bit strings because each 16-bit code unit (<code>PRUnichar</code>) corresponds to a Unicode character as long as all characters are in BMP, which is often the case. However, you have to keep in mind that a single Unicode character in plane 1 and beyond is represented in two 16-bit code units in 16-bit strings so that the number of <code>PRUnichar</code>'s is
- <i>
- not</i>
- always equal to the number of Unicode characters. For the same reason, the position and the index in terms of 16-bit code units are not always the same as the position and the index in terms of Unicode characters.</li>
-</ul>
-<p><br>
- To assist with ASCII, UTF-8, and UTF-16 conversions, there are some helper methods and classes. Some of these classes look like functions, because they are most often used as temporary objects on the stack.</p>
-<h3 id="UTF-8_.2F_UTF-16_conversion" name="UTF-8_.2F_UTF-16_conversion">UTF-8 / UTF-16 conversion</h3>
-<p><code><b>NS_ConvertUTF8toUTF16(
- <i>
- const nsACString&amp;</i>
- )</b></code> - a <code>nsAutoString</code> subclass that converts a UTF-8 encoded <code>nsACString</code> or <code>const char*</code> to a 16-bit UTF-16 string. If you need a <code>const PRUnichar*</code> buffer, you can use the <code>.get()</code> method. For example:</p>
-<pre class="eval">/* signature: void HandleUnicodeString(const nsAString&amp; str); */
-object-&gt;HandleUnicodeString(<b>NS_ConvertUTF8toUTF16</b>(utf8String));
-
-/* signature: void HandleUnicodeBuffer(const PRUnichar* str); */
-object-&gt;HandleUnicodeBuffer(<b>NS_ConvertUTF8toUTF16</b>(utf8String).get());
-</pre>
-<p><code><b>NS_ConvertUTF16toUTF8(
- <i>
- const nsAString&amp;</i>
- )</b></code> - a <code>nsCAutoString</code> which converts a 16-bit UTF-16 string (<code>nsAString</code>) to a UTF-8 encoded string. As above, you can use <code>.get()</code> to access a <code>const char*</code> buffer.</p>
-<pre class="eval">/* signature: void HandleUTF8String(const nsACString&amp; str); */
-object-&gt;HandleUTF8String(<b>NS_ConvertUTF16toUTF8</b>(utf16String));
-
-/* signature: void HandleUTF8Buffer(const char* str); */
-object-&gt;HandleUTF8Buffer(<b>NS_ConvertUTF16toUTF8</b>(utf16String).get());
-</pre>
-<p><code><b>CopyUTF8toUTF16(
- <i>
- const nsACString&amp;, nsAString&amp;</i>
- )</b></code> - converts and copies:</p>
-<pre class="eval">// return a UTF-16 value
-void Foo::GetUnicodeValue(nsAString&amp; result) {
- <b>CopyUTF8toUTF16</b>(mLocalUTF8Value, result);
- }
-</pre>
-<p><code><b>AppendUTF8toUTF16(
- <i>
- const nsACString&amp;, nsAString&amp;</i>
- )</b></code> - converts and appends:</p>
-<pre class="eval">// return a UTF-16 value
-void Foo::GetUnicodeValue(nsAString&amp; result) {
- result.AssignLiteral("prefix:");
- <b>AppendUTF8toUTF16</b>(mLocalUTF8Value, result);
-}
-</pre>
-<p><br>
- <code><b>UTF8ToNewUnicode(
- <i>
- const nsACString&amp;, PRUint32* aUTF16Count = nsnull</i>
- )</b></code> - allocates and converts (the optional parameter will contain the number of 16-byte units upon return, if non-null):</p>
-<pre class="eval">void Foo::GetUTF16Value(PRUnichar** result) {
- *result = <b>UTF8ToNewUnicode</b>(mLocalUTF8Value);
-}
-</pre>
-<p><br>
- <code><b>CopyUTF16toUTF8(
- <i>
- const nsAString&amp;, nsACString&amp;</i>
- )</b></code> - converts and copies:</p>
-<pre class="eval">// return a UTF-8 value
-void Foo::GetUTF8Value(nsACString&amp; result) {
- <b>CopyUTF16toUTF8</b>(mLocalUTF16Value, result);
-}
-</pre>
-<p><code><b>AppendUTF16toUTF8(
- <i>
- const nsAString&amp;, nsACString&amp;</i>
- )</b></code> - converts and appends:</p>
-<pre class="eval">// return a UTF-8 value
-void Foo::GetUnicodeValue(nsACString&amp; result) {
- result.AssignLiteral("prefix:");
- <b>AppendUTF16toUTF8</b>(mLocalUTF16Value, result);
-}
-</pre>
-<p><code><b>ToNewUTF8String(
- <i>
- const nsAString&amp;</i>
- )</b></code> - allocates and converts:</p>
-<pre class="eval">void Foo::GetUTF8Value(char** result) {
- *result = <b>ToNewUTF8String</b>(mLocalUTF16Value);
-}
-</pre>
-<h3 id="Lossy_Conversion" name="Lossy_Conversion">Lossy Conversion</h3>
-<p>The following should only be used when you can guarantee that the original string is ASCII. These helpers are very similar to the UTF-8 / UTF-16 conversion helpers above.</p>
-<h4 id="UTF-16_to_ASCII_converters" name="UTF-16_to_ASCII_converters">UTF-16 to ASCII converters</h4>
-<p>These converters are
- <i>
- <b>very dangerous</b></i>
- because they
- <i>
- <b>lose information</b></i>
- during the conversion process. You should
- <i>
- <b>avoid UTF-16 to ASCII conversions</b></i>
- unless your strings are guaranteed to be ASCII. Each 16-bit code unit in 16-bit string is simply cast to an 8-bit byte, which means all Unicode character values above 0xFF are converted to an arbitrary 8-bit byte.</p>
-<ul>
- <li><code><b>NS_LossyConvertUTF16toASCII(
- <i>
- nsAString</i>
- )</b></code> - a <code>nsCAutoString</code> which holds a temporary buffer containing the deflated value of the string.</li>
- <li><code><b>LossyCopyUTF16toASCII(
- <i>
- nsAString, nsACString</i>
- )</b></code> - does an in-place conversion from UTF-16 into an ASCII string object.</li>
- <li><code><b>LossyAppendUTF16toASCII(
- <i>
- nsAString, nsACString</i>
- )</b></code> - appends an UTF-16 string to an ASCII string, losing non-ASCII values.</li>
- <li><code><b>ToNewCString(
- <i>
- nsAString</i>
- )</b></code> - allocates a new <code>char*</code> string.</li>
-</ul>
-<h4 id="ASCII_to_UTF-16_converters" name="ASCII_to_UTF-16_converters">ASCII to UTF-16 converters</h4>
-<p>These converters are
- <i>
- <b>very dangerous</b></i>
- because they will
- <i>
- <b>mangle any non-ASCII string</b></i>
- into a meaningless UTF-16 string. You should
- <i>
- <b>avoid ASCII to UTF-16 conversions</b></i>
- unless your strings are guaranteed to be ASCII. For instance, if you have an 8-bit string encoded in a multibyte character encoding, each byte of the string will be "inflated" to a 16-bit number by simple casting.</p>
-<p>For example, imagine a UTF-8 string where the first Unicode character of the string is represented with a 3-byte UTF-8 sequence, the "inflated" UTF-16 string will contain the 3 <code>PRUnichar</code>'s instead of the single <code>PRUnichar</code> that represents the first character. These <code>PRUnichar</code>'s have nothing to do with the first Unicode character in the UTF-8 string.</p>
-<ul>
- <li><code><b>NS_ConvertASCIItoUTF16(
- <i>
- nsACString</i>
- )</b></code> - a <code>nsAutoString</code> which holds a temporary buffer containing the inflated value of the string.</li>
- <li><code><b>CopyASCIItoUTF16(
- <i>
- nsACString, nsAString</i>
- )</b></code> - does an in-place conversion from one string into a Unicode string object.</li>
- <li><code><b>AppendASCIItoUTF16(
- <i>
- nsACString, nsAString</i>
- )</b></code> - appends an ASCII string to a Unicode string.</li>
- <li><code><b>ToNewUnicode(
- <i>
- nsACString</i>
- )</b></code> - Creates a new <code>PRUnichar*</code> string which contains the inflated value.</li>
-</ul>
-<h2 id="Common_Patterns" name="Common_Patterns">Common Patterns</h2>
-<h3 id="Callee-allocated_Parameters" name="Callee-allocated_Parameters">Callee-allocated Parameters</h3>
-<p>Many APIs result in a method allocating a buffer in order to return strings to its caller. This can be tricky because the caller has to remember to free the string when they have finished using it. Fortunately, the <code>nsXPIDLString</code> class makes this very easy.</p>
-<p>A method may look like this:</p>
-<pre class="eval">void GetValue(PRUnichar** aValue)
-{
- *aValue = ToNewUnicode(foo);
-}
-</pre>
-<p>Without the string classes, the caller would need to free the string:</p>
-<pre>{
- PRUnichar* val;
- GetValue(&amp;val);
-
- if (someCondition) {
- // don't forget to free the value!
- nsMemory::Free(val);
- return NS_ERROR_FAILURE;
- }
-
- ...
- // and later, still don't forget to free!
- nsMemory::Free(val);
-}
-</pre>
-<p>With <code>nsXPIDLString</code> you never have to worry about this. You can just use <code>getter_Copies()</code> to wrap the string class, and the class will remember to free the buffer when it goes out of scope:</p>
-<pre>{
- nsXPIDLString val;
- GetValue(getter_Copies(val));
-
- // val will free itself here
- if (someCondition)
- return NS_ERROR_FAILURE;
- ...
- // and later, still nothing to free
-}
-</pre>
-<p>The resulting code is much simpler, and easy to read.</p>
-<h3 id="Literal_Strings" name="Literal_Strings">Literal Strings</h3>
-<p>A
- <i>
- literal string</i>
- is a raw string value that is written in some C++ code. For example, in the statement <code>printf("Hello World\n");</code> the value <code>"Hello World\n"</code> is a literal string. It is often necessary to insert literal string values when an <code>nsAString</code> or <code>nsACString</code> is required. These four macros will provide you with the necessary conversion:</p>
-<ul>
- <li><code><b>NS_LITERAL_CSTRING(
- <i>
- literal string</i>
- )</b></code> - a temporary <code>nsCString</code></li>
- <li><code><b>NS_NAMED_LITERAL_CSTRING(
- <i>
- variable,literal string</i>
- )</b></code> - declares a <code>nsCString</code> variable named
- <i>
- variable</i>
- </li>
- <li><code><b>NS_LITERAL_STRING(
- <i>
- literal string</i>
- )</b></code> - a temporary <code>nsString</code> with the unicode version of
- <i>
- literal string</i>
- </li>
- <li><code><b>NS_NAMED_LITERAL_STRING(
- <i>
- variable,literal string</i>
- )</b></code> - declares a <code>nsString</code> variable named
- <i>
- variable</i>
- with the unicode version of
- <i>
- literal string</i>
- </li>
-</ul>
-<p>The purpose of the <code>CSTRING</code> versions of these macros may seem unnecessary, given that <code>nsDependentCString</code> will also wrap a string value in an <code>nsCString</code>. The advantage to these macros is that the length of these strings is calculated at compile time, so the string does not need to be scanned at runtime to determine its length.</p>
-<p>The <code>STRING</code> versions of these macros provide a portable way of declaring UTF-16 versions of the given literal string, avoiding runtime conversion on platforms which support literal UTF-16 strings (e.g., MSVC++ and GCC with the -fshort-wchar option).</p>
-<pre>// call Init(const PRUnichar*)
-Init(L"start value"); // bad - L"..." is not portable!
-Init(NS_ConvertASCIItoUTF16("start value").get()); // bad - runtime ASCII-&gt;UTF-16 conversion!
-
-// call Init(const nsAString&amp;)
-Init(nsDependentString(L"start value")); // bad - not portable!
-Init(NS_ConvertASCIItoUTF16("start value")); // bad - runtime ASCII-&gt;UTF-16 conversion!
-
-// call Init(const nsACString&amp;)
-Init(nsDependentCString("start value")); // bad - length determined at runtime
-</pre>
-<p>Here are some examples of proper <code>NS_LITERAL_[C]STRING</code> usage.</p>
-<pre>// call Init(const PRUnichar*)
-Init(NS_LITERAL_STRING("start value").get());
-
-// call Init(const nsAString&amp;)
-Init(NS_LITERAL_STRING("start value"));
-
-// call Init(const nsACString&amp;)
-Init(NS_LITERAL_CSTRING("start value"));
-</pre>
-<p>There are a few details which can be useful in tracking down issues with these macros:</p>
-<p><code>NS_LITERAL_STRING</code> does compile-time conversion to UTF-16 on some platforms (e.g. Windows, Linux, and Mac) but does runtime conversion on other platforms. By using <code>NS_LITERAL_STRING</code> your code is guaranteed to use the best possible conversion for the platform in question.</p>
-<p>Because some platforms do runtime conversion, the use of literal string concatenation inside a <code>NS_LITERAL_STRING/NS_NAMED_LITERAL_STRING</code> macro will compile on these platforms, but not on platforms which support compile-time conversion.</p>
-<p>For example:</p>
-<pre>// call Init(nsAString&amp;)
-Init(NS_LITERAL_STRING("start "
- "value")); // only compiles on some platforms
-</pre>
-<p>The reason for this is that on some platforms, the <code>L"..."</code> syntax is used, but it is only applied to the first string in the concatenation (<code>"start "</code>). When the compiler attempts to concatenate this with the non-Unicode string <code>"value"</code> it gets confused.</p>
-<p>Also, using preprocessor macros as the string literal is unsupported:</p>
-<pre>#define some_string "See Mozilla Run"
-...
-Init(NS_LITERAL_STRING( some_string )); // only compiles on some platforms/with some compilers.
-
-</pre>
-<h3 id="String_Concatenation" name="String_Concatenation">String Concatenation</h3>
-<p>Strings can be concatenated together using the + operator. The resulting string is a <code>const nsSubstringTuple</code> object. The resulting object can be treated and referenced similarly to a <code>nsAString</code> object. Concatenation
- <i>
- does not copy the substrings</i>
- . The strings are only copied when the concatenation is assigned into another string object. The <code>nsSubstringTuple</code> object holds pointers to the original strings. Therefore, the <code>nsSubstringTuple</code> object is dependent on all of its substrings, meaning that their lifetime must be at least as long as the <code>nsSubstringTuple</code> object.</p>
-<p>For example, you can use the value of two strings and pass their concatenation on to another function which takes an <code>const nsAString&amp;:</code></p>
-<pre class="eval">void HandleTwoStrings(const nsAString&amp; one, const nsAString&amp; two) {
- // call HandleString(const nsAString&amp;)
- HandleString(one + two);
-}
-</pre>
-<p>NOTE: The two strings are implicitly combined into a temporary <code>nsString</code> in this case, and the temporary string is passed into <code>HandleString</code>. If <code>HandleString</code> assigns its input into another <code>nsString</code>, then the string buffer will be shared in this case negating the cost of the intermediate temporary. You can concatenate N strings and store the result in a temporary variable:</p>
-<pre class="eval">NS_NAMED_LITERAL_STRING(start, "start ");
-NS_NAMED_LITERAL_STRING(middle, "middle ");
-NS_NAMED_LITERAL_STRING(end, "end");
-// create a string with 3 dependent fragments - no copying involved!
-nsString combinedString = start + middle + end;
-
-// call void HandleString(const nsAString&amp;);
-HandleString(combinedString);
-</pre>
-<p>If you are using <code>NS_LITERAL_STRING</code> to create a temporary that is only used once, then it is safe to define it inside a concatenation because the string buffer will live as long as the temporary concatenation object (of type <code>nsSubstringTuple</code>).</p>
-<pre class="eval">// call HandlePage(const nsAString&amp;);
-// safe because the concatenated-string will live as long as its substrings
-HandlePage(NS_LITERAL_STRING("start ") + NS_LITERAL_STRING("end"));
-</pre>
-<h3 id="Local_variables" name="Local_variables">Local variables</h3>
-<p>Local variables within a function are usually stored on the stack. The <code>nsAutoString/nsCAutoString</code> classes are derivatives of the <code>nsString/nsCString classes</code>. They own a 64-character buffer allocated in the same storage space as the string itself. If the <code>nsAutoString</code> is allocated on the stack, then it has at its disposal a 64-character stack buffer. This allows the implementation to avoid allocating extra memory when dealing with small strings.</p>
-<pre class="eval">...
-nsAutoString value;
-GetValue(value); // if the result is less than 64 code units,
- // then this just saved us an allocation
-...
-</pre>
-<h3 id="Member_variables" name="Member_variables">Member variables</h3>
-<p>In general, you should use the concrete classes <code>nsString</code> and <code>nsCString</code> for member variables.</p>
-<pre class="eval">class Foo {
- ...
- // these store UTF-8 and UTF-16 values respectively
- nsCString mLocalName;
- nsString mTitle;
-};
-</pre>
-<p>Note that the strings are declared directly in the class, not as pointers to strings. Don't do this:</p>
-<pre>class Foo {
-public:
- Foo() {
- mLocalName = new nsCString();
- mTitle = new nsString();
- }
- ~Foo() { delete mLocalName; delete mTitle; }
-
-private:
- // these store UTF-8 and UTF-16 values respectively
- nsCString* mLocalName;
- nsString* mTitle;
-};
-</pre>
-<p>The above code may appear to save the cost of the string objects, but <code>nsString/nsCString</code> are small objects - the overhead of the allocation outweighs the few bytes you'd save by keeping a pointer.</p>
-<p>Another common incorrect pattern is to use <code>nsAutoString/nsCAutoString</code> for member variables. As described in <a href="#Local_variables">Local Variables</a>, these classes have a built in buffer that make them very large. This means that if you include them in a class, they bloat the class by 64 bytes (<code>nsCAutoString</code>) or 128 bytes (<code>nsAutoString</code>).</p>
-<p>An example:</p>
-<pre>class Foo {
- ...
-
- // bloats 'Foo' by 128 bytes!
- nsAutoString mLocalName;
-};
-</pre>
-<h3 id="Raw_Character_Pointers" name="Raw_Character_Pointers">Raw Character Pointers</h3>
-<p><code>PromiseFlatString()</code> can be used to create a temporary buffer which holds a null-terminated buffer containing the same value as the source string. <code>PromiseFlatString()</code> will create a temporary buffer if necessary. This is most often used in order to pass an <code>nsAString</code> to an API which requires a null-terminated string.</p>
-<p>In the following example, an <code>nsAString</code> is combined with a literal string, and the result is passed to an API which requires a simple character buffer.</p>
-<pre class="eval">// Modify the URL and pass to AddPage(const PRUnichar* url)
-void AddModifiedPage(const nsAString&amp; url) {
- NS_NAMED_LITERAL_STRING(httpPrefix, <span class="nowiki">"http://"</span>);
- const nsAString&amp; modifiedURL = httpPrefix + url;
-
- // creates a temporary buffer
- AddPage(PromiseFlatString(modifiedURL).get());
-}
-</pre>
-<p><code>PromiseFlatString()</code> is smart when handed a string that is already null-terminated. It avoids creating the temporary buffer in such cases.</p>
-<pre class="eval">// Modify the URL and pass to AddPage(const PRUnichar* url)
-void AddModifiedPage(const nsAString&amp; url, PRBool addPrefix) {
- if (addPrefix) {
- // MUST create a temporary buffer - string is multi-fragmented
- NS_NAMED_LITERAL_STRING(httpPrefix, <span class="nowiki">"http://"</span>);
- AddPage(PromiseFlatString(httpPrefix + modifiedURL));
- } else {
- // MIGHT create a temporary buffer, does a runtime check
- AddPage(PromiseFlatString(url).get());
- }
-}
-</pre>
-<h3 id="printf_and_a_UTF-16_string" name="printf_and_a_UTF-16_string"><code>printf</code> and a UTF-16 string</h3>
-<p>For debugging, it's useful to <code>printf</code> a UTF-16 string (nsString, nsAutoString, nsXPIDLString, etc). To do this usually requires converting it to an 8-bit string, because that's what printf expects. However, on Windows, the following should work:</p>
-<pre class="eval">printf("%S\n", yourString.get());
-</pre>
-<p>(Note: I didn't test this. Also, I'm not sure what exactly this does to non-ASCII characters, especially when they are outside the system codepage). The reason that this doesn't work on Unix is because a wchar_t, which is what %S expects, is usually 4 bytes there (even when Mozilla is compiled with -fshort-wchar, because this would require libc to be compiled with -fshort-wchar).</p>
-<p>If non-ASCII characters aren't important, use:</p>
-<pre class="eval">printf("%s\n", NS_LossyConvertUTF16toASCII(yourString).get());
-</pre>
-<p>On platforms that use UTF-8 for console output (most Linux distributions), this works:</p>
-<pre class="eval">printf("%s\n", NS_ConvertUTF16toUTF8(yourString).get());
-</pre>
-<h2 id="IDL" name="IDL">IDL</h2>
-<p>The string library is also available through IDL. By declaring attributes and methods using the specially defined IDL types, string classes are used as parameters to the corresponding methods.</p>
-<h3 id="IDL_String_types" name="IDL_String_types">IDL String types</h3>
-<p>The C++ signatures follow the abstract-type convention described above, such that all method parameters are based on the <a href="#The_Abstract_Classes">abstract classes</a>. The following table describes the purpose of each string type in IDL.</p>
-<table class="standard-table">
- <tbody>
- <tr>
- <th class="header">IDL type</th>
- <th class="header">C++ Type</th>
- <th class="header">Purpose</th>
- </tr>
- <tr>
- <td><code>string</code></td>
- <td><code>char*</code></td>
- <td>Raw character pointer to ASCII (7-bit) string, no string classes used. High bit is not guaranteed across XPConnect boundaries</td>
- </tr>
- <tr>
- <td><code>wstring</code></td>
- <td><code>PRUnichar*</code></td>
- <td>Raw character pointer to UTF-16 string, no string classes used</td>
- </tr>
- <tr>
- <td><code>AString</code></td>
- <td><code>nsAString</code></td>
- <td>UTF-16 string</td>
- </tr>
- <tr>
- <td><code>ACString</code></td>
- <td><code>nsACString</code></td>
- <td>8-bit string, all bits are preserved across XPConnect boundaries</td>
- </tr>
- <tr>
- <td><code>AUTF8String</code></td>
- <td><code>nsACString</code></td>
- <td>UTF-8 string - converted to UTF-16 as necessary when value is used across XPConnect boundaries</td>
- </tr>
- <tr>
- <td><code>DOMString</code></td>
- <td><code>nsAString</code></td>
- <td>UTF-16 string used in the DOM. More or less the same as <code>AString</code>, but in JavaScript it has no distinction between whether the string is void or just empty. (not sure on this, looking for corrections.</td>
- </tr>
- </tbody>
-</table>
-<h3 id="C.2B.2B_Signatures" name="C.2B.2B_Signatures">C++ Signatures</h3>
-<p>In IDL, <code>in</code> parameters are read-only, and the C++ signatures for <code>*String</code> parameters follows the above guidelines by using <code>const nsAString&amp;</code> for these parameters. <code>out</code> and <code>inout</code> parameters are defined simply as <code>nsAString</code> so that the callee can write to them.</p>
-<table class="standard-table">
- <tbody>
- <tr>
- <th class="header">IDL</th>
- <th class="header">C++</th>
- </tr>
- <tr>
- <td>
- <pre class="eval">
-interface nsIFoo : nsISupports {
-
- attribute AString utf16String;
-
-
-
-
- AUTF8String getValue(in ACString key);
-
-};
-</pre>
- </td>
- <td>
- <pre class="eval">
-class nsIFoo : public nsISupports {
-
- NS_IMETHOD GetUtf16String(nsAString&amp;
- aResult) = 0;
- NS_IMETHOD SetUtf16String(const nsAString&amp;
- aValue) = 0;
-
- NS_IMETHOD GetValue(const nsACString&amp; aKey,
- nsACString&amp; aResult) = 0;
-};
-</pre>
- </td>
- </tr>
- </tbody>
-</table>
-<p>In the above example, <code>utf16String</code> is treated as a UTF-16 string. The implementation of <code>GetUtf16String()</code> will use <code>aResult.Assign</code> to "return" the value. In <code>SetUtf16String()</code> the value of the string can be used through a variety of methods including <a href="#Iterators">Iterators</a>, <code><a href="#Raw_Character_Pointers">PromiseFlatString</a></code>, and assignment to other strings.</p>
-<p>In <code>GetValue()</code>, the first parameter, <code>aKey</code>, is treated as a raw sequence of 8-bit values. Any non-ASCII characters in <code>aKey</code> will be preserved when crossing XPConnect boundaries. The implementation of <code>GetValue()</code> will assign a UTF-8 encoded 8-bit string into <code>aResult</code>. If the <code>this</code> method is called across XPConnect boundaries, such as from a script, then the result will be decoded from UTF-8 into UTF-16 and used as a Unicode value.</p>
-<h3 id="Choosing_a_string_type" name="Choosing_a_string_type">Choosing a string type</h3>
-<p>It can be difficult to determine the correct string type to use for IDL. The following points should help determine the appropriate string type.</p>
-<ul>
- <li>Using string classes may avoid new memory allocation for <code>out</code> parameters. For example, if the caller is using an <code>nsAutoString</code> to receive the value for an <code>out</code> parameter, (defined in C++ as simply <code>nsAString&amp;</code> then assignment of short (less than 64-characters) values to an <code>out</code> parameter will only copy the value into the <code>nsAutoString</code>'s buffer. Moreover, using the string classes allows for sharing of string buffers. In many cases, assigning from one string object to another avoids copying in favor of simply incrementing a reference count.</li>
- <li><code>in</code> strings using string classes often have their length pre-calculated. This can be a performance win.</li>
- <li>In cases where a raw-character buffer is required, <code>string</code> and <code>wstring</code> provide faster access than <code>PromiseFlatString</code>.</li>
- <li>UTF-8 strings defined with <code>AUTF8String</code> may need to be decoded when crossing XPConnect boundaries. This can be a performance hit. On the other hand, UTF-8 strings take up less space for strings that are commonly ASCII.</li>
- <li>UTF-16 strings defined with <code>wstring</code> or <code>AString</code> are fast when the unicode value is required. However, if the value is more often ASCII, then half of the storage space of the underlying string may be wasted.</li>
-</ul>
-<h2 id="Appendix_A_-_What_class_to_use_when" name="Appendix_A_-_What_class_to_use_when">Appendix A - What class to use when</h2>
-<p>This table provides a quick reference for what classes you should be using.</p>
-<table class="standard-table">
- <tbody>
- <tr>
- <th class="header">Context</th>
- <th class="header">class</th>
- <th class="header">Notes</th>
- </tr>
- <tr>
- <td>Local Variables</td>
- <td><code>nsAutoString<br>
- nsCAutoString</code></td>
- <td> </td>
- </tr>
- <tr>
- <td>Class Member Variables</td>
- <td><code>nsString<br>
- nsCString</code></td>
- <td> </td>
- </tr>
- <tr>
- <td>Method Parameter types</td>
- <td><code>nsAString<br>
- nsACString</code></td>
- <td>Use abstract classes for parameters. Use <code>const nsAString&amp;</code> for "in" parameters and <code>nsAString&amp;</code> for "out" parameters.</td>
- </tr>
- <tr>
- <td>Retrieving "out" string/wstrings</td>
- <td><code>nsXPIDLString<br>
- nsXPIDLCString</code></td>
- <td>Use <code>getter_Copies()</code>. Similar to <code>nsString / nsCString</code>.</td>
- </tr>
- <tr>
- <td>Wrapping character buffers</td>
- <td><code>nsDependentString<br>
- nsDependentCString</code></td>
- <td>Wrap <code>const char* / const PRUnichar*</code> buffers.</td>
- </tr>
- <tr>
- <td>Literal strings</td>
- <td><code>NS_LITERAL_STRING<br>
- NS_LITERAL_CSTRING</code></td>
- <td>Similar to <code>nsDependent[C]String</code>, but pre-calculates length at build time.</td>
- </tr>
- </tbody>
-</table>
-<h2 id="Appendix_B_-_nsAString_Reference" name="Appendix_B_-_nsAString_Reference">Appendix B - nsAString Reference</h2>
-<p>Read-only methods.</p>
-<ul>
- <li><code><b>Length()</b></code></li>
- <li><code><b>IsEmpty()</b></code></li>
- <li><code><b>IsVoid()</b></code> - XPConnect will convert void nsAStrings to JavaScript <code>null</code>.</li>
- <li><code><b>BeginReading(
- <i>
- iterator</i>
- )</b></code></li>
- <li><code><b>EndReading(
- <i>
- iterator</i>
- )</b></code></li>
- <li><code><b>Equals(
- <i>
- string[, comparator]</i>
- )</b></code></li>
- <li><code><b>First()</b></code></li>
- <li><code><b>Last()</b></code></li>
- <li><code><b>CountChar()</b></code></li>
- <li><code><b>Left(
- <i>
- outstring, length</i>
- )</b></code></li>
- <li><code><b>Mid(
- <i>
- outstring, position, length</i>
- )</b></code></li>
- <li><code><b>Right(
- <i>
- outstring, length</i>
- )</b></code></li>
- <li><code><b>FindChar(
- <i>
- character</i>
- )</b></code></li>
-</ul>
-<p>Methods that modify the string.</p>
-<ul>
- <li><code><b>Assign(
- <i>
- string</i>
- )</b></code></li>
- <li><code><b>Append(
- <i>
- string</i>
- )</b></code></li>
- <li><code><b>Insert(
- <i>
- string</i>
- )</b></code></li>
- <li><code><b>Cut(
- <i>
- start, length</i>
- )</b></code></li>
- <li><code><b>Replace(
- <i>
- start, length, string</i>
- )</b></code></li>
- <li><code><b>Truncate(
- <i>
- length</i>
- )</b></code></li>
- <li><code><b>SetIsVoid(
- <i>
- state</i>
- )</b></code> - XPConnect will convert void nsAStrings to JavaScript <code>null</code>.</li>
- <li><code><b>BeginWriting(
- <i>
- iterator</i>
- )</b></code></li>
- <li><code><b>EndWriting(
- <i>
- iterator</i>
- )</b></code></li>
- <li><code><b>SetCapacity()</b></code></li>
-</ul>
diff --git a/files/zh-cn/mozilla/tech/xpcom/index.html b/files/zh-cn/mozilla/tech/xpcom/index.html
deleted file mode 100644
index 98620642db..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/index.html
+++ /dev/null
@@ -1,44 +0,0 @@
----
-title: XPCOM
-slug: Mozilla/Tech/XPCOM
-tags:
- - XPCOM
- - 所有分类
-translation_of: Mozilla/Tech/XPCOM
----
-<p><strong>XPCOM</strong>(Cross Platform Component Object Model)是一种跨平台组件对象模型,其原理与微软的COM技术类似,它支持多种语言绑定(<a href="cn/XPCOM/Language_Bindings">Language Bindings</a>)。也就是说,我们可以使用C++、JAVA、JavaScript、Python、Ruby、Perl等语言来编写组件。而XPCOM的接口是用一种叫做<a href="cn/XPIDL">XPIDL</a>的IDL(Interface Description Language)来定义的。</p>
-
-<div>
-<p>XPCOM 本身提供了一套核心的组件和类,用于诸如内存管理,线程,基本数据结构(strings, arrays, variants)等 。但是大部分的XPCOM组件并不是这个核心库提供的,而是由很多第三方的平台(例如<a href="cn/Gecko">Gecko</a>或者<a href="Necko">Necko</a>)提供,或者由一个应用,甚至一个扩展提供。</p>
-
-<p> </p>
-
-<p></p><div class="row topicpage-table">
- <div class="section"><dl><dl><dt class="landingPageList"><a href="/zh-CN/docs/Generic_factory">Generic factory</a></dt><dd class="landingPageList">Most XPCOM factories can be very simple. Rick Potts wrote a templated-based generic factory (nsFactory&lt;t&gt;) that simplifies the factory creation process that just requires writing a CreateInstance() method. The new nsIGenericFactory interface takes this a step further, by providing a single interface that can be reused anytime a simple implementation of nsIFactory is needed. Here is the interface, and a description of its use.&lt;/t&gt;</dd><dt class="landingPageList"><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Observer_Notifications">Observer Notifications</a></dt><dd class="landingPageList">The following are topics that you can observe during the course of an application. Unless otherwise noted you register for the topics using the <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIObserverService" title="">nsIObserverService</a></code>.</dd><dt class="landingPageList"><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Setting_HTTP_request_headers">Setting HTTP request headers</a></dt><dd class="landingPageList"><a href="https://developer.mozilla.org/en-US/docs/HTTP">HTTP</a> 是网络背后的核心技术之一。除了实质内容之外,一些重要的信息通过HTTP 头传递给HTTP 请求和响应。</dd><dt class="landingPageList"><a href="/zh-CN/docs/Storage">Storage</a></dt><dd class="landingPageList"><strong>Storage</strong> 存储是一个 <a class="external" href="http://www.sqlite.org/">SQLite</a> 数据库API。它可用于受信任的调用者,仅限于扩展和Firefox组件。</dd><dt class="landingPageList"><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Glue">XPCOM Glue</a></dt><dd class="landingPageList">The XPCOM Glue is a static library which component developers and embedders can link against. It allows developers to link only against the frozen XPCOM method symbols and maintain compatibility with multiple versions of XPCOM.</dd><dt class="landingPageList"><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference">XPCOM reference</a></dt><dd class="landingPageList">This reference describes the interfaces and functions provided by the <a href="/en-US/docs/Mozilla/Tech/XPCOM">XPCOM</a> library. In addition, it details the various helper classes and functions, as well as the components, provided by the <a href="/en-US/docs/Mozilla/Tech/XPCOM/Glue">XPCOM glue</a> library. The contents herein are oriented primarily toward extension developers and people embedding XPCOM in other projects.</dd></dl></dl></div>
- <div class="section"><dl><dt class="landingPageList"><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Guide">XPCOM 指南</a></dt><dd class="landingPageList">本文提供了关于 XPCOM 的说明和使用文档,包括如何在你的工程中使用,如何为你的 Firefox 扩展等构建 XPCOM 组件。</dd><dt class="landingPageList"><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Interfacing_with_the_XPCOM_cycle_collector">与XPCOM cycle collector交互</a></dt><dd class="landingPageList">本文是对于在Firefox 3的XPCOM中引入的cycle collector的一个简要描述,描述了将一个已有的C++类修改为一个XPCOM cycle collection中的参与项的步骤。如果你认为你有关于类的循环引用导致的内存泄漏,那可以看看这个。</dd><dt class="landingPageList"><a href="/zh-CN/docs/Using_the_Clipboard">使用剪贴板</a></dt><dd class="landingPageList">This section provides information about cutting, copying and pasting to and from the clipboard.</dd><dt class="landingPageList"><a href="/zh-CN/docs/Creating_a_Python_XPCOM_component">创建Python XPCOM组件</a></dt><dd class="landingPageList"><a href="http://books.mozdev.org/html"><em>Creating Applications with Mozilla</em></a> 已经包含了一个<a href="http://books.mozdev.org/html/mozilla-chp-8-sect-2.html" title="http://books.mozdev.org/html/mozilla-chp-8-sect-2.html">教程</a>用于编写简单的基于JavaScript和C++(实现<code>nsISimple</code>接口)的组件,本文阐述如何通过Python语言使用<a href="/en-US/docs/PyXPCOM" title="/en-US/docs/PyXPCOM">PyXPCOM</a>创建相同的组件。</dd><dt class="landingPageList"><a href="/zh-CN/docs/Aggregating_the_In-Memory_Datasource">收集 In-Memory 数据源</a></dt><dd class="landingPageList"></dd><dt class="landingPageList"><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Language_Bindings">语言绑定</a></dt><dd class="landingPageList">一款 <strong>XPCOM 的语言绑定</strong>是连接某种特定的程序设计语言与 <a href="/cn/XPCOM" title="cn/XPCOM">XPCOM</a> 之间的纽带,它用来提供从语言到 XPCOM 对象的访问, 并且将此种语言写成的模块作为其他进行 XPCOM 绑定的程序语言的 XPCOM 对象。</dd></dl></div>
- </div><p></p>
-
-<p></p><div class="blockIndicator communitybox">
-
- <div class="column-container">
- <h2 id="加入_XPCOM_社区">加入 XPCOM 社区</h2>
- <div class="column-half">
- <div class="communitysubhead">请选择你喜欢的方式加入我们:</div>
- <ul class="communitymailinglist">
- <li><a href="https://lists.mozilla.org/listinfo/dev-tech-xpcom"> 邮件列表</a></li>
-
-
- <li><a href="http://groups.google.com/group/mozilla.dev.tech.xpcom"> 新闻组</a></li>
- <li><a href="http://groups.google.com/group/mozilla.dev.tech.xpcom/feeds"> Web feed</a></li>
-</ul>
- </div>
- <div class="column-half">
- <ul class="communitycontact"><li><strong>IRC: </strong><a href="irc://irc.mozilla.org/developers">#developers</a> <span class="smaller">(<a href="https://wiki.mozilla.org/IRC">了解 IRC</a>)</span></li><li><strong>Tools: </strong><a href="http://ted.mielczarek.org/code/mozilla/jscomponentwiz/">JavaScript Component Wizard</a>, <a href="http://www.mytools360.com-a.googlepages.com/home#XPComPro">Visual C++ Component Wizard</a>, <a href="http://www.yutools.com/wp/tools/yuxpcomwizard/?lang=en">Visual C++ Component Wizard for Visual Studio 2010</a></li></ul>
- </div>
- </div>
-</div><p></p>
-
-<p></p><section id="Quick_Links"><ol><li><a href="http://www.ibm.com/developerworks/library/os-xpcomfirefox/">Tutorial from IBM DeveloperWorks</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Creating_Custom_Firefox_Extensions_with_the_Mozilla_Build_System">Binary components tutorial</a></li><li><a href="http://www.iosart.com/firefox/xpcom/">Linux and Windows how-to guide</a></li><li><a href="http://starkravingfinkle.org/blog/2006/10/mozilla-platform-xpcom-in-c/">Windows example blog post</a></li><li><a href="http://wanderingstan.com/2007-11-16/geekout_how_to_make_a_c_xpcom_component">Another Windows example</a></li><li><a href="http://rcrowley.org/2007/07/17/cross-platform-xpcom-a-howto.html">Mac OS X example</a></li><li><a href="/en-US/docs/Web/JavaScript" title="JavaScript (JS) is a lightweight interpreted or JIT-compiled programming language with first-class functions. While it is most well-known as the scripting language for Web pages, many non-browser environments also use it, such as Node.js, Apache CouchDB and Adobe Acrobat.">JavaScript</a></li></ol></section><p></p>
-</div>
-
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/interfacing_with_the_xpcom_cycle_collector/index.html b/files/zh-cn/mozilla/tech/xpcom/interfacing_with_the_xpcom_cycle_collector/index.html
deleted file mode 100644
index a0b4472d02..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/interfacing_with_the_xpcom_cycle_collector/index.html
+++ /dev/null
@@ -1,141 +0,0 @@
----
-title: 与XPCOM cycle collector交互
-slug: Mozilla/Tech/XPCOM/Interfacing_with_the_XPCOM_cycle_collector
-translation_of: Mozilla/Tech/XPCOM/Interfacing_with_the_XPCOM_cycle_collector
----
-<p>本文是对于在Firefox 3的XPCOM中引入的cycle collector的一个简要描述,描述了将一个已有的C++类修改为一个XPCOM cycle collection中的参与项的步骤。如果你认为你有关于类的循环引用导致的内存泄漏,那可以看看这个。</p>
-
-<p>本文面向Mozilla C++开发者。</p>
-
-<h2 id="What_the_cycle_collector_does" name="What_the_cycle_collector_does">cycle collector干了些什么</h2>
-
-<p>cycle collector大部分时间在记录可能导致循环引用的XPCOM对象指针。在collector的空闲阶段,<code>nsAutoRefCnt的变体通过collector快速的修改自己的注册状态(注册/注销),会传递出一个“可疑”的引用计数事件(从N+1到N,N≠0)。</code></p>
-
-<p>collector会阶段性的唤醒并验证缓冲区中记录过的可疑指针。这是collector的扫描阶段。在这个阶段,collector会请求每个候选项的cycle-collection helper类,如果存在,则需要helper来描述候选项拥有的子结构。collector可以以这种方式建立一个从可疑对象开始的拥有权关系图。</p>
-
-<p>如果collector发现一组对象出现了彼此互相引用,并且确定组内对象的引用计数全由组内其他对象提供,则认定这组对象为循环引用,并尝试释放它们。这是collector的释放阶段。在这个阶段,collector遍历已找到的循环引用对象,再次请求它们的helper对象,释放其子结构和其他对象的引用。</p>
-
-<p>collector也能遍历JS堆,并定位传入和传出的循环引用。</p>
-
-<h2 id="How_the_collector_can_fail" name="How_the_collector_can_fail">collector失效</h2>
-
-<p>cycle collector是一个保守的设备。有些情况下,它无法回收循环引用。</p>
-
-<ol>
- <li>它默认不怀疑任何指针;对象必须要标记它们自己为可疑对象,一般用<code>nsCycleCollectingAutoRefCnt而不是nsAutoRefCnt。</code></li>
- <li>它只遍历那些在QI(QueryInterface)时返回helper对象的对象。如果在遍历图的过程中遇到了未知的边,那它会直接放弃这条边,因此每条边都需要被标记为可疑对象,否则找不到环。</li>
- <li>helper对象中的<code>Traverse<font face="Open Sans, arial, x-locale-body, sans-serif">和</font></code><code>Unlink</code>方法不是魔法,是程序员编码的,如果代码写错了,那collector也还是会崩。</li>
- <li>collector不知道怎么去搜索一个存在栈中的具有所有权的临时指针,所以将它放在程序的最顶层运行是有必要的。虽然有额外的所有权指针时不会崩,但是它会无法统计已记录的对象的引用计数,这也有可能导致回收失败。</li>
-</ol>
-
-<h2 id="How_to_make_your_classes_participate" name="How_to_make_your_classes_participate">怎么标记一个类为候选项</h2>
-
-<p>cycle collector和你的类之间的接口使用<code>xpcom/base/nsCycleCollector.h中的内容实现直接获取,但是在xpcom/glue/nsCycleCollectionParticipant.h中提供了很多方便的宏用来标记你的类。通常,如果你用nsCOMPtr的mBar和mBaz来修改类nsFoo,可以简化为几个简单的修改:</code></p>
-
-<ol>
- <li>在nsFoo.h和nsFoo.cpp中包含头文件<code>nsCycleCollectionParticipant.h。</code> </li>
- <li>在nsFoo.cpp中加一行用于声明nsFoo类是cycle collection的候选项的语句:
- <pre class="brush: cpp">NS_IMPL_CYCLE_COLLECTION_CLASS(nsFoo)</pre>
- </li>
- <li>在nsFoo的定义里,将写有<code>NS_DECL_ISUPPORTS的行修改为</code><code>NS_DECL_CYCLE_COLLECTING_ISUPPORTS</code>.</li>
- <li>
- <p><code><font face="Open Sans, arial, x-locale-body, sans-serif">在nsFoo的定义里public部分加一行</font>NS_DECL_CYCLE_COLLECTION_CLASS(nsFoo)。如果nsFoo从多个接口继承而来的话,可以写成NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsFoo, nsIBar),在你QueryInterface nsFoo为nsISSupports时,nsIBar作为接口返回。(我们把nsIBar称为nsFoo的典型ISupport类型。)</code></p>
- </li>
- <li>在nsFoo.cpp里接口map处加一行<code>NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(nsFoo)</code> :
- <pre class="brush: cpp">NS_INTERFACE_TABLE_HEAD(nsFoo)
- NS_INTERFACE_TABLE2(nsFoo,
- nsIBar,
- nsIBaz)
- NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(nsFoo)
-NS_INTERFACE_MAP_END
-</pre>
- </li>
- <li>在nsFoo.cpp里把<code>NS_IMPL_ADDREF(nsFoo)</code>修改为<code>NS_IMPL_CYCLE_COLLECTING_ADDREF(nsFoo),同样的修改</code><code>NS_IMPL_RELEASE(nsFoo)</code>为<code>NS_IMPL_CYCLE_COLLECTING_RELEASE(nsFoo)。</code></li>
- <li><code><font face="Open Sans, arial, x-locale-body, sans-serif">可以在nsFoo.cpp中添加合适的</font>NS_IMPL_CYCLE_COLLECTION_#</code>宏, <code>#是你类中的成员数量。如果nsFoo包含两个成员变量,mBar和mBaz,我们可以写成NS_IMPL_CYCLE_COLLECTION_2(nsFoo, mBar, mBaz)。</code></li>
-</ol>
-
-<p>你的类可能会比这张图的结构更复杂。例如,你的类可能有好几个nsISupport基类,需要使用一些执行消除歧义的* _AMBIGUOUS宏。或者说你的类拥有复杂的所有权结构,这样简单的NS_IMPL_CYCLE_COLLECTION_N宏就低效了;你可能需要手动的实现helper类的<em>Traverse和Unlink方法。即使是这样的情况,也可以使用NS_IMPL_CYCLE_COLLECTION_TRAVERSE_ {BEGIN,END}和NS_IMPL_CYCLE_COLLECTION_UNLINK_ {BEGIN,END}。可以在一些复杂的类中看到实例,例如content/base/src/nsGenericElement.cpp。</em> If your class has tearoffs or is being aggregated by other classes it is important to make the tearoff classes or the outer classes participate in cycle collection too, not doing so could lead to the cycle collector trying to collect the objects too soon.</p>
-
-<h3 id="手动的实现Traverse和Unlink方法">手动的实现<em>Traverse和Unlink方法</em></h3>
-
-<p>每个可能包含循环回收对象的域都需要被传递给cycle collector,以检查通过这些域的循环。</p>
-
-<p>用于Traverse的宏主要是是NS_IMPL_CYCLE_COLLECTION_TRAVERSE:</p>
-
-<p>  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSomeMember)</p>
-
-<p>Unlink同理:</p>
-
-<p>  NS_IMPL_CYCLE_COLLECTION_UNLINK(mSomeMember)</p>
-
-<p>这些宏应当处理各种情况,像指向nsISupports对象的指针或者非nsISupports对象的指针,或者这些指针的数组,当然这些指针都是有引用计数的、被collector记录的指针。</p>
-
-<h3 id="处理JSObject">处理JSObject</h3>
-
-<p>如果你的类需要保存一个指向JSObject的指针,你需要告知cycle collector。像这样操作:</p>
-
-<p>首先,它必须被保存在<code>JS::Heap&lt;JSObject *&gt;域,假如你的类nsFoo有一个域mSomeObj:</code></p>
-
-<pre class="brush: cpp">private:
- ...
- JS::Heap&lt;JSObject*&gt; mSomeObj;
- ...</pre>
-
-<p>当你在JS对象指针中存了东西时,你需要用<code>mozilla::HoldJSObjects来告诉GC遍历它并保持这个对象的存活:</code></p>
-
-<pre class="brush: cpp">...
-mSomeObj = ... ;
-<code>mozilla::HoldJSObjects</code>(this);
-...
-</pre>
-
-<p>在Unlink方法(或者析构函数)里,需要将对象指针置为空:</p>
-
-<pre class="brush: cpp">NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsFoo)
- ...
-  NS_IMPL_CYCLE_COLLECTION_UNLINK(mSomeMember)
-  ...
-  //如果你的类是wrapper cache:
- //NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
-
-  tmp-&gt;mSomeObj = nullptr;
-NS_IMPL_CYCLE_COLLECTION_UNLINK_END
-</pre>
-
-<p>在析构函数里调用</p>
-
-<pre class="brush: cpp"><code>mozilla::DropJSObjects</code>(this);</pre>
-
-<p>你需要在Traverse方法列出cycle collector中记录的成员,也就是非JS对象:</p>
-
-<pre class="brush: cpp">NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsFoo)
- ...
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSomeMember)
- ...
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-</pre>
-
-<p>最后你需要把JS对象加入Trace方法:</p>
-
-<pre class="brush: cpp">NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsFoo)
-  //if your class is a wrapper cache:
- //NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
-
-  NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mSomeObj)
-NS_IMPL_CYCLE_COLLECTION_TRACE_END
-</pre>
-
-<p>如果你的类是一个wrapper cache,可能生成的代码用了<code>NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_#</code>宏而不是<code>NS_IMPL_CYCLE_COLLECTION_#</code>. 这个宏不能定义Trace方法,因此不能列出JS对象;所以你需要向上面那样手动实现Trace和Unlink。</p>
-
-<h3 id="处理_JSValue_fields">处理 JS::Value fields</h3>
-
-<p> <a href="/en-US/docs/SpiderMonkey/JSAPI_Reference/Jsval" title="/en-US/docs/SpiderMonkey/JSAPI_Reference/Jsval">这里</a>说过,一个<code>JS::Value可能引用一个字符串或者对象并且被GC控制。于是我们需要告知cycle collector这种成员变量的存在。这与JSObject相似,但是使用的是NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK宏:</code></p>
-
-<pre class="brush: cpp">NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsFoo)
- ...
- NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(mSomeJSVal).
- ...
-NS_IMPL_CYCLE_COLLECTION_TRACE_END
-</pre>
-
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/language_bindings/components.utils.cloneinto/index.html b/files/zh-cn/mozilla/tech/xpcom/language_bindings/components.utils.cloneinto/index.html
deleted file mode 100644
index 0bc55dbf99..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/language_bindings/components.utils.cloneinto/index.html
+++ /dev/null
@@ -1,290 +0,0 @@
----
-title: Components.utils.cloneInto
-slug: Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.cloneInto
-translation_of: Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.cloneInto
----
-<div><section class="Quick_links" id="Quick_Links">
- <ol>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions"><strong>Browser extensions</strong></a></li>
- <li class="toggle">
- <details>
- <summary>Getting started</summary>
- <ol>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/What_are_WebExtensions">What are extensions?</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Your_first_WebExtension">Your first extension</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Your_second_WebExtension">Your second extension</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Anatomy_of_a_WebExtension">Anatomy of an extension</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Examples">Example extensions</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/What_next_">What next?</a></li>
- </ol>
- </details>
- </li>
- <li class="toggle">
- <details>
- <summary>Concepts</summary>
- <ol>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Using_the_JavaScript_APIs">Using the JavaScript APIs</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Content_scripts">Content scripts</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Match_patterns">Match patterns</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Working_with_files">Working with files</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Internationalization">Internationalization</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Security_best_practices">Security best practices</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Content_Security_Policy">Content Security Policy</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Native_messaging">Native messaging</a></li>
- </ol>
- </details>
- </li>
- <li class="toggle">
- <details>
- <summary>User interface</summary>
- <ol>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/user_interface">User Interface</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/user_interface/Browser_action">Toolbar button</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/user_interface/Page_actions">Address bar button</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/user_interface/Sidebars">Sidebars</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/user_interface/Context_menu_items">Context menu items</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/user_interface/Options_pages">Options page</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/user_interface/Extension_pages">Extension pages</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/user_interface/Notifications">Notifications</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/user_interface/Omnibox">Address bar suggestions</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/user_interface/devtools_panels">Developer tools panels</a></li>
- </ol>
- </details>
- </li>
- <li class="toggle">
- <details>
- <summary>How to</summary>
- <ol>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Intercept_HTTP_requests">Intercept HTTP requests</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Modify_a_web_page">Modify a web page</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Safely_inserting_external_content_into_a_page">Insert external content</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Add_a_button_to_the_toolbar">Add a button to the toolbar</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Implement_a_settings_page">Implement a settings page</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Working_with_the_Tabs_API">Work with the Tabs API</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Work_with_the_Bookmarks_API">Work with the Bookmarks API</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Work_with_the_Cookies_API">Work with the Cookies API</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Work_with_contextual_identities">Work with contextual identities</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/onboarding_upboarding_offboarding_best_practices">Onboard, upboard, and offboard users</a></li>
- </ol>
- </details>
- </li>
- <li class="toggle">
- <details>
- <summary>Porting</summary>
- <ol>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Firefox_differentiators">Firefox differentiators</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Porting_a_Google_Chrome_extension">Porting a Google Chrome extension</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Porting_a_legacy_Firefox_add-on">Porting a legacy Firefox extension</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Embedded_WebExtensions">Embedded WebExtensions</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Comparison_with_the_Add-on_SDK">Comparison with the Add-on SDK</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Comparison_with_XUL_XPCOM_extensions">Comparison with XUL/XPCOM extensions</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Differences_between_API_implementations">Differences between API implementations</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Chrome_incompatibilities">Chrome incompatibilities</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Differences_between_desktop_and_Android">Differences between desktop and Android</a></li>
- </ol>
- </details>
- </li>
- <li class="toggle">
- <details>
- <summary>Firefox workflow</summary>
- <ol>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Development_Tools">Developer tools</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/User_experience_best_practices">User Experience</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Temporary_Installation_in_Firefox">Temporary Installation in Firefox</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Debugging">Debugging</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Testing_persistent_and_restart_features">Testing persistent and restart features</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Developing_WebExtensions_for_Firefox_for_Android">Developing for Firefox for Android</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Getting_started_with_web-ext">Getting started with web-ext</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/web-ext_command_reference">web-ext command reference</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/WebExtensions_and_the_Add-on_ID">Extensions and the Add-on ID</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Request_the_right_permissions">Request the right permissions</a></li>
- </ol>
- </details>
- </li>
- <li class="toggle">
- <details>
- <summary>JavaScript APIs</summary>
- <ol><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Browser_support_for_JavaScript_APIs">Browser support for JavaScript APIs</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/API/alarms">alarms</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/API/bookmarks">bookmarks</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/API/browserAction">browserAction</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/API/contextMenus">contextMenus</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/API/cookies">cookies</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/API/devtools.inspectedWindow">devtools.inspectedWindow</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/API/history">history</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/API/runtime">runtime</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/API/storage">storage</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/API/tabs">tabs</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/API/webNavigation">webNavigation</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/API/webRequest">webRequest</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/API/windows">windows</a></li></ol>
- </details>
- </li>
-
- <li class="toggle">
- <details>
- <summary>Manifest keys</summary>
- <ol><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_specific_settings">applications</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/manifest.json/browser_action">browser_action</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts">content_scripts</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/manifest.json/default_locale">default_locale</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/manifest.json/developer">developer</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/manifest.json/manifest_version">manifest_version</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/manifest.json/version">version</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/manifest.json/%E4%B8%BB%E9%A1%B5%E5%9C%B0%E5%9D%80">主页地址</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/manifest.json/author">作者 - author</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/manifest.json/name">名称 - name</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/manifest.json/background">后台 - background</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/manifest.json/description">描述 - description</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions">权限 - permissions</a></li><li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/manifest.json/short_name">短名称 - short_name</a></li></ol>
- </details>
- </li>
-
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/Themes"><strong>Themes</strong></a></li>
- <li class="toggle">
- <details>
- <summary>Browser themes</summary>
- <ol>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/Themes/Theme_concepts">Browser theme concepts</a></li>
- </ol>
- </details>
- </li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/Distribution"><strong>Publishing and Distribution</strong></a></li>
- <li class="toggle">
- <details>
- <summary>Publishing add-ons</summary>
- <ol>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/Distribution">Signing and distribution overview</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Package_your_extension_">Package your extension</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/Distribution/Submitting_an_add-on">Submit an add-on</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/Source_Code_Submission">Source code submission</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/Distribution/Resources_for_publishers">Resources for publishers</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/Listing">Creating an appealing listing</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/Distribution/Make_money_from_browser_extensions">Make money from browser extensions</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/Distribution/Promoting_your_extension_or_theme">Promoting your extension or theme</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/AMO/Policy/Reviews">Review policies</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/AMO/Policy/Agreement">Developer agreement</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/AMO/Policy/Featured">Featured add-ons</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/Distribution/Retiring_your_extension">Retiring your extension</a></li>
- </ol>
- </details>
- </li>
- <li class="toggle">
- <details>
- <summary>Distributing add-ons</summary>
- <ol>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Alternative_distribution_options/Sideloading_add-ons">For sideloading</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Alternative_distribution_options/Add-ons_for_desktop_apps">For desktop apps</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/WebExtensions/Alternative_distribution_options/Add-ons_in_the_enterprise">For an enterprise</a></li>
- </ol>
- </details>
- </li>
- <li><a href="https://discourse.mozilla.org/c/add-ons"><strong>Community and Support</strong></a></li>
- <li class="toggle">
- <details>
- <summary>Channels</summary>
- <ol>
- <li><a href="https://blog.mozilla.org/addons">Add-ons blog</a></li>
- <li><a href="https://discourse.mozilla.org/c/add-ons">Add-on forums</a></li>
- <li><a href="http://stackoverflow.com/questions/tagged/firefox-addon">Stack Overflow</a></li>
- <li><a href="/zh-CN/docs/Mozilla/Add-ons/#Contact_us">Contact us</a></li>
- </ol>
- </details>
- </li>
- </ol>
-</section></div>
-
-<p><span class="seoSummary">该函数为定义在某一作用域中的对象提供了一个安全的、将其<a href="https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/The_structured_clone_algorithm">结构化克隆</a>到其字作用域中的方法,</span>并返回对克隆对象的引用:</p>
-
-<pre class="brush: js">var clonedObject = cloneInto(myObject, targetWindow);</pre>
-
-<p>可以将克隆后的对象作为可扩展对象的动态属性引入到特定作用域中,以便运行在该作用域的脚本进行访问:</p>
-
-<pre class="brush: js">targetWindow.foo = clonedObject;</pre>
-
-<p>通过这种方式,运行在某一作用域中的代码可以和运行在另一作用域中的代码共享对某一对象的访问。</p>
-
-<h2 id="语法">语法</h2>
-
-<pre class="brush: js">Components.utils.cloneInto(obj, targetScope[, options]);</pre>
-
-<h3 id="参数列表">参数列表</h3>
-
-<dl>
- <dt><code>obj : object</code></dt>
- <dd>被克隆对象。</dd>
- <dt><code>targetScope : object</code></dt>
- <dd>对象克隆后的容器。</dd>
- <dt><code>options : object</code></dt>
- <dd>该参数为一可选参数。该参数为一拥有以下可选属性的对象:</dd>
-</dl>
-
-<ul>
- <li><code>cloneFunctions</code>: 决定函数是否被克隆的布尔值。默认值为 <code>false</code>。Cloned functions have the same semantics as functions exported using <a href="/en-US/docs/Components.utils.exportFunction"><code>Components.utils.exportFunction</code></a>. See <a href="/en-US/docs/Components.utils.cloneInto#Cloning_objects_that_have_functions">Cloning objects that have functions</a> below.</li>
- <li><code>wrapReflectors</code>: a Boolean value that determines if objects reflected from C++, such as DOM objects, should be cloned. If omitted the default value is <code>false</code>. See <a href="/en-US/docs/Components.utils.cloneInto#Cloning_objects_that_contain_DOM_elements">Cloning objects that contain DOM elements</a> below.</li>
-</ul>
-
-<h3 id="返回值">返回值</h3>
-
-<p>对克隆后的对象的引用。</p>
-
-<h2 id="范例">范例</h2>
-
-<p>This add-on script creates an object, clones it into the content window and makes it a property of the content window global:</p>
-
-<pre class="brush: js">// add-on script
-
-var addonScriptObject = {"greeting" : "hello from add-on"};
-contentWindow.addonScriptObject = cloneInto(addonScriptObject, contentWindow);</pre>
-
-<p>Scripts running in the page can now access the object:</p>
-
-<pre class="brush: js">// page script
-
-button.addEventListener("click", function() {
- console.log(window.addonScriptObject.greeting); // "hello from add-on"
-}, false);</pre>
-
-<p>Of course, you don't have to assign the clone to the window itself: you can assign it to some other object in the target scope:</p>
-
-<pre class="brush: js">contentWindow.foo.addonScriptObject = cloneInto(addonScriptObject, contentWindow);</pre>
-
-<p>You can also pass it into a function defined in the page script. Suppose the page script defines a function like this:</p>
-
-<pre class="brush: js">// page script
-
-function foo(greeting) {
- console.log("they said: " + greeting.message);
-}
-</pre>
-
-<p>The add-on script can define an object, clone it, and pass it into this function:</p>
-
-<pre class="brush: js">// add-on script
-
-var addonScriptObject = {"message" : "hello from add-on"};
-contentWindow.foo(cloneInto(addonScriptObject, contentWindow)); // "they said: hello from add-on"</pre>
-
-<h3 id="Cloning_objects_that_have_functions">Cloning objects that have functions</h3>
-
-<p>If the object to be cloned contains functions, you must pass the <code>{cloneFunctions:true}</code> flag or you'll get an error. If you do pass this flag, then functions in the object are cloned using the same mechanism as that used in <a href="/en-US/docs/Components.utils.exportFunction"><code>Components.utils.exportFunction</code></a>:</p>
-
-<pre class="brush: js">// add-on script
-
-var addonScriptObject = {
- greetme: function() {
- alert("hello from add-on");
- }
-};
-
-contentWindow.addonScriptObject = cloneInto(addonScriptObject,
- contentWindow,
- {cloneFunctions: true});
-</pre>
-
-<pre class="brush: js">// page script
-
-var test = document.getElementById("test");
-
-test.addEventListener("click", function() {
- window.addonScriptObject.greetme();
-}, false);</pre>
-
-<h3 id="Cloning_objects_that_contain_DOM_elements">Cloning objects that contain DOM elements</h3>
-
-<p>By default, if the object you clone contains objects that are reflected from C++, such as DOM elements, the cloning operation will fail with an error. If you pass the <code>{wrapReflectors:true}</code> flag, then the object you clone is allowed to contain these objects:</p>
-
-<pre class="brush: js">// add-on script
-
-var addonScriptObject = {
- body: contentWindow.document.body
-};
-
-contentWindow.addonScriptObject = cloneInto(addonScriptObject,
- contentWindow,
- {wrapReflectors: true});</pre>
-
-<pre class="brush: js">// page script
-
-var test = document.getElementById("test");
-
-test.addEventListener("click", function() {
- console.log(window.addonScriptObject.body.innerHTML);
-}, false);</pre>
-
-<p>Access to these objects in the target scope is subject to the normal <a href="/en-US/docs/Security_check_basics">security checks</a>.</p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/language_bindings/components.utils.getglobalforobject/index.html b/files/zh-cn/mozilla/tech/xpcom/language_bindings/components.utils.getglobalforobject/index.html
deleted file mode 100644
index a22b49a2d5..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/language_bindings/components.utils.getglobalforobject/index.html
+++ /dev/null
@@ -1,41 +0,0 @@
----
-title: Components.utils.getGlobalForObject
-slug: Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.getGlobalForObject
-translation_of: Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.getGlobalForObject
----
-<p></p>
-
-<p><font>此方法是用于确定与对象关联的全局对象。用于</font>获取创建对象时所处的全局对象, 即在执行创建对象的脚本时使用的全局对象。</p>
-
-<h3 id="Syntax" name="Syntax">语法</h3>
-
-<pre class="eval">var global = Components.utils.getGlobalForObject(<em>obj</em>);
-</pre>
-
-<h3 id="Parameters" name="Parameters">参数</h3>
-
-<dl>
- <dt><code>obj</code></dt>
- <dd>其对应的全局对象将被检索的对象; 非可选参数,必须是对象。</dd>
-</dl>
-
-<h3 id="Example" name="Example">例子</h3>
-
-<pre class="eval">var obj = {};
-function foo() { }
-var global = this;
-
-var g1 = Components.utils.getGlobalForObject(foo);
-var g2 = Components.utils.getGlobalForObject(obj);
-// g1 === global, g2 === global, g1 === g2
-
-// In a script in another window
-var global2 = this;
-function bar() { }
-var obj2 = {};
-
-// Then, assuming bar refers to the function defined in that other window:
-var o1 = Components.utils.getGlobalForObject(bar);
-var o2 = Components.utils.getGlobalForObject(obj2);
-// o1 === global2, o2 === global2
-</pre>
diff --git a/files/zh-cn/mozilla/tech/xpcom/language_bindings/index.html b/files/zh-cn/mozilla/tech/xpcom/language_bindings/index.html
deleted file mode 100644
index cf8ced2678..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/language_bindings/index.html
+++ /dev/null
@@ -1,20 +0,0 @@
----
-title: 语言绑定
-slug: Mozilla/Tech/XPCOM/Language_Bindings
-tags:
- - XPCOM
- - 'XPCOM:Language Bindings'
-translation_of: Mozilla/Tech/XPCOM/Language_Bindings
----
-<p>一款 <strong>XPCOM 的语言绑定</strong>是连接某种特定的程序设计语言与 <a href="/cn/XPCOM" title="cn/XPCOM">XPCOM</a> 之间的纽带,它用来提供从语言到 XPCOM 对象的访问, 并且将此种语言写成的模块作为其他进行 XPCOM 绑定的程序语言的 XPCOM 对象。 </p>
-<p>更具体的说, 一个 XPCOM 语言绑定:</p>
-<ul>
- <li>允许<em>在特定的程序设计语言中访问 XPCOM 对象</em>(此处,访问的意思是能够读取、写入和创建 XPCOM 对象以及调用这些对象的方法)。</li>
- <li>暴露<em>由</em><em>特定的程序设计语言</em><em>编写的模块并使之成为一个 XPCOM 对象</em>,从而允许所有已绑定的其它程序设计语言能够访问这些模块。</li>
-</ul>
-<p>由于 XPCOM 层本身使用 C/C++ 编写,因此可以使用 C/C++ 直接访问其 API。而当其它的程序设计语言需要访问该 API 时,则需要通过额外的桥接层来实现。</p>
-<p>当前有效的链接层如下:</p>
-<p></p><div class="row topicpage-table">
- <div class="section"><dl><dl><dt class="landingPageList"><a href="/zh-CN/docs/Components_object">Components</a></dt><dd class="landingPageList"><code>Components</code> 对象是 <a href="https://developer.mozilla.org/en/XPConnect" title="en/XPConnect">XPConnect</a> 功能被映射到 <a href="https://developer.mozilla.org/en/JavaScript" title="en/JavaScript">JavaScript</a> 上的对象。<code>Components</code> 对象的 native 实现位置在   <a href="https://dxr.mozilla.org/mozilla-central/source/js/xpconnect/idl/xpccomponents.idl" rel="custom">nsIXPCComponents</a> , 这个接口会被映射成JavaScript 作为使用 XPConnect 的最高层级的对象。</dd><dt class="landingPageList"><a href="/zh-CN/docs/Components.classes">Components.classes</a></dt><dd class="landingPageList"></dd><dt class="landingPageList"><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.cloneInto">Components.utils.cloneInto</a></dt><dd class="landingPageList">该函数为定义在某一作用域中的对象提供了一个安全的、将其<a href="https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/The_structured_clone_algorithm">结构化克隆</a>到其字作用域中的方法,</dd><dt class="landingPageList"><a href="/zh-CN/docs/Components.utils.evalInSandbox">Components.utils.evalInSandbox</a></dt><dd class="landingPageList"></dd><dt class="landingPageList"><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.getGlobalForObject">Components.utils.getGlobalForObject</a></dt><dd class="landingPageList"><font>此方法是用于确定与对象关联的全局对象。用于</font>获取创建对象时所处的全局对象, 即在执行创建对象的脚本时使用的全局对象。</dd></dl></dl></div>
- <div class="section"><dl><dt class="landingPageList"><a href="/zh-CN/docs/Components.utils.import">Components.utils.import</a></dt><dd class="landingPageList">这个方法在 <a href="/en/Firefox_3_for_developers" title="en/Firefox_3_for_developers">Firefox 3</a> 中被引入,它使得在不同的作用域之间分享代码变得更加容易。例如:你可以直接导入 <a href="/en/JavaScript_code_modules/XPCOMUtils.jsm" title="en/XPCOMUtils.jsm">XPCOMUtils.jsm</a> 而不必复制/粘贴冗长的XPCOM组件。</dd><dt class="landingPageList"><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Language_bindings/JavaXPCOM">JavaXPCOM</a></dt><dd class="landingPageList"></dd><dt class="landingPageList"><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Language_bindings/PyXPCOM">PyXPCOM</a></dt><dd class="landingPageList"></dd><dt class="landingPageList"><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Language_bindings/XPConnect">XPConnect</a></dt><dd class="landingPageList">[<a class="external" href="http://developer.mozilla.org/en/docs/XPConnect">] </a></dd></dl></div>
- </div><p></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/language_bindings/javaxpcom/index.html b/files/zh-cn/mozilla/tech/xpcom/language_bindings/javaxpcom/index.html
deleted file mode 100644
index 6ce4c6a6ba..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/language_bindings/javaxpcom/index.html
+++ /dev/null
@@ -1,49 +0,0 @@
----
-title: JavaXPCOM
-slug: Mozilla/Tech/XPCOM/Language_bindings/JavaXPCOM
-tags:
- - Java
- - JavaXPCOM
-translation_of: Mozilla/Tech/XPCOM/Language_bindings/JavaXPCOM
----
-<p>
-</p><p><b>JavaXPCOM</b>允许在Java和<a href="cn/XPCOM">XPCOM</a>间进行会话,这样一来,Java应用程序就可以访问XPCOM对象,并且XPCOM也可以访问任何实现了XPCOM接口的Java类。借助JavaXPCOM,开发者可以在Java应用程序中同XPCOM或嵌入的<a href="cn/Gecko">Gecko</a>对话。JavaXPCOM和<a href="cn/XPConnect">XPConnect</a>(JavaScript-XPCOM桥)十分相似,并且使用<a href="cn/XPIDL">XPIDL</a>实现其功能。
-</p><p>JavaXPCOM默认地作为<a href="cn/XULRunner">XULRunner</a>的一部分被构建。下载最近的编译成品或<a href="cn/XULRunner_1.8.0.4">XULRunner 1.8.0.4</a>进行尝试。
-</p>
-<table class="topicpage-table">
-<tbody><tr><td>
-<h4 id=".E9.A2.84.E8.A7.88" name=".E9.A2.84.E8.A7.88"> 预览 </h4>
-<ul><li> <a href="cn/JavaXPCOM/%e5%bc%80%e5%8f%91">JavaXPCOM:开发</a>
-</li><li> <a href="cn/JavaXPCOM/%e8%8c%83%e4%be%8b">JavaXPCOM:范例</a>
-</li></ul>
-<h4 id=".E6.96.87.E7.AB.A0.E7.B2.BE.E9.80.89" name=".E6.96.87.E7.AB.A0.E7.B2.BE.E9.80.89"> 文章精选 </h4>
-<ul><li> <a href="cn/JavaXPCOM/%e4%bd%bf%e7%94%a8JavaXPCOM%e5%9c%a8Java%e5%ba%94%e7%94%a8%e7%a8%8b%e5%ba%8f%e4%b8%ad%e5%b5%8c%e5%85%a5Mozilla">JavaXPCOM:使用JavaXPCOM在Java应用程序中嵌入Mozilla</a>
-</li></ul>
-<p><span class="alllinks"><a>View All...</a></span>
-</p>
-</td>
-<td>
-<h4 id=".E5.85.B6.E4.BB.96.E9.A1.B5.E9.9D.A2" name=".E5.85.B6.E4.BB.96.E9.A1.B5.E9.9D.A2"> 其他页面 </h4>
-<ul><li> <a>参考</a>
-</li><li> <a>文章</a>
-</li><li> <a>范例</a>
-</li><li> <a href="cn/JavaXPCOM/Community">社区</a>
-</li><li> <a href="cn/JavaXPCOM/Other_Resources">其他资源</a>
-</li></ul>
-<h4 id=".E7.9B.B8.E5.85.B3.E4.B8.BB.E9.A2.98" name=".E7.9B.B8.E5.85.B3.E4.B8.BB.E9.A2.98"> 相关主题 </h4>
-<dl><dd> <a href="cn/XPCOM">XPCOM</a>, <a href="cn/Embedding_Mozilla">嵌入式Mozilla</a>
-</dd></dl>
-<p><span class="comment">there's no javaxpcom category on webwatch &lt;rss&gt;<a class=" external" href="http://developer.mozilla.org/webwatch/?cat=23&amp;feed=rss2" rel="freelink">http://developer.mozilla.org/webwatc...t=23&amp;feed=rss2</a>|short|max=5|charset=UTF-8&lt;/rss&gt; &lt;span class="alllinks"&gt;<a class="external" href="http://developer.mozilla.org/webwatch/?cat=23" title="http://developer.mozilla.org/webwatch/?cat=23">View All...</a>&lt;/span&gt;</span>
-</p>
-</td>
-</tr>
-</tbody></table>
-<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:jhpedemonte@gmail.com">Javier Pedemonte</a>
-</li><li> 最后更新: December 22, 2005
-</li><li> 版权信息: Copyright (C) <a class="link-mailto" href="mailto:jhpedemonte@gmail.com">Javier Pedemonte</a>
-</li></ul>
-</div>
-<p><br>
-</p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/language_bindings/javaxpcom/使用javaxpcom在java应用程序中嵌入mozilla/index.html b/files/zh-cn/mozilla/tech/xpcom/language_bindings/javaxpcom/使用javaxpcom在java应用程序中嵌入mozilla/index.html
deleted file mode 100644
index 9a8e1805fa..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/language_bindings/javaxpcom/使用javaxpcom在java应用程序中嵌入mozilla/index.html
+++ /dev/null
@@ -1,65 +0,0 @@
----
-title: 使用JavaXPCOM在Java应用程序中嵌入Mozilla
-slug: Mozilla/Tech/XPCOM/Language_bindings/JavaXPCOM/使用JavaXPCOM在Java应用程序中嵌入Mozilla
-tags:
- - 'JavaXPCOM:Articles'
-translation_of: Archive/Mozilla/Embedding_Mozilla_in_a_Java_Application_using_JavaXPCOM
----
-<p>
-</p><p><br>
-<a href="cn/XULRunner">XULRunner</a>中包含了<a href="cn/JavaXPCOM">JavaXPCOM</a>组件,允许Java代码与XPCOM对象交互。在这片文章中您将会看到,在Java中使用XPCOM对象,要比在C++中容易得多。
-</p>
-<h4 id=".E5.BF.85.E8.A6.81.E6.9D.A1.E4.BB.B6" name=".E5.BF.85.E8.A6.81.E6.9D.A1.E4.BB.B6"> 必要条件 </h4>
-<ul><li> Java 1.4.2或者更新
-</li><li> XULRunner
-</li></ul>
-<div class="note">
-<p><b>2006-01-16</b>:XULRunner目前还没有官方发布版本,因此,为了能XULRunner加上JavaXPCOM一起使用,您应该马上下载1.8.0版分支的一个每夜构建。(<a class="external" href="http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/latest-mozilla1.8.0/xulrunner-1.8.0.1.en-US.linux-i686.tar.gz">Linux</a>,<a class="external" href="http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/latest-mozilla1.8.0/xulrunner-1.8.0.1.en-US.mac.dmg">Mac OS X</a>,<a class="external" href="http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/latest-mozilla1.8.0/xulrunner-1.8.0.1.en-US.win32.zip">Windows</a>)。下面提到的<i>MozillaInterfaces.jar</i>文件可以在<i>sdk</i>顶层文件夹中找到。
-</p>
-</div>
-<h4 id=".E5.B5.8C.E5.85.A5" name=".E5.B5.8C.E5.85.A5"> 嵌入 </h4>
-<p>为了在Java应用程序中嵌入Mozilla,您需要将库文件<i>MozillaInterfaces.jar</i>加入您的classpath中。这个库(它是SDK的一部分)提供了启动Mozilla和调用XPCOM方法所必需的接口。
-</p><p>要开始嵌入,我们使用<a href="https://dxr.mozilla.org/mozilla-central/source/extensions/java/xpcom/interfaces/Mozilla.java" rel="custom">Mozilla</a>单件类提供的方法。首先,Java应用程序必须找到一个合适的XULRunner安装:
-</p>
-<pre class="eval"> Mozilla mozilla = Mozilla.getInstance();
- GREVersionRange[] range = new GREVersionRange[1];
- range[0] = new GREVersionRange("1.8.*", false, "1.9", false);
- <span class="highlightgreen">// work with trunk nightly version 1.9a1 ^^</span>
-
- try {
- File grePath = Mozilla.getGREPathWithProperties(range, null);
- LocationProvider locProvider = new LocationProvider(grePath);
- mozilla.initEmbedding(grePath, grePath, locProvider);
- } catch (FileNotFoundException e) {
- <span class="highlightgreen">// this exception is thrown if greGREPathWithProperties cannot find a GRE</span>
- } catch (XPCOMException e) {
- <span class="highlightgreen">// this exception is thrown if initEmbedding failed</span>
- }
-</pre>
-<p><code>LocationProvider</code>是Java应用程序提供的一个类。它实现了<a href="https://dxr.mozilla.org/mozilla-central/source/extensions/java/xpcom/interfaces/IAppFileLocProvider.java" rel="custom">IAppFileLocProvider</a>接口,并且告诉XPCOM那里可以找到那些文件和目录。
-</p><p><code>initEmbedding</code>方法启动嵌入进程,允许Java应用程序与XPCOM和Mozilla一起工作。一旦Java应用程序使用完Mozilla,就需要中止嵌入进程:
-</p>
-<pre class="eval"> try {
- mozilla.termEmbedding();
- } catch (XPCOMException e) {
- <span class="highlightgreen">// this exception is thrown if termEmbedding failed</span>
- }
-</pre>
-<h4 id=".E4.B8.8EXPCOM.E5.AF.B9.E8.B1.A1.E4.B8.80.E8.B5.B7.E5.B7.A5.E4.BD.9C" name=".E4.B8.8EXPCOM.E5.AF.B9.E8.B1.A1.E4.B8.80.E8.B5.B7.E5.B7.A5.E4.BD.9C"> 与XPCOM对象一起工作 </h4>
-<p>现在,Mozilla已经嵌入了,Java应用程序可以和XPCOM对象工作了。<code>Mozilla</code>类提供了多种方法使工作更加容易,例如<code>getServiceManager</code>,<code>getComponentManager</code>,和<code>newLocalFile</code>。为了在XPCOM对象中增加查询和调用的方法,JavaXPCOM允许Java应用程序传递Java类对象给XPCOM方法。
-</p><p>例如:
-</p>
-<pre class="eval"> Mozilla mozilla = Mozilla.getInstance();
- WindowCreator creator = new WindowCreator(); <span class="highlightgreen">// implements nsIWindowCreator</span>
-
- nsIServiceManager serviceManager = mozilla.getServiceManager();
-
- nsIWindowWatcher windowWatcher = (nsIWindowWatcher) serviceManager
- .getServiceManagerByContractID(NS_WINDOWWATCHER_CONTRACTID,
- nsIWindowWatcher.NS_IWINDOWWATCHER_IID);
- windowWatcher.setWindowCreator(creator);
-</pre>
-<p>在这个例子中,我们有一个叫<code>WindowCreator</code>的类,它实现了<code>nsIWindowCreator</code>接口,我们想要在Mozilla中注册它。要做到这点,我们首先获取服务管理器(service manager),通过它,我们可以获取Mozilla窗口监视器的引用。
-</p>
-<div class="noinclude">
-</div>
diff --git a/files/zh-cn/mozilla/tech/xpcom/language_bindings/javaxpcom/开发/index.html b/files/zh-cn/mozilla/tech/xpcom/language_bindings/javaxpcom/开发/index.html
deleted file mode 100644
index d21deddbb6..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/language_bindings/javaxpcom/开发/index.html
+++ /dev/null
@@ -1,26 +0,0 @@
----
-title: 开发
-slug: Mozilla/Tech/XPCOM/Language_bindings/JavaXPCOM/开发
-tags:
- - JavaXPCOM
-translation_of: Mozilla/Tech/XPCOM/Language_bindings/JavaXPCOM/Development
----
-<p>
-</p>
-<h3 id=".E7.AE.80.E8.BF.B0" name=".E7.AE.80.E8.BF.B0"> 简述 </h3>
-<p>JavaXPCOM源于Mozilla的Java版firefox计划,后来演变为Mozilla的一项重要的扩展应用技术。目前JavaXPCOM是Mozilla最活跃的扩展应用技术之一。
-简单的说,JavaXPCOM就是通过Java运行环境启动GRE(Gecko Runtime Environment)环境,然后通过Java Interface与GRE typelib的映射关系,使得Java对象可以与XPCOM对象进行对象交互。当然,与XPCOM一样,JavaXPCOM也支持通过XPConnect映射同以xul/js为主体的Mozilla界面环境进行对象交互。
-</p>
-<h3 id=".E6.BA.90.E4.BB.A3.E7.A0.81" name=".E6.BA.90.E4.BB.A3.E7.A0.81"> 源代码 </h3>
-<p>最新的源代码可以在Mozilla主干上找到,在<code><a href="https://dxr.mozilla.org/mozilla-central/source/extensions/java/xpcom" rel="custom">extensions/java/xpcom</a></code>目录中。
-</p>
-<h3 id=".E6.9E.84.E5.BB.BA.E6.8C.87.E4.BB.A4" name=".E6.9E.84.E5.BB.BA.E6.8C.87.E4.BB.A4"> 构建指令 </h3>
-<p>构建指令可以在这里找到:<a href="cn/%e6%9e%84%e5%bb%baJavaXPCOM">构建JavaXPCOM</a>。
-</p>
-<h3 id="Bugs" name="Bugs"> Bugs </h3>
-<p>所有的JavaXPCOM的bugs都在<a class="external" href="http://bugzilla.mozilla.org/">Bugzilla</a>中被跟踪, 使用"Core"产品和"Java to XPCOM Bridge"组件。
-</p>
-<ul><li> <a class="link-https" href="https://bugzilla.mozilla.org/buglist.cgi?query_format=advanced&amp;product=Core&amp;component=Java+to+XPCOM+Bridge&amp;bug_status=UNCONFIRMED&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;chfieldto=Now">List</a>共开的JavaXPCOM bugs
-</li><li> <a class="link-https" href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Core&amp;component=Java+to+XPCOM+Bridge&amp;rep_platform=All&amp;op_sys=All">Open</a> 一个新的JavaXPCOM的bug
-</li><li> <a class="external" href="http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&amp;module=all&amp;branch=HEAD&amp;branchtype=match&amp;dir=mozilla%2Fextensions%2Fjava%2Fxpcom&amp;file=&amp;filetype=match&amp;who=&amp;whotype=match&amp;sortby=Date&amp;hours=2&amp;date=month&amp;mindate=&amp;maxdate=&amp;cvsroot=%2Fcvsroot">Checkins</a> 最近一个月之内
-</li></ul>
diff --git a/files/zh-cn/mozilla/tech/xpcom/language_bindings/pyxpcom/index.html b/files/zh-cn/mozilla/tech/xpcom/language_bindings/pyxpcom/index.html
deleted file mode 100644
index 397d95ff78..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/language_bindings/pyxpcom/index.html
+++ /dev/null
@@ -1,67 +0,0 @@
----
-title: PyXPCOM
-slug: Mozilla/Tech/XPCOM/Language_bindings/PyXPCOM
-translation_of: Mozilla/Tech/XPCOM/Language_bindings/PyXPCOM
----
-<p> </p>
-<div>
- <p><strong>PyXPCOM</strong>允许在<a href="http://www.python.org/" title="http://www.python.org/">Python</a>和<a href="/en/XPCOM" title="/en/XPCOM">XPCOM</a>之间进行通信,例如Python应用能够访问XPCOM对象,XPCOM能够访问任何实现了XPCOM接口的Python类。使用PyXPCOM一个开发者可以与XPCOM交互或者从一个Python应用中嵌入<a href="/en/Gecko" title="/en/Gecko">Gecko</a>。PyXPCOM就类似于<a href="/en/JavaXPCOM" title="/en/JavaXPCOM">JavaXPCOM</a>(Java-XPCOM桥)或者是<a href="/en/XPConnect" title="/en/XPConnect">XPConnect</a>(JavaScript-XPCOM桥)。</p>
- <p>Python类和接口:Mozilla定义了许多外部接口并允许用于嵌入使用和组件开发。PyXPCOM提供了方法以像Python语言接口那样来访问这些接口。PyXPCOM同时也包含了几个用于提供从Python访问那些初始化及关闭XPCOM和Gecko功能的类,以及一些XPCOM的帮助函数。</p>
-</div>
-<table class="topicpage-table">
- <tbody>
- <tr>
- <td>
- <h4 id="Documentation" name="Documentation"><a href="/Special:Tags?tag=PyXPCOM&amp;language=en" title="Special:Tags?tag=PyXPCOM&amp;language=en">文档</a></h4>
- <dl>
- <dt>
- <a href="/zh-CN/docs/Building_PyXPCOM" title="en/Building_PyXPCOM">构建 PyXPCOM</a></dt>
- <dd>
- <small>PyXPCOM</small>构建指导。</dd>
- </dl>
- <dl>
- <dt>
- <a href="/zh-CN/docs/Creating_a_Python_XPCOM_component" title="en/Creating_a_Python_XPCOM_component">创建 Python XPCOM 组件</a></dt>
- <dd>
- 如何使用Python创建简单的<a href="/en/XPCOM" title="/en/XPCOM">XPCOM</a>组件的例子。</dd>
- </dl>
- <dl>
- <dt>
- <a class="external" href="http://www-128.ibm.com/developerworks/webservices/library/co-pyxp1/">PyXPCOM 入门</a></dt>
- <dd>
- PyXPCOM是XPCOM与Python之间的一种桥接技术。本节带给你的是PyXPCOM入门级的向导。</dd>
- </dl>
- <p><span class="comment">NOTE: The links to Part II and III of this series are broken and I cannot find them on the IBM site. Please update this page if/when the links can be found.</span></p>
- <p><span class="alllinks"><a href="/Special:Tags?tag=PyXPCOM&amp;language=en" title="Special:Tags?tag=PyXPCOM&amp;language=en">View All...</a></span></p>
- <h4 id="History" name="History">历史</h4>
- <p>PyXPCOM was initially developed by <a class="external" href="http://www.activestate.com/">ActiveState Tool Corporation</a>, and <a class="external" href="http://aspn.activestate.com/ASPN/Downloads/Komodo/index/PyXPCOM/">came out</a> of their <a class="external" href="http://www.activestate.com/Products/Komodo">Komodo project</a>. Current releases are now <a class="external" href="http://public.activestate.com/pyxpcom/">integrated</a> with the Mozilla build system.</p>
- <p>Other Resources<br>
- <a class="external" href="http://pyxpcomext.mozdev.org/" title="http://pyxpcomext.mozdev.org/">PythonExt</a> - extension that provides PyXPCOM<br>
- <a class="external" href="http://pyxpcomext.mozdev.org/samples.html" title="http://pyxpcomext.mozdev.org/samples.html">Samples</a> - demo applications using PyXPCOM</p>
- </td>
- <td>
- <h4 id="Community" name="Community">交流</h4>
- <br>
- <ul>
- <li><a class="external" href="http://listserv.activestate.com/mailman/listinfo/pyxpcom">Python-XPCOM bindings mailing list (ActiveState)</a></li>
- <li><a class="link-irc" href="irc://irc.mozilla.org:6667/pyxpcom">#pyxpcom on irc.mozilla.org</a></li>
- </ul>
- <h4 id="Source_Code" name="Source_Code">源代码</h4>
- <ul>
- <li>The PyXPCOM code is available here: <a class="external" href="http://hg.mozilla.org/pyxpcom/">http://hg.mozilla.org/pyxpcom/</a></li>
- <li>To build PyXPCOM, see <a href="/en/Building_PyXPCOM" title="en/Building_PyXPCOM">Building PyXPCOM</a>.</li>
- </ul>
- <h4 id="Related_Topics" name="Related_Topics">相关主题</h4>
- <dl>
- <dd>
- <a href="/en/XPCOM" title="en/XPCOM">XPCOM</a></dd>
- <dd>
- <a href="/en/PyDOM" title="en/PyDOM">PyDOM</a>: replace JavaScript with Python</dd>
- <dd>
- <a class="external" href="http://code.google.com/p/python-spidermonkey/">Python-SpiderMonkey</a></dd>
- </dl>
- </td>
- </tr>
- </tbody>
-</table>
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/language_bindings/xpconnect/index.html b/files/zh-cn/mozilla/tech/xpcom/language_bindings/xpconnect/index.html
deleted file mode 100644
index df0270b533..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/language_bindings/xpconnect/index.html
+++ /dev/null
@@ -1,67 +0,0 @@
----
-title: XPConnect
-slug: Mozilla/Tech/XPCOM/Language_bindings/XPConnect
-translation_of: Mozilla/Tech/XPCOM/Language_bindings/XPConnect
----
-<p>XPConnect是<a href="/zh-CN/docs/Web/JavaScript">JavaScript</a>和<a href="/zh-CN/docs/Mozilla/Tech/XPCOM">XPCOM</a>之间的桥梁。利用XPConnect,你可以通过JavaScript代码使用XPCOM组件,同时让XPCOM组件与JavaScript对象交互。XPConnect是<a href="/zh-CN/Firefox">Firefox</a>的组成部分,同时也应用于<a href="/zh-CN/docs/Mozilla/Tech/XUL">XUL</a>应用。</p>
-
-<table class="topicpage-table">
- <tbody>
- <tr>
- <td>
- <h2 id="Documentation" name="Documentation">文档</h2>
-
- <dl>
- <dt><a href="/zh-CN/docs/XPConnect/Architecture_basics">结构基础</a></dt>
- <dd>XPConnect, JavaScript, XPCOM, XUL...</dd>
- <dt><a href="/zh-CN/docs/XPConnect/Using_components">使用组件</a></dt>
- <dd>如何与XPCOM组件通信。</dd>
- <dt><a class="external" href="https://www-archive.mozilla.org/scriptable/faq.html">XPConnect 和 XPIDL 的常见问题解答</a></dt>
- <dd>关于使用XPConnect和XPIDL的常见问题解答。<strong>该页面尚未迁移至MDN。</strong></dd>
- <dt><a href="/zh-CN/docs/Mozilla/XPConnect/XPConnect_wrappers">XPConnect Wrappers</a></dt>
- <dd>XPConnect的wrappers的生成和使用</dd>
- </dl>
-
- <p><strong><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Language_bindings/XPConnect/XPConnect_security_membranes">XPConnect 脚本安全</a></strong></p>
- </td>
- <td>
- <h2 id="Tools" name="Tools">工具</h2>
-
- <ul>
- <li><a href="/zh-CN/docs/XPConnect/xpcshell">xpcshell</a></li>
- </ul>
- </td>
- </tr>
- </tbody>
-</table>
-
-<div class="blockIndicator communitybox" dir="ltr">
-<div class="column-container">
-<h2 id="加入XPCOM社区">加入XPCOM社区</h2>
-
-<div class="column-half">
-<div class="communitysubhead">选择你喜欢的方式来加入讨论:</div>
-
-<ul class="communitymailinglist">
- <li><a href="https://lists.mozilla.org/listinfo/dev-tech-xpcom">Mailing list</a></li>
- <li><a href="http://groups.google.com/group/mozilla.dev.tech.xpcom">Newsgroup</a></li>
- <li><a href="http://groups.google.com/group/mozilla.dev.tech.xpcom/feeds">RSS feed</a></li>
-</ul>
-</div>
-
-<div class="column-half">
-<ul class="communitycontact">
- <li><strong>IRC: </strong><a href="irc://irc.mozilla.org/developers">#developers</a> <span class="smaller">(<a href="https://wiki.mozilla.org/IRC">learn more</a>)</span></li>
- <li><strong>Tools: </strong><a href="http://ted.mielczarek.org/code/mozilla/jscomponentwiz/">JavaScript Component Wizard</a>, <a href="http://www.mytools360.com-a.googlepages.com/home#XPComPro">Visual C++ Component Wizard</a>, <a href="http://www.yutools.com/wp/tools/yuxpcomwizard/?lang=en">Visual C++ Component Wizard for Visual Studio 2010</a></li>
-</ul>
-</div>
-</div>
-</div>
-
-<section id="Quick_Links">
-<ol>
- <li><a href="/en-US/docs/Mozilla/XPCOM">XPCOM</a></li>
- <li><a href="/en-US/docs/Mozilla/XPIDL" title="XPIDL is an Interface Description Language used to specify XPCOM interface classes.">XPIDL</a></li>
- <li><a href="/en-US/docs/Mozilla/Projects/SpiderMonkey" title="Standalone source code releases can be found on the Releases page.">SpiderMonkey</a></li>
-</ol>
-</section>
diff --git a/files/zh-cn/mozilla/tech/xpcom/observer_notifications/index.html b/files/zh-cn/mozilla/tech/xpcom/observer_notifications/index.html
deleted file mode 100644
index 86fdd81a37..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/observer_notifications/index.html
+++ /dev/null
@@ -1,880 +0,0 @@
----
-title: Observer Notifications
-slug: Mozilla/Tech/XPCOM/Observer_Notifications
-translation_of: Mozilla/Tech/XPCOM/Observer_Notifications
----
-<h2 id="Observer_topics" name="Observer_topics">Observer topics</h2>
-
-<p>The following are topics that you can observe during the course of an application. Unless otherwise noted you register for the topics using the <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIObserverService" title="">nsIObserverService</a></code>.</p>
-
-<h3 id="Application_startup" name="Application_startup">Application startup</h3>
-
-<p>These are the topics that you can observe on startup, in order of appearance.</p>
-
-<p>If your component requires access to the user profile, or any services which require access to the profile (preferences, bookmarks, and so on) then a common pattern is to register with the <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsICategoryManager" title="">nsICategoryManager</a></code> for the app-startup topic which can be done in the component's registration code, and then in that notification register with the observer service for the profile-after-change notification. See <a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Guide/Receiving_startup_notifications" title="zh-CN/XPCOM/Receiving startup notifications">Receiving startup notifications</a> for more information about how this works.</p>
-
-<p>Starting in Firefox 3.5 components can simply register for the profile-after-change notification in <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsICategoryManager" title="">nsICategoryManager</a></code>.</p>
-
-<table class="standard-table" style="width: 846px;">
- <tbody>
- <tr>
- <th>Topic</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>*</td>
- <td>
- <p>Everything.  [<a class="external" href="http://mxr.mozilla.org/mozilla-central/source/xpcom/ds/nsObserverService.cpp#152" title="http://mxr.mozilla.org/mozilla-central/source/xpcom/ds/nsObserverService.cpp#184">nsObserverService.cpp</a>]</p>
- </td>
- </tr>
- </tbody>
-</table>
-
-<table class="standard-table" style="height: 880px; width: 846px;">
- <tbody>
- <tr>
- <th>Topic</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>xpcom-startup</td>
- <td>
- <p></p><div class="blockIndicator note"><strong>Note:</strong> An extension can no longer be registered to receive this notification in Firefox 4 and later. See <a href="zh-CN/XPCOM/XPCOM_changes_in_Gecko_2.0#Category_registration">XPCOM changes in Gecko 2.0</a> for details.</div><p></p>
-
- <p>Called when xpcom is initialized. Many things are not available for use at this point. To receive this notification you have to register with <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsICategoryManager" title="">nsICategoryManager</a></code>. The registered component is always retrieved as a singleton (That is getService() will be used to instantiate it).</p>
- </td>
- </tr>
- <tr>
- <td>app-startup</td>
- <td>
- <p></p><div class="blockIndicator note"><strong>Note:</strong> An extension can no longer be registered to receive this notification in Firefox 4 and later. See <a href="zh-CN/XPCOM/XPCOM_changes_in_Gecko_2.0#Category_registration">XPCOM changes in Gecko 2.0</a> for details.</div><p></p>
-
- <p>General event for application startup. To receive this notification you have to register with <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsICategoryManager" title="">nsICategoryManager</a></code>. Prepend "service," to the contract ID in the category registration to be invoked via getService() instead of createInstance().</p>
- </td>
- </tr>
- <tr>
- <td>profile-do-change</td>
- <td>This is fired after the profile has been selected. You will not be able to access user preferences, bookmarks, or anything that uses the profile folder until this event occurs. This occurs after any profile migration.</td>
- </tr>
- <tr>
- <td>profile-after-change</td>
- <td>
- <p>This is fired after all the observers for profile-do-change have been notified.</p>
-
- <p>You can register with <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsICategoryManager" title="">nsICategoryManager</a></code> to receive this notification. Prior to Firefox 3.5, this was available to observers observing the app-startup/xpcom-startup notification.</p>
- </td>
- </tr>
- <tr>
- <td>final-ui-startup</td>
- <td>
- <p>Triggered just before the first window for the application is displayed.</p>
- </td>
- </tr>
- <tr>
- <td>sessionstore-windows-restored </td>
- <td>
- <p>Sent by the session restore process to indicate that all initial browser windows have opened. Note that while the window are open and the chrome loaded the tabs in the windows may still be being restored after this notification.</p>
-
- <p></p><div class="blockIndicator note"><strong>Note:</strong> This notification is specific to Firefox and SeaMonkey 2.0 applications</div><p></p>
- </td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="Application_shutdown" name="Application_shutdown">Application shutdown</h3>
-
-<p>These are the topics that you can observe on shutdown, in order of appearance.</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th>Topic</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>quit-application-requested</td>
- <td>Something has requested that the application be shutdown. You can cancel the shutdown from here by setting <code>aSubject.data</code> to <code>true</code> (<code>aSubject</code> is the first parameter to your observer, the data value is an <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupportsPRBool" title="">nsISupportsPRBool</a></code>).</td>
- </tr>
- <tr>
- <td>quit-application-granted</td>
- <td>All observers have agreed to the shutdown.</td>
- </tr>
- <tr>
- <td>quit-application</td>
- <td>The application is about to quit. This can be in response to a normal shutdown, or a restart. <div class="blockIndicator note"><strong>Note:</strong> The data value for this notification is either 'shutdown' or 'restart'.</div></td>
- </tr>
- <tr>
- <td>profile-change-net-teardown</td>
- <td>The network connection is going offline at this point. <div class="blockIndicator note"><strong>Note:</strong> The data value for this notification is either 'shutdown-persist' or 'shutdown-cleanse'.</div></td>
- </tr>
- <tr>
- <td>profile-change-teardown</td>
- <td>Part of the shutdown, profile data is still available at this point. <div class="blockIndicator note"><strong>Note:</strong> The data value for this notification is either 'shutdown-persist' or 'shutdown-cleanse'.</div></td>
- </tr>
- <tr>
- <td>profile-before-change</td>
- <td>Called just before the profile is lost. <div class="blockIndicator note"><strong>Note:</strong> The data value for this notification is either 'shutdown-persist' or 'shutdown-cleanse'.</div></td>
- </tr>
- <tr>
- <td>xpcom-will-shutdown </td>
- <td>Called just before xpcom-shutdown. Observer must not spin event loop.</td>
- </tr>
- <tr>
- <td>xpcom-shutdown</td>
- <td>This is the end. Many things will not be available here.</td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="Browser" name="Browser">Browser</h3>
-
-<p>These topics indicate interesting things that happen that the browser alerts you to.</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th>Topic</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>browser:purge-session-history</td>
- <td>Sent when the sanitizer runs to purge all history and other information.</td>
- </tr>
- <tr>
- <td>browser:purge-domain-data</td>
- <td>Sent after domain-specific history and other information have been purged. The data value is a string form of the domain. </td>
- </tr>
- <tr>
- <td>browser-lastwindow-close-requested</td>
- <td>Sent when the browser wishes to close the last open browser window. When this is sent, it is possible that other windows may still be open, such as the download manager or preferences. The data value is an <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupportsPRBool" title="">nsISupportsPRBool</a></code>. Recipients may set this to <code>true</code> to abort the close. </td>
- </tr>
- <tr>
- <td>browser-lastwindow-close-granted</td>
- <td>Sent when all interested parties have responded to the browser-lastwindow-close-requested notification and none of them requested that the close be aborted. After this is sent and handled, the browser window will close. </td>
- </tr>
- <tr>
- <td>browser-delayed-startup-finished</td>
- <td>Sent when the browser window and all its components have been loaded and initialized.</td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="Documents" name="Documents">Documents</h3>
-
-<p>These topics indicate notifications you can monitor related to DOM documents.</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th>Topic</th>
- <th>Subject</th>
- <th>Data</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>chrome-document-global-created </td>
- <td><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindow" title="">nsIDOMWindow</a></code></td>
- <td>null</td>
- <td>Sent immediately after a chrome document window has been set up, but before any script code has been executed. This lets extensions inject API into chrome windows as needed (see <a href="/zh-CN/XPCOM_Interface_Reference/nsIDOMGlobalPropertyInitializer" title="zh-CN/XPCOM_Interface_Reference/nsIDOMGlobalPropertyInitializer">nsIDOMGlobalPropertyInitializer</a> for an alternative method of doing this, which uses significantly less memory).<br>
- <code>data</code> is intentionally left blank.</td>
- </tr>
- <tr>
- <td>content-document-global-created </td>
- <td><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindow" title="">nsIDOMWindow</a></code></td>
- <td>origin</td>
- <td>Sent immediately after a web content document window has been set up, but before any script code has been executed. This lets extensions inject API into content windows as needed (see <a href="/zh-CN/XPCOM_Interface_Reference/nsIDOMGlobalPropertyInitializer" title="zh-CN/XPCOM_Interface_Reference/nsIDOMGlobalPropertyInitializer">nsIDOMGlobalPropertyInitializer</a> for an alternative method of doing this).<br>
- <code>data</code> is a string form of the origin (for use in security checks), eg "http://developer.mozilla.org".</td>
- </tr>
- <tr>
- <td>document-element-inserted </td>
- <td><a href="/zh-CN/docs/Web/API/Document" title="Document接口表示任何在浏览器中已经加载好的网页,并作为一个入口去操作网页内容(也就是DOM tree)。DOM tree包括像 &lt;body> 、&lt;table>这样的还有其他的元素。它提供了全局操作document的功能,像获取网页的URL和在document里创建一个新的元素。"><code>Document</code></a></td>
- <td>null</td>
- <td>Sent immediately after the root element of a document has been created, but before executing any script on it.</td>
- </tr>
- <tr>
- <td>user-interaction-active </td>
- <td><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindow" title="">nsIDOMWindow</a></code></td>
- <td>null</td>
- <td>
- <p>Sent once every 5000ms while this chrome document sees some kind of user activity (for example, keyboard or mouse events), <em>and</em> at the exact moment of the state transition from idle to active.</p>
- </td>
- </tr>
- <tr>
- <td>user-interaction-inactive </td>
- <td><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindow" title="">nsIDOMWindow</a></code></td>
- <td>null</td>
- <td>
- <p>Sent when the chrome document has seen no user activity for a while. The notification is not repeated during a continuous inactivity period.</p>
- </td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="Windows" name="Windows">Windows</h3>
-
-<p>These topics indicate points of interest during the lifetime of a window.</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th>Topic</th>
- <th>Data</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>dom-window-destroyed </td>
- <td> </td>
- <td>Called just before a DOM window is destroyed.</td>
- </tr>
- <tr>
- <td>inner-window-destroyed </td>
- <td> <code>null</code></td>
- <td>Called when an inner window is removed from the backward/forward cache. See <a href="/zh-CN/Working_with_BFCache" title="zh-CN/Working with BFCache">Working With BFCache</a> for information about the bfcache, and <a href="/zh-CN/Inner_and_outer_windows" title="zh-CN/Inner and outer windows">Inner and outer windows</a> for details about how the window hierarchy works. Extensions that cache information about windows may wish to observe this so they can release information when the window is destroyed.  The <a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=534149" title="https://bugzilla.mozilla.org/show_bug.cgi?id=534149">window id</a> can be obtained from subject.QueryInterface(Components.interfaces.nsISupportsPRUint64).data</td>
- </tr>
- <tr>
- <td>outer-window-destroyed </td>
- <td><code>null</code></td>
- <td>Called when an outer window is disconnected from its docshell.  See <a href="/zh-CN/Inner_and_outer_windows" title="zh-CN/Inner and outer windows">Inner and outer windows</a> for details about how the window hierarchy works. Extensions that cache information about windows may wish to observe this so they can release information when the window is destroyed.  The<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=534149" title="https://bugzilla.mozilla.org/show_bug.cgi?id=534149"> window id</a> can be obtained from subject.QueryInterface(Components.interfaces.nsISupportsPRUint64).data</td>
- </tr>
- <tr>
- <td>toplevel-window-ready</td>
- <td> </td>
- <td>Called just after a new top level window has been opened and is ready, but has not yet loaded a document.</td>
- </tr>
- <tr>
- <td>xul-window-destroyed</td>
- <td> </td>
- <td>Called just before a XUL window is destroyed.</td>
- </tr>
- <tr>
- <td>xul-window-registered</td>
- <td> </td>
- <td>Called just after a top level XUL window is registered with the window mediator service.</td>
- </tr>
- <tr>
- <td>xul-window-visible</td>
- <td> </td>
- <td>Called just after a XUL window is made visible.</td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="Spelling checker" name="Spelling checker">Spelling checker </h3>
-
-<p>These topics indicate activities that have occurred related to the spelling checker.</p>
-
-<table class="standard-table" style="width: auto;">
- <tbody>
- <tr>
- <td class="header">Topic</td>
- <td class="header">Data</td>
- <td class="header">Description</td>
- </tr>
- <tr>
- <td>spellcheck-dictionary-update</td>
- <td> </td>
- <td>Sent by a spell checker implemented by the <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/mozISpellingChecker" title="">mozISpellingChecker</a></code> interface when something has happened that causes a change that may interest the editor; these are received primarily by <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIEditor" title="">nsIEditor</a></code>.</td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="IO_Notifications" name="IO_Notifications">IO Notifications</h3>
-
-<p>These topics can be used to watch the IO service for useful information.</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th>Topic</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>offline-requested</td>
- <td>Called to query whether the application can go offline. The attempt to go offline can be canceled.
- <p></p><div class="blockIndicator note"><strong>Note:</strong> If your code chooses to cancel the attempt to go offline, it <strong>must</strong> notify the user.</div><p></p>
- </td>
- </tr>
- <tr>
- <td>network:offline-about-to-go-offline</td>
- <td>Called just before all network IO is taken offline.</td>
- </tr>
- <tr>
- <td>network:offline-status-changed</td>
- <td>Called when the offline state has changed. <div class="blockIndicator note"><strong>Note:</strong> The data value for this notification 'offline' or 'online' to indicate the new state.</div></td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="HTTP_requests" name="HTTP_requests">HTTP requests</h3>
-
-<p>These are the topics that you can observe during a HTTP request (see <a href="/zh-CN/Setting_HTTP_request_headers" title="zh-CN/Setting_HTTP_request_headers">Setting HTTP request headers</a> and <a href="/zh-CN/Creating_Sandboxed_HTTP_Connections#HTTP_notifications" title="zh-CN/Creating_Sandboxed_HTTP_Connections#HTTP_notifications"> Creating Sandboxed HTTP Connections</a>). Both are passed an <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIHttpChannel" title="">nsIHttpChannel</a></code> as the subject parameter.</p>
-
-<table class="standard-table" style="height: 221px; width: 1106px;">
- <tbody>
- <tr>
- <th>Topic</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>http-on-modify-request</td>
- <td>Called as a http request is made. The channel is available to allow you to modify headers and such. See <a class="internal" href="/zh-CN/Code_snippets/Tabbed_browser#Getting_the_tab_that_fires_the_http-on-modify-request_notification" title="zh-CN/Code snippets/Tabbed browser#Getting the tab that fires the http-on-modify-request notification">this code snippet</a> to learn how to get the tab that issued the request.</td>
- </tr>
- <tr>
- <td>http-on-opening-request </td>
- <td>Similar to http-on-modify-request, but called earlier (synchronously during the channel's asyncOpen() call), and some channel atttributes (proxyInfo) may be missing.  Use only if your observer must be called before asyncOpen returns.</td>
- </tr>
- <tr>
- <td>http-on-examine-response</td>
- <td>Called after a response has been received from the web server. Headers are available on the channel. The response can be accessed and modified via <a href="XPCOM_Interface_Reference/NsITraceableChannel" rel="internal" title="nsITraceableChannel">nsITraceableChannel</a>.</td>
- </tr>
- <tr>
- <td>http-on-examine-cached-response </td>
- <td>Called instead of http-on-examine-response when a response will be read completely from the cache. Headers are available on the channel.</td>
- </tr>
- <tr>
- <td>http-on-examine-merged-response</td>
- <td>Called instead of http-on-examine-response when a response will be read partially from cache, and partially from the network (HTTP 206 or 304 response). Headers are available on the channel.</td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="Cookies" name="Cookies">Cookies</h3>
-
-<p>These topics indicate whenever a cookie has been changed (added, changed, cleared, or deleted) or its setting rejected by the browser. See <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsICookieService" title="">nsICookieService</a></code> for details.</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th>Topic</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>cookie-changed</td>
- <td>Called upon a cookie change (added, changed, cleared, or deleted)</td>
- </tr>
- <tr>
- <td>cookie-rejected</td>
- <td>Called when the setting of a cookie was rejected by the browser (per the user's preferences)</td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="Download_Manager" name="Download_Manager">Download Manager</h3>
-
-<p>These topics indicate that events related to the Download Manager have occurred.</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th>Topic</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>download-manager-ui-done</td>
- <td>Called when the list of downloads in the Download Manager windows finishes updating.  This can happen multiple times, such as when the window first opens, when multiple items are removed, and when entering private browsing mode.</td>
- </tr>
- <tr>
- <td>download-manager-remove-download </td>
- <td>Called when a download of the list is removed or all the list is cleared. The subject will be the download id wrapped in <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupportsPRUint32" title="">nsISupportsPRUint32</a></code>, for one download removed, or null for multi download remove, for example when the download list is cleared.</td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="Extension_Manager" name="Extension_Manager">Extension Manager</h3>
-
-<div class="note">
-<p><strong>Note:</strong> These notifications are no longer available starting with <span title="(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)">Gecko 2.0</span>, instead use <code><a href="/zh-CN/Addons/Add-on_Manager/AddonManager#addAddonListener()" title="https://developer.mozilla.org/zh-CN/Addons/Add-on_Manager/AddonManager#addAddonListener()">AddonManager.addAddonListener()</a></code> to receive similar events.</p>
-</div>
-
-<p>This topic indicates when the extension manager performs some action. Note that any action will be taken the next time the application starts. See <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIExtensionManager" title="">nsIExtensionManager</a></code> for details.</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th>Topic</th>
- <th>Data</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>em-action-requested</td>
- <td>item-installed</td>
- <td>A new extension has been installed.</td>
- </tr>
- <tr>
- <td>em-action-requested</td>
- <td>item-upgraded</td>
- <td>A different version of an existing extension has been installed.</td>
- </tr>
- <tr>
- <td>em-action-requested</td>
- <td>item-uninstalled</td>
- <td>An addon has been marked to be uninstalled.</td>
- </tr>
- <tr>
- <td>em-action-requested</td>
- <td>item-enabled</td>
- <td>An addon has been enabled.</td>
- </tr>
- <tr>
- <td>em-action-requested</td>
- <td>item-disabled</td>
- <td>An addon has been disabled.</td>
- </tr>
- <tr>
- <td>em-action-requested</td>
- <td>item-cancel-action</td>
- <td>A previous action has been cancelled.</td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="Idle_Service" name="Idle_Service">Idle Service</h3>
-
-<p>This topic indicates when actions related to the Idle Service, provided by the <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIIdleService" title="">nsIIdleService</a></code> interface. Unlike the user-interaction-active and user-interaction-inactive topics listed above, the Idle Service monitors user activity in general, whether related to the Mozilla application or not (acting somewhat like the user activity/inactivity events a screen saver would be interested in).</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th>Topic</th>
- <th>Data</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>idle</td>
- <td>The length of time the user has been idle, in milliseconds.</td>
- <td>Sent when the user becomes idle.</td>
- </tr>
- <tr>
- <td>idle-daily</td>
- <td>The length of time the user has been idle, in milliseconds.</td>
- <td>Sent once a day while the user is idle. </td>
- </tr>
- <tr>
- <td>back</td>
- <td>The length of time the user has been idle, in milliseconds.</td>
- <td>Sent when the user returns from being idle.</td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="Computer_sleep_and_wake" name="Computer_sleep_and_wake">Computer sleep and wake</h3>
-
-<p>This topic indicates when actions related to the computer going to sleep or waking up occur.  (Note: these notifications are not currently available on Linux.  <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=758848" title="https://bugzilla.mozilla.org/show_bug.cgi?id=758848">See bug 758848</a>.)</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th>Topic</th>
- <th>Data</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>sleep_notification</td>
- <td>null</td>
- <td>Sent when the computer is going to sleep.</td>
- </tr>
- <tr>
- <td>wake_notification</td>
- <td>null</td>
- <td>Sent when the computer is waking up.</td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="Login_Manage" name="Login_Manage">Login Manager</h3>
-
-<p>This topic indicates when actions related to the Login Manager occur.</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th>Topic</th>
- <th>Data</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>passwordmgr-found-form</td>
- <td>noAutofillForms</td>
- <td>A login is available for this form, but autofill of forms is disabled, so the form was not automatically filled out.  </td>
- </tr>
- <tr>
- <td>passwordmgr-found-form</td>
- <td>autocompleteOff</td>
- <td>A login is available for this form, but autocomplete is disabled.</td>
- </tr>
- <tr>
- <td>passwordmgr-storage-changed</td>
- <td>addLogin</td>
- <td>A login has been added to the Login Manager's database. The notification's subject is the login that was added to the database. </td>
- </tr>
- <tr>
- <td>passwordmgr-storage-changed</td>
- <td>removeLogin</td>
- <td>A login was removed from the Login Manager's database. The notification's subject is the login that was removed from the database. </td>
- </tr>
- <tr>
- <td>passwordmgr-storage-changed</td>
- <td>modifyLogin</td>
- <td>A login in the Login Manager's database was modified. The notification's subject is an array whose first entry is the old login and whose second entry is the new one. </td>
- </tr>
- <tr>
- <td>passwordmgr-storage-changed</td>
- <td>removeAllLogins</td>
- <td>All logins have been removed from the Login Manager's database. </td>
- </tr>
- <tr>
- <td>passwordmgr-storage-changed</td>
- <td>hostSavingEnabled</td>
- <td>Host saving has been enabled. </td>
- </tr>
- <tr>
- <td>passwordmgr-storage-changed</td>
- <td>hostSavingDisabled</td>
- <td>Host saving has been disabled. </td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="Places" name="Places">Places</h3>
-
-<p>This topic indicates when actions related to Places (the history and bookmarks database) occur.</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th>Topic</th>
- <th>Data</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>places-autocomplete-feedback-updated</td>
- <td> </td>
- <td>Sent when Places updates the location bar's autocompletion display.</td>
- </tr>
- <tr>
- <td>places-connection-closed</td>
- <td> </td>
- <td>Sent after Places has closed its database connection. Once this has been sent, no Places features will work. </td>
- </tr>
- <tr>
- <td>places-connection-closing</td>
- <td> </td>
- <td>
- <p>Sent as the last notification before the Places service closes its database connection. </p>
-
- <div class="warning"><strong>Warning:</strong> This is for internal use only.</div>
- </td>
- </tr>
- <tr>
- <td>places-database-locked</td>
- <td> </td>
- <td>The Places database is currently locked by a third-party process and cannot be opened.</td>
- </tr>
- <tr>
- <td>places-favicons-expired</td>
- <td> </td>
- <td>Sent when all favicons have been expired. </td>
- </tr>
- <tr>
- <td>places-init-complete</td>
- <td> </td>
- <td>The Places database has been successfully initialized. You should wait until this notification occurs before querying the places database.</td>
- </tr>
- <tr>
- <td>places-maintenance-finished</td>
- <td> </td>
- <td>Sent when maintenance of the Places database is complete; this is done periodically in the background to keep the Places database tidy.</td>
- </tr>
- <tr>
- <td>places-shutdown</td>
- <td> </td>
- <td>Sent when Places shuts down. If you are referencing instances of <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/mozIStorageStatement" title="">mozIStorageStatement</a></code> referencing Places databases when this notification occurs, you should call their <code><a href="https://developer.mozilla.org/zh-CN/docs/XPCOM_Interface_Reference/mozIStorageStatement#finalize()">mozIStorageStatement.finalize()</a></code> method </td>
- </tr>
- <tr>
- <td>places-sync-finished</td>
- <td> </td>
- <td>Sent when the Places database has been successfully flushed to disk.</td>
- </tr>
- <tr>
- <td>places-will-close-connection</td>
- <td> </td>
- <td>
- <p>Sent when the Places service is about to close its database connection. Only necessary cleanup tasks should run at this point, and nothing should be added to the database. In addition, after this has been sent, no Places APIs should be called. </p>
-
- <div class="warning"><strong>Warning:</strong> This is for internal use only.</div>
- </td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="Session_Store" name="Session_Store">Session Store</h3>
-
-<p>These topics are used when actions related to Session Store occur.</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th>Topic</th>
- <th>Data</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>sessionstore-state-read</td>
- <td> </td>
- <td>Sent immediately after session store data is read and before it's used. </td>
- </tr>
- <tr>
- <td>sessionstore-state-finalized</td>
- <td> </td>
- <td>Sent immediately after the session is restored.</td>
- </tr>
- <tr>
- <td>sessionstore-state-write</td>
- <td> </td>
- <td>Sent immediately before the session store data is written to disk. </td>
- </tr>
- <tr>
- <td>sessionstore-state-write-complete</td>
- <td> </td>
- <td>Sent immediately after the session store data is written to disk.</td>
- </tr>
- <tr>
- <td>sessionstore-state-purge-complete</td>
- <td> </td>
- <td> </td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="Private_browsing" name="Private_browsing">Private browsing</h3>
-
-<p>These topics indicate when actions related to private browsing occur.</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th>Topic</th>
- <th>Data</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>private-browsing</td>
- <td>enter</td>
- <td>Sent when private browsing mode is activated. </td>
- </tr>
- <tr>
- <td>private-browsing</td>
- <td>exit</td>
- <td>Sent when private browsing mode is deactivated. </td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="Bookmarks" name="Bookmarks">Bookmarks</h3>
-
-<p>These topics indicate when actions related to bookmarks occur.</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th>Topic</th>
- <th>Data</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>bookmarks-restore-begin</td>
- <td>json</td>
- <td>Sent just before bookmarks are restored from JSON. </td>
- </tr>
- <tr>
- <td>bookmarks-restore-begin</td>
- <td>html</td>
- <td>Sent just before bookmarks are restored from HTML. If bookmarks will be restored into a specific folder, observers will be passed an <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupportsPRInt64" title="">nsISupportsPRInt64</a></code> through their subject parameters indicating the ID of the folder. The subject is null otherwise. </td>
- </tr>
- <tr>
- <td>bookmarks-restore-begin</td>
- <td>html-initial</td>
- <td>Sent just before bookmarks are restored from HTML on initial import. If bookmarks are restored into a specific folder, observers will be passed an <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupportsPRInt64" title="">nsISupportsPRInt64</a></code> through their subject parameters indicating the ID of the folder. The subject is null otherwise. </td>
- </tr>
- <tr>
- <td>bookmarks-restore-success</td>
- <td>json</td>
- <td>Sent just after bookmarks are restored from JSON. </td>
- </tr>
- <tr>
- <td>bookmarks-restore-success</td>
- <td>html</td>
- <td>Sent just after bookmarks are restored from HTML. If bookmarks were restored into a specific folder, observers will be passed an <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupportsPRInt64" title="">nsISupportsPRInt64</a></code> through their subject parameters indicating the ID of the folder. The subject is null otherwise. </td>
- </tr>
- <tr>
- <td>bookmarks-restore-success</td>
- <td>html-initial</td>
- <td>Sent just after bookmarks are restored from HTML on initial import. If bookmarks were restored into a specific folder, observers will be passed an <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupportsPRInt64" title="">nsISupportsPRInt64</a></code> through their subject parameters indicating the ID of the folder. The subject is null otherwise. </td>
- </tr>
- <tr>
- <td>bookmarks-restore-failed</td>
- <td>json</td>
- <td>Sent when bookmarks could not be sucessfully restored from JSON. </td>
- </tr>
- <tr>
- <td>bookmarks-restore-failed</td>
- <td>html</td>
- <td>Sent when bookmarks could not be successfully restored from HTML. If bookmarks were to have been restored into a specific folder, observers will be passed an <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupportsPRInt64" title="">nsISupportsPRInt64</a></code> through their subject parameters indicating the ID of the folder. The subject is null otherwise. </td>
- </tr>
- <tr>
- <td>bookmarks-restore-failed</td>
- <td>html-initial</td>
- <td>Sent when bookmarks could not be successfully restored from HTML on intial import. If bookmarks were to have been restored into a specific folder, observers will be passed an <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupportsPRInt64" title="">nsISupportsPRInt64</a></code> through their subject parameters indicating the ID of the folder. The subject is null otherwise. </td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="Themes" name="Themes">Themes</h3>
-
-<p>These topics indicate when actions related to themes occur.</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th>Topic</th>
- <th>Data</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>lightweight-theme-preview-requested </td>
- <td>json</td>
- <td>Sent when the user requests to preview a lightweight theme, but before existing windows are styled with the new theme.</td>
- </tr>
- <tr>
- <td>lightweight-theme-change-requested </td>
- <td>json</td>
- <td>Sent to indicate that the user has chosen a new theme in the add-ons manager, but before the change takes effect.</td>
- </tr>
- <tr>
- <td>lightweight-theme-changed </td>
- <td>-</td>
- <td>Sent after the current theme is changed.</td>
- </tr>
- <tr>
- <td>lightweight-theme-styling-update </td>
- <td>json</td>
- <td>Sent when the current theme being used is changed; this is sent even when the user is previewing a theme, not just when the theme is actually selected.</td>
- </tr>
- <tr>
- <td>lightweight-theme-list-changed </td>
- <td>-</td>
- <td>The list of available lightweight themes has changed.</td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="Developer_tools">Developer tools</h3>
-
-<p>These topics let you know about things that have happened related to Firefox's built-in developer tools.</p>
-
-<p> </p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <th>Topic</th>
- <th>Data</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>highlighter-ready </td>
- <td>-</td>
- <td>
- <p>Sent when the highlighter component is initialized.</p>
-
- <div class="note"><strong>Note:</strong> This is used by the Inspector to detect when it should begin its initialization process.</div>
- </td>
- </tr>
- <tr>
- <td>inspector-closed </td>
- <td>-</td>
- <td>Sent when the Inspector tool is closed.</td>
- </tr>
- <tr>
- <td>inspector-editor-closed </td>
- <td>-</td>
- <td>Sent after the attribute-value editor has been closed.</td>
- </tr>
- <tr>
- <td>inspector-editor-opened </td>
- <td>-</td>
- <td>Sent after the attribute-value editor has been opened and initialized.</td>
- </tr>
- <tr>
- <td>inspector-editor-saved </td>
- <td>-</td>
- <td>Sent when changes have been saved in the attribute-value editor.</td>
- </tr>
- <tr>
- <td>inspector-highlighting </td>
- <td>-</td>
- <td>Sent every time a different node in the page gets highlighted.</td>
- </tr>
- <tr>
- <td>inspector-opened </td>
- <td>-</td>
- <td>Sent after the Inspector tool has finished its initialization.</td>
- </tr>
- <tr>
- <td>inspector-ruleview-ready </td>
- <td>-</td>
- <td>Sent when the inspector's CSS Rule View is opened and initialized.</td>
- </tr>
- <tr>
- <td>inspector-state-restored </td>
- <td>-</td>
- <td>Sent when the Inspector is re-opened after a tab switch.</td>
- </tr>
- <tr>
- <td>inspector-treepanel-ready </td>
- <td>-</td>
- <td>Sent when the Inspector's Tree Panel is opened and initialized.</td>
- </tr>
- <tr>
- <td>inspector-unhighlighting </td>
- <td>-</td>
- <td>Sent every time the highlighter stops highlighting a node.</td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="Telemetry">Telemetry</h3>
-
-<table class="standard-table" style="width: auto;">
- <tbody>
- <tr>
- <td class="header">Topic</td>
- <td class="header">Data</td>
- <td class="header">Description</td>
- </tr>
- <tr>
- <td>gather-telemetry </td>
- <td>-</td>
- <td>Sent by the telemetry service when it's time to start gathering telemetry data, since the telemetry ping is coming soon.</td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="Plugins">Plugins</h3>
-
-<table class="standard-table" style="width: auto;">
- <tbody>
- <tr>
- <td class="header">Topic</td>
- <td class="header">Data</td>
- <td class="header">Description</td>
- </tr>
- <tr>
- <td>plugin-crashed</td>
- <td>-</td>
- <td>Sent when a plugin has crashed.</td>
- </tr>
- </tbody>
-</table>
-
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/glue_classes/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/glue_classes/index.html
deleted file mode 100644
index 92f0a47369..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/glue_classes/index.html
+++ /dev/null
@@ -1,16 +0,0 @@
----
-title: XPCOM glue classes
-slug: Mozilla/Tech/XPCOM/Reference/Glue_classes
-tags:
- - Classes
- - Landing
- - NeedsTranslation
- - TopicStub
- - XPCOM
-translation_of: Mozilla/Tech/XPCOM/Reference/Glue_classes
----
-<p><span class="seoSummary">These "glue" classes are provided to make it easier to use XPCOM from C++ code.</span> When these classes are used by a component, you may need to link the component against the XPCOM glue library.</p>
-<p></p><div class="row topicpage-table">
- <div class="section"><dl><dl><dt></dt></dl></dl></div>
- <div class="section"><dl><dt class="landingPageList"><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Glue_classes/nsCOMPtr">使用nsCOMPtr</a></dt><dd class="landingPageList">这篇文档是对nsCOMPtr的一个总述。如果您所遇到的问题,无法在该文档中找到答案,可能就没有其他文档可以回答它了。您需要求助于XPCOM新闻组或者有nsCOMPtr使用经验的人来求解,或者根据自己的试验获取答案。</dd></dl></div>
- </div><p></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/glue_classes/nscomptr/getting_started_guide/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/glue_classes/nscomptr/getting_started_guide/index.html
deleted file mode 100644
index 32dedcf102..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/glue_classes/nscomptr/getting_started_guide/index.html
+++ /dev/null
@@ -1,478 +0,0 @@
----
-title: 入门指南
-slug: Mozilla/Tech/XPCOM/Reference/Glue_classes/nsCOMPtr/Getting_Started_Guide
-translation_of: Mozilla/Tech/XPCOM/Using_nsCOMPtr/Getting_Started_Guide
----
-<p>下面开始探讨智能指针问题。</p>
-<h3 id="Introduction" name="Introduction">介绍</h3>
-<h4 id="What_is_nsCOMPtr.3F" name="What_is_nsCOMPtr.3F">什么是 <code>nsCOMPtr</code>?</h4>
-<p><code>nsCOMPtr</code> 是防止内存泄漏的一种工具。</p>
-<p><code>nsCOMPtr</code> 是一种智能指针。 它是一个模板类,在使用上类似C/C++中的普通指针。如:可使用*或者-&gt;得到其所指定的内容。<code>nsCOMPtr</code>之所以智能,是因为它不像一般指向XPCOM对象的指针<code>,nsCOMPtr还管理</code><code>AddRef</code>, <code>Release</code>, 和<code>QueryInterface</code>方法。 <code>nsCOMPtr</code>是在以下源文件中定义的:</p>
-<ul>
- <li>{{ Source("xpcom/glue/nsCOMPtr.h", "xpcom/glue/nsCOMPtr.h") }}</li>
- <li>{{ Source("xpcom/glue/nsCOMPtr.cpp", "xpcom/glue/nsCOMPtr.cpp") }}</li>
-</ul>
-<p>...though you probably don't want to look in there, just yet.</p>
-<p><code>利用nsCOMPtr</code>,比使用原始的XPCOM接口指针,能够把代码写的更简短,更清晰,更明白,更安全。</p>
-<h4 id=".5BXP.5DCOM_Basics:_Ownership_and_Reference_Counting" name=".5BXP.5DCOM_Basics:_Ownership_and_Reference_Counting">[XP]COM Basics: Ownership and Reference Counting</h4>
-<p>这段是对XPCOM的一些基本问题的一个复习。对<code>nsCOMPtr</code>s的理解,需要对XPCOM有一个基本的认识。您可通过以下方式对XPCOM进行学习。<a class="external" href="http://www.develop.com/dbox/">Don Box</a>的<a class="external" href="http://www.amazon.com/exec/obidos/ASIN/0201634465">Essential COM</a> 介绍了COM的基本规则和使用。 Don Box 在 <a class="external" href="http://www.amazon.com/exec/obidos/ASIN/0201379686">Effective COM</a>.一书中更详尽的说明了COM的细节,缺陷和易犯的错误。您还需要对C++有基本的了解。这里列举三本比较有用的书:Bjarne Stroustrup 的 <a class="external" href="http://www.amazon.com/exec/obidos/ASIN/0201889544">The C++ Programming Language</a>,Scott Meyers 的 <a class="external" href="http://www.amazon.com/exec/obidos/ASIN/0201924889">Effective C++</a> 和 <a class="external" href="http://www.amazon.com/exec/obidos/ASIN/020163371X">More Effective C++</a>。</p>
-<p>All XPCOM objects are allocated on the heap. Clients don't get to know much about the implementation of any such object. They reference it only through a pointer to an `interface', i.e., the static type of the pointer is a pointer to an abstract base class, the actual object pointed to is a class derived from that abstract base class. The XPCOM object is said to `implement that interface'. The client's reference to the object is typically called `an interface pointer'.</p>
-<p>An object may implement many interfaces. Each interface is (at least conceptually) separately `reference counted'. That is, the interface keeps a count of the number of clients holding references to it. When that count goes to zero, the interface may <code>delete</code> itself. Clients are expected to keep this reference count accurate by incrementing it when they acquire a reference to the interface, and decrementing it before they let go. To facilitate this, all interfaces inherit from an abstract base class that provides the member functions <code>AddRef</code>, and <code>Release</code>.</p>
-<p>A rule of XPCOM is that any function that creates or returns an interface pointer will have already <code>AddRef</code>ed it. The caller can then hold onto the reference indefinitely, calling <code>Release</code> when it no longer needs it. When the last pointer to an interface is <code>Release</code>d, the interface (and consequently, typically the underlying object) will <code>delete</code> itself. As long as there is an outstanding <code>AddRef</code> against the interface, it continues to exist. If you forget to call <code>Release</code>, the object will leak, i.e., the storage for that object will never be reclaimed. Leaks are bad <code><span class="nowiki">:-)</span></code>.</p>
-<p>A reference through which you will call <code>AddRef</code> and <code>Release</code> is called an <strong>owning reference</strong>. It holds a stake in the underlying object. That object cannot go away until the owning reference has relinquished its claim. Not all references need to be owning references. In fact, if two objects somehow end up owning each other (even transitively) it becomes difficult for either of those object to be reclaimed without adding some `out-of-band' mechanism for breaking the ownership cycle. The document <a href="/en/XPCOM_ownership_guidelines" title="en/XPCOM_ownership_guidelines">Some COM Ownership Guidelines</a> provides some hints on when ownership is needed. The following lists are good starting point, but by no means complete.</p>
-<p>You use an owning reference when</p>
-<ul>
- <li>you created the object;</li>
- <li>you got the object from a function that <em>might</em> have created it, e.g., any `getter' function, such as <code>QueryInterface</code>, or <code>CreateInstance</code>. All good getters <code>AddRef</code> the interface pointers they produce, thus providing you with an owning reference;</li>
- <li>you will hold onto the reference longer than the scope of the function in which you acquired it, e.g., you got it as a parameter, but you're hanging onto it in a member variable (see, for example, {{ web.link("#Comparison_1", "Comparison 1") }}, below).</li>
-</ul>
-<p>You don't need an owning reference when</p>
-<ul>
- <li>the object is passed in as a parameter, and you <em>don't</em> need to keep it any longer than the scope of this function;</li>
- <li>the object's lifetime is known to contain yours in some well defined way, e.g., in the nodes of a tree, parent nodes keep owning references to their children, children need not keep owning references to their parents.</li>
-</ul>
-<p>It turns out that reference counting by hand is hard for programmers to get right. It may sound simple, but in practice it's very easy to forget to <code>Release</code> at the appropriate moment. Or to <code>AddRef</code> too many or too few times.</p>
-<h4 id="How_does_nsCOMPtr_help.3F" name="How_does_nsCOMPtr_help.3F">How does <code>nsCOMPtr</code> help?</h4>
-<p><code>nsCOMPtr</code> manages <code>AddRef</code>, <code>Release</code>, and other red-tape for you. An <code>nsCOMPtr</code> looks and acts as much like a raw XPCOM interface pointer as C allows, but it knows it owns the object it points to. This takes a little getting used to on your part, but ends up with less typing, clearer, safer code, and less leaks.</p>
-<p>For instance, here is a typical snippet of code (at its most compact) where you assign a XPCOM interface pointer into a member variable, i.e., the body of a `setter' function, side-by-side using raw XPCOM interface pointers and <code>nsCOMPtr</code>s. </p>
-<p>对照1.设置成员变量。</p>
-<p> </p>
-<table>
- <caption>
-  </caption>
- <tbody>
- <tr>
- <td>
- <pre class="eval">
-<span class="comment">// raw [XP]COM interface pointers...</span>
-<span class="comment">// given: |nsIFoo* mFooPtr;|</span>
-
-<span class="comment"><span class="nowiki">/*
- |AddRef| the new value if it's not
- |NULL|; assign it in; and |Release|
- the old value, if any (so we don't
- leak it).
-
- This order of assignment is special
- and must be used to avoid particular
- ownership bugs.
- */</span></span>
-
-<strong>NS_IF_ADDREF(aFooPtr);
-nsIFoo* temp = mFooPtr;</strong>
-mFooPtr = aFooPtr;
-<strong>NS_IF_RELEASE(temp);</strong>
-</pre>
- </td>
- <td>
- <pre class="eval">
-<span class="comment">// |nsCOMPtr|...</span>
-<span class="comment">// given: |nsCOMPtr&lt;nsIFoo&gt; mFooPtr;|</span>
-
-<span class="comment"><span class="nowiki">/*
- This assignment automatically
- |Release|s the old value in
- |mFooPtr|, if any, and |AddRef|s the
- new one, in the appropriate sequence
- to avoid the ownership bug mentioned
- earlier.
- */</span></span>
-
-
-
-
-
-mFooPtr = aFooPtr;
-
-</pre>
- </td>
- </tr>
- </tbody>
-</table>
-<p>Additionally, the class using raw XPCOM interface pointers will need a destructor to <code>Release</code> <code>mFooPtr</code><span class="nowiki">; and a constructor to ensure that </span><code>mFooPtr</code> is initially set to <code>NULL</code> (or some other reasonable value).</p>
-<p><code>nsCOMPtr</code> helps you write code that is leak-proof, exception safe, and significantly less verbose than you would with raw XPCOM interface pointers. With <code>nsCOMPtr</code>, you may never have to call <code>AddRef</code>, <code>Release</code>, or <code>QueryInterface</code> by hand.</p>
-<p>You still have to understand XPCOM. You still have to know which functions return interface pointers that have already been <code>AddRef</code>ed and which don't. You still have to ensure your program logic doesn't produce circularly referencing garbage. <code>nsCOMPtr</code> is not a panacea. It is, however, helpful, easy to use, well-tested, and polite. It doesn't require that a function author cooperate with you, nor does your use force others to use it.</p>
-<h3 id="Using_nsCOMPtr" name="Using_nsCOMPtr"><span style="font-family: monospace;">使用</span><code>nsCOMPtr</code></h3>
-<h4 id="The_Basics" name="The_Basics">The Basics</h4>
-<p>多数情况下,使用nsCOMPtr和一个一般的XPCOM接口指针是类似的。注意在声明中的细微区别。</p>
-<table>
- <caption>
- 对照 2. 相似点: <code>nsCOMPtr</code>类似于 XPCOM接口指针</caption>
- <tbody>
- <tr>
- <td>
- <pre class="eval">
-<span class="comment">// raw [XP]COM interface pointers...</span>
-
-nsIFoo<strong><span class="nowiki">*</span></strong> fooPtr <strong><span class="nowiki">= 0</span></strong><span class="nowiki">;
- </span><span class="comment">// ...</span>
-fooPtr-&gt;SomeFunction(x, y, z);
-AnotherFunction(fooPtr);
-
-if ( fooPtr )
- <span class="comment">// ...</span>
-
-if ( fooPtr == foo2Ptr )
- <span class="comment">// ...</span>
-</pre>
- </td>
- <td>
- <pre class="eval">
-<span class="comment">// |nsCOMPtr|...</span>
-
-<strong>nsCOMPtr&lt;</strong>nsIFoo<strong>&gt;</strong> fooPtr;
-<span class="comment">// ...</span>
-fooPtr-&gt;SomeFunction(x, y, z);
-AnotherFunction(fooPtr);
-
-if ( fooPtr )
- <span class="comment">// ...</span>
-
-if ( fooPtr == foo2Ptr )
- <span class="comment">// ...</span>
-</pre>
- </td>
- </tr>
- </tbody>
-</table>
-<p> </p>
-<p>有两点主要区别。第一:不需要也不再允许调用<code>AddRef</code> 和 <code>Release</code>方法。 </p>
-<table>
- <caption>
- 对照 3. 不同点: <code>AddRef</code> <span style="font-family: monospace;">和 </span><code>Release</code> 对于 <code>nsCOMPtr</code>s 来说是非法的。</caption>
- <tbody>
- <tr>
- <td>
- <pre class="eval">
-<span class="comment">// raw [XP]COM interface pointers...</span>
-<span class="comment">// given: |nsIFoo* mFooPtr;|</span>
-
- <span class="comment">/*
- Note: this sequence is not the
- correct order to do assign
- raw pointers anyway (see
- {{ Anch("Comparison 1") }}) but I need it
- for this comparison.
- */</span>
-
-NS_IF_RELEASE(mFooPtr);
-
-mFooPtr = aFooPtr;
-NS_IF_ADDREF(mFooPtr);
-
-</pre>
- </td>
- <td>
- <pre class="eval">
-<span class="comment">// |nsCOMPtr|...</span>
-<span class="comment">// given: |nsCOMPtr&lt;nsIFoo&gt; mFooPtr;|</span>
-
- <span class="comment">/*
- You no longer need, nor will the
- compiler let you, call |AddRef|,
- or |Release|.
- */</span>
-
-
-
-<span class="warning">NS_IF_RELEASE(mFooPtr);</span>
- <span class="comment">// Error: |Release| is private</span>
-mFooPtr = aFooPtr;
-<span class="warning">NS_IF_ADDREF(mFooPtr);</span>
- <span class="comment">// Error: |AddRef| is private</span>
-</pre>
- </td>
- </tr>
- </tbody>
-</table>
-<p> </p>
-<p>第二:使用 <a href="/en/Using_nsCOMPtr/Reference_Manual#.60Out.27_Parameters:_getter_AddRefs" title="en/Using_nsCOMPtr/Reference_Manual#.60Out.27_Parameters:_getter_AddRefs"><code>getter_AddRefs</code></a> 标识nsCOMPtr,作为获取指针返回值的函数的参数,而不能只使用<code>nsCOMPtr</code>的地址作为参数。</p>
-<table>
- <caption>
- 对照 4. 不同点: <span style="font-family: monospace;">当 </span><code>nsCOMPtr</code> 作为输出参数时,使用 getter_AddRefs。</caption>
- <tbody>
- <tr>
- <td>
- <pre class="eval">
-<span class="comment">// raw [XP]COM interface pointers...</span>
-
-nsIFoo* foo;
-
-GetFoo(<strong>&amp;</strong>foo);
-</pre>
- </td>
- <td>
- <pre class="eval">
-<span class="comment">// |nsCOMPtr|s...</span>
-
-nsCOMPtr&lt;nsIFoo&gt; foo;
-
-GetFoo(<strong>getter_AddRefs(</strong>foo<strong>)</strong>);
-</pre>
- </td>
- </tr>
- </tbody>
-</table>
-<p> </p>
-<p>以上是对nsCOMPtrS的一些说明,基本涵盖了平日使用的90%。以下是在一些复杂情况下,对其的细节说明。</p>
-<p> </p>
-<h4 id="A_Few_Details" name="A_Few_Details">一些细节</h4>
-<p> </p>
-<p>以下是更多细节让您更了解 <code>nsCOMPtr</code>。</p>
-<p>通常,通过调用 <code>QueryInterface 获取接口指针</code><span style="font-family: monospace;">。</span> <code>QueryInterface</code> 是一个 getter 函数,由以上方法,可通过 <code>getter_AddRefs</code> 方法来获取。</p>
-<table>
- <caption>
- The hard way to <code>QueryInterface</code> into an <code>nsCOMPtr</code>.</caption>
- <tbody>
- <tr>
- <td>
- <pre class="eval">
-<span class="comment">// A way (though not the best way) to |QueryInterface| into an |nsCOMPtr|...</span>
-
-nsCOMPtr&lt;nsIFoo&gt; foo;
-
-nsresult rv = bar-&gt;QueryInterface(NS_GET_IID(nsIFoo), getter_AddRefs(foo));
-
- <span class="comment">// Or, if you're a savvy [XP]COM programmer,</span>
- <span class="comment">// you use the type-safe version...</span>
-nsresult rv = CallQueryInterface(bar, getter_AddRefs(foo));
-</pre>
- </td>
- </tr>
- </tbody>
-</table>
-<p><code>因为 QueryInterface</code> 使用频繁,<code>nsCOMPtr</code> 提供了一种特殊方式对其调用。这种方式是类型安全的,<code>QueryInterface的返回值能</code>直接构造nsCOMPtr。这种构造方式比通过赋值进行构造效率更高。这种方式是 <a href="/en/Using_nsCOMPtr/Reference_Manual#nsCOMPtr.3CT.3E_.3D_do_QueryInterface.28_nsISupports.2A_.29.2CnsCOMPtr.3CT.3E_.3D_do_QueryInterface.28_nsISupports.2A.2C_nsresult.2A_.29" title="en/Using_nsCOMPtr/Reference_Manual#nsCOMPtr.3CT.3E_.3D_do_QueryInterface.28_nsISupports.2A_.29.2CnsCOMPtr.3CT.3E_.3D_do_QueryInterface.28_nsISupports.2A.2C_nsresult.2A_.29"><code>do_QueryInterface</code></a> 。通过使用这种方式,以上例子可写为:</p>
-<table>
- <caption>
- How to <code>QueryInterface</code> into an <code>nsCOMPtr</code>.</caption>
- <tbody>
- <tr>
- <td>
- <pre class="eval">
-<span class="comment">// The best way to |QueryInterface| into an |nsCOMPtr|...</span>
-
-nsresult rv;
-nsCOMPtr&lt;nsIFoo&gt; foo( <strong>do_QueryInterface(</strong>bar, &amp;rv<strong>)</strong> );
-
- <span class="comment">// Or, if you don't care about the |nsresult|</span>
-nsCOMPtr&lt;nsIFoo&gt; foo( <strong>do_QueryInterface(</strong>bar<strong>)</strong> );
-</pre>
- </td>
- </tr>
- </tbody>
-</table>
-<p><code>nsCOMPtr</code> happily calls <code>AddRef</code> and <code>Release</code> implicitly. This same favor is <em>not</em> extended to <code>QueryInterface</code>. <code>nsCOMPtr</code> does not <code>QueryInterface</code> on assignment without your explicit permission in the form of the <code>do_QueryInterface</code> directive. You need never worry about hidden queries. However, be aware that if you <em>should</em> have queried but didn't, e.g., when assigning in a raw pointer where C allows the assignment, but XPCOM wouldn't, <code>nsCOMPtr</code> will <a href="/en/Using_nsCOMPtr/Reference_Manual#Type_Safeguards" title="en/Using_nsCOMPtr/Reference_Manual#Type_Safeguards">assert at runtime</a>. Use <code>do_QueryInterface</code> whenever you assign in a pointer to a XPCOM interface of a different type, even if that type happens to derive from the base type of the <code>nsCOMPtr</code></p>
-<p> </p>
-<table>
- <caption>
- 对照6. <code>do_QueryInterface</code> 避免了XPCOM 中的类型错误。</caption>
- <tbody>
- <tr>
- <td>
- <pre class="eval">
-class nsIBar
-  : public nsIFoo ... { ... };
-
-nsIBar* p = ...;
-
- <span class="comment">// C thinks every |nsIBar*| is an</span>
- <span class="comment">// |nsIFoo*|, therefore, C allows</span>
- <span class="comment">// this...</span>
-nsCOMPtr&lt;nsIFoo&gt; <span class="warning">foo = p;</span>
- <span class="comment">// ...even though it is an [XP]COM</span>
- <span class="comment">// type error</span>
-</pre>
- </td>
- <td>
- <pre class="eval">
-class nsIBar
-  : public nsIFoo ... { ... };
-
-nsIBar* p = ...;
-
-
-
- <span class="comment">// No type error here...</span>
-nsCOMPtr&lt;nsIFoo&gt; foo( <strong>do_QueryInterface(</strong>p<strong>)</strong> );
-
-
-</pre>
- </td>
- </tr>
- </tbody>
-</table>
-<p>Remember, the C type system and the XPCOM type system are really two independent things. Because XPCOM interfaces are expressed as abstract C base classes, you may be tempted to let C handle the differences, or to use C casts to navigate between interface types. This is wrong. The only sanctioned way to get between XPCOM types is with <code>QueryInterface</code>. In the example above, there is no reason to assume that the <code>nsIFoo*</code> C pulls out of <code>p</code> would be the same one that <code>p-&gt;QueryInterface()</code> would return.</p>
-<p><a href="/en/Using_nsCOMPtr/Reference_Manual#nsCOMPtr.3CT.3E_.3D_dont_AddRef.28_T.2A_.29.2CnsCOMPtr.3CT.3E_.3D_getter_AddRefs.28_T.2A_.29" title="en/Using_nsCOMPtr/Reference_Manual#nsCOMPtr.3CT.3E_.3D_dont_AddRef.28_T.2A_.29.2CnsCOMPtr.3CT.3E_.3D_getter_AddRefs.28_T.2A_.29"><code>dont_AddRef</code></a> is a similar directive that helps you when you assign in a pointer that has already been <code>AddRef</code>ed, e.g., because you called a getter that returned the pointer as its function result.</p>
-<table>
- <caption>
- Using <code>dont_AddRef</code>.</caption>
- <tbody>
- <tr>
- <td>
- <pre class="eval">
-nsCOMPtr&lt;nsIFoo&gt; foo( <strong>dont_AddRef(</strong>CreateFoo()<strong>)</strong> );
- <span class="comment">// |CreateFoo| |AddRef|s its result, as all good getters do</span>
-</pre>
- </td>
- </tr>
- </tbody>
-</table>
-<h4 id="Something_nsCOMPtr_Doesn.27t_Do" name="Something_nsCOMPtr_Doesn.27t_Do">Something <code>nsCOMPtr</code> <em>Doesn't</em> Do</h4>
-<p>An <code>nsCOMPtr</code> does all that is necessary to behave as an owning reference. A given <code>nsCOMPtr</code> does not, however, cooperate in making <em>other</em> owning pointers. After learning how <code>nsCOMPtr</code> automatically <code>AddRef</code>s a pointer as it is being assigned <em>in</em>, the natural assumption is that it does the same thing when assigning <em>out</em>. Here is a snippet of code that demonstrates this misconception.</p>
-<table>
- <tbody>
- <tr>
- <td>
- <pre class="eval">
-<span class="comment">// Incorrect assumptions about |nsCOMPtr|...</span>
-
-nsresult
-nsCacheRecord::GetFileSpec( nsIFileSpec** aFileSpecResult )
- <span class="comment">/*
- ...fills in the callers |nsFileSpec*| (which the caller supplied
- the address of) with a copy of my member variable |mFileSpec|,
- an |nsCOMPtr|. I.e., this function is a `getter'.
-
- Remember: good [XP]COM getters always |AddRef| their result.
- */</span>
- {
- <span class="comment">// ...</span>
- *aFileSpec = mFileSpec;
- <span class="warning"><span class="comment">// the |nsCOMPtr| should take care of the refcount here, right?</span></span>
- return NS_OK;
- }
-</pre>
- </td>
- </tr>
- </tbody>
-</table>
-<p>Plainly, the author believed (though perhaps with some question) that the <code>nsCOMPtr</code>, <code>mFileSpec</code>, would <code>AddRef</code> automatically as it was assigned into <code><span class="nowiki">*aFileSpec</span></code>. This is <em>not</em> the case. An <code>nsCOMPtr</code> automatically calls <code>AddRef</code> and <code>Release</code> (only) on its <em>own</em> behalf. In all other situations, it is designed to be a drop in replacement for a raw XPCOM pointer. Where ever an <code>nsCOMPtr</code> is used in a situation where a raw pointer is needed, the <code>nsCOMPtr</code> automatically provides one.</p>
-<table>
- <tbody>
- <tr>
- <td>
- <pre class="eval">
-<span class="comment">// |nsCOMPtr| produces a raw pointer when needed...</span>
-
-nsCOMPtr&lt;nsIFoo&gt; foo = ...;
-
- <span class="comment">// 1. Assigning into a raw pointer</span>
-nsIFoo* raw_foo = foo;
-
- <span class="comment">// 2. Assigning into another |nsCOMPtr|</span>
-nsCOMPtr&lt;nsIFoo&gt; foo2 = foo;
-
- <span class="comment">// 3. As a parameter</span>
-SetFoo(foo);
-
- <span class="comment">// 4. Testing the value in an |if| expression</span>
- <span class="comment">// 5. Calling a member function</span>
-if ( foo )
- foo-&gt;DoSomething();
-</pre>
- </td>
- </tr>
- </tbody>
-</table>
-<p>In all of these cases, pretty much the exact same code is executed (case 2 is slightly different, but the intent is the same). In each case, you are essentially extracting the raw pointer value for your own purpose. If the <code>nsCOMPtr</code> <code>AddRef</code>ed the value each time you did that, cases 4 and 5 would obviously always generate leaks. <code>SetFoo</code>, from case 3, would have to be written two different ways when given an <code>nsCOMPtr</code>, it would know the value was already <code>AddRef</code>ed, and when given a raw pointer it would assume the value was not <code>AddRef</code>ed. Actually the contradictions run deeper than that. All these cases show that automatically <code>AddRef</code>ing on `output' makes <code>nsCOMPtr</code>s and raw-pointers act differently from the point of view of the clients. The goal is to make them act the same so that <code>nsCOMPtr</code>s can be a drop in replacement (modulo managing its own `ownership').</p>
-<p>Given what you now know, the rule is predictable. As described above, and unless you tell it otherwise, an <code>nsCOMPtr</code> <code>AddRef</code>s when you assign <em>in</em> to it. It does nothing when you assign <em>out</em> of it.</p>
-<h4 id="Where_should_I_use_nsCOMPtrs.3F" name="Where_should_I_use_nsCOMPtrs.3F">Where should I use <code>nsCOMPtr</code>s?</h4>
-<p>You should use an <code>nsCOMPtr</code> any place you use an interface pointer as an owning reference, i.e., where you call <code>AddRef</code> and <code>Release</code> on it. You should use <code>nsCOMPtr</code> as a member variable, where it will simplify setters, and eliminate constructors, destructors, and assignment operators. You should use <code>nsCOMPtr</code> on the stack, where it makes calling <code>QueryInterface</code> almost pleasant, and eliminates the complex logic that falls out of error handling.</p>
-<h4 id="Where_shouldn.27t_I_use_nsCOMPtrs.3F" name="Where_shouldn.27t_I_use_nsCOMPtrs.3F">Where shouldn't I use <code>nsCOMPtr</code>s?</h4>
-<p>Don't use <code>nsCOMPtr</code>s where you don't need an owning reference. See <a href="/en/XPCOM_ownership_guidelines" title="en/XPCOM_ownership_guidelines">Some COM Ownership Guidelines</a>. <code>nsCOMPtr</code> is designed to be used with XPCOM interfaces, so don't use it with non-interfaces with specific exceptions described <a href="/en/Using_nsCOMPtr/Getting_Started_Guide#nsCOMPtrs_for_non-interface_classes" title="en/Using_nsCOMPtr/Getting_Started_Guide#nsCOMPtrs_for_non-interface_classes">below</a>. Don't use <code>nsCOMPtr</code>s in XPCOM interfaces. Don't use them in plain old C code; <code>nsCOMPtr</code>s are, of course, a C only construct. <a href="/en/Using_nsCOMPtr/Reference_Manual#Casting" title="en/Using_nsCOMPtr/Reference_Manual#Casting">Never cast</a> an <code>nsCOMPtr</code>, it's almost guaranteed to leak.</p>
-<h4 id="nsCOMPtrs_for_non-interface_classes" name="nsCOMPtrs_for_non-interface_classes"><code>nsCOMPtr</code>s for non-interface classes</h4>
-<p>Appropriately formatted answer to come, in the meanwhile, the full details are available in <a class="link-news" href="news://news.mozilla.org/scc-3E1526.12182423042001@h-204-29-187-152.netscape.com">this news posting</a> (<a class="external" href="http://groups.google.com/group/netscape.public.mozilla.xpcom/browse_frm/thread/77258f1cd7d99773/268b949066f2ba4a?hl=de&amp;q=#268b949066f2ba4a" title="http://groups.google.com/group/netscape.public.mozilla.xpcom/browse_frm/thread/77258f1cd7d99773/268b949066f2ba4a?hl=de&amp;q=#268b949066f2ba4a">via Google Groups</a>).</p>
-<h4 id="nsCOMPtrs_in_function_signatures" name="nsCOMPtrs_in_function_signatures"><code>nsCOMPtr</code>s in function signatures</h4>
-<p>In general, you won't want to use <code>nsCOMPtr</code> in the signature of XPCOM (i.e., `scriptable') functions. <code>nsCOMPtr</code> is not currently directly supported by IDL. However, you may sometime be tempted to use an <code>nsCOMPtr</code> in a non-scriptable function.</p>
-<h5 id="nsCOMPtr.3CT.3E_f.28.29_don.27t_return_an_nsCOMPtr" name="nsCOMPtr.3CT.3E_f.28.29_don.27t_return_an_nsCOMPtr"><span class="warning"><code>nsCOMPtr&lt;T&gt; f()</code></span> 不返回 <code>nsCOMPtr</code></h5>
-<p>This practice is dangerous. Returning an <code>AddRef</code>ed pointer in almost any form as a function result leads to several potential errors, some of which are leaks, some of which are dangling pointers. Returning an <code>nsCOMPtr</code> may seem like a good idea (since it tells clients you are giving them ownership), however it can be the cause of an dangling pointer. Consider:</p>
-<table>
- <tbody>
- <tr>
- <td>
- <pre class="eval">
-<span class="comment">// Don't return |nsCOMPtr|s...</span>
-nsCOMPtr&lt;nsIFoo&gt; CreateFoo();
-<span class="comment">// ...</span>
-
-<span class="warning">nsIFoo* myFoo = CreateFoo();</span> <span class="comment">// Oops: |myFoo| now dangles!</span>
- <span class="comment">// |CreateFoo| returns an |nsCOMPtr|, which</span>
- <span class="comment">// automatically |Release|s right after this</span>
- <span class="comment">// assignment. Now |myFoo| refers to a</span>
- <span class="comment">// deleted object.</span>
-</pre>
- </td>
- </tr>
- </tbody>
-</table>
-<p>You can tell callers you are giving them ownership in a way that doesn't pose this hazard by returning a <code>already_AddRefed&lt;T&gt;</code> (see bug <a class="external" href="http://bugzilla.mozilla.org/show_bug.cgi?id=59212"><span class="nowiki">#59212</span></a>). An <code>nsCOMPtr</code> knows not to <code>AddRef</code> a value that is <code>already_AddRefed</code>.</p>
-<table>
- <tbody>
- <tr>
- <td>
- <pre class="eval">
-<span class="comment">// Preferred form: if you must return a pointer, use |already_AddRefed|...</span>
-already_AddRefed&lt;nsIFoo&gt; CreateFoo();
-<span class="comment">// ...</span>
-
-nsIFoo* myFoo1 = CreateFoo(); <span class="comment">// doesn't dangle</span>
-nsCOMPtr&lt;nsIFoo&gt; myFoo2( CreateFoo() ); <span class="comment">// doesn't leak</span>
-nsCOMPtr&lt;nsIFoo&gt; myFoo3( dont_AddRef(CreateFoo()) ); <span class="comment">// redundant, but legal and correct</span>
-</pre>
- </td>
- </tr>
- </tbody>
-</table>
-<p>Compare this to the most frequent leaks caused by returning a raw pointer you have already <code>AddRef</code>ed:</p>
-<table>
- <tbody>
- <tr>
- <td>
- <pre class="eval">
-<span class="comment">// Don't return raw pointers; that incites leaks...</span>
-nsIFoo* CreateFoo(); <span class="comment">// returns an |AddRef|ed pointer</span>
-<span class="comment">// ...</span>
-
-<span class="warning">nsCOMPtr&lt;nsIFoo&gt; myFoo = CreateFoo();</span> <span class="comment">// Oops: leak;</span>
-nsCOMPtr&lt;nsIFoo&gt; myFoo( <span class="notice">dont_AddRef(</span>CreateFoo()<span class="notice">)</span> );
- <span class="comment">// Since |CreateFoo| already |AddRef|s its result, we must remind</span>
- <span class="comment">// our |nsCOMPtr| not to. It's easy to forget. Prevent it in advance</span>
- <span class="comment">// by not returning pointers as function results, or else by returning</span>
- <span class="comment">// an |already_AddRefed&lt;T&gt;| as above.</span>
-</pre>
- </td>
- </tr>
- </tbody>
-</table>
-<h5 id="void_f.28_nsCOMPtr.3CT.3E_.29_don.27t_pass_an_nsCOMPtr_by_value" name="void_f.28_nsCOMPtr.3CT.3E_.29_don.27t_pass_an_nsCOMPtr_by_value"><span class="warning"><code>void f( nsCOMPtr&lt;T&gt; )</code></span> don't pass an <code>nsCOMPtr</code> by value</h5>
-<p>This practice is wasteful, but not otherwise harmful. There is no need to <code>AddRef</code> parameters, as they are guaranteed to live as long as the function call. You only need to <code>AddRef</code> them as you store them in a structure that will live longer than the function call. Which means the appropriate member of that structure should be an <code>nsCOMPtr</code>, not the function parameter. Additionally, this signature may confuse callers into thinking they need an <code>nsCOMPtr</code> just to call the function.</p>
-<h5 id="void_f.28_const_nsCOMPtr.3CT.3E&amp;_.29_don.27t_pass_an_nsCOMPtr_by_const_reference" name="void_f.28_const_nsCOMPtr.3CT.3E&amp;_.29_don.27t_pass_an_nsCOMPtr_by_const_reference"><span class="warning"><code>void f( const nsCOMPtr&lt;T&gt;&amp; )</code></span> don't pass an <code>nsCOMPtr</code> by <code>const</code> reference</h5>
-<p>Exactly as the signature above, this practice is wasteful, but not otherwise harmful, and has the same impact as passing an <code>nsCOMPtr</code> by value if the caller only supplied a raw pointer.</p>
-<h5 id="void_f.28_nsCOMPtr.3CT.3E.2A_.29_avoid_passing_an_nsCOMPtr_by_address.2C_if_possible" name="void_f.28_nsCOMPtr.3CT.3E.2A_.29_avoid_passing_an_nsCOMPtr_by_address.2C_if_possible"><span class="warning"><code>void f( nsCOMPtr&lt;T&gt;* )</code></span> avoid passing an <code>nsCOMPtr</code> by address, if possible</h5>
-<p>This practice requires callers to have an <code>nsCOMPtr</code>, and requires them to do a little extra work, as <code>operator&amp;</code> for <code>nsCOMPtr</code>s is <code>private</code> (to help prevent <a href="/en/Using_nsCOMPtr/Reference_Manual#Casting" title="en/Using_nsCOMPtr/Reference_Manual#Casting">leaks caused by casting</a>; also see {{ Bug(59414) }}). This is an acceptable way to declare `in/out' parameters, but prefer passing <code>nsCOMPtr</code>s by reference, as below.</p>
-<table>
- <tbody>
- <tr>
- <td>
- <pre class="eval">
-<span class="comment">// Passing an |nsCOMPtr| by pointer requires extra work...</span>
-void f( nsCOMPtr&lt;nsIFoo&gt;* );
-<span class="comment">// ...</span>
-
-nsCOMPtr&lt;nsIFoo&gt; myFoo = ...;
-
-f( <span class="notice">address_of(</span>myFoo<span class="notice">)</span> );
-</pre>
- </td>
- </tr>
- </tbody>
-</table>
-<h5 id="void_f.28_nsCOMPtr.3CT.3E&amp;_.29_do_pass_an_nsCOMPtr_by_reference_for_.60in.2Fout.27_parameters" name="void_f.28_nsCOMPtr.3CT.3E&amp;_.29_do_pass_an_nsCOMPtr_by_reference_for_.60in.2Fout.27_parameters"><code>void f( nsCOMPtr&lt;T&gt;&amp; )</code> do pass an <code>nsCOMPtr</code> by reference for `in/out' parameters</h5>
-<p>This is the prefered scheme for providing `in/out' parameters. If you were to use a raw pointer instead, your function couldn't know what ownership relationship the caller had to the input value, and hence, couldn't know whether to <code>Release</code> it or not before assigning in the new value. By declaring the parameter as an <code>nsCOMPtr&amp;</code>, the relationship is explicit.</p>
-<h3 id="Summary" name="Summary">Summary</h3>
-<p>An <code>nsCOMPtr</code> is an owning reference. Whatever it points to has been <code>AddRef</code>ed, counting the <code>nsCOMPtr</code> as one of its `owners'. An <code>nsCOMPtr</code> always calls <code>Release</code> before letting go, whether the <code>nsCOMPtr</code> is letting go so that it can point to a different object, or because the <code>nsCOMPtr</code> is going out of scope. Any time a new value is assigned into an <code>nsCOMPtr</code>, the <code>nsCOMPtr</code> automatically always <code>Release</code>s its old referent, if any, and (unless you tell it you already have) <code>AddRef</code>s the new.</p>
-<p>You use an <code>nsCOMPtr</code> exactly as you would a raw XPCOM interface pointer in almost all cases. You won't have to explictly call <code>AddRef</code> or <code>Release</code> through it, nor will the compiler allow it. The only place you can't use an <code>nsCOMPtr</code> without change is where a raw XPCOM interface pointer is an `out' parameter. In this case, you wrap the <code>nsCOMPtr</code> with <a href="/en/Using_nsCOMPtr/Reference_Manual#.60Out.27_Parameters:_getter_AddRefs" title="en/Using_nsCOMPtr/Reference_Manual#.60Out.27_Parameters:_getter_AddRefs"><code>getter_AddRefs</code></a> (see {{ web.link("#Comparison_4", "Comparison 4") }}).</p>
-<p>When assigning into an <code>nsCOMPtr</code>, you will usually just supply another pointer (either a raw XPCOM interface pointer or an <code>nsCOMPtr</code>), with no additional directives { web.link("#Comparison_1", "Comparison 1") }}). As stated above, with no directives, the <code>nsCOMPtr</code> will <code>Release</code> its old referent, if any, and <code>AddRef</code> the new. This is appropriate when the thing you're assigning in hasn't yet been <code>AddRef</code>ed to account for the new reference. This is typically the case when you are assigning in a pointer that you <em>didn't</em> call a function to get, e.g., one that was passed in as a parameter, or that you pulled out of a structure.</p>
-<p>You can tell <code>nsCOMPtr</code> it doesn't need to <code>AddRef</code> the new value on assignment by wrapping the new value in <a href="/en/Using_nsCOMPtr/Reference_Manual#nsCOMPtr.3CT.3E_.3D_dont_AddRef.28_T.2A_.29.2CnsCOMPtr.3CT.3E_.3D_getter_AddRefs.28_T.2A_.29" title="en/Using_nsCOMPtr/Reference_Manual#nsCOMPtr.3CT.3E_.3D_dont_AddRef.28_T.2A_.29.2CnsCOMPtr.3CT.3E_.3D_getter_AddRefs.28_T.2A_.29"><code>dont_AddRef</code></a>. Do this, for example, when you got the new value from a function which, like all good XPCOM getters, already called <code>AddRef</code> on your behalf.</p>
-<p>You may not assign in a pointer to a different interface type; you must first query it to the right type (see, e.g., {{ web.link("#Comparison_6", "Comparison 6") }} and the surrounding discussion). <code>nsCOMPtr</code> <em>never</em> calls <code>QueryInterface</code> implicitly, i.e., you must call it yourself, or explictly ask <code>nsCOMPtr</code> to call it with <a href="/en/Using_nsCOMPtr/Reference_Manual#nsCOMPtr.3CT.3E_.3D_do_QueryInterface.28_nsISupports.2A_.29.2CnsCOMPtr.3CT.3E_.3D_do_QueryInterface.28_nsISupports.2A.2C_nsresult.2A_.29" title="en/Using_nsCOMPtr/Reference_Manual#nsCOMPtr.3CT.3E_.3D_do_QueryInterface.28_nsISupports.2A_.29.2CnsCOMPtr.3CT.3E_.3D_do_QueryInterface.28_nsISupports.2A.2C_nsresult.2A_.29"><code>do_QueryInterface</code></a>. The <code>do_QueryInterface</code> directive allows you to do the query as part of the assignment. This better facilitates constructing an <code>nsCOMPtr</code> directly from the right value, rather than constructing it and assigning in the correct value later. Construction alone is more efficient than construction followed by assignment. Prefer construction over assignment whereever reasonable. Be careful not to apply <code>do_QueryInterface</code> to a function returning an <code>AddRef</code>ed pointer [see <a href="/en/Using_nsCOMPtr/Reference_Manual#nsCOMPtr.3CT.3E_.3D_.2F.2A_call_QueryInterface_but_don.27t_AddRef_.2A.2F" title="en/Using_nsCOMPtr/Reference_Manual#nsCOMPtr.3CT.3E_.3D_.2F.2A_call_QueryInterface_but_don.27t_AddRef_.2A.2F">this short section</a> for an explanation]</p>
-<p>For more details, continue on to the <a href="/en/Using_nsCOMPtr/Reference_Manual" title="en/Using_nsCOMPtr/Reference_Manual">Reference Manual</a>.</p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/glue_classes/nscomptr/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/glue_classes/nscomptr/index.html
deleted file mode 100644
index d9c427784a..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/glue_classes/nscomptr/index.html
+++ /dev/null
@@ -1,56 +0,0 @@
----
-title: 使用nsCOMPtr
-slug: Mozilla/Tech/XPCOM/Reference/Glue_classes/nsCOMPtr
-translation_of: Mozilla/Tech/XPCOM/Reference/Glue_classes/nsCOMPtr
----
-<p>这篇文档是对nsCOMPtr的一个总述。如果您所遇到的问题,无法在该文档中找到答案,可能就没有其他文档可以回答它了。您需要求助于XPCOM新闻组或者有nsCOMPtr使用经验的人来求解,或者根据自己的试验获取答案。</p>
-
-<p>如果您尚未使用过nsCOMPtr,您正好可从这里开始。当您使用了一段时间后,或者遇到了不熟悉的领域,或者出现编译错误,您可返回该文档,在参考手册或者FAQ中求助。</p>
-
-<h2 id="Contents" name="Contents">内容</h2>
-
-<ol>
- <li><a href="/en/Using_nsCOMPtr/Status,_Recent_Changes,_and_Plans" title="en/Using_nsCOMPtr/Status,_Recent_Changes,_and_Plans">状态,最新修改和计划</a>
-
- <ol>
- <li><a href="/en/Using_nsCOMPtr/Status,_Recent_Changes,_and_Plans#Recent_changes_to_nsCOMPtr" title="en/Using_nsCOMPtr/Status,_Recent_Changes,_and_Plans#Recent_changes_to_nsCOMPtr"><span style="font-family: monospace;">对</span><code>nsCOMPtr的最新修改</code></a></li>
- </ol>
- </li>
- <li><a href="/en/Using_nsCOMPtr/Getting_Started_Guide" title="en/Using_nsCOMPtr/Getting_Started_Guide">入门指南</a>
- <ol>
- <li><a href="/en/Using_nsCOMPtr/Getting_Started_Guide#Introduction" title="en/Using_nsCOMPtr/Getting_Started_Guide#Introduction">介绍</a></li>
- <li><a href="/en/Using_nsCOMPtr/Getting_Started_Guide#Using_nsCOMPtr" title="en/Using_nsCOMPtr/Getting_Started_Guide#Using_nsCOMPtr">使用 <code>nsCOMPtr</code></a></li>
- <li><a href="/en/Using_nsCOMPtr/Getting_Started_Guide#Summary" title="en/Using_nsCOMPtr/Getting_Started_Guide#Summary">小结</a></li>
- </ol>
- </li>
- <li><a href="/en/Using_nsCOMPtr/Reference_Manual" title="en/Using_nsCOMPtr/Reference_Manual">参考手册</a>
- <ol>
- <li><a href="/en/Using_nsCOMPtr/Reference_Manual#The_Basics" title="en/Using_nsCOMPtr/Reference_Manual#The_Basics">基本原理</a></li>
- <li><a href="/en/Using_nsCOMPtr/Reference_Manual#Initialization_and_Assignment" title="en/Using_nsCOMPtr/Reference_Manual#Initialization_and_Assignment">初始化和赋值</a></li>
- <li><a href="/en/Using_nsCOMPtr/Reference_Manual#Using_an_nsCOMPtr.3CT.3E_as_a_T.2A" title="en/Using_nsCOMPtr/Reference_Manual#Using_an_nsCOMPtr.3CT.3E_as_a_T.2A">Using an <code>nsCOMPtr&lt;T&gt;</code> as a <code>T*</code></a></li>
- <li><a href="/en/Using_nsCOMPtr/Reference_Manual#Efficiency_and_Correctness" title="en/Using_nsCOMPtr/Reference_Manual#Efficiency_and_Correctness">Efficiency and Correctness</a></li>
- <li><a href="/en/Using_nsCOMPtr/Reference_Manual#Compiler_Annoyances" title="en/Using_nsCOMPtr/Reference_Manual#Compiler_Annoyances">Compiler Annoyances</a></li>
- </ol>
- </li>
- <li><a href="/en/Using_nsCOMPtr/Frequently_Asked_Questions" title="en/Using_nsCOMPtr/Frequently_Asked_Questions">FAQ</a>
- <ol>
- <li><a href="/en/Using_nsCOMPtr/Frequently_Asked_Questions#Buildtime_Errors" title="en/Using_nsCOMPtr/Frequently_Asked_Questions#Buildtime_Errors">编译时错误</a></li>
- <li><a href="/en/Using_nsCOMPtr/Frequently_Asked_Questions#Runtime_Errors" title="en/Using_nsCOMPtr/Frequently_Asked_Questions#Runtime_Errors">运行时错误</a></li>
- <li><a href="/en/Using_nsCOMPtr/Frequently_Asked_Questions#How_do_I..." title="en/Using_nsCOMPtr/Frequently_Asked_Questions#How_do_I...">How do I...</a></li>
- <li><a href="/en/Using_nsCOMPtr/Frequently_Asked_Questions#General" title="en/Using_nsCOMPtr/Frequently_Asked_Questions#General">General</a></li>
- <li><a href="/en/Using_nsCOMPtr/Frequently_Asked_Questions#Bibliography" title="en/Using_nsCOMPtr/Frequently_Asked_Questions#Bibliography">Bibliography</a></li>
- </ol>
- </li>
-</ol>
-
-<div class="originaldocinfo">
-<h2 id="Original_Document_Information" name="Original_Document_Information">Original Document Information</h2>
-
-<ul>
- <li>Author(s): <a class="link-mailto" href="mailto:scc@mozilla.org">Scott Collins</a></li>
- <li>Last Updated Date: December 11, 2001</li>
- <li>Copyright Information: Copyright © 1999, 2000 by the Mozilla organization; use is subject to the <a class="external" href="http://www.mozilla.org/MPL/">MPL</a>. Portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a Creative Commons license | <a class="external" href="http://www.mozilla.org/foundation/licensing/website-content.html">Details</a>.</li>
-</ul>
-</div>
-
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/index.html
deleted file mode 100644
index 188a822ae6..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/index.html
+++ /dev/null
@@ -1,14 +0,0 @@
----
-title: XPCOM reference
-slug: Mozilla/Tech/XPCOM/Reference
-translation_of: Mozilla/Tech/XPCOM/Reference
----
-<p>This reference describes the interfaces and functions provided by the <a href="/en-US/docs/Mozilla/Tech/XPCOM">XPCOM</a> library. In addition, it details the various helper classes and functions, as well as the components, provided by the <a href="/en-US/docs/Mozilla/Tech/XPCOM/Glue">XPCOM glue</a> library. The contents herein are oriented primarily toward extension developers and people embedding XPCOM in other projects.</p>
-<div class="note">
- <p><strong>Note:</strong> If you're working on a module in the Mozilla codebase that's compiled with the <code>MOZILLA_INTERNAL_API</code> flag set, some of these APIs -- the string functions and classes in particular -- are not the ones you should be using. See the <a href="/en-US/docs/Mozilla/Tech/XPCOM/Guide/Internal_strings">XPCOM internal string guide</a> for documentation of the internal string API used within the Mozilla codebase.</p>
-</div>
-<p></p><div class="row topicpage-table">
- <div class="section"><dl><dl><dt class="landingPageList"><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Glue_classes">XPCOM glue classes</a></dt><dd class="landingPageList">These "glue" classes are provided to make it easier to use XPCOM from C++ code.</dd><dt class="landingPageList"><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface">XPCOM Interface Reference</a></dt><dd class="landingPageList"><span class="long_text short_text" id="result_box" lang="zh-CN"><span>这是一个</span><span>由</span><span>Mozilla平台</span><span>提供</span><span>的</span><span>XPCOM接口</span><span>的</span><span>参考</span></span>.</dd></dl></dl></div>
- <div class="section"><dl><dt></dt></dl></div>
- </div><p></p>
-<p>Many XPCOM pages return an <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Core_functions/nsresult">nsresult</a></code>. Prior to Gecko 19 (Firefox 19 / Thunderbird 19 / SeaMonkey 2.16), this was an integer that simply returned an error code. It is now a strongly typed <code>enum</code> when XPCOM is built using a C++11 compiler. This causes compile-time errors to occur when improper values are returned as nsresult values, thereby making it easier to catch many bugs.</p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/interface/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/interface/index.html
deleted file mode 100644
index da50238f6f..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/interface/index.html
+++ /dev/null
@@ -1,11 +0,0 @@
----
-title: XPCOM Interface Reference
-slug: Mozilla/Tech/XPCOM/Reference/Interface
-translation_of: Mozilla/Tech/XPCOM/Reference/Interface
----
-<p><span class="long_text short_text" id="result_box" lang="zh-CN"><span>这是一个</span><span>由</span><span>Mozilla平台</span><span>提供</span><span>的</span><span>XPCOM接口</span><span>的</span><span>参考</span></span>.</p>
-<div style=""><ul><li><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIAccessibleProvider">nsIAccessibleProvider</a></li><li><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIClipboard">nsIClipboard</a></li><li><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIClipboardHelper">nsIClipboardHelper</a></li><li><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIConsoleService">nsIConsoleService</a></li><li><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMClientRect">nsIDOMClientRect</a></li><li><a href="/zh-CN/docs/nsIDOMParser">nsIDOMParser</a></li><li><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDirectoryServiceProvider">nsIDirectoryServiceProvider</a></li><li><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFile">nsIFile</a></li><li><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFilePicker">nsIFilePicker</a></li><li><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIHttpChannel">nsIHttpChannel</a></li><li><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIIdleService">nsIIdleService</a></li><li><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsILocalFile">nsILocalFile</a></li><li><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIProcess">nsIProcess</a></li><li><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIPrompt">nsIPrompt</a></li><li><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIPromptService">nsIPromptService</a></li><li><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIScriptableUnicodeConverter">nsIScriptableUnicodeConverter</a></li><li><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISyncMessageSender">nsISyncMessageSender</a></li><li><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsITimer">nsITimer</a></li><li><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/NsITraceableChannel">nsITraceableChannel</a></li><li><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIURI">nsIURI</a></li><li><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIXMLHttpRequest">nsIXMLHttpRequest</a></li></ul></div>
-<h2 id="See_also" name="See_also">相关链接</h2>
-<ul> <li><a href="/zh-cn/XPCOM_Interface_Reference_group" title="https://developer.mozilla.org/zh-cn/XPCOM_Interface_Reference_group">Interfaces grouped by function</a></li>
-</ul>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiaccessibleprovider/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiaccessibleprovider/index.html
deleted file mode 100644
index 488e504556..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiaccessibleprovider/index.html
+++ /dev/null
@@ -1,45 +0,0 @@
----
-title: nsIAccessibleProvider
-slug: Mozilla/Tech/XPCOM/Reference/Interface/nsIAccessibleProvider
-tags:
- - Accessibility
- - Interfaces
-translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIAccessibleProvider
----
-<p> </p>
-<p><br>
- </p><div style="border: solid #ddd 2px; margin-bottom: 12px;">
-<div style="background: #eee; padding: 2px;"><code><a href="https://dxr.mozilla.org/mozilla-central/source/accessible/public/nsIAccessibleProvider.idl" rel="custom">accessible/public/nsIAccessibleProvider.idl</a></code><span style="text-align: right; float: right;"><a href="/zh-CN/docs/Interfaces/About_Scriptable_Interfaces" style="color: #00cc00; font-weight: 700;">脚本化</a></span></div>
-<span style="padding: 4px 2px;">
-
-<i>Please add a summary to this article.</i>
-</span>
-
-<div style="background: #eee; padding: 2px;">
-<span> </span>
-<span style="text-align: right; float: right;">最后修改于Gecko 1.9 (Firefox 3)</span></div>
-</div><p></p>
-<p>Inherits from: <a href="cn/NsISupports">nsISupports</a></p>
-<h2 id="Attributes" name="Attributes">Attributes</h2>
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">Attribute</td>
- <td class="header">Type</td>
- <td class="header">Description</td>
- </tr>
- <tr>
- <td><code>accessible</code></td>
- <td><code><a href="cn/NsIAccessible">nsIAccessible</a></code></td>
- <td>Returns an accessible.
- <i>
- Read only</i>
- </td>
- </tr>
- </tbody>
-</table>
-<h3 id="See_also" name="See_also">See also</h3>
-<ul>
- <li><a href="cn/Accessibility">Accessibility</a></li>
- <li><a href="cn/NsIAccessible">nsIAccessible</a></li>
-</ul>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiclipboard/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiclipboard/index.html
deleted file mode 100644
index a1778f2cbb..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiclipboard/index.html
+++ /dev/null
@@ -1,91 +0,0 @@
----
-title: nsIClipboard
-slug: Mozilla/Tech/XPCOM/Reference/Interface/nsIClipboard
-translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIClipboard
----
-<p></p><div style="border: solid #ddd 2px; margin-bottom: 12px;">
-<div style="background: #eee; padding: 2px;"><code><a href="https://dxr.mozilla.org/mozilla-central/source/widget/public/nsIClipboard.idl" rel="custom">widget/public/nsIClipboard.idl</a></code><span style="text-align: right; float: right;"><a href="/zh-CN/docs/Interfaces/About_Scriptable_Interfaces" style="color: #00cc00; font-weight: 700;">脚本化</a></span></div>
-<span style="padding: 4px 2px;">
-
-This interface supports basic clipboard operations such as: setting, retrieving, emptying, matching and supporting clipboard data.
-</span>
-
-<div style="background: #eee; padding: 2px;">
-继承于: <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupports" title="">nsISupports</a></code>
-<span style="text-align: right; float: right;">最后修改于Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0)</span></div>
-</div><p></p>
-<h2 id="Method_overview" name="Method_overview"><span class="long_text short_text" id="result_box" lang="zh-CN"><span>方法</span><span>概述</span></span></h2>
-<table class="standard-table"> <tbody> <tr> <td><code>void <a href="#emptyClipboard()">emptyClipboard</a>(in long aWhichClipboard);</code></td> </tr> <tr> <td><code>void <a href="#forceDataToClipboard()">forceDataToClipboard</a>(in long aWhichClipboard);</code> <span class="inlineIndicator obsolete obsoleteInline" title="(Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0)">已废弃 Gecko 1.8</span></td> </tr> <tr> <td><code>void <a href="#getData()">getData</a>(in nsITransferable aTransferable, in long aWhichClipboard);</code></td> </tr> <tr> <td><code>boolean <a href="#hasDataMatchingFlavors()">hasDataMatchingFlavors</a>([array, size_is(aLength)] in string aFlavorList, in unsigned long aLength, in long aWhichClipboard);</code></td> </tr> <tr> <td><code>void <a href="#setData()">setData</a>(in nsITransferable aTransferable, in nsIClipboardOwner anOwner, in long aWhichClipboard);</code></td> </tr> <tr> <td><code>boolean <a href="#supportsSelectionClipboard()">supportsSelectionClipboard</a>();</code></td> </tr> </tbody>
-</table>
-<h2 id="Constants" name="Constants">常量</h2>
-<p>Most users will expect clipboard operations to use the global clipboard. In fact, the <code>kSelectionClipboard</code> is peculiar to the X Windows System, and not used much even under X.</p>
-<table class="standard-table"> <tbody> <tr> <td class="header">常量名称</td> <td class="header">值</td> <td class="header">描述</td> </tr> <tr> <td><code>kSelectionClipboard</code></td> <td><code>0</code></td> <td>Clipboard for selection.</td> </tr> <tr> <td><code>kGlobalClipboard</code></td> <td><code>1</code></td> <td>Clipboard for global use.</td> </tr> </tbody>
-</table>
-<h2 id="Methods" name="Methods">方法</h2>
-<h3 id="emptyClipboard()" name="emptyClipboard()">emptyClipboard()</h3>
-<p>This method empties the clipboard and notifies the clipboard owner. It empties the "logical" clipboard. It does not clear the native clipboard.</p>
-<pre class="eval">void emptyClipboard(
- in long aWhichClipboard
-);
-</pre>
-<h6 id="Parameters" name="Parameters">参数</h6>
-<dl> <dt><code>aWhichClipboard</code></dt> <dd>Specifies the clipboard to which this operation applies.</dd>
-</dl>
-<p></p><div class="headingWithIndicator">
- <h3 id="forceDataToClipboard()">forceDataToClipboard()</h3>
- <span class="indicatorInHeadline obsolete obsoleteMethod">已废弃 Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0)</span>
- </div><p></p>
-<p>Some platforms support deferred notification for putting data on the clipboard This method forces the data onto the clipboard in its various formats This may be used if the application going away.</p>
-<pre class="eval">void forceDataToClipboard(
- in long aWhichClipboard
-);
-</pre>
-<h6 id="Parameters" name="Parameters">参数</h6>
-<dl> <dt><code>aWhichClipboard</code></dt> <dd>Specifies the clipboard to which this operation applies.</dd>
-</dl>
-<h3 id="getData()" name="getData()">getData()</h3>
-<p>This method retrieves data from the clipboard into a transferable.</p>
-<pre class="eval">void getData(
- in nsITransferable aTransferable,
- in long aWhichClipboard
-);
-</pre>
-<h6 id="Parameters" name="Parameters">参数</h6>
-<dl> <dt><code>aTransferable</code></dt> <dd>The transferable to receive data from the clipboard.</dd> <dt><code>aWhichClipboard</code></dt> <dd>Specifies the clipboard to which this operation applies.</dd>
-</dl>
-<h3 id="hasDataMatchingFlavors()" name="hasDataMatchingFlavors()">hasDataMatchingFlavors()</h3>
-<p>This method provides a way to give correct UI feedback about, for instance, whether a paste should be allowed. It does <strong>not</strong> actually retrieve the data and should be a very inexpensive call. All it does is check if there is data on the clipboard matching any of the flavors in the given list.</p>
-<pre class="eval">boolean hasDataMatchingFlavors(
- [array, size_is(aLength)] in string aFlavorList,
- in unsigned long aLength,
- in long aWhichClipboard
-);
-</pre>
-<h6 id="Parameters" name="Parameters">参数</h6>
-<dl> <dt><code>aFlavorList</code></dt> <dd>An array of ASCII strings.</dd> <dt><code>aLength</code></dt> <dd>The length of the <code>aFlavorList</code>.</dd> <dt><code>aWhichClipboard</code></dt> <dd>Specifies the clipboard to which this operation applies.</dd>
-</dl>
-<h6 id="Return_value" name="Return_value">返回值</h6>
-<p>Returns <code>true</code>, if data is present and it matches the specified flavor. Otherwise it returns <code>false</code>.</p>
-<h3 id="setData()" name="setData()">setData()</h3>
-<p>This method sets the data from a transferable on the native clipboard.</p>
-<pre class="eval">void setData(
- in nsITransferable aTransferable,
- in nsIClipboardOwner anOwner,
- in long aWhichClipboard
-);
-</pre>
-<h6 id="Parameters" name="Parameters">参数</h6>
-<dl> <dt><code>aTransferable</code></dt> <dd>The transferable containing the data to put on the clipboard.</dd> <dt><code>anOwner</code></dt> <dd>The owner of the transferable.</dd> <dt><code>aWhichClipboard</code></dt> <dd>Specifies the clipboard to which this operation applies.</dd>
-</dl>
-<h3 id="supportsSelectionClipboard()" name="supportsSelectionClipboard()">supportsSelectionClipboard()</h3>
-<p>This method allows clients to determine if the implementation supports the concept of a separate clipboard for selection.</p>
-<pre class="eval">boolean supportsSelectionClipboard();
-</pre>
-<h6 id="Parameters" name="Parameters">参数</h6>
-<p>None.</p>
-<h6 id="Return_value" name="Return_value">返回值</h6>
-<p>Returns <code>true</code> if <code>kSelectionClipboard</code> is available. Otherwise it returns <code>false</code>.</p>
-<h2 id="See_also" name="See_also">相关链接</h2>
-<ul> <li><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIClipboardOwner" title="">nsIClipboardOwner</a></code></li> <li><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsITransferable" title="">nsITransferable</a></code></li> <li><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIArray" title="">nsIArray</a></code></li> <li><a class="internal" href="/zh-cn/Using_the_Clipboard" title="Using the Clipboard">Using the Clipboard</a></li>
-</ul>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiclipboardhelper/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiclipboardhelper/index.html
deleted file mode 100644
index b4c7881597..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiclipboardhelper/index.html
+++ /dev/null
@@ -1,65 +0,0 @@
----
-title: nsIClipboardHelper
-slug: Mozilla/Tech/XPCOM/Reference/Interface/nsIClipboardHelper
-translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIClipboardHelper
----
-<div style="border: solid #ddd 2px; margin-bottom: 12px;">
-<div style="background: #eee; padding: 2px;"><code><a href="https://dxr.mozilla.org/mozilla-central/source/widget/public/nsIClipboardHelper.idl" rel="custom">widget/public/nsIClipboardHelper.idl</a></code><span style="text-align: right; float: right;"><a href="/zh-CN/docs/Interfaces/About_Scriptable_Interfaces" style="color: #00cc00; font-weight: 700;">脚本化</a></span></div>
-<span style="padding: 4px 2px;">
-
-<code>nsIClipboardHelper接口是能够快速方便的使用</code> nsIClipboard 接口中常用方法的辅助接口.
-</span>
-
-<div style="background: #eee; padding: 2px;">
-继承于: <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupports" title="">nsISupports</a></code>
-<span style="text-align: right; float: right;">最后修改于Gecko 1.7 </span></div>
-</div>
-<h2 id="Method_overview" name="Method_overview">方法概述</h2>
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>void <a href="#copyString()">copyString</a>(in AString aString);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#copyStringToClipboard()">copyStringToClipboard</a>(in AString aString, in long aClipboardID);</code></td>
- </tr>
- </tbody>
-</table>
-<h2 id="Methods" name="Methods">方法</h2>
-<h3 id="copyString()" name="copyString()">copyString()</h3>
-<p>该方法将字符串复制到默认剪切板.</p>
-<pre class="eval">void copyString(
- in AString aString
-);
-</pre>
-<h6 id="Parameters" name="Parameters">参数</h6>
-<dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- 将要复制到剪切板的字符串.</dd>
-</dl>
-<h3 id="copyStringToClipboard()" name="copyStringToClipboard()">copyStringToClipboard()</h3>
-<p>该方法将字符串复制到指定剪切板.</p>
-<pre class="eval">void copyStringToClipboard(
- in AString aString,
- in long aClipboardID
-);
-</pre>
-<h6 id="Parameters" name="Parameters">参数</h6>
-<dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- 将要复制到指定剪切板的字符串.</dd>
- <dt>
- <code>aClipboardID</code></dt>
- <dd>
- 指定剪切板的ID(例如<code>kSelectionClipboard</code>).</dd>
-</dl>
-<h2 id="See_also" name="See_also">相关连接</h2>
-<ul>
- <li><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIClipboard" title="">nsIClipboard</a></code></li>
- <li><a href="/zh-cn/Using_the_Clipboard" title="zh-cn/Using the Clipboard">Using the Clipboard</a></li>
-</ul>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiconsoleservice/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiconsoleservice/index.html
deleted file mode 100644
index b373505057..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiconsoleservice/index.html
+++ /dev/null
@@ -1,215 +0,0 @@
----
-title: nsIConsoleService
-slug: Mozilla/Tech/XPCOM/Reference/Interface/nsIConsoleService
-translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIConsoleService
----
-<div class="warning">
- <p>Error Console在Firefox中已经过期,只有将<code>devtools.errorconsole.enabled<font face="Open Sans, sans-serif"><span style="line-height: 23.33333396911621px;">
- <i>
- 设为</i>
- </span></font></code><code>true<em>才能使用</em></code>. 对于web应用使用 <a href="/en-US/docs/Tools/Web_Console" title="/en-US/docs/Tools/Web_Console">Web Console </a>代替, 对于浏览器中的chrome应用,使用 <a href="/en-US/docs/Tools/Browser_Console" title="/en-US/docs/Tools/Browser_Console">Browser Console</a> 代替 .</p>
-</div>
-<p></p><div style="border: solid #ddd 2px; margin-bottom: 12px;">
-<div style="background: #eee; padding: 2px;"><code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/base/nsIConsoleService.idl" rel="custom">xpcom/base/nsIConsoleService.idl</a></code><span style="text-align: right; float: right;"><a href="/zh-CN/docs/Interfaces/About_Scriptable_Interfaces" style="color: #00cc00; font-weight: 700;">脚本化</a></span></div>
-<span style="padding: 4px 2px;">
-
-console service是<a title="en/Error_Console">Error Console</a> 后端的一部分, 与每一个Mozilla应用绑定在一起. 它用来记录各种消息、警告以及错误,同时可获取所有已经记录的消息
-</span>
-
-<div style="background: #eee; padding: 2px;">
-继承于: <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupports" title="">nsISupports</a></code>
-<span style="text-align: right; float: right;">最后修改于Gecko 1.9 (Firefox 3)</span></div>
-</div><p></p>
-<p>实现方式: <code>@mozilla.org/consoleservice;1</code> as a service:</p>
-<pre class="eval">var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
- .getService(Components.interfaces.nsIConsoleService);
-</pre>
-<h2 id="Method_overview" name="Method_overview">Method overview</h2>
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>void <a href="#getMessageArray()">getMessageArray</a>([array, size_is(count)] out nsIConsoleMessage messages, out uint32_t count);</code><span class="inlineIndicator obsolete obsoleteInline" title="(Firefox 19 / Thunderbird 19 / SeaMonkey 2.16)">已废弃 Gecko 19</span><br>
- <code>void <a href="#getMessageArray()">getMessageArray</a>(</code><code>[optional] out uint32_t count, </code><code>[retval, array, size_is(count)] out nsIConsoleMessage messages);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#logMessage()">logMessage</a>(in nsIConsoleMessage message);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#logStringMessage()">logStringMessage</a>(in wstring message);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#registerListener()">registerListener</a>(in nsIConsoleListener listener);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#reset()">reset</a>();</code> </td>
- </tr>
- <tr>
- <td><code>void <a href="#unregisterListener()">unregisterListener</a>(in nsIConsoleListener listener);</code></td>
- </tr>
- </tbody>
-</table>
-<h2 id="Methods" name="Methods">Methods</h2>
-<h3 id="getMessageArray()" name="getMessageArray()">getMessageArray()</h3>
-<p>获取有关目前所有控制台记录的信息的数组</p>
-<p></p><div class="blockIndicator obsolete obsoleteHeader"><p><strong><span class="icon-only-inline" title="This is an obsolete API and is no longer guaranteed to work."><i class="icon-trash"> </i></span> 已废弃 Gecko 19 (Firefox 19 / Thunderbird 19 / SeaMonkey 2.16)</strong><br>This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.</p></div><p></p>
-<pre class="eval">void getMessageArray(
- [array, size_is(count)] out nsIConsoleMessage messages,
- out PRUint32 count
-);
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<dl>
- <dt>
- <code>messages</code></dt>
- <dd>
- 已经记录的消息数组</dd>
- <dt>
- <code>count</code></dt>
- <dd>
- 数组中消息的数。如果没有消息被记录,函数会返回0,但同时仍会为message分配一个标记,在从脚本调用时,表示返回的一个长度为0的消息。</dd>
-</dl>
-<p></p>
-<pre class="eval">void getMessageArray(
- [optional] out PRUint32 count,
- [retval, array, size_is(count)] out nsIConsoleMessage messages
-);
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<dl>
- <dt>
- <code>count</code></dt>
- <dd>
- The number of messages in the array. If no messages are logged, this function will return a count of 0 but still will allocate one word for messages, so as to show up as a 0-length array when called from script.</dd>
-</dl>
-<p></p><div class="blockIndicator note"><strong>Note:</strong> See the code samples below for how to call getMessageArray.</div><p></p>
-<h3 id="logMessage()" name="logMessage()">logMessage()</h3>
-<pre class="eval">void logMessage(
- in nsIConsoleMessage message
-);
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<dl>
- <dt>
- <code>message</code></dt>
- <dd>
- An <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIConsoleMessage" title="">nsIConsoleMessage</a></code> to log.</dd>
-</dl>
-<h3 id="logStringMessage()" name="logStringMessage()">logStringMessage()</h3>
-<p>Convenience method for logging simple messages.</p>
-<pre class="eval">void logStringMessage(
- in wstring message
-);
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<dl>
- <dt>
- <code>message</code></dt>
- <dd>
- The string to log.</dd>
-</dl>
-<h3 id="registerListener()" name="registerListener()">registerListener()</h3>
-<p>Registers a listener for notification when an error is logged.</p>
-<p></p><div class="blockIndicator note"><strong>Note:</strong> To guard against stack overflows from listeners that could log messages (it is easy to do this inadvertently from listeners implemented in JavaScript), we do not call any listeners when another error is already being logged.</div><p></p>
-<pre class="eval">void registerListener(
- in nsIConsoleListener listener
-);
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<dl>
- <dt>
- <code>listener</code></dt>
- <dd>
- The <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIConsoleListener" title="">nsIConsoleListener</a></code> to add.</dd>
-</dl>
-<p></p><h3 id="reset()">reset()</h3><p></p>
-<p>Clear the message buffer (For example, for privacy reasons).</p>
-<pre class="eval">void reset();
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<p>None.</p>
-<p></p><div class="blockIndicator note"><strong>Note:</strong> Console listeners expect you to log an empty string message before calling <code>reset</code> so that they can clear their message buffers too. (This works before Gecko 1.9 too of course.)</div><p></p>
-<h3 id="unregisterListener()" name="unregisterListener()">unregisterListener()</h3>
-<p>Unregisters a listener.</p>
-<pre class="eval">void unregisterListener(
- in nsIConsoleListener listener
-);
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<dl>
- <dt>
- <code>listener</code></dt>
- <dd>
- The <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIConsoleListener" title="">nsIConsoleListener</a></code> to remove.</dd>
-</dl>
-<h2 id="Examples" name="Examples">Examples</h2>
-<h4 id="Retrieving_the_message_array" name="Retrieving_the_message_array">Retrieving the message array</h4>
-<p>To retrieve the message array in Gecko prior to version 19:</p>
-<pre class="brush: js">function getConsoleMessageArray() {
- var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
- .getService(Components.interfaces.nsIConsoleService);
- var array = {};
- consoleService.getMessageArray(array, {});
- return array.value;
-}
-</pre>
-<p>To retrieve the message array in Gecko 19 or later:</p>
-<pre class="brush: js">function getConsoleMessageArray() {
- var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
- .getService(Components.interfaces.nsIConsoleService);
- return consoleService.getMessageArray();
-}
-</pre>
-<p>To retrieve the message array in a compatible way:</p>
-<pre class="brush: js">function getConsoleMessageArray() {
- var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
- .getService(Components.interfaces.nsIConsoleService);
- var array = {};
- return consoleService.getMessageArray(array, {}) || array.value;
-}
-</pre>
-<h4 id="Logging_a_simple_message" name="Logging_a_simple_message">Logging a simple message</h4>
-<p>A common usage is to log a string message to console:</p>
-<pre class="brush: js">function LOG(msg) {
- var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
- .getService(Components.interfaces.nsIConsoleService);
- consoleService.logStringMessage(msg);
-}
-</pre>
-<p>Alternative logging methods include <a href="/en/Components.utils.reportError" title="en/Components.utils.reportError">Components.utils.reportError</a> and <a href="/en/DOM/window.dump" title="en/DOM/window.dump">dump()</a>.</p>
-<h4 id="Logging_a_message_with_additional_information" name="Logging_a_message_with_additional_information">Logging a message with additional information</h4>
-<p>To include other information an <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIConsoleMessage" title="">nsIConsoleMessage</a></code> object must be used. In this example <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIScriptError" title="">nsIScriptError</a></code>, which implements <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIConsoleMessage" title="">nsIConsoleMessage</a></code>, is used to include information about the source file and line number of the error.</p>
-<pre class="brush: js">function myLogToConsole(aMessage, aSourceName, aSourceLine, aLineNumber,
- aColumnNumber, aFlags, aCategory)
-{
- var consoleService = Components.classes["@mozilla.org/consoleservice;1"]
- .getService(Components.interfaces.nsIConsoleService);
- var scriptError = Components.classes["@mozilla.org/scripterror;1"]
- .createInstance(Components.interfaces.nsIScriptError);
- scriptError.init(aMessage, aSourceName, aSourceLine, aLineNumber,
- aColumnNumber, aFlags, aCategory);
- consoleService.logMessage(scriptError);
-}
-</pre>
-<ul>
- <li><code>aMessage</code> — the string to be logged. You must provide this.</li>
- <li><code>aSourceName</code> — the URL of file with error. This will be a hyperlink in the Error Console, so you'd better use real URL. You may pass <code>null</code> if it's not applicable.</li>
- <li><code>aSourceLine</code> — the line #<code>aLineNumber</code> from <code>aSourceName</code> file. You are responsible for providing that line. You may pass <code>null</code> if you are lazy; that will prevent showing the source line in Error Console.</li>
- <li><code>aLineNumber</code> and <code>aColumnNumber</code> — specify the exact location of error. <code>aColumnNumber</code> is used to draw the arrow pointing to the problem character.</li>
- <li><code>aFlags</code> — one of flags declared in <code>nsIScriptError</code>. At the time of writing, possible values are:
- <ul>
- <li><code>nsIScriptError.errorFlag = 0</code></li>
- <li><code>nsIScriptError.warningFlag = 1</code></li>
- <li><code>nsIScriptError.exceptionFlag = 2</code> and</li>
- <li><code>nsIScriptError.strictFlag = 4</code>.</li>
- </ul>
- </li>
- <li><code>aCategory</code> — a string indicating what kind of code caused the message. There are quite a few category strings and they do not seem to be listed in a single place. Hopefully, they will all be listed in <code>nsIScriptError.idl</code> eventually.</li>
-</ul>
-<h2 id="See_also" name="See_also">See also</h2>
-<ul>
- <li><a href="/en/Error_Console" title="en/Error_Console">Error Console</a></li>
- <li><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIConsoleMessage" title="">nsIConsoleMessage</a></code></li>
-</ul>
-<p></p>
-<div id="cke_pastebin" style="position: absolute; top: 894.333px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">
-  </div>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsidirectoryserviceprovider/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsidirectoryserviceprovider/index.html
deleted file mode 100644
index 20d094eaf3..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsidirectoryserviceprovider/index.html
+++ /dev/null
@@ -1,65 +0,0 @@
----
-title: nsIDirectoryServiceProvider
-slug: Mozilla/Tech/XPCOM/Reference/Interface/nsIDirectoryServiceProvider
-translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIDirectoryServiceProvider
----
-<p></p><div style="border: solid #ddd 2px; margin-bottom: 12px;">
-<div style="background: #eee; padding: 2px;"><code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/io/nsIDirectoryService.idl" rel="custom">xpcom/io/nsIDirectoryService.idl</a></code><span style="text-align: right; float: right;"><a href="/zh-CN/docs/Interfaces/About_Scriptable_Interfaces" style="color: #00cc00; font-weight: 700;">脚本化</a></span></div>
-<span style="padding: 4px 2px;">
-
-本接口是目录服务用于得到文件位置的函数。
-</span>
-
-<div style="background: #eee; padding: 2px;">
-继承于: <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupports" title="">nsISupports</a></code>
-<span style="text-align: right; float: right;">最后修改于Gecko 1.7 </span></div>
-</div><p></p>
-<p><code>nsIDirectoryServiceProvider</code>.</p>
-<h2 id="Method_overview" name="Method_overview">方法概览</h2>
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>nsIFile <a href="#getFile()">getFile</a>(in string prop, out PRBool persistent);</code></td>
- </tr>
- </tbody>
-</table>
-<h2 id="Methods" name="Methods">方法</h2>
-<h3 id="getFile()" name="getFile()">getFile()</h3>
-<p>The Directory Service calls this method when it gets the first request for a prop or on every request if the prop is not persistent.</p>
-<pre class="eval">nsIFile getFile(
- in string prop,
- out PRBool persistent
-);
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<dl>
- <dt>
- <code>prop</code></dt>
- <dd>
- The symbolic name of the file.</dd>
- <dt>
- <code>persistent</code></dt>
- <dd>
- <code>true</code> if the returned file will be cached by Directory Service. Subsequent requests for this prop will bypass the provider and use the cache. <code>false</code> if the provider will be asked for this prop each time it is requested.</dd>
-</dl>
-<h6 id="Return_value" name="Return_value">Return value</h6>
-<p>The <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFile" title="">nsIFile</a></code> represented by the property.</p>
-<h2 id="Example" name="Example">示例</h2>
-<p>This code creates a global, read-only string called <code>currDir</code> with the value of the current working directory.</p>
-<pre class="eval"> __defineGetter__("currDir",
- function getCurrDir() {
- return Components.classes["@mozilla.org/file/directory_service;1"]
- .getService(Components.interfaces.nsIDirectoryServiceProvider)
- .getFile("CurWorkD",{}).path;
- });
-</pre>
-<p>Test it with to see the magic happen.</p>
-<pre class="eval"> alert(currDir);
-</pre>
-<h2 id="See_also" name="See_also">参见</h2>
-<ul>
- <li><a href="/en/nsDirectoryService" title="en/nsDirectoryService">nsDirectoryService</a></li>
- <li><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDirectoryService" title="">nsIDirectoryService</a></code></li>
- <li>(译注)其它目录服务关键字见<a href="http://mxr.mozilla.org/mozilla-central/source/xpcom/io/nsDirectoryServiceDefs.h" title="http://mxr.mozilla.org/mozilla-central/source/xpcom/io/nsDirectoryServiceDefs.h">nsDirectoryServiceDefs.h</a></li>
-</ul>
-<p>Additionally, see <a class="external" href="http://mb.eschew.org/16.php#sub_16.5.2">section 16.5.2</a> of the <a class="external" href="http://mb.eschew.org/">Rapid Application Development with Mozilla</a> book for instructions on how to get the <strong>current working directory</strong> and the <strong>process binary directory</strong>, among other things.</p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsidomclientrect/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsidomclientrect/index.html
deleted file mode 100644
index 20a00c9e26..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsidomclientrect/index.html
+++ /dev/null
@@ -1,92 +0,0 @@
----
-title: nsIDOMClientRect
-slug: Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMClientRect
-translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMClientRect
----
-<p></p><div style="border: solid #ddd 2px; margin-bottom: 12px;">
-<div style="background: #eee; padding: 2px;"><code><a href="https://dxr.mozilla.org/mozilla-central/source/dom/interfaces/base/nsIDOMClientRect.idl" rel="custom">dom/interfaces/base/nsIDOMClientRect.idl</a></code><span style="text-align: right; float: right;"><a href="/zh-CN/docs/Interfaces/About_Scriptable_Interfaces" style="color: #00cc00; font-weight: 700;">脚本化</a></span></div>
-<span style="padding: 4px 2px;">代表一个矩形盒子。盒子类型由返回这种盒子对象的方法指定的。它是由像<a href="/zh-CN/docs/Web/API/Element/getBoundingClientRect" title="Element.getBoundingClientRect()方法返回元素的大小及其相对于视口的位置。"><code>element.getBoundingClientRect</code></a>的函数返回的。.</span>
-
- <div style="height: 42px; position: relative; padding: 2px; width: auto;">
-
- <div style="top: 22px; font-size: 11px; position: absolute;">1.0</div>
-
- <div style="top: 22px; font-size: 11px; position: absolute; left: 0px; text-align: right; float: right; width: 100%;">66</div>
-
- <div style="height: 8px; top: 16px; background: #dd0000; left: 0px; position: absolute; width: 8.571428571428571%;"></div>
-
-<div style="height: 8px; top: 16px; left: 8.571428571428571%; background: #00dd00; position: absolute; width: 91.42857142857143%;" title="Introduced in Gecko 1.9 (Firefox 3)"></div>
-
-<div style="top: 0px; font-size: 11px; position: absolute; left: 8.571428571428571%;">Introduced</div>
-<div style="top: 22px; font-size: 11px; position: absolute; left: 8.571428571428571%;">Gecko 1.9</div>
-
- <div style="height: 8px; top: 16px; left: 9.023809428571429%; background: #eeee00; position: absolute; width: 1%; border-radius: 4px; -webkit-border-radius: 4px;" title="Last changed in Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0)"></div>
-
-</div>
-
-<div style="background: #eee; padding: 2px;">
-继承于: <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupports" title="">nsISupports</a></code>
-<span style="text-align: right; float: right;">最后修改于Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0)</span></div>
-</div><p></p>
-
-<h2 id="Attributes" name="Attributes">属性</h2>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">Attribute</td>
- <td class="header">Type</td>
- <td class="header">Description</td>
- </tr>
- <tr>
- <td><code>bottom</code></td>
- <td><code><a href="/en/float" title="en/float">float</a></code></td>
- <td>Y 轴,相对于视口原点(viewport origin)矩形盒子的底部。<strong>只读。 </strong></td>
- </tr>
- <tr>
- <td><code>height</code></td>
- <td><code><a href="/en/float" title="en/float">float</a></code></td>
- <td>矩形盒子的高度(等同于 bottom 减 top)。<strong>只读。</strong></td>
- </tr>
- <tr>
- <td><code>left</code></td>
- <td><code><a href="/en/float" title="en/float">float</a></code></td>
- <td>X 轴,相对于视口原点(viewport origin)矩形盒子的左侧。<strong>只读。 </strong></td>
- </tr>
- <tr>
- <td><code>right</code></td>
- <td><code><a href="/en/float" title="en/float">float</a></code></td>
- <td>X 轴,相对于视口原点(viewport origin)矩形盒子的右侧。<strong>只读。 </strong></td>
- </tr>
- <tr>
- <td><code>top</code></td>
- <td><code><a href="/en/float" title="en/float">float</a></code></td>
- <td>Y 轴,相对于视口原点(viewport origin)矩形盒子的顶部。<strong>只读。</strong></td>
- </tr>
- <tr>
- <td><code>width</code></td>
- <td><code><a href="/en/float" title="en/float">float</a></code></td>
- <td>矩形盒子的宽度(等同于 right 减 left)。<strong>只读。</strong> </td>
- </tr>
- <tr>
- <td><code>x</code></td>
- <td><code><a href="/en/float" title="en/float">float</a></code></td>
- <td>X 轴,相对于视口原点(viewport origin)矩形盒子的左侧。<strong>只读。</strong> </td>
- </tr>
- <tr>
- <td><code>y</code></td>
- <td><code><a href="/en/float" title="en/float">float</a></code></td>
- <td>Y 轴,相对于视口原点(viewport origin)矩形盒子的顶部。<strong>只读。</strong></td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="See_also" name="See_also">参考资料</h2>
-
-<ul>
- <li><a href="http://www.w3.org/TR/cssom-view/#the-clientrect-interface">CSSOM View Module : The ClientRect Interface</a><span style="color: #fff; background: #e66e33; display: inline-block; font-size: x-small; margin-left: 6px; white-space: nowrap; padding: 2px 5px;" title="工作草案">WD</span></li>
-</ul>
-
-<p><span style="line-height: 1.5;">这个对象几次易名:最初叫做 TextRectangle,</span><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=916520" style="line-height: 1.5;">然后</a><span style="line-height: 1.5;">叫做 ClientRect,</span><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=916520" style="line-height: 1.5;">后来</a><span style="line-height: 1.5;">叫做 DOMRect。</span></p>
-
-<p><span style="line-height: 1.5;">该对象最初只有 top、left、right、bottom 属性,后来添加了 width、height、x、y 属性。</span></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsifile/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsifile/index.html
deleted file mode 100644
index d966771e83..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsifile/index.html
+++ /dev/null
@@ -1,828 +0,0 @@
----
-title: nsIFile
-slug: Mozilla/Tech/XPCOM/Reference/Interface/nsIFile
-translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIFile
----
-<p></p><div style="border: solid #ddd 2px; margin-bottom: 12px;">
-<div style="background: #eee; padding: 2px;"><code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/io/nsIFile.idl" rel="custom">xpcom/io/nsIFile.idl</a></code><span style="text-align: right; float: right;"><a href="/zh-CN/docs/Interfaces/About_Scriptable_Interfaces" style="color: #00cc00; font-weight: 700;">脚本化</a></span></div>
-<span style="padding: 4px 2px;">
-
-An instance of this interface is a cross-platform representation of a location in the filesystem.
-</span>
-
-<div style="background: #eee; padding: 2px;">
-继承于: <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupports" title="">nsISupports</a></code>
-<span style="text-align: right; float: right;">最后修改于Gecko 1.0 </span></div>
-</div><p></p>
-<p><code>nsIFile</code> is the correct platform-agnostic way to specify a file; you should always use this instead of a string to ensure compatibility.</p>
-<p>With an <code>nsIFile</code> you can navigate to ancestors or descendants without having to deal with the different path separators used on different platforms, query the state of any file or directory at the position represented by the <code>nsIFile</code> and create, move or copy items in the filesystem.</p>
-<p>An <code>nsIFile</code> can be retrieved by either instantiating an <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsILocalFile" title="">nsILocalFile</a></code> using a platform specific path string or by using cross-platform locations retrieved from the <a href="/en/Code_snippets/File_I//O#Getting_special_files" title="en/Code_snippets/File_I//O#Getting_special_files">directory service</a>.</p>
-<p>All methods with string parameters have two forms. The preferred form operates on UTF-16 encoded characters strings. An alternate form operates on characters strings encoded in the "native" charset. A string containing characters encoded in the native charset cannot be safely passed to javascript via xpconnect. Therefore, the UTF-16 forms are scriptable, but the "native methods" are not. In addition, the native form <strong>cannot</strong> deal with files whose name contains characters outside the default system code page on Windows. Using the native form limits the ability of your code to deal with the full Unicode support on Windows 2000 or later where the OS itself does not have such a limitation. Therefore, you <strong>must not</strong> use the native form unless it is <strong>guaranteed</strong> that the path passed to a native form function is <strong>always</strong> ASCII.</p>
-<div class="note">
- <strong>Note:</strong> <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsILocalFile" title="">nsILocalFile</a></code> was merged with this interface in Gecko 14. Much of the documentation has not been updated to reflect this change.</div>
-<h2 id="Method_overview" name="Method_overview">Method overview</h2>
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>void <a href="#append()">append</a>(in AString node);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#appendNative()">appendNative</a>(in ACString node);</code> <span class="inlineIndicator noscript noscriptInline" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span></td>
- </tr>
- <tr>
- <td><code>void <a href="/en/XPCOM_Interface_Reference/nsILocalFile#appendRelativeNativePath()" title="/en/XPCOM_Interface_Reference/nsILocalFile#appendRelativeNativePath()">appendRelativeNativePath</a>(in ACString relativeFilePath);</code> <span class="inlineIndicator noscript noscriptInline" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span></td>
- </tr>
- <tr>
- <td><code>void <a href="/en/XPCOM_Interface_Reference/nsILocalFile#appendRelativePath()" title="/en/XPCOM_Interface_Reference/nsILocalFile#appendRelativePath()">appendRelativePath</a>(in AString relativeFilePath);</code> </td>
- </tr>
- <tr>
- <td><code>nsIFile <a href="#clone()">clone</a>();</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="#contains()">contains</a>(in nsIFile inFile, in boolean recur);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#copyTo()">copyTo</a>(in nsIFile newParentDir, in AString newName);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#copyToFollowingLinks()">copyToFollowingLinks</a>(in nsIFile newParentDir, in AString newName);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#copyToFollowingLinksNative()">copyToFollowingLinksNative</a>(in nsIFile newParentDir, in ACString newName);</code> <span class="inlineIndicator noscript noscriptInline" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span></td>
- </tr>
- <tr>
- <td><code>void <a href="#CopyToNative()">CopyToNative</a>(in nsIFile newParentDir, in ACString newName);</code> <span class="inlineIndicator noscript noscriptInline" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span></td>
- </tr>
- <tr>
- <td><code>void <a href="#create()">create</a>(in unsigned long type, in unsigned long permissions);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#createUnique()">createUnique</a>(in unsigned long type, in unsigned long permissions);</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="#equals()">equals</a>(in nsIFile inFile);</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="#exists()">exists</a>();</code></td>
- </tr>
- <tr>
- <td><code>ACString <a href="/en/XPCOM_Interface_Reference/nsILocalFile#getRelativeDescriptor()" title="/en/XPCOM_Interface_Reference/nsILocalFile#getRelativeDescriptor()">getRelativeDescriptor</a>(in nsIFile fromFile);</code> </td>
- </tr>
- <tr>
- <td><code>void <a href="/en/XPCOM_Interface_Reference/nsILocalFile#initWithFile()" title="/en/XPCOM_Interface_Reference/nsILocalFile#initWithFile()">initWithFile</a>(in nsIFile aFile);</code> </td>
- </tr>
- <tr>
- <td><code>void <a href="/en/XPCOM_Interface_Reference/nsILocalFile#initWithNativePath()" title="/en/XPCOM_Interface_Reference/nsILocalFile#initWithNativePath()">initWithNativePath</a>(in ACString filePath);</code> <span class="inlineIndicator noscript noscriptInline" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span></td>
- </tr>
- <tr>
- <td><code>void <a href="/en/XPCOM_Interface_Reference/nsILocalFile#initWithPath()" title="/en/XPCOM_Interface_Reference/nsILocalFile#initWithPath()">initWithPath</a>(in AString filePath);</code> </td>
- </tr>
- <tr>
- <td><code>boolean <a href="#isDirectory()">isDirectory</a>();</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="#isExecutable()">isExecutable</a>();</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="#isFile()">isFile</a>();</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="#isHidden()">isHidden</a>();</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="#isReadable()">isReadable</a>();</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="#isSpecial()">isSpecial</a>();</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="#isSymlink()">isSymlink</a>();</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="#isWritable()">isWritable</a>();</code></td>
- </tr>
- <tr>
- <td><code>void <a href="/en/XPCOM_Interface_Reference/nsILocalFile#launch()" title="/en/XPCOM_Interface_Reference/nsILocalFile#launch()">launch</a>();</code> </td>
- </tr>
- <tr>
- <td><code>PRLibraryStar <a href="/en/XPCOM_Interface_Reference/nsILocalFile#load()" title="/en/XPCOM_Interface_Reference/nsILocalFile#load()">load</a>();</code> <span class="inlineIndicator noscript noscriptInline" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span></td>
- </tr>
- <tr>
- <td><code>void <a href="#moveTo()">moveTo</a>(in nsIFile newParentDir, in AString newName);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#moveToNative()">moveToNative</a>(in nsIFile newParentDir, in ACString newName);</code> <span class="inlineIndicator noscript noscriptInline" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span></td>
- </tr>
- <tr>
- <td><code>void <a href="#normalize()">normalize</a>();</code></td>
- </tr>
- <tr>
- <td><code>FILE <a href="/en/XPCOM_Interface_Reference/nsILocalFile#openANSIFileDesc()" title="/en/XPCOM_Interface_Reference/nsILocalFile#openANSIFileDesc()">openANSIFileDesc</a>(in string mode);</code> <span class="inlineIndicator noscript noscriptInline" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span></td>
- </tr>
- <tr>
- <td><code>PRFileDescStar <a href="/en/XPCOM_Interface_Reference/nsILocalFile#openNSPRFileDesc()" title="/en/XPCOM_Interface_Reference/nsILocalFile#openNSPRFileDesc()">openNSPRFileDesc</a>(in long flags, in long mode);</code> <span class="inlineIndicator noscript noscriptInline" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span></td>
- </tr>
- <tr>
- <td><code>void <a href="#remove()">remove</a>(in boolean recursive);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="/en/XPCOM_Interface_Reference/nsILocalFile#reveal()" title="/en/XPCOM_Interface_Reference/nsILocalFile#reveal()">reveal</a>();</code> </td>
- </tr>
- <tr>
- <td><code>void <a href="/en/XPCOM_Interface_Reference/nsILocalFile#setRelativeDescriptor()" title="/en/XPCOM_Interface_Reference/nsILocalFile#setRelativeDescriptor()">setRelativeDescriptor</a>(in nsIFile fromFile, in ACString relativeDesc);</code> </td>
- </tr>
- </tbody>
-</table>
-<h2 id="Attributes" name="Attributes">Attributes</h2>
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">Attribute</td>
- <td class="header">Type</td>
- <td class="header">Description</td>
- </tr>
- <tr>
- <td><code>directoryEntries</code></td>
- <td><code><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISimpleEnumerator" title="">nsISimpleEnumerator</a></code></code></td>
- <td>Returns an enumeration of the elements in a directory. Each element in the enumeration is an <code>nsIFile</code>. <strong>Read only.</strong>
- <h6 id="Exceptions_thrown" name="Exceptions_thrown">Exceptions thrown</h6>
- <dl>
- <dt>
- <code>NS_ERROR_FILE_NOT_DIRECTORY</code></dt>
- <dd>
- Indicates that this <code>nsIFile</code> does not reference a directory.</dd>
- </dl>
- </td>
- </tr>
- <tr>
- <td><code>diskSpaceAvailable</code> </td>
- <td><code><a href="/en/PRInt64" title="en/PRInt64">PRInt64</a></code></td>
- <td>The number of bytes available to non-superuser on the disk volume containing the <code>nsIFile</code>. <strong>Read only.</strong></td>
- </tr>
- <tr>
- <td><code>fileSize</code></td>
- <td><code><a href="/en/PRInt64" title="en/PRInt64">PRInt64</a></code></td>
- <td>
- <p>The value of this attribute is the number of bytes corresponding to the data represented by the file.</p>
- <p>On the Mac, getting/setting the file size with <code>nsIFile</code> only deals with the size of the data fork. If you need to know the size of the combined data and resource forks use <code><a href="https://developer.mozilla.org/zh-CN/docs/XPCOM_Interface_Reference/nsILocalFileMac#GetFileSizeWithResFork()">nsILocalFileMac.GetFileSizeWithResFork()</a></code>.</p>
- Changing the size of a <code>nsIFile</code> operates on the underlying filesystem, possibly truncating the existing file to specified size.</td>
- </tr>
- <tr>
- <td><code>fileSizeOfLink</code></td>
- <td><code><a href="/en/PRInt64" title="en/PRInt64">PRInt64</a></code></td>
- <td>
- <p>This attribute exposes the size of the symbolic link referenced by this <code>nsIFile</code>.</p>
- <p>Unlike <code>fileSize</code>, this attribute corresponds to the size of the symbolic link referenced by this <code>nsIFile</code>. If this <code>nsIFile</code> does not reference a symbolic link, then the value of this attribute is undefined.</p>
- The value of this attribute is the number of bytes corresponding to the data represented by the symbolic link. Any meta data, such as a resource fork on the Mac, is not included in the measurement of the file size. <strong>Read only.</strong></td>
- </tr>
- <tr>
- <td><code>followLinks</code> </td>
- <td><code><a href="/en/PRBool" title="en/PRBool">PRBool</a></code></td>
- <td>
- <p>Determines whether or not the <code>nsIFile</code> will automatically resolve symbolic links.</p>
- By default, this value is <code>false</code> on all non-UNIX systems. As of Mozilla 1.7, this attribute is ignored on UNIX systems.</td>
- </tr>
- <tr>
- <td><code>lastModifiedTime</code></td>
- <td><code><a href="/en/PRInt64" title="en/PRInt64">PRInt64</a></code></td>
- <td>
- <p>This attribute exposes the time when the file referenced by this <code>nsIFile</code> was last modified.</p>
- <p>The value of this attribute is milliseconds since midnight (00:00:00), January 1, 1970 Greenwich Mean Time (GMT).</p>
- Changing the last modified time of a <code>nsIFile</code> operates on the underlying filesystem. As of <span title="">Gecko 1.7</span>, changing the last modified time of a non-existent file has undefined behavior.</td>
- </tr>
- <tr>
- <td><code>lastModifiedTimeOfLink</code></td>
- <td><code><a href="/en/PRInt64" title="en/PRInt64">PRInt64</a></code></td>
- <td>
- <p>This attribute exposes the time when the symbolic link referenced by this <code>nsIFile</code> was last modified.</p>
- <p>Unlike <code>lastModifiedTime</code>, this attribute corresponds to the last modified time of the symbolic link referenced by this <code>nsIFile</code>. If this <code>nsIFile</code> does not reference a symbolic link, then the value of this attribute is undefined.</p>
- <p>The value of this attribute is milliseconds since midnight (00:00:00), January 1, 1970 Greenwich Mean Time (GMT).</p>
- Changing the last modified time of a <code>nsIFile</code> operates on the underlying filesystem. As of <span title="">Gecko 1.7</span>, changing the last modified time of a non-existent file has undefined behavior.</td>
- </tr>
- <tr>
- <td><code>leafName</code></td>
- <td><code><a href="/en/AString" title="en/AString">AString</a></code></td>
- <td>
- <p>This attribute exposes the name of the <code>nsIFile</code> without any directory components.</p>
- Changing the leaf name of a <code>nsIFile</code> does not affect the underlying filesystem. It only changes what this <code>nsIFile</code> references.</td>
- </tr>
- <tr>
- <td><code>nativeLeafName</code></td>
- <td><code><a href="/en/ACString" title="en/ACString">ACString</a></code></td>
- <td>
- <p>This attribute exposes the name of the <code>nsIFile</code> without any directory components. [native character encoding variant]</p>
- Changing the leaf name of a <code>nsIFile</code> does not affect the underlying filesystem. It only changes what this <code>nsIFile</code> references. <span class="inlineIndicator noscript noscriptInline" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span></td>
- </tr>
- <tr>
- <td><code>nativePath</code></td>
- <td><code><a href="/en/ACString" title="en/ACString">ACString</a></code></td>
- <td>
- <p>This attribute exposes the full path of the <code>nsIFile</code>. [native character encoding variant]</p>
- The value of this attribute is a platform-specific file path. <strong>Read only.</strong> <span class="inlineIndicator noscript noscriptInline" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span></td>
- </tr>
- <tr>
- <td><code>nativeTarget</code></td>
- <td><code><a href="/en/ACString" title="en/ACString">ACString</a></code></td>
- <td>
- <p>This attribute exposes the full target of the <code>nsIFile</code> - the full path with any symbolic links dereferenced. [native character encoding variant]</p>
- The value of this attribute is a platform-specific file path. <strong>Read only.</strong> <span class="inlineIndicator noscript noscriptInline" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span></td>
- </tr>
- <tr>
- <td><code>parent</code></td>
- <td><code><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFile" title="">nsIFile</a></code></code></td>
- <td>
- <p>This attribute returns the parent <code>nsIFile</code> for this <code>nsIFile</code>.</p>
- The parent will be <code>null</code> when this <code>nsIFile</code> references the top of the volume. For example, C:\ does not have a parent. <strong>Read only.</strong></td>
- </tr>
- <tr>
- <td><code>path</code></td>
- <td><code><a href="/en/AString" title="en/AString">AString</a></code></td>
- <td>
- <p>This attribute exposes the full platform-specific path of the <code>nsIFile</code> (including the <code>leafName</code>). <strong>Read only.</strong></p>
- Example, this could return "/home/user/foo.txt" or "C:\Images\my.jpeg"</td>
- </tr>
- <tr>
- <td><code>permissions</code></td>
- <td><code><a href="/en/unsigned_long" title="en/unsigned long">unsigned long</a></code></td>
- <td>
- <p>The value of this attribute is a UNIX-style file permission mask for this <code>nsIFile</code>.</p>
- Changing the permissions of a <code>nsIFile</code> operates on the underlying filesystem. As of <span title="">Gecko 1.7</span>, changing the permissions of a non-existent file has undefined behavior.</td>
- </tr>
- <tr>
- <td><code>permissionsOfLink</code></td>
- <td><code><a href="/en/unsigned_long" title="en/unsigned long">unsigned long</a></code></td>
- <td>
- <p>The value of this attribute is a UNIX-style file permission mask for this <code>nsIFile</code>.</p>
- <p>Unlike <code>permissions</code>, this attribute corresponds to the permissions of the symbolic link referenced by this <code>nsIFile</code>. If this <code>nsIFile</code> does not reference a symbolic link, then the value of this attribute is undefined.</p>
- Changing the permissions of a <code>nsIFile</code> operates on the underlying filesystem. As of <span title="">Gecko 1.7</span>, changing the permissions of a non-existent file has undefined behavior.</td>
- </tr>
- <tr>
- <td><code>persistentDescriptor</code> </td>
- <td><code><a href="/en/ACString" title="en/ACString">ACString</a></code></td>
- <td>
- <p>On some platforms, the value of <a href="https://developer.mozilla.org/zh-CN/docs/XPCOM_Interface_Reference/nsIFile#path">nsIFile.path</a> may be insufficient to uniquely identify the file on the local file system. The persistent descriptor is intended to be used whenever a <code>nsIFile</code> needs to be serialized to disk and later recovered. This string is not intended for display to users.</p>
- <div class="blockIndicator note"><strong>Note:</strong> The value of the <code>followLinks</code> attribute is not encoded in the persistent descriptor.</div></td>
- </tr>
- <tr>
- <td><code>target</code></td>
- <td><code><a href="/en/AString" title="en/AString">AString</a></code></td>
- <td>
- <p>This attribute exposes the full target of the <code>nsIFile</code> - the full path with any symbolic links dereferenced.</p>
- <p>Accessor to the string <code>path</code>. The native version of these strings are not guaranteed to be a usable <code>path</code> to pass to NSPR or the C stdlib. There are problems that affect platforms on which a <code>path</code> does not fully specify a file because two volumes can have the same name (For example Mac). This is solved by holding "private", native data in the <code>nsIFile</code> implementation. This native data is lost when you convert to a string. DO NOT PASS TO USE WITH NSPR OR STDLIB! <strong>Read only.</strong></p>
- <h6 id="Exceptions_thrown" name="Exceptions_thrown">Exceptions thrown</h6>
- <dl>
- <dt>
- <code>NS_ERROR_FILE_INVALID_PATH</code></dt>
- <dd>
- Indicates that this <code>nsIFile</code> does not reference a symbolic links.</dd>
- </dl>
- </td>
- </tr>
- </tbody>
-</table>
-<h2 id="Constants" name="Constants">Constants</h2>
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">Constant</td>
- <td class="header">Value</td>
- <td class="header">Description</td>
- </tr>
- <tr>
- <td><code>NORMAL_FILE_TYPE</code></td>
- <td><code>0</code></td>
- <td>A normal file.</td>
- </tr>
- <tr>
- <td><code>DIRECTORY_TYPE</code></td>
- <td><code>1</code></td>
- <td>A directory/folder.</td>
- </tr>
- <tr>
- <td><code>DELETE_ON_CLOSE</code> </td>
- <td><code>0x80000000</code></td>
- <td>Optional parameter used by <a href="/en/XPCOM_Interface_Reference/nsILocalFile#openNSPRFileDesc()" title="/en/XPCOM_Interface_Reference/nsILocalFile#openNSPRFileDesc()">openNSPRFileDesc</a></td>
- </tr>
- </tbody>
-</table>
-<h2 id="Methods" name="Methods">Methods</h2>
-<h3 id="append()" name="append()">append()</h3>
-<p>This function is used for constructing a descendant of the current <code>nsIFile</code>.</p>
-<div class="note style-wrap">
- <p><strong>Note:</strong> This method does not return a new <code>nsIFile</code>; it modifies the object it was called on. If the old <code>nsIFile</code> should be retained, use <code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFile#clone()">clone()</a></code>.</p>
-</div>
-<pre class="eval">void append(
- in AString node
-);
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<dl>
- <dt>
- <code>node</code></dt>
- <dd>
- A string which is intended to be a child node of the <code>nsIFile</code>. This string must not contain a path separator character.</dd>
-</dl>
-<h6 id="Exceptions_thrown" name="Exceptions_thrown">Exceptions thrown</h6>
-<dl>
- <dt>
- <code>NS_ERROR_FILE_UNRECOGNIZED_PATH</code></dt>
- <dd>
- Indicates that aNode incorrectly contains a path separator character.</dd>
-</dl>
-<p></p><div><span class="indicatorInHeadline noscript noscriptMethod" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span><h3 id="appendNative">appendNative</h3></div><p></p>
-<p>This method is used for constructing a descendant of the current <code>nsIFile</code>. [native character encoding variant]</p>
-<pre class="eval">void appendNative(
- in ACString node
-);
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<dl>
- <dt>
- <code>node</code></dt>
- <dd>
- A string that is intended to be a child node of the current <code>nsIFile</code>. This string must not contain a path separator character. This string must be encoded using the native character encoding.</dd>
-</dl>
-<h6 id="Exceptions_thrown" name="Exceptions_thrown">Exceptions thrown</h6>
-<dl>
- <dt>
- <code>NS_ERROR_FILE_UNRECOGNIZED_PATH</code></dt>
- <dd>
- Indicates that aNode incorrectly contains a path separator character.</dd>
-</dl>
-<h3 id="clone()" name="clone()">clone()</h3>
-<p>This method creates a clone of the <code>nsIFile</code>. (It does NOT clone the file itself; see the copy methods.)</p>
-<pre class="eval">nsIFile clone();
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<p>None.</p>
-<h6 id="Return_value" name="Return_value">Return value</h6>
-<p>A new <code>nsIFile</code> instance that corresponds to the same file or directory as this <code>nsIFile</code>.</p>
-<h3 id="contains()" name="contains()">contains()</h3>
-<p>This method tests whether or not a <code>nsIFile</code> instance is a descendant of the this <code>nsIFile</code>.</p>
-<pre class="eval">boolean contains(
- in nsIFile inFile,
- in boolean recur
-);
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<dl>
- <dt>
- <code>inFile</code></dt>
- <dd>
- The <code>nsIFile</code> to test.</dd>
- <dt>
- <code>recur</code></dt>
- <dd>
- This parameter specifies whether or not subdirectories should be inspected. As of <span title="">Gecko 1.7</span>, this parameter is ignored and always treated as false by the canonical Local File implementation.</dd>
-</dl>
-<h6 id="Return_value" name="Return_value">Return value</h6>
-<p><code>true</code> if inFile is a descendant of this <code>nsIFile</code>.</p>
-<h3 id="copyTo()" name="copyTo()">copyTo()</h3>
-<p>This method copies a source file to a new location if it does not already exist.</p>
-<p>This method will NOT resolve aliases/shortcuts during the copy.</p>
-<pre class="eval">void copyTo(
- in nsIFile newParentDir,
- in AString newName
-);
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<dl>
- <dt>
- <code>newParentDir</code></dt>
- <dd>
- This parameter specifies the parent directory to copy the file into. If this parameter is <code>null</code>, then the parent directory of the file will be used.</dd>
- <dt>
- <code>newName</code></dt>
- <dd>
- This parameter allows you to specify a new leaf name for the file to be copied. This parameter may be empty, in which case the current leaf name will be used.</dd>
-</dl>
-<h6 id="Exceptions_thrown" name="Exceptions_thrown">Exceptions thrown</h6>
-<dl>
- <dt>
- <code>NS_ERROR_FILE_DESTINATION_NOT_DIR</code></dt>
- <dd>
- If the "newParentDir" is not a directory.</dd>
- <dt>
- <code>NS_ERROR_FILE_TARGET_DOES_NOT_EXIST</code></dt>
- <dd>
- Indicates that the current file path does not exist. It is not possible to copy a file that does not exist.</dd>
- <dt>
- <code>NS_ERROR_FILE_ALREADY_EXISTS</code></dt>
- <dd>
- Indicates that there is already a file named "newName" in the destination directory.</dd>
-</dl>
-<h3 id="copyToFollowingLinks()" name="copyToFollowingLinks()">copyToFollowingLinks()</h3>
-<p>This method copies a source file to a new location if it does not already exist.</p>
-<p>This method is identical to <code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFile#copyTo()">copyTo()</a></code> except that any symbolic links will be followed as the name suggests.</p>
-<pre class="eval">void copyToFollowingLinks(
- in nsIFile newParentDir,
- in AString newName
-);
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<dl>
- <dt>
- <code>newParentDir</code></dt>
- <dd>
- This parameter specifies the parent directory to copy the file into. If this parameter is <code>null</code>, then the parent directory of the file will be used.</dd>
- <dt>
- <code>newName</code></dt>
- <dd>
- This parameter allows you to specify a new leaf name for the file to be copied. This parameter may be empty, in which case the current leaf name will be used.</dd>
-</dl>
-<h6 id="Exceptions_thrown" name="Exceptions_thrown">Exceptions thrown</h6>
-<dl>
- <dt>
- <code>NS_ERROR_FILE_DESTINATION_NOT_DIR</code></dt>
- <dd>
- If the "newParentDir" is not a directory.</dd>
- <dt>
- <code>NS_ERROR_FILE_TARGET_DOES_NOT_EXIST</code></dt>
- <dd>
- Indicates that the current file path does not exist. It is not possible to copy a file that does not exist.</dd>
- <dt>
- <code>NS_ERROR_FILE_ALREADY_EXISTS</code></dt>
- <dd>
- Indicates that there is already a file named "newName" in the destination directory.</dd>
-</dl>
-<p></p><div><span class="indicatorInHeadline noscript noscriptMethod" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span><h3 id="copyToFollowingLinksNative">copyToFollowingLinksNative</h3></div><p></p>
-<p>This method copies this file to a new location. [native character encoding variant]</p>
-<p>This method is identical to <code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFile#copyToNative()">copyToNative()</a></code> except that any symbolic links will be followed as the name suggests.</p>
-<pre class="eval">void copyToFollowingLinksNative(
- in nsIFile newParentDir,
- in ACString newName
-);
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<dl>
- <dt>
- <code>newParentDir</code></dt>
- <dd>
- This parameter specifies the parent directory to copy the file into. If this parameter is <code>null</code>, then the parent directory of the file will be used.</dd>
- <dt>
- <code>newName</code></dt>
- <dd>
- This parameter allows you to specify a new leaf name for the file to be copied. This parameter may be empty, in which case the current leaf name will be used. This string must be encoded using the native character encoding.</dd>
-</dl>
-<h6 id="Exceptions_thrown" name="Exceptions_thrown">Exceptions thrown</h6>
-<dl>
- <dt>
- <code>NS_ERROR_FILE_DESTINATION_NOT_DIR</code></dt>
- <dd>
- If the "newParentDir" is not a directory.</dd>
- <dt>
- <code>NS_ERROR_FILE_TARGET_DOES_NOT_EXIST</code></dt>
- <dd>
- Indicates that the current file path does not exist. It is not possible to copy a file that does not exist.</dd>
- <dt>
- <code>NS_ERROR_FILE_ALREADY_EXISTS</code></dt>
- <dd>
- Indicates that there is already a file named "newName" in the destination directory.</dd>
-</dl>
-<p></p><div><span class="indicatorInHeadline noscript noscriptMethod" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span><h3 id="CopyToNative">CopyToNative</h3></div><p></p>
-<p>This method copies this file to a new location. [native character encoding variant]</p>
-<pre class="eval">void CopyToNative(
- in nsIFile newParentDir,
- in ACString newName
-);
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<dl>
- <dt>
- <code>newParentDir</code></dt>
- <dd>
- This parameter specifies the parent directory to copy the file into. If this parameter is <code>null</code>, then the parent directory of the file will be used.</dd>
- <dt>
- <code>newName</code></dt>
- <dd>
- This parameter allows you to specify a new leaf name for the file to be copied. This parameter may be empty, in which case the current leaf name will be used. This string must be encoded using the native character encoding.</dd>
-</dl>
-<h6 id="Exceptions_thrown" name="Exceptions_thrown">Exceptions thrown</h6>
-<dl>
- <dt>
- <code>NS_ERROR_FILE_DESTINATION_NOT_DIR</code></dt>
- <dd>
- If the "newParentDir" is not a directory.</dd>
- <dt>
- <code>NS_ERROR_FILE_TARGET_DOES_NOT_EXIST</code></dt>
- <dd>
- Indicates that the current file path does not exist. It is not possible to copy a file that does not exist.</dd>
- <dt>
- <code>NS_ERROR_FILE_ALREADY_EXISTS</code></dt>
- <dd>
- Indicates that there is already a file named "newName" in the destination directory.</dd>
-</dl>
-<h3 id="create()" name="create()">create()</h3>
-<p>This method creates a new file or directory in the file system corresponding to the file path represented by this <code>nsIFile</code>. This method will create any path segments that do not already exist.</p>
-<pre class="eval">void create(
- in unsigned long type,
- in unsigned long permissions
-);
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<dl>
- <dt>
- <code>type</code></dt>
- <dd>
- This specifies the type of file system object to be made. The only two types at this time are file and directory which are defined above.</dd>
- <dt>
- <code>permissions</code></dt>
- <dd>
- A UNIX-style file permissions value. For example, the octal value 0600 may be used to limit read and write access to the current user of the system. This parameter may be ignored on systems that do not support file permissions.</dd>
-</dl>
-<h6 id="Exceptions_thrown" name="Exceptions_thrown">Exceptions thrown</h6>
-<dl>
- <dt>
- <code>NS_ERROR_FILE_ALREADY_EXISTS</code></dt>
- <dd>
- Indicates that the file or directory already exists.</dd>
- <dt>
- <code>NS_ERROR_FILE_UNKNOWN_TYPE</code></dt>
- <dd>
- Indicates that the value of "type" does not correspond to a known type.</dd>
-</dl>
-<h3 id="createUnique()" name="createUnique()">createUnique()</h3>
-<p>This function will create a new file or directory in the file system. Any nodes that have not been created or resolved, will be. If this file already exists, we try variations on the leaf name "suggestedName" until we find one that did not already exist. This method will create any path segments that do not already exist.</p>
-<pre class="eval">void createUnique(
- in unsigned long type,
- in unsigned long permissions
-);
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<dl>
- <dt>
- <code>type</code></dt>
- <dd>
- This specifies the type of file system object to be made. The only two types at this time are file and directory which are defined above.</dd>
- <dt>
- <code>permissions</code></dt>
- <dd>
- A UNIX-style file permissions value. For example, the octal value 0600 may be used to limit read and write access to the current user of the system. This parameter may be ignored on systems that do not support file permissions.</dd>
-</dl>
-<h6 id="Exceptions_thrown" name="Exceptions_thrown">Exceptions thrown</h6>
-<dl>
- <dt>
- <code>NS_ERROR_FILE_UNKNOWN_TYPE</code></dt>
- <dd>
- Indicates that the value of "type" does not correspond to a known type.</dd>
- <dt>
- <code>NS_ERROR_FILE_TOO_BIG</code></dt>
- <dd>
- Indicates that the search for nonexistent files was unsuccessful because all of the attempted leaf name variants already exist.</dd>
-</dl>
-<h3 id="equals()" name="equals()">equals()</h3>
-<p>This method tests whether or not two <code>nsIFile</code> instances correspond to the same file or directory.</p>
-<pre class="eval">boolean equals(
- in nsIFile inFile
-);
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<dl>
- <dt>
- <code>inFile</code></dt>
- <dd>
- The <code>nsIFile</code> to compare this <code>nsIFile</code> against.</dd>
-</dl>
-<h6 id="Return_value" name="Return_value">Return value</h6>
-<p><code>true</code> if "inFile" is equivalent to this <code>nsIFile</code>.</p>
-<h3 id="exists()" name="exists()">exists()</h3>
-<p>This method tests whether or not this <code>nsIFile</code> exists.</p>
-<pre class="eval">boolean exists()
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<p>None.</p>
-<h6 id="Return_value" name="Return_value">Return value</h6>
-<p><code>true</code> if the file or directory exists. Otherwise it returns <code>false</code>.</p>
-<h3 id="isDirectory()" name="isDirectory()">isDirectory()</h3>
-<p>This method tests whether or not this <code>nsIFile</code> corresponds to a directory.</p>
-<pre class="eval">boolean isDirectory();
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<p>None.</p>
-<h6 id="Return_value" name="Return_value">Return value</h6>
-<p><code>true</code> if this <code>nsIFile</code> corresponds to a directory. Otherwise it returns <code>false</code>.</p>
-<h3 id="isExecutable()" name="isExecutable()">isExecutable()</h3>
-<p>This method tests whether or not this <code>nsIFile</code> corresponds to a file that may be executed.</p>
-<div class="note style-wrap">
- <p><strong>Note:</strong> This method does not work on all platforms due to <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=322865" title="isExecutable method of nsILocalFile reports false for executable files on OSX">bug 322865</a>.</p>
-</div>
-<pre class="eval">boolean isExecutable();
-</pre>
-<div class="note style-wrap">
- <p><strong>Note:</strong> Use <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIProcess" title="">nsIProcess</a></code> to then execute/run this file.</p>
-</div>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<p>None.</p>
-<h6 id="Return_value" name="Return_value">Return value</h6>
-<p><code>true</code> if the <code>nsIFile</code> may be executed by the user. Otherwise it returns <code>false</code>.</p>
-<h3 id="isFile()" name="isFile()">isFile()</h3>
-<p>This method tests whether or not this <code>nsIFile</code> corresponds to a normal file.</p>
-<pre class="eval">boolean isFile();
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<p>None.</p>
-<h6 id="Return_value" name="Return_value">Return value</h6>
-<p><code>true</code> if this <code>nsIFile</code> corresponds to a normal file. Otherwise it returns <code>false</code>.</p>
-<h3 id="isHidden()" name="isHidden()">isHidden()</h3>
-<p>This method tests whether or not this <code>nsIFile</code> corresponds to a file or directory that is hidden. In Unix, hidden files start with a period. On Mac and Windows, they have an attribute bit set.</p>
-<pre class="eval">boolean isHidden();
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<p>None.</p>
-<h6 id="Return_value" name="Return_value">Return value</h6>
-<p><code>true</code> if the file or directory is hidden. Otherwise it returns <code>false</code>.</p>
-<h3 id="isReadable()" name="isReadable()">isReadable()</h3>
-<p>This method tests whether or not this <code>nsIFile</code> corresponds to a file or directory that may be read by the user.</p>
-<pre class="eval">boolean isReadable();
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<p>None.</p>
-<h6 id="Return_value" name="Return_value">Return value</h6>
-<p><code>true</code> if the file or directory may be read by the user. Otherwise it returns <code>false</code>.</p>
-<h3 id="isSpecial()" name="isSpecial()">isSpecial()</h3>
-<p>This method tests whether or not this <code>nsIFile</code> corresponds to a special system file.</p>
-<p></p><div class="blockIndicator note"><strong>Note:</strong> The definition of a special system file is platform dependent. For example, under UNIX platforms this might correspond to a device file, socket, or fifo.</div><p></p>
-<pre class="eval">boolean isSpecial();
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<p>None.</p>
-<h6 id="Return_value" name="Return_value">Return value</h6>
-<p><code>true</code> if this <code>nsIFile</code> corresponds to a special system file. Otherwise it returns <code>false</code>.</p>
-<h3 id="isSymlink()" name="isSymlink()">isSymlink()</h3>
-<p>This method tests whether or not this <code>nsIFile</code> corresponds to a symbolic link, shortcut, or alias.</p>
-<pre class="eval">boolean isSymlink();
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<p>None.</p>
-<h6 id="Return_value" name="Return_value">Return value</h6>
-<p><code>true</code> if this <code>nsIFile</code> corresponds to a symbolic link. Otherwise it returns <code>false</code>.</p>
-<h3 id="isWritable()" name="isWritable()">isWritable()</h3>
-<p>This method tests whether or not this <code>nsIFile</code> corresponds to a file or directory that may be modified by the user.  As of Gecko 9, files on read only shares will return false.  Files that are exclusively opened on Win32 will return true if they are normally writable, and files that don't have write permissions will return false. For specific handling before Gecko 9 (Firefox 9.0 / Thunderbird 9.0 / SeaMonkey 2.6), please see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=682571" title="FIXED: nsLocalFile::isWritable behaves wrongly on Windows">bug 682571</a>.</p>
-<pre class="eval">boolean isWritable();
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<p>None.</p>
-<h6 id="Return_value" name="Return_value">Return value</h6>
-<p><code>true</code> if the file or directory may be modified by the user. Otherwise it returns <code>false</code>.</p>
-<h3 id="moveTo()" name="moveTo()">moveTo()</h3>
-<p>This method moves this file to a new location.</p>
-<div class="note">
- <strong>Note:</strong> If this method succeeds, this instance will be updated to point to the new file.</div>
-<p>If the current file path corresponds to a regular file (for storage of bytes), and if the new leaf name identifies a regular file that already exists, then this method will overwrite the destination file.</p>
-<p>Usually, "move" means to relocate the file to a different directory without changing the file's contents or properties, or in fact the file's serial number (inode). That is a very fast operation because it just changes directory information. The actual data doesn't move.</p>
-<p>Unfortunately, an actual "move" is impossible between different volumes (disks or partitions). This method attempts to do the "right thing" when moving files across volumes. That is, it will copy the old file to the new location, try to assign the file attributes as the old file had them, and then delete the old file. You should be aware of these possible problems:</p>
-<ul>
- <li>This process may take a long time if the file is large and/or the bandwidth is narrow.</li>
- <li>If the <code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFile#copyTo()">copyTo()</a></code> method loses data, such as Mac resource data, then so will such a move.</li>
- <li>If attribute data cannot be recreated (like the file owner if you don't have enough privileges, or ACL data if moving to a non-ACL volume), then those attributes will be lost.</li>
- <li>The new file's serial number will almost certainly be different, because it is a different file, probably stored in a different physical location.</li>
-</ul>
-<pre class="eval">void moveTo(
- in nsIFile newParentDir,
- in AString newName
-);
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<dl>
- <dt>
- <code>newParentDir</code></dt>
- <dd>
- This parameter specifies the parent directory to move the file into. If this parameter is <code>null</code>, then the parent directory of the file will be used.</dd>
- <dt>
- <code>newName</code></dt>
- <dd>
- This parameter allows you to specify a new leaf name for the file to be moved. This parameter may be empty, in which case the current leaf name will be used.</dd>
-</dl>
-<h6 id="Exceptions_thrown" name="Exceptions_thrown">Exceptions thrown</h6>
-<dl>
- <dt>
- <code>NS_ERROR_FILE_TARGET_DOES_NOT_EXIST</code></dt>
- <dd>
- Indicates that the current file path does not exist. It is not possible to move a file that does not exist.</dd>
- <dt>
- <code>NS_ERROR_FILE_DIR_NOT_EMPTY</code></dt>
- <dd>
- Indicates that an attempt was made to move a directory to the location of an existing directory that is not empty.</dd>
- <dt>
- <code>NS_ERROR_FILE_ACCESS_DENIED</code></dt>
- <dd>
- Indicates that an attempt was made to move a directory to the location of an existing directory that is not writable.</dd>
- <dt>
- <code>NS_ERROR_FILE_DESTINATION_NOT_DIR</code></dt>
- <dd>
- Indicates that "newParentDir" exists and is not a directory.</dd>
-</dl>
-<p></p><div><span class="indicatorInHeadline noscript noscriptMethod" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span><h3 id="moveToNative">moveToNative</h3></div><p></p>
-<p>This method moves this file to a new location. [native character encoding variant]</p>
-<div class="note">
- <strong>Note:</strong> If this method succeeds, this instance will be updated to point to the new file.</div>
-<p>If the current file path corresponds to a regular file (for storage of bytes), and if the new leaf name identifies a regular file that already exists, then this method will overwrite the destination file.</p>
-<p>Usually, "move" means to relocate the file to a different directory without changing the file's contents or properties, or in fact the file's serial number (inode). That is a very fast operation because it just changes directory information. The actual data doesn't move.</p>
-<p>Unfortunately, an actual "move" is impossible between different volumes (disks or partitions). This method attempts to do the "right thing" when moving files across volumes. That is, it will copy the old file to the new location, try to assign the file attributes as the old file had them, and then delete the old file. You should be aware of these possible problems:</p>
-<ul>
- <li>This process may take a long time if the file is large and/or the bandwidth is narrow.</li>
- <li>If the <code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFile#copyTo()">copyTo()</a></code> method loses data, such as Mac resource data, then so will such a move.</li>
- <li>If attribute data cannot be recreated (like the file owner if you don't have enough privileges, or ACL data if moving to a non-ACL volume), then those attributes will be lost.</li>
- <li>The new file's serial number will almost certainly be different, because it is a different file, probably stored in a different physical location.</li>
-</ul>
-<pre class="eval">void moveToNative(
- in nsIFile newParentDir,
- in ACString newName
-);
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<p> </p>
-<dl>
- <dt>
- <code>newParentDir</code></dt>
- <dd>
- This parameter specifies the parent directory to copy the file into. If this parameter is <code>null</code>, then the parent directory of the file will be used.</dd>
- <dt>
- <code>newName</code></dt>
- <dd>
- This parameter allows you to specify a new leaf name for the file to be copied. This parameter may be empty, in which case the current leaf name will be used. This string must be encoded using the native character encoding.</dd>
-</dl>
-<h6 id="Exceptions_thrown" name="Exceptions_thrown">Exceptions thrown</h6>
-<dl>
- <dt>
- <code>NS_ERROR_FILE_TARGET_DOES_NOT_EXIST</code></dt>
- <dd>
- Indicates that the current file path does not exist. It is not possible to move a file that does not exist.</dd>
- <dt>
- <code>NS_ERROR_FILE_DIR_NOT_EMPTY</code></dt>
- <dd>
- Indicates that an attempt was made to move a directory to the location of an existing directory that is not empty.</dd>
- <dt>
- <code>NS_ERROR_FILE_ACCESS_DENIED</code></dt>
- <dd>
- Indicates that an attempt was made to move a directory to the location of an existing directory that is not writable.</dd>
- <dt>
- <code>NS_ERROR_FILE_DESTINATION_NOT_DIR</code></dt>
- <dd>
- Indicates that "newParentDir" exists and is not a directory.</dd>
-</dl>
-<h3 id="normalize()" name="normalize()">normalize()</h3>
-<p>This method is used to canonicalize the path represented by this <code>nsIFile</code>. (for example removing .. and . components on Unix).</p>
-<p>As of <span title="">Gecko 1.7</span>, this method is only implemented under UNIX builds (except for Mac OSX). This method will fail if the path does not exist.</p>
-<pre class="eval">void normalize();
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<p>None.</p>
-<h6 id="Exceptions_thrown" name="Exceptions_thrown">Exceptions thrown</h6>
-<dl>
- <dt>
- <code>NS_ERROR_FILE_TARGET_DOES_NOT_EXIST</code></dt>
- <dd>
- Indicates that the file path does not exist.</dd>
- <dt>
- <code>NS_ERROR_FILE_DESTINATION_NOT_DIR</code></dt>
- <dd>
- Indicates that a component of the path prefix is not a directory.</dd>
- <dt>
- <code>NS_ERROR_FILE_ACCESS_DENIED</code></dt>
- <dd>
- Read or search permission was denied for a component of the path prefix.</dd>
-</dl>
-<h3 id="remove()" name="remove()">remove()</h3>
-<p>This method removes the file or directory corresponding to the file path represented by this <code>nsIFile</code>.</p>
-<p>This method will not resolve any symlinks.</p>
-<pre class="eval">void remove(
- in boolean recursive
-);
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<dl>
- <dt>
- <code>recursive</code></dt>
- <dd>
- If this <code>nsIFile</code> corresponds to a directory that is not empty, then this parameter must be <code>true</code> in order for the directory to be deleted. Otherwise, this parameter is ignored.</dd>
-</dl>
-<h6 id="Exceptions_thrown" name="Exceptions_thrown">Exceptions thrown</h6>
-<dl>
- <dt>
- <code>NS_ERROR_FILE_TARGET_DOES_NOT_EXIST</code></dt>
- <dd>
- Indicates that the current file path does not exist. It is not possible to remove a file that does not exist.</dd>
- <dt>
- <code>NS_ERROR_FILE_DIR_NOT_EMPTY</code></dt>
- <dd>
- Indicates that an attempt was made to remove a directory that is not empty.</dd>
- <dt>
- <code>NS_ERROR_FILE_ACCESS_DENIED</code></dt>
- <dd>
- Indicates that an attempt was made to remove a file in a way that exceeded your permissions. Details depend on your file system and how its permissions work.</dd>
-</dl>
-<h2 id="Remarks" name="Remarks">Remarks</h2>
-<p>All string-valued methods and attributes have two forms. The preferred form operates on UTF-16 (Unicode) encoded character strings. The alternate form operates on character strings encoded in the "native" multibyte character set. The native character encoding is defined as the single-byte character encoding used with the standard fopen function on the host system.</p>
-<p>The native character encoding is determined using platform specific methods. As of <span title="">Gecko 1.7</span>, it is UTF-8 on Mac OS X. On Linux and other UNIX platforms, it is the value returned from nl_langinfo (CODESET), which usually corresponds to the value of the LC_ALL, LC_CTYPE and LANG environment variables (with the precedence the same as the order they're enumerated). On Win32 platforms, it is the currently selected ANSI codepage (specified by CP_ACP).</p>
-<p>The word "Native" appears in the name of methods that operate on or return strings encoded in the native character set.</p>
-<p>A string containing characters encoded in the native character set cannot be safely passed to JavaScript via XPConnect. Therefore, the "native" methods and attributes are not scriptable.</p>
-<p>XPCOM provides the string conversion functions <a href="/en/NS_CStringToUTF16" title="en/NS_CStringToUTF16">NS_CStringToUTF16</a> and <a href="/en/NS_UTF16ToCString" title="en/NS_UTF16ToCString">NS_UTF16ToCString</a>, which can be used to convert a string between UTF-16 and the native character encoding.</p>
-<p>This interface was frozen for <span title="">Gecko 1.0</span>. See <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=129279" title="FIXED: nsIFile unicode/utf8/ascii task">bug 129279</a> for details. From <span title="(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)">Gecko 2.0</span> interfaces are no longer frozen.</p>
-<h2 id="See_also" name="See_also">See also</h2>
-<ul>
- <li><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsILocalFile" title="">nsILocalFile</a></code></li>
- <li><a href="/en/NS_CStringToUTF16" title="en/NS_CStringToUTF16">NS_CStringToUTF16</a></li>
- <li><a href="/en/NS_UTF16ToCString" title="en/NS_UTF16ToCString">NS_UTF16ToCString</a></li>
-</ul>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsifilepicker/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsifilepicker/index.html
deleted file mode 100644
index 7122dcd1ef..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsifilepicker/index.html
+++ /dev/null
@@ -1,376 +0,0 @@
----
-title: nsIFilePicker
-slug: Mozilla/Tech/XPCOM/Reference/Interface/nsIFilePicker
-tags:
- - Filepicker
- - 文件选取器
-translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIFilePicker
----
-<p></p><div style="border: solid #ddd 2px; margin-bottom: 12px;">
-<div style="background: #eee; padding: 2px;"><code><a href="https://dxr.mozilla.org/mozilla-central/source/widget/nsIFilePicker.idl" rel="custom">widget/nsIFilePicker.idl</a></code><span style="text-align: right; float: right;"><a href="/zh-CN/docs/Interfaces/About_Scriptable_Interfaces" style="color: #00cc00; font-weight: 700;">脚本化</a></span></div>
-<span style="padding: 4px 2px;">
-
-文件选择器组件是通过显示标准的用户界面来让用户来选择文件和目录,以及选择目的地来命名和新建文件。
-</span>
-
-<div style="background: #eee; padding: 2px;">
-继承于: <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupports" title="">nsISupports</a></code>
-<span style="text-align: right; float: right;">最后修改于Gecko 17.0 (Firefox 17.0 / Thunderbird 17.0 / SeaMonkey 2.14)</span></div>
-</div><p></p>
-
-<p>实现自: <code>@mozilla.org/filepicker;1</code>。要创建一个实例,使用以下代码:</p>
-
-<pre class="eval">var filePicker = Components.classes["@mozilla.org/filepicker;1"]
- .createInstance(Components.interfaces.nsIFilePicker);
-</pre>
-
-<h2 id="Method_overview" name="Method_overview">方法概述</h2>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>void <a href="#appendFilter()">appendFilter</a>(in AString title, in AString filter);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#appendFilters()">appendFilters</a>(in long filterMask);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#init()">init</a>(in nsIDOMWindow parent, in AString title, in short mode);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#open()">open</a>(in nsIFilePickerShownCallback aFilePickerShownCallback);</code> </td>
- </tr>
- <tr>
- <td><code>short <a href="#show()">show</a>();</code> <span class="inlineIndicator deprecated deprecatedInline" title="(Firefox 17.0 / Thunderbird 17.0 / SeaMonkey 2.14)">已废弃 Gecko 17.0</span></td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Attributes" name="Attributes">属性</h2>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">属性</td>
- <td class="header">类型</td>
- <td class="header">说明</td>
- </tr>
- <tr>
- <td><code>addToRecentDocs</code> </td>
- <td><code>boolean</code></td>
- <td>If <code>true</code>, the file is added to the operating system's "recent documents" list (if the operating system has one; nothing happens if there is no such concept on the user's platform). This attribute has no effect if private browsing mode is in effect.</td>
- </tr>
- <tr>
- <td><code>defaultExtension</code></td>
- <td><code><a href="/en/AString" title="en/AString">AString</a></code></td>
- <td>The extension for the type of files you want to work with. On some platforms, this is automatically appended to filenames the user enters, if required.  Specify it without a leading dot, for example "jpg".</td>
- </tr>
- <tr>
- <td><code>defaultString</code></td>
- <td><code><a href="/en/AString" title="en/AString">AString</a></code></td>
- <td>The filename, including extension, that should be suggested to the user as a default. This should be set this before calling <code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFilePicker#open()">open()</a></code> or <code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFilePicker#show()">show()</a></code>.
- <h6 id="Exceptions_thrown" name="Exceptions_thrown">Exceptions thrown</h6>
-
- <dl>
- <dt><code>NS_ERROR_FAILURE</code></dt>
- <dd>If you try to read this attribute.</dd>
- </dl>
- </td>
- </tr>
- <tr>
- <td><code>displayDirectory</code></td>
- <td><code><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsILocalFile" title="">nsILocalFile</a></code></code></td>
- <td>The directory that the file picker dialog should initially display. This should be set this before calling <code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFilePicker#open()">open()</a></code> or <code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFilePicker#show()">show()</a></code> to specify a starting point.</td>
- </tr>
- <tr>
- <td><code>file</code></td>
- <td><code><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsILocalFile" title="">nsILocalFile</a></code></code></td>
- <td>The currently selected file or directory. <strong>Read only.</strong></td>
- </tr>
- <tr>
- <td><code>files</code></td>
- <td><code><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISimpleEnumerator" title="">nsISimpleEnumerator</a></code></code></td>
- <td>
- <p>An enumerator of the currently selected files. <strong>Read only.</strong></p>
- <div class="blockIndicator note"><strong>Note:</strong> Only works with <code>modeOpenMultiple</code> mode.</div></td>
- </tr>
- <tr>
- <td><code>fileURL</code></td>
- <td><code><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIURI" title="">nsIURI</a></code></code></td>
- <td>The URI of the currently selected file or directory. <strong>Read only.</strong></td>
- </tr>
- <tr>
- <td><code>filterIndex</code></td>
- <td><code><a href="/en/long" title="en/long">long</a></code></td>
- <td>The (0-based) index of the filter which is currently selected in the file picker dialog. Set this to choose a particular filter to be selected by default.</td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Constants" name="Constants">常量</h2>
-
-<h3 id="Mode_constants" name="Mode_constants">模式常量</h3>
-
-<p>These constants are used to specify the type of file picker to create when calling <code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFilePicker#init()">init()</a></code>.</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">常量</td>
- <td class="header">值</td>
- <td class="header">说明</td>
- </tr>
- <tr>
- <td><code>modeOpen</code></td>
- <td><code>0</code></td>
- <td>Load a file or directory.</td>
- </tr>
- <tr>
- <td><code>modeSave</code></td>
- <td><code>1</code></td>
- <td>Save a file or directory.</td>
- </tr>
- <tr>
- <td><code>modeGetFolder</code></td>
- <td><code>2</code></td>
- <td>Select a folder/directory.</td>
- </tr>
- <tr>
- <td><code>modeOpenMultiple</code></td>
- <td><code>3</code></td>
- <td>Load multiple files.</td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="Return_value_constants" name="Return_value_constants">返回值常量</h3>
-
-<p>These values are returned by <code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFilePicker#show()">show()</a></code>, indicating the result of the file picker activity.</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">Constant</td>
- <td class="header">Value</td>
- <td class="header">Description</td>
- </tr>
- <tr>
- <td><code>returnOK</code></td>
- <td><code>0</code></td>
- <td>The file picker dialog was closed by the user hitting 'Ok'</td>
- </tr>
- <tr>
- <td><code>returnCancel</code></td>
- <td><code>1</code></td>
- <td>The file picker dialog was closed by the user hitting 'Cancel'</td>
- </tr>
- <tr>
- <td><code>returnReplace</code></td>
- <td><code>2</code></td>
- <td>The user chose an existing file and acknowledged that they want to overwrite the file</td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="Filter_constants" name="Filter_constants">筛选器常量</h3>
-
-<p>These constants are used to create filters for commonly-used file types. For the most up to date list see <a href="https://dxr.mozilla.org/mozilla-central/source/toolkit/content/filepicker.properties" rel="custom">filepicker.properties</a>.</p>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">Constant</td>
- <td class="header">Value</td>
- <td class="header">Description</td>
- </tr>
- <tr>
- <td><code>filterAll</code></td>
- <td><code>0x001</code></td>
- <td>Corresponds to the *.* filter for file extensions. All files will pass through the filter.</td>
- </tr>
- <tr>
- <td><code>filterHTML</code></td>
- <td><code>0x002</code></td>
- <td>Corresponds to the *.html, *.htm, *.shtml and *.xhtml filters for file extensions.</td>
- </tr>
- <tr>
- <td><code>filterText</code></td>
- <td><code>0x004</code></td>
- <td>Corresponds to the *.txt and *.text filter for file extensions.</td>
- </tr>
- <tr>
- <td><code>filterImages</code></td>
- <td><code>0x008</code></td>
- <td>Corresponds to the *.jpe, *.jpg, *.jpeg, *.gif, *.png, *.bmp, *.ico, *.svg, *.svgz, *.tif, *.tiff, *.ai, *.drw, *.pct, *.psp, *.xcf, *.psd and *.raw filters for file extensions.</td>
- </tr>
- <tr>
- <td><code>filterXML</code></td>
- <td><code>0x010</code></td>
- <td>Corresponds to the *.xml filter for file extensions.</td>
- </tr>
- <tr>
- <td><code>filterXUL</code></td>
- <td><code>0x020</code></td>
- <td>Corresponds to the *.xul filter for file extensions.</td>
- </tr>
- <tr>
- <td><code>filterApps</code></td>
- <td><code>0x040</code></td>
- <td>Corresponds to the platform specific application filter for file extensions. Application files for the user's platform will pass through the filter.</td>
- </tr>
- <tr>
- <td><code>filterAllowURLs</code></td>
- <td><code>0x80</code></td>
- <td>Allow URLs. </td>
- </tr>
- <tr>
- <td><code>filterAudio</code></td>
- <td><code>0x100</code></td>
- <td>Corresponds to the *.aac, *.aif, *.flac, *.iff, *.m4a, *.m4b, *.mid, *.midi, *.mp3, *.mpa, *.mpc, *.oga, *.ogg, *.ra, *.ram, *.snd, *.wav and *.wma filters for file extensions. </td>
- </tr>
- <tr>
- <td><code>filterVideo</code></td>
- <td><code>0x200</code></td>
- <td>Corresponds to the *.avi, *.divx, *.flv, *.m4v, *.mkv, *.mov, *.mp4, *.mpeg, *.mpg, *.ogm, *.ogv, *.ogx, *.rm, *.rmvb, *.smil, *.webm, *.wmv and *.xvid filters for file extensions. </td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Methods" name="Methods">方法</h2>
-
-<h3 id="appendFilter()" name="appendFilter()">appendFilter()</h3>
-
-<p>Appends a custom file extension filter to the dialog. The filter appended first will be used to display the <code>nsIFilePicker</code> dialog, the user may then select another from the list.</p>
-
-<pre class="eval">void appendFilter(
- in AString title,
- in AString filter
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-
-<dl>
- <dt><code>title</code></dt>
- <dd>The title of the filter.</dd>
- <dt><code>filter</code></dt>
- <dd>The filter string. Multiple extensions may be included, separated by a semicolon and a space.</dd>
-</dl>
-
-<h6 id="appendFilter_example" name="appendFilter_example">Example</h6>
-
-<p>Some example filter strings:</p>
-
-<ul>
- <li>"*.ics"</li>
- <li>"*.txt; *.doc; *.rtf"</li>
-</ul>
-
-<h3 id="appendFilters()" name="appendFilters()">appendFilters()</h3>
-
-<p>Appends a list of file extension filters, from the predefined list, to the dialog.</p>
-
-<pre class="eval">void appendFilters(
- in long filterMask
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-
-<div class="note"><strong>Note:</strong> If <code>appendFilters</code> is the first (or only) call to set the file filters the filter with the smallest code will be used as default filter when displaying the <code>nsIFilePicker</code> dialog. If you would like to use another you must append it separately before the others you want to go into the drop down list.</div>
-
-<dl>
- <dt><code>filterMask</code></dt>
- <dd>A combination of the <a class="internal" href="#Filter_constants" title="Filter constants">filters</a> you wish to use. You may OR multiple filters together; for example <code>filterAll | filterHTML</code>.</dd>
-</dl>
-
-<h3 id="init()" name="init()">init()</h3>
-
-<p>Initialize the file picker widget. The file picker is not valid until this method is called.</p>
-
-<pre class="eval">void init(
- in nsIDOMWindow parent,
- in AString title,
- in short mode
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-
-<dl>
- <dt><code>parent</code></dt>
- <dd>The <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindow" title="">nsIDOMWindow</a></code> parent. This dialog will be dependent on this parent. Must be non-null.</dd>
- <dt><code>title</code></dt>
- <dd>The file picker dialog title. If this is <code>null</code>, the dialog will have the default title.</dd>
- <dt><code>mode</code></dt>
- <dd>One of the <a class="internal" href="#Mode_constants" title="Mode constants">mode constants</a>, indicating the type of picker to create.</dd>
-</dl>
-
-<h3 id="open">open</h3>
-
-<p>Opens the file dialog asynchrounously. The passed in object's done method will be called upon completion.</p>
-
-<pre class="eval">void open(
- in nsIFilePickerShownCallback aFilePickerShownCallback
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-
-<dl>
- <dt><code>aFilePickerShownCallback</code></dt>
- <dd>The <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFilePickerShownCallback" title="">nsIFilePickerShownCallback</a></code> to be called on completion.</dd>
-</dl>
-
-<h3 id="show">show</h3>
-
-<p>Displays the file picker dialog. The dialog is displayed modally.</p>
-
-<pre class="eval">short show();
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-
-<p>None.</p>
-
-<h6 id="Return_value" name="Return_value">Return value</h6>
-
-<p>One of the <a class="internal" href="#Return_value_constants" title="Return value constants">return constants</a>.</p>
-
-<h2 id="Example" name="Example">示例</h2>
-
-<p>Here's an example:</p>
-
-<pre>const nsIFilePicker = Components.interfaces.nsIFilePicker;
-
-var fp = Components.classes["@mozilla.org/filepicker;1"]
- .createInstance(nsIFilePicker);
-fp.init(window, "Dialog Title", nsIFilePicker.modeOpen);
-fp.appendFilters(nsIFilePicker.filterAll | nsIFilePicker.filterText);
-
-var rv = fp.show();
-if (rv == nsIFilePicker.returnOK || rv == nsIFilePicker.returnReplace) {
- var file = fp.file;
- // Get the path as string. Note that you usually won't
- // need to work with the string paths.
- var path = fp.file.path;
- // work with returned nsILocalFile...
-}
-</pre>
-
-<p>If your code is a component and <code>window</code> is not defined, you can get one using <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIWindowMediator" title="">nsIWindowMediator</a></code>.</p>
-
-<p>When selecting multiple files:</p>
-
-<pre> ....
- fp.init(window, "Dialog Title", nsIFilePicker.modeOpenMultiple);
- ....
-
- var files = fp.files;
- var paths = [];
- while (files.hasMoreElements())
- {
- var arg = files.getNext().QueryInterface(Components.interfaces.nsILocalFile).path;
- paths.push(arg);
- }
-</pre>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsihttpchannel/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsihttpchannel/index.html
deleted file mode 100644
index b469773f43..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsihttpchannel/index.html
+++ /dev/null
@@ -1,365 +0,0 @@
----
-title: nsIHttpChannel
-slug: Mozilla/Tech/XPCOM/Reference/Interface/nsIHttpChannel
-translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIHttpChannel
----
-<p></p><div style="border: solid #ddd 2px; margin-bottom: 12px;">
-<div style="background: #eee; padding: 2px;"><code><a href="https://dxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/nsIHttpChannel.idl" rel="custom">netwerk/protocol/http/nsIHttpChannel.idl</a></code><span style="text-align: right; float: right;"><a href="/zh-CN/docs/Interfaces/About_Scriptable_Interfaces" style="color: #00cc00; font-weight: 700;">脚本化</a></span></div>
-<span style="padding: 4px 2px;">
-
-This interface allows for the modification of HTTP request parameters and the inspection of the resulting HTTP response status and headers when they become available.
-</span>
-
-<div style="background: #eee; padding: 2px;">
-继承于: <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIChannel" title="">nsIChannel</a></code>
-<span style="text-align: right; float: right;">最后修改于Gecko 1.3 </span></div>
-</div><p></p>
-
-<p>To create an HTTP channel, use <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIIOService" title="">nsIIOService</a></code> with a HTTP URI, for example:</p>
-
-<pre class="eval">var ios = Components.classes["@mozilla.org/network/io-service;1"]
- .getService(Components.interfaces.nsIIOService);
-var ch = ios.newChannel("<a class="linkification-ext external" href="http://www.example.com/" title="Linkification: http://www.example.com/">http://www.example.com/</a>", null, null);
-</pre>
-
-<h2 id="Method_overview" name="Method_overview">方法概述</h2>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>ACString <a href="#getRequestHeader()">getRequestHeader</a>(in ACString aHeader);</code></td>
- </tr>
- <tr>
- <td><code>ACString <a href="#getResponseHeader()">getResponseHeader</a>(in ACString header);</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="#isNoCacheResponse()">isNoCacheResponse</a>();</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="#isNoStoreResponse()">isNoStoreResponse</a>();</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#setRequestHeader()">setRequestHeader</a>(in ACString aHeader, in ACString aValue, in boolean aMerge);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#setResponseHeader()">setResponseHeader</a>(in ACString header, in ACString value, in boolean merge);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#visitRequestHeaders()">visitRequestHeaders</a>(in nsIHttpHeaderVisitor aVisitor);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#visitResponseHeaders()">visitResponseHeaders</a>(in nsIHttpHeaderVisitor aVisitor);</code></td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Attributes" name="Attributes">属性</h2>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">属性名</td>
- <td class="header">类型</td>
- <td class="header">描述</td>
- </tr>
- <tr>
- <td><code>allowPipelining</code></td>
- <td><code><a href="/zh-CN/boolean" title="zh-CN/boolean">boolean</a></code></td>
- <td>
- <p>This attribute is a hint to the channel to indicate whether or not the underlying HTTP transaction should be allowed to be pipelined with other transactions. This should be set to <code>false</code>, for example, if the application knows that the corresponding document is likely to be very large.</p>
-
- <p>This attribute is <code>true</code> by default, though other factors may prevent pipelining.</p>
- This attribute may only be set before the channel is opened.
-
- <h6 id="Exceptions_thrown" name="Exceptions_thrown">可能抛出的异常</h6>
-
- <dl>
- <dt><code>NS_ERROR_FAILURE</code></dt>
- <dd>If set after the channel has been opened.</dd>
- </dl>
- </td>
- </tr>
- <tr>
- <td><code>redirectionLimit</code></td>
- <td><code><a href="/zh-CN/unsigned_long" title="zh-CN/unsigned long">unsigned long</a></code></td>
- <td>
- <p>This attribute specifies the number of redirects this channel is allowed to make. If zero, the channel will fail to redirect and will generate a <code>NS_ERROR_REDIRECT_LOOP</code> failure status.</p>
- <div class="blockIndicator note"><strong>Note:</strong> An HTTP redirect results in a new channel being created. If the new channel supports <code>nsIHttpChannel</code>, then it will be assigned a value to its <code>redirectionLimit</code> attribute one less than the value of the redirected channel's <code>redirectionLimit</code> attribute. The initial value for this attribute may be a configurable preference (depending on the implementation).</div></td>
- </tr>
- <tr>
- <td><code>referrer</code></td>
- <td><code><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIURI" title="">nsIURI</a></code></code></td>
- <td>
- <p>Get or set the URI of the HTTP <code>Referer:</code> header. This is the address (URI) of the resource from which this channel's URI was obtained (see RFC2616 section 14.36).</p>
-
- <p>This attribute may only be set before the channel is opened.</p>
- <div class="blockIndicator note"><strong>Note:</strong> The channel may silently refuse to set the Referer: header if the URI does not pass certain security checks (e.g., a "https://" URL will never be sent as the <code>referrer</code> for a plaintext HTTP request). The implementation is not required to throw an exception when the <code>referrer</code> URI is rejected.</div>
-
- <h6 id="Exceptions_thrown" name="Exceptions_thrown">可能抛出的异常</h6>
-
- <dl>
- <dt><code>NS_ERROR_IN_PROGRESS</code></dt>
- <dd>If set after the channel has been opened.</dd>
- </dl>
- </td>
- </tr>
- <tr>
- <td><code>requestMethod</code></td>
- <td><code><a href="/zh-CN/ACString" title="zh-CN/ACString">ACString</a></code></td>
- <td>
- <p>获取或设置HTTP请求方法(默认为"GET").设置时不区分大小写,获取时返回的都是大写字母组成的字符串.</p>
-
- <p>该属性的值只能在通道打开之前进行设置.</p>
-
- <p></p><div class="blockIndicator note"><strong>Note:</strong>  The data for a "POST" or "PUT" request can be configured via <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIUploadChannel" title="">nsIUploadChannel</a></code>. However, after setting the upload data, it may be necessary to set the request method explicitly. The documentation for <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIUploadChannel" title="">nsIUploadChannel</a></code> has further details. </div><p></p>
-
- <h6 id="Exceptions_thrown" name="Exceptions_thrown">可能抛出的异常</h6>
-
- <dl>
- <dt><code>NS_ERROR_IN_PROGRESS</code></dt>
- <dd>If set after the channel has been opened.</dd>
- </dl>
- </td>
- </tr>
- <tr>
- <td><code>requestSucceeded</code></td>
- <td><code><a href="/zh-CN/boolean" title="zh-CN/boolean">boolean</a></code></td>
- <td>
- <p>Returns <code>true</code> if the HTTP response code indicates success. The value of <code><a href="https://developer.mozilla.org/zh-CN/docs/XPCOM_Interface_Reference/nsIRequest#status()">nsIRequest.status()</a></code> will be NS_OK even when processing a <code><a href="/zh-CN/HTTP/HTTP_response_codes#404" title="https://developer.mozilla.org/zh-CN/HTTP/HTTP_response_codes#404">404 File Not Found</a></code> response because such a response may include a message body that (in some cases) should be shown to the user. Use this attribute to distinguish server error pages from normal pages, instead of comparing the response status manually against the set of valid response codes, if that is required by your application. <strong>Read only.</strong></p>
-
- <h6 id="Exceptions_thrown" name="Exceptions_thrown">可能抛出的异常</h6>
-
- <dl>
- <dt><code>NS_ERROR_NOT_AVAILABLE</code></dt>
- <dd>If called before the response has been received (before <code>onStartRequest()</code>).</dd>
- </dl>
- </td>
- </tr>
- <tr>
- <td><code>responseStatus</code></td>
- <td><code><a href="/zh-CN/unsigned_long" title="zh-CN/unsigned long">unsigned long</a></code></td>
- <td>获取HTTP响应状态码(比如200). <strong>只读.</strong>
- <h6 id="Exceptions_thrown" name="Exceptions_thrown">可能抛出的异常</h6>
-
- <dl>
- <dt><code>NS_ERROR_NOT_AVAILABLE</code></dt>
- <dd>If called before the response has been received (before <code>onStartRequest()</code>).</dd>
- </dl>
- </td>
- </tr>
- <tr>
- <td><code>responseStatusText</code></td>
- <td><code><a href="/zh-CN/ACString" title="zh-CN/ACString">ACString</a></code></td>
- <td>
- <p>获取HTTP响应状态信息(比如"OK").</p>
- <div class="blockIndicator note"><strong>Note:</strong> This returns the raw (possibly 8-bit) text from the server. There are no assumptions made about the charset of the returned text. You have been warned!</div> <strong>Read only.</strong>
-
- <h6 id="Exceptions_thrown" name="Exceptions_thrown">可能抛出的异常</h6>
-
- <dl>
- <dt><code>NS_ERROR_NOT_AVAILABLE</code></dt>
- <dd>If called before the response has been received (before <code>onStartRequest()</code>).</dd>
- </dl>
- </td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Methods" name="Methods">方法</h2>
-
-<h3 id="getRequestHeader()" name="getRequestHeader()">getRequestHeader()</h3>
-
-<p>Get the value of a particular request header.</p>
-
-<pre class="eval">ACString getRequestHeader(
- in ACString aHeader
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">参数</h6>
-
-<dl>
- <dt><code>aHeader</code></dt>
- <dd>需要查询的请求头名称,不区分大小写(比如"Cache-Control").</dd>
-</dl>
-
-<h6 id="Return_value" name="Return_value">返回值</h6>
-
-<p>指定请求头的值.</p>
-
-<h6 id="Exceptions_thrown" name="Exceptions_thrown">可能抛出的异常</h6>
-
-<dl>
- <dt><code>NS_ERROR_NOT_AVAILABLE</code></dt>
- <dd>如果没有这个请求头</dd>
-</dl>
-
-<h3 id="getResponseHeader()" name="getResponseHeader()">getResponseHeader()</h3>
-
-<p>获取指定响应头的值.</p>
-
-<pre class="eval">ACString getResponseHeader(
- in ACString header
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">参数</h6>
-
-<dl>
- <dt><code>header</code></dt>
- <dd>需要查询的响应头名称,不区分大小写(比如"Set-Cookie").</dd>
-</dl>
-
-<h6 id="Return_value" name="Return_value">返回值</h6>
-
-<p>指定响应头的值.</p>
-
-<h6 id="Exceptions_thrown" name="Exceptions_thrown">可能抛出的异常</h6>
-
-<dl>
- <dt><code>NS_ERROR_NOT_AVAILABLE</code></dt>
- <dd>在响应头还未完全返回的时候调用了该方法(before <code>onStartRequest()</code>),或者响应中没有包含此响应头的情况下.</dd>
-</dl>
-
-<h3 id="isNoCacheResponse()" name="isNoCacheResponse()">isNoCacheResponse()</h3>
-
-<p>Returns <code>true</code> if the server sent the equivalent of a "Cache-Control: no-cache" response header. Equivalent response headers include: "Pragma: no-cache", "Expires: 0", and "Expires" with a date value in the past relative to the value of the "Date" header.</p>
-
-<pre class="eval">boolean isNoCacheResponse();
-</pre>
-
-<h6 id="Parameters" name="Parameters">参数</h6>
-
-<p>无</p>
-
-<h6 id="Return_value" name="Return_value">返回值</h6>
-
-<p>如果服务器返回了"Cache-control: no-cache"或者其他能够禁止缓存的响应头,则<code>该方法返回true</code>,否则返回<code>false</code>.</p>
-
-<h6 id="Exceptions_thrown" name="Exceptions_thrown">可能抛出的异常</h6>
-
-<dl>
- <dt><code>NS_ERROR_NOT_AVAILABLE</code></dt>
- <dd>在响应头还未完全返回的时候调用了该方法(before <code>onStartRequest()</code>).</dd>
-</dl>
-
-<h3 id="isNoStoreResponse()" name="isNoStoreResponse()">isNoStoreResponse()</h3>
-
-<pre class="eval">boolean isNoStoreResponse();
-</pre>
-
-<h6 id="Parameters" name="Parameters">参数</h6>
-
-<p>无</p>
-
-<h6 id="Return_value" name="Return_value">返回值</h6>
-
-<p>如果服务器返回了"Cache-Control: no-store"这样的响应头,则<code>该方法返回true</code>,否则返回<code>false</code>.</p>
-
-<h6 id="Exceptions_thrown" name="Exceptions_thrown">可能抛出的异常</h6>
-
-<dl>
- <dt><code>NS_ERROR_NOT_AVAILABLE</code></dt>
- <dd>在响应头还未完全返回的时候调用了该方法(before <code>onStartRequest()</code>).</dd>
-</dl>
-
-<h3 id="setRequestHeader()" name="setRequestHeader()">setRequestHeader()</h3>
-
-<p>This method is called to set the value of a particular request header. This method allows, for example, the cookies module to add "Cookie" headers to the outgoing HTTP request. This method may only be called before the channel is opened. If aValue is empty and aMerge is <code>false</code>, the header will be cleared.</p>
-
-<pre class="eval">void setRequestHeader(
- in ACString aHeader,
- in ACString aValue,
- in boolean aMerge
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">参数</h6>
-
-<dl>
- <dt><code>aHeader</code></dt>
- <dd>指定请求头的名称,不区分大小写(例如"Cookie").</dd>
- <dt><code>aValue</code></dt>
- <dd>指定请求头的值(例如"X=1").</dd>
- <dt><code>aMerge</code></dt>
- <dd>如果该参数为<code>true</code>,则新指定的请求头的值会合并到该请求头已有的值的后面.如果指定的请求头不支持(或者说不适合)新旧值的合并操作,则这个参数会被忽略(比如"<span>Connection</span>"头就只能有一个值).具体那些请求头会忽略掉这个参数,本文档不会给出.如果该参数的值为<code>false</code>,则新指定的请求头的值会覆盖掉该请求头已有的值.</dd>
-</dl>
-
-<h6 id="Exceptions_thrown" name="Exceptions_thrown">可能抛出的异常</h6>
-
-<dl>
- <dt><code>NS_ERROR_IN_PROGRESS</code></dt>
- <dd>在通道已经打开之后才调用了该方法</dd>
-</dl>
-
-<h3 id="setResponseHeader()" name="setResponseHeader()">setResponseHeader()</h3>
-
-<p>设置指定响应头的值.This method allows, for example, the HTML content sink to inform the HTTP channel about HTTP-EQUIV headers found in HTML &lt;META&gt; tags. If value is empty and merge is <code>false</code>, the header will be cleared.</p>
-
-<pre class="eval">void setResponseHeader(
- in ACString header,
- in ACString value,
- in boolean merge
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">参数</h6>
-
-<dl>
- <dt><code>header</code></dt>
- <dd>指定响应头的名称,不区分大小写(例如"Cache-Control").</dd>
- <dt><code>value</code></dt>
- <dd>指定响应头的值(例如"no-cache").</dd>
- <dt><code>merge</code></dt>
- <dd>如果该参数为<code>true</code>,则新指定的响应头的值会合并到该响应头已有的值的后面.如果指定的响应头不支持(或者说不适合)新旧值的合并操作,则这个参数会被忽略(比如"Content-Type"头就只能有一个值).具体那些响应头会忽略掉这个参数,本文档不会给出.如果该参数的值为<code>false</code>,则新指定的响应头的值会覆盖掉该响应头已有的值.</dd>
-</dl>
-
-<h6 id="Exceptions_thrown" name="Exceptions_thrown">可能抛出的异常</h6>
-
-<dl>
- <dt><code>NS_ERROR_NOT_AVAILABLE</code></dt>
- <dd>在响应头还未完全返回的时候调用了该方法(before <code>onStartRequest()</code>).</dd>
- <dt><code>NS_ERROR_ILLEGAL_VALUE</code></dt>
- <dd>If changing the value of this response header is not allowed.</dd>
-</dl>
-
-<h3 id="visitRequestHeaders()" name="visitRequestHeaders()">visitRequestHeaders()</h3>
-
-<p>Call this method to visit all request headers. Calling <code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIHttpChannel#setRequestHeader()">setRequestHeader()</a></code> while visiting request headers has undefined behavior. Don't do it!</p>
-
-<pre class="eval">void visitRequestHeaders(
- in nsIHttpHeaderVisitor aVisitor
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">参数</h6>
-
-<dl>
- <dt><code>aVisitor</code></dt>
- <dd>The header visitor instance.</dd>
-</dl>
-
-<h3 id="visitResponseHeaders()" name="visitResponseHeaders()">visitResponseHeaders()</h3>
-
-<p>Call this method to visit all response headers.</p>
-
-<p>{</p><div class="warning"> Calling <code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIHttpChannel#setResponseHeader()">setResponseHeader()</a></code> while visiting response headers has undefined behavior. Don't do it! </div><p></p>
-
-<pre class="eval">void visitResponseHeaders(
- in nsIHttpHeaderVisitor aVisitor
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">参数</h6>
-
-<dl>
- <dt><code>aVisitor</code></dt>
- <dd>The header visitor instance.</dd>
-</dl>
-
-<h6 id="Exceptions_thrown" name="Exceptions_thrown">可能抛出的异常</h6>
-
-<dl>
- <dt><code>NS_ERROR_NOT_AVAILABLE</code></dt>
- <dd>If called before the response has been received (before <code>onStartRequest()</code>).</dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiidleservice/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiidleservice/index.html
deleted file mode 100644
index a0dec4ad73..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiidleservice/index.html
+++ /dev/null
@@ -1,119 +0,0 @@
----
-title: nsIIdleService
-slug: Mozilla/Tech/XPCOM/Reference/Interface/nsIIdleService
-translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIIdleService
----
-<p><span class="lang lang-en"><code>nsIIdleService </code>的定义文档是:<span class="lang lang-en"><a class="external" href="http://mxr.mozilla.org/mozilla-central/source/widget/public/nsIIdleService.idl" rel="external nofollow" title="http://mxr.mozilla.org/mozilla-central/source/widget/public/nsIIdleService.idl"><code>widget/public/nsIIdleService.idl</code></a> </span>。 It is <span class="lang lang-en"><a href="../../../../en/Interfaces/About_Scriptable_Interfaces" rel="internal">scriptable</a> </span> and <span class="lang lang-en"> <a href="../../../../en/Interfaces/About_Frozen_Interfaces" rel="internal">unfrozen</a> (hasn't changed since Mozilla 1.9a) </span>. </span></p>
-<h2 id="Summary" name="Summary">概要</h2>
-<p>该服务可使您监测到空闲时间,例如,用户没有进行鼠标或者键盘等操作。您可直接捕获到空闲的时间,但一般,需要注册一个监听。</p>
-<p>目前<code> nsIIdleService</code> 服务在 Windows, Mac OS X, and Linux (via XScreenSaver) 等系统上都已实现。</p>
-<p>实现: <code>@mozilla.org/widget/idleservice;1</code>。创建实例如:</p>
-<pre class="eval">var idleService = Components.classes["@mozilla.org/widget/idleservice;1"]
- .getService(Components.interfaces.nsIIdleService)
-</pre>
-<h2 id="Method_overview" name="Method_overview">方法预览</h2>
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>void <a href="#addIdleObserver.28.29">addIdleObserver</a>(in <a href="/en/nsIObserver" title="en/nsIObserver">nsIObserver</a> observer, in unsigned long time)</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#removeIdleObserver.28.29">removeIdleObserver</a>(in <a href="/en/nsIObserver" title="en/nsIObserver">nsIObserver</a> observer, in unsigned long time)</code></td>
- </tr>
- </tbody>
-</table>
-<h2 id="Attributes" name="Attributes">属性</h2>
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">属性</td>
- <td class="header">类型</td>
- <td class="header">描述</td>
- </tr>
- <tr>
- <td><code>idleTime</code></td>
- <td><code>long</code></td>
- <td>The amount of time in milliseconds that has passed since the last user activity. <em>Read only.</em></td>
- </tr>
- </tbody>
-</table>
-<h2 id="Methods" name="Methods">方法</h2>
-<h3 id="addIdleObserver.28.29" name="addIdleObserver.28.29">addIdleObserver()</h3>
-<p>添加一个observer,用于侦听使用者何时离开,及何时归来。</p>
-<pre class="eval">void addIdleObserver(
- in nsIObserver observer,
- in unsigned long time
-)
-</pre>
-<h6 id="Parameters" name="Parameters">参数 </h6>
-<dl>
- <dt>
- <code>observer</code></dt>
- <dd>
- The <a href="/en/nsIObserver" title="en/nsIObserver">observer</a> to be notified.</dd>
-</dl>
-<dl>
- <dt>
- <code>time</code></dt>
- <dd>
-    使用者离开多少秒钟后,开始侦听。</dd>
-</dl>
-<h6 id="Remarks" name="Remarks">备注</h6>
-<ul>
- <li>observer 侦听的 subject 一直是 nsIIdleSerivce 。当空闲时, observer 的 topic 是 'idle' , 当他回来时,将为 'back' 。侦听的参数中包含当前使用空闲的时间。</li>
-</ul>
-<ul>
- <li>相同的 observer 可以添加两次。</li>
-</ul>
-<ul>
- <li>大多数实现需要自己在 OS 中查询 idle 信息,侦听可能会出现延迟,这取决于在实现中查询的间隔时间的长度。当前实现中使用的是 5 秒钟的延迟时间。</li>
-</ul>
-<p></p><div class="blockIndicator geckoMinVer standardNote">
- <div style="text-align: center; font-weight: bold; padding-bottom: 0.5em;">Gecko 1.9.2 note</div>
- <div>从版本 Gecko 1.9.2 开始,增加一个新的侦听消息:‘idle-daily’ 。</div>
-</div><p></p>
-<h3 id="removeIdleObserver.28.29" name="removeIdleObserver.28.29">removeIdleObserver()</h3>
-<p>删除observer。</p>
-<pre class="eval">void removeIdleObserver(
- in nsIObserver observer,
- in unsigned long time
-)
-</pre>
-<h6 id="Parameters_2" name="Parameters_2">参数</h6>
-<dl>
- <dt>
- <code>observer</code></dt>
- <dd>
- the <a href="/en/nsIObserver" title="en/nsIObserver">observer</a> to be removed</dd>
-</dl>
-<dl>
- <dt>
- <code>time</code></dt>
- <dd>
- 消息侦听的时间(一段时间)。</dd>
-</dl>
-<p>备注</p>
-<p>删除 observer 时,根据指定的 idle 时间来删除。如果已经添加了多个 observer ,则需要删除多次。</p>
-<h2 id="Example_Code" name="Example_Code">示例:</h2>
-<p>例一:</p>
-<pre class="eval">var idleService = Components.classes["@mozilla.org/widget/idleservice;1"]
- .getService(Components.interfaces.nsIIdleService)
-setTimeout(function() { alert(idleService.idleTime) }, 1000)
-// if you don't use the mouse or the keyboard after running this snippet,
-// you'll see a number around 1000 alerted.
-</pre>
-<p>例二:</p>
-<pre class="eval">var idleService = Components.classes["@mozilla.org/widget/idleservice;1"]
- .getService(Components.interfaces.nsIIdleService)
-var idleObserver = {
- observe: function(subject, topic, data) {
- alert("topic: " + topic + "\ndata: " + data);
- }
-};
-idleService.addIdleObserver(idleObserver, 60); // one minute
-// ...
-// Don't forget to remove the observer using removeIdleObserver!
-idleService.removeIdleObserver(idleObserver, 60);
-</pre>
-<p><span class="comment">Interwiki Language Links</span></p>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsilocalfile/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsilocalfile/index.html
deleted file mode 100644
index 882450bf87..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsilocalfile/index.html
+++ /dev/null
@@ -1,478 +0,0 @@
----
-title: nsILocalFile
-slug: Mozilla/Tech/XPCOM/Reference/Interface/nsILocalFile
-translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsILocalFile
----
-<p> </p>
-
-<div class="note">
-<p>In <span title="(Firefox 14 / Thunderbird 14 / SeaMonkey 2.11)">Gecko 14</span> this Interface was merged into the <code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFile" title="">nsIFile</a></code> interface.</p>
-</div>
-
-<p> </p>
-
-<p></p><div style="border: solid #ddd 2px; margin-bottom: 12px;">
-<div style="background: #eee; padding: 2px;"><code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/io/nsILocalFile.idl" rel="custom">xpcom/io/nsILocalFile.idl</a></code><span style="text-align: right; float: right;"><a href="/zh-CN/docs/Interfaces/About_Scriptable_Interfaces" style="color: #00cc00; font-weight: 700;">脚本化</a></span></div>
-<span style="padding: 4px 2px;">
-
-This interface adds methods to <code>nsIFile</code> that are particular to a file that is accessible via the local file system.
-</span>
-
- <div style="height: 42px; position: relative; padding: 2px; width: auto;">
-
- <div style="top: 22px; font-size: 11px; position: absolute; left: 0px; text-align: right; float: right; width: 100%;">66</div>
-
-<div style="height: 8px; top: 16px; left: 0%; background: #00dd00; position: absolute; width: 25.71428571428571%;" title="Introduced in Gecko 1.0 "></div>
-
-<div style="top: 0px; font-size: 11px; position: absolute; left: 0%;">Introduced</div>
-<div style="top: 22px; font-size: 11px; position: absolute; left: 0%;">Gecko 1.0</div>
-
- <div style="height: 8px; top: 16px; left: 25.71428571428571%; background: #ff8000; position: absolute; width: 74.28571428571429%;" title="Deprecated in Gecko 14 (Firefox 14 / Thunderbird 14 / SeaMonkey 2.11)"></div>
-
- <div style="top: 0px; font-size: 11px; position: absolute; left: 25.71428571428571%;">Deprecated</div>
- <div style="top: 22px; font-size: 11px; position: absolute; left: 25.71428571428571%;">Gecko 14</div>
-
-</div>
-
-<div style="background: #eee; padding: 2px;">
-继承于: <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFile" title="">nsIFile</a></code>
-<span style="text-align: right; float: right;">最后修改于Gecko 1.0 </span></div>
-</div><p></p>
-
-<p>Implemented by: <code>@mozilla.org/file/local;1</code>. To create an instance, use:</p>
-
-<pre class="eval">var localFile = Components.classes["@mozilla.org/file/local;1"]
- .createInstance(Components.interfaces.nsILocalFile);
-</pre>
-
-<h2 id="Method_overview" name="Method_overview">Method overview</h2>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>void <a href="#appendRelativeNativePath()">appendRelativeNativePath</a>(in ACString relativeFilePath);</code> <span class="inlineIndicator noscript noscriptInline" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span></td>
- </tr>
- <tr>
- <td><code>void <a href="#appendRelativePath()">appendRelativePath</a>(in AString relativeFilePath);</code></td>
- </tr>
- <tr>
- <td><code>ACString <a href="#getRelativeDescriptor()">getRelativeDescriptor</a>(in nsILocalFile fromFile);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#initWithFile()">initWithFile</a>(in nsILocalFile aFile);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#initWithNativePath()">initWithNativePath</a>(in ACString filePath);</code> <span class="inlineIndicator noscript noscriptInline" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span></td>
- </tr>
- <tr>
- <td><code>void <a href="#initWithPath()">initWithPath</a>(in AString filePath);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#launch()">launch</a>();</code></td>
- </tr>
- <tr>
- <td><code>PRLibraryStar <a href="#load()">load</a>();</code> <span class="inlineIndicator noscript noscriptInline" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span></td>
- </tr>
- <tr>
- <td><code>FILE <a href="#openANSIFileDesc()">openANSIFileDesc</a>(in string mode);</code> <span class="inlineIndicator noscript noscriptInline" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span></td>
- </tr>
- <tr>
- <td><code>PRFileDescStar <a href="#openNSPRFileDesc()">openNSPRFileDesc</a>(in long flags, in long mode);</code> <span class="inlineIndicator noscript noscriptInline" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span></td>
- </tr>
- <tr>
- <td><code>void <a href="#reveal()">reveal</a>();</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#setRelativeDescriptor()">setRelativeDescriptor</a>(in nsILocalFile fromFile, in ACString relativeDesc);</code></td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Attributes" name="Attributes">Attributes</h2>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">Attribute</td>
- <td class="header">Type</td>
- <td class="header">Description</td>
- </tr>
- <tr>
- <td><code>diskSpaceAvailable</code></td>
- <td><code><a href="/zh-cn/PRInt64" title="zh-cn/PRInt64">PRInt64</a></code></td>
- <td>The number of bytes available to non-superuser on the disk volume containing the <code>nsILocalFile</code>. <strong>Read only.</strong></td>
- </tr>
- <tr>
- <td><code>followLinks</code></td>
- <td><code><a href="/zh-cn/PRBool" title="zh-cn/PRBool">PRBool</a></code></td>
- <td>
- <p>Determines whether or not the <code>nsILocalFile</code> will automatically resolve symbolic links.</p>
- By default, this value is <code>false</code> on all non-UNIX systems. As of Mozilla 1.7, this attribute is ignored on UNIX systems.</td>
- </tr>
- <tr>
- <td><code>persistentDescriptor</code></td>
- <td><code><a href="/zh-cn/ACString" title="zh-cn/ACString">ACString</a></code></td>
- <td>
- <p>On some platforms, the value of <a href="https://developer.mozilla.org/zh-CN/docs/XPCOM_Interface_Reference/nsIFile#path">nsIFile.path</a> may be insufficient to uniquely identify the file on the local file system. The persistent descriptor is intended to be used whenever a <code>nsILocalFile</code> needs to be serialized to disk and later recovered. This string is not intended for display to users.</p>
- <div class="blockIndicator note"><strong>Note:</strong> The value of the <code>followLinks</code> attribute is not encoded in the persistent descriptor.</div></td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Constants" name="Constants">Constants</h2>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">Constant</td>
- <td class="header">Value</td>
- <td class="header">Description</td>
- </tr>
- <tr>
- <td><code>DELETE_ON_CLOSE</code></td>
- <td><code>0x80000000</code></td>
- <td>Optional parameter used by <code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsILocalFile#openNSPRFileDesc()">openNSPRFileDesc()</a></code>. </td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Methods" name="Methods">Methods</h2>
-
-<p></p><div><span class="indicatorInHeadline noscript noscriptMethod" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span><h3 id="appendRelativeNativePath">appendRelativeNativePath</h3></div><p></p>
-
-<p>Appends a relative, native character encoding, path to the current path of the <code>nsILocalFile</code> object.</p>
-
-<pre class="eval">void appendRelativeNativePath(
- in ACString relativeFilePath
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-
-<dl>
- <dt><code>relativeFilePath</code></dt>
- <dd>A native relative path. For security reasons, this cannot contain '..' or cannot start with a directory separator '.'. Must be in the native file system character set.</dd>
-</dl>
-
-<h6 id="Exceptions_thrown" name="Exceptions_thrown">Exceptions thrown</h6>
-
-<dl>
- <dt><code>NS_ERROR_FILE_UNRECOGNIZED_PATH</code></dt>
- <dd>Indicates that <code>relativeFilePath</code> incorrectly begins with a path separator character or otherwise contains invalid characters.</dd>
-</dl>
-
-<h3 id="appendRelativePath()" name="appendRelativePath()">appendRelativePath()</h3>
-
-<p>Appends a relative native path to the current path of the <code>nsILocalFile</code> object.</p>
-
-<pre class="eval">void appendRelativePath(
- in AString relativeFilePath
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-
-<dl>
- <dt><code>relativeFilePath</code></dt>
- <dd>A native relative path. For security reasons, this cannot contain '..' or cannot start with a directory separator '.' .</dd>
-</dl>
-
-<h6 id="Exceptions_thrown" name="Exceptions_thrown">Exceptions thrown</h6>
-
-<dl>
- <dt><code>NS_ERROR_FILE_UNRECOGNIZED_PATH</code></dt>
- <dd>Indicates that <code>relativeFilePath</code> incorrectly begins with a path separator character or otherwise contains invalid characters.</dd>
-</dl>
-
-<h3 id="getRelativeDescriptor()" name="getRelativeDescriptor()">getRelativeDescriptor()</h3>
-
-<p>Returns a relative file path in an opaque, cross platform format. It is therefore not a native path.</p>
-
-<pre class="eval">ACString getRelativeDescriptor(
- in nsILocalFile fromFile
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-
-<dl>
- <dt><code>fromFile</code></dt>
- <dd>The file from which the descriptor is relative. There is no defined result if this parameter is <code>null</code>.</dd>
-</dl>
-
-<h6 id="Return_value" name="Return_value">Return value</h6>
-
-<p>An opaque string value with undefined character encoding. This string is not intended for display to users.</p>
-
-<p>The result returned from this method may be used with <code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsILocalFile#setRelativeDescriptor()">setRelativeDescriptor()</a></code> to initialize a <code>nsILocalFile</code> instance.</p>
-
-<h3 id="initWithFile()" name="initWithFile()">initWithFile()</h3>
-
-<p>Initializes this object with another file.</p>
-
-<pre class="eval">void initWithFile(
- in nsILocalFile aFile
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-
-<dl>
- <dt><code>aFile</code></dt>
- <dd>The file this becomes equivalent to.</dd>
-</dl>
-
-<p></p><div><span class="indicatorInHeadline noscript noscriptMethod" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span><h3 id="initWithNativePath">initWithNativePath</h3></div><p></p>
-
-<p>Used to set the full path that this <code>nsILocalFile</code> references. All current settings will be reset.</p>
-
-<pre class="eval">void initWithNativePath(
- in ACString filePath
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-
-<dl>
- <dt><code>filePath</code></dt>
- <dd>A string that specifies a platform-specific, full path to a file or directory. Must be in the native file system character set.</dd>
-</dl>
-
-<h6 id="Exceptions_thrown" name="Exceptions_thrown">Exceptions thrown</h6>
-
-<dl>
- <dt><code>NS_ERROR_FILE_UNRECOGNIZED_PATH</code></dt>
- <dd>Indicates that FilePath is not an absolute file path.</dd>
-</dl>
-
-<h3 id="initWithPath()" name="initWithPath()">initWithPath()</h3>
-
-<p>Used to set the full path that this <code>nsILocalFile</code> references. All current settings will be reset.</p>
-
-<pre class="eval">void initWithPath(
- in AString filePath
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-
-<dl>
- <dt><code>filePath</code></dt>
- <dd>A string that specifies a platform-specific, full path to a file or directory.</dd>
-</dl>
-
-<h6 id="Exceptions_thrown" name="Exceptions_thrown">Exceptions thrown</h6>
-
-<dl>
- <dt><code>NS_ERROR_FILE_UNRECOGNIZED_PATH</code></dt>
- <dd>Indicates that FilePath is not an absolute file path.</dd>
-</dl>
-
-<h3 id="launch()" name="launch()">launch()</h3>
-
-<p>Requests that the operating system attempt to open this file.</p>
-
-<pre class="eval">void launch();
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-
-<p>None.</p>
-
-<p></p><div><span class="indicatorInHeadline noscript noscriptMethod" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span><h3 id="load">load</h3></div><p></p>
-
-<p>Returns the result of <a href="/zh-cn/PR_LoadLibrary" title="zh-cn/PR LoadLibrary"><code>PR_LoadLibrary()</code></a> on the file. The caller is responsible for calling <a href="/zh-cn/PR_UnloadLibrary" title="zh-cn/PR UnloadLibrary"><code>PR_UnloadLibrary()</code></a> on the result.</p>
-
-<pre class="eval">PRLibraryStar load();
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-
-<p>None.</p>
-
-<h6 id="Return_value" name="Return_value">Return value</h6>
-
-<p>A pointer to a <a href="/zh-cn/PRLibrary" title="zh-cn/PRLibrary"><code>PRLibrary</code></a>.</p>
-
-<h6 id="Example" name="Example">Example</h6>
-
-<pre class="brush: cpp">#include "prlink.h"
-#include "nsError.h"
-#include "nsILocalFile.h"
-
-// Load the DLL corresponding to the given nsILocalFile...
-
-nsresult LoadDLL(nsILocalFile *aLocalFile)
-{
- PRLibrary *dll;
- nsresult rv = aLocalFile-&gt;Load(&amp;dll);
- if (NS_FAILED(rv))
- return rv;
-
- // Do something with the library now that it is open...
-
- PR_FreeLibrary(dll);
- return NS_OK;
-}
-</pre>
-
-<p></p><div><span class="indicatorInHeadline noscript noscriptMethod" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span><h3 id="openANSIFileDesc">openANSIFileDesc</h3></div><p></p>
-
-<p>Returns the result of <code>fopen()</code> on the file. The caller is responsible for calling <code>fclose()</code> on the result.</p>
-
-<pre class="eval">FILE openANSIFileDesc(
- in string mode
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-
-<dl>
- <dt><code>mode</code></dt>
- <dd>An ANSI file open mode string, which will be passed to <code>fopen()</code>.</dd>
-</dl>
-
-<h6 id="Return_value" name="Return_value">Return value</h6>
-
-<p>A pointer to an ANSI <code>FILE</code> type.</p>
-
-<h6 id="Example" name="Example">Example</h6>
-
-<pre class="brush: cpp">#include &lt;stdio.h&gt;
-#include "nsError.h"
-#include "nsILocalFile.h"
-
-// Read the contents of a nsILocalFile...
-
-nsresult ReadLocalFile(nsILocalFile *aLocalFile)
-{
- FILE *fp;
- nsresult rv = aLocalFile-&gt;OpenANSIFileDesc("r", &amp;fp);
- if (NS_FAILED(rv))
- return rv;
-
- char buf[512];
- size_t n;
-
- while ((n = fread(buf, sizeof(buf), 1, fp)) &gt; 0)
- {
- // Do something with n-byte block of data from file...
- }
-
- if (ferror(fp) != 0)
- rv = NS_ERROR_UNEXPECTED;
-
- fclose(fp);
- return rv;
-}
-</pre>
-
-<p></p><div><span class="indicatorInHeadline noscript noscriptMethod" title="This method may only be called from C++; don't use it from JavaScript.">Native code only!</span><h3 id="openNSPRFileDesc">openNSPRFileDesc</h3></div><p></p>
-
-<p>Returns the result of <a href="/zh-cn/PR_Open" title="zh-cn/PR Open"><code>PR_Open()</code></a> on the file. The caller is responsible for calling <a href="/zh-cn/PR_Close" title="zh-cn/PR Close"><code>PR_Close()</code></a> on the result.</p>
-
-<pre class="eval">PRFileDescStar openNSPRFileDesc(
- in long flags,
- in long mode
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-
-<dl>
- <dt><code>flags</code></dt>
- <dd>
- <p>The <a href="/zh-cn/PR_Open" title="zh-cn/PR Open"><code>PR_Open()</code></a> flags from <code><a href="https://dxr.mozilla.org/mozilla-central/source/nsprpub/pr/include/prio.h" rel="custom">nsprpub/pr/include/prio.h</a></code>, plus optionally <code>DELETE_ON_CLOSE</code>. <code>DELETE_ON_CLOSE</code> may be implemented by removing the file (by path name) immediately after opening it, so beware of possible races; the file should be exclusively owned by this process.</p>
-
- <p>A bitwise combination of the following open flags:</p>
-
- <ul>
- <li><code><strong>PR_RDONLY</strong></code> Open for reading only.</li>
- <li><code><strong>PR_WRONLY</strong></code> Open for writing only.</li>
- <li><code><strong>PR_RDWR</strong></code> Open for reading and writing.</li>
- <li><code><strong>PR_CREATE_FILE</strong></code> If the file does not exist, the file is created. If the file exists, this flag has no effect.</li>
- <li><code><strong>PR_APPEND</strong></code> The file pointer is set to the end of the file prior to each write.</li>
- <li><code><strong>PR_TRUNCATE</strong></code> If the file exists, its length is truncated to 0.</li>
- <li><code><strong>PR_SYNC</strong></code> If set, each write will wait for both the file data and file status to be physically updated.</li>
- <li><code><strong>PR_EXCL</strong></code> With <code>PR_CREATE_FILE</code>, if the file does not exist, the file is created. If the file already exists, no action and null is returned.</li>
- <li><code><strong>DELETE_ON_CLOSE</strong></code> File will be deleted when closed.</li>
- </ul>
- </dd>
- <dt><code>mode</code></dt>
- <dd>A UNIX-style file permissions value. For example, the octal value 0600 may be used to limit read and write access to the current user of the system. This parameter may be ignored on systems that do not support file permissions.</dd>
-</dl>
-
-<h6 id="Return_value" name="Return_value">Return value</h6>
-
-<p>If the file is successfully opened, returns a pointer to the <a href="/zh-cn/PRFileDesc" title="zh-cn/PRFileDesc"><code>PRFileDesc</code></a> created for the newly opened file. Returns a null pointer if the open failed.</p>
-
-<h6 id="Example" name="Example">Example</h6>
-
-<pre class="brush: cpp">#include "prio.h"
-#include "nsError.h"
-#include "nsILocalFile.h"
-
-// Read the contents of a nsILocalFile...
-
-nsresult ReadLocalFile(nsILocalFile *aLocalFile)
-{
- PRFileDesc *fd;
- nsresult rv = aLocalFile-&gt;OpenNSPRFileDesc(PR_RDONLY, 0, &amp;fd);
- if (NS_FAILED(rv))
- return rv;
-
- char buf[512];
- PRInt32 n;
-
- while ((n = PR_Read(fd, buf, sizeof(buf))) &gt; 0)
- {
- // Do something with n-byte block of data from file...
- }
-
- if (n &lt; 0)
- rv = NS_ERROR_UNEXPECTED;
-
- PR_Close(fd);
- return rv;
-}
-</pre>
-
-<h3 id="reveal()" name="reveal()">reveal()</h3>
-
-<p>Ask the operating system to open the folder which contains this file or folder. This routine only works on platforms which support the ability to open a folder. See the note in the <a href="#Remarks">remarks</a> below.</p>
-
-<pre class="eval">void reveal();
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-
-<p>None.</p>
-
-<h3 id="setRelativeDescriptor()" name="setRelativeDescriptor()">setRelativeDescriptor()</h3>
-
-<p>Initializes the file to the location relative to <code>fromFile</code> using a string returned by <code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsILocalFile#getRelativeDescriptor()">getRelativeDescriptor()</a></code>.</p>
-
-<pre class="eval">void setRelativeDescriptor(
- in nsILocalFile fromFile,
- in ACString relativeDesc
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-
-<dl>
- <dt><code>fromFile</code></dt>
- <dd>The file to which the descriptor is relative.</dd>
- <dt><code>relativeDesc</code></dt>
- <dd>The relative descriptor obtained from <code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsILocalFile#getRelativeDescriptor()">getRelativeDescriptor()</a></code>.</dd>
-</dl>
-
-<h2 id="Remarks" name="Remarks">Remarks</h2>
-
-<p>The methods <code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsILocalFile#initWithNativePath()">initWithNativePath()</a></code> and <code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsILocalFile#appendRelativeNativePath()">appendRelativeNativePath()</a></code> take string valued parameters that are encoded using the native character encoding. That means, you cannot deal with files whose name contain characters outside the default code page on Windows even though Windows 2000 or later has no problem with them. Therefore, <strong>never</strong> use these functions unless you are absolutely sure that the path passed to them is <strong>always</strong> ASCII-only. See <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFile" title="">nsIFile</a></code> for more information on the native character encoding.</p>
-
-<h2 id="See_also" name="See_also">See also</h2>
-
-<ul>
- <li><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFile" title="">nsIFile</a></code></li>
-</ul>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiprocess/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiprocess/index.html
deleted file mode 100644
index 1abc109440..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiprocess/index.html
+++ /dev/null
@@ -1,283 +0,0 @@
----
-title: nsIProcess
-slug: Mozilla/Tech/XPCOM/Reference/Interface/nsIProcess
-translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIProcess
----
-<p></p><div style="border: solid #ddd 2px; margin-bottom: 12px;">
-<div style="background: #eee; padding: 2px;"><code><a href="https://dxr.mozilla.org/mozilla-central/source/xpcom/threads/nsIProcess.idl" rel="custom">xpcom/threads/nsIProcess.idl</a></code><span style="text-align: right; float: right;"><a href="/zh-CN/docs/Interfaces/About_Scriptable_Interfaces" style="color: #00cc00; font-weight: 700;">脚本化</a></span></div>
-<span style="padding: 4px 2px;">
-
-This interface represents an executable process.
-</span>
-
-<div style="background: #eee; padding: 2px;">
-继承于: <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupports" title="">nsISupports</a></code>
-<span style="text-align: right; float: right;">最后修改于Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)</span></div>
-</div><p></p>
-<p>Implemented by: <code>@mozilla.org/process/util;1</code>. To create an instance, use:</p>
-<pre class="eval">var process = Components.classes["@mozilla.org/process/util;1"]
- .createInstance(Components.interfaces.nsIProcess);
-</pre>
-<h2 id="Method_overview" name="Method_overview">Method overview</h2>
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>void <a href="#init()">init</a>(in nsIFile executable);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#initWithPid()">initWithPid</a>(in unsigned long pid);</code> <span class="inlineIndicator obsolete obsoleteInline" title="(Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)">已废弃 Gecko 1.9.2</span></td>
- </tr>
- <tr>
- <td><code>void <a href="#kill()">kill</a>();</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#run()">run</a>(in boolean blocking, [array, size_is(count)] in string args, in unsigned long count);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#runAsync()">runAsync</a>([array, size_is(count)] in string args, in unsigned long count, [optional] in nsIObserver observer, [optional] in boolean holdWeak);</code> </td>
- </tr>
- <tr>
- <td><code>void <a href="#runw()">runw</a>(in boolean blocking, [array, size_is(count)] in wstring args, in unsigned long count);</code> </td>
- </tr>
- <tr>
- <td><code>void <a href="#runwAsync()">runwAsync</a>([array, size_is(count)] in wstring args, in unsigned long count, [optional] in nsIObserver observer, [optional] in boolean holdWeak);</code> </td>
- </tr>
- </tbody>
-</table>
-<h2 id="Attributes" name="Attributes">属性</h2>
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">属性名称</td>
- <td class="header">属性类型</td>
- <td class="header">属性描述</td>
- </tr>
- <tr>
- <td><code>exitValue</code></td>
- <td><code><a href="/zh-cn/long" title="zh-cn/long">long</a></code></td>
- <td>The value returned by the process upon exit. This is only valid after the process has exited. <strong>Read only.</strong></td>
- </tr>
- <tr>
- <td><code>isRunning</code></td>
- <td><code><a href="/zh-cn/boolean" title="zh-cn/boolean">boolean</a></code></td>
- <td><code>true</code> if the process is running, otherwise <code>false</code>. Only accurate if the process was run with blocking disabled. <strong>Read only.</strong> </td>
- </tr>
- <tr>
- <td><code>location</code></td>
- <td><code><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFile" title="">nsIFile</a></code></code></td>
- <td>
- <p>The location of the executable file on disk. <strong>Read only.</strong></p>
- <p></p><div class="blockIndicator geckoMinVer standardNote">
- <div style="text-align: center; font-weight: bold; padding-bottom: 0.5em;">Gecko 1.9.1 note</div>
- <div>This attribute is no longer implemented as of Gecko 1.9.1, and is removed entirely in Gecko 1.9.2.</div>
-</div><p></p>
- </td>
- </tr>
- <tr>
- <td><code>pid</code></td>
- <td><code><a href="/zh-cn/unsigned_long" title="zh-cn/unsigned long">unsigned long</a></code></td>
- <td>The process ID of the process. This value is only available after the process has started; in addition, some platforms may not offer this value at all. <strong>Read only.</strong></td>
- </tr>
- <tr>
- <td><code>processName</code></td>
- <td><code><a href="/zh-cn/string" title="zh-cn/string">string</a></code></td>
- <td>
- <p>The name of the process. <strong>Read only.</strong></p>
- <p></p><div class="blockIndicator geckoMinVer standardNote">
- <div style="text-align: center; font-weight: bold; padding-bottom: 0.5em;">Gecko 1.9.1 note</div>
- <div>This attribute is no longer implemented as of Gecko 1.9.1, and is removed entirely in Gecko 1.9.2.</div>
-</div><p></p>
- </td>
- </tr>
- <tr>
- <td><code>processSignature</code></td>
- <td><code><a href="/zh-cn/unsigned_long" title="zh-cn/unsigned long">unsigned long</a></code></td>
- <td>
- <p>The process signature. <strong>Read only.</strong></p>
- <p></p><div class="blockIndicator geckoMinVer standardNote">
- <div style="text-align: center; font-weight: bold; padding-bottom: 0.5em;">Gecko 1.9.1 note</div>
- <div>This attribute is no longer implemented as of Gecko 1.9.1, and is removed entirely in Gecko 1.9.2.</div>
-</div><p></p>
- </td>
- </tr>
- </tbody>
-</table>
-<h2 id="Methods" name="Methods">方法</h2>
-<h3 id="init()" name="init()">init()</h3>
-<p>Initializes the <code>nsIProcess</code> with the specified executable file. Once initialized, you can start the process executing by calling <code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIProcess#run()">run()</a></code>.</p>
-<p></p><div class="blockIndicator note"><strong>Note:</strong> This function does not work with application bundles on Mac OS X, see <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=307463" title="nsProcess::init fails for Mac OS X application bundles (foo.app)">bug 307463</a> for details.</div><p></p>
-<pre class="eval">void init(
- in nsIFile executable
-);
-</pre>
-<h6 id="Parameters" name="Parameters">参数</h6>
-<dl>
- <dt>
- <code>executable</code></dt>
- <dd>
- The <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFile" title="">nsIFile</a></code> executable file to be represented by the <code>nsIProcess</code> object.</dd>
-</dl>
-<p></p><div class="headingWithIndicator">
- <h3 id="initWithPid()">initWithPid()</h3>
- <span class="indicatorInHeadline obsolete obsoleteMethod">已废弃 Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)</span>
- </div><p></p>
-<p>Initializes the <code>nsIProcess</code> to represent an existing process, given that process's ID.</p>
-<p></p><div class="blockIndicator geckoMinVer standardNote">
- <div style="text-align: center; font-weight: bold; padding-bottom: 0.5em;">Gecko 1.9.1 note</div>
- <div>This method is no longer implemented as of Gecko 1.9.1, and is removed entirely in Gecko 1.9.2.</div>
-</div><p></p>
-<pre class="eval">void initWithPid(
- in unsigned long pid
-);
-</pre>
-<h6 id="Parameters" name="Parameters">参数</h6>
-<dl>
- <dt>
- <code>pid</code></dt>
- <dd>
- The process ID to begin to represent.</dd>
-</dl>
-<h3 id="kill()" name="kill()">kill()</h3>
-<p>立即终止该<code>nsIProcess对象所代表的进程</code>,只在该进程是非阻塞方式启动的情况下才有效.</p>
-<p></p><div class="blockIndicator geckoMinVer standardNote">
- <div style="text-align: center; font-weight: bold; padding-bottom: 0.5em;">Gecko 1.9.1 note</div>
- <div>在Gecko 1.9.1 (Firefox 3.5)之前版本中, 该方法在Windows和Mac OS X下无效.目前此bug已经修复.</div>
-</div><p></p>
-<pre class="eval">void kill();
-</pre>
-<h6 id="Parameters" name="Parameters">参数</h6>
-<p>无.</p>
-<h3 id="run()" name="run()">run()</h3>
-<p>开始执行进程.</p>
-<p></p><div class="blockIndicator geckoMinVer standardNote">
- <div style="text-align: center; font-weight: bold; padding-bottom: 0.5em;">Gecko 1.9.1 note</div>
- <div>在Gecko 1.9.1 (Firefox 3.5)之前版本中,该方法会返回一个新执行进程的进程ID,目前已经不会返回任何值.</div>
-</div><p></p>
-<pre class="eval">void run(
- in boolean blocking,
- [array, size_is(count)] in string args,
- in unsigned long count
-);
-</pre>
-<h6 id="Parameters" name="Parameters">参数</h6>
-<dl>
- <dt>
- <code>blocking</code></dt>
- <dd>
- 如果为<code>true</code>,则该方法会阻塞,直到所打开的进程关闭为止,如果为<code>false</code>,则该方法会立即返回.</dd>
- <dt>
- <code>args</code></dt>
- <dd>
- An array of <code>count</code> arguments, using the native character set, to be passed to the executable on its command line.</dd>
- <dt>
- <code>count</code></dt>
- <dd>
- 参数<code>args中的参数个数</code>.</dd>
-</dl>
-<p></p><h3 id="runAsync()">runAsync()</h3><p></p>
-<p>Asynchronously runs the process with which the object was initialized, optionally calling an observer when the process finishes running.</p>
-<pre class="eval">void runAsync(
- [array, size_is(count)] in string args,
- in unsigned long count,
- in nsIObserver observer, <span class="inlineIndicator optional optionalInline">可选</span>
- in boolean holdWeak <span class="inlineIndicator optional optionalInline">可选</span>
-);
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<dl>
- <dt>
- <code>args</code></dt>
- <dd>
- An array of arguments to pass into the process, using the native character set. This array must have <code>count</code> entries.</dd>
- <dt>
- <code>count</code></dt>
- <dd>
- The number of arguments passed in the <code>args</code> array.</dd>
- <dt>
- <code>observer</code> <span class="inlineIndicator optional optionalInline">可选</span></dt>
- <dd>
- An observer that will be notified when the process exits. The observer will receive this <code>nsIProcess</code> instance as the subject and "process-finished" or "process-failed" as the topic. The observer will be notified on the main thread.</dd>
- <dt>
- <code>holdWeak</code> <span class="inlineIndicator optional optionalInline">可选</span></dt>
- <dd>
- If <code>true</code>, a <a class="internal" href="/zh-cn/Weak_reference" title="zh-cn/Weak reference">weak reference</a> is used to hold the observer.</dd>
- <dd>
-  </dd>
-</dl>
-<p></p><h3 id="runw()">runw()</h3><p></p>
-<p>Executes the file this object was initialized with.</p>
-<pre class="eval">void runw(
- in boolean blocking,
- [array, size_is(count)] in wstring args,
- in unsigned long count
-);
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<dl>
- <dt>
- <code>blocking</code></dt>
- <dd>
- If <code>true</code>, this method will block until the process terminates; if <code>false</code>, the method returns immediately.</dd>
- <dt>
- <code>args</code></dt>
- <dd>
- An array of <code>count</code> arguments, using UTF-16, to be passed to the executable on its command line.</dd>
- <dt>
- <code>count</code></dt>
- <dd>
- The number of arguments in the <code>args</code> array.</dd>
-</dl>
-<p></p><h3 id="runwAsync()">runwAsync()</h3><p></p>
-<p>Asynchronously runs the process with which the object was initialized, optionally calling an observer when the process finishes running.</p>
-<pre class="eval">void runwAsync(
- [array, size_is(count)] in wstring args,
- in unsigned long count,
- in nsIObserver observer, <span class="inlineIndicator optional optionalInline">可选</span>
- in boolean holdWeak <span class="inlineIndicator optional optionalInline">可选</span>
-);
-</pre>
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-<dl>
- <dt>
- <code>args</code></dt>
- <dd>
- An array of arguments to pass into the process, using UTF-16. This array must have <code>count</code> entries.</dd>
- <dt>
- <code>count</code></dt>
- <dd>
- The number of arguments passed in the <code>args</code> array.</dd>
- <dt>
- <code>observer</code> <span class="inlineIndicator optional optionalInline">可选</span></dt>
- <dd>
- An observer that will be notified when the process exits. The observer will receive this <code>nsIProcess</code> instance as the subject and "process-finished" or "process-failed" as the topic. The observer will be notified on the main thread.</dd>
- <dt>
- <code>holdWeak</code> <span class="inlineIndicator optional optionalInline">可选</span></dt>
- <dd>
- If <code>true</code>, a <a class="internal" href="/zh-cn/Weak_reference" title="zh-cn/Weak reference">weak reference</a> is used to hold the observer.</dd>
-</dl>
-<h2 id="See_also" name="See_also">Example</h2>
-<pre class="brush: js">// create an nsILocalFile for the executable
-var file = Components.classes["@mozilla.org/file/local;1"]
- .createInstance(Components.interfaces.nsILocalFile);
-file.initWithPath("c:\\myapp.exe");
-
-// create an nsIProcess
-var process = Components.classes["@mozilla.org/process/util;1"]
- .createInstance(Components.interfaces.nsIProcess);
-process.init(file);
-
-// Run the process.
-// If first param is true, calling thread will be blocked until
-// called process terminates.
-// Second and third params are used to pass command-line arguments
-// to the process.
-var args = ["argument1", "argument2"];
-process.run(false, args, args.length);
-</pre>
-<h2 id="See_also" name="See_also">See also</h2>
-<ul>
- <li><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFile" title="">nsIFile</a></code></li>
- <li><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsILocalFile" title="">nsILocalFile</a></code></li>
- <li><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIProcess2" title="">nsIProcess2</a></code> <span class="inlineIndicator obsolete obsoleteInline" title="(Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)">已废弃 Gecko 1.9.2</span></li>
-</ul>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiprompt/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiprompt/index.html
deleted file mode 100644
index 9bd2106964..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiprompt/index.html
+++ /dev/null
@@ -1,55 +0,0 @@
----
-title: nsIPrompt
-slug: Mozilla/Tech/XPCOM/Reference/Interface/nsIPrompt
-translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIPrompt
----
-<p></p><div style="border: solid #ddd 2px; margin-bottom: 12px;">
-<div style="background: #eee; padding: 2px;"><code><a href="https://dxr.mozilla.org/mozilla-central/source/netwerk/base/public/nsIPrompt.idl" rel="custom">netwerk/base/public/nsIPrompt.idl</a></code><span style="text-align: right; float: right;"><a href="/zh-CN/docs/Interfaces/About_Scriptable_Interfaces" style="color: #00cc00; font-weight: 700;">脚本化</a></span></div>
-<span style="padding: 4px 2px;">
-
-This is the prompt interface which can be used without knowledge of a parent window. The parentage is hidden by the <code>GetInterface</code> though which it is obtained.
-</span>
-
-<div style="background: #eee; padding: 2px;">
-继承于: <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupports" title="">nsISupports</a></code>
-<span style="text-align: right; float: right;">最后修改于Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0)</span></div>
-</div><p></p>
-<div class="note">
- <strong>注:</strong> 本接口基本等价于<code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIPromptService" title="">nsIPromptService</a></code>,只是没有parent <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindow" title="">nsIDOMWindow</a></code>这个参数.为了避免重复的文档,下面的所有方法都链接到了<code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIPromptService" title="">nsIPromptService</a></code>.如果你准备使用这个接口,一定要删除那些方法中的<code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindow" title="">nsIDOMWindow</a></code>参数.</div>
-<p>Normally you would use the prompt service as it is more flexible, but sometimes a callback will request an <code>nsIPrompt</code> via <code><a href="https://developer.mozilla.org/zh-CN/docs/XPCOM_Interface_Reference/nsIInterfaceRequestor#getInterface()">nsIInterfaceRequestor.getInterface()</a></code>. To get an instance, call the <code><a href="https://developer.mozilla.org/zh-CN/docs/XPCOM_Interface_Reference/nsIWindowWatcher#getNewPrompter()">nsIWindowWatcher.getNewPrompter()</a></code>.</p>
-<h2 id="Method_overview" name="Method_overview">方法概述</h2>
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>void <a href="/zh-CN/docs/XPCOM_Interface_Reference/nsIPromptService#alert()" title="en/XPCOM_Interface_Reference/nsIPromptService#alert()">alert</a>(in wstring dialogTitle, in wstring text);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="/zh-CN/docs/XPCOM_Interface_Reference/nsIPromptService#alertCheck()" title="en/XPCOM_Interface_Reference/nsIPromptService#alertCheck()">alertCheck</a>(in wstring dialogTitle, in wstring text, in wstring checkMsg, inout boolean checkValue);</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="/zh-CN/docs/XPCOM_Interface_Reference/nsIPromptService#confirm()" title="en/XPCOM_Interface_Reference/nsIPromptService#confirm()">confirm</a>(in wstring dialogTitle, in wstring text);</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="/zh-CN/docs/XPCOM_Interface_Reference/nsIPromptService#confirmCheck()" title="en/XPCOM_Interface_Reference/nsIPromptService#confirmCheck()">confirmCheck</a>(in wstring dialogTitle, in wstring text, in wstring checkMsg, inout boolean checkValue);</code></td>
- </tr>
- <tr>
- <td><code>PRInt32 <a href="/zh-CN/docs/XPCOM_Interface_Reference/nsIPromptService#confirmEx()" title="en/XPCOM_Interface_Reference/nsIPromptService#confirmEx()">confirmEx</a>(in wstring dialogTitle, in wstring text, in unsigned long buttonFlags, in wstring button0Title, in wstring button1Title, in wstring button2Title, in wstring checkMsg, inout boolean checkValue);</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="/zh-CN/docs/XPCOM_Interface_Reference/nsIPromptService#prompt()" title="en/XPCOM_Interface_Reference/nsIPromptService#prompt()">prompt</a>(in wstring dialogTitle, in wstring text, inout wstring value, in wstring checkMsg, inout boolean checkValue);</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="/zh-CN/docs/XPCOM_Interface_Reference/nsIPromptService#promptPassword()" title="en/XPCOM_Interface_Reference/nsIPromptService#promptPassword()">promptPassword</a>(in wstring dialogTitle, in wstring text, inout wstring password, in wstring checkMsg, inout boolean checkValue);</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="/zh-CN/docs/XPCOM_Interface_Reference/nsIPromptService#promptUsernameAndPassword()" title="en/XPCOM_Interface_Reference/nsIPromptService#promptUsernameAndPassword()">promptUsernameAndPassword</a>(in wstring dialogTitle, in wstring text, inout wstring username, inout wstring password, in wstring checkMsg, inout boolean checkValue);</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="/zh-CN/docs/XPCOM_Interface_Reference/nsIPromptService#select()" title="en/XPCOM_Interface_Reference/nsIPromptService#select()">select</a>(in wstring dialogTitle, in wstring text, in PRUint32 count, [array, size_is(count)] in wstring selectList, out long outSelection);</code></td>
- </tr>
- </tbody>
-</table>
-<h2 id="Constants" name="Constants">常量</h2>
-<p><code>nsIPrompt中的</code>按钮标识同样等同于<code><a href="https://developer.mozilla.org/zh-CN/docs/XPCOM_Interface_Reference/nsIPromptService#Constants">nsIPromptService.Constants</a></code>中定义的那些.示例代码可以在这里找到: <a href="/zh-CN/docs/XPCOM_Interface_Reference/nsIPromptService#Using_the_button_flags" title="en/XPCOM_Interface_Reference/nsIPromptService#Using_the_button_flags">使用按钮标识</a></p>
-<h2 id="相关链接">相关链接</h2>
-<p><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIPromptService" title="">nsIPromptService</a></code></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsipromptservice/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsipromptservice/index.html
deleted file mode 100644
index b194faca6b..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsipromptservice/index.html
+++ /dev/null
@@ -1,696 +0,0 @@
----
-title: nsIPromptService
-slug: Mozilla/Tech/XPCOM/Reference/Interface/nsIPromptService
-translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIPromptService
----
-<p></p><div style="border: solid #ddd 2px; margin-bottom: 12px;">
-<div style="background: #eee; padding: 2px;"><code><a href="https://dxr.mozilla.org/mozilla-central/source/embedding/components/windowwatcher/public/nsIPromptService.idl" rel="custom">embedding/components/windowwatcher/public/nsIPromptService.idl</a></code><span style="text-align: right; float: right;"><a href="/zh-CN/docs/Interfaces/About_Scriptable_Interfaces" style="color: #00cc00; font-weight: 700;">脚本化</a></span></div>
-<span style="padding: 4px 2px;">该接口用来显示一些简单的对话框.在chrome上下文,你应该使用该接口的所属方法来替代常规的DOM方法,例如 <a href="/zh-CN/docs/Web/API/Window/alert" title='显示一个警告对话框,上面显示有指定的文本内容以及一个"确定"按钮。'><code>window.alert</code></a>, <a href="/zh-CN/docs/Web/API/Window/confirm" title="Window.confirm() 方法显示一个具有一个可选消息和两个按钮(确定和取消)的模态对话框 。"><code>window.confirm</code></a>, 等.</span>
-
-<div style="background: #eee; padding: 2px;">
-继承于: <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupports" title="">nsISupports</a></code>
-<span style="text-align: right; float: right;">最后修改于Gecko 1.7.5 </span></div>
-</div><p></p>
-<p>You can define access keys (or keyboard shortcuts) for buttons by including an ampersand ("&amp;") in front of the character that should be the access key for that button. If you need to include an ampersand in the button's text, use two of them, like this: "&amp;&amp;".</p>
-<div class="note">
- <strong>Note:</strong> Some of these interface methods use <code>out</code> and <code>inout</code> parameters. In C++, <code>out</code> parameters are pointers. For JavaScript, they are extra work, as you can't use an <code>out</code> parameter directly. You need to wrap them in a temporary object, which can be either empty or have a <code>value</code> property set to the <code>out</code> parameter type. For more information on out parameters and JavaScript refer to <a href="/zh-cn/Working_with_out_parameters" title="zh-cn/Working with out parameters">Working with out parameters</a>.</div>
-<p>该接口由: <code>@mozilla.org/embedcomp/prompt-service;1</code> 组件实现,下面的代码可以得到一个promptService对象实例:</p>
-<pre>var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
- .getService(Components.interfaces.nsIPromptService);
-</pre>
-<h2 id="Method_overview" name="Method_overview">方法概述</h2>
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>void <a href="#alert()">alert</a>(in <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindow" title="">nsIDOMWindow</a></code> aParent, in wstring aDialogTitle, in wstring aText);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="#alertCheck()">alertCheck</a>(in <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindow" title="">nsIDOMWindow</a></code> aParent, in wstring aDialogTitle, in wstring aText, in wstring aCheckMsg, inout boolean aCheckState);</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="#confirm()">confirm</a>(in <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindow" title="">nsIDOMWindow</a></code> aParent, in wstring aDialogTitle, in wstring aText);</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="#confirmCheck()">confirmCheck</a>(in <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindow" title="">nsIDOMWindow</a></code> aParent, in wstring aDialogTitle, in wstring aText, in wstring aCheckMsg, inout boolean aCheckState);</code></td>
- </tr>
- <tr>
- <td><code>PRInt32 <a href="#confirmEx()">confirmEx</a>(in <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindow" title="">nsIDOMWindow</a></code> aParent,in wstring aDialogTitle,in wstring aText, in unsigned long aButtonFlags,in wstring aButton0Title, in wstring aButton1Title,in wstring aButton2Title,in wstring aCheckMsg, inout boolean aCheckState);</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="#prompt()">prompt</a>(in <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindow" title="">nsIDOMWindow</a></code> aParent, in wstring aDialogTitle, in wstring aText, inout wstring aValue, in wstring aCheckMsg, inout boolean aCheckState);</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="#promptUsernameAndPassword()">promptUsernameAndPassword</a>(in <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindow" title="">nsIDOMWindow</a></code> aParent, in wstring aDialogTitle, in wstring aText, inout wstring aUsername, inout wstring aPassword, in wstring aCheckMsg, inout boolean aCheckState);</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="#promptPassword()">promptPassword</a>(in <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindow" title="">nsIDOMWindow</a></code> aParent, in wstring aDialogTitle, in wstring aText, inout wstring aPassword, in wstring aCheckMsg, inout boolean aCheckState);</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="#select()">select</a>(in <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindow" title="">nsIDOMWindow</a></code> aParent, in wstring aDialogTitle, in wstring aText, in PRUint32 aCount, [array, size_is(aCount)] in wstring aSelectList, out long aOutSelection);</code></td>
- </tr>
- </tbody>
-</table>
-<h2 id="Constants" name="Constants">常量</h2>
-<p>The following flags are combined to form the <code>aButtonFlags</code> parameter passed to <a href="#confirmEx">confirmEx</a>. All flags are defined as <code>unsigned long</code> constants and can be accessed as <code>Components.interfaces.nsIPromptService.<em>flagname</em></code> from JavaScript and as nsIPromptService::<code><em>flagname</em></code> from C++.</p>
-<h3 id="Button_position_flags">Button position flags</h3>
-<p>On Linux and Mac, button 2 is on the left of the prompt, while buttons 1 and 0 are on the right. On Windows and OS/2, the buttons are centred in the order 0, 2, 1.</p>
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">Constant</td>
- <td class="header">Value</td>
- <td class="header">Description</td>
- </tr>
- <tr>
- <td><code>BUTTON_POS_0</code></td>
- <td><code>1</code></td>
- <td>This is usually the button used to confirm the prompt. It typically has the label "OK", "Yes" or "Save".</td>
- </tr>
- <tr>
- <td><code>BUTTON_POS_1</code></td>
- <td><code>256</code></td>
- <td>This is the button used to cancel the prompt. It typically has the label "Cancel" or "No". It is equivalent to pressing the Escape key (or Cmd+. on the Mac), or closing the window through the OS controls.</td>
- </tr>
- <tr>
- <td><code>BUTTON_POS_2</code></td>
- <td><code>65536</code></td>
- <td>This button can be used to give the user a choice of options, but still allowing the user to cancel the prompt. For instance, it might have the label "Don't Save".</td>
- </tr>
- </tbody>
-</table>
-<h3 id="Button_title_flags">Button title flags</h3>
-<p>These flags are used along with <a href="#Button_position_flags">Button position flags</a> to set the labels of buttons in the prompt.</p>
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">Constant</td>
- <td class="header">Value</td>
- <td class="header">Description</td>
- </tr>
- <tr>
- <td><code>BUTTON_TITLE_OK</code></td>
- <td><code>1</code></td>
- <td rowspan="7"> These flags are used to select standard labels from the user's current locale.</td>
- </tr>
- <tr>
- <td><code>BUTTON_TITLE_CANCEL</code></td>
- <td><code>2</code></td>
- </tr>
- <tr>
- <td><code>BUTTON_TITLE_YES</code></td>
- <td><code>3</code></td>
- </tr>
- <tr>
- <td><code>BUTTON_TITLE_NO</code></td>
- <td><code>4</code></td>
- </tr>
- <tr>
- <td><code>BUTTON_TITLE_SAVE</code></td>
- <td><code>5</code></td>
- </tr>
- <tr>
- <td><code>BUTTON_TITLE_DONT_SAVE</code></td>
- <td><code>6</code></td>
- </tr>
- <tr>
- <td><code>BUTTON_TITLE_REVERT</code></td>
- <td><code>7</code></td>
- </tr>
- <tr>
- <td><code>BUTTON_TITLE_IS_STRING</code></td>
- <td><code>127</code></td>
- <td>This flag indicates that the label is passed as a separate string. Use this for labels that don't match one of the constants above.</td>
- </tr>
- </tbody>
-</table>
-<h3 id="Button_default_flags">Button default flags</h3>
-<p>These flags are used to select which button is the default.</p>
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">Constant</td>
- <td class="header">Value</td>
- <td class="header">Description</td>
- </tr>
- <tr>
- <td>BUTTON_POS_0_DEFAULT</td>
- <td>0</td>
- <td> </td>
- </tr>
- <tr>
- <td>BUTTON_POS_1_DEFAULT</td>
- <td>16777216</td>
- <td> </td>
- </tr>
- <tr>
- <td>BUTTON_POS_2_DEFAULT</td>
- <td>33554432</td>
- <td> </td>
- </tr>
- </tbody>
-</table>
-<h3 id="BUTTON_DELAY_ENABLE">BUTTON_DELAY_ENABLE</h3>
-<p><code>BUTTON_DELAY_ENABLE</code> causes the buttons to be initially disabled. They are enabled after a timeout expires. The implementation may interpret this loosely, as the intent is to ensure that the user does not click through a security dialog too quickly. Strictly speaking, the implementation could choose to ignore this flag. A delay can be useful not only to give the user more time to think before acting, but also as a countermeasure against malicious web sites that intentionally create a race condition whereby the user intends to click or type a key responding, for example, to the web site's prompt but the security dialog pops up unexpectedly and its button is unintentionally activated.</p>
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">Constant</td>
- <td class="header">Value</td>
- <td class="header">Description</td>
- </tr>
- <tr>
- <td>BUTTON_DELAY_ENABLE</td>
- <td>67108864</td>
- <td> </td>
- </tr>
- </tbody>
-</table>
-<h3 id="Standard_Buttons_flags">Standard Buttons flags</h3>
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">Constant</td>
- <td class="header">Value</td>
- <td class="header">Description</td>
- </tr>
- <tr>
- <td><code>STD_OK_CANCEL_BUTTONS</code></td>
- <td>513</td>
- <td>
- <p>selects the standard set of OK/Cancel buttons.</p>
- <code>(BUTTON_TITLE_OK *BUTTON_POS_0) +(BUTTON_TITLE_CANCEL * BUTTON_POS_1)</code></td>
- </tr>
- <tr>
- <td><code>STD_YES_NO_BUTTONS</code></td>
- <td>1027</td>
- <td>
- <p>selects the standard set of Yes/No buttons.</p>
- <code>(BUTTON_TITLE_YES *BUTTON_POS_0) +(BUTTON_TITLE_NO * BUTTON_POS_1)</code></td>
- </tr>
- </tbody>
-</table>
-<h2 id="Methods" name="Methods">方法</h2>
-<h3 id="alert()">alert()</h3>
-<p><code>alert</code> 方法显示一个警告对话框,包含一个确认按钮. 除了可以设置对话框的标题以外,效果和<a href="/zh-CN/docs/Web/API/Window/alert" title='显示一个警告对话框,上面显示有指定的文本内容以及一个"确定"按钮。'><code>window.alert</code></a>全都相同 . 在chrome上下文,你应该使用该xpcom方法来替代<code>window.alert</code>.</p>
-<pre>void alert(
- in nsIDOMWindow aParent,
- in wstring aDialogTitle,
- in wstring aText
-);
-</pre>
-<h6 id="Parameters" name="Parameters">参数</h6>
-<dl>
- <dt>
- <code>aParent</code></dt>
- <dd>
- 对话框的父窗口,如果该值设为 <code>null</code>,则父窗口为当前激活的窗口 <code>nsIWindowWatcher.activeWindow</code>.</dd>
- <dt>
- <code>aDialogTitle</code></dt>
- <dd>
- 对话框的标题文字.</dd>
- <dt>
- <code>aText</code></dt>
- <dd>
- 对话框的内容文字.</dd>
-</dl>
-<p>代码示例:<a href="#alert_example">alert_example</a>.</p>
-<h3 id="alertCheck()">alertCheck()</h3>
-<p>显示一个警告对话框,包含一个确认按钮和一个复选框.</p>
-<pre>void alertCheck(
- in nsIDOMWindow aParent,
- in wstring aDialogTitle,
- in wstring aText,
- in wstring aCheckMsg,
- inout boolean aCheckState
-);
-</pre>
-<h6 id="Parameters" name="Parameters">参数</h6>
-<dl>
- <dt>
- <code>aParent</code></dt>
- <dd>
- 对话框的父窗口,如果该值设为 <code>null</code>,则父窗口为当前激活的窗口 <code>nsIWindowWatcher.activeWindow</code>..</dd>
- <dt>
- <code>aDialogTitle</code></dt>
- <dd>
- 对话框的标题文字.</dd>
- <dt>
- <code>aText</code></dt>
- <dd>
- 对话框的内容文字.</dd>
- <dt>
- <code>aCheckMsg</code></dt>
- <dd>
- 复选框的说明文字.</dd>
- <dt>
- <code>aCheckState</code></dt>
- <dd>
- 该变量是一个对象引用,当对话框打开时,变量的value属性控制了复选框的初始选择状态.当对话框关闭时,变量的value属性会存储下复选框的最后选择状态.该变量初始化时可以包含一个类型为布尔值的value属性或者是空对象.</dd>
-</dl>
-<p>代码示例:<a href="#alertCheck_example">alertCheck_example</a>.</p>
-<h3 id="confirm()">confirm()</h3>
-<p>显示一个确认对话框,包含一个确认按钮和一个取消按钮.</p>
-<pre>boolean confirm(
- in nsIDOMWindow aParent,
- in wstring aDialogTitle,
- in wstring aText
-);
-</pre>
-<h6 id="Parameters" name="Parameters">参数</h6>
-<dl>
- <dt>
- <code>aParent</code></dt>
- <dd>
- 对话框的父窗口,如果该值设为 <code>null</code>,则父窗口为当前激活的窗口 <code>nsIWindowWatcher.activeWindow</code>.</dd>
- <dt>
- <code>aDialogTitle</code></dt>
- <dd>
- 对话框的标题文字.</dd>
- <dt>
- <code>aText</code></dt>
- <dd>
- 对话框的内容文字.</dd>
-</dl>
-<h6 id="Return_value" name="Return_value">返回值</h6>
-<dl>
- <dd>
- 点确定按钮返回 <code>true</code> , 点取消按钮返回 <code>false</code></dd>
-</dl>
-<p>代码示例:<a href="#confirm_example">confirm_example</a>.</p>
-<h3 id="confirmCheck()">confirmCheck()</h3>
-<p>显示一个对话框,包含一个确认按钮,一个取消按钮和一个复选框.</p>
-<p>代码示例:<a href="#confirm_example">confirm_example</a>.</p>
-<pre>boolean confirmCheck(
- in nsIDOMWindow aParent,
- in wstring aDialogTitle,
- in wstring aText,
- in wstring aCheckMsg,
- inout boolean aCheckState
-);
-</pre>
-<h6 id="Parameters" name="Parameters">参数</h6>
-<dl>
- <dt>
- <code>aParent</code></dt>
- <dd>
- 对话框的父窗口,如果该值设为 <code>null</code>,则父窗口为当前激活的窗口 <code>nsIWindowWatcher.activeWindow</code>.</dd>
- <dt>
- <code>aDialogTitle</code></dt>
- <dd>
- 对话框的标题文字.</dd>
- <dt>
- <code>aText</code></dt>
- <dd>
- 对话框的内容文字.</dd>
- <dt>
- <code>aCheckMsg</code></dt>
- <dd>
- 复选框的说明文字.</dd>
- <dt>
- <code>aCheckState</code></dt>
- <dd>
- 该变量是一个对象引用,当对话框打开时,变量的value属性控制了复选框的初始选择状态.当对话框关闭时,变量的value属性会存储下复选框的最后选择状态.该变量初始化时可以包含一个类型为布尔值的value属性或者是空对象.</dd>
-</dl>
-<h6 id="Return_value" name="Return_value">返回值</h6>
-<dl>
- <dd>
- 点确定按钮返回 <code>true</code> , 点取消按钮返回 <code>false</code></dd>
-</dl>
-<h3 id="confirmEx()">confirmEx()</h3>
-<p>Puts up a dialog with up to 3 buttons and an optional, labeled checkbox.</p>
-<p>The Buttons are numbered 0 - 2. The implementation can decide what order the buttons appear in, and it may not be simply right-to-left (2, 1, 0) or left-to-right (0, 1, 2). See <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=624043" title="nsIPromptService.confirmEx : buttons show up in the order 0,2,1 instead of 0,1,2">bug 624043</a> for more on this. Button 0 is the default button unless one of the Button Default Flags is specified (see <a href="/zh-cn/XPCOM_Interface_Reference/nsIPromptService#Button_default_flags" title="https://developer.mozilla.org/zh-cn/XPCOM_Interface_Reference/nsIPromptService#Button_default_flags">Button default flags</a>).</p>
-<p>A button may use a predefined title, specified by one of the Button Title Flags values. Each title value can be multiplied by a position value to assign the title to a particular button. If BUTTON_TITLE_IS_STRING is used for a button, the string parameter for that button will be used. If the value for a button position is zero, the button will not be shown.</p>
-<p>The following Example creates a Dialog with an OK button an an custom button description.</p>
-<p><code>aButtonFlags = (BUTTON_POS_0) * (BUTTON_TITLE_OK) +<br>
- (BUTTON_POS_1) * (BUTTON_TITLE_IS_STRING) +<br>
- BUTTON_POS_1_DEFAULT; </code></p>
-<div class="note">
- confirmEx always returns 1 if the user closes the window using the close button in the titlebar! <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=345067" title="Issues with prompt service's confirmEx - confirmEx always returns 1 when user closes dialog window using the X button in titlebar">bug 345067</a></div>
-<pre>PRInt32 confirmEx(
- in nsIDOMWindow aParent,
- in wstring aDialogTitle,
- in wstring aText,
- in unsigned long aButtonFlags,
- in wstring aButton0Title,
- in wstring aButton1Title,
- in wstring aButton2Title,
- in wstring aCheckMsg,
- inout boolean aCheckState
-);
-</pre>
-<h6 id="Parameters" name="Parameters">参数</h6>
-<dl>
- <dt>
- <code>aParent</code></dt>
- <dd>
- 对话框的父窗口,如果该值设为 <code>null</code>,则父窗口为当前激活的窗口 <code>nsIWindowWatcher.activeWindow</code>.</dd>
- <dt>
- <code>aDialogTitle</code></dt>
- <dd>
- 对话框的标题文字.</dd>
- <dt>
- <code>aText</code></dt>
- <dd>
- 对话框的内容文字.</dd>
- <dt>
- <code>aButtonFlags</code></dt>
- <dd>
- <code>aButtonFlags</code> is a combination of <a href="#Button_flags">Button flags</a> as described in <a href="#Using_the_button_flags">Using the button flags</a> below.</dd>
- <dt>
- <code>aButton0Title</code></dt>
- <dd>
- caption displayed for button 0 if<code>(BUTTON_TITLE_IS_STRING*</code><code>BUTTON_TITLE_POS_0)</code> flags are set in aButtonFlags</dd>
- <dt>
- <code>aButton1Title</code></dt>
- <dd>
- caption displayed for button 1 if<code>(BUTTON_TITLE_IS_STRING*</code><code>BUTTON_TITLE_POS_1)</code> flags are set in aButtonFlags</dd>
- <dt>
- <code>aButton2Title</code></dt>
- <dd>
- caption displayed for button 2 if<code>(BUTTON_TITLE_IS_STRING*</code><code>BUTTON_TITLE_POS_2)</code> flags are set in aButtonFlags</dd>
- <dt>
- <code>aCheckMsg</code></dt>
- <dd>
-  复选框的说明文字. 如果值设为Null,则复选框不会显示.</dd>
- <dt>
- <code>aCheckState</code></dt>
- <dd>
- 该变量是一个对象引用,当对话框打开时,变量的value属性控制了复选框的初始选择状态.当对话框关闭时,变量的value属性会存储下复选框的最后选择状态.该变量初始化时可以包含一个类型为布尔值的value属性或者是空对象.</dd>
-</dl>
-<h6 id="Return_value" name="Return_value">返回值</h6>
-<dl>
- <dd>
- 按下按钮的索引.</dd>
-</dl>
-<h3 id="prompt()">prompt()</h3>
-<p>显示一个对话框,包含一个文本框,一个可选的复选框.</p>
-<p>代码示例:<a href="#prompt_example">prompt_example</a>.</p>
-<pre>boolean prompt(
- in nsIDOMWindow aParent,
- in wstring aDialogTitle,
- in wstring aText,
- inout wstring aValue,
- in wstring aCheckMsg,
- inout boolean aCheckState
-);
-</pre>
-<h6 id="Parameters" name="Parameters">参数</h6>
-<dl>
- <dt>
- <code>aParent</code></dt>
- <dd>
- 对话框的父窗口,如果该值设为 <code>null</code>,则父窗口为当前激活的窗口 <code>nsIWindowWatcher.activeWindow</code>.</dd>
- <dt>
- <code>aDialogTitle</code></dt>
- <dd>
- 对话框的标题文字.</dd>
- <dt>
- <code>aText</code></dt>
- <dd>
- 对话框的内容文字.</dd>
- <dt>
- <code>aValue</code></dt>
- <dd>
- 该变量是一个对象引用,当对话框打开时,变量的value属性值就是文本输入框的的初始值.当用户点击确认按钮关闭对话框时,变量的value属性会存储下文本输入框的最后确定值.其他方法关闭对话框时,变量的value属性值不会改变.该变量初始化时可以包含一个类型为字符串值的value属性或者是空对象.</dd>
- <dt>
- <code>aCheckMsg</code></dt>
- <dd>
- 复选框的说明文字. 如果值设为Null,则复选框不会显示.</dd>
- <dt>
- <code>aCheckState</code></dt>
- <dd>
- 该变量是一个对象引用,当对话框打开时,变量的value属性控制了复选框的初始选择状态.当对话框关闭时,变量的value属性会存储下复选框的最后选择状态.该变量初始化时可以包含一个类型为布尔值的value属性或者是空对象.</dd>
-</dl>
-<h6 id="Return_value" name="Return_value">返回值</h6>
-<dl>
- <dd>
- 点确定按钮返回 <code>true</code> , 点取消按钮返回 <code>false</code></dd>
-</dl>
-<h3 id="promptUsernameAndPassword()">promptUsernameAndPassword()</h3>
-<p>显示一个对话框,内部包含一个文本输入框,一个密码输入框,和一个可选的复选框.</p>
-<p>代码示例:<a href="#promptUsernameAndPassword_example">promptUsernameAndPassword_example</a>.</p>
-<pre>boolean promptUsernameAndPassword(
- in nsIDOMWindow aParent,
- in wstring aDialogTitle,
- in wstring aText,
- inout wstring aUsername,
- inout wstring aPassword,
- in wstring aCheckMsg,
- inout boolean aCheckState
-);
-</pre>
-<h6 id="Parameters" name="Parameters">参数</h6>
-<dl>
- <dt>
- <code>aParent</code></dt>
- <dd>
- 对话框的父窗口,如果该值设为 <code>null</code>,则父窗口为当前激活的窗口 <code>nsIWindowWatcher.activeWindow</code>.</dd>
- <dt>
- <code>aDialogTitle</code></dt>
- <dd>
- 对话框的标题文字.</dd>
- <dt>
- <code>aText</code></dt>
- <dd>
- 对话框的内容文字.</dd>
- <dt>
- <code>aUsername</code></dt>
- <dd>
- 该变量是一个对象引用,当对话框打开时,变量的value属性值就是用户名输入框的的初始值.当用户点击确认按钮关闭对话框时,变量的value属性会存储下用户名输入框的最后确定值.其他方法关闭对话框时,变量的value属性值不会改变.该变量初始化时可以包含一个类型为字符串值的value属性或者是空对象.</dd>
- <dt>
- <code>aPassword</code></dt>
- <dd>
- 该变量是一个对象引用,当对话框打开时,变量的value属性值就是密码输入框的的初始值.当用户点击确认按钮关闭对话框时,变量的value属性会存储下密码输入框的最后确定值.其他方法关闭对话框时,变量的value属性值不会改变.该变量初始化时可以包含一个类型为字符串值的value属性或者是空对象.</dd>
- <dt>
- <code>aCheckMsg</code></dt>
- <dd>
- 复选框的说明文字. 如果值设为Null,则复选框不会显示.</dd>
- <dt>
- <code>aCheckState</code></dt>
- <dd>
- 该变量是一个对象引用,当对话框打开时,变量的value属性控制了复选框的初始选择状态.当对话框关闭时,变量的value属性会存储下复选框的最后选择状态.该变量初始化时可以包含一个类型为布尔值的value属性或者是空对象.</dd>
-</dl>
-<h6 id="Return_value" name="Return_value">返回值</h6>
-<dl>
- <dd>
- 点确定按钮返回 <code>true</code> , 点取消按钮返回 <code>false</code></dd>
-</dl>
-<h3 id="promptPassword()">promptPassword()</h3>
-<p>显示一个对话框,包含一个密码框,一个可选的复选框.</p>
-<p>代码示例:<a href="#promptPassword_example">promptPassword_example</a>.</p>
-<pre>boolean promptPassword(
- in nsIDOMWindow aParent,
- in wstring aDialogTitle,
- in wstring aText,
- inout wstring aPassword,
- in wstring aCheckMsg,
- inout boolean aCheckState
-);
-</pre>
-<h6 id="Parameters" name="Parameters">参数</h6>
-<dl>
- <dt>
- <code>aParent</code></dt>
- <dd>
- 对话框的父窗口,如果该值设为 <code>null</code>,则父窗口为当前激活的窗口 <code>nsIWindowWatcher.activeWindow</code>.</dd>
- <dt>
- <code>aDialogTitle</code></dt>
- <dd>
- 对话框的标题文字.</dd>
- <dt>
- <code>aText</code></dt>
- <dd>
- 对话框的内容文字.</dd>
- <dt>
- <code>aPassword</code></dt>
- <dd>
- 该变量是一个对象引用,当对话框打开时,变量的value属性值就是密码输入框的的初始值.当用户点击确认按钮关闭对话框时,变量的value属性会存储下密码输入框的最后确定值.其他方法关闭对话框时,变量的value属性值不会改变.该变量初始化时可以包含一个类型为字符串值的value属性或者是空对象.</dd>
- <dt>
- <code>aCheckMsg</code></dt>
- <dd>
- 复选框的说明文字. 如果值设为Null,则复选框不会显示.</dd>
- <dt>
- <code>aCheckState</code></dt>
- <dd>
-     该变量是一个对象引用,当对话框打开时,变量的value属性控制了复选框的初始选择状态.当对话框关闭时,变量的value属性会存储下复选框的最后选择状态.该变量初始化时可以包含一个类型为布尔值的value属性或者是空对象.</dd>
-</dl>
-<h6 id="Return_value" name="Return_value">返回值</h6>
-<dl>
- <dd>
- 点确定按钮返回 <code>true</code> , 点取消按钮返回 <code>false</code></dd>
-</dl>
-<h3 id="select()">select()</h3>
-<p>显示一个对话框,包含一个单项选择的字符串列表.</p>
-<p>代码示例:<a href="#select_example">select_example</a>.</p>
-<pre>boolean select(
- in nsIDOMWindow aParent,
- in wstring aDialogTitle,
- in wstring aText,
- in PRUint32 aCount,
- [array, size_is(aCount)] in wstring aSelectList,
- out long aOutSelection
-);
-</pre>
-<dl>
- <dt>
- <code>aParent</code></dt>
- <dd>
- 对话框的父窗口,如果该值设为 <code>null</code>,则父窗口为当前激活的窗口 <code>nsIWindowWatcher.activeWindow</code>.</dd>
- <dt>
- <code>aDialogTitle</code></dt>
- <dd>
- 对话框的标题文字.</dd>
- <dt>
- <code>aText</code></dt>
- <dd>
- 对话框的内容文字.</dd>
- <dt>
- <code>aCount</code></dt>
- <dd>
- 参数aSelectList的数组长度.</dd>
- <dt>
- <code>aSelectList</code></dt>
- <dd>
- 构成字符串列表的字符串数组.</dd>
- <dt>
- <code>aOutSelection</code></dt>
- <dd>
- 该变量是一个对象引用,当用户选择某个项目后,变量的value属性值存储了用户所选列表项目的索引值.</dd>
-</dl>
-<h6 id="Return_value" name="Return_value">返回值</h6>
-<dl>
- <dd>
- 点确定按钮返回 <code>true</code> , 点取消按钮返回 <code>false</code></dd>
-</dl>
-<h2 id="代码示例">代码示例</h2>
-<p> </p>
-<h3 id="alert_example">alert example</h3>
-<p><a href="#alert()">alert()</a> 显示一个简单的对话框.</p>
-<p><img alt="" class="internal" src="/@api/deki/files/4072/=AlertExample.png" style="width: 365px; height: 129px;"></p>
-<pre class="brush: js">var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
- .getService(Components.interfaces.nsIPromptService);
-
-prompts.alert(null, "Title of this Dialog", "Hello! You have now been alerted.");
-</pre>
-<h3 id="alertCheck_example">alertCheck example</h3>
-<p><a href="#alertCheck()">alertCheck()</a> 显示一个包含复选框的对话框</p>
-<p><img alt="" class="internal" src="/@api/deki/files/4073/=AlertCheckExample.png" style="width: 365px; height: 152px;"></p>
-<pre class="brush: js">var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
- .getService(Components.interfaces.nsIPromptService);
-
-var check = {value: false}; // default the checkbox to false
-
-prompts.alertCheck(null, "Title of this Dialog", "Hello! You have now been alerted.",
- "And this is a checkbox", check);
-
-// check.value is now true if the box was checked and false if the box was cleared
-</pre>
-<h3 id="confirm_example">confirm example</h3>
-<p><a href="#confirm()">confirm()</a> 显示一个提示框,内部包含一个确认按钮和一个取消按钮.</p>
-<pre class="brush: js">var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
- .getService(Components.interfaces.nsIPromptService);
-
-var result = prompts.confirm(null, "Title of this Dialog", "Are you sure?");
-
-// result is now true if OK was clicked, and false if cancel was clicked
-</pre>
-<h3 id="confirmCheck_example">confirmCheck example</h3>
-<p><a href="#confirmCheck">confirmCheck</a> 显示一个提示框,内部包含一个确认按钮,一个取消按钮,一个复选框.</p>
-<pre class="brush: js">var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
- .getService(Components.interfaces.nsIPromptService);
-
-var check = {value: true}; // default the checkbox to true
-
-var result = prompts.confirmCheck(null, "Title of this Dialog", "Are you sure?",
- "Don't ask again", check);
-
-// check.value is now true if the box was checked AND OK was pressed, false if
-// the box was cleared AND OK was pressed, and is the default of true if Cancel was pressed.
-</pre>
-<h3 id="confirmEx_example">confirmEx example</h3>
-<p><a href="#confirmEx()">confirmEx()</a>  显示一个对话框,内部包含三个或三个以下的按纽,和一个可选的复选框.</p>
-<p><img alt="" class="internal" src="/@api/deki/files/4075/=confirmExExample.png" style="width: 365px; height: 129px;"></p>
-<pre class="brush: js">var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
- .getService(Components.interfaces.nsIPromptService);
-
-var check = {value: false}; // default the checkbox to false
-
-var flags = prompts.BUTTON_POS_0 * prompts.BUTTON_TITLE_SAVE +
- prompts.BUTTON_POS_1 * prompts.BUTTON_TITLE_IS_STRING +
- prompts.BUTTON_POS_2 * prompts.BUTTON_TITLE_CANCEL;
-// This value of flags will create 3 buttons. The first will be "Save", the
-// second will be the value of aButtonTitle1, and the third will be "Cancel"
-
-var button = prompts.confirmEx(null, "Title of this Dialog", "What do you want to do?",
- flags, "", "Button 1", "", null, check);
-
-// The checkbox will be hidden, and button will contain the index of the button pressed,
-// 0, 1, or 2.
-</pre>
-<h3 id="prompt_example">prompt example</h3>
-<p><a href="#prompt()">prompt()</a> 显示一个对话框,内部包含一个文本输入框.</p>
-<pre class="brush: js">var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
- .getService(Components.interfaces.nsIPromptService);
-
-var check = {value: false}; // default the checkbox to false
-
-var input = {value: "Bob"}; // default the edit field to Bob
-
-var result = prompts.prompt(null, "Title", "What is your name?", input, null, check);
-
-// result is true if OK is pressed, false if Cancel. input.value holds the value of the edit field if "OK" was pressed.
-</pre>
-<h3 id="promptUsernameAndPassword_example">promptUsernameAndPassword example</h3>
-<p><a href="#promptUsernameAndPassword()">promptUsernameAndPassword()</a> 显示一个对话框,内部包含一个文本输入框,一个密码输入框和一个可选的复选框.</p>
-<p><img alt="" class="internal" src="/@api/deki/files/4076/=promptUsernameAndPasswordExample.png" style="width: 365px; height: 200px;"></p>
-<pre class="brush: js">var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
- .getService(Components.interfaces.nsIPromptService);
-
-var username = {value: "user"}; // default the username to user
-
-var password = {value: "pass"}; // default the password to pass
-
-var check = {value: true}; // default the checkbox to true
-
-var result = prompts.promptUsernameAndPassword(null, "Title", "Enter username and password:",
- username, password, "Save", check);
-
-// result is true if OK was pressed, false if cancel was pressed. username.value,
-// password.value, and check.value are set if OK was pressed.
-</pre>
-<h3 id="promptPassword_example">promptPassword example</h3>
-<p><a href="#promptPassword()">promptPassword()</a> 显示一个对话框,内部包含一个密码输入框和一个可选的复选框.</p>
-<pre class="brush: js">var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
- .getService(Components.interfaces.nsIPromptService);
-
-var password = {value: "pass"}; // default the password to pass
-
-var check = {value: true}; // default the checkbox to true
-
-var result = prompts.promptPassword(null, "Title", "Enter password:", password, null, check);
-
-// result is true if OK was pressed, false if cancel was pressed. password.value is
-// set if OK was pressed. The checkbox is not displayed.
-</pre>
-<h3 id="select_example">select example</h3>
-<p><a href="#select()">select()</a> 显示一个对话框,内部是一个包含多个选项的列表框.</p>
-<p><img alt="" class="internal" src="/@api/deki/files/4074/=selectExample.png" style="width: 333px; height: 196px;"></p>
-<pre class="brush: js">var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
- .getService(Components.interfaces.nsIPromptService);
-
-var items = ["Hello", "Welcome", "Howdy", "Hi", ":)"]; // list items
-
-var selected = {};
-
-var result = prompts.select(null, "Title", "What greeting do you want?", items.length,
- items, selected);
-
-// result is true if OK was pressed, false if cancel. selected is the index of the item array
-// that was selected. Get the item using items[selected.value].
-</pre>
-<h2 id="See_also" name="See_also">相关链接</h2>
-<ul>
- <li><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIPrompt" title="">nsIPrompt</a></code></li>
- <li><a href="/zh-cn/Working_with_out_parameters" title="zh-cn/Working with out parameters">Working with out parameters</a></li>
-</ul>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiscriptableunicodeconverter/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiscriptableunicodeconverter/index.html
deleted file mode 100644
index fe406f1bba..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiscriptableunicodeconverter/index.html
+++ /dev/null
@@ -1,609 +0,0 @@
----
-title: nsIScriptableUnicodeConverter
-slug: Mozilla/Tech/XPCOM/Reference/Interface/nsIScriptableUnicodeConverter
-translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIScriptableUnicodeConverter
----
-<p></p><div style="border: solid #ddd 2px; margin-bottom: 12px;">
-<div style="background: #eee; padding: 2px;"><code><a href="https://dxr.mozilla.org/mozilla-central/source/intl/uconv/idl/nsIScriptableUConv.idl" rel="custom">intl/uconv/idl/nsIScriptableUConv.idl</a></code><span style="text-align: right; float: right;"><a href="/zh-CN/docs/Interfaces/About_Scriptable_Interfaces" style="color: #00cc00; font-weight: 700;">脚本化</a></span></div>
-<span style="padding: 4px 2px;">
-
-This interface is a Unicode encoder for use by scripts.
-</span>
-
-<div style="background: #eee; padding: 2px;">
-继承于: <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupports" title="">nsISupports</a></code>
-<span style="text-align: right; float: right;">最后修改于Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0)</span></div>
-</div><p></p>
-<p>Implemented by: <code>@mozilla.org/intl/scriptableunicodeconverter</code>. To create an instance, use:</p>
-<pre class="eval">var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]
- .createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
-</pre>
-<h2 id="Method_overview" name="Method_overview">Method overview</h2>
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>ACString <a href="/zh-cn/XPCOM_Interface_Reference/nsIScriptableUnicodeConverter#ConvertFromUnicode()" title="zh-cn/nsIScriptableUnicodeConverter#ConvertFromUnicode()">ConvertFromUnicode</a>(in AString aSrc);</code></td>
- </tr>
- <tr>
- <td><code>ACString <a href="/zh-cn/XPCOM_Interface_Reference/nsIScriptableUnicodeConverter#Finish()" title="zh-cn/nsIScriptableUnicodeConverter#Finish()">Finish</a>();</code></td>
- </tr>
- <tr>
- <td><code>AString <a href="/zh-cn/XPCOM_Interface_Reference/nsIScriptableUnicodeConverter#ConvertToUnicode()" title="zh-cn/nsIScriptableUnicodeConverter#ConvertToUnicode()">ConvertToUnicode</a>(in ACString aSrc);</code></td>
- </tr>
- <tr>
- <td><code>AString <a href="/zh-cn/XPCOM_Interface_Reference/nsIScriptableUnicodeConverter#convertFromByteArray()" title="zh-cn/nsIScriptableUnicodeConverter#convertFromByteArray()">convertFromByteArray</a>([const,array,size_is(aCount)] in octet aData, in unsigned long aCount);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="/zh-cn/XPCOM_Interface_Reference/nsIScriptableUnicodeConverter#convertToByteArray()" title="zh-cn/nsIScriptableUnicodeConverter#convertToByteArray()">convertToByteArray</a>(in AString aString,[optional] out unsigned long aLen,[array, size_is(aLen),retval] out octet aData);</code></td>
- </tr>
- <tr>
- <td><code><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIInputStream" title="">nsIInputStream</a></code> <a href="/zh-cn/XPCOM_Interface_Reference/nsIScriptableUnicodeConverter#convertToInputStream()" title="zh-cn/nsIScriptableUnicodeConverter#convertToInputStream()">convertToInputStream</a>(in AString aString);</code></td>
- </tr>
- </tbody>
-</table>
-<h2 id="Attributes">Attributes</h2>
-<table class="standard-table" style="width: auto;">
- <tbody>
- <tr>
- <td class="header">Attribute</td>
- <td class="header">Type</td>
- <td class="header">Description</td>
- </tr>
- <tr>
- <td><code>charset</code></td>
- <td><code>string</code></td>
- <td>Current character set. Throws <code>NS_ERROR_UCONV_NOCONV</code> if the requested charset is not supported.</td>
- </tr>
- </tbody>
-</table>
-<h2 id="Methods" name="Methods">Methods</h2>
-<h3 id="ConvertFromUnicode()" name="ConvertFromUnicode()">ConvertFromUnicode()</h3>
-<p>Converts the data from Unicode to one Charset. Returns the converted string. After converting, Finish should be called and its return value appended to this return value.</p>
-<pre class="eval">ACString ConvertFromUnicode(
- in AString aSrc
-);
-</pre>
-<h3 id="Finish()">Finish()</h3>
-<p>Returns the terminator string. Should be called after ConvertFromUnicode() and appended to that function's return value.</p>
-<pre>ACString Finish();
-</pre>
-<h3 id="ConvertToUnicode()">ConvertToUnicode()</h3>
-<p>Converts the data from one Charset to Unicode.</p>
-<pre>AString ConvertToUnicode(
- in ACString aSrc
-);
-</pre>
-<h3 id="convertFromByteArray()">convertFromByteArray()</h3>
-<p>Converts an array of bytes to a unicode string.</p>
-<pre>AString convertFromByteArray(
- [const,array,size_is(aCount)] in octet aData,
- in unsigned long aCount
-);
-</pre>
-<h3 id="convertToByteArray()">convertToByteArray()</h3>
-<p>Convert a unicode string to an array of bytes. Finish does not need to be called.</p>
-<pre>void convertToByteArray(in AString aString,
- out unsigned long aLen, <span class="inlineIndicator optional optionalInline">可选</span>
- [array, size_is(aLen),retval] out octet aData
-);
-</pre>
-<h3 id="convertToInputStream()">convertToInputStream()</h3>
-<p>Converts a Unicode string to an input stream. The bytes in the stream are encoded according to the <code>charset</code> attribute. The returned stream is non-blocking.</p>
-<pre>nsIInputStream convertToInputStream(
-  in AString aString
- );
-</pre>
-<h6 id="Parameters">Parameters</h6>
-<h6 id="Return_value">Return value</h6>
-<p>An <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIInputStream" title="">nsIInputStream</a></code> that will present the text specified in <code>aString</code> as its data.</p>
-<ul>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- <li>
- <ul>
- <li>
- <dl>
- <dt>
- <code>aString</code></dt>
- <dd>
- The text to encode to the stream. The text is encoded into the character set specified by the <code>charset</code> attribute.</dd>
- </dl>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </li>
- </ul>
- </li>
-</ul>
-<dl>
-</dl>
-<h2 id="Examples" name="Examples">Examples</h2>
-<p>See <a href="/zh-cn/Reading_textual_data" title="zh-cn/Reading_textual_data">Reading textual data</a> and <a href="/zh-cn/Writing_textual_data" title="zh-cn/Writing_textual_data">Writing textual data</a> for examples.</p>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsisyncmessagesender/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsisyncmessagesender/index.html
deleted file mode 100644
index 1af1e116c3..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsisyncmessagesender/index.html
+++ /dev/null
@@ -1,65 +0,0 @@
----
-title: nsISyncMessageSender
-slug: Mozilla/Tech/XPCOM/Reference/Interface/nsISyncMessageSender
-translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsISyncMessageSender
----
-<p></p><div style="border: solid #ddd 2px; margin-bottom: 12px;">
-<div style="background: #eee; padding: 2px;"><code><a href="https://dxr.mozilla.org/mozilla-central/source/content/base/public/nsIMessageManager.idl" rel="custom">content/base/public/nsIMessageManager.idl</a></code><span style="text-align: right; float: right;"><a href="/zh-CN/docs/Interfaces/About_Scriptable_Interfaces" style="color: #00cc00; font-weight: 700;">脚本化</a></span></div>
-<span style="padding: 4px 2px;">
-
-Handles sending messages synchronously to a destination frame.
-</span>
-
- <div style="height: 42px; position: relative; padding: 2px; width: auto;">
-
- <div style="top: 22px; font-size: 11px; position: absolute;">1.0</div>
-
- <div style="top: 22px; font-size: 11px; position: absolute; left: 0px; text-align: right; float: right; width: 100%;">66</div>
-
- <div style="height: 8px; top: 16px; background: #dd0000; left: 0px; position: absolute; width: 11.428571428571429%;"></div>
-
-<div style="height: 8px; top: 16px; left: 11.428571428571429%; background: #00dd00; position: absolute; width: 88.57142857142857%;" title="Introduced in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)"></div>
-
-<div style="top: 0px; font-size: 11px; position: absolute; left: 11.428571428571429%;">Introduced</div>
-<div style="top: 22px; font-size: 11px; position: absolute; left: 11.428571428571429%;">Gecko 2.0</div>
-
-</div>
-
-<div style="background: #eee; padding: 2px;">
-继承于: <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFrameMessageManager" title="">nsIFrameMessageManager</a></code>
-<span style="text-align: right; float: right;">最后修改于Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)</span></div>
-</div><p></p>
-<h2 id="Method_overview" name="Method_overview">方法概述</h2>
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>void sendSyncMessage(in messageName, in JSON, in [array] jsObjects);</code></td>
- </tr>
- </tbody>
-</table>
-<h3 id="sendSyncMessage()">sendSyncMessage()</h3>
-<p>同步发送一条短消息.</p>
-<pre>void sendSyncMessage(
-  in DOMString messageName,
-  in DOMString json,
-);
-</pre>
-<h6 id="Parameters">Parameters</h6>
-<dl>
- <dt>
- <code>messageName</code></dt>
- <dd>
- 消息的名称.</dd>
- <dt>
- <code>json</code></dt>
- <dd>
- 一个JSON格式的字符串,代表了要发送的数据.</dd>
-</dl>
-<h2 id="See_also" name="See_also">相关链接</h2>
-<ul>
- <li><a href="/en/Content_process_event_handling" title="en/Content process event handling">Content process event handling</a></li>
- <li><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIChromeFrameMessageManager" title="">nsIChromeFrameMessageManager</a></code></li>
- <li><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIContentFrameMessageManager" title="">nsIContentFrameMessageManager</a></code></li>
- <li><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFrameLoader" title="">nsIFrameLoader</a></code></li>
- <li><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIFrameMessageListener" title="">nsIFrameMessageListener</a></code></li>
-</ul>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsitimer/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsitimer/index.html
deleted file mode 100644
index 24cfb2eb4f..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsitimer/index.html
+++ /dev/null
@@ -1,285 +0,0 @@
----
-title: nsITimer
-slug: Mozilla/Tech/XPCOM/Reference/Interface/nsITimer
-translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsITimer
----
-<div id="page-top">
- <div class="pageText" id="pageText">
- <p>nsITimer 接口的功能是:在指定延迟后唤醒一个程序。</p>
- <p><span class="lang lang-en"><code>nsITimer</code> 的定义文档: <span class="lang lang-en"><a class="external" href="http://mxr.mozilla.org/mozilla-central/source/xpcom/threads/nsITimer.idl" rel="external nofollow" title="http://mxr.mozilla.org/mozilla-central/source/xpcom/threads/nsITimer.idl"><code>xpcom/threads/nsITimer.idl</code></a> </span>。It is <span class="lang lang-en"><a href="../../../../en/Interfaces/About_Scriptable_Interfaces" rel="internal">scriptable</a> </span> and <span class="lang lang-en"> <a href="../../../../en/Interfaces/About_Frozen_Interfaces" rel="internal">unfrozen</a> (hasn't changed since 1.9.1) </span>. </span></p>
- <p>继承自: <span class="lang lang-en"><code><a href="../../../../en/nsISupports" rel="internal">nsISupports</a></code> </span></p>
- <p>实现: <code>@mozilla.org/timer;1</code>。创建实例如:</p>
- <pre class="eval">var timer = Components.classes["@mozilla.org/timer;1"]
- .createInstance(Components.interfaces.nsITimer);
-</pre>
- <div id="section_1">
- <h2 class="editable" id="方法预览"><span>方法预览</span></h2>
- <div class="editIcon">
- <a href="/../../../../En/NsITimer#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <table class="standard-table">
- <tbody>
- <tr>
- <td><code>void <a href="/../../../../En/NsITimer#initWithCallback.28.29" title="../../../../En/NsITimer#initWithCallback.28.29">initWithCallback</a>(in <span class="lang lang-en"><code><a href="../../../../en/nsITimerCallback" rel="internal">nsITimerCallback</a></code> </span> aCallback, in unsigned long aDelay, in unsigned long aType);</code></td>
- </tr>
- <tr>
- <td><code>[noscript] void <a href="/../../../../En/NsITimer#initWithFuncCallback.28.29" title="../../../../En/NsITimer#initWithFuncCallback.28.29">initWithFuncCallback</a>(in <span class="lang lang-en"><code><a class="new" href="../../../../en/nsITimerCallbackFunc" rel="internal">nsITimerCallbackFunc</a></code> </span> aCallback, in voidPtr aClosure, in unsigned long aDelay, in unsigned long aType);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="/../../../../En/NsITimer#init.28.29" title="../../../../En/NsITimer#init.28.29">init</a>(in <span class="lang lang-en"><code><a href="../../../../en/nsIObserver" rel="internal">nsIObserver</a></code> </span> aObserver, in unsigned long aDelay, in unsigned long aType);</code></td>
- </tr>
- <tr>
- <td><code>void <a href="/../../../../En/NsITimer#cancel.28.29" title="../../../../En/NsITimer#cancel.28.29">cancel</a>();</code></td>
- </tr>
- </tbody>
- </table>
- </div>
- <div id="section_2">
- <h2 class="editable" id="属性"><span>属性</span></h2>
- <div class="editIcon">
- <a href="/../../../../En/NsITimer#" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <table class="standard-table">
- <tbody>
- <tr>
- <td class="header">Attribute</td>
- <td class="header">Type</td>
- <td class="header">Description</td>
- </tr>
- <tr>
- <td><code>delay</code></td>
- <td><code>unsigned long</code></td>
- <td>The timeout delay in millisecond.</td>
- </tr>
- <tr>
- <td><code>type</code></td>
- <td><code>unsigned long</code></td>
- <td>Defines the timer type: one shot, repeating slack or repeating precise. Must be one of the constants defined under <span class="lang lang-en"><a href="/../../../../En/NsITimer#Constants" title="../../../../En/NsITimer#Constants">Constants</a> </span> on this page</td>
- </tr>
- <tr>
- <td><code>callback</code></td>
- <td><code>readonly <span class="lang lang-en"><code><a href="../../../../en/nsITimerCallback" rel="internal">nsITimerCallback</a></code> </span> </code></td>
- <td>The <code>nsITimerCallback</code> object passed to <code>initWithCallback()</code>.</td>
- </tr>
- <tr>
- <td><code>closure</code></td>
- <td><code>[noscript] readonly voidPtr</code></td>
- <td>
- <p>The opaque pointer pass to <code>initWithFuncCallback()</code>.</p>
- </td>
- </tr>
- <tr>
- <td>target</td>
- <td><span class="lang lang-en"><code><a class="new" href="../../../../en/nsIEventTarget" rel="internal">nsIEventTarget</a></code> </span></td>
- <td>The <span class="lang lang-en"><code><a class="new" href="../../../../en/nsIEventTarget" rel="internal">nsIEventTarget</a></code> </span> to which the callback is dispatched.  This target must be set before calling any of the initialization methods.</td>
- </tr>
- </tbody>
- </table>
- </div>
- <div id="section_3">
- <h2 class="editable" id="常量"><span>常量</span></h2>
- <div class="editIcon">
- <a href="/../../../../En/NsITimer#" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <table class="standard-table">
- <tbody>
- <tr>
- <td class="header">Constant</td>
- <td class="header">Value</td>
- <td class="header">Description</td>
- </tr>
- <tr>
- <td><code>TYPE_ONE_SHOT</code></td>
- <td>0</td>
- <td>Type of a timer that fires once only.</td>
- </tr>
- <tr>
- <td><code>TYPE_REPEATING_SLACK</code></td>
- <td>1</td>
- <td>After firing, the timer is stopped and not restarted until its callback completes. Specified timer period will be at least the time between when processing for last firing the callback completes and when the next firing occurs.</td>
- </tr>
- <tr>
- <td><code>TYPE_REPEATING_PRECISE</code></td>
- <td>2</td>
- <td>This repeating timer aims to have constant period between firings. The processing time for each timer callback should not influence the timer period. However, if the processing for the last timer firing could not be completed until just before the next firing occurs, then you could have two timer notification routines being executed in quick succession.</td>
- </tr>
- </tbody>
- </table>
- </div>
- <div id="section_4">
- <h2 class="editable" id="方法"><span>方法</span></h2>
- <div class="editIcon">
- <a href="/../../../../En/NsITimer#" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <div id="section_5">
- <h3 class="editable" id="initWithCallback()"><span>initWithCallback()</span></h3>
- <div class="editIcon">
- <a href="/../../../../En/NsITimer#" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>Initialize a timer to fire after the given millisecond interval. This version takes a function to call and a closure to pass to that function.</p>
- <pre class="eval"> void initWithCallback (
- in nsITimerCallback aCallback,
- in unsigned long aDelay,
- in unsigned long aType
- );
-</pre>
- <div id="section_6">
- <h6 class="editable" id="Parameters"><span>Parameters</span></h6>
- <div class="editIcon">
- <a href="/../../../../En/NsITimer#" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <dl>
- <dt>
- <code>aFunc</code></dt>
- <dd>
- <span class="lang lang-en"><code><a href="../../../../en/nsITimerCallback" rel="internal">nsITimerCallback</a></code> </span> interface to call when timer expires.</dd>
- </dl>
- <dl>
- <dt>
- <code>aDelay</code></dt>
- <dd>
- timeout delay in milliseconds.</dd>
- </dl>
- <dl>
- <dt>
- <code>aType</code></dt>
- <dd>
- Defines the timer type: one shot, repeating slack or repeating precise. Must be one of the constants defined under <span class="lang lang-en"><a href="/../../../../En/NsITimer#Constants" title="../../../../En/NsITimer#Constants">Constants</a> </span> on this page.</dd>
- </dl>
- </div>
- </div>
- <div id="section_7">
- <h3 class="editable" id="initWithFuncCallback()"><span>initWithFuncCallback()</span></h3>
- <div class="editIcon">
- <a href="/../../../../En/NsITimer#" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>Initialize a timer to fire after the given millisecond interval. This version takes a function to call and a closure to pass to that function.</p>
- <pre class="eval"> [noscript] void initWithFuncCallback(
- in nsTimerCallbackFunc aCallback,
- in voidPtr aClosure,
- in unsigned long aDelay,
- in unsigned long aType
- );
-</pre>
- <div id="section_8">
- <h6 class="editable" id="Parameters_2"><span>Parameters</span></h6>
- <div class="editIcon">
- <a href="/../../../../En/NsITimer#" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <dl>
- <dt>
- <code>aFunc</code></dt>
- <dd>
- a <span class="lang lang-en"><code><a class="new" href="../../../../en/nsITimerCallbackFunc" rel="internal">nsITimerCallbackFunc</a></code> </span> interface compatible function to call when timer fires.</dd>
- </dl>
- <dl>
- <dt>
- <code>aClosure</code></dt>
- <dd>
- An opaque pointer to pass to that function.</dd>
- </dl>
- <dl>
- <dt>
- <code>aDelay</code></dt>
- <dd>
- timeout delay in milliseconds.</dd>
- </dl>
- <dl>
- <dt>
- <code>aType</code></dt>
- <dd>
- Defines the timer type: one shot, repeating slack or repeating precise. Must be one of the constants defined under <span class="lang lang-en"><a href="/../../../../En/NsITimer#Constants" title="../../../../En/NsITimer#Constants">Constants</a> </span> on this page.</dd>
- </dl>
- </div>
- </div>
- <div id="section_9">
- <h3 class="editable" id="init()"><span>init()</span></h3>
- <div class="editIcon">
- <a href="/../../../../En/NsITimer#" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>Initialize a timer that will fire after the specified delay. A user must keep a reference to this timer till it is no longer needed or has been canceled.</p>
- <pre class="eval"> void init(
- in nsIObserver aObserver,
- in unsigned long aDelay,
- in unsigned long aType
- );
-</pre>
- <div id="section_10">
- <h6 class="editable" id="Parameters_3"><span>Parameters</span></h6>
- <div class="editIcon">
- <a href="/../../../../En/NsITimer#" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <dl>
- <dt>
- <code>aObserver</code></dt>
- <dd>
- A callback Object, that is capable listening to timer events. If the timer fires, the observer will be notified via the <span class="lang lang-en"><code><a href="../../../../en/nsIObserver" rel="internal">nsIObserver</a></code> </span> Interface. The subject is set to the <code>nsITimer</code> Object which fired, the topic is equal to "timer-callback" and data is always set to null.</dd>
- </dl>
- <dl>
- <dt>
- <code>aDelay</code></dt>
- <dd>
- timeout delay in milliseconds.</dd>
- </dl>
- <dl>
- <dt>
- <code>aType</code></dt>
- <dd>
- Defines the timer type: one shot, repeating slack or repeating precise. Must be one of the constants defined under <span class="lang lang-en"><a href="/../../../../En/NsITimer#Constants" title="../../../../En/NsITimer#Constants">Constants</a> </span> on this page.</dd>
- </dl>
- </div>
- </div>
- <div id="section_11">
- <h3 class="editable" id="cancel()"><span>cancel()</span></h3>
- <div class="editIcon">
- <a href="/../../../../En/NsITimer#" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>Cancels the timer. This method works on all types, not just on repeating timers -- you might want to cancel a TYPE_ONE_SHOT timer, and even reuse it by re-initializing it (to avoid object destruction and creation costs by conserving one timer instance).</p>
- <pre class="eval"> void cancel();
-</pre>
- <div id="section_12">
- <h6 class="editable" id="Parameters_4"><span>Parameters</span></h6>
- <div class="editIcon">
- <a href="/../../../../En/NsITimer#" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>None.</p>
- </div>
- </div>
- </div>
- <div id="section_13">
- <h2 class="editable" id="备注"><span>备注</span></h2>
- <div class="editIcon">
- <a href="/../../../../En/NsITimer#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>TYPE_REPEATING_SLACK timer is the preferable repeating timer type for most situations<span id="1243145776531S" style="display: none;"> </span></p>
- </div>
- <div id="section_14">
- <h2 class="editable" id="sect1"> </h2>
- <div class="editIcon">
- 实例</div>
- <div class="editIcon">
- <a href="/../../../../En/NsITimer#" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <pre class="eval"> // we need a <span class="lang lang-en"><code><a href="../../../../en/nsITimerCallback" rel="internal">nsITimerCallback</a></code>
-</span> compatible...
- // ... interface for the callbacks.
- var event
- = { notify: function(timer) { alert("Fire!"); } }
-
- // Now it is time to create the timer...
- var timer
- = Components.classes["@mozilla.org/timer;1"]
- .createInstance(Components.interfaces.nsITimer);
-
- // ... and to initialize it, we want to call event.notify() ...
- // ... one time after exactly ten second.
- timer.initWithCallback(
- event,
- 10000,
- Components.interfaces.nsITimer.TYPE_ONE_SHOT);
-</pre>
- <p> </p>
- </div>
- <div id="section_15">
- <h2 class="editable" id="请参阅"><span>请参阅</span></h2>
- <div class="editIcon">
- <a href="/../../../../En/NsITimer#" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p><span class="lang lang-en"><code><a class="new" href="../../../../en/nsITimerCallbackFunc" rel="internal">nsITimerCallbackFunc</a></code> </span>, <span class="lang lang-en"><code><a href="../../../../en/nsITimerCallback" rel="internal">nsITimerCallback</a></code></span></p>
- </div>
- </div>
-</div>
-
-<p><strong class="tag-label">标记:</strong></p>
-<div id="pageTags">
- <div class="pageTagList">
- <div class="item taglist">
- <a href="/../../../../Special:Tags?tag=Interfaces&amp;language=en" title="Interfaces">Interfaces</a>, <a href="/../../../../Special:Tags?tag=Interfaces:Scriptable&amp;language=en" title="Interfaces:Scriptable">Interfaces:Scriptable</a>, <a href="/../../../../Special:Tags?tag=XPCOM&amp;language=en" title="XPCOM">XPCOM</a>, <a href="/../../../../Special:Tags?tag=XPCOM+API+Reference&amp;language=en" title="XPCOM API Reference">XPCOM API Reference</a></div>
- </div>
-</div>
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsitraceablechannel/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsitraceablechannel/index.html
deleted file mode 100644
index ce7c6deb2f..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsitraceablechannel/index.html
+++ /dev/null
@@ -1,71 +0,0 @@
----
-title: nsITraceableChannel
-slug: Mozilla/Tech/XPCOM/Reference/Interface/NsITraceableChannel
-translation_of: Mozilla/Tech/XPCOM/Reference/Interface/NsITraceableChannel
----
-<p></p><div style="border: solid #ddd 2px; margin-bottom: 12px;">
-<div style="background: #eee; padding: 2px;"><code><a href="https://dxr.mozilla.org/mozilla-central/source/netwerk/base/public/nsITraceableChannel.idl" rel="custom">netwerk/base/public/nsITraceableChannel.idl</a></code><span style="text-align: right; float: right;"><a href="/zh-CN/docs/Interfaces/About_Scriptable_Interfaces" style="color: #00cc00; font-weight: 700;">脚本化</a></span></div>
-<span style="padding: 4px 2px;">这个接口用于允许拦截 <a href="/en-US/docs/HTTP" title="/en-US/docs/HTTP">HTTP</a> 流量。It is implemented by <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIHttpChannel" title="">nsIHttpChannel</a></code>.</span>
-
- <div style="height: 42px; position: relative; padding: 2px; width: auto;">
-
- <div style="top: 22px; font-size: 11px; position: absolute;">1.0</div>
-
- <div style="top: 22px; font-size: 11px; position: absolute; left: 0px; text-align: right; float: right; width: 100%;">66</div>
-
- <div style="height: 8px; top: 16px; background: #dd0000; left: 0px; position: absolute; width: 8.952380571428572%;"></div>
-
-<div style="height: 8px; top: 16px; left: 8.952380571428572%; background: #00dd00; position: absolute; width: 91.04761942857142%;" title="Introduced in Gecko 1.9.0.4 "></div>
-
-<div style="top: 0px; font-size: 11px; position: absolute; left: 8.952380571428572%;">Introduced</div>
-<div style="top: 22px; font-size: 11px; position: absolute; left: 8.952380571428572%;">Gecko 1.9.0.4</div>
-
-</div>
-
-<div style="background: #eee; padding: 2px;">
-继承于: <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupports" title="">nsISupports</a></code>
-<span style="text-align: right; float: right;">最后修改于Gecko 1.9.0.4 </span></div>
-</div><p></p>
-<p>使用这个接口的典型方式如下:</p>
-<ul>
- <li><a href="/en/XUL_School/Intercepting_Page_Loads#HTTP_Observers" title="en/XUL_School/Intercepting_Page_Loads#HTTP_Observers">注册“http-on-examine-response”通知</a>来跟综全部 HTTP 响应;</li>
- <li>跳过重定义 (<code>responseStatus</code> = 3xx on <a href="/en-US/docs/XPCOM_Interface_Reference/nsIHttpChannel" title="/en-US/docs/XPCOM_Interface_Reference/nsIHttpChannel">nsIHttpChannel</a>),否则你可能<a class="link-https" href="https://bugzilla.mozilla.org/show_bug.cgi?id=728901#c8" title="https://bugzilla.mozilla.org/show_bug.cgi?id=728901#c8">最终有两个监听视(listeners)注册通道(channel)</a>;</li>
- <li>QI the channel passed as the "<code>subject</code>" to your observer to <code>nsITraceableChannel</code>, and replace the default <code>nsIStreamListener</code> (that passes the data to the original requester - e.g. to XMLHttpRequest or to the browser tab that made the request) with your own implementation (see <a href="#Using_channel_listeners" title="#Using_channel_listeners">"Implementing nsIStreamListener"</a> below).</li>
-</ul>
-<p>之后,你的 nsIStreamListener 实现将会获取到响应数据(response data),并且能够传递数据到原始的 nsIStreamListener(可能会修改它)。</p>
-<p>See <a class="external" href="http://www.softwareishard.com/blog/firebug/nsitraceablechannel-intercept-http-traffic/" title="http://www.softwareishard.com/blog/firebug/nsitraceablechannel-intercept-http-traffic/">nsITraceableChannel, Intercept HTTP Traffic</a> for a more detailed description with code samples.</p>
-<p>See <a href="http://stackoverflow.com/questions/5205672/modify-url-before-loading-page-in-firefox/" title="http://stackoverflow.com/questions/5205672/modify-url-before-loading-page-in-firefox/"> Modify URL before loading page in firefox</a> for an overview of how to <strong>modify</strong> a request before it is made.</p>
-<h2 id="Method_overview" name="Method_overview">Method overview</h2>
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>nsIStreamListener <a href="#setNewListener()">setNewListener</a>(in nsIStreamListener aListener);</code></td>
- </tr>
- </tbody>
-</table>
-<h2 id="Methods" name="Methods">Methods</h2>
-<h3 id="setNewListener()" name="setNewListener()">setNewListener()</h3>
-<p>用一个新的来替换该通道的当前监听器,返回先前分配给该通道的监听器。</p>
-<pre class="eval">nsIStreamListener setNewListener(
- in nsIStreamListener aListener
-);
-</pre>
-<h6 id="Parameters" name="Parameters">参数</h6>
-<dl>
- <dt>
- <code>aListener</code></dt>
- <dd>
- An <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIStreamListener" title="">nsIStreamListener</a></code> to be notified of events on the HTTP channel.</dd>
-</dl>
-<h6 id="Return_value" name="Return_value">返回值</h6>
-<p>该通道的前一个监听器。Each listener call through to the previous listener for every call, in order to establish a call chain to allow all interested parties a chance to act on each event.</p>
-<h2 id="Using_channel_listeners" name="Using_channel_listeners">实现 nsIStreamListener</h2>
-<p>一个 <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIStreamListener" title="">nsIStreamListener</a></code> 接口传递给 <code>setNewListener()</code> 需要实现下列的方法,这是通过调用(这些方法)来通知它在 HTTP stream 上发生的事件:</p>
-<ul>
- <li><code>onStartRequest</code>:一个 HTTP 请求开始。</li>
- <li><code>onDataAvailable:</code>数据到达 HTTP 通道(HTTP channel)。</li>
- <li><code>onStopRequest</code>:HTTP 请求结束。</li>
-</ul>
-<div class="note">
- <strong>Note:</strong> It is critical that you pass along requests to the previous listener as soon as possible -- especially for <code>onStartRequest</code>.</div>
-<p>Channels may restrict when you may replace the listener. In particular, listeners typically should not be replaced after <code>onStartRequest</code> has been called.</p>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiuri/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiuri/index.html
deleted file mode 100644
index d133861ac3..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsiuri/index.html
+++ /dev/null
@@ -1,407 +0,0 @@
----
-title: nsIURI
-slug: Mozilla/Tech/XPCOM/Reference/Interface/nsIURI
-translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIURI
----
-<p></p><div style="border: solid #ddd 2px; margin-bottom: 12px;">
-<div style="background: #eee; padding: 2px;"><code><a href="https://dxr.mozilla.org/mozilla-central/source/netwerk/base/public/nsIURI.idl" rel="custom">netwerk/base/public/nsIURI.idl</a></code><span style="text-align: right; float: right;"><a href="/zh-CN/docs/Interfaces/About_Scriptable_Interfaces" style="color: #00cc00; font-weight: 700;">脚本化</a></span></div>
-<span style="padding: 4px 2px;">
-
-这是具有国际化支持的统一资源标识符的接口,提供允许设置和查询URI基本组件的属性以及用于在URI上执行基本操作的方法。
-</span>
-
-<div style="background: #eee; padding: 2px;">
-继承于: <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISupports" title="">nsISupports</a></code>
-<span style="text-align: right; float: right;">最后修改于Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3)</span></div>
-</div><p></p>
-
-<p>细节请查看下列 RFCs:</p>
-
-<ul>
- <li><a class="external" href="http://www.ietf.org/rfc/rfc3490.txt" title="http://www.ietf.org/rfc/rfc3490.txt">RFC3490</a>: 在应用程序中的国际域名 (IDNA)</li>
- <li><a class="external" href="http://tools.ietf.org/rfc/rfc3986.txt" title="http://tools.ietf.org/rfc/rfc3986.txt">RFC3986</a>: 统一资源标识符 (URI): 通用词法</li>
- <li><a class="external" href="http://tools.ietf.org/rfc/rfc3987.txt" title="http://tools.ietf.org/rfc/rfc3987.txt">RFC3987</a>: 国际化的内容标识</li>
-</ul>
-
-<p><code>nsIURI</code>的子类,  例如 <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIURL" title="">nsIURL</a></code>, 加强了URI未来的结构化.</p>
-
-<p>为了创建一个 <code>nsIURI</code> 对象, 你应该如此使用 <code><a href="https://developer.mozilla.org/zh-CN/docs/XPCOM_Interface_Reference/nsIIOService#newURI()">nsIIOService.newURI()</a></code>:</p>
-
-<pre class="brush: js">function makeURI(aURL, aOriginCharset, aBaseURI) {
- var ioService = Components.classes["@mozilla.org/network/io-service;1"]
- .getService(Components.interfaces.nsIIOService);
- return ioService.newURI(aURL, aOriginCharset, aBaseURI);
-}
-</pre>
-
-<h2 id="Components_of_a_URI" name="Components_of_a_URI">一个 URI 的组件</h2>
-
-<table class="standard-table">
- <thead>
- <tr>
- <th colspan="7" scope="col" style="text-align: center;">prePath</th>
- <th colspan="2" scope="col" style="text-align: center;">path</th>
- </tr>
- <tr>
- <th scope="col" style="text-align: center;">scheme</th>
- <th scope="col" style="text-align: center;"> </th>
- <th scope="col" style="text-align: center;">userPass</th>
- <th scope="col" style="text-align: center;"> </th>
- <th scope="col" style="text-align: center;">host</th>
- <th scope="col" style="text-align: center;"> </th>
- <th scope="col" style="text-align: center;">port</th>
- <th scope="col" style="text-align: center;"> </th>
- <th scope="col" style="text-align: center;">ref</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td style="text-align: right;">ftp</td>
- <td>://</td>
- <td>username@password</td>
- <td>@</td>
- <td>hostname</td>
- <td>:</td>
- <td>portnumber</td>
- <td>/pathname?query=value</td>
- <td>#ref</td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Method_overview" name="Method_overview">函数预览</h2>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td><code>nsIURI <a href="#clone()">clone</a>();</code></td>
- </tr>
- <tr>
- <td><code>nsIURI <a href="#cloneIgnoringRef()">cloneIgnoringRef</a>();</code> </td>
- </tr>
- <tr>
- <td><code>boolean <a href="#equals()">equals</a>(in nsIURI other);</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="#equalsExceptRef()">equalsExceptRef</a>(in nsIURI other);</code> </td>
- </tr>
- <tr>
- <td><code>AUTF8String <a href="#resolve()">resolve</a>(in AUTF8String relativePath);</code></td>
- </tr>
- <tr>
- <td><code>boolean <a href="#schemeIs()">schemeIs</a>(in string scheme);</code></td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Attributes" name="Attributes">属性</h2>
-
-<table class="standard-table">
- <tbody>
- <tr>
- <td class="header">属性</td>
- <td class="header">类别</td>
- <td class="header">描述</td>
- </tr>
- <tr>
- <td><code>asciiHost</code></td>
- <td><code><a href="/en/ACString" title="en/ACString">ACString</a></code></td>
- <td>
- <p>The URI <code>host</code> with an ASCII compatible encoding. Follows the IDNA draft specification for converting internationalized domain names (UTF-8) to ASCII for compatibility with existing Internet infrastructure. <strong>Read only.</strong></p>
-
- <div class="note">
- <p><strong>Note:</strong> IPv6 addresses are not enclosed in square brackets.</p>
- </div>
- </td>
- </tr>
- <tr>
- <td><code>asciiSpec</code></td>
- <td><code><a href="/en/ACString" title="en/ACString">ACString</a> (US-ASCII)</code></td>
- <td>The URI spec with an ASCII compatible encoding. The host portion follows the IDNA draft spec. Other parts are URL-escaped per the rules of <a class="external" href="http://tools.ietf.org/rfc/rfc3986.txt" title="http://tools.ietf.org/rfc/rfc3986.txt">RFC3986</a>. The result is strictly ASCII. <strong>Read only.</strong></td>
- </tr>
- <tr>
- <td><code>hasRef</code></td>
- <td><code>boolean</code></td>
- <td>Returns if there is a reference portion (the part after the "#") of the URI.<br>
- <br>
- </td>
- </tr>
- <tr>
- <td><code>host</code></td>
- <td><code><a href="/en/AUTF8String" title="en/AUTF8String">AUTF8String</a></code></td>
- <td>
- <p>The host is the Internet domain name to which this URI refers. It could be an IPv4 (or IPv6) address literal. If supported, it could be a non-ASCII internationalized domain name.</p>
-
- <h6 id="Exceptions_thrown">Exceptions thrown</h6>
-
- <dl>
- <dt><code>NS_ERROR_FAILURE</code></dt>
- <dd>If host is not applicable to the URI scheme (e.g. about:blank)</dd>
- </dl>
-
- <div class="note"><strong>Note:</strong> Characters are <strong>not</strong> escaped. IPv6 addresses are not enclosed in square brackets.</div>
- </td>
- </tr>
- <tr>
- <td><code>hostPort</code></td>
- <td><code><a href="/en/AUTF8String" title="en/AUTF8String">AUTF8String</a></code></td>
- <td>
- <p>The "host:port" part of the URI (or simply the host, if port is -1).</p>
-
- <h6 id="Exceptions_thrown_2">Exceptions thrown</h6>
-
- <dl>
- <dt><code>NS_ERROR_FAILURE</code></dt>
- <dd>If hostPort is not applicable to the URI scheme (e.g. about:blank)</dd>
- </dl>
-
- <div class="note"><strong>Note:</strong> Characters are <strong>not</strong> escaped.</div>
- </td>
- </tr>
- <tr>
- <td><code>originCharset</code></td>
- <td><code><a href="/en/ACString" title="en/ACString">ACString</a></code></td>
- <td>
- <p>The charset of the document from which this URI originated. An empty value implies UTF-8.</p>
- If this value is something other than UTF-8 then the URI components (for example <code>spec</code>, <code>prePath</code>, <code>username</code>, and so on) are all fully URL-escaped. Otherwise, the URI components may contain unescaped multibyte UTF-8 characters. <strong>Read only.</strong></td>
- </tr>
- <tr>
- <td><code>password</code></td>
- <td><code><a href="/en/AUTF8String" title="en/AUTF8String">AUTF8String</a></code></td>
- <td>
- <p>The optional password, assuming the <code>preHost</code> consists of "username:password".</p>
-
- <h6 id="Exceptions_thrown_3">Exceptions thrown</h6>
-
- <dl>
- <dt><code>NS_ERROR_FAILURE</code></dt>
- <dd>If password is not applicable to the URI scheme (e.g. about:blank)</dd>
- </dl>
-
- <p></p><div class="blockIndicator note"><strong>Note:</strong> Some characters may be escaped.</div><p></p>
- </td>
- </tr>
- <tr>
- <td><code>path</code></td>
- <td><code><a href="/en/AUTF8String" title="en/AUTF8String">AUTF8String</a></code></td>
- <td>
- <p>The path, typically including at least a leading '/' (but may also be empty, depending on the protocol).</p>
- <div class="blockIndicator note"><strong>Note:</strong> Some characters may be escaped.</div></td>
- </tr>
- <tr>
- <td><code>port</code></td>
- <td><code><a href="/en/long" title="en/long">long</a></code></td>
- <td>
- <p>The URI's port. A port value of -1 corresponds to the protocol's default port (for example -1 implies port 80 for HTTP URIs).</p>
-
- <h6 id="Exceptions_thrown_4">Exceptions thrown</h6>
-
- <dl>
- <dt><code>NS_ERROR_FAILURE</code></dt>
- <dd>If port is not applicable to the URI scheme (e.g. about:blank)</dd>
- </dl>
- </td>
- </tr>
- <tr>
- <td><code>prePath</code></td>
- <td><code><a href="/en/AUTF8String" title="en/AUTF8String">AUTF8String</a></code></td>
- <td>
- <p>The <code>prePath</code> returns the string before the path (such as "<a class="external" rel="freelink">scheme://user:password@host</a>:port").</p>
-
- <p>This is related to the <a class="external" href="http://tools.ietf.org/html/rfc6454" title="http://tools.ietf.org/html/rfc6454">Web Origin Concept of RFC6454</a>.</p>
-
- <p>This is useful for authentication, managing sessions, or for checking the <code>origin</code> of an URI to prevent cross-site scripting attacks while using methods such as <a href="/zh-CN/docs/Web/API/Window/postMessage" title="window.postMessage() 方法可以安全地实现跨源通信。通常,对于两个不同页面的脚本,只有当执行它们的页面位于具有相同的协议(通常为https),端口号(443为https的默认值),以及主机  (两个页面的模数 Document.domain设置为相同的值) 时,这两个脚本才能相互通信。window.postMessage() 方法提供了一种受控机制来规避此限制,只要正确的使用,这种方法就很安全。"><code>window.postMessage()</code></a>.</p>
- <div class="blockIndicator note"><strong>Note:</strong> Some characters may be escaped.</div> <strong>Read only.</strong></td>
- </tr>
- <tr>
- <td><code>ref</code></td>
- <td><code><a href="/en/AUTF8String" title="en/AUTF8String">AUTF8String</a></code></td>
- <td>
- <p>Returns the reference portion (the part after the "#") of the URI. If there is not one, an empty string is returned.</p>
- <div class="blockIndicator note"><strong>Note:</strong> Some characters may be escaped.</div> </td>
- </tr>
- <tr>
- <td><code>scheme</code></td>
- <td><code><a href="/en/ACString" title="en/ACString">ACString</a> (US-ASCII)</code></td>
- <td>
- <p>The <code>scheme</code> is the protocol to which this URI refers. The scheme is restricted to the US-ASCII charset per <a class="external" href="http://tools.ietf.org/rfc/rfc3986.txt" title="http://tools.ietf.org/rfc/rfc3986.txt">RFC3986</a>.</p>
-
- <div class="warning"><strong>Warning:</strong> Setting this is highly discouraged outside of a protocol handler implementation, since doing so will generally lead to unpredictable results.</div>
- </td>
- </tr>
- <tr>
- <td><code>spec</code></td>
- <td><code><a href="/en/AUTF8String" title="en/AUTF8String">AUTF8String</a></code></td>
- <td>
- <p>Returns a string representation of the URI. Setting the <code>spec</code> causes the new spec to be parsed using the rules for the scheme the URI currently has. If the string cannot be parsed as a URI, <code>NS_ERROR_MALFORMED_URI</code> thrown.</p>
-
- <div class="warning"><strong>Warning:</strong> Because parsing the string is done using the current URI's scheme, setting the spec to a URI with a different scheme will produce incorrect results. Therefore, only protocol handler implementations should do this.</div>
-
- <p>If the URI stores information from the <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIIOService" title="">nsIIOService</a></code> interface's <code><a href="https://developer.mozilla.org/zh-CN/docs/XPCOM_Interface_Reference/nsIIOService#newURI()">nsIIOService.newURI()</a></code> call that created it, other than just the parsed string, the behavior of this information when setting the <code>spec</code> attribute is undefined.</p>
- <div class="blockIndicator note"><strong>Note:</strong> Some characters may be escaped.</div></td>
- </tr>
- <tr>
- <td><code>specIgnoringRef</code></td>
- <td><code><a href="/en/AUTF8String" title="en/AUTF8String">AUTF8String</a></code></td>
- <td>Returns a string representation of the URI without the <code>ref</code> (part after the #) portion.<br>
- <br>
- <div class="blockIndicator note"><strong>Note:</strong> Some characters may be escaped.</div> </td>
- </tr>
- <tr>
- <td><code>username</code></td>
- <td><code><a href="/en/AUTF8String" title="en/AUTF8String">AUTF8String</a></code></td>
- <td>
- <p>The optional username, assuming the <code>preHost</code> consists of "username:password".</p>
-
- <h6 id="Exceptions_thrown_5">Exceptions thrown</h6>
-
- <dl>
- <dt><code>NS_ERROR_FAILURE</code></dt>
- <dd>If username is not applicable to the URI scheme (e.g. about:blank)</dd>
- </dl>
- <div class="blockIndicator note"><strong>Note:</strong> Some characters may be escaped.</div></td>
- </tr>
- <tr>
- <td><code>userPass</code></td>
- <td><code><a href="/en/AUTF8String" title="en/AUTF8String">AUTF8String</a></code></td>
- <td>
- <p>The "username:password" (or username only if the value doesn't contain a ':').</p>
-
- <h6 id="Exceptions_thrown_6">Exceptions thrown</h6>
-
- <dl>
- <dt><code>NS_ERROR_FAILURE</code></dt>
- <dd>If userPass is not applicable to the URI scheme (e.g. about:blank)</dd>
- </dl>
- <div class="blockIndicator note"><strong>Note:</strong> Some characters may be escaped.</div></td>
- </tr>
- </tbody>
-</table>
-
-<h2 id="Methods" name="Methods">Methods</h2>
-
-<h3 id="clone()" name="clone()">clone()</h3>
-
-<p>Clones the URI, returning a new <code>nsIURI</code> object.</p>
-
-<div class="note"><strong>Note:</strong> For some protocols, this is more than just an optimization. For example, under Mac OS X, the spec of a file URI doesn't necessarily uniquely identify a file, since two volumes can have the same name.</div>
-
-<pre class="eval">nsIURI clone();
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-
-<p>None.</p>
-
-<h6 id="Return_value" name="Return_value">Return value</h6>
-
-<p>An <code>nsIURI</code> object that represents the same URI as the current <code>nsIURI</code>.</p>
-
-<p></p><h3 id="cloneIgnoringRef()">cloneIgnoringRef()</h3><p></p>
-
-<p>Clones the current URI, clearing the <code>'ref'</code> attribute in the clone.</p>
-
-<pre class="eval">nsIURI cloneIgnoringRef();
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-
-<p>None.</p>
-
-<h6 id="Return_value" name="Return_value">Return value</h6>
-
-<p>An <code>nsIURI</code> object that represents the same URI as the current <code>nsIURI</code> without the <code>'ref'</code> attribute.</p>
-
-<h3 id="equals()" name="equals()">equals()</h3>
-
-<p>Compares the current URI with another URI.</p>
-
-<div class="note"><strong>Note:</strong> This is more than a string comparison, as two different URI strings can represent the same location. For example, comparing "<a class="external" href="http://foo.com:80/" rel="freelink">http://foo.com:80/</a>" and "<a class="external" href="http://foo.com/" rel="freelink">http://foo.com/</a>" will return <code>true</code>.</div>
-
-<pre class="eval">boolean equals(
- in nsIURI other
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-
-<dl>
- <dt><code>other</code></dt>
- <dd>Another <code>nsIURI</code> to compare to.</dd>
-</dl>
-
-<h6 id="Return_value" name="Return_value">Return value</h6>
-
-<p><code>true</code> if the two URIs represent the same location; otherwise <code>false</code>.</p>
-
-<p></p><h3 id="equalsExceptRef()">equalsExceptRef()</h3><p></p>
-
-<p>Compares the current URI with another URI, ignoring the value of the <code>.ref</code> member.</p>
-
-<div class="note"><strong>Note:</strong> This is more than a string comparison, as two different URI strings can represent the same location. For example, comparing "<a class="external" href="http://foo.com/#" rel="freelink">http://foo.com/#</a>" and "<a class="external" href="http://foo.com/" rel="freelink">http://foo.com/</a>" or "<a class="external" href="http://foo.com/#aaa" rel="freelink">http://foo.com/#aaa</a>" and "<a class="external" href="http://foo.com/#bbb" rel="freelink">http://foo.com/#bbb</a>" will return <code>true</code>.</div>
-
-<pre class="eval">boolean equalsExceptRef(
- in nsIURI other
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-
-<dl>
- <dt><code>other</code></dt>
- <dd>Another <code>nsIURI</code> to compare to.</dd>
-</dl>
-
-<h6 id="Return_value" name="Return_value">Return value</h6>
-
-<p><code>true</code> if the two URIs represent the same location; otherwise <code>false</code>.</p>
-
-<h3 id="resolve()" name="resolve()">resolve()</h3>
-
-<p>Resolves a relative URI string, using this URI as the base.</p>
-
-<p></p><div class="blockIndicator note"><strong>Note:</strong> Some implementations may have no concept of a relative URI.</div><p></p>
-
-<pre class="eval">AUTF8String resolve(
- in AUTF8String relativePath
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-
-<dl>
- <dt><code>relativePath</code></dt>
- <dd>The relative path to resolve.</dd>
-</dl>
-
-<h6 id="Return_value" name="Return_value">Return value</h6>
-
-<p>The resolved absolute URI string.</p>
-
-<h3 id="schemeIs()" name="schemeIs()">schemeIs()</h3>
-
-<p>Quickly reports whether the <code>nsIURI</code> represents a URI with the specified scheme. This comparison is case-insensitive.</p>
-
-<p></p><div class="blockIndicator note"><strong>Note:</strong> This is an optimization, allowing you to check the scheme of the URI without having to get the scheme and do the comparison yourself; this saves memory allocations.</div><p></p>
-
-<pre class="eval">boolean schemeIs(
- in string scheme
-);
-</pre>
-
-<h6 id="Parameters" name="Parameters">Parameters</h6>
-
-<dl>
- <dt><code>scheme</code></dt>
- <dd>A string representing the scheme to compare to.</dd>
-</dl>
-
-<h6 id="Return_value" name="Return_value">Return value</h6>
-
-<p><code>true</code> if the URI is for the specified scheme; otherwise <code>false</code>.</p>
-
-<h2 id="See_also" name="See_also">See also</h2>
-
-<ul>
- <li><a href="/en/Code_snippets/URI_parsing" title="en/Code_snippets/URI_parsing">Code snippets:URI parsing</a></li>
-</ul>
diff --git a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsixmlhttprequest/index.html b/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsixmlhttprequest/index.html
deleted file mode 100644
index f12f52cb12..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/reference/interface/nsixmlhttprequest/index.html
+++ /dev/null
@@ -1,90 +0,0 @@
----
-title: nsIXMLHttpRequest
-slug: Mozilla/Tech/XPCOM/Reference/Interface/nsIXMLHttpRequest
-tags:
- - XMLHttpRequest
- - XPCOM API 参考
- - XPCOM 接口参考
- - 指南
- - 接口
-translation_of: Mozilla/Tech/XPCOM/Reference/Interface/nsIXMLHttpRequest
----
-<div class="blockIndicator obsolete obsoleteHeader"><p><strong><span class="icon-only-inline" title="This is an obsolete API and is no longer guaranteed to work."><i class="icon-trash"> </i></span> Obsolete since Gecko 60 (Firefox 60 / Thunderbird 60 / SeaMonkey 2.57)</strong><br>This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.</p></div>
-
-<p><code>nsIXMLHttpRequest</code> along with <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIJSXMLHttpRequest" title="">nsIJSXMLHttpRequest</a></code> and <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIXMLHttpRequestEventTarget" title="">nsIXMLHttpRequestEventTarget</a></code> are Mozilla's implementation details of the DOM <a href="/en/DOM/XMLHttpRequest" title="en/DOM/XMLHttpRequest">XMLHttpRequest</a> object.</p>
-
-<div class="note"><strong>注意:</strong> 如果你是 Web 开发者或者 Mozilla add-on 开发者,请参考 <a href="/en/DOM/XMLHttpRequest">XMLHttpRequest</a>。</div>
-
-<p>This page contains documentation, specific to Mozilla application and add-on developers.</p>
-
-<p>The interface definition: <a href="https://dxr.mozilla.org/mozilla-central/source/dom/xhr/nsIXMLHttpRequest.idl">https://dxr.mozilla.org/mozilla-central/source/dom/xhr/nsIXMLHttpRequest.idl</a></p>
-
-<h3 id="Elevated_Privileges">Elevated Privileges</h3>
-
-<p>As mentioned in the "Non-Standard Properties" the property of <code>channel</code> was read-only. When using the XPCOM interface, as seen below in <a href="#Example_code">Example 2</a>, we can get access to this. The most obvious benefit is that we can set <a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/NsIRequest#Constants">nsiRequest - Constants</a> in the <code>xhr.channel.loadFlags</code>. For instance, as done in <a href="#Example_code">Example 2</a>, the flag of <code>LOAD_ANONYMOUS</code> is added, this strips all user data (cookies, tokens, etc).</p>
-
-<h3 id="Using_event_handlers_from_native_code">Using event handlers from native code</h3>
-
-<p>(Not sure if it's up-to-date)</p>
-
-<p>From native code, the way to set up onload and onerror handlers is a bit different. Here is a comment from Johnny Stenback &lt;<a class="link-mailto" href="mailto:jst@netscape.com" rel="freelink">jst@netscape.com</a>&gt;:</p>
-
-<blockquote>The mozilla implementation of nsIXMLHttpRequest implements the interface nsIDOMEventTarget and that's how you're supported to add event listeners. Try something like this: nsCOMPtr&lt;nsIDOMEventTarget&gt; target(do_QueryInterface(myxmlhttpreq)); target-&gt;AddEventListener(NS_LITERAL_STRING("load"), mylistener, PR_FALSE) where mylistener is your event listener object that implements the interface nsIDOMEventListener. The 'onload', 'onerror', and 'onreadystatechange' attributes moved to nsIJSXMLHttpRequest, but if you're coding in C++ you should avoid using those.</blockquote>
-
-<p>Though actually, if you use addEventListener from C++ weird things will happen too, since the result will depend on what JS happens to be on the stack when you do it....</p>
-
-<p>Conclusion: Do not use event listeners on XMLHttpRequest from C++, unless you're aware of all the security implications. And then think twice about it.</p>
-
-<h2 id="Example_code" name="Example_code">Example code</h2>
-
-<p>This is a simple example code for opening a simple HTTP request from a xul application (like a Mozilla extension) without using observers:</p>
-
-<pre class="eval"> var req = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance();
- req.open('POST', "<a class="external" href="http://www.foo.bar:8080/nietzsche.do" rel="freelink">http://www.foo.bar:8080/nietzsche.do</a>", true);
- req.send('your=data&amp;and=more&amp;stuff=here');
-</pre>
-
-<h2 id="Example_code" name="Example_code">Example 2</h2>
-
-<pre><code>var {Cu: utils, Cc: classes, Ci: instances} = Components;
-Cu.import('resource://gre/modules/Services.jsm');
-function xhr(url, cb) {
- let xhr = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIXMLHttpRequest);
-
- let handler = ev =&gt; {
- evf(m =&gt; xhr.removeEventListener(m, handler, !1));
- switch (ev.type) {
- case 'load':
- if (xhr.status == 200) {
- cb(xhr.response);
- break;
- }
- default:
- Services.prompt.alert(null, 'XHR Error', 'Error Fetching Package: ' + xhr.statusText + ' [' + ev.type + ':' + xhr.status + ']');
- break;
- }
- };
-
- let evf = f =&gt; ['load', 'error', 'abort'].forEach(f);
- evf(m =&gt; xhr.addEventListener(m, handler, false));
-
- xhr.mozBackgroundRequest = true;
- xhr.open('GET', url, true);
- xhr.channel.loadFlags |= Ci.nsIRequest.LOAD_ANONYMOUS | Ci.nsIRequest.LOAD_BYPASS_CACHE | Ci.nsIRequest.INHIBIT_PERSISTENT_CACHING;
- xhr.responseType = "arraybuffer"; //dont set it, so it returns string, you dont want arraybuffer. you only want this if your url is to a zip file or some file you want to download and make a nsIArrayBufferInputStream out of it or something
- xhr.send(null);
-}
-
-xhr('https://www.gravatar.com/avatar/eb9895ade1bd6627e054429d1e18b576?s=24&amp;d=identicon&amp;r=PG&amp;f=1', data =&gt; {
- Services.prompt.alert(null, 'XHR Success', data);
- var file = OS.Path.join(OS.Constants.Path.desktopDir, "test.png");
- var promised = OS.File.writeAtomic(file, new UInt8Array(data));
- promised.then(
- function() {
- alert('succesfully saved image to desktop')
- },
- function(ex) {
- alert('FAILED in saving image to desktop')
- }
- );
-});</code></pre>
diff --git a/files/zh-cn/mozilla/tech/xpcom/setting_http_request_headers/index.html b/files/zh-cn/mozilla/tech/xpcom/setting_http_request_headers/index.html
deleted file mode 100644
index b91030b424..0000000000
--- a/files/zh-cn/mozilla/tech/xpcom/setting_http_request_headers/index.html
+++ /dev/null
@@ -1,261 +0,0 @@
----
-title: Setting HTTP request headers
-slug: Mozilla/Tech/XPCOM/Setting_HTTP_request_headers
-translation_of: Mozilla/Tech/XPCOM/Setting_HTTP_request_headers
----
-<p><a href="https://developer.mozilla.org/en-US/docs/HTTP">HTTP</a> 是网络背后的核心技术之一。除了实质内容之外,一些重要的信息通过HTTP 头传递给HTTP 请求和响应。</p>
-
-<p>你可以添加你自己的HTTP头到应用程序所做的任何请求中,不论你的代码是否启动了显式打开了基于 <a href="/zh-cn/nsIXMLHttpRequest" title="zh-cn/XMLHttpRequest">XMLHttpRequest</a> 活动、&lt;img&gt;元素或者甚至是从css中的 HTTP Channel的请求。</p>
-
-<h3 id="HTTP_Channels">HTTP Channels</h3>
-
-<p>当你处理HTTP请求和响应时,通常情况下你是通过 <code><a href="/zh-cn/XPCOM_Interface_Reference/nsIHttpChannel" title="zh-cn/XPCOM_Interface_Reference/nsIHttpChannel">nsIHttpChannel</a></code>来做的。 <code><a href="/zh-cn/XPCOM_Interface_Reference/nsIHttpChannel" title="zh-cn/XPCOM_Interface_Reference/nsIHttpChannel">nsIHttpChannel</a></code>接口有一些属性和方法,但是这下方法中我们只对<code>setRequestHeader感兴趣。这个方法允许我们设置一个</code> <em>HTTP request header</em>.</p>
-
-<p>下面是设置一个HTTP header 的简单代码</p>
-
-<pre class="eval">// adds "X-Hello: World" header to the request
-httpChannel.setRequestHeader("X-Hello", "World", false);
-</pre>
-
-<p>在这个示例代码中我们有一个变量名为httpChannel,它是一个nsIHttpChannel的实例。</p>
-
-<p>setRequestHeader有三个参数,第一个参数是HTTP请求头的名字,第二个参数是HTTP请求头的值,第三个参数我们暂时忽略它,总设置其为false。</p>
-
-<p>在我们的示例代码中,我们为HTTP reques header中增加了被我们命名为X-Hello的HTTP请求头,其值为World</p>
-
-<div class="note">
-<p><s><strong>NOTE</strong>: If you are making up your own HTTP header, you MUST put a <code>X-</code> in front of the name. (In our example, our made up HTTP header is <code>X-Hello</code> and NOT <code>Hello</code> because we correctly added the <code>X-</code> in front of our name.)</s></p>
-
-<p><br>
- <strong>No longer the case: <a class="external" href="http://tools.ietf.org/html/draft-ietf-appsawg-xdash-02" title="http://tools.ietf.org/html/draft-ietf-appsawg-xdash-02">http://tools.ietf.org/html/draft-ietf-appsawg-xdash-02</a></strong></p>
-</div>
-
-<h3 id="Notifications" name="Notifications">Notifications</h3>
-
-<p>The question that may be coming to your mind right now is, how do you get the <code>nsIHttpChannel</code> when an HTTP request is made.</p>
-
-<p>In the case your code initiates the request, you probably already have one. Trapping other requests is done with notifications, which are a lot like <em>events</em> or <em>signals</em> found in other languages and frameworks.</p>
-
-<p>In particular, to get the <code>nsIHttpChannel</code> just before the HTTP request is made we need to <em>observe</em> the <code>"http-on-modify-request"</code> topic. (And yes, <code>"http-on-modify-request"</code> is a string.)</p>
-
-<div class="note">
-<p><strong>NOTE</strong>: There are many topics, besides just <code>"http-on-modify-request"</code>, that you can get notifications about, for example <code>"http-on-examine-response"</code> and <code>"xpcom-shutdown"</code>. You can also make up your own topics and send out your own notifications.</p>
-
-<p>For more information about notifications framework and a list of common notification topics, see <a href="/zh-cn/Observer_Notifications" title="zh-cn/Observer_Notifications">Observer Notifications</a>.</p>
-</div>
-
-<h3 id="Observers" name="Observers">Observers</h3>
-
-<p>To get notified about some topic (like <code>"http-on-modify-request"</code>) we need to create an <strong>observer</strong>. An observer is a component implementing <a href="/zh-cn/XPCOM_Interface_Reference/nsIObserver" title="zh-cn/nsIObserver">nsIObserver</a> interface. And once the observer is <em>registered</em> for a topic, it will get notified about the topic by having its <code>observe</code> method called.</p>
-
-<p>Below is an example observer that adds a custom header "X-Hello" to the channel passed in for http-on-modify-request notification:</p>
-
-<pre class="brush: js">var httpRequestObserver =
-{
- observe: function(subject, topic, data)
- {
- if (topic == "http-on-modify-request") {
- var httpChannel = subject.QueryInterface(Components.interfaces.nsIHttpChannel);
- httpChannel.setRequestHeader("X-Hello", "World", false);
- }
- }
-};
-</pre>
-
-<p><span class="comment">div class="note"&gt; Doesn't seem very suitable for this article; readers should are typically assumed to be familiar with JS. Nickolay '''NOTE''': Often people expect <a href="/zh-cn/JavaScript" title="zh-cn/JavaScript">JavaScript</a> to be just like <a href="/zh-cn/Java" title="zh-cn/Java">Java</a>. And while superficially, they look very similar, there are some important differences between the two. For example, while Java is an &lt;em&gt;object-oriented programming language&lt;/em&gt;, JavaScript is not. JavaScript is &lt;em&gt;prototype-based programming language&lt;/em&gt; and as such while it has &lt;em&gt;objects&lt;/em&gt; it does not have &lt;em&gt;classes&lt;/em&gt;. (Which is why, if you are not well versed with JavaScript, the object creation in the sample code above may look strange.) &lt;/div</span></p>
-
-<p>Note that the number of parameter that the <code>observe</code> method takes is important. It takes 3 parameters (as we've shown in the example code above). For the <code>"http-on-modify-request"</code> topic, the first parameter (named <code>subject</code> in the code above) will be the <code>nsIHttpChannel</code>. However, it is passed to us as an <code><a href="/zh-cn/XPCOM_Interface_Reference/nsISupports" title="zh-cn/nsISupports">nsISupports</a></code>. So we need to <em>change</em> the <code>nsISupports</code> into a <code>nsIHttpChannel</code> which is what the <code>QueryInterface</code> call does. And yes, <em>converting</em> objects from one kind to another is very ugly, and lacks (what is usually called) <em>syntactic sugar</em>.</p>
-
-<p>The second line of code in the <code>if</code> block should already be familiar to you. It is the same code we used before, earlier in this article, to add the HTTP request header.</p>
-
-<p>The name of this object -- <code>httpRequestObserver</code> -- isn't important. We could have named it anything we liked.</p>
-
-<h3 id="Registering" name="Registering">Registering</h3>
-
-<p>After we've created the observer, we need to register it. In our case, we want to register it for the <code>"http-on-modify-request"</code> topic. We can do this with the code below.</p>
-
-<pre class="eval">var observerService = Components.classes["@<a class="linkification-ext external" href="http://mozilla.org/observer-service;1" title="Linkification: http://mozilla.org/observer-service;1">mozilla.org/observer-service;1</a>"]
- .getService(Components.interfaces.<a href="/zh-cn/XPCOM_Interface_Reference/nsIObserverService" title="zh-cn/XPCOM_Interface_Reference/nsIObserverService">nsIObserverService</a>);
-observerService.addObserver(httpRequestObserver, "http-on-modify-request", false);
-</pre>
-
-<p>The first statement gets the object that will let us register with topics that we want to get notified about.</p>
-
-<p>The second statement does the actual registering. We are saying we want <code>httpRequestObserver</code> to be notified (by calling its <code>observe</code> method) when a <code>"http-on-modify-request"</code> topic takes place (which we know happens just before each HTTP request).</p>
-
-<h3 id="Unregistering" name="Unregistering">Unregistering</h3>
-
-<p>You should unregister the observer on shutdown. Failing to do that may cause memory leaks. To unregister the observer use <code>nsIObserverService.removeObserver</code> as follows:</p>
-
-<pre class="eval">observerService.removeObserver(httpRequestObserver, "http-on-modify-request");</pre>
-
-<h3 id="All-in-one_example">All-in-one example</h3>
-
-<p>Here is a slightly different version of our <code>httpRequestObserver</code> object. While the previous version we showed before was good for learning, in an actual real-world application, you'd probably want to code it more like the following.</p>
-
-<pre class="brush: js">var httpRequestObserver =
-{
- observe: function(subject, topic, data)
- {
- if (topic == "http-on-modify-request") {
- var httpChannel = subject.QueryInterface(Components.interfaces.nsIHttpChannel);
- httpChannel.setRequestHeader("X-Hello", "World", false);
- }
- },
-
- get observerService() {
- return Components.classes["@<a class="linkification-ext" href="http://mozilla.org/observer-service;1" title="Linkification: http://mozilla.org/observer-service;1">mozilla.org/observer-service;1</a>"]
- .getService(Components.interfaces.nsIObserverService);
- },
-
- register: function()
- {
- this.observerService.addObserver(this, "http-on-modify-request", false);
- },
-
- unregister: function()
- {
- this.observerService.removeObserver(this, "http-on-modify-request");
- }
-};
-</pre>
-
-<p>This object has a convenience <code>register()</code> and <code>unregister()</code> methods, so in order to activate it you just need to call:</p>
-
-<pre class="eval">httpRequestObserver.register();
-</pre>
-
-<p>You should also remember to unregister the observer at shutdown:</p>
-
-<pre class="eval">httpRequestObserver.unregister();
-</pre>
-
-<p>And that's it.</p>
-
-<h3 id="XPCOM_components" name="XPCOM_components">XPCOM components</h3>
-
-<p>You need to register a single <code>http-on-modify-request</code> observer per application (and not one per window). This means that you should put the observer's implementation in an <a href="/zh-cn/How_to_Build_an_XPCOM_Component_in_Javascript" title="zh-cn/How_to_Build_an_XPCOM_Component_in_Javascript">XPCOM component</a> instead of an <a href="/zh-cn/XUL_Overlays" title="zh-cn/XUL_Overlays">overlay</a>. If you want to support Gecko2 (Firefox4) you need to register your javascript component as described here: <a class="linkification-ext" href="/zh-cn/XPCOM/XPCOM_changes_in_Gecko_2.0#JavaScript_components" title="Linkification: https://developer.mozilla.org/zh-cn/XPCOM/XPCOM_changes_in_Gecko_2.0#JavaScript_components">https://developer.mozilla.org/zh-cn/XPCOM/XPCOM_changes_in_Gecko_2.0#JavaScript_components</a>.</p>
-
-<pre class="brush: js">var headerName = "X-hello";
-var headerValue = "world";
-
-function LOG(text)
-{
- // var consoleService = Components.classes["@<a class="linkification-ext" href="http://mozilla.org/consoleservice;1" title="Linkification: http://mozilla.org/consoleservice;1">mozilla.org/consoleservice;1</a>"].getService(Components.interfaces.nsIConsoleService);
- // consoleService.logStringMessage(text);
-}
-
-function myHTTPListener() { }
-
-myHTTPListener.prototype = {
-
- observe: function(subject, topic, data)
- {
- if (topic == "http-on-modify-request") {
-
- LOG("----------------------------&gt; (" + subject + ") mod request");
-
- var httpChannel = subject.QueryInterface(Components.interfaces.nsIHttpChannel);
- httpChannel.setRequestHeader(headerName, headerValue, false);
- return;
- }
-
-
- if (topic == "profile-after-change") {
-
- LOG("----------------------------&gt; profile-after-change");
-
- var os = Components.classes["@<a class="linkification-ext" href="http://mozilla.org/observer-service;1" title="Linkification: http://mozilla.org/observer-service;1">mozilla.org/observer-service;1</a>"]
- .getService(Components.interfaces.nsIObserverService);
-
- os.addObserver(this, "http-on-modify-request", false);
- return;
- }
- },
-
- QueryInterface: function (iid) {
- if (iid.equals(Components.interfaces.nsIObserver) ||
- iid.equals(Components.interfaces.nsISupports))
- return this;
-
- Components.returnCode = Components.results.NS_ERROR_NO_INTERFACE;
- return null;
- },
-};
-
-var myModule = {
- registerSelf: function (compMgr, fileSpec, location, type) {
-
- var compMgr = compMgr.QueryInterface(Components.interfaces.nsIComponentRegistrar);
- compMgr.registerFactoryLocation(this.myCID,
- this.myName,
- this.myProgID,
- fileSpec,
- location,
- type);
-
-
- LOG("----------------------------&gt; registerSelf");
-
- var catMgr = Components.classes["@<a class="linkification-ext" href="http://mozilla.org/categorymanager;1" title="Linkification: http://mozilla.org/categorymanager;1">mozilla.org/categorymanager;1</a>"].getService(Components.interfaces.nsICategoryManager);
- catMgr.addCategoryEntry("app-startup", this.myName, this.myProgID, true, true);
- },
-
-
- getClassObject: function (compMgr, cid, iid) {
-
- LOG("----------------------------&gt; getClassObject");
-
- return this.myFactory;
- },
-
- myCID: Components.ID("{9cf5f3df-2505-42dd-9094-c1631bd1be1c}"),
-
- myProgID: "@dougt/myHTTPListener;1",
-
- myName: "Simple HTTP Listener",
-
- myFactory: {
- QueryInterface: function (aIID) {
- if (!aIID.equals(Components.interfaces.nsISupports) &amp;&amp;
-  !aIID.equals(Components.interfaces.nsIFactory))
- throw Components.results.NS_ERROR_NO_INTERFACE;
- return this;
- },
-
- createInstance: function (outer, iid) {
-
- LOG("----------------------------&gt; createInstance");
-
- return new myHTTPListener();
- }
- },
-
- canUnload: function(compMgr) {
- return true;
- }
-};
-
-function NSGetModule(compMgr, fileSpec) {
- return myModule;
-}
-</pre>
-
-<h3 id="Privacy_and_security_good_practice">Privacy and security good practice</h3>
-
-<p>A use case for setting specific a HTTP request header is to have a specific web site be able to check if a specific plugin / addon / extension is installed.</p>
-
-<p>The good practice is not to have this specific HTTP header (<code>for example </code>"X-site.net-extension") sent all the time but only when doing requests with this specific web sites. By not advertising to all sites what extensions are installed this improves both privacy (this makes it harder to track a user known by his set of plugins, addons and extensions) and security (some plugins, addons and extensions may be known to have flaws by attackers).</p>
-
-<p>With this privacy and security addition the code to use becomes:</p>
-
-<pre class="brush: js"> observe: function(subject, topic, data)
- {
- if (topic == "http-on-modify-request") {
- var httpChannel = subject.QueryInterface(Components.interfaces.nsIHttpChannel);
-<code> if (/site.net/.test(</code>httpChannel<code>.originalURI.host)) {
-</code> httpChannel.setRequestHeader("X-Hello", "World", false);
- }
- }
- },
-</pre>
diff --git a/files/zh-cn/mozilla/tech/xpidl/index.html b/files/zh-cn/mozilla/tech/xpidl/index.html
deleted file mode 100644
index c976d0bae9..0000000000
--- a/files/zh-cn/mozilla/tech/xpidl/index.html
+++ /dev/null
@@ -1,502 +0,0 @@
----
-title: XPIDL
-slug: Mozilla/Tech/XPIDL
-tags:
- - XPCOM
- - xpidl
-translation_of: Mozilla/Tech/XPIDL
----
-<p> </p>
-<p><strong>XPIDL</strong> 是一个用于指定 <a href="https://developer.mozilla.org/en-US/docs/XPCOM" title="XPCOM">XPCOM</a> 接口类的接口描述语言</p>
-<p>Interface Description Languages (IDL) are used to describe interfaces in a language- and machine-independent way. IDLs make it possible to define interfaces which can then be processed by tools to autogenerate language-dependent interface specifications. XPIDL is expected to converge towards WebIDL in the future.</p>
-<div class="note">
- <p><strong>Note:</strong> Starting in {{Gecko("9.0")}}, the older <a href="https://developer.mozilla.org/en-US/docs/XPIDL/xpidl" title="XPIDL/xpidl">xpidl</a> utility, which was previously used to generate C++ header files, typelib information, and so forth has been replaced with<a href="https://developer.mozilla.org/en-US/docs/XPIDL/pyxpidl" title="XPIDL/pyxpidl">pyxpidl</a> in the <a href="https://developer.mozilla.org/en-US/docs/Gecko_SDK" title="Gecko SDK">Gecko SDK</a>. <a href="https://developer.mozilla.org/en-US/docs/XPIDL/pyxpidl" title="XPIDL/pyxpidl">pyxpidl</a> has been used for some time now, but now the older tool has been fully retired.</p>
-</div>
-<h2 id="Writing_XPIDL_interface_files" name="Writing_XPIDL_interface_files" style="margin-bottom: 20px; line-height: 30px;">Writing XPIDL interface files</h2>
-<p>XPIDL closely resembles <a class="external external-icon" href="http://www.omg.org/gettingstarted/omg_idl.htm" style="white-space: pre-line;">OMG IDL</a>, with extended syntax to handle IIDs and additional types. Some examples are in the {{Source("xpcom/base")}} and {{Source("xpcom/ds")}} directories of the Mozilla tree.</p>
-<ul>
- <li><a href="https://developer.mozilla.org/en-US/docs/XPIDL/Syntax" title="XPIDL/Syntax">XPIDL:Syntax</a> (Now up to date again)</li>
- <li><a class="external external-icon" href="http://www.mozilla.org/scriptable/xpidl/syntax.html" style="white-space: pre-line;">XPIDL syntax</a> (Out of date)</li>
- <li><a class="external external-icon" href="http://www.mozilla.org/scriptable/xpidl/idl-authors-guide/index.html" style="white-space: pre-line;">XPIDL Author's Guide</a> (Not as out of date)</li>
-</ul>
-<h2 id="Explanation_of_IDL_semantics" name="Explanation_of_IDL_semantics" style="margin-bottom: 20px; line-height: 30px;">Explanation of IDL semantics</h2>
-<p>A full guide to the syntax can be found at <a href="https://developer.mozilla.org/en-US/docs/XPIDL/Syntax" title="XPIDL/Syntax">XPIDL:Syntax</a>, which is written in an ABNF form.</p>
-<p>An xpidl file is essentially just a series of declarations. At the top level, we can define typedefs, native types, or interfaces. Interfaces may furthermore contain typedefs, natives, methods, constants, or attributes. Most declarations can have properties applied to them.</p>
-<h3 id="Types" style="line-height: 24px; letter-spacing: normal;">Types</h3>
-<p>There are three ways to make types: a typedef, a native, or an interface. In addition, there are a few built-in native types. The built-in native types are those listed under the type_spec production above. The following is the correspondence table:</p>
-<table class="standard-table">
- <caption>
- Table 1: Standard IDL types</caption>
- <thead>
- <tr>
- <th scope="col">IDL</th>
- <th scope="col">C++ in parameter</th>
- <th scope="col">C++ out parameter</th>
- <th scope="col">JS type</th>
- <th scope="col">Notes</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><code>boolean</code></td>
- <td><code>bool</code></td>
- <td><code>bool *</code></td>
- <td>boolean</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>char</code></td>
- <td><code>char</code></td>
- <td><code>char *</code></td>
- <td>string</td>
- <td>Only chars in range \u0000-\u00ff permitted</td>
- </tr>
- <tr>
- <td><code>double</code></td>
- <td><code>double</code></td>
- <td><code>double *</code></td>
- <td>number</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>float</code></td>
- <td><code>float</code></td>
- <td><code>float *</code></td>
- <td>number</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>long</code></td>
- <td><code>int32_t</code></td>
- <td><code>int32_t *</code></td>
- <td>number</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>long long</code></td>
- <td><code>int64_t</code></td>
- <td><code>int64_t *</code></td>
- <td>number</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>octet</code></td>
- <td><code>uint8_t</code></td>
- <td><code>uint8_t *</code></td>
- <td>number</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>short</code></td>
- <td><code>int16_t</code></td>
- <td><code>int16_t *</code></td>
- <td>number</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>string</code></td>
- <td><code>const char *</code></td>
- <td><code>char **</code></td>
- <td>string</td>
- <td>Only chars in range \u0000-\u00ff permitted</td>
- </tr>
- <tr>
- <td><code>unsigned long</code></td>
- <td><code>uint32_t</code></td>
- <td><code>uint32_t *</code></td>
- <td>number</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>unsigned long long</code></td>
- <td><code>uint64_t</code></td>
- <td><code>uint64_t *</code></td>
- <td>number</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>unsigned short</code></td>
- <td><code>uint16_t</code></td>
- <td><code>uint16_t *</code></td>
- <td>number</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>wchar</code></td>
- <td><code>PRUnichar</code></td>
- <td><code>PRUnichar *</code></td>
- <td>string</td>
- <td>Full Unicode set permitted</td>
- </tr>
- <tr>
- <td><code>wstring</code></td>
- <td><code>const PRUnichar *</code></td>
- <td><code>PRUnichar **</code></td>
- <td>string</td>
- <td>Full Unicode set permitted</td>
- </tr>
- </tbody>
-</table>
-<p>In addition to this list, nearly every IDL file includes <code>nsrootidl.idl</code> in some fashion, which also defines the following types:</p>
-<table class="standard-table">
- <caption>
- Table 2: Types provided by nsrootidl.idl</caption>
- <thead>
- <tr>
- <th scope="col">IDL typedef</th>
- <th scope="col">C++ in parameter</th>
- <th scope="col">C++ out parameter</th>
- <th scope="col">JS type</th>
- <th scope="col">Notes</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><code>PRTime</code></td>
- <td colspan="2" rowspan="1">(XPIDL <code>unsigned long long</code> typedef, 64 bits)</td>
- <td rowspan="1">number</td>
- <td rowspan="1">PRTime is in microseconds, while JS date assumes time in milliseconds</td>
- </tr>
- <tr>
- <td><code>nsresult</code></td>
- <td colspan="2" rowspan="1">(XPIDL <code>unsigned long</code>typedef, 32 bits)</td>
- <td rowspan="1">number</td>
- <td rowspan="1"> </td>
- </tr>
- <tr>
- <td><code>nsrefcnt</code></td>
- <td colspan="2" rowspan="1">(XPIDL <code>unsigned long</code>typedef, 32 bits)</td>
- <td rowspan="1">number</td>
- <td rowspan="1"> </td>
- </tr>
- <tr>
- <td><code>size_t</code></td>
- <td colspan="2" rowspan="1">(XPIDL <code>unsigned long</code>typedef, 32 bits)</td>
- <td rowspan="1">number</td>
- <td rowspan="1"> </td>
- </tr>
- <tr>
- <td><code>voidPtr</code></td>
- <td><code>void *</code></td>
- <td><code>void *</code></td>
- <td>not allowed</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>charPtr</code></td>
- <td><code>char *</code></td>
- <td><code>char **</code></td>
- <td>not allowed</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>unicharPtr</code></td>
- <td><code>PRUnichar *</code></td>
- <td><code>PRUnichar **</code></td>
- <td>not allowed</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>nsIDRef</code></td>
- <td><code>const nsID &amp;</code></td>
- <td><code>nsID *</code></td>
- <td>?</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>nsIIDRef</code></td>
- <td><code>const nsIID &amp;</code></td>
- <td><code>nsIID *</code></td>
- <td>?</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>nsCIDRef</code></td>
- <td><code>const nsCID &amp;</code></td>
- <td><code>nsCID *</code></td>
- <td>?</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>nsIDPtr</code></td>
- <td><code>const nsID *</code></td>
- <td><code>nsID **</code></td>
- <td>?</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>nsIIDPtr</code></td>
- <td><code>const nsIID *</code></td>
- <td><code>nsIID **</code></td>
- <td>?</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>nsCIDPtr</code></td>
- <td><code>const nsCID *</code></td>
- <td><code>nsCID **</code></td>
- <td>?</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>nsIID</code></td>
- <td><code>const nsIID</code></td>
- <td><code>nsIID *</code></td>
- <td>?</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>nsID</code></td>
- <td><code>const nsID</code></td>
- <td><code>nsID *</code></td>
- <td>?</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>nsCID</code></td>
- <td><code>const nsCID</code></td>
- <td><code>nsCID *</code></td>
- <td>?</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>nsQIResult</code></td>
- <td><code>void *</code></td>
- <td><code>void **</code></td>
- <td>object</td>
- <td>Should only be used with methods that act like QueryInterface</td>
- </tr>
- <tr>
- <td><code>DOMString</code></td>
- <td><code>const nsAString &amp;</code></td>
- <td><code>nsAString &amp;</code></td>
- <td>string</td>
- <td>Full Unicode set permitted</td>
- </tr>
- <tr>
- <td><code>AUTF8String</code></td>
- <td><code>const nsACString &amp;</code></td>
- <td><code>nsACString &amp;</code></td>
- <td>string</td>
- <td>Full Unicode set permitted (translated to UTF-8)</td>
- </tr>
- <tr>
- <td><code>ACString</code></td>
- <td><code>const nsACString &amp;</code></td>
- <td><code>nsACString &amp;</code></td>
- <td>string</td>
- <td>Only chars in range \u0000-\u00ff permitted</td>
- </tr>
- <tr>
- <td><code>AString</code></td>
- <td><code>const nsAString &amp;</code></td>
- <td><code>nsAString &amp;</code></td>
- <td>string</td>
- <td>Full Unicode set permitted</td>
- </tr>
- <tr>
- <td><code>jsval</code></td>
- <td><code>const jsval &amp;</code></td>
- <td><code>jsval *</code></td>
- <td>anything</td>
- <td> </td>
- </tr>
- <tr>
- <td><code>jsid</code></td>
- <td><code>jsid</code></td>
- <td><code>jsid *</code></td>
- <td>not allowed</td>
- <td> </td>
- </tr>
- </tbody>
-</table>
-<p>Typedefs in IDL are basically as they are in C or C++: you define first the type that you want to refer to and then the name of the type. Types can of course be one of the fundamental types, or any other type declared via a typedef, interface, or a native type.</p>
-<p>Native types are types which correspond to a given C++ type. Most native types are not scriptable: if it is not present in the list above, then it is certainly not scriptable (some of the above, particularly jsid, are not scriptable).</p>
-<p>The contents of the parentheses of a native type declaration (although native declarations without parentheses are parsable, I do not trust that they are properly handled by the xpidl handlers) is a string equivalent to the C++ type. XPIDL itself does not interpret this string, it just literally pastes it anywhere the native type is used. The interpretation of the type can be modified by having properties on the native declaration:</p>
-<table class="standard-table">
- <caption>
- Table 3: Native type definitions</caption>
- <tbody>
- <tr>
- <td>astring</td>
- <td>This is an nsAString declaration. Overrides native string.</td>
- </tr>
- <tr>
- <td>cstring</td>
- <td>This is an nsACString declaration. Overrides native string.</td>
- </tr>
- <tr>
- <td>domstring</td>
- <td>This is an nsAString declaration. Overrides native string.</td>
- </tr>
- <tr>
- <td>jsval</td>
- <td>This type gets const when an in type. Special in typelib.</td>
- </tr>
- <tr>
- <td>nsid</td>
- <td>This type gets const when an in type. Special in typelib.</td>
- </tr>
- <tr>
- <td>ptr</td>
- <td>The type is really (native str)*</td>
- </tr>
- <tr>
- <td>ref</td>
- <td>The type is really (native str)&amp;</td>
- </tr>
- <tr>
- <td>utf8string</td>
- <td>This is an nsACString declaration whose text is UTF-8.</td>
- </tr>
- </tbody>
-</table>
-<p class="warning" style="background-color: rgba(193, 56, 50, 0.839844); font-size: 14px;">As far as I can tell, these properties also apply to typedefs. Need to verify.</p>
-<h3 id="Constants" style="line-height: 24px; letter-spacing: normal;">Constants</h3>
-<p>Constants are technically legal at the top level, but xpidl I forbids them from being placed there; instead, they must be in an interface. The only constants supported are those which become integer types when compiled to source code; string constants and floating point constants, though parseable, cannot be made into a header or xpt file.</p>
-<p>Constants are emitted in header files using anonymous enums, although there is an outstanding patch that combines adjacent constants into the same anonymous enums to quiet enum mismatch warnings.</p>
-<h3 id="Interfaces" style="line-height: 24px; letter-spacing: normal;">Interfaces</h3>
-<p>Specifying interfaces is the primary purpose of using xpidl. Interfaces are basically a collection of constants, methods, and attributes; in Mozilla, these are the primary ways in which JavaScript code can interact with native C++ code. Furthermore, interfaces can also inherit from another interface. Every interface should inherit <a href="https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsISupports" title="nsISupports">nsISupports</a> in some fashion. However, it is generally not recommended to have a chain of interfaces inheriting from each other if you intend to have a chain of implementations for each interface, as it can cause problems in C++ code.</p>
-<table class="standard-table">
- <caption>
- Table 4: Basic interface attributes</caption>
- <thead>
- <tr>
- <th scope="col">Attribute</th>
- <th scope="col">Interpretation</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><code>uuid(12345678-fedc-ba98-7654-0123456789ab)</code></td>
- <td>This is the internal way this interface is accessed; it must be unique, and the uuid must be changed anytime any part of the interface or its ancestors are changed. For instructions on how to generate an UUID see <a href="https://developer.mozilla.org/en-US/docs/Generating_GUIDs" title="Generating GUIDs">Generating GUIDs</a>.</td>
- </tr>
- <tr>
- <td><code>builtinclass</code></td>
- <td>JavaScript classes are forbidden from implementing this interface. All children must also be marked with this property.</td>
- </tr>
- <tr>
- <td><code>function</code></td>
- <td>The JavaScript implementation of this interface may be a function that is invoked on property calls instead of an object with the given property</td>
- </tr>
- <tr>
- <td><code>scriptable</code></td>
- <td>This interface is usable by JavaScript classes. Must inherit from a<code>scriptable</code> interface.</td>
- </tr>
- <tr>
- <td><code>deprecated</code></td>
- <td>This interface should no longer be used. The compiler will emit warnings if you attempt to use this.</td>
- </tr>
- </tbody>
-</table>
-<h3 id="Methods_and_attributes" style="line-height: 24px; letter-spacing: normal;">Methods and attributes</h3>
-<p>Interfaces declare a series of attributes and methods. Attributes in IDL are akin to JavaScript properties, in that they are a getter and (optionally) a setter pair. In JavaScript contexts, attributes are exposed as a regular property access, while native code sees attributes as a Get and possibly a Set method.</p>
-<p>Attributes can be declared readonly, in which case setting causes an error to be thrown in script contexts and native contexts lack the Set method, by using the "readonly" keyword.</p>
-<p>To native code, on attribute declared 'attribute type foo;' is syntactic sugar for the declaration of two methods 'type getFoo();' and 'void setFoo(in type foo);'. If foo were declared readonly, the latter method would not be present. Attributes support all of the properties of methods with the exception of <code>optional_argc</code>, as this does not make sense for attributes.</p>
-<p>There are some special rules for attribute naming. As a result of vtable munging by the MSVC++ compiler, an attribute with the name `IID' is forbidden. In addition, any attribute whose name matches the regex /^[a-z]{2,3}I[A-Z][a-z]/ is emitted with a warning, as its name looks like an nsIInterface or a mozIInterface declaration. Also like methods, if the first character of an attribute is lowercase in IDL, it is made uppercase in native code only.</p>
-<p>Methods define a return type and a series of in and out parameters. When called from a JavaScript context, they invocation looks as it is declared for the most part; some parameter properties can adjust what the code looks like. The calls are more mangled in native contexts.</p>
-<p>An important attribute for methods and attributes is scriptability. A method or attribute is scriptable if it is declared in a <code>scriptable</code> interface and it lacks a<code>noscript</code> or <code>notxpcom</code> property. Any method that is not scriptable can only be accessed by native code. However, scriptable methods must contain parameters and a return type that can be translated to script: any native type, save those declared with an <code>nsid</code>, <code>domstring</code>, <code>utf8string</code>, <code>cstring</code>, <code>astring</code>, or <code>jsval</code> property, may not be used in a scriptable method or attribute. An exception to the above rule is if the parameter has the <code>iid_is</code> property (a special case for some QueryInterface-like operations). In general, this means that the only usable native types are those declared in nsrootidl.idl (see above).</p>
-<p>Methods and attributes are mangled on conversion to native code. If a method is declared <code>notxpcom</code>, the mangling of the return type is prevented, so it is called mostly as it looks. Otherwise, the return type of the native method is nsresult, and the return type acts as a final outparameter if it is not void. The name is translated so that the first character is unconditionally uppercase; subsequent characters are unaffected. However, the presence of the <code>binaryname</code> property allows the user to select another name to use in native code (to avoid conflicts with other functions). For example, the method '[binaryname(foo)] void bar();' becomes 'nsresult Foo()' in native code (note that capitalization is still applied). However, the capitalization is not applied when using <code>binaryname</code> with attributes; i.e., <code>[binaryname(foo)] readonly attribute Quux bar;</code> becomes <code>Getfoo(Quux**)</code> in native code. Attributes named 'IID' and methods named 'GetIID' are forbidden, although this is checked before binaryname conversion.</p>
-<p>The <code>implicit_jscontext</code> and <code>optional_argc</code> parameters are properties which help native code implementations determine how the call was made from script. If<code>implicit_jscontext</code> is present on a method, then an additional JSContext *cx parameter is added just after the regular list which receives the context of the caller. If <code>optional_argc</code> is present, then an additional uint8_t _argc method is added at the end which receives the number of optional arguments that were actually used (obviously, you need to have an optional argument in the first place). Note that if both properties are set, the JSContext *cx is added first, followed by the uint8_t _argc, and then ending with return value parameter. Finally, as an exception to everything already mentioned, for attribute getters and setters the JSContext *cx comes before any other arguments.</p>
-<p>In addition, methods and attributes can be both marked as deprecated with the<code>deprecated</code> property, which causes compilers to emit deprecation usage warnings. Note that this is only verified in native code and not script code.</p>
-<p>The final native-only property is <code>nostdcall</code>. Normally, declarations are made in the stdcall ABI on Windows to be ABI-compatible with COM interfaces. Any non-scriptable method or attribute with <code>nostdcall</code> instead uses the thiscall ABI convention. Methods without this property generally use NS_IMETHOD in their declarations and NS_IMETHODIMP in their definitions to automatically add in the stdcall declaration specifier on requisite compilers; those that use this method may use a plain `nsresult' instead.</p>
-<h4 id="Source_and_Binary_Compatibility" style="line-height: 18px; letter-spacing: normal;">Source and Binary Compatibility</h4>
-<p>Some consumers of IDL interfaces create binary plugins that expect the interfaces to be stored in a specific way in memory. In other words, some changes made to IDL interfaces require the author to modify the unique identifier (IID) in order to make it clear to plugins that utilize these interfaces that they have changed, and thus their plugin must be recompiled.</p>
-<p>Common changes to an interface, such as changes to a method signature, number of arguments, and number or type of attributes, automatically require an IID change. In addition, some changes to interface attributes require that an IID be changed, as well. When a change to an interface made by an XPIDL developer requires that third-party binary addons be recompiled, we say that it affects <em>binary compatibility</em>. When a change to an interface made by an XPIDL developer requires that third-party binary addons change their source code, we say that it affects <em>source compatibility. </em>In table 5, the columns on the far right indicate whether changes to a specific attribute affect source compatibility, binary compatibility, or both.</p>
-<table>
- <caption>
- Table 5: Optional interface attributes</caption>
- <thead>
- <tr>
- <th scope="row">Attribute</th>
- <th scope="col">Valid for methods</th>
- <th scope="col">Valid for attributes</th>
- <th scope="col">Effect</th>
- <th scope="col">Changes Source Compatibility?</th>
- <th scope="col">Changes Binary Compatibility?</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td><code>binaryname(foo)</code></td>
- <td>Y</td>
- <td>Y</td>
- <td>Results in the C++ method being called "<code>Foo</code>"</td>
- <td>Y</td>
- <td>N</td>
- </tr>
- <tr>
- <td><code>deprecated</code></td>
- <td>Y</td>
- <td>Y</td>
- <td>Emits a compiler warning if used in C++ code</td>
- <td>N</td>
- <td>N</td>
- </tr>
- <tr>
- <td><code>implicit_jscontext</code></td>
- <td>Y</td>
- <td>Y</td>
- <td>Adds an additional<code>JSContext *cx</code> parameter to the C++ implementation</td>
- <td>Y</td>
- <td>Y</td>
- </tr>
- <tr>
- <td><code>noscript</code></td>
- <td>Y</td>
- <td>Y</td>
- <td>Prohibits the method/attribute from being accessible in JS code</td>
- <td>N</td>
- <td>N</td>
- </tr>
- <tr>
- <td><code>nostdcall</code></td>
- <td>Y</td>
- <td>Y</td>
- <td>The C++ implementation uses <code>virtual nsresult</code>instead of<code>NS_IMETHOD</code>/<code>NS_IMETHODIMP</code></td>
- <td>Y</td>
- <td>Y</td>
- </tr>
- <tr>
- <td><code>notxpcom</code></td>
- <td>Y</td>
- <td>Y</td>
- <td>The C++ implementation does not return <code>nsresult</code>(implies <code>noscript</code>)</td>
- <td>Y</td>
- <td>Y</td>
- </tr>
- <tr>
- <td><code>optional_argc</code></td>
- <td>Y</td>
- <td>N</td>
- <td>Adds an additional <code>uint8_t _argc</code> parameter to the C++ implementation</td>
- <td>Y</td>
- <td>Y</td>
- </tr>
- </tbody>
-</table>
-<h4 id="Method_parameters" style="line-height: 18px; letter-spacing: normal;">Method parameters</h4>
-<p>Each method parameter can be specified in one of three modes: <code>in</code>, <code>out</code>, or <code>inout</code>. An out parameter is essentially an auxiliary return value, although these are moderately cumbersome to use from script contexts and should therefore be avoided if reasonable. An inout parameter is an in parameter whose value may be changed as a result of the method; these parameters are rather annoying to use and should generally be avoided if at all possible.</p>
-<p>Out and inout parameters are reflected as objects having the .value property which contains the real value of the parameter; it is not initialized in the case of out parameters and is initialized to the passed-in-value for inout parameters. The script code would need to set this property to assign a value to the parameter. Regular in parameters are reflected more or less normally, with numeric types all representing numbers, booleans as true or false, the various strings (including AString et al) as a JavaScript string, and nsid types as a Components.ID instance. In addition, the jsval type is translated as the appropriate JavaScript value (since a jsval is the internal representation of all JavaScript values), and objects that are marked nsIVariant have their<br>
- types automatically boxed and unboxed as appropriate.</p>
-<p>The equivalent representations of all IDL types in native code is given in the earlier tables; parameters of type inout follow their out form. Native code should pay particular attention to not passing in null values for out parameters (although some parts of the codebase are known to violate this, it is strictly enforced at the JS&lt;-&gt;native barrier), and also ensuring that boolean types only receive values of 0 (false) or 1 (true).</p>
-<p>Representations of types additionally depend on some of the many types of properties they may have. The <code>array</code> property turns the parameter into an array; the parameter must also have a corresponding <code>size_is</code> property whose argument is the parameter that has the size of the array. In native code, the type gains another pointer indirection, and JavaScript arrays are used in script code. Script code callers can ignore the value of array parameter, but implementors must still set the values appropriately.</p>
-<p>The <code>const</code> and <code>shared</code> properties are special to native code. As its name implies, the const property makes its corresponding argument const. The shared property is only meaningful for out or inout parameters and it means that the pointer value should not be freed by the caller. Only the string, wstring, and native types having the nsid, domstring, utf8string, cstirng, astring, or jsval properties may be declared shared, and, even then, only if the parameter is not an array parameter. The shared property also makes its corresponding argument const.<br>
- <br>
- The <code>retval</code> property indicates that the parameter is actually acting as the return value, and it is only the need to assign properties to the parameter that is causing it to be specified as a parameter. It has no effect on native code, but script code uses it like a regular return value. Naturally, a method which contains a retval parameter must be declared void, and the parameter itself must be an out parameter and the last parameter.</p>
-<p>Other properties are the <code>optional</code> and <code>iid_is</code> property. The optional property indicates that script code may omit the property without problems; all subsequent parameters must either by optional themselves or the retval parameter. Note that optional out parameters still pass in a variable for the parameter, but its value will be ignored. The iid_is parameter indicates that the real IID of an nsQIResult parameter may be found in the corresponding parameter, to allow script code to automatically unbox the type.</p>
-<p>Not all type combinations are possible. Native types with the various string properties are all forbidden from being used as an inout parameter or as an array parameter. In addition, native types with the nsid property but lacking either a ptr or ref property are forbidden unless the method is notxpcom and it is used as an inparameter.</p>
-<p>For types that reference heap-allocated data (strings, arrays, interface pointers, etc), you must follow the XPIDL data ownership conventions in order to avoid memory corruption and security vulnerabilities:</p>
-<ul>
- <li>For <code>in</code> parameters, the caller allocates and deallocates all data. If the callee needs to use the data after the call completes, it must make a private copy of the data, or, in the case of interface pointers, AddRef it.</li>
- <li>For <code>out</code> parameters, the callee creates the data, and transfers ownership to the caller. For buffers, the callee allocates the buffer with NS_Alloc, and the caller frees the buffer with NS_Free. For interface pointers, the callee does the AddRef on behalf of the caller, and the caller must call Release.</li>
- <li>For <code>inout</code> parameters, the callee must clean up the old data if it chooses to replace it. Buffers must be deallocated with NS_Free, and interface pointers must be Release'd. Afterwards, the above rules for <code>out</code> apply.</li>
- <li>Shared out-parameters should not be freed, as they are intended to refer to constant string literals.</li>
-</ul>
-<h2 id="Resources" name="Resources" style="margin-bottom: 20px; line-height: 30px;">Resources (mostly outdated)</h2>
-<ul>
- <li><a class="external external-icon" href="http://www.mozilla.org/scriptable/xpidl/notes/" style="white-space: pre-line;">Some unsorted notes</a> including a <a class="external external-icon" href="http://www.mozilla.org/scriptable/xpidl/notes/keywords.txt" style="white-space: pre-line;">keyword list</a></li>
- <li><a href="https://developer.mozilla.org/en-US/docs/XPIDL/xpidl" title="XPIDL/xpidl">xpidl</a> is a tool for generating C++ headers, Java interfaces, <a href="https://developer.mozilla.org/en-US/docs/XPConnect" title="XPConnect">XPConnect</a> typelibs, and HTML documentation from XPIDL files</li>
- <li><a href="https://developer.mozilla.org/en-US/docs/XPIDL/Generating_xpt_on_Windows" title="XPIDL/Generating_xpt_on_Windows">Generating xpt files on Windows</a></li>
- <li><a class="external external-icon" href="http://groups.google.com/group/mozilla.dev.extensions/browse_thread/thread/371b5f04e4ecdcfb/a9d48a45c9453d16?q=idl+OR+xpidl+variable+argument+group:mozilla.dev.*#a9d48a45c9453d16" style="white-space: pre-line;" title="http://groups.google.com/group/mozilla.dev.extensions/browse_thread/thread/371b5f04e4ecdcfb/a9d48a45c9453d16?q=idl+OR+xpidl+variable+argument+group:mozilla.dev.*#a9d48a45c9453d16">A Google groups post</a> with instructions on how to use variable-length argument lists using XPIDL.</li>
-</ul>
diff --git a/files/zh-cn/mozilla/tech/xpidl/syntax/index.html b/files/zh-cn/mozilla/tech/xpidl/syntax/index.html
deleted file mode 100644
index daca23f49f..0000000000
--- a/files/zh-cn/mozilla/tech/xpidl/syntax/index.html
+++ /dev/null
@@ -1,127 +0,0 @@
----
-title: Syntax
-slug: Mozilla/Tech/XPIDL/Syntax
-tags:
- - xpidl
-translation_of: Mozilla/Tech/XPIDL/Syntax
----
-<h3 id="Status_of_this_document" name="Status_of_this_document">Status of this document</h3>
-
-<p>This is a partial reverse-engineering of the libIDL source code's parser, limited mostly to the subset of functionality that is supported by the Mozilla xpidl binary.</p>
-
-<h3 id="Purpose_of_this_document" name="Purpose_of_this_document">Purpose of this document</h3>
-
-<p>This document is <strong>not</strong> an introduction to XPIDL or IDL in general. It is more focused on XPIDL syntax and grammar. See <a href="/en/XPIDL" title="en/XPIDL">XPIDL Main Page</a> for more links and introductory content.</p>
-
-<h3 id="Simplifications.2C_conventions_and_notation" name="Simplifications.2C_conventions_and_notation">Simplifications, conventions and notation</h3>
-
-<p>The syntax is specified according to ABNF as defined by <a class="external" href="http://tools.ietf.org/html/rfc5234" title="http://tools.ietf.org/html/rfc5234">RFC 5234</a>, although a few productions use prose for clarity of understanding.</p>
-
-<p>Lexically, tokens are delimited by whitespace (defined here as spaces, tabs, vertical tabs, form feeds, line feeds, and carriage returns, or [ \t\v\f\r\n] in regular expression form). LibIDL only considers a single line feed as a newline, and not carriage returns (although xpidl begs to differ). Additionally, the use of both C-style (/* ... */) and C++-style (// ... end-of-line) comments are permitted between any two tokens.</p>
-
-<p>Some productions can only occur at the beginning of lines; to simplify the grammar, I will not mention them in the grammar, especially since they are handled as a preprocessing step before the IDL source code is actually parsed.</p>
-
-<ol>
- <li>A `<code>%{</code>' that appears at the beginning of a line is the start of a <strong>raw code fragment</strong>, which extends until the end of a line that begins with `<code>%}</code>'. Text inside raw code fragments are not otherwise parsed by xpidl directly. This may be followed by the language, as in `<code>%{C++</code>', to output the raw fragment only in the specified language.</li>
- <li>A `<code>#include "file"</code>' line instructs the xpidl processor to include that file in the same sense that the C preprocessor includes a file. Note that includes within comments or raw code fragments are not processed by xpidl. Unlike the C preprocessor, when a file is included multiple times, it acts as if the subsequent includes did not happen; this prevents the need for include guards.</li>
-</ol>
-
-<h3 id="XPIDL_Syntax_.28BNF.29" name="XPIDL_Syntax_.28BNF.29">XPIDL Syntax (ABNF)</h3>
-
-<p>The root production here is <code>idl_file</code>.</p>
-
-<p><code><code>idl_file = 1*definition<br>
- definition = [type_decl / const_decl / interface] ";"<br>
- interface = [prop_list] "interface" ident [[inheritance] "{" *(ifacebody) "}"]<br>
- inheritance = ":" *(scoped_name ",") scoped_name]<br>
- ifacebody = [type_decl / op_decl /attr_decl / const_decl] ";" / codefrag<br>
- <br>
- type_decl = [prop_list] "typedef" type_spec *(ident ",") ident<br>
- type_decl /= [prop_list] "native" ident [parens]<br>
- const_decl = "const" type_spec ident "=" expr<br>
- op_decl = [prop_list] (type_spec / "void") parameter_decls raise_list<br>
- parameter_decls = "(" [*(param_decl ",") param_decl] ")"<br>
- param_decl = [prop_list] ("in" / "out" / "inout") type_spec ident<br>
- attr_decl = [prop_list] ["readonly"] "attribute" type_spec *(ident ",") ident<br>
- <br>
- ; Descending order of precedence<br>
- expr /= expr ("|" / "^" / "&amp;") expr ; Unequal precedence "|" is lowest<br>
- expr /= expr ("&lt;&lt;" / "&gt;&gt;") expr<br>
- expr /= expr ("+" / "-") expr<br>
- expr /= expr ("*" / "/" / "%") expr<br>
- expr /= ["-" / "+" / "~"] (scoped_name / literal / "(" expr ")" )<br>
- <br>
- ; Numeric literals: quite frankly, I'm sure you know how these kinds of<br>
- ; literals work, and these are annoying to specify in ABNF.<br>
- literal = octal_literal / decimal_literal / hex_literal / floating_literal<br>
- literal /= string_literal / char_literal<br>
- literal /= "TRUE" / "FALSE"<br>
- <br>
- ; In regex: /"[^"\n]*["\n]/. Yes, newline terminates.<br>
- string_literal = 1*(%x22 *(any char except %x22 or %x0a) (%x22 / %x0a))<br>
- ; Same as above, but s/"/'/g<br>
- char_literal = 1*(%x27 *(any char except %x27 or %x0a) (%x27 / %x0a))<br>
- <br>
- type_spec = "float" / "double" / "string" / "wstring"<br>
- type_spec /= ["unsigned"] ("short" / "long" / "long" "long")<br>
- type_spec /= "char" / "wchar" / "boolean" / "octet"<br>
- type_spec /= scoped_name<br>
- <br>
- prop_list = "[" *(property ",") property "]"<br>
- property = ident [parens]<br>
- raise_list = "raises" "(" *(scoped_name) ",") scoped_name ")"<br>
- <br>
- scoped_name = *(ident "::") ident / "::" ident</code></code><br>
- <code><code>; In regex: [A-Za-z_][A-Za-z0-9_]*; identifiers beginning with _ cause warnings</code></code><br>
- <code><code>ident = (%x41-5a / %x61-7a / "_") *(%x41-5a / %x61-7a / %x30-39 / "_")<br>
- parens = "(" 1*(any char except ")") ")"</code></code></p>
-
-<h3 id="Functionality_not_used_in_xpidl">Functionality not used in xpidl</h3>
-
-<p>The libIDL parser we use is more powerful than xpidl itself can understand. The following is a list of potential features which are parseable but may not result in expected code:</p>
-
-<ul>
- <li>Struct, union, and enumerated types</li>
- <li>Array declarators (appears to be supported in xpidl_header.c but not xpidl_typelib.c)</li>
- <li>Exception declarations</li>
- <li>Module declarations</li>
- <li>Variable arguments (that makes the ABNF get more wonky)</li>
- <li>Sequence types</li>
- <li>Max-length strings</li>
- <li>Fixed-point numbers</li>
- <li>"any" and "long double" types.</li>
-</ul>
-
-<h3 id="Pyxpidl_syntax">Pyxpidl syntax</h3>
-
-<p><code><code>idlfile = *(CDATA / INCLUDE / interface / typedef / native)<br>
- <br>
- typedef = "typedef" IDENTIFER IDENTIFIER ";"<br>
- native = [attributes] "native" IDENTIFIER "(" NATIVEID ")"<br>
- interface = [attributes] "interface" IDENTIFIER" [ifacebase] [ifacebody] ";"<br>
- ifacebase = ":" IDENTIFIER<br>
- ifacebody = "{" *(member) "}"<br>
- <br>
- member = CDATA / "const" IDENTIFIER IDENTIFIER "=" number ";"<br>
- member /= [attributes] ["readonly"] "attribute" IDENTIFIER IDENTIFER ";"<br>
- member /= [attributes] IDENTIFIER IDENTIFIER "(" paramlist ")" raises ";"<br>
- paramlist = [param *("," param)]<br>
- raises = ["raises" "(" IDENTIFIER *("," identifier) ")"]<br>
- attributes = "[" attribute *("," attribute) "]"<br>
- attribute = (IDENTIFIER / CONST) ["(" (IDENTIFIER / IID) ")"]<br>
- param = [attributes] ("in" / "out" / "inout") IDENTIFIER IDENTIFIER<br>
- <br>
- number = NUMBER / IDENTIFIER<br>
- number /= "(" number ")"<br>
- number /= "-" number<br>
- number /= number ("+" / "-" / "*") number<br>
- number /= number ("&lt;&lt;" / &gt;&gt;") number<br>
- number /= number "|" number<br>
- <br>
- ; Lexical tokens, I'm going to specify these in regex form<br>
- NUMBER = /-?\d+|0x[0-9A-Fa-f]+/<br>
- CDATA = /%\{[ ]*C\+\+[ ]*\n(.*?\n?)%\}[ ]*(C\+\+)?/s<br>
- INCLUDE = /\#include[ \t]+"[^"\n]+"/<br>
- NATIVEID = /[^()\n]+(?=\))/<br>
- IID = /[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}/<br>
- IDENTIFIER = /unsigned long long|unsigned short|unsigned long|long long|[A-Za-z][A-Za-z_0-9]*/</code></code></p>
diff --git a/files/zh-cn/mozilla/tech/xpidl/xpidl/index.html b/files/zh-cn/mozilla/tech/xpidl/xpidl/index.html
deleted file mode 100644
index 57838ceae4..0000000000
--- a/files/zh-cn/mozilla/tech/xpidl/xpidl/index.html
+++ /dev/null
@@ -1,58 +0,0 @@
----
-title: xpidl
-slug: Mozilla/Tech/XPIDL/xpidl
-tags:
- - 'Developing_Mozilla:Tools'
- - Tools
- - xpidl
- - 开发Mozilla
- - 所有分类
-translation_of: Mozilla/Tech/XPIDL/xpidl
----
-<p> </p>
-<p><b>xpidl</b> 是一个基于 <a href="cn/XPIDL">XPIDL</a> 接口描述文件, 用于生成 <a href="cn/XPCOM">XPCOM</a> 接口信息的工具. 它会自动生成:</p>
-<ul>
- <li>C++ 头文件 (&lt;tt&gt;.h&lt;/tt&gt;), 该头文件中包含了一个带注释的 C++ 接口的完整声明.</li>
- <li>Java 接口文件 (&lt;tt&gt;.java&lt;/tt&gt;)</li>
- <li><a href="cn/XPConnect">XPConnect</a> typelib 文件 (&lt;tt&gt;.xpt&lt;/tt&gt;), 这个文件中定义了通过 <a href="cn/XPConnect">XPConnect</a> 动态调用 XPCOM 对象的运行时刻类型信息.</li>
- <li>HTML 格式的文档 (&lt;tt&gt;.html&lt;/tt&gt;)</li>
-</ul>
-<h2 id=".E7.BC.96.E8.AF.91_xpidl" name=".E7.BC.96.E8.AF.91_xpidl">编译 xpidl</h2>
-<p>xpidl 的实现是基于 <a class="external" href="http://www.gnome.org/">Gnome</a> 工程中的 <a class="external" href="http://andrewtv.org/libIDL/">libIDL idl 编译器</a>. libIDL 编译器依赖的 glib 库也来自于 gnome 工程. xpidl 编译器现在是 Mozilla 整个编译过程中必须包含的一分子, 我们用它来生成 XPCOM 组件的头文件. 如何得到 libIDL 和 glib 请看 <a href="cn/Build_Documentation">Build Documentation</a>.</p>
-<p>Unix: 如果你<b>仅仅</b>想编译 xpidl 本身, 你只需要编译很少一部分目录. 在获取 mozilla 源码后, 执行 'configure', 然后以下面的命令就可以在 dist/bin 目录下编译出 xpidl:</p>
-<pre class="eval">make -C config
-make -C nsprpub
-make -C xpcom/typelib
-</pre>
-<h2 id=".E4.BD.BF.E7.94.A8_xpidl" name=".E4.BD.BF.E7.94.A8_xpidl">使用 xpidl</h2>
-<p><a class="external" href="http://www.mozilla.org/scriptable/xpidl/xpidl-in-the-build.html">xpidl build page</a> 有关于如何添加一个 XPIDL 文件到 Mozilla 的编译过程的说明. xpidl 也可以在 Unix 和 Windows 下以命令行的形式执行:</p>
-<pre class="eval">Usage: ./xpidl -m mode [-w] [-v] [-t version number]
- [-I path] [-o basename | -e filename.ext] filename.idl
- -a emit annotations to typelib
- -w turn on warnings (recommended)
- -v verbose mode (NYI)
- -t create a typelib of a specific version number
- -I add entry to start of include path for ``#include "nsIThing.idl"
- -o use basename (e.g. ``/tmp/nsIThing<i>) for output</i>
- -e use explicit output filename
- -m specify output mode:
- header Generate C++ header (.h)
- typelib Generate XPConnect typelib (.xpt)
- doc Generate HTML documentation (.html)
- java Generate Java interface (.java)
-</pre>
-<h2 id=".E8.B5.84.E6.BA.90" name=".E8.B5.84.E6.BA.90">资源</h2>
-<ul>
- <li>关于 xpidl 的<a class="external" href="http://bugzilla.mozilla.org/buglist.cgi?bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;component=xpidl">Open bugs</a>.</li>
-</ul>
-<p>Flames to <a class="link-mailto" href="mailto:mike+mozilla@meer.net,mang@subcarrier.org?Subject=xpidl">docs mike+mozilla@meer.net &amp; mang@subcarrier.org</a></p>
-<p> </p>
-<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:mike+mozilla@meer.net">mike+mozilla@meer.net</a>, <a class="link-mailto" href="mailto:mang@subcarrier.org">mang@subcarrier.org</a></li>
- <li>上一次更新日期:版权信息 五月 29, 2002</li>
- <li> : 版权所有(C) <a class="link-mailto" href="mailto:mike+mozilla@meer.net">mike+mozilla@meer.net</a>, <a class="link-mailto" href="mailto:mang@subcarrier.org">mang@subcarrier.org</a></li>
- </ul>
-</div>
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/acceltext/index.html b/files/zh-cn/mozilla/tech/xul/attribute/acceltext/index.html
deleted file mode 100644
index 77bc1dccbe..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/acceltext/index.html
+++ /dev/null
@@ -1,23 +0,0 @@
----
-title: acceltext
-slug: Mozilla/Tech/XUL/Attribute/acceltext
-tags:
- - XUL Attributes
-translation_of: Archive/Mozilla/XUL/Attribute/acceltext
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-acceltext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/acceltext">acceltext</a></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Text that appears beside beside the <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code> label to indicate the shortcut key (accelerator key) to use to invoke the command. If this value is set, it overrides an assigned key set in the key attribute. This attribute does not apply to menus directly on the menubar.</dd>
-</dl>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/accesskey/index.html b/files/zh-cn/mozilla/tech/xul/attribute/accesskey/index.html
deleted file mode 100644
index e6697bda0d..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/accesskey/index.html
+++ /dev/null
@@ -1,43 +0,0 @@
----
-title: accesskey
-slug: Mozilla/Tech/XUL/Attribute/accesskey
-tags:
- - XUL Attributes
-translation_of: Archive/Mozilla/XUL/Attribute/accesskey
----
-<div class="noinclude"><span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-
-<div class="noinclude">
-<dl>
- <dd>Attribute of: <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/button" title="button">button</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/checkbox" title="checkbox">checkbox</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/caption" title="caption">caption</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/description" title="description">description</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/label" title="label">label</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listitem" title="listitem">listitem</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/tab" title="tab">tab</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/radio" title="radio">radio</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbarbutton" title="toolbarbutton">toolbarbutton</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/textbox (Firefox autocomplete)" title="textbox (Firefox autocomplete)">textbox (Firefox autocomplete)</a></code></dd>
-</dl>
-</div>
-
-<dl>
- <dt><code id="a-accesskey"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/accesskey">accesskey</a></code></dt>
- <dd>类型:
- <i>character【字符】</i>
- </dd>
- <dd>本属性允许为控件(元素)设定一个字符作为快捷键,这个字符应该是 <code><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></code> 属性文本中的一个字符。该字符将会被加下划线以重点强调,平台和主体的变换并不影响这一表现行为。 当用户点击 ALT (在其他平台上具有类似功能的键) 和这个字符对应的按键时, 控件(元素)将立刻被从窗口中的某处激活或/并且获得焦点 <b>。虽说字符不分大小写,但是当label中存在大写字符和小写字符时,快捷键的字符将首先选择与之完全匹配的那一个,如果label中存在两个或更多的与accesskey字符相同的字符,其中的第一个字符将被加下划线。</b></dd>
- <dt>      *(有些键在监听按键事件时,分别对应event.ctrlKey和event.metaKey。)</dt>
-</dl>
-
-<p> </p>
-
-<h4 id="Example" name="Example">Example</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_accesskey_attr.png"></div>
-
-<pre>&lt;vbox&gt;
- &lt;label value="Enter Name" accesskey="e" control="myName"/&gt;
- &lt;textbox id="myName"/&gt;
- &lt;button label="Cancel" accesskey="n"/&gt;
- &lt;button label="Ok" accesskey="O"/&gt;
-&lt;/vbox&gt;
-</pre>
-
-<h4 id="See_also" name="See_also">See also</h4>
-
-<p><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code> attribute, <code id="a-acceltext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/acceltext">acceltext</a></code> attribute</p>
-
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/activetitlebarcolor/index.html b/files/zh-cn/mozilla/tech/xul/attribute/activetitlebarcolor/index.html
deleted file mode 100644
index 5352f49114..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/activetitlebarcolor/index.html
+++ /dev/null
@@ -1,19 +0,0 @@
----
-title: activetitlebarcolor
-slug: Mozilla/Tech/XUL/Attribute/activetitlebarcolor
-translation_of: Archive/Mozilla/XUL/Attribute/activetitlebarcolor
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-activetitlebarcolor"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/activetitlebarcolor">activetitlebarcolor</a></code> </dt>
- <dd>
- Type: <em>color string</em></dd>
- <dd>
- Specify background color of the window's titlebar when it is active (foreground). Moreover this hides separator between titlebar and window contents. <em>This only affects Mac OS X.</em></dd>
-</dl>
-<div class="noinclude">
- <p></p>
-</div>
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/align/index.html b/files/zh-cn/mozilla/tech/xul/attribute/align/index.html
deleted file mode 100644
index f940cbdbb3..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/align/index.html
+++ /dev/null
@@ -1,54 +0,0 @@
----
-title: align
-slug: Mozilla/Tech/XUL/Attribute/align
-tags:
- - Reference
- - XUL
-translation_of: Archive/Mozilla/XUL/Attribute/align
----
-<div class="noinclude"><span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-
-<dl>
- <dt><code id="a-align"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/align">align</a></code></dt>
- <dd>Type: <em>one of the values below</em></dd>
- <dd>The align attribute specifies how child elements of the box are aligned, when the size of the box is larger than the total size of the children.<br>
- 当box的尺寸大于全部子元素的尺寸时,align属性指定box元素的对齐方式。
- <ul>
- <li>For boxes that have horizontal orientation, it specifies how its children will be aligned vertically.</li>
- <li>当box设置水平排列,它指定子元素如何垂直对齐。</li>
- <li>For boxes that have vertical orientation, it specifies how its children will be aligned horizontally.</li>
- <li>当box设置垂直排列,它指定子元素如何水平对齐</li>
- </ul>
- </dd>
- <dd>
- <dl>
- <dt><code>start</code></dt>
- <dd>Child elements are aligned starting from the left or top edge of the box. If the box is larger than the total size of the children, the extra space is placed on the right or bottom side.<br>
- 子元素从box的左边或顶部开始排列。如果box大于全部子元素的总和,多出的空间在右边或底部。</dd>
- <dt><code>center</code></dt>
- <dd>Extra space is split equally along each side of the child elements, resulting in the children being placed in the center of the box.<br>
- 多出的空间在子元素的周围,使子元素放置在box的中间。</dd>
- <dt><code>end</code></dt>
- <dd>Child elements are placed on the right or bottom edge of the box. If the box is larger than the total size of the children, the extra space is placed on the left or top side.<br>
- 子元素从box的右边或底部开始排列。如果box大于全部子元素的总和,多出的空间在左边或顶部部。</dd>
- <dt><code>baseline</code></dt>
- <dd>This value applies to horizontally oriented boxes only. It causes the child elements to be aligned so that their text labels are lined up.<br>
- 这个值只适用于水平方向的box元素。它让子元素的文本标签成一条直线。</dd>
- <dt><code>stretch</code></dt>
- <dd><em>This is the default value.</em> The child elements are stretched to fit the size of the box. For a horizontal box, the children are stretched to be the height of the box. For a vertical box, the children are stretched to be the width of the box. If the size of the box changes, the children stretch to fit. Use the flex attribute to create elements that stretch in the opposite direction.<br>
- 这是默认值。拉伸子元素来填充box。在水平的box元素中,子元素在高度上被拉伸。在垂直的box元素中,子元素在宽度上被拉伸。如果box元素尺寸改变,子元素也随之改变。使用flex属性创建的元素在相反方向被拉伸。</dd>
- <dt><code>left</code> <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span></dt>
- <dd>The elements are aligned on their left edges.<br>
- 元素左边缘对齐。</dd>
- <dt><code>center</code> <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span></dt>
- <dd>The elements are centered horizontally.<br>
- 元素水平居中。</dd>
- <dt><code>right</code> <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span></dt>
- <dd>The elements are aligned on their right edges.<br>
- 元素右边缘对齐。</dd>
- </dl>
- </dd>
- <dd>The <a href="/en-US/docs/XUL/Attribute/pack" title="XUL/Attribute/pack">pack</a> attribute is related to the alignment but is used to specify the position in the opposite direction. You can also specify the value of align using the style property <a href="/zh-CN/docs/Web/CSS/-moz-box-align" title="此页面仍未被本地化, 期待您的翻译!"><code>-moz-box-align</code></a>.<br>
- <a href="/en-US/docs/XUL/Attribute/pack" title="XUL/Attribute/pack">pack</a>也是有关对齐的属性,但是指定相反方向的位置。你也可以在style中使用对齐的方式<a href="/zh-CN/docs/Web/CSS/-moz-box-align" title="此页面仍未被本地化, 期待您的翻译!"><code>-moz-box-align</code></a>。</dd>
- <dt></dt>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/allowevents/index.html b/files/zh-cn/mozilla/tech/xul/attribute/allowevents/index.html
deleted file mode 100644
index 5d17570f74..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/allowevents/index.html
+++ /dev/null
@@ -1,30 +0,0 @@
----
-title: allowevents
-slug: Mozilla/Tech/XUL/Attribute/allowevents
-tags:
- - XUL Attributes
- - XUL Reference
-translation_of: Archive/Mozilla/XUL/Attribute/allowevents
----
-<div class="noinclude"><span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-
-<dl>
- <dt><code id="a-allowevents"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/allowevents">allowevents</a></code></dt>
- <dd>Type:
- <i>boolean<br>
- </i>
- 类型:boolean</dd>
- <dd>If true, events are passed to children of the element. Otherwise, events are passed to the element only.<br>
- 如果为真,事件向子元素传递。否则,事件只传递到当前元素。</dd>
-</dl>
-
-<div class="noinclude">
-<p>On <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listitem" title="listitem">listitem</a></code> and <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/titlebar" title="titlebar">titlebar</a></code> elements, mouse events normally do not get sent to their children; instead they are retargeted to the <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listitem" title="listitem">listitem</a></code> and <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/titlebar" title="titlebar">titlebar</a></code> element itself. This means that elements placed inside a listitem do not respond to events, and instead clicking the mouse simply selects that item within the list. By setting the allowevents attribute to <code>true</code>, this special behavior is disabled, and the events are targeted the same as other elements.<br>
- 在 <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listitem" title="listitem">listitem</a></code> 和 <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/titlebar" title="titlebar">titlebar</a></code> 元素中,鼠标事件通常不发送给子元素;相反它们重定向到 <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listitem" title="listitem">listitem</a></code> 和 <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/titlebar" title="titlebar">titlebar</a></code> 元素本身。这意味着,放置在listitem内部的元素并不响应事件,而点击鼠标仅仅是选择在列表中的元素。当设置allowevents属性为真时,这种特殊的响应被禁止,事件则被定向到其他相同的元素。</p>
-
-<p>For <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuseparator" title="menuseparator">menuseparator</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code> and <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/treecol" title="treecol">treecol</a></code> elements, as well as menu buttons, and the popup <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/datepicker" title="datepicker">datepicker</a></code>, mouse events are also retargeted to the element itself. However, the allowevents attribute is handled in a different way. Instead, the allowevents may be set to <code>true</code> on a descendant instead. This does the same thing in that it allows events to be targeted normally, but allows this to be different for each descendant.</p>
-
-<p>This behavior is used for menus, for instance, to allow a menu button to behave as a menu when clicking on it, yet have part of the menu behave as a button. For the latter, the allowevents attribute is set to <code>true</code> to have a click on the child button receive events instead of targeting all events at the menu.</p>
-</div>
-
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/allownegativeassertions/index.html b/files/zh-cn/mozilla/tech/xul/attribute/allownegativeassertions/index.html
deleted file mode 100644
index 51c8c4e222..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/allownegativeassertions/index.html
+++ /dev/null
@@ -1,18 +0,0 @@
----
-title: allownegativeassertions
-slug: Mozilla/Tech/XUL/Attribute/allownegativeassertions
-translation_of: Archive/Mozilla/XUL/Attribute/allownegativeassertions
----
-<div class="noinclude"><span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-
-<dl>
- <dt><code id="a-allownegativeassertions"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/allownegativeassertions">allownegativeassertions</a></code></dt>
- <dd>Type: <em>boolean</em><br>
- 类型:布尔类型</dd>
- <dd>Valid on any element that has a <code id="a-datasources"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/datasources">datasources</a></code> attribute. When multiple datasources are used, one may override an assertion from another. This attribute, if <code>true</code>, which is the default, allows a datasource to negate an earlier assertion.<br>
- 适用于任何有 <code id="a-datasources"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/datasources">datasources</a></code> 属性的元素。当使用多个数据源,一个数据源可以指定覆盖另一个。这个属性,如果为真,这是默认值,允许一个数据源覆盖之前的数据源。</dd>
-</dl>
-
-<div class="noinclude">
-<p></p>
-</div>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/autocheck/index.html b/files/zh-cn/mozilla/tech/xul/attribute/autocheck/index.html
deleted file mode 100644
index edd3c5e9ed..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/autocheck/index.html
+++ /dev/null
@@ -1,24 +0,0 @@
----
-title: autocheck
-slug: Mozilla/Tech/XUL/Attribute/autocheck
-tags:
- - XUL Attributes
-translation_of: Archive/Mozilla/XUL/Attribute/autoCheck
----
-<div class="noinclude"><span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-
-<dl>
- <dt><code id="a-autocheck"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/autocheck">autocheck</a></code></dt>
- <dd>类型:
- <i>boolean</i>
- </dd>
- <dd>如果此属性为 <code>true</code>,或空白, 每次点击按钮时,此按钮的状态检查都会被执行一次。如果此属性为<code>false</code>, 检查会手动的被拒绝。当autocheck值为true的时候,按钮将会变为多选框或者单选框。</dd>
-</dl>
-
-<div class="noinclude">
-<h3 id="See_also" name="See_also">See also</h3>
-
-<p><code><a href="cn/XUL/Attribute/autoCheck">autoCheck</a></code></p>
-</div>
-
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/autoscroll/index.html b/files/zh-cn/mozilla/tech/xul/attribute/autoscroll/index.html
deleted file mode 100644
index 9bc1366f88..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/autoscroll/index.html
+++ /dev/null
@@ -1,12 +0,0 @@
----
-title: autoscroll
-slug: Mozilla/Tech/XUL/Attribute/autoscroll
-translation_of: Archive/Mozilla/XUL/Attribute/autoscroll
----
-<div class="noinclude"><span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/en-US/docs/XUL/XUL_Reference">XUL Reference home</a></span></div>
-
-<dl>
- <dt><code id="a-autoscroll"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/autoscroll">autoscroll</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>Set to <code>false</code> to disable autoscroll for this browser. If this attribute is set to <code>true</code> or omitted, autoscroll will be enabled or depending on the user preference <code>general.autoScroll</code>.</dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/buttonaccesskeyaccept/index.html b/files/zh-cn/mozilla/tech/xul/attribute/buttonaccesskeyaccept/index.html
deleted file mode 100644
index 4e42f14bad..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/buttonaccesskeyaccept/index.html
+++ /dev/null
@@ -1,20 +0,0 @@
----
-title: buttonaccesskeyaccept
-slug: Mozilla/Tech/XUL/Attribute/buttonaccesskeyaccept
-translation_of: Archive/Mozilla/XUL/Attribute/buttonaccesskeyaccept
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-buttonaccesskeyaccept"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/buttonaccesskeyaccept">buttonaccesskeyaccept</a></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- The access key to use for the "accept" button.</dd>
-</dl>
-<p> </p>
-<div class="noinclude">
- <p></p>
-</div>
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/buttonlabelextra1/index.html b/files/zh-cn/mozilla/tech/xul/attribute/buttonlabelextra1/index.html
deleted file mode 100644
index 1de5913a9b..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/buttonlabelextra1/index.html
+++ /dev/null
@@ -1,19 +0,0 @@
----
-title: buttonlabelextra1
-slug: Mozilla/Tech/XUL/Attribute/buttonlabelextra1
-translation_of: Archive/Mozilla/XUL/Attribute/buttonlabelextra1
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-buttonlabelextra1"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/buttonlabelextra1">buttonlabelextra1</a></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- The label to appear on the first extra button.</dd>
-</dl>
-<div class="noinclude">
- <p></p>
-</div>
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/buttonlabelextra2/index.html b/files/zh-cn/mozilla/tech/xul/attribute/buttonlabelextra2/index.html
deleted file mode 100644
index 1a7f700eac..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/buttonlabelextra2/index.html
+++ /dev/null
@@ -1,19 +0,0 @@
----
-title: buttonlabelextra2
-slug: Mozilla/Tech/XUL/Attribute/buttonlabelextra2
-translation_of: Archive/Mozilla/XUL/Attribute/buttonlabelextra2
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-buttonlabelextra2"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/buttonlabelextra2">buttonlabelextra2</a></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- The label to appear on the second extra button.</dd>
-</dl>
-<div class="noinclude">
- <p></p>
-</div>
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/buttons/index.html b/files/zh-cn/mozilla/tech/xul/attribute/buttons/index.html
deleted file mode 100644
index 5759eabd90..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/buttons/index.html
+++ /dev/null
@@ -1,28 +0,0 @@
----
-title: buttons
-slug: Mozilla/Tech/XUL/Attribute/buttons
-translation_of: Archive/Mozilla/XUL/Attribute/buttons
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span></div>
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/buttons">buttons</a></span></code></dt>
- <dd>
- 类型: 列表,下面的值用逗号分隔</dd>
- <dd>
- 需要显示在对话框上的按钮的一个列表,使用逗号分隔。将按钮放置在合适的位置,将根据用户平台自动执行基本的事件处理。在列表中可以使用以下值:
- <ul>
- <li><code>accept</code>:“确定”按钮,按下按钮时将接受更改。此按钮为默认按钮。</li>
- <li><code>cancel</code>:“取消”按钮,将取消操作。</li>
- <li><code>help</code>:“帮助”按钮,在对话框显示一个“帮助”按钮。</li>
- <li><code>disclosure</code>:“更多信息”按钮,显示一个“more info”按钮。该按钮可能是一个按钮或一个三角形。</li>
- <li><code>extra1</code>:一个可选的额外的按钮。你可以通过<code><code id="a-buttonlabelextra1"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/buttonlabelextra1">buttonlabelextra1</a></code></code> 属性设置它的label。</li>
- <li><code>extra2</code>:第二个可选的额外的按钮。你可以通过 <code><code id="a-buttonlabelextra2"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/buttonlabelextra2">buttonlabelextra2</a></code></code> 属性设置它的label。</li>
- </ul>
- </dd>
-</dl>
-<div class="noinclude">
- <p></p>
-</div>
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/checked/index.html b/files/zh-cn/mozilla/tech/xul/attribute/checked/index.html
deleted file mode 100644
index 249a1f1ee1..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/checked/index.html
+++ /dev/null
@@ -1,24 +0,0 @@
----
-title: checked
-slug: Mozilla/Tech/XUL/Attribute/checked
-tags:
- - XUL Attributes
-translation_of: Archive/Mozilla/XUL/Attribute/checked
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-checked"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/checked">checked</a></code></dt>
- <dd>
- Type:
- <i>
- boolean</i>
- </dd>
- <dd>
- Indicates whether the element is checked or not.</dd>
- <dd>
- Use <code>hasAttribute()</code> to determine whether this attribute is set instead of <code>getAttribute()</code>.</dd>
- <dd>
- For buttons, the <code>type</code> attribute must be set to <code>checkbox</code> or <code>radio</code> for this attribute to have any effect.&lt;magic name="\"PAGENAME\"/"&gt;&lt;/magic&gt;</dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/class/index.html b/files/zh-cn/mozilla/tech/xul/attribute/class/index.html
deleted file mode 100644
index 45eb8dbc87..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/class/index.html
+++ /dev/null
@@ -1,23 +0,0 @@
----
-title: class
-slug: Mozilla/Tech/XUL/Attribute/class
-tags:
- - XUL Attributes
- - XUL Reference
-translation_of: Archive/Mozilla/XUL/Attribute/class
----
-<div class="noinclude"><span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-
-<dl>
- <dt><code id="a-class"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/class">class</a></code></dt>
- <dd>Type:
- <i>string<br>
- </i>
- 类型:字符串(string)</dd>
- <dd>The style class of the element. Multiple classes may be specified by separating them with spaces.<br>
- 元素样式类型。多个类可以使用空格分开。</dd>
-</dl>
-
-<div class="noinclude"> </div>
-
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/coalesceduplicatearcs/index.html b/files/zh-cn/mozilla/tech/xul/attribute/coalesceduplicatearcs/index.html
deleted file mode 100644
index 01e6ddd51f..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/coalesceduplicatearcs/index.html
+++ /dev/null
@@ -1,17 +0,0 @@
----
-title: coalesceduplicatearcs
-slug: Mozilla/Tech/XUL/Attribute/coalesceduplicatearcs
-tags:
- - XUL Attributes
- - XUL Reference
-translation_of: Archive/Mozilla/XUL/Attribute/coalesceduplicatearcs
----
-<div class="noinclude"><span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-
-<dl>
- <dt><code id="a-coalesceduplicatearcs"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/coalesceduplicatearcs">coalesceduplicatearcs</a></code></dt>
- <dd>Type: <em>boolean</em><br>
- 类型:布尔类型(boolean)</dd>
- <dd>Valid on any element that has a <code id="a-datasources"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/datasources">datasources</a></code> attribute. When multiple datasources are used, one may override an assertion from another. This attribute, if <code>true</code>, which is the default, allows a datasource to negate an earlier assertion.<br>
- 任何有 <code id="a-datasources"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/datasources">datasources</a></code> 属性的元素有效。当有多个数据源时使用,可以覆盖另一个声明。这个属性,如果是真,这是默认属性,允许一个数据源取消更早的声明。 </dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/collapsed/index.html b/files/zh-cn/mozilla/tech/xul/attribute/collapsed/index.html
deleted file mode 100644
index 50d54b771f..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/collapsed/index.html
+++ /dev/null
@@ -1,27 +0,0 @@
----
-title: collapsed
-slug: Mozilla/Tech/XUL/Attribute/collapsed
-translation_of: Archive/Mozilla/XUL/Attribute/collapsed
----
-<div class="noinclude"><span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-
-<dl>
- <dt><code id="a-collapsed"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/collapsed">collapsed</a></code></dt>
- <dd>Type: <em>boolean</em><br>
- 类型:布尔类型(boolean)</dd>
- <dd>If <code>true</code>, then the element is collapsed and does not appear. It is equivalent to setting the CSS <a href="/en-US/docs/CSS/visibility" title="/en-US/docs/CSS/visibility">visibility</a> property to <code>collapse</code>.<br>
- 如果是真,那么这个元素可以折叠并且隐藏。相当于设置CSS的 <a href="/en-US/docs/CSS/visibility" title="/en-US/docs/CSS/visibility">visibility</a> 属性为 collapse。</dd>
-</dl>
-
-<div class="noinclude">
-<h2 id="See_also_相关参考">See also<br>
- 相关参考</h2>
-
-<ul>
- <li><code id="a-hidden"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/hidden">hidden</a></code></li>
-</ul>
-
-<p></p>
-</div>
-
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/command/index.html b/files/zh-cn/mozilla/tech/xul/attribute/command/index.html
deleted file mode 100644
index 75c4957f0e..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/command/index.html
+++ /dev/null
@@ -1,30 +0,0 @@
----
-title: command
-slug: Mozilla/Tech/XUL/Attribute/command
-tags:
- - XUL Attributes
-translation_of: Archive/Mozilla/XUL/Attribute/command
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-command"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/command">command</a></code></dt>
- <dd>
- Type:
- <i>
- element id</i>
- </dd>
- <dd>
- Set to the <code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code> of a <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/command" title="command">command</a></code> element that is being observed by the element.</dd>
-</dl>
-<div class="noinclude">
- <h3 id="Example" name="Example">Example</h3>
- <pre>&lt;command id="cmd_openhelp" oncommand="alert('Help');"/&gt;
-&lt;button label="Help" command="cmd_openhelp"/&gt;
-&lt;button label="More Help" command="cmd_openhelp"/&gt;
-</pre>
- <h3 id="See_also" name="See_also">See also</h3>
- <p><code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/command" title="command">command</a></code></code> element, <code><code id="a-oncommand"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/oncommand">oncommand</a></code></code> and <code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/commandset" title="commandset">commandset</a></code></code></p>
-</div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/container/index.html b/files/zh-cn/mozilla/tech/xul/attribute/container/index.html
deleted file mode 100644
index 4b1429ae43..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/container/index.html
+++ /dev/null
@@ -1,18 +0,0 @@
----
-title: container
-slug: Mozilla/Tech/XUL/Attribute/container
-translation_of: Archive/Mozilla/XUL/Attribute/container
----
-<div class="noinclude"><span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-
-<dl>
- <dt><code id="a-container"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/container">container</a></code></dt>
- <dd>Type: <em>boolean</em><br>
- 类型:布尔类型(boolean)</dd>
- <dd>Set to true if the element is to act as a container which can have child elements. This would be used for folders. This will be set by the template builder as needed.<br>
- 如果该元素是作为一个容器可以有子元素,设置为真。</dd>
-</dl>
-
-<div class="noinclude">
-<p></p>
-</div>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/control/index.html b/files/zh-cn/mozilla/tech/xul/attribute/control/index.html
deleted file mode 100644
index 74a0edec5a..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/control/index.html
+++ /dev/null
@@ -1,23 +0,0 @@
----
-title: control
-slug: Mozilla/Tech/XUL/Attribute/control
-tags:
- - XUL Attributes
- - XUL Reference
-translation_of: Archive/Mozilla/XUL/Attribute/control
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-control"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/control">control</a></code></dt>
- <dd>
- Type: <em>element id</em></dd>
- <dd>
- This attribute specifies the <code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code> of the element with which the label is associated. When the user clicks on the label, the associated element is given focus.<br>
- 这个属性定义了元素的<code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code>,它与<code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code>相关联。当用户点击 <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code> 的时候,相关联的元素将获得焦点。</dd>
-</dl>
-<div class="noinclude">
- <p></p>
-</div>
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/crop/index.html b/files/zh-cn/mozilla/tech/xul/attribute/crop/index.html
deleted file mode 100644
index 1ab3f59210..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/crop/index.html
+++ /dev/null
@@ -1,37 +0,0 @@
----
-title: crop
-slug: Mozilla/Tech/XUL/Attribute/crop
-tags:
- - XUL Attributes
-translation_of: Archive/Mozilla/XUL/Attribute/crop
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-crop"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/crop">crop</a></code></dt>
- <dd>
- Type:
- <i>
- one of the values below</i>
- </dd>
- <dd>
- If the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the <code>crop</code> attribute. An ellipsis will be used in place of the cropped text. If the box direction is reversed, the cropping is reversed.</dd>
-</dl>
-<ul>
- <li><code>start</code>: The text will be cropped on its left side.</li>
- <li><code>end</code>: The text will be cropped on its right side.</li>
- <li><code>left</code>: <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> The text will be cropped on its left side.</li>
- <li><code>right</code>: <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> The text will be cropped on its right side.</li>
- <li><code>center</code>: The text will be cropped in the middle, showing both the start and end of the text normally.</li>
- <li><code>none</code>: The text will be not be cropped using an ellipsis. However, the text will simply be cut off if it is too large. The side depends on the CSS text alignment.</li>
-</ul>
-<div class="noinclude">
- <dl>
- <dd>
- Depending on the platform and theme being used, some elements will have a set maximum width so they will be always appear cropped. If you wish to use the value <code>none</code> and the displayed text is larger than this maximum width, you may be able to use the max-width CSS property (or the maxwidth attribute) to override this size. For example, for a menuitem in a menu you can add the following CSS rule when you want to use the value <code>none</code>:</dd>
- </dl>
- <pre class="eval">menupopup &gt; menuitem, menupopup &gt; menu { max-width: none; }
-</pre>
-</div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/description/index.html b/files/zh-cn/mozilla/tech/xul/attribute/description/index.html
deleted file mode 100644
index 008aa1281c..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/description/index.html
+++ /dev/null
@@ -1,23 +0,0 @@
----
-title: description
-slug: Mozilla/Tech/XUL/Attribute/description
-tags:
- - XUL Attributes
-translation_of: Archive/Mozilla/XUL/Attribute/description
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-description"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/description">description</a></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Descriptive text to appear in addition to the dialog title.</dd>
-</dl>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/dir/index.html b/files/zh-cn/mozilla/tech/xul/attribute/dir/index.html
deleted file mode 100644
index 0b4c5c36a4..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/dir/index.html
+++ /dev/null
@@ -1,39 +0,0 @@
----
-title: dir
-slug: Mozilla/Tech/XUL/Attribute/dir
-tags:
- - XUL Attributes
-translation_of: Archive/Mozilla/XUL/Attribute/dir
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-dir"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/dir">dir</a></code></dt>
- <dd>
- Type:
- <i>
- one of the values below</i>
- </dd>
- <dd>
- The direction in which the child elements of the element are placed.</dd>
-</dl>
-<dl>
- <dt>
- <code>normal</code></dt>
- <dd>
- For scales, the scale's values are ordered from left to right (for horizontal scales) or from top to bottom (for vertical scales)  For other elements, the elements are placed left to right or top to bottom in the order they appear in the XUL code</dd>
- <dt>
- <code>reverse</code></dt>
- <dd>
- For scales, the scale's values are ordered from right to left (for horizontal scales) or from bottom to top (for vertical scales). For other elements, they are placed right to left or bottom to top. This is reverse of the order in which they appear in the XUL code.</dd>
-</dl>
-<ul>
-</ul>
-<div class="noinclude">
- <h3 id="See_also" name="See_also">See also</h3>
- <ul>
- <li><a href="cn/XUL/Attribute/resizer.dir">resizer.dir</a></li>
- </ul>
-</div>
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/disabled/index.html b/files/zh-cn/mozilla/tech/xul/attribute/disabled/index.html
deleted file mode 100644
index 057bca261d..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/disabled/index.html
+++ /dev/null
@@ -1,38 +0,0 @@
----
-title: disabled
-slug: Mozilla/Tech/XUL/Attribute/disabled
-tags:
- - XUL Attributes
-translation_of: Archive/Mozilla/XUL/Attribute/disabled
----
-<div class="noinclude"><span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-
-<dl>
- <dt><code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code></dt>
- <dd> </dd>
- <dd>
- <h5 id="类型boolean">类型:<em>boolean</em></h5>
- </dd>
- <dd>
- <h5 id="表示元素是被禁用的。">表示元素是被禁用的。</h5>
-
- <p>如果这个元素的disabled属性被设置为true,表示元素被禁用,被禁用的属性在页面上通常会显示灰色文本,它无法响应用户的操作,它也无法得到光标。</p>
-
- <p>然而,这个元素仍然能够响应鼠标事件,如果要启用这个元素,把disabled设置为false</p>
- </dd>
-</dl>
-
-<h4 id="示例:">示例:</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_attr_disabled.png" src="https://mdn.mozillademos.org/files/1742/XUL_ref_attr_disabled.png"></div>
-
-<pre><code>// Disabling an element
-document.getElementById('buttonRemove').setAttribute("disabled", "true");
-
-// Enabling back an element by removing the "disabled" attribute
-document.getElementById('buttonRemove').removeAttribute("disabled");</code></pre>
-
-<p></p><div class="blockIndicator standardNote">
- <p><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Firefox/Releases/3.5">Firefox 3.5 note</a></p>
- <p style="font-weight: 400;">For <a href="https://developer.mozilla.org/en-US/docs/XUL/keyset" title="en/XUL/Keyset"><code>keyset</code></a> elements, support for this attribute was added in Firefox 3.5.</p>
-</div><p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/flex/index.html b/files/zh-cn/mozilla/tech/xul/attribute/flex/index.html
deleted file mode 100644
index 7d9954d30a..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/flex/index.html
+++ /dev/null
@@ -1,23 +0,0 @@
----
-title: flex
-slug: Mozilla/Tech/XUL/Attribute/flex
-tags:
- - XUL Attributes
- - XUL Reference
-translation_of: Archive/Mozilla/XUL/Attribute/flex
----
-<div class="noinclude"><span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-
-<dl>
- <dt><code id="a-flex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/flex">flex</a></code></dt>
- <dd>Type: <em>string</em> (representing an integer)<br>
- 类型:字符串 (string) 表示一个整数</dd>
- <dd>Indicates the flexibility of the element, which indicates how an element's container distributes remaining empty space among its children. Flexible elements grow and shrink to fit their given space. Elements with larger flex values will be made larger than elements with lower flex values, at the ratio determined by the two elements. The actual value is not relevant unless there are other flexible elements within the same container. Once the default sizes of elements in a box are calculated, the remaining space in the box is divided among the flexible elements, according to their flex ratios. Specifying a flex value of 0 has the same effect as leaving the flex attribute out entirely.<br>
- 指示一个元素的伸缩性,</dd>
-</dl>
-
-<div class="noinclude">
-<p></p>
-</div>
-
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/href/index.html b/files/zh-cn/mozilla/tech/xul/attribute/href/index.html
deleted file mode 100644
index 50013e44b3..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/href/index.html
+++ /dev/null
@@ -1,24 +0,0 @@
----
-title: href
-slug: Mozilla/Tech/XUL/Attribute/href
-tags:
- - XUL 参考
- - XUL 属性
-translation_of: Archive/Mozilla/XUL/Attribute/href
----
-<div class="noinclude"><span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-
-<dl>
- <dt><code id="a-href"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/href">href</a></code></dt>
- <dd>类型: <em>文本</em></dd>
- <dd>定义一个当元素被点击时将会打开的 URL 。需要引用类 <a href="/en/XUL/Style/text-link" title="en/XUL/Style/text-link">text-link </a>。</dd>
-</dl>
-
-<div class="noinclude">
-<pre class="eval">&lt;label href="<span class="nowiki">http://example.com</span>" class="text-link" value="点击这里前往 example.com"/&gt;
-</pre>
-</div>
-
-<div class="noinclude">
-<p></p>
-</div>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/id/index.html b/files/zh-cn/mozilla/tech/xul/attribute/id/index.html
deleted file mode 100644
index 50e8e7b188..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/id/index.html
+++ /dev/null
@@ -1,41 +0,0 @@
----
-title: id
-slug: Mozilla/Tech/XUL/Attribute/id
-tags:
- - XUL Attributes
-translation_of: Archive/Mozilla/XUL/Attribute/id
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code></dt>
- <dd>
- 类型: <em>元素的ID,在主窗口中必须唯一</em></dd>
- <dd>
- 一个唯一的标识一边开发者能够定义. 你可以使用方法 <code><a href="/cn/DOM/document.getElementById" title="cn/DOM/document.getElementById">getElementById()</a></code> 或者其他 DOM 的函数并在样式表中添加对元素的引用。</dd>
-</dl>
-<div class="noinclude">
- <h4 id="Example" name="Example">示例</h4>
- <pre>&lt;button id="foo" label="Click Me" oncommand="doSomething()"/&gt;
-
-&lt;script&gt;
-function doSomething(){
- var myButton = document.getElementById('foo');
- myButton.setAttribute('label','The button was pressed');
-}
-&lt;/script&gt;
-</pre>
- <p>一个更加抽象的版本</p>
- <pre>&lt;button id="foo" label="Click Me" oncommand="setWidgetLabel(this, 'I was pressed')"/&gt;
-&lt;script&gt;
-function setWidgetLabel(idName, newCaption){
- document.getElementById( idName.id ).setAttribute('label',newCaption)
-}
-
-&lt;/script&gt;
-</pre>
- <h4 id="See_also" name="See_also">同样,这里还有一些资料</h4>
- <p><code id="a-name"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/name">name</a></code></p>
-</div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/image.onload/index.html b/files/zh-cn/mozilla/tech/xul/attribute/image.onload/index.html
deleted file mode 100644
index 846d404d89..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/image.onload/index.html
+++ /dev/null
@@ -1,12 +0,0 @@
----
-title: image.onload
-slug: Mozilla/Tech/XUL/Attribute/image.onload
-translation_of: Archive/Mozilla/XUL/Attribute/image.onload
----
-<div class="noinclude"><span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/en-US/docs/XUL/XUL_Reference">XUL Reference home</a></span></div>
-
-<dl>
- <dt><code id="a-image.onload"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/image.onload">image.onload</a></code></dt>
- <dd>类型: <em>脚本代码</em></dd>
- <dd>该事件的处理函数将会在 <code><a href="/en-US/docs/Mozilla/Tech/XUL/image" title="image">image</a></code> 元素指示的图片加载完毕之后触发。此事件触发适用于用 <code id="a-src"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/src">src</a></code> 元素属性或用 <code>list-style-image</code> css属性声明元素样式。如果图片的加载源发生变化,该事件会在图片加载完毕之后再次触发。该事件不会在文档树上向上冒泡。</dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/image/index.html b/files/zh-cn/mozilla/tech/xul/attribute/image/index.html
deleted file mode 100644
index dd82594964..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/image/index.html
+++ /dev/null
@@ -1,25 +0,0 @@
----
-title: image
-slug: Mozilla/Tech/XUL/Attribute/image
-tags:
- - XUL Attributes
-translation_of: Archive/Mozilla/XUL/Attribute/image
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-image"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/image">image</a></code></dt>
- <dd>
- Type:
- <i>
- image URL</i>
- </dd>
- <dd>
- The URL of the image to appear on the element. If this attribute is empty or left out, no image appears. The position of the image is determined by the <code id="a-dir"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/dir">dir</a></code> and <code id="a-orient"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/orient">orient</a></code> attributes.</dd>
-</dl>
-<div class="noinclude">
- <h4 id="See_also" name="See_also">See also</h4>
- <p><code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/image" title="image">image</a></code></code> element</p>
-</div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/increment/index.html b/files/zh-cn/mozilla/tech/xul/attribute/increment/index.html
deleted file mode 100644
index 782156bb47..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/increment/index.html
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: increment
-slug: Mozilla/Tech/XUL/Attribute/increment
-translation_of: Archive/Mozilla/XUL/Attribute/increment
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-increment"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/increment">increment</a></code></dt>
- <dd>
- 类型:整数</dd>
- <dd>
- 拖动刻度条控件(<code>scale</code>元素)中的拉杆,点击滚动条控件(<code>scrollbar</code>元素)中的箭头(拖动拉杆也可以),点击数字输入框(<code>type</code>属性为<code>number</code>的<code>textbox</code>元素)中的箭头时,其<code id="a-curpos"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/curpos">curpos</a></code>属性或者value属性每次改变的数字值,默认值为1.</dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/index.html b/files/zh-cn/mozilla/tech/xul/attribute/index.html
deleted file mode 100644
index 097a3d6678..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/index.html
+++ /dev/null
@@ -1,304 +0,0 @@
----
-title: Attributes
-slug: Mozilla/Tech/XUL/Attribute
-tags:
- - XUL Attributes
-translation_of: Archive/Mozilla/XUL/Attribute
----
-<p><span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span>
-</p>
-<ul><li> <a href="cn/XUL/Attribute/acceltext">acceltext</a>
-</li><li> <a href="cn/XUL/Attribute/accessible">accessible</a>
-</li><li> <a href="cn/XUL/Attribute/accesskey">accesskey</a>
-</li><li> <a href="cn/XUL/Attribute/activetitlebarcolor">activetitlebarcolor</a>
-</li><li> <a href="cn/XUL/Attribute/afterselected">afterselected</a>
-</li><li> <a href="cn/XUL/Attribute/align">align</a>
-</li><li> <a href="cn/XUL/Attribute/allowevents">allowevents</a>
-</li><li> <a href="cn/XUL/Attribute/allownegativeassertions">allownegativeassertions</a>
-</li><li> <a href="cn/XUL/Attribute/alternatingbackground">alternatingbackground</a>
-</li><li> <a href="cn/XUL/Attribute/alwaysopenpopup">alwaysopenpopup</a>
-</li><li> <a href="cn/XUL/Attribute/attribute">attribute</a>
-</li><li> <a href="cn/XUL/Attribute/autocheck">autocheck</a>
-</li><li> <a href="cn/XUL/Attribute/autoCheck">autoCheck</a>
-</li><li> <a href="cn/XUL/Attribute/autocompleteenabled">autocompleteenabled</a>
-</li><li> <a href="cn/XUL/Attribute/autocompletepopup">autocompletepopup</a>
-</li><li> <a href="cn/XUL/Attribute/autocompletesearch">autocompletesearch</a>
-</li><li> <a href="cn/XUL/Attribute/autocompletesearchparam">autocompletesearchparam</a>
-</li><li> <a href="cn/XUL/Attribute/autoFill">autoFill</a>
-</li><li> <a href="cn/XUL/Attribute/autoFillAfterMatch">autoFillAfterMatch</a>
-</li><li> <a href="cn/XUL/Attribute/autoscroll">autoscroll</a>
-</li><li> <a href="cn/XUL/Attribute/beforeselected">beforeselected</a>
-</li><li> <a href="cn/XUL/Attribute/buttonaccesskeyaccept">buttonaccesskeyaccept</a>
-</li><li> <a href="cn/XUL/Attribute/buttonaccesskeycancel">buttonaccesskeycancel</a>
-</li><li> <a href="cn/XUL/Attribute/buttonaccesskeydisclosure">buttonaccesskeydisclosure</a>
-</li><li> <a href="cn/XUL/Attribute/buttonaccesskeyextra1">buttonaccesskeyextra1</a>
-</li><li> <a href="cn/XUL/Attribute/buttonaccesskeyextra2">buttonaccesskeyextra2</a>
-</li><li> <a href="cn/XUL/Attribute/buttonaccesskeyhelp">buttonaccesskeyhelp</a>
-</li><li> <a href="cn/XUL/Attribute/buttonalign">buttonalign</a>
-</li><li> <a href="cn/XUL/Attribute/buttondir">buttondir</a>
-</li><li> <a href="cn/XUL/Attribute/buttonlabelaccept">buttonlabelaccept</a>
-</li><li> <a href="cn/XUL/Attribute/buttonlabelcancel">buttonlabelcancel</a>
-</li><li> <a href="cn/XUL/Attribute/buttonlabeldisclosure">buttonlabeldisclosure</a>
-</li><li> <a href="cn/XUL/Attribute/buttonlabelextra1">buttonlabelextra1</a>
-</li><li> <a href="cn/XUL/Attribute/buttonlabelextra2">buttonlabelextra2</a>
-</li><li> <a href="cn/XUL/Attribute/buttonlabelhelp">buttonlabelhelp</a>
-</li><li> <a href="cn/XUL/Attribute/buttonorient">buttonorient</a>
-</li><li> <a href="cn/XUL/Attribute/buttonpack">buttonpack</a>
-</li><li> <a href="cn/XUL/Attribute/buttons">buttons</a>
-</li><li> <a href="cn/XUL/Attribute/checked">checked</a>
-</li><li> <a href="cn/XUL/Attribute/checkState">checkState</a>
-</li><li> <a href="cn/XUL/Attribute/class">class</a>
-</li><li> <a href="cn/XUL/Attribute/closebutton">closebutton</a>
-</li><li> <a href="cn/XUL/Attribute/coalesceduplicatearcs">coalesceduplicatearcs</a>
-</li><li> <a href="cn/XUL/Attribute/collapse">collapse</a>
-</li><li> <a href="cn/XUL/Attribute/collapsed">collapsed</a>
-</li><li> <a href="cn/XUL/Attribute/color">color</a>
-</li><li> <a href="cn/XUL/Attribute/cols">cols</a>
-</li><li> <a href="cn/XUL/Attribute/command">command</a>
-</li><li> <a href="cn/XUL/Attribute/commandupdater">commandupdater</a>
-</li><li> <a href="cn/XUL/Attribute/completedefaultindex">completedefaultindex</a>
-</li><li> <a href="cn/XUL/Attribute/container">container</a>
-</li><li> <a href="cn/XUL/Attribute/containment">containment</a>
-</li><li> <a href="cn/XUL/Attribute/contentcontextmenu">contentcontextmenu</a>
-</li><li> <a href="cn/XUL/Attribute/contenttooltip">contenttooltip</a>
-</li><li> <a href="cn/XUL/Attribute/context">context</a>
-</li><li> <a href="cn/XUL/Attribute/contextmenu">contextmenu</a>
-</li><li> <a href="cn/XUL/Attribute/control">control</a>
-</li><li> <a href="cn/XUL/Attribute/crop">crop</a>
-</li><li> <a href="cn/XUL/Attribute/curpos">curpos</a>
-</li><li> <a href="cn/XUL/Attribute/current">current</a>
-</li><li> <a href="cn/XUL/Attribute/currentset">currentset</a>
-</li><li> <a href="cn/XUL/Attribute/customindex">customindex</a>
-</li><li> <a href="cn/XUL/Attribute/customizable">customizable</a>
-</li><li> <a href="cn/XUL/Attribute/cycler">cycler</a>
-</li><li> <a href="cn/XUL/Attribute/datasources">datasources</a>
-</li><li> <a href="cn/XUL/Attribute/decimalplaces">decimalplaces</a>
-</li><li> <a href="cn/XUL/Attribute/default">default</a>
-</li><li> <a href="cn/XUL/Attribute/defaultButton">defaultButton</a>
-</li><li> <a href="cn/XUL/Attribute/defaultset">defaultset</a>
-</li><li> <a href="cn/XUL/Attribute/description">description</a>
-</li><li> <a href="cn/XUL/Attribute/dir">dir</a>
-</li><li> <a href="cn/XUL/Attribute/disableAutocomplete">disableAutocomplete</a>
-</li><li> <a href="cn/XUL/Attribute/disableautocomplete">disableautocomplete</a>
-</li><li> <a href="cn/XUL/Attribute/disableautoselect">disableautoselect</a>
-</li><li> <a href="cn/XUL/Attribute/disableclose">disableclose</a>
-</li><li> <a href="cn/XUL/Attribute/disabled">disabled</a>
-</li><li> <a href="cn/XUL/Attribute/disablehistory">disablehistory</a>
-</li><li> <a href="cn/XUL/Attribute/disableKeyNavigation">disableKeyNavigation</a>
-</li><li> <a href="cn/XUL/Attribute/disablekeynavigation">disablekeynavigation</a>
-</li><li> <a href="cn/XUL/Attribute/disablesecurity">disablesecurity</a>
-</li><li> <a href="cn/XUL/Attribute/dlgtype">dlgtype</a>
-</li><li> <a href="cn/XUL/Attribute/dragging">dragging</a>
-</li><li> <a href="cn/XUL/Attribute/editable">editable</a>
-</li><li> <a href="cn/XUL/Attribute/editortype">editortype</a>
-</li><li> <a href="cn/XUL/Attribute/element">element</a>
-</li><li> <a href="cn/XUL/Attribute/empty">empty</a>
-</li><li> <a href="cn/XUL/Attribute/emptytext">emptytext</a>
-</li><li> <a href="cn/XUL/Attribute/enableColumnDrag">enableColumnDrag</a>
-</li><li> <a href="cn/XUL/Attribute/enablehistory">enablehistory</a>
-</li><li> <a href="cn/XUL/Attribute/equalsize">equalsize</a>
-</li><li> <a href="cn/XUL/Attribute/eventnode">eventnode</a>
-</li><li> <a href="cn/XUL/Attribute/events">events</a>
-</li><li> <a href="cn/XUL/Attribute/expr">expr</a>
-</li><li> <a href="cn/XUL/Attribute/firstdayofweek">firstdayofweek</a>
-</li><li> <a href="cn/XUL/Attribute/firstpage">firstpage</a>
-</li><li> <a href="cn/XUL/Attribute/first-tab">first-tab</a>
-</li><li> <a href="cn/XUL/Attribute/fixed">fixed</a>
-</li><li> <a href="cn/XUL/Attribute/flags">flags</a>
-</li><li> <a href="cn/XUL/Attribute/flex">flex</a>
-</li><li> <a href="cn/XUL/Attribute/focused">focused</a>
-</li><li> <a href="cn/XUL/Attribute/forceComplete">forceComplete</a>
-</li><li> <a href="cn/XUL/Attribute/forcecomplete">forcecomplete</a>
-</li><li> <a href="cn/XUL/Attribute/grippyhidden">grippyhidden</a>
-</li><li> <a href="cn/XUL/Attribute/grippytooltiptext">grippytooltiptext</a>
-</li><li> <a href="cn/XUL/Attribute/group">group</a>
-</li><li> <a href="cn/XUL/Attribute/handleCtrlPageUpDown">handleCtrlPageUpDown</a>
-</li><li> <a href="cn/XUL/Attribute/handleCtrlTab">handleCtrlTab</a>
-</li><li> <a href="cn/XUL/Attribute/height">height</a>
-</li><li> <a href="cn/XUL/Attribute/helpURI">helpURI</a>
-</li><li> <a href="cn/XUL/Attribute/hidden">hidden</a>
-</li><li> <a href="cn/XUL/Attribute/hidechrome">hidechrome</a>
-</li><li> <a href="cn/XUL/Attribute/hidecolumnpicker">hidecolumnpicker</a>
-</li><li> <a href="cn/XUL/Attribute/hideheader">hideheader</a>
-</li><li> <a href="cn/XUL/Attribute/hideseconds">hideseconds</a>
-</li><li> <a href="cn/XUL/Attribute/hidespinbuttons">hidespinbuttons</a>
-</li><li> <a href="cn/XUL/Attribute/homepage">homepage</a>
-</li><li> <a href="cn/XUL/Attribute/href">href</a>
-</li><li> <a href="cn/XUL/Attribute/icon">icon</a>
-</li><li> <a href="cn/XUL/Attribute/id">id</a>
-</li><li> <a href="cn/XUL/Attribute/ignoreBlurWhileSearching">ignoreBlurWhileSearching</a>
-</li><li> <a href="cn/XUL/Attribute/ignoreblurwhilesearching">ignorebluewhilesearching</a>
-</li><li> <a href="cn/XUL/Attribute/ignorecase">ignorecase</a>
-</li><li> <a href="cn/XUL/Attribute/ignoreincolumnpicker">ignoreincolumnpicker</a>
-</li><li> <a href="cn/XUL/Attribute/ignorekeys">ignorekeys</a>
-</li><li> <a href="cn/XUL/Attribute/image">image</a>
-</li><li> <a href="cn/XUL/Attribute/inactivetitlebarcolor">inactivetitlebarcolor</a>
-</li><li> <a href="cn/XUL/Attribute/increment">increment</a>
-</li><li> <a href="cn/XUL/Attribute/inputtooltiptext">inputtooltiptext</a>
-</li><li> <a href="cn/XUL/Attribute/insertafter">insertafter</a>
-</li><li> <a href="cn/XUL/Attribute/insertbefore">insertbefore</a>
-</li><li> <a href="cn/XUL/Attribute/instantApply">instantApply</a>
-</li><li> <a href="cn/XUL/Attribute/inverted">inverted</a>
-</li><li> <a href="cn/XUL/Attribute/iscontainer">iscontainer</a>
-</li><li> <a href="cn/XUL/Attribute/isempty">isempty</a>
-</li><li> <a href="cn/XUL/Attribute/key">key</a>
-</li><li> <a href="cn/XUL/Attribute/keycode">keycode</a>
-</li><li> <a href="cn/XUL/Attribute/keytext">keytext</a>
-</li><li> <a href="cn/XUL/Attribute/label">label</a>
-</li><li> <a href="cn/XUL/Attribute/lastpage">lastpage</a>
-</li><li> <a href="cn/XUL/Attribute/lastSelected">lastSelected</a>
-</li><li> <a href="cn/XUL/Attribute/last-tab">last-tab</a>
-</li><li> <a href="cn/XUL/Attribute/left">left</a>
-</li><li> <a href="cn/XUL/Attribute/linkedpanel">linkedpanel</a>
-</li><li> <a href="cn/XUL/Attribute/max">max</a>
-</li><li> <a href="cn/XUL/Attribute/maxheight">maxheight</a>
-</li><li> <a href="cn/XUL/Attribute/maxlength">maxlength</a>
-</li><li> <a href="cn/XUL/Attribute/maxpos">maxpos</a>
-</li><li> <a href="cn/XUL/Attribute/maxrows">maxrows</a>
-</li><li> <a href="cn/XUL/Attribute/maxwidth">maxwidth</a>
-</li><li> <a href="cn/XUL/Attribute/member">member</a>
-</li><li> <a href="cn/XUL/Attribute/menu">menu</a>
-</li><li> <a href="cn/XUL/Attribute/menuactive">menuactive</a>
-</li><li> <a href="cn/XUL/Attribute/min">min</a>
-</li><li> <a href="cn/XUL/Attribute/minheight">minheight</a>
-</li><li> <a href="cn/XUL/Attribute/minResultsForPopup">minResultsForPopup</a>
-</li><li> <a href="cn/XUL/Attribute/minresultsforpopup">minresultsforpopup</a>
-</li><li> <a href="cn/XUL/Attribute/minwidth">minwidth</a>
-</li><li> <a href="cn/XUL/Attribute/mode">mode</a>
-</li><li> <a href="cn/XUL/Attribute/modifiers">modifiers</a>
-</li><li> <a href="cn/XUL/Attribute/mousethrough">mousethrough</a>
-</li><li> <a href="cn/XUL/Attribute/multiline">multiline</a>
-</li><li> <a href="cn/XUL/Attribute/multiple">multiple</a>
-</li><li> <a href="cn/XUL/Attribute/name">name</a>
-</li><li> <a href="cn/XUL/Attribute/negate">negate</a>
-</li><li> <a href="cn/XUL/Attribute/newlines">newlines</a>
-</li><li> <a href="cn/XUL/Attribute/next">next</a>
-</li><li> <a href="cn/XUL/Attribute/noautofocus">noautofocus</a>
-</li><li> <a href="cn/XUL/Attribute/noautohide">noautohide</a>
-</li><li> <a href="cn/XUL/Attribute/nomatch">nomatch</a>
-</li><li> <a href="cn/XUL/Attribute/object">object</a>
-</li><li> <a href="cn/XUL/Attribute/observes">observes</a>
-</li><li> <a href="cn/XUL/Attribute/onbeforeaccept">onbeforeaccept</a>
-</li><li> <a href="cn/XUL/Attribute/onbookmarkgroup">onbookmarkgroup</a>
-</li><li> <a href="cn/XUL/Attribute/onchange">onchange</a>
-</li><li> <a href="cn/XUL/Attribute/onclosetab">onclosetab</a>
-</li><li> <a href="cn/XUL/Attribute/oncommand">oncommand</a>
-</li><li> <a href="cn/XUL/Attribute/oncommandupdate">oncommandupdate</a>
-</li><li> <a href="cn/XUL/Attribute/ondialogaccept">ondialogaccept</a>
-</li><li> <a href="cn/XUL/Attribute/ondialogcancel">ondialogcancel</a>
-</li><li> <a href="cn/XUL/Attribute/ondialogdisclosure">ondialogclosure</a>
-</li><li> <a href="cn/XUL/Attribute/ondialogextra1">ondialogextra1</a>
-</li><li> <a href="cn/XUL/Attribute/ondialogextra2">ondialogextra2</a>
-</li><li> <a href="cn/XUL/Attribute/ondialoghelp">ondialoghelp</a>
-</li><li> <a href="cn/XUL/Attribute/onerror">onerror</a>
-</li><li> <a href="cn/XUL/Attribute/onerrorcommand">onerrorcommand</a>
-</li><li> <a href="cn/XUL/Attribute/onextra1">onextra1</a>
-</li><li> <a href="cn/XUL/Attribute/onextra2">onextra2</a>
-</li><li> <a href="cn/XUL/Attribute/oninput">oninput</a>
-</li><li> <a href="cn/XUL/Attribute/onload">onload</a>
-</li><li> <a href="cn/XUL/Attribute/onnewtab">onnewtab</a>
-</li><li> <a href="cn/XUL/Attribute/onpageadvanced">onpageadvanced</a>
-</li><li> <a href="cn/XUL/Attribute/onpagehide">onpagehide</a>
-</li><li> <a href="cn/XUL/Attribute/onpagerewound">onpagerewound</a>
-</li><li> <a href="cn/XUL/Attribute/onpageshow">onpageshow</a>
-</li><li> <a href="cn/XUL/Attribute/onpaneload">onpaneload</a>
-</li><li> <a href="cn/XUL/Attribute/onpopuphidden">onpopuphidden</a>
-</li><li> <a href="cn/XUL/Attribute/onpopuphiding">onpopuphiding</a>
-</li><li> <a href="cn/XUL/Attribute/onpopupshowing">onpopupshowing</a>
-</li><li> <a href="cn/XUL/Attribute/onpopupshown">onpopupshown</a>
-</li><li> <a href="cn/XUL/Attribute/onsearchcomplete">onsearchcomplete</a>
-</li><li> <a href="cn/XUL/Attribute/onselect">onselect</a>
-</li><li> <a href="cn/XUL/Attribute/ontextcommand">ontextcommand</a>
-</li><li> <a href="cn/XUL/Attribute/ontextentered">ontextentered</a>
-</li><li> <a href="cn/XUL/Attribute/ontextrevert">ontextrevert</a>
-</li><li> <a href="cn/XUL/Attribute/ontextreverted">ontextreverted</a>
-</li><li> <a href="cn/XUL/Attribute/onwizardback">onwizardback</a>
-</li><li> <a href="cn/XUL/Attribute/onwizardcancel">onwizardcancel</a>
-</li><li> <a href="cn/XUL/Attribute/onwizardfinish">onwizardfinish</a>
-</li><li> <a href="cn/XUL/Attribute/onwizardnext">onwizardnext</a>
-</li><li> <a href="cn/XUL/Attribute/open">open</a>
-</li><li> <a href="cn/XUL/Attribute/ordinal">ordinal</a>
-</li><li> <a href="cn/XUL/Attribute/orient">orient</a>
-</li><li> <a href="cn/XUL/Attribute/pack">pack</a>
-</li><li> <a href="cn/XUL/Attribute/pageid">pageid</a>
-</li><li> <a href="cn/XUL/Attribute/pageincrement">pageincrement</a>
-</li><li> <a href="cn/XUL/Attribute/pagestep">pagestep</a>
-</li><li> <a href="cn/XUL/Attribute/parent">parent</a>
-</li><li> <a href="cn/XUL/Attribute/parsetype">parsetype</a>
-</li><li> <a href="cn/XUL/Attribute/persist">persist</a>
-</li><li> <a href="cn/XUL/Attribute/persistence">persistence</a>
-</li><li> <a href="cn/XUL/Attribute/phase">phase</a>
-</li><li> <a href="cn/XUL/Attribute/pickertooltiptext">pickertooltiptext</a>
-</li><li> <a href="cn/XUL/Attribute/popup">popup</a>
-</li><li> <a href="cn/XUL/Attribute/position">position</a>
-</li><li> <a href="cn/XUL/Attribute/predicate">predicate</a>
-</li><li> <a href="cn/XUL/Attribute/preference">preference</a>
-</li><li> <a href="cn/XUL/Attribute/preference-editable">preference-editable</a>
-</li><li> <a href="cn/XUL/Attribute/primary">primary</a>
-</li><li> <a href="cn/XUL/Attribute/priority">priority</a>
-</li><li> <a href="cn/XUL/Attribute/properties">properties</a>
-</li><li> <a href="cn/XUL/Attribute/querytype">querytype</a>
-</li><li> <a href="cn/XUL/Attribute/readonly">readonly</a>
-</li><li> <a href="cn/XUL/Attribute/ref">ref</a>
-</li><li> <a href="cn/XUL/Attribute/rel">rel</a>
-</li><li> <a href="cn/XUL/Attribute/removeelement">removeelement</a>
-</li><li> <a href="cn/XUL/Attribute/resizeafter">resizeafter</a>
-</li><li> <a href="cn/XUL/Attribute/resizebefore">resizebefore</a>
-</li><li> <a href="cn/XUL/Attribute/rows">rows</a>
-</li><li> <a href="cn/XUL/Attribute/screenX">screenX</a>
-</li><li> <a href="cn/XUL/Attribute/screenY">screenY</a>
-</li><li> <a href="cn/XUL/Attribute/searchSessions">searchSessions</a>
-</li><li> <a href="cn/XUL/Attribute/searchlabel">searchlabel</a>
-</li><li> <a href="cn/XUL/Attribute/selected">selected</a>
-</li><li> <a href="cn/XUL/Attribute/selectedIndex">selectedIndex</a>
-</li><li> <a href="cn/XUL/Attribute/seltype">seltype</a>
-</li><li> <a href="cn/XUL/Attribute/setfocus">setfocus</a>
-</li><li> <a href="cn/XUL/Attribute/showcaret">showcaret</a>
-</li><li> <a href="cn/XUL/Attribute/showCommentColumn">showCommentColumn</a>
-</li><li> <a href="cn/XUL/Attribute/showcommentcolumn">showcommentcolumn</a>
-</li><li> <a href="cn/XUL/Attribute/showpopup">showpopup</a>
-</li><li> <a href="cn/XUL/Attribute/size">size</a>
-</li><li> <a href="cn/XUL/Attribute/sizemode">sizemode</a>
-</li><li> <a href="cn/XUL/Attribute/sizetopopup">sizetopopup</a>
-</li><li> <a href="cn/XUL/Attribute/smoothscroll">smoothscroll</a>
-</li><li> <a href="cn/XUL/Attribute/sort">sort</a>
-</li><li> <a href="cn/XUL/Attribute/sortActive">sortActive</a>
-</li><li> <a href="cn/XUL/Attribute/sortDirection">sortDirection</a>
-</li><li> <a href="cn/XUL/Attribute/sortResource">sortResource</a>
-</li><li> <a href="cn/XUL/Attribute/sortResource2">sortResource2</a>
-</li><li> <a href="cn/XUL/Attribute/spellcheck">spellcheck</a>
-</li><li> <a href="cn/XUL/Attribute/src">src</a>
-</li><li> <a href="cn/XUL/Attribute/state">state</a>
-</li><li> <a href="cn/XUL/Attribute/statedatasource">statedatasource</a>
-</li><li> <a href="cn/XUL/Attribute/statusbar">statusbar</a>
-</li><li> <a href="cn/XUL/Attribute/statustext">statustext</a>
-</li><li> <a href="cn/XUL/Attribute/style">style</a>
-</li><li> <a href="cn/XUL/Attribute/subject">subject</a>
-</li><li> <a href="cn/XUL/Attribute/substate">substate</a>
-</li><li> <a href="cn/XUL/Attribute/suppressonselect">suppressonselect</a>
-</li><li> <a href="cn/XUL/Attribute/tabindex">tabindex</a>
-</li><li> <a href="cn/XUL/Attribute/tabScrolling">tabScrolling</a>
-</li><li> <a href="cn/XUL/Attribute/tabscrolling">tabscrolling</a>
-</li><li> <a href="cn/XUL/Attribute/targets">targets</a>
-</li><li> <a href="cn/XUL/Attribute/template">template</a>
-</li><li> <a href="cn/XUL/Attribute/timeout">timeout</a>
-</li><li> <a href="cn/XUL/Attribute/title">title</a>
-</li><li> <a href="cn/XUL/Attribute/toolbarname">toolbarname</a>
-</li><li> <a href="cn/XUL/Attribute/tooltip">tooltip</a>
-</li><li> <a href="cn/XUL/Attribute/tooltiptext">tooltiptext</a>
-</li><li> <a href="cn/XUL/Attribute/tooltiptextnew">tooltiptextnew</a>
-</li><li> <a href="cn/XUL/Attribute/top">top</a>
-</li><li> <a href="cn/XUL/Attribute/type">type</a>
-</li><li> <a href="cn/XUL/Attribute/uri">uri</a>
-</li><li> <a href="cn/XUL/Attribute/userAction">userAction</a>
-</li><li> <a href="cn/XUL/Attribute/validate">validate</a>
-</li><li> <a href="cn/XUL/Attribute/value">value</a>
-</li><li> <a href="cn/XUL/Attribute/var">var</a>
-</li><li> <a href="cn/XUL/Attribute/wait-cursor">wait-cursor</a>
-</li><li> <a href="cn/XUL/Attribute/width">width</a>
-</li><li> <a href="cn/XUL/Attribute/windowtype">windowtype</a>
-</li><li> <a href="cn/XUL/Attribute/wrap">wrap</a>
-</li><li> <a href="cn/XUL/Attribute/wraparound">wraparound</a>
-</li></ul>
-<div class="noinclude">
-</div>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/label/index.html b/files/zh-cn/mozilla/tech/xul/attribute/label/index.html
deleted file mode 100644
index 1846c63a8e..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/label/index.html
+++ /dev/null
@@ -1,41 +0,0 @@
----
-title: label
-slug: Mozilla/Tech/XUL/Attribute/label
-tags:
- - XUL Attributes
- - XUL Reference
-translation_of: Archive/Mozilla/XUL/Attribute/label
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- The label that will appear on the element. If this is left out, no text appears.<br>
- label 在元素上显示。如果左侧出界,则不显示任何文字。</dd>
-</dl>
-<div class="noinclude">
- <h3 id="See_also" name="See_also">See also</h3>
- <ul>
- <li><a href="/cn/XUL/Attribute/treeitem.label" title="cn/XUL/Attribute/treeitem.label">treeitem.label</a>, <code><a href="/cn/XUL/label" title="cn/XUL/label">&lt;label&gt;</a></code> element</li>
- </ul>
- <h4 id="Examples_in_JavaScript" name="Examples_in_JavaScript">Examples in JavaScript</h4>
- <pre>&lt;label value="Whaw" id="the-big-label" command="the-big-button"/&gt;
-&lt;button id="the-big-button" label="Click me"
- oncommand="alert(document.getElementById('the-big-label').value)"/&gt;
-
-&lt;label id="myLabel" value="My label"/&gt;
-&lt;button label="Click me"
- oncommand="document.getElementById('myLabel').setAttribute('value','Value changed');" /&gt;
-
-&lt;checkbox label="my Checkbox" id="myCheckboX"/&gt;
-&lt;button label="Another click"
- oncommand="document.getElementById('myCheckboX').setAttribute('label','Still not checked');"/&gt;
-&lt;button label="Show label of checkbox"
- oncommand="alert( document.getElementById('myCheckboX').getAttribute('label') )"/&gt;
-</pre>
-</div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/max/index.html b/files/zh-cn/mozilla/tech/xul/attribute/max/index.html
deleted file mode 100644
index 93eb88d4f7..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/max/index.html
+++ /dev/null
@@ -1,20 +0,0 @@
----
-title: max
-slug: Mozilla/Tech/XUL/Attribute/max
-translation_of: Archive/Mozilla/XUL/Attribute/max
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dd>
- 类型:整数</dd>
- <dd>
- 设置刻度条控件(scale元素)或者数字输入框控件(type属性为number的textbox元素)中能输入的最大数字.刻度条控件中,该属性的默认值为100,数字输入框中,该属性的默认值为无穷大.</dd>
-</dl>
-<div class="noinclude">
- <h3 id="See_also" name="See_also">相关链接</h3>
- <ul>
- <li><a href="/en/XUL/Attribute/progressmeter.max" title="en/XUL/Attribute/progressmeter.max">progressmeter.ma</a></li>
- </ul>
-</div>
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/menuitem.key/index.html b/files/zh-cn/mozilla/tech/xul/attribute/menuitem.key/index.html
deleted file mode 100644
index b4239b866d..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/menuitem.key/index.html
+++ /dev/null
@@ -1,23 +0,0 @@
----
-title: menuitem.key
-slug: Mozilla/Tech/XUL/Attribute/menuitem.key
-tags:
- - XUL Attributes
-translation_of: Archive/Mozilla/XUL/Attribute/menuitem.key
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-menuitem.key"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/menuitem.key">key</a></code></dt>
- <dd>
- Type:
- <i>
- element id</i>
- </dd>
- <dd>
- Set to the <code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code> of a <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/key" title="key">key</a></code> element whose key shortcut is displayed in the <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code>.</dd>
-</dl>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/menuitem.name/index.html b/files/zh-cn/mozilla/tech/xul/attribute/menuitem.name/index.html
deleted file mode 100644
index a485138846..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/menuitem.name/index.html
+++ /dev/null
@@ -1,38 +0,0 @@
----
-title: menuitem.name
-slug: Mozilla/Tech/XUL/Attribute/menuitem.name
-tags:
- - XUL Attributes
-translation_of: Archive/Mozilla/XUL/Attribute/menuitem.name
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-menuitem.name"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/menuitem.name">name</a></code></dt>
- <dd>
- Type:
- <i>
- string name</i>
- </dd>
- <dd>
- Radio <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code>s with the same name as put into a group. Only one <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code> in each radio group can be checked at a time.</dd>
-</dl>
-<div class="noinclude">
- <h3 id="Example" name="Example">Example</h3>
- <pre>&lt;toolbox&gt;
- &lt;menubar id="planets-menubar"&gt;
- &lt;menu id="planet-menu" label="Planet"&gt;
- &lt;menupopup&gt;
- &lt;menuitem id="jupiter" label="Jupiter" type="radio" name="planet"/&gt;
- &lt;menuitem id="saturn" label="Saturn" type="radio" name="planet" checked="true"/&gt;
- &lt;menuitem id="uranus" label="Uranus" type="radio" name="planet"/&gt;
- &lt;/menupopup&gt;
- &lt;/menu&gt;
- &lt;/menubar&gt;
-&lt;/toolbox&gt;
-</pre>
- <h3 id="See_also" name="See_also">See also</h3>
- <p><a href="cn/XUL/Attribute/name">name</a> and <a href="cn/XUL_Tutorial/More_Menu_Features#Adding_Checkmarks_to_Menus">menus in the XUL Tutorial</a></p>
-</div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/menuitem.type/index.html b/files/zh-cn/mozilla/tech/xul/attribute/menuitem.type/index.html
deleted file mode 100644
index 872c50331b..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/menuitem.type/index.html
+++ /dev/null
@@ -1,28 +0,0 @@
----
-title: menuitem.type
-slug: Mozilla/Tech/XUL/Attribute/menuitem.type
-tags:
- - XUL Attributes
-translation_of: Archive/Mozilla/XUL/Attribute/menuitem.type
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-menuitem.type"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/menuitem.type">type</a></code></dt>
- <dd>
- Type:
- <i>
- one of the values below</i>
- </dd>
- <dd>
- Can be used to create checkable menuitems or for radio button menuitems.</dd>
-</dl>
-<ul>
- <li><code>checkbox</code>: The <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code> is checked. The <code id="a-checked"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/checked">checked</a></code> attribute determines whether the menuitem is checked or not.</li>
- <li><code>radio</code>: The <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code> becomes part of a radio group. Other menuitems that have the same value for their <code id="a-name"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/name">name</a></code> attributes are part of the same <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/radio" title="radio">radio</a></code> group. Only one menuitem in the same radio group can be checked at once.</li>
-</ul>
-<p>More information on adding checkmarks to menus in the <a href="cn/XUL_Tutorial/More_Menu_Features#Adding_Checkmarks_to_Menus">XUL tutorial</a></p>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/min/index.html b/files/zh-cn/mozilla/tech/xul/attribute/min/index.html
deleted file mode 100644
index 9646b1da96..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/min/index.html
+++ /dev/null
@@ -1,16 +0,0 @@
----
-title: min
-slug: Mozilla/Tech/XUL/Attribute/min
-translation_of: Archive/Mozilla/XUL/Attribute/min
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-min"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/min">min</a></code></dt>
- <dd>
- 类型:整数</dd>
- <dd>
- 该控件可以有的最小的整数值,默认值为0.</dd>
-</dl>
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/name/index.html b/files/zh-cn/mozilla/tech/xul/attribute/name/index.html
deleted file mode 100644
index cd1695a84c..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/name/index.html
+++ /dev/null
@@ -1,16 +0,0 @@
----
-title: name
-slug: Mozilla/Tech/XUL/Attribute/name
-tags:
- - XUL Attributes
-translation_of: Archive/Mozilla/XUL/Attribute/name
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span>
- <h3 id="See_also" name="See_also">See also</h3>
- <ul>
- <li><a href="cn/XUL/Attribute/menuitem.name">menuitem.name</a></li>
- <li><a href="cn/XUL/Attribute/preference.name">preference.name</a></li>
- </ul>
-</div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/onpopupshowing/index.html b/files/zh-cn/mozilla/tech/xul/attribute/onpopupshowing/index.html
deleted file mode 100644
index ec821daefe..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/onpopupshowing/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: onpopupshowing
-slug: Mozilla/Tech/XUL/Attribute/onpopupshowing
-translation_of: Archive/Mozilla/XUL/Attribute/onpopupshowing
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-onpopupshowing"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/onpopupshowing">onpopupshowing</a></code></dt>
- <dd>
- Type: <em>script code</em></dd>
- <dd>
- This event is sent to a popup just before it is opened. This handler is usually used to dynamically set the contents when the user requests to display it. Returning <code>false</code> from this event handler prevents the popup from appearing.</dd>
- <dd>
- 该事件在 popup 打开之前传给它。它用于动态生成菜单项。如果返回 false 值,则 popup 将不会显示菜单项。</dd>
-</dl>
-<div class="noinclude">
- <p></p>
-</div>
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/onpopupshown/index.html b/files/zh-cn/mozilla/tech/xul/attribute/onpopupshown/index.html
deleted file mode 100644
index a94af052a2..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/onpopupshown/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: onpopupshown
-slug: Mozilla/Tech/XUL/Attribute/onpopupshown
-translation_of: Archive/Mozilla/XUL/Attribute/onpopupshown
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-onpopupshown"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/onpopupshown">onpopupshown</a></code></dt>
- <dd>
- Type: <em>script code</em></dd>
- <dd>
- This event is sent to a popup after it has been opened, much like the <code>onload</code> event is sent to a window when it is opened.</dd>
- <dd>
- 该事件在 popup 打开之后触发,与 window 的 onload 事件比较类似。</dd>
-</dl>
-<div class="noinclude">
- <p></p>
-</div>
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/orient/index.html b/files/zh-cn/mozilla/tech/xul/attribute/orient/index.html
deleted file mode 100644
index aa1c735a6c..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/orient/index.html
+++ /dev/null
@@ -1,16 +0,0 @@
----
-title: orient
-slug: Mozilla/Tech/XUL/Attribute/orient
-translation_of: Archive/Mozilla/XUL/Attribute/orient
----
-<p><strong>布局(orient)</strong></p>
-<dl>
- <dd>
- 值类型:可以是下面值中的一种。<br>
- 指定了子控件的布局(orient)为水平分布的(horizontally)或者是垂直分布的(vertically)。默认值依赖于控件本身。你也可以使用<a href="cn/-moz-box-orient">-moz-box-orient</a>中的样式属性。
- <ul>
- <li><strong>horizontally</strong>: 子控件会被按照在xul源文件中出现的位置依次布置在一行中。</li>
- <li><strong>vertically</strong>: 子控件会被按照在xul源文件中出现的位置依次布置在一列中。</li>
- </ul>
- </dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/pending/index.html b/files/zh-cn/mozilla/tech/xul/attribute/pending/index.html
deleted file mode 100644
index 0ab9643c8f..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/pending/index.html
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: pending
-slug: Mozilla/Tech/XUL/Attribute/pending
-translation_of: Archive/Mozilla/XUL/Attribute/pending
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-pending"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/pending">pending</a></code> </dt>
- <dd>
- Type: <em>boolean</em></dd>
- <dd>
- This attribute is set to <code>true</code> if the tab is currently in the process of being restored by the session store service. Once the tab is restored, this attribute is removed. You can determine if a tab is being restored by checking to see if <code>hasAttribute("pending")</code> is <code>true</code>. If the user has turned on the "Don't load tabs until selected" preference, the <code id="a-pending"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/pending">pending</a></code> attribute is set on tabs until they get loaded.</dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/persist/index.html b/files/zh-cn/mozilla/tech/xul/attribute/persist/index.html
deleted file mode 100644
index b1d30d5a59..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/persist/index.html
+++ /dev/null
@@ -1,24 +0,0 @@
----
-title: persist
-slug: Mozilla/Tech/XUL/Attribute/persist
-tags:
- - XUL Attributes
-translation_of: Archive/Mozilla/XUL/Attribute/persist
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-persist"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/persist">persist</a></code></dt>
- <dd>
- Type:
- <i>
- space-separated list of attribute names</i>
- </dd>
- <dd>
- A space-separated list of attributes that are maintained when the window is closed. When the window is re-opened, the values of persistent attributes are restored. In Mozilla, persistent attributes are stored in the per-profile file <code>localstore.rdf</code>. Persistence can also be stored using the <code>document.persist</code> function. In order for persistence to work, the element must also have an <code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code>.</dd>
-</dl>
-<p> </p>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/selected/index.html b/files/zh-cn/mozilla/tech/xul/attribute/selected/index.html
deleted file mode 100644
index 47971cd8c8..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/selected/index.html
+++ /dev/null
@@ -1,28 +0,0 @@
----
-title: selected
-slug: Mozilla/Tech/XUL/Attribute/selected
-tags:
- - XUL Attributes
-translation_of: Archive/Mozilla/XUL/Attribute/selected
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-selected"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/selected">selected</a></code></dt>
- <dd>
- Type:
- <i>
- boolean</i>
- </dd>
- <dd>
- Indicates whether the element is selected or not. This value is read-only. To change the selection, set either the <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectedIndex">selectedIndex</a></span></code> or <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectedItem">selectedItem</a></span></code> property of the containing element.</dd>
-</dl>
-<div class="noinclude">
- <h3 id="See_also" name="See_also">See also</h3>
- <ul>
- <li><a href="cn/XUL/Attribute/prefpane.selected">prefpane.selected</a></li>
- <li><a href="cn/XUL/Attribute/tab.selected">tab.selected</a></li>
- </ul>
-</div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/selectedindex/index.html b/files/zh-cn/mozilla/tech/xul/attribute/selectedindex/index.html
deleted file mode 100644
index 72dd679801..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/selectedindex/index.html
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: selectedIndex
-slug: Mozilla/Tech/XUL/Attribute/selectedIndex
-translation_of: Archive/Mozilla/XUL/Attribute/selectedIndex
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-selectedIndex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/selectedIndex">selectedIndex</a></code></dt>
- <dd>
- 类型: 整数</dd>
- <dd>
- 获取或设置当前所选面板的索引号,索引号从0开始.</dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/tabindex/index.html b/files/zh-cn/mozilla/tech/xul/attribute/tabindex/index.html
deleted file mode 100644
index c5e54fdd1c..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/tabindex/index.html
+++ /dev/null
@@ -1,18 +0,0 @@
----
-title: tabindex
-slug: Mozilla/Tech/XUL/Attribute/tabindex
-tags:
- - XUL Attributes
-translation_of: Archive/Mozilla/XUL/Attribute/tabindex
----
-<div class="noinclude"><span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-
-<dl>
- <dt><code id="a-tabindex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tabindex">tabindex</a></code></dt>
- <dd>Type:<em>integer</em></dd>
- <dd>当用户按下 "<kbd>tab</kbd>" 键时焦点移动到元素上的顺序。<code>tabindex</code> 数字越大,顺序越靠后。</dd>
-</dl>
-
-<div class="noinclude"> </div>
-
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/validate/index.html b/files/zh-cn/mozilla/tech/xul/attribute/validate/index.html
deleted file mode 100644
index a56181d8b7..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/validate/index.html
+++ /dev/null
@@ -1,27 +0,0 @@
----
-title: validate
-slug: Mozilla/Tech/XUL/Attribute/validate
-tags:
- - XUL Attributes
-translation_of: Archive/Mozilla/XUL/Attribute/validate
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-validate"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/validate">validate</a></code></dt>
- <dd>
- Type:
- <i>
- one of the values below</i>
- </dd>
- <dd>
- This attribute indicates whether to load the image from the cache or not. This would be useful if the images are stored remotely or you plan on swapping the image frequently. The following values are accepted, or leave out the attribute entirely for default handling:</dd>
-</dl>
-<ul>
- <li><code>always</code>: The image is always checked to see whether it should be reloaded.</li>
- <li><code>never</code>: The image will be loaded from the cache if possible.</li>
-</ul>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/attribute/value/index.html b/files/zh-cn/mozilla/tech/xul/attribute/value/index.html
deleted file mode 100644
index f436308d89..0000000000
--- a/files/zh-cn/mozilla/tech/xul/attribute/value/index.html
+++ /dev/null
@@ -1,30 +0,0 @@
----
-title: value
-slug: Mozilla/Tech/XUL/Attribute/value
-tags:
- - XUL Attributes
-translation_of: Archive/Mozilla/XUL/Attribute/value
----
-<div class="noinclude">
- <span class="breadcrumbs xulRefAttr_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- The string attribute allows you to associate a data value with an element. It is not used for any specific purpose, but you can access it with a script for your own use.</dd>
-</dl>
-<div class="noinclude">
- <h3 id="See_also" name="See_also">See also</h3>
- <ul>
- <li><a href="cn/XUL/Attribute/label.value">label.value</a></li>
- <li><a href="cn/XUL/Attribute/progressmeter.value">progressmeter.value</a></li>
- <li><a href="cn/XUL/Attribute/textbox.value">textbox.value</a></li>
- <li><a href="cn/XUL/Attribute/textnode.value">textnode.value</a></li>
- </ul>
-</div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/broadcaster/index.html b/files/zh-cn/mozilla/tech/xul/broadcaster/index.html
deleted file mode 100644
index be97efef42..0000000000
--- a/files/zh-cn/mozilla/tech/xul/broadcaster/index.html
+++ /dev/null
@@ -1,91 +0,0 @@
----
-title: broadcaster
-slug: Mozilla/Tech/XUL/broadcaster
-translation_of: Archive/Mozilla/XUL/broadcaster
----
-<div class="noinclude">
- <span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-<div class="noinclude">
- <br>
- 当您希望若干个元素共享一个或多个属性值时,或者当您想要多个元素对某一个状态改变做出响应是,可以使用 broadcaster。任何监视 broadcaster 的元素都会共享到 broadcaster 中的属性。比如说,假设我们有一个 broadcaster,它拥有一个 <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code> 属性,而它的观察者们正在监视这个 label。这时如果 label 发生了改变,label 的观察者们将立刻被唤醒(update)。改变发生时,每个观察者都会收到一个 <code>onbroadcast 事件。</code><br>
- <br>
- 对于 <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code> 或者 <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/button" title="button">button</a></code> 来说,如果只是为了根据功能是否可用,即时更新菜单项目的 <code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code> 状态,那么您应该优先考虑 <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/command" title="command">command</a></code>。</div>
-<p>更多内容请参考 <a href="/en/XUL_Tutorial/Broadcasters_and_Observers" title="en/XUL_Tutorial/Broadcasters_and_Observers">Broadcasters and Observers</a> XUL Tutorial.</p>
-<h3 id="Examples" name="Examples">Examples</h3>
-<p>(example needed)</p>
-<h3 id="Attributes" name="Attributes">Attributes</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0 0 10px 10px; padding: 0 10px; background: rgb(238, 238, 238);">
-<tbody>
-<tr>
-<td><p><strong>Inherited from XUL element</strong><br> <small>
-<code id="a-align"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/align">align</a></code>,
-<code id="a-allowevents"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/allowevents">allowevents</a></code>,
-<code id="a-allownegativeassertions"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/allownegativeassertions">allownegativeassertions</a></code>,
-<code id="a-class"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/class">class</a></code>,
-<code id="a-coalesceduplicatearcs"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/coalesceduplicatearcs">coalesceduplicatearcs</a></code>,
-<code id="a-collapsed"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/collapsed">collapsed</a></code>,
-<code id="a-container"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/container">container</a></code>,
-<code id="a-containment"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/containment">containment</a></code>,
-<code id="a-context"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/context">context</a></code>,
-<code id="a-contextmenu"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/contextmenu">contextmenu</a></code>,
-<code id="a-datasources"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/datasources">datasources</a></code>,
-<code id="a-dir"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/dir">dir</a></code>,
-<code id="a-empty"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/empty">empty</a></code>,
-<code id="a-equalsize"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/equalsize">equalsize</a></code>,
-<code id="a-flags"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/flags">flags</a></code>,
-<code id="a-flex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/flex">flex</a></code>,
-<code id="a-height"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/height">height</a></code>,
-<code id="a-hidden"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/hidden">hidden</a></code>,
-<code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code>,
-<code id="a-insertafter"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/insertafter">insertafter</a></code>,
-<code id="a-insertbefore"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/insertbefore">insertbefore</a></code>,
-<code id="a-left"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/left">left</a></code>,
-<code id="a-maxheight"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/maxheight">maxheight</a></code>,
-<code id="a-maxwidth"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/maxwidth">maxwidth</a></code>,
-<code id="a-menu"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/menu">menu</a></code>,
-<code id="a-minheight"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/minheight">minheight</a></code>,
-<code id="a-minwidth"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/minwidth">minwidth</a></code>,
-<code id="a-mousethrough"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/mousethrough">mousethrough</a></code>,
-<code id="a-observes"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/observes">observes</a></code>,
-<code id="a-ordinal"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/ordinal">ordinal</a></code>,
-<code id="a-orient"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/orient">orient</a></code>,
-<code id="a-pack"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/pack">pack</a></code>,
-<code id="a-persist"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/persist">persist</a></code>,
-<code id="a-popup"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/popup">popup</a></code>,
-<code id="a-position"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/position">position</a></code>,
-<code id="a-preference-editable"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/preference-editable">preference-editable</a></code>,
-<code id="a-querytype"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/querytype">querytype</a></code>,
-<code id="a-ref"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/ref">ref</a></code>,
-<code id="a-removeelement"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/removeelement">removeelement</a></code>,
-<code id="a-sortDirection"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/sortDirection">sortDirection</a></code>,
-<code id="a-sortResource"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/sortResource">sortResource</a></code>,
-<code id="a-sortResource2"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/sortResource2">sortResource2</a></code>,
-<code id="a-statustext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/statustext">statustext</a></code>,
-<code id="a-style"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/style">style</a></code>,
-<code id="a-template"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/template">template</a></code>,
-<code id="a-tooltip"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tooltip">tooltip</a></code>,
-<code id="a-tooltiptext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tooltiptext">tooltiptext</a></code>,
-<code id="a-top"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/top">top</a></code>,
-<code id="a-uri"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/uri">uri</a></code>,
-<code id="a-wait-cursor"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/wait-cursor">wait-cursor</a></code>,
-<code id="a-width"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/width">width</a></code> </small></p>
-</td>
-</tr>
-</tbody>
-</table><p></p>
-<h3 id="Properties" name="Properties">Properties</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited Properties</strong><br> <small> <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/align">align</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/allowEvents">allowEvents</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/boxObject">boxObject</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/builder">builder</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/className">className</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/collapsed">collapsed</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/contextMenu">contextMenu</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/controllers">controllers</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/database">database</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/datasources">datasources</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/dir">dir</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/flex">flex</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/height">height</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/hidden">hidden</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/id">id</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/left">left</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/maxHeight">maxHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/maxWidth">maxWidth</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/menu">menu</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/minHeight">minHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/minWidth">minWidth</a></span></code>, , , , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/observes">observes</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/ordinal">ordinal</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/orient">orient</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/pack">pack</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/persist">persist</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/ref">ref</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/resource">resource</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/statusText">statusText</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/style">style</a></span></code>, ,, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tooltip">tooltip</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tooltipText">tooltipText</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/top">top</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/width">width</a></span></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Methods" name="Methods">Methods</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited from XUL element</strong><br> <small> <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span></small></p> <p><strong>Inherited from DOM element</strong><br> <small> <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Related" name="Related">Related</h3>
-<p>TBD</p>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/browser/index.html b/files/zh-cn/mozilla/tech/xul/browser/index.html
deleted file mode 100644
index 4f9a039f3a..0000000000
--- a/files/zh-cn/mozilla/tech/xul/browser/index.html
+++ /dev/null
@@ -1,409 +0,0 @@
----
-title: browser
-slug: Mozilla/Tech/XUL/browser
-translation_of: Archive/Mozilla/XUL/browser
----
-<div class="noinclude">
- <span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-<p>A frame which is expected to contain a view of a Web document. It is similar to an <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/iframe" title="iframe">iframe</a></code> except that it holds a page history and contains additional methods to manipulate the currently displayed page.</p>
-<p>Most of the properties and methods of the browser will rarely be used and can only be called from chrome URLs. Other URLs will need to use the document and history objects to change the displayed document.</p>
-<dl>
- <dt>
- Attributes</dt>
- <dd>
- <a href="#a-autocompleteenabled">autocompleteenabled</a>, <a href="#a-autocompletepopup">autocompletepopup</a>, <a href="#a-autoscroll">autoscroll</a>, <a href="#a-disablehistory">disablehistory</a>, <a href="#a-disablesecurity">disablesecurity</a>, <a href="#a-homepage">homepage</a>, <a href="#a-showcaret">showcaret</a>, <a href="#a-src">src</a>, <a href="#a-browser.type">type</a></dd>
-</dl>
-<dl>
- <dt>
- Properties</dt>
- <dd>
- <a href="#p-accessibleType">accessibleType</a>, <a href="#p-canGoBack">canGoBack</a>, <a href="#p-canGoForward">canGoForward</a>, <a href="#p-contentDocument">contentDocument</a>, <a href="#p-contentPrincipal">contentPrincipal</a>, <a href="#p-contentTitle">contentTitle</a>, <a href="#p-contentViewerEdit">contentViewerEdit</a>, <a href="#p-contentViewerFile">contentViewerFile</a>, <a href="#p-contentWindow">contentWindow</a>, <a href="#p-currentURI">currentURI</a>, <a href="#p-docShell">docShell</a>, <a href="#p-documentCharsetInfo">documentCharsetInfo</a>, <a href="#p-homePage">homePage</a>, <a href="#p-markupDocumentViewer">markupDocumentViewer</a>, <a href="#p-messageManager">messageManager</a>, <a href="#p-browser.preferences">preferences</a>, <a href="#p-securityUI">securityUI</a>, <a href="#p-sessionHistory">sessionHistory</a>, <a href="#p-webBrowserFind">webBrowserFind</a>, <a href="#p-webNavigation">webNavigation</a>, <a href="#p-webProgress">webProgress</a></dd>
-</dl>
-<dl>
- <dt>
- Methods</dt>
- <dd>
- <a href="#m-addProgressListener">addProgressListener</a>, <a href="#m-goBack">goBack</a>, <a href="#m-goForward">goForward</a>, <a href="#m-goHome">goHome</a>, <a href="#m-gotoIndex">gotoIndex</a>, <a href="#m-loadURI">loadURI</a>, <a href="#m-loadURIWithFlags">loadURIWithFlags</a>, <a href="#m-reload">reload</a>, <a href="#m-reloadWithFlags">reloadWithFlags</a>, <a href="#m-removeProgressListener">removeProgressListener</a>, <a href="#m-stop">stop</a>, <a href="#m-swapDocShells">swapDocShells</a></dd>
-</dl>
-<h3 id="Examples" name="Examples">Examples</h3>
-<div class="float-right">
- <img alt="Image:XUL_ref_browser.png" class="internal" src="/@api/deki/files/447/=XUL_ref_browser.png"></div>
-<pre>&lt;!-- shows Mozilla homepage inside a groupbox --&gt;
-&lt;groupbox flex="1"&gt;
- &lt;caption label="Mozilla homepage"/&gt;
- &lt;browser type="content" src="http://www.mozilla.org" flex="1"/&gt;
-&lt;/groupbox&gt;
-</pre>
-<h3 id="Attributes" name="Attributes">Attributes</h3>
-<p></p>
-<p></p><div id="a-autocompleteenabled">
-
-
-<dl>
- <dt><code id="a-autocompleteenabled"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/autocompleteenabled">autocompleteenabled</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>Set to <code>true</code> to enable autocomplete of fields.</dd>
-</dl>
-</div> <div id="a-autocompletepopup">
-
-<dl>
- <dt>
- <code id="a-autocompletepopup"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/autocompletepopup">autocompletepopup</a></code></dt>
- <dd>
- Type: <em>id</em></dd>
- <dd>
- The <code id="a-id"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code> of a <code><a href="/en-US/docs/Mozilla/Tech/XUL/popup" title="popup">popup</a></code> element used to hold autocomplete results for the element.</dd>
-</dl>
-
-</div> <div id="a-autoscroll">
-
-
-<dl>
- <dt><code id="a-autoscroll"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/autoscroll">autoscroll</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>Set to <code>false</code> to disable autoscroll for this browser. If this attribute is set to <code>true</code> or omitted, autoscroll will be enabled or depending on the user preference <code>general.autoScroll</code>.</dd>
-</dl>
-</div> <div id="a-disablehistory">
-
-<dl> <dt><code id="a-disablehistory"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/disablehistory">disablehistory</a></code></dt> <dd>Type: <em>boolean</em></dd> <dd>Disables both session and global history for the docshell attached to the browser.</dd>
-</dl>
-</div> <div id="a-disablesecurity">
-
-
-<dl>
- <dt><code id="a-disablesecurity"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/disablesecurity">disablesecurity</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>Set this attribute to <code>true</code> to disable the security UI for this browser. Omit this attribute off to enable it.</dd>
-</dl>
-</div> <div id="a-homepage">
-
-
-<dl>
- <dt><code id="a-homepage"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/homepage">homepage</a></code></dt>
- <dd>Type: <em>URL</em></dd>
- <dd>This attribute allows you to set a homepage for the browser element. It does not have any correlation with the user's browser homepage; instead it is a convenient property to hold a home page. You can switch to this home page using the <span id="m-goHome"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/goHome">goHome</a></code></span> method.</dd>
-</dl>
-</div> <div id="a-showcaret">
-
-
-<dl>
- <dt><code id="a-showcaret"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/showcaret">showcaret</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>Whether or not to cause a typing caret to be visible in the content area. Default is <code>false</code>.</dd>
-</dl>
-
-
-</div> <div id="a-src">
-
-<dl>
- <dt>
- <code id="a-src"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/src">src</a></code></dt>
- <dd>
- Type: <em>URI</em></dd>
- <dd>
- The URI of the content to appear in the element.</dd>
-</dl>
-
-
-</div> <div id="a-browser.type">
-
-
-<dl>
- <dt><code id="a-browser.type"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/browser.type">type</a></code></dt>
- <dd><span class="seoSummary">Type: <em>one of the values below</em>.</span></dd>
- <dd><span class="seoSummary">The type of browser, which can be used to set access of the document loaded inside the browser.</span> If this is not set, the loaded document has the same access as the window containing the <code><code><a href="/en-US/docs/Mozilla/Tech/XUL/browser" title="browser">browser</a></code></code>. More precisely: The document loaded into a chrome window is always of chrome type. Subdocuments of chrome documents are of chrome type, unless the container element (one of iframe, browser or editor) has one of the special type attribute values (the common ones are content, content-targetable and content-primary) indicating that the subdocument is of content type. This boundary has a number of special effects, such as making window.top == window (unless the <code><code><a href="/en-US/docs/Mozilla/Tech/XUL/browser" title="browser">browser</a></code></code> is added to a chrome document), and preventing documents from inheriting the principal of the parent document. The type attribute on all frames in content documents is ignored; subdocuments of content documents are always content documents.</dd>
- <dt>
- <div class="warning"><strong>Warning: </strong>The type attribute must be set before the element is inserted into the document.</div>
- </dt>
- <dd>
- <dl>
- <dt><code>content</code></dt>
- <dd>A browser for content. The content that is loaded inside the browser is not allowed to access the chrome above it.</dd>
- <dt><code>content-primary</code></dt>
- <dd>The primary browser for content. The content that is loaded inside the browser is not allowed to access the chrome above it. For instance, in a web browser, this would be the element that displays the web page. The window for the primary content can be retrieved more conveniently using <a href="/en/DOM/window.content" title="en/DOM/window.content">window.content</a>.</dd>
- <dt><code>content-targetable</code></dt>
- <dd>One browser among many for content. The content that is loaded inside the browser is not allowed to access the chrome above it. This is the preferred value for any <code><code><a href="/en-US/docs/Mozilla/Tech/XUL/browser" title="browser">browser</a></code></code> element in an application, which will use multiple browsers of equal privileges, and is unselected at the moment.</dd>
- <dt><code>chrome</code></dt>
- <dd>(default behaviour): A browser, intended to be used for loading privileged content using a chrome:// URI. Don't use for content from web, as this may cause serious security problems!</dd>
- </dl>
- </dd>
-</dl>
-
-
-</div><p></p>
-<h3 id="Properties" name="Properties">Properties</h3>
-<p></p>
-<p></p><div id="p-accessibleType">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessibleType">accessibleType</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- A value indicating the type of accessibility object for the element.</dd>
-</dl>
-
-<p></p></div> <div id="p-canGoBack">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/canGoBack">canGoBack</a></span></code></dt>
- <dd>
- Type: <em>boolean</em></dd>
- <dd>
- This read-only property is <code>true</code> if there is a page to go back to in the session history and the Back button should be enabled.</dd>
-</dl></div> <div id="p-canGoForward">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/canGoForward">canGoForward</a></span></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>This read-only property is <code>true</code> if there is a page to go forward to in the session history and the Forward button should be enabled.</dd>
-</dl></div> <div id="p-contentDocument">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/contentDocument">contentDocument</a></span></code></dt>
- <dd>
- Type: <em>document</em></dd>
- <dd>
- This read-only property contains the document object in the element.</dd>
-</dl></div> <div id="p-contentPrincipal">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/contentPrincipal">contentPrincipal</a></span></code></dt>
- <dd>Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIPrincipal" title="">nsIPrincipal</a></code></em></dd>
- <dd>This read-only property contains the principal for the content loaded in the browser, which provides security context information.</dd>
-</dl></div> <div id="p-contentTitle">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/contentTitle">contentTitle</a></span></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- This read-only property contains the title of the document object in the browser.</dd>
-</dl></div> <div id="p-contentViewerEdit">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/contentViewerEdit">contentViewerEdit</a></span></code></dt>
- <dd>
- Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIContentViewerEdit" title="">nsIContentViewerEdit</a></code></em></dd>
- <dd>
- This read-only property contains the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIContentViewerEdit" title="">nsIContentViewerEdit</a></code> which handles clipboard operations on the document.</dd>
-</dl></div> <div id="p-contentViewerFile">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/contentViewerFile">contentViewerFile</a></span></code></dt>
- <dd>
- Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIContentViewerFile" title="">nsIContentViewerFile</a></code></em></dd>
- <dd>
- Reference to the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIContentViewerFile" title="">nsIContentViewerFile</a></code> interface for the document.</dd>
-</dl></div> <div id="p-contentWindow">
-<dl> <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/contentWindow">contentWindow</a></span></code></dt> <dd>Type: <em>TODO</em></dd> <dd>Use the contentWindow.wrappedJSObject to obtain a DOM(html) window object</dd>
-</dl></div> <div id="p-currentURI">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/currentURI">currentURI</a></span></code></dt>
- <dd>
- Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIURI" title="">nsIURI</a></code></em></dd>
- <dd>
- This read-only property contains the currently loaded URL. To change the URL, use the <span id="m-loadURI"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/loadURI">loadURI</a></code></span> method.</dd>
-</dl></div> <div id="p-docShell">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/docShell">docShell</a></span></code></dt>
- <dd>
- Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDocShell" title="">nsIDocShell</a></code></em></dd>
- <dd>
- This read-only property contains the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDocShell" title="">nsIDocShell</a></code> object for the document.</dd>
-</dl></div> <div id="p-documentCharsetInfo">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/documentCharsetInfo">documentCharsetInfo</a></span></code> <span class="inlineIndicator obsolete obsoleteInline" title="(Firefox 12.0 / Thunderbird 12.0 / SeaMonkey 2.9)">Obsolete since Gecko 12.0</span></dt>
- <dd>
- Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDocumentCharsetInfo" title="">nsIDocumentCharsetInfo</a></code></em></dd>
- <dd>
- This read-only property contains the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDocumentCharsetInfo" title="">nsIDocumentCharsetInfo</a></code> object for the document which is used to handle which character set should be used to display the document. The properties of the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDocumentCharsetInfo" title="">nsIDocumentCharsetInfo</a></code> object were merged into the docshell in Gecko 12.0 (Firefox 12.0 / Thunderbird 12.0 / SeaMonkey 2.9).</dd>
-</dl></div> <div id="p-homePage">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/homePage">homePage</a></span></code></dt>
- <dd>
- Type: <em>string home page URL</em></dd>
- <dd>
- This property holds the value of the user's home page setting.</dd>
-</dl></div> <div id="p-markupDocumentViewer">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/markupDocumentViewer">markupDocumentViewer</a></span></code></dt>
- <dd>
- 类型: <em><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMarkupDocumentViewer" title="">nsIMarkupDocumentViewer</a></code></em></dd>
- <dd>
- 这个只读的属性包含 <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMarkupDocumentViewer" title="">nsIMarkupDocumentViewer</a></code> 接口,负责document文档的绘制。</dd>
-</dl></div> <div id="p-messageManager">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/messageManager">messageManager</a></span></code> </dt>
- <dd>
- Type: <em>message manager object</em></dd>
- <dd>
- This read-only property returns the <a href="/en/The_message_manager" title="en/The message manager">message manager</a> object for the <code><a href="/en-US/docs/Mozilla/Tech/XUL/browser" title="browser">browser</a></code> element.</dd>
-</dl></div> <div id="p-browser.preferences">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/browser.preferences">preferences</a></span></code></dt>
- <dd>
- 类型: <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIPrefService" title="">nsIPrefService</a></code></dd>
- <dd>
- 这是一个只读属性,其值为一个<code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIPref" title="">nsIPref</a></code>对象,可以用来读取或设置用户的首选项.</dd>
-</dl></div> <div id="p-securityUI">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/securityUI">securityUI</a></span></code></dt>
- <dd>
- Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISecureBrowserUI" title="">nsISecureBrowserUI</a></code></em></dd>
- <dd>
- The read-only property holds an object which may be used to determine the security level of the loaded document.</dd>
-</dl></div> <div id="p-sessionHistory">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/sessionHistory">sessionHistory</a></span></code></dt>
- <dd>
- Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISHistory" title="">nsISHistory</a></code></em></dd>
- <dd>
- This read-only property contains the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISHistory" title="">nsISHistory</a></code> object which holds the session history.</dd>
-</dl></div> <div id="p-webBrowserFind">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/webBrowserFind">webBrowserFind</a></span></code></dt>
- <dd>
- Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIWebBrowserFind" title="">nsIWebBrowserFind</a></code></em></dd>
- <dd>
- This read-only property contains an <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIWebBrowserFind" title="">nsIWebBrowserFind</a></code> object which can be used to search for text in the document.</dd>
-</dl></div> <div id="p-webNavigation">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/webNavigation">webNavigation</a></span></code></dt>
- <dd>
- Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIWebNavigation" title="">nsIWebNavigation</a></code></em></dd>
- <dd>
- This read-only property contains the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIWebNavigation" title="">nsIWebNavigation</a></code> object for the document. Most of its methods are callable directly on the element itself, such as <span id="m-goBack"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/goBack">goBack</a></code></span> and <span id="m-goForward"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/goForward">goForward</a></code></span>. It also contains the load constants used by <span id="m-reloadWithFlags"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/reloadWithFlags">reloadWithFlags</a></code></span> and <span id="m-loadURIWithFlags"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/loadURIWithFlags">loadURIWithFlags</a></code></span>.</dd>
-</dl></div> <div id="p-webProgress">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/webProgress">webProgress</a></span></code></dt>
- <dd>
- Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIWebProgress" title="">nsIWebProgress</a></code></em></dd>
- <dd>
- This read-only property contains an <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIWebProgress" title="">nsIWebProgress</a></code> object which is used to monitor the progress of a document loading.</dd>
-</dl></div><p></p>
-<h3 id="Methods" name="Methods">Methods</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0 0 10px 10px; padding: 0 10px; background: rgb(238, 238, 238); float: right; width: 250px;">
-<tbody>
-<tr>
-<td>
-<p><strong>Inherited Methods</strong><br>
-<small><code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.cloneNode">cloneNode()</a></code>, <a href="/En/DOM/Node.compareDocumentPosition" title="En/DOM/Node.compareDocumentPosition">compareDocumentPosition</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getBoundingClientRect">getBoundingClientRect()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getClientRects">getClientRects()</a></code>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span>, <span id="m-getElementsByAttributeNS"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttributeNS">getElementsByAttributeNS</a></code></span>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByClassName">getElementsByClassName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getFeature">getFeature()</a></code>, <a href="/En/DOM/Node.getUserData" title="En/DOM/Node.getUserData">getUserData</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isDefaultNamespace">isDefaultNamespace()</a></code>, <a href="/En/DOM/Node.isEqualNode" title="En/DOM/Node.isEqualNode">isEqualNode</a>, <a href="/En/DOM/Node.isSameNode" title="En/DOM/Node.isSameNode">isSameNode</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <a href="/En/DOM/Node.lookupNamespaceURI" title="En/DOM/Node.lookupNamespaceURI">lookupNamespaceURI</a>, <a href="/En/DOM/Node.lookupPrefix" title="En/DOM/Node.lookupPrefix">lookupPrefix</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.querySelector">querySelector()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.querySelectorAll">querySelectorAll()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code>, <a href="/En/DOM/Node.setUserData" title="En/DOM/Node.setUserData">setUserData</a></small></p>
-
-</td>
-</tr>
-</tbody>
-</table><p></p>
-<p></p><dl>
- <dt>
- <span id="m-addProgressListener"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/addProgressListener">addProgressListener( listener )</a></code></span></dt>
- <dd>
- Return type: <em>no return value</em></dd>
- <dd>
- Add a progress listener to the browser which will monitor loaded documents. The progress listener should implement the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIWebProgressListener" title="">nsIWebProgressListener</a></code> interface.</dd>
-</dl> <dl>
- <dt><span id="m-goBack"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/goBack">goBack()</a></code></span></dt>
- <dd>Return type: <em>no return value</em></dd>
- <dd>Go back one page in the history.</dd>
-</dl> <dl>
- <dt><span id="m-goForward"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/goForward">goForward()</a></code></span></dt>
- <dd>Return type: <em>no return value</em></dd>
- <dd>Go forward one page in the history.</dd>
-</dl> <dl>
- <dt><span id="m-goHome"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/goHome">goHome()</a></code></span></dt>
- <dd>Return type: <em>no return value</em></dd>
- <dd>Load the user's home page into the browser.</dd>
-</dl> <dl>
- <dt><span id="m-gotoIndex"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/gotoIndex">gotoIndex( index )</a></code></span></dt>
- <dd>Return type: <em>no return value</em></dd>
- <dd>Navigate to the page in the history with the given index. Use a positive number to go forward and a negative number to go back.</dd>
-</dl> <p><span class="comment">NOTE: This is the XUL method on &lt;browser&gt; / &lt;tabbrowser&gt;, not the global function in <a class="external" rel="freelink">chrome://browser/content/browser.js</a>. Please check which one you're documenting! (This one has no post data parameter, see loadURIWithFlags for a version that does)</span></p>
-<dl>
- <dt>
- <span id="m-loadURI"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/loadURI">loadURI( uri, referrer, charset )</a></code></span></dt>
- <dd>
- Return type: <em>no return value</em></dd>
- <dd>
- Load a URL into the document, with the given referrer and character set.</dd>
- <dd>
- The first argument should be a string, not a <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIURI" title="">nsIURI</a></code> object. To get a string from an <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIURI" title="">nsIURI</a></code>, use <code>nsIURI.spec</code> or <code>nsIURI.asciiSpec</code></dd>
-</dl> <dl>
- <dt><span id="m-loadURIWithFlags"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/loadURIWithFlags">loadURIWithFlags( uri, flags, referrer, charset, postData )</a></code></span></dt>
- <dd>Return type: <em>no return value</em></dd>
- <dd>Load a URL into the document, with the specified load flags, the given referrer, character set, and POST data. In addition to the flags allowed for the <span id="m-reloadWithFlags"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/reloadWithFlags">reloadWithFlags</a></code></span> method, the following flags are also valid:
- <ul>
- <li><code>LOAD_FLAGS_IS_REFRESH</code>: This flag is used when the URL is loaded because of a meta tag refresh or redirect.</li>
- <li><code>LOAD_FLAGS_IS_LINK</code>: This flag is used when the URL is loaded because a user clicked on a link. The HTTP Referer header is set accordingly.</li>
- <li><code>LOAD_FLAGS_BYPASS_HISTORY</code>: Do not add the URL to the session history.</li>
- <li><code>LOAD_FLAGS_REPLACE_HISTORY</code>: Replace the current URL in the session history with a new one. This flag might be used for a redirect.</li>
- </ul>
- </dd>
-</dl>
-
-<p>(See <code><a href="https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIWebNavigation#loadURI()">nsIWebNavigation.loadURI()</a></code> for details on the <code>referrer</code> and <code>postData</code> parameters.)</p> <dl>
- <dt><span id="m-reload"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/reload">reload()</a></code></span></dt>
- <dd>Return type: <em>no return value</em></dd>
- <dd>Reloads the document in the <code><a href="/en-US/docs/Mozilla/Tech/XUL/browser" title="browser">browser</a></code> element on which you call this method.</dd>
-</dl> <dl>
- <dt><span id="m-reloadWithFlags"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/reloadWithFlags">reloadWithFlags( flags )</a></code></span></dt>
- <dd>Return type: <em>no return value</em></dd>
- <dd>Reloads the document in the browser with the given load flags. The flags listed below may be used, which are all constants of the <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/webNavigation">webNavigation</a></span></code> property (or the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIWebNavigation" title="">nsIWebNavigation</a></code> interface). You may combine flags using a or symbol ( <code>|</code> ).
- <ul>
- <li><code>LOAD_FLAGS_NONE</code>: No special flags. The document is loaded normally.</li>
- <li><code>LOAD_FLAGS_BYPASS_CACHE</code>: Reload the page, ignoring if it is already in the cache. This is the flag used when the reload button is pressed while the Shift key is held down.</li>
- <li><code>LOAD_FLAGS_BYPASS_PROXY</code>: Reload the page, ignoring the proxy server.</li>
- <li><code>LOAD_FLAGS_CHARSET_CHANGE</code>: This flag is used if the document needs to be reloaded because the character set changed.</li>
- </ul>
- </dd>
-</dl> <dl>
- <dt><span id="m-removeProgressListener"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/removeProgressListener">removeProgressListener( listener )</a></code></span></dt>
- <dd>Return type: <em>no return value</em></dd>
- <dd>Remove a <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIWebProgressListener" title="">nsIWebProgressListener</a></code> from the browser.</dd>
-</dl> <dl>
- <dt>
- <span id="m-stop"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/stop">stop()</a></code></span></dt>
- <dd>
- 返回值: 无返回值</dd>
- <dd>
- 效果等同于按下了停止按钮,停止当前页面中文档的加载.</dd>
-</dl> <dl>
- <dt>
- <span id="m-swapDocShells"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/swapDocShells">swapDocShells( otherBrowser )</a></code></span></dt>
- <dd>
- Return type: <em>no return value</em></dd>
- <dd>
- Swaps the content, history and current state of this <code><a href="/en-US/docs/Mozilla/Tech/XUL/browser" title="browser">browser</a></code> with another browser. During the swap, pagehide and pageshow events are fired on both browsers. This method can be used to move browser between windows or tear off a browser into a new window.</dd>
-</dl>
-
-<div class="note">
-<p><strong>Note:</strong> Both browsers must be either standalone browsers or embedded in a <a href="/en-US/docs/XUL/tabbrowser"><code>tabbrowser</code></a>. You can't mix them.</p></div><p></p>
-<h3 id="Related" name="Related">Related</h3>
-<dl>
- <dt>
- Interfaces</dt>
- <dd>
- <a href="/en/XPCOM_Interface_Reference/nsIAccessibleProvider" title="en/nsIAccessibleProvider">nsIAccessibleProvider</a></dd>
-</dl>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/button/index.html b/files/zh-cn/mozilla/tech/xul/button/index.html
deleted file mode 100644
index a3bcf45284..0000000000
--- a/files/zh-cn/mozilla/tech/xul/button/index.html
+++ /dev/null
@@ -1,528 +0,0 @@
----
-title: button
-slug: Mozilla/Tech/XUL/button
-tags:
- - XUL Elements
- - XUL Reference
-translation_of: Archive/Mozilla/XUL/button
----
-<div class="noinclude"><span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-
-<p>按钮就是可以点击的东西。事件处理程序可以用来捕获鼠标、键盘和其他事件。它通常呈现为一个灰色开始长方形。您可以指定按钮的<code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code> 属性来将按钮的文字设置好,或者直接写在标签中间也行。</p>
-
-<p>更多信息请参阅 <a href="cn/XUL_Tutorial/Adding_Buttons">XUL tutorial</a>.</p>
-
-<dl>
- <dt>Attributes</dt>
- <dd><a href="#a-accesskey">accesskey</a>, <a href="#a-autocheck">autocheck</a>, <a href="#a-checkState">checkState</a>, <a href="#a-checked">checked</a>, <a href="#a-command">command</a>, <a href="#a-crop">crop</a>, <a href="#a-dir">dir</a>, <a href="#a-disabled">disabled</a>, <a href="#a-dlgtype">dlgtype</a>, <a href="#a-group">group</a>, <a href="#a-icon">icon</a>, <a href="#a-image">image</a>, <a href="#a-label">label</a>, <a href="#a-open">open</a>, <a href="#a-orient">orient</a>, <a href="#a-tabindex">tabindex</a>, <a href="#a-button.type">type</a></dd>
-</dl>
-
-<dl>
- <dt>Properties</dt>
- <dd><a href="#p-accessKey">accessKey</a>, <a href="#p-accessibleType">accessibleType</a>, <a href="#p-autoCheck">autoCheck</a>, <a href="#p-checkState">checkState</a>, <a href="#p-checked">checked</a>, <a href="#p-command">command</a>, <a href="#p-crop">crop</a>, <a href="#p-dir">dir</a>, <a href="#p-disabled">disabled</a>, <a href="#p-dlgType">dlgType</a>, <a href="#p-group">group</a>, <a href="#p-image">image</a>, <a href="#p-label">label</a>, <a href="#p-open">open</a>, <a href="#p-orient">orient</a>, <a href="#p-tabIndex">tabIndex</a>, <a href="#p-type">type</a></dd>
-</dl>
-
-<h3 id="Examples" name="Examples">Examples</h3>
-
-<div class="float-right"><img alt="Image:XUL_ref_button.png"></div>
-
-<pre class="eval">&lt;button label="Press Me"
- oncommand="alert('You pressed me!');"/&gt;
-</pre>
-
-<h3 id="Attributes" name="Attributes">Attributes</h3>
-
-<p> </p><div id="a-accesskey">
-
-
-
-
-<dl>
- <dt><code id="a-accesskey"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/accesskey">accesskey</a></code></dt>
- <dd>类型:
- <i>character【字符】</i>
- </dd>
- <dd>本属性允许为控件(元素)设定一个字符作为快捷键,这个字符应该是 <code><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></code> 属性文本中的一个字符。该字符将会被加下划线以重点强调,平台和主体的变换并不影响这一表现行为。 当用户点击 ALT (在其他平台上具有类似功能的键) 和这个字符对应的按键时, 控件(元素)将立刻被从窗口中的某处激活或/并且获得焦点 <b>。虽说字符不分大小写,但是当label中存在大写字符和小写字符时,快捷键的字符将首先选择与之完全匹配的那一个,如果label中存在两个或更多的与accesskey字符相同的字符,其中的第一个字符将被加下划线。</b></dd>
- <dt>      *(有些键在监听按键事件时,分别对应event.ctrlKey和event.metaKey。)</dt>
-</dl>
-
-<p> </p>
-
-<h4 id="Example" name="Example">Example</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_accesskey_attr.png"></div>
-
-<pre>&lt;vbox&gt;
- &lt;label value="Enter Name" accesskey="e" control="myName"/&gt;
- &lt;textbox id="myName"/&gt;
- &lt;button label="Cancel" accesskey="n"/&gt;
- &lt;button label="Ok" accesskey="O"/&gt;
-&lt;/vbox&gt;
-</pre>
-
-<h4 id="See_also" name="See_also">See also</h4>
-
-<p><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code> attribute, <code id="a-acceltext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/acceltext">acceltext</a></code> attribute</p>
-
-<p></p>
-</div> <div id="a-autoCheck">
-
-
-<dl>
- <dt><code id="a-autocheck"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/autocheck">autocheck</a></code></dt>
- <dd>类型:
- <i>boolean</i>
- </dd>
- <dd>如果此属性为 <code>true</code>,或空白, 每次点击按钮时,此按钮的状态检查都会被执行一次。如果此属性为<code>false</code>, 检查会手动的被拒绝。当autocheck值为true的时候,按钮将会变为多选框或者单选框。</dd>
-</dl>
-
-
-
-<p></p>
-</div> <div id="a-checkState">
-
-
-<dl>
- <dt><code id="a-checkState"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/checkState">checkState</a></code></dt>
- <dd>Type: <em>integer</em>, values <code>0</code>, <code>1</code>, or <code>2</code></dd>
- <dd>This attribute may be used to create three state buttons, numbered 0, 1 and 2. When in state 0 or 1, pressing the button will switch to the opposite state. When in state 2, pressing the button will switch to state 0. This means that the button acts like a checkbox except that there is a third state which must be set manually by adjusting the check state. If you wish to have different behavior for how the states are adjusted, set the <code id="a-autoCheck"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/autoCheck">autoCheck</a></code> attribute to <code>false</code> and adjust the state with a script. The <code id="a-type"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/type">type</a></code> attribute must be set to <code>checkbox</code> for buttons with a check state. Constants for the possible values for this attribute are in the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMXULButtonElement" title="">nsIDOMXULButtonElement</a></code> interface.</dd>
-</dl>
-</div> <div id="a-checked">
-
-<dl>
- <dt>
- <code id="a-checked"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/checked">checked</a></code></dt>
- <dd>
- Type:
- <i>
- boolean</i>
- </dd>
- <dd>
- Indicates whether the element is checked or not.</dd>
- <dd>
- Use <code>hasAttribute()</code> to determine whether this attribute is set instead of <code>getAttribute()</code>.</dd>
- <dd>
- For buttons, the <code>type</code> attribute must be set to <code>checkbox</code> or <code>radio</code> for this attribute to have any effect.&lt;magic name="\"PAGENAME\"/"&gt;&lt;/magic&gt;</dd>
-</dl>
-</div> <div id="a-command">
-
-<dl>
- <dt>
- <code id="a-command"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/command">command</a></code></dt>
- <dd>
- Type:
- <i>
- element id</i>
- </dd>
- <dd>
- Set to the <code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code> of a <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/command" title="command">command</a></code> element that is being observed by the element.</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-crop">
-
-<dl>
- <dt>
- <code id="a-crop"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/crop">crop</a></code></dt>
- <dd>
- Type:
- <i>
- one of the values below</i>
- </dd>
- <dd>
- If the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the <code>crop</code> attribute. An ellipsis will be used in place of the cropped text. If the box direction is reversed, the cropping is reversed.</dd>
-</dl>
-<ul>
- <li><code>start</code>: The text will be cropped on its left side.</li>
- <li><code>end</code>: The text will be cropped on its right side.</li>
- <li><code>left</code>: <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> The text will be cropped on its left side.</li>
- <li><code>right</code>: <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> The text will be cropped on its right side.</li>
- <li><code>center</code>: The text will be cropped in the middle, showing both the start and end of the text normally.</li>
- <li><code>none</code>: The text will be not be cropped using an ellipsis. However, the text will simply be cut off if it is too large. The side depends on the CSS text alignment.</li>
-</ul>
-
-<p></p>
-</div> <div id="a-dir">
-
-<dl>
- <dt>
- <code id="a-dir"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/dir">dir</a></code></dt>
- <dd>
- Type:
- <i>
- one of the values below</i>
- </dd>
- <dd>
- The direction in which the child elements of the element are placed.</dd>
-</dl>
-<dl>
- <dt>
- <code>normal</code></dt>
- <dd>
- For scales, the scale's values are ordered from left to right (for horizontal scales) or from top to bottom (for vertical scales)  For other elements, the elements are placed left to right or top to bottom in the order they appear in the XUL code</dd>
- <dt>
- <code>reverse</code></dt>
- <dd>
- For scales, the scale's values are ordered from right to left (for horizontal scales) or from bottom to top (for vertical scales). For other elements, they are placed right to left or bottom to top. This is reverse of the order in which they appear in the XUL code.</dd>
-</dl>
-<ul>
-</ul>
-
-<p> </p>
-</div> <div id="a-disabled">
-
-
-<dl>
- <dt><code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code></dt>
- <dd> </dd>
- <dd>
- <h5 id="类型boolean">类型:<em>boolean</em></h5>
- </dd>
- <dd>
- <h5 id="表示元素是被禁用的。">表示元素是被禁用的。</h5>
-
- <p>如果这个元素的disabled属性被设置为true,表示元素被禁用,被禁用的属性在页面上通常会显示灰色文本,它无法响应用户的操作,它也无法得到光标。</p>
-
- <p>然而,这个元素仍然能够响应鼠标事件,如果要启用这个元素,把disabled设置为false</p>
- </dd>
-</dl>
-
-<h4 id="示例:">示例:</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_attr_disabled.png" src="https://mdn.mozillademos.org/files/1742/XUL_ref_attr_disabled.png"></div>
-
-<pre><code>// Disabling an element
-document.getElementById('buttonRemove').setAttribute("disabled", "true");
-
-// Enabling back an element by removing the "disabled" attribute
-document.getElementById('buttonRemove').removeAttribute("disabled");</code></pre>
-
-<p></p><div class="blockIndicator standardNote">
- <p><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Firefox/Releases/3.5">Firefox 3.5 note</a></p>
- <p style="font-weight: 400;">For <a href="https://developer.mozilla.org/en-US/docs/XUL/keyset" title="en/XUL/Keyset"><code>keyset</code></a> elements, support for this attribute was added in Firefox 3.5.</p>
-</div><p></p>
-</div> <div id="a-dlgtype">
-
-
-<dl>
- <dt><code id="a-dlgtype"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/dlgtype">dlgtype</a></code></dt>
- <dd>Type: <em>one of the values below</em></dd>
- <dd>The dialog type of the button, used only when the button is in a dialog box. You can use this feature to replace the standard dialog box buttons with custom buttons, yet the dialog event methods will still function. For example, if the <code>dlgType</code> is set to <code>accept</code>, the button will replace the dialog box's accept button, which is usually labeled <code>OK</code>. Using this attribute on a button that is not in a dialog box has no effect. The following values can be used as the dialog type:</dd>
- <dd>
- <dl>
- <dt><code>accept</code></dt>
- <dd>The OK button, which will accept the changes when pressed.</dd>
- <dt><code>cancel</code></dt>
- <dd>The cancel button which will cancel the operation.</dd>
- <dt><code>help</code></dt>
- <dd>A help button for displaying help about the dialog.</dd>
- <dt><code>disclosure</code></dt>
- <dd>A button to show more information. This might be a button or a disclosure triangle.</dd>
- <dt><code>extra1</code></dt>
- <dd>An optional additional button.</dd>
- <dt><code>extra2</code></dt>
- <dd>A second optional additional button.</dd>
- </dl>
- </dd>
-</dl>
-</div> <div id="a-group">
-
-
-<dl>
- <dt><code id="a-group"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/group">group</a></code></dt>
- <dd>Type: <em>string group name</em> </dd>
- <dd>Buttons with type="radio" and the same value for their group attribute are put into the same group. Only one button from each group can be checked at a time. If the user selects one the buttons, the others in the group are unchecked.</dd>
-</dl>
-</div> <div id="a-icon">
-
-
-<dl>
- <dt><code id="a-icon"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/icon">icon</a></code></dt>
- <dd><strong><span class="highlightgreen">Mozilla 1.8</span></strong></dd>
- <dd>Type: <em>string</em></dd>
- <dd>This attribute should be used to set the usage for common buttons. Some platforms display these buttons with a small icon indicating their usage. This should be used in place of the <code id="a-image"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/image">image</a></code> attribute. Possible values include: <code>accept</code>, <code>cancel</code>, <code>help</code>, <code>open</code>, <code>save</code>, <code>find</code>, <code>clear</code>, <code>yes</code>, <code>no</code>, <code>apply</code>, <code>close</code>, <code>print</code>, <code>add</code>, <code>remove</code>, <code>refresh</code>, <code>go-forward</code>, <code>go-back</code>, <code>properties</code>, <code>select-font</code>, <code>select-color</code>, <code>network</code>. If you are using a button that matches one of these common usages, use the <code>icon</code> attribute to indicate this. See <a href="/en/XUL/button#pageFiles" title="https://developer.mozilla.org/en/XUL/button#pageFiles">the appearance of the different icons on some available platforms</a>.</dd>
-</dl>
-</div> <div id="a-image">
-
-<dl>
- <dt>
- <code id="a-image"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/image">image</a></code></dt>
- <dd>
- Type:
- <i>
- image URL</i>
- </dd>
- <dd>
- The URL of the image to appear on the element. If this attribute is empty or left out, no image appears. The position of the image is determined by the <code id="a-dir"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/dir">dir</a></code> and <code id="a-orient"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/orient">orient</a></code> attributes.</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-label">
-
-<dl>
- <dt>
- <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- The label that will appear on the element. If this is left out, no text appears.<br>
- label 在元素上显示。如果左侧出界,则不显示任何文字。</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-open">
-
-
-<dl>
- <dt><code id="a-open"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/open">open</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>For the <code>menu</code> <code id="a-type"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/type">type</a></code> buttons, the <code>open</code> attribute is set to <code>true</code> when the menu is open. The <code>open</code> attribute is not present if the menu is closed.</dd>
-</dl>
-</div> <div id="a-orient">
-<p><strong>布局(orient)</strong></p>
-<dl>
- <dd>
- 值类型:可以是下面值中的一种。<br>
- 指定了子控件的布局(orient)为水平分布的(horizontally)或者是垂直分布的(vertically)。默认值依赖于控件本身。你也可以使用<a href="cn/-moz-box-orient">-moz-box-orient</a>中的样式属性。
- <ul>
- <li><strong>horizontally</strong>: 子控件会被按照在xul源文件中出现的位置依次布置在一行中。</li>
- <li><strong>vertically</strong>: 子控件会被按照在xul源文件中出现的位置依次布置在一列中。</li>
- </ul>
- </dd>
-</dl>
-</div> <div id="a-tabindex">
-
-
-<dl>
- <dt><code id="a-tabindex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tabindex">tabindex</a></code></dt>
- <dd>Type:<em>integer</em></dd>
- <dd>当用户按下 "<kbd>tab</kbd>" 键时焦点移动到元素上的顺序。<code>tabindex</code> 数字越大,顺序越靠后。</dd>
-</dl>
-
-
-
-<p></p>
-</div> <div id="a-button.type">
-
-
-<dl>
- <dt><code id="a-button.type"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/button.type">type</a></code></dt>
- <dd>Type: <em>one of the values below</em></dd>
- <dd>The type of button. If this attribute is not present, a normal button is created. Leave the attribute out for a normal button.</dd>
- <dd>
- <dl>
- <dt><code>checkbox</code></dt>
- <dd>This type of button can be in two states. The user can click the button to switch between the states. This is not the same as a checkbox because it looks like a button.</dd>
- <dt><code>menu</code></dt>
- <dd>Set the <code>type</code> attribute to the value <code>menu</code> to create a button with a menu popup. Place a <code><a href="/en-US/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code> element inside the button in this case. The user may click anywhere on the button to open and close the menu.</dd>
- <dt><code>menu-button</code></dt>
- <dd>You can also use the value <code>menu-button</code> to create a button with a menu. Unlike the <code>menu</code> type, this type requires the user to press the arrow to open the menu, but a different command may be invoked when the main part of the button is pressed.</dd>
- <dt><code>panel</code></dt>
- <dd>Similar to the <code>menu</code> type, this opens a popup. Place a <code><a href="/en-US/docs/Mozilla/Tech/XUL/panel" title="panel">panel</a></code> element inside the button. <code><a href="/en-US/docs/Mozilla/Tech/XUL/panel" title="panel">panel</a></code> elements are popups that support any type of content.</dd>
- <dt><code>radio</code></dt>
- <dd>The button acts like a radio button. Only one button in the group can be on a once.</dd>
- <dt><code>repeat</code></dt>
- <dd>This button will fire its command event repeatedly while the mouse button is held down. </dd>
- </dl>
- </dd>
-</dl>
-</div><p></p>
-
-<h3 id="Properties" name="Properties">Properties</h3>
-
-<p> </p><div id="p-accessKey">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessKey">accessKey</a></span></code></dt>
- <dd>
- Type:
- <i>
- character</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-accesskey"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/accesskey">accesskey</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-accessibleType">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessibleType">accessibleType</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- A value indicating the type of accessibility object for the element.</dd>
-</dl>
-
-<p></p></div> <div id="p-autoCheck">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/autoCheck">autoCheck</a></span></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>Gets and sets the value of the <code id="a-autoCheck"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/autoCheck">autoCheck</a></code> attribute.</dd>
-</dl></div> <div id="p-checkState">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/checkState">checkState</a></span></code></dt>
- <dd>
- Type: <em>integer</em>, values <code>0</code>, <code>1</code>, or <code>2</code></dd>
- <dd>
- Gets and sets the value of the <code id="a-checkState"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/checkState">checkState</a></code> attribute.</dd>
-</dl></div> <div id="p-checked">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/checked">checked</a></span></code></dt>
- <dd>
- Type: <em>boolean</em></dd>
- <dd>
- Gets and sets the value of the <code id="a-checked"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/checked">checked</a></code> attribute.</dd>
-</dl></div> <div id="p-command">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/command">command</a></span></code></dt>
- <dd>
- Type:
- <i>
- element id</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-command"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/command">command</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-crop">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/crop">crop</a></span></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-crop"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/crop">crop</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-dir">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/dir">dir</a></span></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- Gets and sets the value of the <code id="a-dir"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/dir">dir</a></code> attribute.</dd>
-</dl></div> <div id="p-disabled">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/disabled">disabled</a></span></code></dt>
- <dd>
- Type:
- <i>
- boolean</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-dlgType">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/dlgType">dlgType</a></span></code></dt>
- <dd>Type: <em>string</em></dd>
- <dd>Gets and sets the value of the <code id="a-dlgType"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/dlgType">dlgType</a></code> attribute.</dd>
-</dl></div> <div id="p-group">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/group">group</a></span></code></dt>
- <dd>Type: <em>string group name</em></dd>
- <dd>Gets and sets the value of the <code id="a-group"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/group">group</a></code> attribute.</dd>
-</dl></div> <div id="p-image">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/image">image</a></span></code></dt>
- <dd>
- Type:
- <i>
- image URL</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-image"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/image">image</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-label">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/label">label</a></span></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-open">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/open">open</a></span></code></dt>
- <dd>
- Type: <em>boolean</em></dd>
- <dd>
- Gets and sets the value of the <code id="a-open"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/open">open</a></code> attribute.</dd>
-</dl>
-</div> <div id="p-orient">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/orient">orient</a></span></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- Gets and sets the value of the <code id="a-orient"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/orient">orient</a></code> attribute.</dd>
-</dl></div> <div id="p-tabIndex">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tabIndex">tabIndex</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-tabindex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tabindex">tabindex</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-type">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/type">type</a></span></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- Gets and sets the value of the <code id="a-type"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/type">type</a></code> attribute.</dd>
-</dl>
-</div><p></p>
-
-<h3 id="Methods" name="Methods">Methods</h3>
-
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited from XUL element</strong><br> <small> <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span></small></p> <p><strong>Inherited from DOM element</strong><br> <small> <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-
-<h3 id="Related" name="Related">Related</h3>
-
-<dl>
- <dt>Interfaces</dt>
- <dd><a href="cn/NsIAccessibleProvider">nsIAccessibleProvider</a>, <a href="cn/NsIDOMXULButtonElement">nsIDOMXULButtonElement</a></dd>
-</dl>
-
-<div class="noinclude"> </div>
-
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/checkbox/index.html b/files/zh-cn/mozilla/tech/xul/checkbox/index.html
deleted file mode 100644
index ea2eef19ba..0000000000
--- a/files/zh-cn/mozilla/tech/xul/checkbox/index.html
+++ /dev/null
@@ -1,329 +0,0 @@
----
-title: checkbox
-slug: Mozilla/Tech/XUL/checkbox
-tags:
- - 中文
-translation_of: Archive/Mozilla/XUL/checkbox
----
-<div class="noinclude"><span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-
-<p>An element that can be turned on and off. This is most commonly rendered as a box when the element is off and a box with a check when the element is on. The user can switch the state of the check box by selecting it with the mouse. A label, specified with the <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code> attribute, may be added beside the check box.</p>
-
-<p>More information is available in the <a href="/en/XUL_Tutorial/Input_Controls" title="en/XUL_Tutorial/Input_Controls">XUL tutorial</a>.</p>
-
-<dl>
- <dt>Attributes</dt>
- <dd><a href="#a-accesskey">accesskey</a>, <a href="#a-checked">checked</a>, <a href="#a-command">command</a>, <a href="#a-crop">crop</a>, <a href="#a-disabled">disabled</a>, <a href="#a-checkbox.src">src</a>, <a href="#a-label">label</a>, <a href="#a-preference">preference</a>, <a href="#a-tabindex">tabindex</a></dd>
-</dl>
-
-<dl>
- <dt>Properties</dt>
- <dd><a href="#p-accessKey">accessKey</a>, <a href="#p-accessibleType">accessibleType</a>, <a href="#p-checked">checked</a>, <a href="#p-command">command</a>, <a href="#p-crop">crop</a>, <a href="#p-disabled">disabled</a>, <a href="#p-src">src</a>, <a href="#p-label">label</a>, <a href="#p-tabIndex">tabIndex</a></dd>
-</dl>
-
-<h3 id="Examples" name="Examples">Examples</h3>
-
-<div class="float-right"><img alt="Image:XUL_ref_checkbox.png" class="internal" src="/@api/deki/files/451/=XUL_ref_checkbox.png"></div>
-
-<pre class="eval">&lt;checkbox label="Enable JavaScript" checked="true"/&gt;
-&lt;checkbox label="Enable Java" checked="false"/&gt;
-</pre>
-
-<h3 id="Attributes" name="Attributes">Attributes</h3>
-
-<p></p>
-
-<p></p><div id="a-accesskey">
-
-
-
-
-<dl>
- <dt><code id="a-accesskey"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/accesskey">accesskey</a></code></dt>
- <dd>类型:
- <i>character【字符】</i>
- </dd>
- <dd>本属性允许为控件(元素)设定一个字符作为快捷键,这个字符应该是 <code><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></code> 属性文本中的一个字符。该字符将会被加下划线以重点强调,平台和主体的变换并不影响这一表现行为。 当用户点击 ALT (在其他平台上具有类似功能的键) 和这个字符对应的按键时, 控件(元素)将立刻被从窗口中的某处激活或/并且获得焦点 <b>。虽说字符不分大小写,但是当label中存在大写字符和小写字符时,快捷键的字符将首先选择与之完全匹配的那一个,如果label中存在两个或更多的与accesskey字符相同的字符,其中的第一个字符将被加下划线。</b></dd>
- <dt>      *(有些键在监听按键事件时,分别对应event.ctrlKey和event.metaKey。)</dt>
-</dl>
-
-<p> </p>
-
-<h4 id="Example" name="Example">Example</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_accesskey_attr.png"></div>
-
-<pre>&lt;vbox&gt;
- &lt;label value="Enter Name" accesskey="e" control="myName"/&gt;
- &lt;textbox id="myName"/&gt;
- &lt;button label="Cancel" accesskey="n"/&gt;
- &lt;button label="Ok" accesskey="O"/&gt;
-&lt;/vbox&gt;
-</pre>
-
-<h4 id="See_also" name="See_also">See also</h4>
-
-<p><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code> attribute, <code id="a-acceltext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/acceltext">acceltext</a></code> attribute</p>
-
-<p></p>
-</div> <div id="a-checked">
-
-<dl>
- <dt>
- <code id="a-checked"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/checked">checked</a></code></dt>
- <dd>
- Type:
- <i>
- boolean</i>
- </dd>
- <dd>
- Indicates whether the element is checked or not.</dd>
- <dd>
- Use <code>hasAttribute()</code> to determine whether this attribute is set instead of <code>getAttribute()</code>.</dd>
- <dd>
- For buttons, the <code>type</code> attribute must be set to <code>checkbox</code> or <code>radio</code> for this attribute to have any effect.&lt;magic name="\"PAGENAME\"/"&gt;&lt;/magic&gt;</dd>
-</dl>
-</div> <div id="a-command">
-
-<dl>
- <dt>
- <code id="a-command"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/command">command</a></code></dt>
- <dd>
- Type:
- <i>
- element id</i>
- </dd>
- <dd>
- Set to the <code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code> of a <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/command" title="command">command</a></code> element that is being observed by the element.</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-crop">
-
-<dl>
- <dt>
- <code id="a-crop"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/crop">crop</a></code></dt>
- <dd>
- Type:
- <i>
- one of the values below</i>
- </dd>
- <dd>
- If the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the <code>crop</code> attribute. An ellipsis will be used in place of the cropped text. If the box direction is reversed, the cropping is reversed.</dd>
-</dl>
-<ul>
- <li><code>start</code>: The text will be cropped on its left side.</li>
- <li><code>end</code>: The text will be cropped on its right side.</li>
- <li><code>left</code>: <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> The text will be cropped on its left side.</li>
- <li><code>right</code>: <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> The text will be cropped on its right side.</li>
- <li><code>center</code>: The text will be cropped in the middle, showing both the start and end of the text normally.</li>
- <li><code>none</code>: The text will be not be cropped using an ellipsis. However, the text will simply be cut off if it is too large. The side depends on the CSS text alignment.</li>
-</ul>
-
-<p></p>
-</div> <div id="a-disabled">
-
-
-<dl>
- <dt><code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code></dt>
- <dd> </dd>
- <dd>
- <h5 id="类型boolean">类型:<em>boolean</em></h5>
- </dd>
- <dd>
- <h5 id="表示元素是被禁用的。">表示元素是被禁用的。</h5>
-
- <p>如果这个元素的disabled属性被设置为true,表示元素被禁用,被禁用的属性在页面上通常会显示灰色文本,它无法响应用户的操作,它也无法得到光标。</p>
-
- <p>然而,这个元素仍然能够响应鼠标事件,如果要启用这个元素,把disabled设置为false</p>
- </dd>
-</dl>
-
-<h4 id="示例:">示例:</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_attr_disabled.png" src="https://mdn.mozillademos.org/files/1742/XUL_ref_attr_disabled.png"></div>
-
-<pre><code>// Disabling an element
-document.getElementById('buttonRemove').setAttribute("disabled", "true");
-
-// Enabling back an element by removing the "disabled" attribute
-document.getElementById('buttonRemove').removeAttribute("disabled");</code></pre>
-
-<p></p><div class="blockIndicator standardNote">
- <p><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Firefox/Releases/3.5">Firefox 3.5 note</a></p>
- <p style="font-weight: 400;">For <a href="https://developer.mozilla.org/en-US/docs/XUL/keyset" title="en/XUL/Keyset"><code>keyset</code></a> elements, support for this attribute was added in Firefox 3.5.</p>
-</div><p></p>
-</div> <div id="a-checkbox.src">
-
-
-<dl>
- <dt><code id="a-checkbox.src"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/checkbox.src">src</a></code></dt>
- <dd>Type: <em>URI</em></dd>
- <dd>Set this to an URI pointing to an image to appear in the checkbox. If this attribute is left out, no image appears. You can have both an image and a label.</dd>
-</dl>
-
-
-</div> <div id="a-label">
-
-<dl>
- <dt>
- <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- The label that will appear on the element. If this is left out, no text appears.<br>
- label 在元素上显示。如果左侧出界,则不显示任何文字。</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-preference">
-
-
-<dl>
- <dt><code id="a-preference"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/preference">preference</a></code></dt>
- <dd>Type: <em>id</em></dd>
- <dd>Connects the element to a corresponding <code><a href="/en-US/docs/Mozilla/Tech/XUL/preference" title="preference">preference</a></code>. This attribute only has any effect when used inside a <code><a href="/en-US/docs/Mozilla/Tech/XUL/prefwindow" title="prefwindow">prefwindow</a></code>. More information is available in the <a href="../../../../en/Preferences_System" rel="internal">Preferences System</a> article.</dd>
-</dl>
-</div> <div id="a-tabindex">
-
-
-<dl>
- <dt><code id="a-tabindex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tabindex">tabindex</a></code></dt>
- <dd>Type:<em>integer</em></dd>
- <dd>当用户按下 "<kbd>tab</kbd>" 键时焦点移动到元素上的顺序。<code>tabindex</code> 数字越大,顺序越靠后。</dd>
-</dl>
-
-
-
-<p></p>
-</div><p></p>
-
-<h3 id="Properties" name="Properties">Properties</h3>
-
-<p></p>
-
-<p></p><div id="p-accessKey">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessKey">accessKey</a></span></code></dt>
- <dd>
- Type:
- <i>
- character</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-accesskey"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/accesskey">accesskey</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-accessibleType">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessibleType">accessibleType</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- A value indicating the type of accessibility object for the element.</dd>
-</dl>
-
-<p></p></div> <div id="p-checked">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/checked">checked</a></span></code></dt>
- <dd>
- Type: <em>boolean</em></dd>
- <dd>
- Gets and sets the value of the <code id="a-checked"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/checked">checked</a></code> attribute.</dd>
-</dl></div> <div id="p-command">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/command">command</a></span></code></dt>
- <dd>
- Type:
- <i>
- element id</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-command"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/command">command</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-crop">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/crop">crop</a></span></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-crop"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/crop">crop</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-disabled">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/disabled">disabled</a></span></code></dt>
- <dd>
- Type:
- <i>
- boolean</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-src">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/src">src</a></span></code></dt>
- <dd>Type: <em>URL</em></dd>
- <dd>Gets and sets the value of the <code id="a-src"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/src">src</a></code> attribute.</dd>
-</dl></div> <div id="p-label">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/label">label</a></span></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-tabIndex">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tabIndex">tabIndex</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-tabindex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tabindex">tabindex</a></code> attribute.</dd>
-</dl>
-
-<p></p></div><p></p>
-
-<h3 id="Methods" name="Methods">Methods</h3>
-
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited from XUL element</strong><br> <small> <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span></small></p> <p><strong>Inherited from DOM element</strong><br> <small> <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-
-<h3 id="Related" name="Related">Related</h3>
-
-<dl>
- <dt>Interfaces</dt>
- <dd><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIAccessibleProvider" title="">nsIAccessibleProvider</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMXULCheckboxElement" title="">nsIDOMXULCheckboxElement</a></code></dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/command/index.html b/files/zh-cn/mozilla/tech/xul/command/index.html
deleted file mode 100644
index 7a9a8916f9..0000000000
--- a/files/zh-cn/mozilla/tech/xul/command/index.html
+++ /dev/null
@@ -1,105 +0,0 @@
----
-title: command
-slug: Mozilla/Tech/XUL/command
-tags:
- - XUL Elements
- - XUL Reference
-translation_of: Archive/Mozilla/XUL/command
----
-<div class="noinclude">
- <span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span><br>
- <code>command </code>元素响应不同来源的、对于同一操作的操作请求。比如,剪贴板的粘贴操作,可以来自 “编辑”菜单,可以来自鼠标右键的上下文菜单,也可以来自键盘快捷键。你可以通过 command 的 <code id="a-oncommand"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/oncommand">oncommand</a></code> 属性调用代码。对于用户来说,从什么地方触发了这个操作并不重要。另外,关闭 command 将自动关闭菜单中的项目和对键盘快捷键的响应。</div>
-<p>Commands are identified by their <code><code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code></code>. If you include the script <code><a class="external" rel="freelink">chrome://global/content/globalOverlay.js</a></code> in your window, you can use the function <code>goDoCommand</code> function to invoke the command. Using this function has the advantage that the command will be sent to the part of the UI which will respond to it. Typically, this will be the currently focused element.</p>
-<p>Like a <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/broadcaster" title="broadcaster">broadcaster</a></code>, commands forward attributes to other elements.</p>
-<p>More information is available in the <a href="/cn/XUL_Tutorial/Commands" title="cn/XUL_Tutorial/Commands">XUL tutorial</a>. See also: <code id="a-command"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/command">command</a></code> attribute, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/commandset" title="commandset">commandset</a></code> element</p>
-<dl>
- <dt>
- Attributes</dt>
- <dd>
- <a href="#a-disabled">disabled</a>, <a href="#a-label">label</a>, <a href="#a-oncommand">oncommand</a></dd>
-</dl>
-<h3 id="Examples" name="Examples">Examples</h3>
-<p>The following code will send a paste command (<code>cmd_paste</code>) to the currently focused element:</p>
-<pre class="eval"> // First include <a class="external" rel="freelink">chrome://global/content/globalOverlay.js</a>
- goDoCommand("cmd_paste");
-</pre>
-<p>Example with two buttons</p>
-<pre>&lt;command id="cmd_openhelp" oncommand="alert('Help');"/&gt;
-&lt;button label="Help" command="cmd_openhelp"/&gt;
-&lt;button label="More Help" command="cmd_openhelp"/&gt;
-</pre>
-<h3 id="Attributes" name="Attributes">Attributes</h3>
-<p> </p><div id="a-disabled">
-
-
-<dl>
- <dt><code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code></dt>
- <dd> </dd>
- <dd>
- <h5 id="类型boolean">类型:<em>boolean</em></h5>
- </dd>
- <dd>
- <h5 id="表示元素是被禁用的。">表示元素是被禁用的。</h5>
-
- <p>如果这个元素的disabled属性被设置为true,表示元素被禁用,被禁用的属性在页面上通常会显示灰色文本,它无法响应用户的操作,它也无法得到光标。</p>
-
- <p>然而,这个元素仍然能够响应鼠标事件,如果要启用这个元素,把disabled设置为false</p>
- </dd>
-</dl>
-
-<h4 id="示例:">示例:</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_attr_disabled.png" src="https://mdn.mozillademos.org/files/1742/XUL_ref_attr_disabled.png"></div>
-
-<pre><code>// Disabling an element
-document.getElementById('buttonRemove').setAttribute("disabled", "true");
-
-// Enabling back an element by removing the "disabled" attribute
-document.getElementById('buttonRemove').removeAttribute("disabled");</code></pre>
-
-<p></p><div class="blockIndicator standardNote standardNoteBlock">
- <p><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Firefox/Releases/3.5">Firefox 3.5 note</a></p>
- <p style="font-weight: 400;">For <a href="https://developer.mozilla.org/en-US/docs/XUL/keyset" title="en/XUL/Keyset"><code>keyset</code></a> elements, support for this attribute was added in Firefox 3.5.</p>
-</div><p></p>
-</div> <div id="a-label">
-
-<dl>
- <dt>
- <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- The label that will appear on the element. If this is left out, no text appears.<br>
- label 在元素上显示。如果左侧出界,则不显示任何文字。</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-oncommand">
-
-
-<dl>
- <dt><code id="a-oncommand"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/oncommand">oncommand</a></code></dt>
- <dd>Type: <em>script code</em></dd>
- <dd>This event handler is called when the command is activated. This occurs when a user selects a menu item or presses a keyboard shortcut attached to the command.</dd>
-</dl>
-
-
-</div><p></p>
-<h3 id="Properties" name="Properties">Properties</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited Properties</strong><br> <small> <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/align">align</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/allowEvents">allowEvents</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/boxObject">boxObject</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/builder">builder</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/className">className</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/collapsed">collapsed</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/contextMenu">contextMenu</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/controllers">controllers</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/database">database</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/datasources">datasources</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/dir">dir</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/flex">flex</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/height">height</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/hidden">hidden</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/id">id</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/left">left</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/maxHeight">maxHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/maxWidth">maxWidth</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/menu">menu</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/minHeight">minHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/minWidth">minWidth</a></span></code>, , , , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/observes">observes</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/ordinal">ordinal</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/orient">orient</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/pack">pack</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/persist">persist</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/ref">ref</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/resource">resource</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/statusText">statusText</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/style">style</a></span></code>, ,, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tooltip">tooltip</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tooltipText">tooltipText</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/top">top</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/width">width</a></span></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Methods" name="Methods">Methods</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited from XUL element</strong><br> <small> <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span></small></p> <p><strong>Inherited from DOM element</strong><br> <small> <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Related" name="Related">Related</h3>
-<ul>
- <li><a href="/cn/XUL/List_of_commands" title="cn/XUL/List_of_commands">XUL:List of commands</a></li>
-</ul>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/deprecated_defunct_markup/index.html b/files/zh-cn/mozilla/tech/xul/deprecated_defunct_markup/index.html
deleted file mode 100644
index 6ae3102b4f..0000000000
--- a/files/zh-cn/mozilla/tech/xul/deprecated_defunct_markup/index.html
+++ /dev/null
@@ -1,50 +0,0 @@
----
-title: Deprecated/Defunct Markup
-slug: Mozilla/Tech/XUL/Deprecated_Defunct_Markup
-translation_of: Archive/Mozilla/XUL/Deprecated_and_defunct_markup
----
-<p>The following XUL tags and attribute should be considered deprecated, if not defunct.</p>
-<p>The list below may include a few elements which are actually in use, but at a deeper level in the code. Even some of the information on the tags below may be out of date, but is provided here for historical reference and to help anyone who comes across them in old code or documentation.</p>
-<h3 id="Elements" name="Elements">Elements</h3>
-<ul>
- <li>&lt;actions&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (listed <a class="external" href="http://www.ar-ent.net/dar/arlib32/out/html/man/xul/elemref/mxdref.html">here</a> (by mistake or was it a container tag?)</li>
- <li>&lt;autorepeatbutton&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (action occurs repeatedly on mouse hover--used to construct other elements; used in &lt;arrowscrollbox&gt; and large drop-down menus)</li>
- <li>&lt;bulletinboard&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (made to support left/top styles, but &lt;stack&gt; can now do as well)</li>
- <li>&lt;gripper&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (inside of &lt;scrollbar&gt;&lt;thumb&gt;; not to be used by itself)</li>
- <li>&lt;listboxbody&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (internal use only; part of XBL for &lt;listbox&gt;)</li>
- <li>&lt;menubutton&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (experiment in combining buttons and menus; use &lt;button type&gt; instead)</li>
- <li>&lt;nativescrollbar&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (displayed a native scrollbar; had been for Mac only with native themes on)</li>
- <li>&lt;outliner&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (former name for &lt;tree&gt;; &lt;listbox&gt; had been "&lt;tree&gt;")</li>
- <li>&lt;package&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (no longer present but in older documentation)</li>
- <li>&lt;scrollbarbutton&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (button at end of scrollbar; had been only within larger &lt;scrollbar&gt;)</li>
- <li>&lt;sidebarheader&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span></li>
- <li>&lt;slider&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (clickable tray in &lt;scrollbar&gt; which holds &lt;thumb&gt;; do not use alone)</li>
- <li>&lt;spinner&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (spinbox; &lt;spinbuttons&gt; with a textbox whereby spinning affects value in textbox; not usable)</li>
- <li>&lt;spring&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (use @flex instead)</li>
- <li>&lt;strut&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (replaced by @debug?)</li>
- <li>&lt;tabcontrol&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (contained tabbox and tabpanel)</li>
- <li>&lt;text&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (like &lt;label&gt; or &lt;description&gt; but does not wrap; like &lt;label crop="end"&gt;; had been used in menus/toolbars)</li>
- <li>&lt;textfield&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (like &lt;textbox&gt;)</li>
- <li>&lt;thumb&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (&lt;button&gt; with deprecated &lt;gripper&gt;; implements sliding box in center of scrolbar)</li>
- <li>&lt;title&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (to add a caption on a &lt;titledbox&gt;</li>
- <li>&lt;titledbox&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (box with a frame)</li>
- <li>&lt;titledbutton&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (attempt to combine text and images before &lt;button&gt;)</li>
- <li>&lt;toolbarpaletteitem&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span></li>
- <li>&lt;treebody&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (old/experimental and unsupported XUL tags)</li>
- <li>&lt;treecaption&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (old/experimental and unsupported XUL tags)</li>
- <li>&lt;treecolgroup&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (former name for &lt;treecols&gt;</li>
- <li>&lt;treecolpicker&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (internal use only; part of XBL for &lt;tree&gt;)</li>
- <li>&lt;treefoot&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (old/experimental and unsupported XUL tags)</li>
- <li>&lt;treeindentation&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (old/experimental and unsupported XUL tags)</li>
- <li>&lt;treeicon&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (old/experimental and unsupported XUL tags)</li>
- <li>&lt;treerows&gt; <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> (internal use only; part of XBL for &lt;tree&gt;)</li>
-</ul>
-<h3 id="Attributes" name="Attributes">Attributes</h3>
-<ul>
- <li>@debug="true" <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> provided struts and springs around boxes to facilitate identification of flex issues but does not seem to work now</li>
-</ul>
-<h3 id="References" name="References">References</h3>
-<ul>
- <li><a class="external" href="http://www.ar-ent.net/dar/arlib32/out/html/man/xul/elemref/mxdref.html">XUL Element Reference</a> by Neal Deakin</li>
- <li>Rapid Application Development With Mozilla, by Nigel McFarlane</li>
-</ul>
diff --git a/files/zh-cn/mozilla/tech/xul/dialog/index.html b/files/zh-cn/mozilla/tech/xul/dialog/index.html
deleted file mode 100644
index b4e3680bf3..0000000000
--- a/files/zh-cn/mozilla/tech/xul/dialog/index.html
+++ /dev/null
@@ -1,364 +0,0 @@
----
-title: dialog
-slug: Mozilla/Tech/XUL/dialog
-translation_of: Archive/Mozilla/XUL/dialog
----
-<div class="noinclude"><span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-<p>在 <a href="/zh-cn/XUL/window" title="zh-cn/XUL/window">window</a> 元素调用对话框时应使用此元素。<code id="a-buttons"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/buttons">buttons</a></code> 属性可以用于设置哪些按钮应该出现在对话框中。这些按钮将被放置在用户平台指定的位置。</p>
-<p>更多有用信息可以查看 <a href="/en/XUL_Tutorial/Creating_Dialogs" title="en/XUL_Tutorial/Creating_Dialogs">XUL tutorial</a> 和 <a href="/en/Code_snippets/Dialogs_and_Prompts" title="en/Code_snippets/Dialogs_and_Prompts">Dialogs and prompts</a> (代码片段)。</p>
-<dl> <dt>属性</dt> <dd><a href="#a-buttonaccesskeyaccept">buttonaccesskeyaccept</a>, <a href="#a-buttonaccesskeycancel">buttonaccesskeycancel</a>, <a href="#a-buttonaccesskeydisclosure">buttonaccesskeydisclosure</a>, <a href="#a-buttonaccesskeyextra1">buttonaccesskeyextra1</a>, <a href="#a-buttonaccesskeyextra2">buttonaccesskeyextra2</a>, <a href="#a-buttonaccesskeyhelp">buttonaccesskeyhelp</a>, <a href="#a-buttonalign">buttonalign</a>, <a href="#a-buttondir">buttondir</a>, <a href="#a-buttondisabledaccept">buttondisabledaccept</a>, <a href="#a-buttonlabelaccept">buttonlabelaccept</a>, <a href="#a-buttonlabelcancel">buttonlabelcancel</a>, <a href="#a-buttonlabeldisclosure">buttonlabeldisclosure</a>, <a href="#a-buttonlabelextra1">buttonlabelextra1</a>, <a href="#a-buttonlabelextra2">buttonlabelextra2</a>, <a href="#a-buttonlabelhelp">buttonlabelhelp</a>, <a href="#a-buttonorient">buttonorient</a>, <a href="#a-buttonpack">buttonpack</a>, <a href="#a-buttons">buttons</a>, <a href="#a-defaultButton">defaultButton</a>, <a href="#a-ondialogaccept">ondialogaccept</a>, <a href="#a-ondialogcancel">ondialogcancel</a>, <a href="#a-ondialogdisclosure">ondialogdisclosure</a>, <a href="#a-ondialogextra1">ondialogextra1</a>, <a href="#a-ondialogextra2">ondialogextra2</a>, <a href="#a-ondialoghelp">ondialoghelp</a>, <a href="#a-title">title</a></dd>
-</dl>
-<dl> <dt>特性</dt> <dd><a href="#p-buttons">buttons</a>, <a href="#p-defaultButton">defaultButton</a></dd>
-</dl>
-<dl> <dt>方法</dt> <dd><a href="#m-acceptDialog">acceptDialog</a>, <a href="#m-cancelDialog">cancelDialog</a>, <a href="#m-centerWindowOnScreen">centerWindowOnScreen</a>, <a href="#m-getButton">getButton</a>, <a href="#m-moveToAlertPosition">moveToAlertPosition</a></dd>
-</dl>
-<h3 id="Examples" name="Examples">示例</h3>
-<div class="float-right"><img alt="Image:XUL_ref_dialog.png" class="internal" src="/@api/deki/files/453/=XUL_ref_dialog.png"></div>
-<pre>&lt;?xml version="1.0"?&gt;
-&lt;?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?&gt;
-&lt;dialog id="donothing" title="Dialog example"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- buttons="accept,cancel"
- buttonlabelcancel="Cancel"
- buttonlabelaccept="Save"
- ondialogaccept="return doOK();"
- ondialogcancel="return doCancel();"&gt;
-
- &lt;dialogheader title="Options" description="My preferences"/&gt;
- &lt;groupbox&gt;
- &lt;caption label="Colour"/&gt;
- &lt;radiogroup&gt;
- &lt;radio label="Red"/&gt;
- &lt;radio label="Green" selected="true"/&gt;
- &lt;radio label="Blue"/&gt;
- &lt;/radiogroup&gt;
- &lt;label value="Nickname"/&gt;
- &lt;textbox /&gt;
- &lt;/groupbox&gt;
-&lt;/dialog&gt;
-</pre>
-<h3 id="Attributes" name="Attributes">属性</h3>
-<p> </p><div id="a-activetitlebarcolor">
-
-<dl>
- <dt>
- <code id="a-activetitlebarcolor"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/activetitlebarcolor">activetitlebarcolor</a></code> </dt>
- <dd>
- Type: <em>color string</em></dd>
- <dd>
- Specify background color of the window's titlebar when it is active (foreground). Moreover this hides separator between titlebar and window contents. <em>This only affects Mac OS X.</em></dd>
-</dl>
-
-<p> </p>
-</div> <div id="a-buttonaccesskeyaccept">
-
-<dl>
- <dt>
- <code id="a-buttonaccesskeyaccept"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/buttonaccesskeyaccept">buttonaccesskeyaccept</a></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- The access key to use for the "accept" button.</dd>
-</dl>
-<p> </p>
-
-<p> </p>
-</div> <div id="a-buttonaccesskeycancel">
-
-<dl>
- <dt>
- <code id="a-buttonaccesskeycancel"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/buttonaccesskeycancel">buttonaccesskeycancel</a></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- The access key to use for the "cancel" button.</dd>
-</dl>
-</div> <div id="a-buttonaccesskeydisclosure">
-
-<dl>
- <dt>
- <code id="a-buttonaccesskeydisclosure"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/buttonaccesskeydisclosure">buttonaccesskeydisclosure</a></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- The access key to use for the "disclosure" button.</dd>
-</dl>
-</div> <div id="a-buttonaccesskeyextra1">
-
-<dl>
- <dt>
- <code id="a-buttonaccesskeyextra1"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/buttonaccesskeyextra1">buttonaccesskeyextra1</a></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- The access key to use for the first extra button.</dd>
-</dl>
-</div> <div id="a-buttonaccesskeyextra2">
-
-
-<dl>
- <dt><code id="a-buttonaccesskeyextra2"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/buttonaccesskeyextra2">buttonaccesskeyextra2</a></code></dt>
- <dd>Type: <em>string</em></dd>
- <dd>The access key to use for the second extra button.</dd>
-</dl>
-</div> <div id="a-buttonaccesskeyhelp">
-
-<dl>
- <dt>
- <code id="a-buttonaccesskeyhelp"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/buttonaccesskeyhelp">buttonaccesskeyhelp</a></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- The access key to use for the "help" button.</dd>
-</dl>
-</div> <div id="a-buttonalign">
-
-<dl>
- <dt>
- <code id="a-buttonalign"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/buttonalign">buttonalign</a></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- The value of the <code id="a-align"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/align">align</a></code> attribute for the box containing the buttons.</dd>
-</dl>
-</div> <div id="a-buttondir">
-
-
-<dl>
- <dt><code id="a-buttondir"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/buttondir">buttondir</a></code></dt>
- <dd>Type: <em>string</em></dd>
- <dd>The value of the <code id="a-dir"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/dir">dir</a></code> attribute for the box containing the buttons.</dd>
-</dl>
-</div> <div id="a-buttondisabledaccept">
-
-
-<dl>
- <dt><code id="a-buttondisabledaccept"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/buttondisabledaccept">buttondisabledaccept</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>If <code>true</code>, the accept button is disabled.</dd>
-</dl>
-</div> <div id="a-buttonlabelaccept">
-
-
-<dl>
- <dt><code id="a-buttonlabelaccept"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/buttonlabelaccept">buttonlabelaccept</a></code></dt>
- <dd>Type: <em>string</em></dd>
- <dd>The label to appear on the "accept" button.</dd>
-</dl>
-</div> <div id="a-buttonlabelcancel">
-
-
-<dl>
- <dt><code id="a-buttonlabelcancel"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/buttonlabelcancel">buttonlabelcancel</a></code></dt>
- <dd>Type: <em>string</em></dd>
- <dd>The label to appear on the "cancel" button.</dd>
-</dl>
-</div> <div id="a-buttonlabeldisclosure">
-
-
-<dl>
- <dt><code id="a-buttonlabeldisclosure"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/buttonlabeldisclosure">buttonlabeldisclosure</a></code></dt>
- <dd>Type: <em>string</em></dd>
- <dd>The label to appear on the "disclosure" button.</dd>
-</dl>
-</div> <div id="a-buttonlabelextra1">
-
-<dl>
- <dt>
- <code id="a-buttonlabelextra1"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/buttonlabelextra1">buttonlabelextra1</a></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- The label to appear on the first extra button.</dd>
-</dl>
-
-<p> </p>
-</div> <div id="a-buttonlabelextra2">
-
-<dl>
- <dt>
- <code id="a-buttonlabelextra2"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/buttonlabelextra2">buttonlabelextra2</a></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- The label to appear on the second extra button.</dd>
-</dl>
-
-<p> </p>
-</div> <div id="a-buttonlabelhelp">
-
-
-<dl>
- <dt><code id="a-buttonlabelhelp"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/buttonlabelhelp">buttonlabelhelp</a></code></dt>
- <dd>Type: <em>string</em></dd>
- <dd>The label to appear on the "help" button.</dd>
-</dl>
-</div> <div id="a-buttonorient">
-
-
-<dl>
- <dt><code id="a-buttonorient"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/buttonorient">buttonorient</a></code></dt>
- <dd>Type: <em>string</em></dd>
- <dd>The value of the <code id="a-orient"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/orient">orient</a></code> attribute for the box containing the buttons.</dd>
-</dl>
-</div> <div id="a-buttonpack">
-
-
-<dl>
- <dt><code id="a-buttonpack"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/buttonpack">buttonpack</a></code></dt>
- <dd>Type: <em>string</em></dd>
- <dd>The value of the <code id="a-pack"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/pack">pack</a></code> attribute for the box containing the buttons.</dd>
-</dl>
-</div> <div id="a-buttons">
-
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/buttons">buttons</a></span></code></dt>
- <dd>
- 类型: 列表,下面的值用逗号分隔</dd>
- <dd>
- 需要显示在对话框上的按钮的一个列表,使用逗号分隔。将按钮放置在合适的位置,将根据用户平台自动执行基本的事件处理。在列表中可以使用以下值:
- <ul>
- <li><code>accept</code>:“确定”按钮,按下按钮时将接受更改。此按钮为默认按钮。</li>
- <li><code>cancel</code>:“取消”按钮,将取消操作。</li>
- <li><code>help</code>:“帮助”按钮,在对话框显示一个“帮助”按钮。</li>
- <li><code>disclosure</code>:“更多信息”按钮,显示一个“more info”按钮。该按钮可能是一个按钮或一个三角形。</li>
- <li><code>extra1</code>:一个可选的额外的按钮。你可以通过<code><code id="a-buttonlabelextra1"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/buttonlabelextra1">buttonlabelextra1</a></code></code> 属性设置它的label。</li>
- <li><code>extra2</code>:第二个可选的额外的按钮。你可以通过 <code><code id="a-buttonlabelextra2"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/buttonlabelextra2">buttonlabelextra2</a></code></code> 属性设置它的label。</li>
- </ul>
- </dd>
-</dl>
-
-<p> </p>
-</div> <div id="a-defaultButton">
-
-
-<dl>
- <dt><code id="a-defaultButton"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/defaultButton">defaultButton</a></code></dt>
- <dd>Type: <em>string</em></dd>
- <dd>Normally this attribute should not be set, but if it is, it specifies the default button in the dialog. Typically, this means that the button will be activated when the Enter key is pressed. This should be set to one of the same values as those for the <code id="a-buttons"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/buttons">buttons</a></code> attribute.</dd>
-</dl>
-</div> <div id="a-inactivetitlebarcolor">
-
-
-<dl>
- <dt><code id="a-inactivetitlebarcolor"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/inactivetitlebarcolor">inactivetitlebarcolor</a></code> </dt>
- <dd>Type: <em>color string</em></dd>
- <dd>Specify background color of the window's titlebar when it is inactive (background). Moreover this hides separator between titlebar and window contents. <em>This affects only on Mac OS X.</em></dd>
-</dl>
-</div> <div id="a-ondialogaccept">
-
-
-<dl>
- <dt><code id="a-ondialogaccept"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/ondialogaccept">ondialogaccept</a></code></dt>
- <dd>Type: <em>script code</em></dd>
- <dd>The code in this attribute is called when the accept button is pressed, or when the <span id="m-acceptDialog"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/acceptDialog">acceptDialog</a></code></span> method is called. If the handler returns <code>true</code>, the dialog will indeed go away, but if it returns <code>false</code> it will not.</dd>
-</dl>
-</div> <div id="a-ondialogcancel">
-
-
-<dl>
- <dt><code id="a-ondialogcancel"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/ondialogcancel">ondialogcancel</a></code></dt>
- <dd>Type: <em>script code</em></dd>
- <dd>The code in this attribute is called when the "cancel" button is pressed or when the <span id="m-cancelDialog"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/cancelDialog">cancelDialog</a></code></span> method is called. If the routine returns true, the dialog will indeed go away, but if it returns false it will not.</dd>
-</dl>
-</div> <div id="a-ondialogdisclosure">
-
-
-<dl>
- <dt><code id="a-ondialogdisclosure"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/ondialogdisclosure">ondialogdisclosure</a></code></dt>
- <dd>Type: <em>script code</em></dd>
- <dd>The code in this attribute is called when the "disclosure" button is pressed.</dd>
-</dl>
-</div> <div id="a-ondialogextra1">
-
-
-<dl>
- <dt><code id="a-ondialogextra1"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/ondialogextra1">ondialogextra1</a></code></dt>
- <dd>Type: <em>script code</em></dd>
- <dd>The code in this attribute is called when the first extra button is pressed.</dd>
-</dl>
-</div> <div id="a-ondialogextra2">
-
-
-<dl>
- <dt><code id="a-ondialogextra2"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/ondialogextra2">ondialogextra2</a></code></dt>
- <dd>Type: <em>script code</em></dd>
- <dd>The code in this attribute is called when the second extra button is pressed.</dd>
-</dl>
-</div> <div id="a-ondialoghelp">
-
-
-<dl>
- <dt><code id="a-ondialoghelp"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/ondialoghelp">ondialoghelp</a></code></dt>
- <dd>Type: <em>script code</em></dd>
- <dd>The code in this attribute is called when the "help" button is pressed.</dd>
-</dl>
-</div> <div id="a-title">
-
-
-<dl>
- <dt><code id="a-title"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/title">title</a></code></dt>
- <dd>Type: <em>string</em></dd>
- <dd>The text to appear in the title bar of the window.</dd>
-</dl>
-</div><p></p>
-<h3 id="Properties" name="Properties">特性</h3>
-<p> </p><div id="p-buttons">
-<dl> <dt><code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/buttons">buttons</a></span></code></dt> <dd>类型: 列表,下面的值用逗号分隔</dd> <dd>需要显示在对话框上的按钮的一个列表,使用逗号分隔。将按钮放置在合适的位置,将根据用户平台自动执行基本的事件处理。在列表中可以使用以下值: <ul> <li><code>accept</code>:“确定”按钮,按下按钮时将接受更改。此按钮为默认按钮。</li> <li><code>cancel</code>:“取消”按钮,将取消操作。</li> <li><code>help</code>:“帮助”按钮,在对话框显示一个“帮助”按钮。</li> <li><code>disclosure</code>:“更多信息”按钮,显示一个“more info”按钮。该按钮可能是一个按钮或一个三角形。</li> <li><code>extra1</code>:一个可选的额外的按钮。你可以通过<code><code id="a-buttonlabelextra1"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/buttonlabelextra1">buttonlabelextra1</a></code></code> 属性设置它的label。</li> <li><code>extra2</code>:第二个可选的额外的按钮。你可以通过 <code><code id="a-buttonlabelextra2"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/buttonlabelextra2">buttonlabelextra2</a></code></code> 属性设置它的label。</li> </ul> </dd>
-</dl>
-</div> <div id="p-defaultButton">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/defaultButton">defaultButton</a></span></code></dt>
- <dd>Type: <em>string</em></dd>
- <dd>Normally this attribute should not be set, but if it is, it specifies the default button in the dialog. Typically, this means that the button will be activated when the Enter key is pressed. This should be set to one of the same values as those for the <code id="a-buttons"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/buttons">buttons</a></code> attribute.</dd>
-</dl></div><p></p><h3 id="Methods" name="Methods">方法</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0 0 10px 10px; padding: 0 10px; background: rgb(238, 238, 238); float: right; width: 250px;">
-<tbody>
-<tr>
-<td>
-<p><strong>Inherited Methods</strong><br>
-<small><code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.cloneNode">cloneNode()</a></code>, <a href="/En/DOM/Node.compareDocumentPosition" title="En/DOM/Node.compareDocumentPosition">compareDocumentPosition</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getBoundingClientRect">getBoundingClientRect()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getClientRects">getClientRects()</a></code>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span>, <span id="m-getElementsByAttributeNS"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttributeNS">getElementsByAttributeNS</a></code></span>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByClassName">getElementsByClassName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getFeature">getFeature()</a></code>, <a href="/En/DOM/Node.getUserData" title="En/DOM/Node.getUserData">getUserData</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isDefaultNamespace">isDefaultNamespace()</a></code>, <a href="/En/DOM/Node.isEqualNode" title="En/DOM/Node.isEqualNode">isEqualNode</a>, <a href="/En/DOM/Node.isSameNode" title="En/DOM/Node.isSameNode">isSameNode</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <a href="/En/DOM/Node.lookupNamespaceURI" title="En/DOM/Node.lookupNamespaceURI">lookupNamespaceURI</a>, <a href="/En/DOM/Node.lookupPrefix" title="En/DOM/Node.lookupPrefix">lookupPrefix</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.querySelector">querySelector()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.querySelectorAll">querySelectorAll()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code>, <a href="/En/DOM/Node.setUserData" title="En/DOM/Node.setUserData">setUserData</a></small></p>
-
-</td>
-</tr>
-</tbody>
-</table> <dl>
- <dt>
- <span id="m-acceptDialog"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/acceptDialog">acceptDialog()</a></code></span></dt>
- <dd>
- Return type: <em>no return value</em></dd>
- <dd>
- Accepts the dialog and closes it, similar to pressing the OK button.</dd>
-</dl> <dl>
- <dt><span id="m-cancelDialog"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/cancelDialog">cancelDialog()</a></code></span></dt>
- <dd>Return type: <em>no return value</em></dd>
- <dd>Cancels the dialog and closes it, similar to pressing the Cancel button.</dd>
-</dl> <dl>
- <dt><span id="m-centerWindowOnScreen"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/centerWindowOnScreen">centerWindowOnScreen()</a></code></span></dt>
- <dd>Return type: <em>no return value</em></dd>
- <dd>Centers the dialog on the screen.</dd>
-</dl> <dl>
- <dt>
- <span id="m-getButton"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getButton">getButton( type )</a></code></span></dt>
- <dd>
- 返回值类型: <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/button" title="button">button</a></code>元素</dd>
- <dd>
- 返回当前对话框中指定类型的<code><a href="/zh-CN/docs/Mozilla/Tech/XUL/button" title="button">button</a></code>元素.</dd>
-</dl> <dl>
- <dt><span id="m-moveToAlertPosition"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/moveToAlertPosition">moveToAlertPosition()</a></code></span></dt>
- <dd>Return type: <em>no return value</em></dd>
- <dd>Moves and resizes the dialog to a position and size suitable for an alert box.</dd>
-</dl><p></p>
-<h3 id="Related" name="Related">相关</h3>
-<dl> <dt>Elements</dt> <dd><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/dialogheader" title="dialogheader">dialogheader</a></code></dd>
-</dl>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/events/index.html b/files/zh-cn/mozilla/tech/xul/events/index.html
deleted file mode 100644
index 02cf21976d..0000000000
--- a/files/zh-cn/mozilla/tech/xul/events/index.html
+++ /dev/null
@@ -1,497 +0,0 @@
----
-title: Events
-slug: Mozilla/Tech/XUL/Events
-translation_of: Archive/Mozilla/XUL/Events
----
-<div class="boxed translate-display">
-<p> </p>
-
-<p><a href="https://developer.mozilla.org/zh-CN/docs/XUL_Reference" title="« XUL Reference">« XUL Reference</a></p>
-
-<p> </p>
-
-<p>下列表格描述了对大部分 XUL 元素有效的事件句柄(Event Handler)。您可以使用 <a href="https://developer.mozilla.org/en/DOM/element.addEventListener" title="en/DOM/element.addEventListener">addEventListener</a> 添加事件的监听器(Listener),并使用 <a href="https://developer.mozilla.org/en/DOM/element.removeEventListener" title="en/DOM/element.removeEventListener">removeEventListener</a> 以移除这些监听器。</p>
-
-<p>其中一些事件同样可以使用属性值绑定。当使用属性值绑定事件时,您要注意这样做始终只能绑定一个监听器——后一次绑定会覆盖掉前面一次的绑定。对应的属性名是事件名前加上“on”前缀。</p>
-
-<h3 id="继承的文档树事件">继承的文档树事件</h3>
-
-<p>继承的文档树事件(Inherited DOM Events)</p>
-
-<table class="fullwidth-table">
- <tbody>
- <tr>
- <th>事件</th>
- <th>描述</th>
- </tr>
- <tr>
- <td>
- <p>blur</p>
- </td>
- <td>
- <p>与 focus 事件相对,当一个元素失去焦点时会触发 blur 事件。<br>
- <strong>属性:</strong>onblur</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>change</p>
- </td>
- <td>
- <p>当文本框的值被修改且失去焦点后,会触发 change 事件。<br>
- <strong>属性:</strong> onchange</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>click</p>
- </td>
- <td>
- <p>当鼠标键被按下并松开后会触发 click 事件。您可以通过事件对象的 <code>button</code> 属性判断按下的是哪个按键。用户双击时同样会触发这个事件,您可以通过 <code>detail</code> 属性检查有多少次点击发生,用它来检查双击或者三击。在 XUL 中,您应当使用 command 事件响应用户操作,而不应使用 click 事件。</p>
-
- <p><strong>属性:</strong> onclick</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>dblclick</p>
- </td>
- <td>
- <p>这个事件和 click 事件类似,但是仅当用户双击鼠标的时候触发。这是另一种检查 click 事件中 detail 属性的方法。<br>
- <strong>属性:</strong> ondblclick</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>DOMMouseScroll</p>
- </td>
- <td>
- <p>当用户滑动鼠标滚轮时会触发这个事件。不论鼠标滚轮的滑动是否造成了页面内容的滚动。事件的 target 属性是滑动滚轮时在鼠标指针下的对象,这与 click 事件相似。</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>focus</p>
- </td>
- <td>
- <p>当一个元素收到焦点的时候,会触发 focus 属性。一旦某个元素获得了焦点,那么键盘事件将会被发送到这个元素上。焦点可以通过鼠标点击、按 Tab 键、按 back Tab 键切换到其他的元素上。<br>
- <strong>属性:</strong> onfocus</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>keydown</p>
- </td>
- <td>
- <p>当键盘按键被按下但是并未抬起时,会触发当前具有焦点的元素的 keydown 事件。<br>
- <strong>属性:</strong> onkeydown</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>keypress</p>
- </td>
- <td>
- <p>当键盘按键被按下并松开后,会触发当前具有焦点的元素的 keypress 事件。当用户按下并松开一个键时,会依次触发 keydown 事件、 keypress 事件和 keyup 事件。在一个文本框里,用户可以按住一个键来发送多个对应的字符,这时会像用户重复按了对应键多次一样触发多组按键事件。<br>
- <strong>属性:</strong> onkeypress</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>keyup</p>
- </td>
- <td>
- <p>当键盘按键被松开后,会触发当前具有焦点的元素的 keyup 事件。<br>
- <strong>属性:</strong> onkeyup</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>load</p>
- </td>
- <td>
- <p>当一个窗口(window)被完整加载后,会触发他的 load 事件。这个事件被用在窗口元素上和图片(image)元素或其他支持图片属性的上。用在图片元素上时,当图片元素被加载时会触发这个事件。图片元素的 load 事件不会起泡(bubble up),换句话说,不会因此触发窗口的 load 事件。<br>
- <strong>属性:</strong> onload</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>mousedown</p>
- </td>
- <td>
- <p>当鼠标点击了某个元素但尚未松开时,会触发 mousedown 事件。<br>
- <strong>属性:</strong> onmousedown</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>mousemove</p>
- </td>
- <td>
- <p>当鼠标在一个元素上移动时,会反复地发送 mousemove 事件。<br>
- <strong>属性:</strong> onmousemove</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>mouseout</p>
- </td>
- <td>
- <p>与 mouseover 事件相对,当用户将鼠标移出某个元素时,会触发这个元素的 mouseout 事件。<br>
- <strong>属性:</strong> onmouseout</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>mouseover</p>
- </td>
- <td>
- <p>当鼠标首次移动到某个元素上时,会触发这个元素的 mouseover 事件。<span class="short_text" id="result_box" lang="zh-CN"><span class="alt-edited">您可以使用此事件来提供给用户反馈。</span></span><br>
- <strong>属性:</strong> onmouseover</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>mouseup</p>
- </td>
- <td>
- <p>当鼠标在某个元素上松开时,会触发 mouseup 事件。<br>
- <strong>属性:</strong> onmouseup</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>select</p>
- </td>
- <td>
- <p>This event is sent to a listbox or tree when an item is selected.<br>
- <strong>属性:</strong> onselect</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>unload</p>
- </td>
- <td>
- <p>This event is sent to a window when the window has closed. This is done after the close event. You should place this event handler on the window element.<br>
- <strong>属性:</strong>onunload</p>
- </td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="Mutation_DOM_events" name="Mutation_DOM_events">Mutation 文档树事件</h3>
-
-<table class="fullwidth-table">
- <tbody>
- <tr>
- <th>事件</th>
- <th>描述</th>
- </tr>
- <tr>
- <td>
- <p>DOMAttrModified</p>
- </td>
- <td>
- <p>当一个元素的属性被修改时,会触发 DOMAttrModified 事件。您可以通过 <code>attrName</code> 属性查看哪个属性被修改了,并通过 <code>prevValue</code> 和 <code>newValue</code> 属性查看对应属性的旧值和新值。</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>DOMNodeInserted</p>
- </td>
- <td>
- <p>当一个节点作为一个元素的子节点被添加时,会触发 DOMNodeInsterted 事件。如果您在 document 层捕获这个事件,您可以收到所有对文档修改的动作。</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>DOMNodeRemoved</p>
- </td>
- <td>
- <p>当一个节点被移除时,会触发 DOMNodeRemoved 事件。如果您在 document 层捕获这个事件,您可以收到所有对文档修改的动作。</p>
- </td>
- </tr>
- </tbody>
-</table>
-
-<div class="warning">
-<p>请注意,向文档中添加任何 mutation 事件监听器会降低后续文档树操作的性能。而且在后续操作中移除这些监听器并不会使之好转。要了解详细信息,请参考  <a href="https://developer.mozilla.org/en-US/docs/DOM/Mutation_events" title="en-US/docs/DOM/Mutation_events">Mutation events</a> ,并且参考 <a href="https://developer.mozilla.org/en-US/docs/DOM/DOM_Mutation_Observers" title="en-US/docs/DOM/DOM_Mutation_Observers">Mutation observers</a> 考虑使用其他效率更好的方式。</p>
-</div>
-
-<h3 id="Common_XUL_events" name="Common_XUL_events">通用 XUL 事件</h3>
-
-<table class="fullwidth-table">
- <tbody>
- <tr>
- <th>事件</th>
- <th>描述</th>
- </tr>
- <tr>
- <td>
- <p>broadcast</p>
- </td>
- <td>
- <p>您应当将这个事件句柄置于观察者上。当对应元素(如广播者)的属性被改变时,会触发 boardcast 事件。<br>
- <strong>属性:</strong> onbroadcast</p>
- </td>
- </tr>
- <tr>
- <td>
- <p><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Events/close_event">close</a></p>
- </td>
- <td>
- <p>当用户按下关闭按钮以要求关闭窗口时,会触发 close 事件。如果您在一个窗口元素上放置该事件的句柄,您可以陷入(trap)窗口的关闭。如果您在监听器中调用 event.preventDefault() ,可以阻止窗口的关闭。注意, close 事件仅针对用户按了标题栏上的关闭按钮,而不针对诸如点击了菜单中的文件—退出的操作。您可以考虑使用窗口的 unload 事件来处理所有关闭窗口的事件。<br>
- <strong>属性:</strong> onclose</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>command</p>
- </td>
- <td>
- <p>当一个元素被激活时,会触发 command 事件。对于不同的元素,这个事件触发的方式也不尽相同。例如,点击按钮可以触发这个事件,在按钮获得焦点时按回车键也可以触发这个事件,用鼠标选择菜单项时可以触发这个事件,用键盘快捷键选择某个菜单项时同样会触发这个事件。您应当考虑使用 command 事件,而非使用 click 事件,因为 command 事件可以在所有上面说的情况下被调用。<br>
- <strong>属性:</strong> oncommand</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>commandupdate</p>
- </td>
- <td>
- <p>This event occurs when a command update occurs on a &lt;commandset&gt; element. You would use this to update the disabled status of its commands.<br>
- <strong>属性:</strong> oncommandupdate</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>contextmenu</p>
- </td>
- <td>
- <p>当用户试图显示某个元素的菜单时,会触发 contextmenu 事件。因平台不同,这个事件的触发方式也有所不同,通常来说是通过右键单击来触发的。这个事件可以用来在用户点击时动态地设置菜单的内容。您还可以使用 popupshowing 事件。在事件句柄中返回 false 可以阻止菜单弹出。<br>
- <strong>属性:</strong> oncontextmenu</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>drag </p>
- </td>
- <td>
- <p>当拖拽一个节点时,会每秒数次地触发被拖拽节点的 drag 事件。<br>
- <strong>属性:</strong> ondrag</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>dragdrop</p>
- </td>
- <td>
- <p>当用户松开鼠标以释放一个被拖拽的对象时,会触发 dragdrop 事件。The element, if it accepts the drop, should respond in some manner such inserting the dragged object into itself.<br>
- <strong>属性:</strong> ondragdrop</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>dragend </p>
- </td>
- <td>
- <p>当拖拽事件结束时,会触发被拖拽的节点的 dragend 事件。<br>
- <strong>属性:</strong> ondragend</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>dragenter</p>
- </td>
- <td>
- <p>在拖拽过程中,当鼠标节点第一次进入某个对象的范围内时,会触发 dragenter 事件。这个事件与 mouseover 事件相似,不同点在于在拖拽的过程中触发。<br>
- <strong>属性:</strong> ondragenter</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>dragexit</p>
- </td>
- <td>
- <p>在拖拽的过程中,当鼠标指针从一个元素上移出的时候,会触发 dragexit 事件。这个事件同样会在释放元素后触发。这个事件与 mouseout 事件相似,不同点在于在拖拽的过程中触发。<br>
- <strong>属性:</strong> ondragexit</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>draggesture</p>
- </td>
- <td>
- <p>当用户开始拖拽一个元素时,会触发 draggesture 事件。一般来说,拖拽是由按住鼠标移动产生的。<br>
- <strong>属性:</strong> ondraggesture</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>dragover</p>
- </td>
- <td>
- <p>类似于 mouseover 事件,当有东西被拖拽到某个元素之上时,会触发 dragover 事件。这个事件应当判断被拖拽的对象是否可以释放。<br>
- <strong>属性:</strong> ondragover</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>input</p>
- </td>
- <td>
- <p>当用户在文本框输入的时候,会触发 input 事件。仅当显示的文本被修改时会触发这个事件,因此如果用户按了不会显示出来的按键时,这个事件是不会被触发的。<br>
- <strong>属性:</strong> oninput</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>overflow</p>
- </td>
- <td>
- <p>仅当 CSS 的 overflow 属性被设置为 visible 以外的值时才会触发 overflow 。当没有足够的空间显示某个元素当内容时,会触发 overflow 事件。例如,一个最大尺寸为 100 像素的盒,但是可用的空间只有 80 像素,那么就会触发 overflow 事件。如果因为用户修改窗口大小等因素导致大小被改变了,因此有了足够的空间时,会触发相应的 underflow 事件。<br>
- <strong>属性:</strong> onoverflow</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>popuphidden</p>
- </td>
- <td>
- <p>当一个弹出的元素被隐藏了时,会触发 popuphidden 事件。<br>
- <strong>属性:</strong> onpopuphidden</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>popuphiding</p>
- </td>
- <td>
- <p>当一个弹出的元素将被隐藏时,会触发 popuphiding 事件。<br>
- <strong>属性:</strong> onpopuphiding</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>popupshowing</p>
- </td>
- <td>
- <p>当一个弹出元素将被显示时,会触发 popupshowing 事件。这个事件经常被用来在用户需要显示弹出元素时动态地设置它的内容。在句柄中返回 false 可以阻止元素弹出。<br>
- <strong>属性:</strong> onpopupshowing</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>popupshown</p>
- </td>
- <td>
- <p>当一个弹出元素被显示了时,会触发 popupshown 事件。这类似于窗口上的 load 事件。<br>
- <strong>属性:</strong> onpopupshown</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>syncfrompreference</p>
- </td>
- <td>
- <p>因为选项的修改而导致元素改变时,会调用 syncfrompreference 事件。这个事件只会对 <a href="https://developer.mozilla.org/en/XUL/prefwindow" title="en/XUL/prefwindow">prefwindow</a> 中的元素生效。这不是实际意义上的事件而仅仅是一个函数调用,所以这个事件必须使用属性形式的语法定义。函数可以返回不同于选项的特定的值。这个事件通常被用于为了让选项值更适合显式在用户界面中而调整选项值。<br>
- <strong>属性:</strong> onsyncfrompreference</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>synctopreference</p>
- </td>
- <td>
- <p>当与对象连接的属性值被修改时,会调用 synctopreference 事件。这不是实际意义上的事件而仅仅是一个函数调用,所以这个事件必须使用属性形式的语法定义。函数可以返回不同于选项的特定的值,以设置属性的值,而非使用元素的 value 。<br>
- <strong>属性:</strong> onsynctopreference</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>underflow</p>
- </td>
- <td>
- <p>当有了足够的空间完整地显示某个元素时,会触发这个元素的 underflow 事件。这个事件对所有 CSS 的 overflow 属性不为 visible 的盒或其他布局元素生效。这个事件说明滚动条已经没必要了。<br>
- <strong>属性:</strong> onunderflow</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>DOMMenuItemActive</p>
- </td>
- <td>
- <p>当鼠标在菜单或菜单项上时或某个菜单项没高亮时,会触发 DOMMenuItemActive 事件。这个事件是起泡的(bubbles)。</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>DOMMenuItemInactive</p>
- </td>
- <td>
- <p>当鼠标移出菜单或菜单项或某个菜单项不再被高亮时,会触发 DOMMenuItemInactive 事件。这个事件是起泡的。</p>
- </td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="窗口事件">窗口事件</h3>
-
-<p>下列事件被绑定在顶级文档树窗口上,可以使用 window.addEventListener 监听。</p>
-
-<table class="fullwidth-table">
- <tbody>
- <tr>
- <th>Event</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>activate </td>
- <td>当窗口变为活动窗口时触发。</td>
- </tr>
- <tr>
- <td>deactivate </td>
- <td>当窗口变为非活动窗口时触发。</td>
- </tr>
- <tr>
- <td>sizemodechange </td>
- <td>
- <p>当某个窗口被最小化,取消最小化,切换到全屏模式,或切换到窗口模式时触发。注意,这个事件可能被调用多次,或者因为修改窗口大小而被调用,(见 <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=715867" title="FIXED: sizemodechange event fires during resizing on mac, even when sizemode/windowState doesn't change">bug 715867</a> )。所以应当在事件中查看 <a href="/zh-CN/docs/Web/API/Window/windowState" title="此页面仍未被本地化, 期待您的翻译!"><code>window.windowState</code></a> 检查窗口的状态。</p>
- </td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="Accessibility_events" name="Accessibility_events">可访问性事件</h3>
-
-<p>这些事件被用来通知可访问性系统。一般来说你不应该自行使用这些事件。</p>
-
-<table class="fullwidth-table">
- <tbody>
- <tr>
- <th>Event</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>
- <p>CheckboxStateChange</p>
- </td>
- <td>
- <p>当一个 <a href="https://developer.mozilla.org/en/XUL/checkbox" title="en/XUL/checkbox">checkbox</a> 被选中或取消选中时,会触发 CheckboxStateChange 事件。这个事件可能由于用户动作触发,也可能由于脚本改变了选框的值。相比之下, command 事件只会因为用户的动作而触发,这时 CheckboxStateChange 事件在 command 事件之前触发。 CheckboxStateChange 事件是不起泡的。</p>
- </td>
- </tr>
- <tr>
- <td>
- <p>RadioStateChange</p>
- </td>
- <td>
- <p>当一个 <a href="https://developer.mozilla.org/en/XUL/radio" title="en/XUL/radio"> radio</a> 被选中时,会触发 RadioStateChange 事件。这个事件可能时由于用户动作触发,也可能时因为脚本修改了对应的值。相比之下, command 事件只会因为用户的动作而触发,这时 RadioStateChange 事件在 command 事件之前触发。 RadioStateChange 事件是起泡的,因此你可以在 <a href="https://developer.mozilla.org/en/XUL/radiogroup" title="en/XUL/radiogroup"> radiogroup</a> 绑定事件句柄。</p>
- </td>
- </tr>
- </tbody>
-</table>
-
-<p></p>
-</div>
-
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/image/index.html b/files/zh-cn/mozilla/tech/xul/image/index.html
deleted file mode 100644
index f70f4a5f7d..0000000000
--- a/files/zh-cn/mozilla/tech/xul/image/index.html
+++ /dev/null
@@ -1,145 +0,0 @@
----
-title: image
-slug: Mozilla/Tech/XUL/image
-translation_of: Archive/Mozilla/XUL/image
----
-<div class="noinclude">
- <span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-<h3 id="Summary">Summary</h3>
-<p>用于图片显示的元素,与HTML中的img相似.使用 <code id="a-src"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/src">src</a></code>可以指定图片的URL.</p>
-<p>More information is available in the <a href="/en/XUL_Tutorial/Adding_Labels_and_Images" title="en/XUL_Tutorial/Adding_Labels_and_Images">XUL tutorial</a>.</p>
-<div class="noinclude">
- <div class="note">
- <p><strong>Note:</strong> Prior to <span title="(Firefox 8.0 / Thunderbird 8.0 / SeaMonkey 2.5)">Gecko 8.0</span>, images did not shrink down with the same ratio in both directions when specifying maximum sizes using <code>maxheight</code> or <code>maxwidth</code>. The new behavior aligns more with the HTML <a href="/zh-CN/docs/Web/HTML/Element/img" title="HTML Image 元素( &lt;img> )代表文档中的一个图像。"><code>&lt;img&gt;</code></a> element and shrinks both the width and height down proportionally.</p>
- </div>
-</div>
-<dl>
- <dt>
- Attributes</dt>
- <dd>
- <a href="#a-onerror">onerror</a>, <a href="#a-onload">onload</a>, <a href="#a-src">src</a>, <a href="#a-validate">validate</a></dd>
-</dl>
-<dl>
- <dt>
- Properties</dt>
- <dd>
- <a href="#p-accessibleType">accessibleType</a>, <a href="#p-src">src</a></dd>
-</dl>
-<dl>
- <dt>
- Style classes</dt>
- <dd>
- <a href="#s-alert-icon">alert-icon</a>, <a href="#s-error-icon">error-icon</a>, <a href="#s-message-icon">message-icon</a>, <a href="#s-question-icon">question-icon</a></dd>
-</dl>
-<h3 id="Examples">Examples</h3>
-<div class="float-right">
- <img alt="Image:Firefoxlogo2.png" class="internal" src="/@api/deki/files/220/=Firefoxlogo2.png"></div>
-<pre class="eval">&lt;image src='Firefoxlogo.png' width='135' height='130'/&gt;
-</pre>
-<h3 id="Attributes">Attributes</h3>
-<p> </p><div id="a-onerror">
-
-
-<dl>
- <dt><code id="a-onerror"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/onerror">onerror</a></code></dt>
- <dd>Type: <em>script code</em></dd>
- <dd>This event is sent to an <code><a href="/en-US/docs/Mozilla/Tech/XUL/image" title="image">image</a></code> element when an error occurs loading the image.</dd>
-</dl>
-</div> <div id="a-onload">
-
-<h3 id="See" name="See">See</h3>
-
-<ul>
- <li><code id="a-image.onload"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/image.onload">image.onload</a></code></li>
- <li><code id="a-prefwindow.onload"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/prefwindow.onload">prefwindow.onload</a></code></li>
-</ul>
-
-</div> <div id="a-src">
-
-<dl>
- <dt>
- <code id="a-src"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/src">src</a></code></dt>
- <dd>
- Type: <em>URI</em></dd>
- <dd>
- The URI of the content to appear in the element.</dd>
-</dl>
-
-
-</div> <div id="a-validate">
-
-<dl>
- <dt>
- <code id="a-validate"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/validate">validate</a></code></dt>
- <dd>
- Type:
- <i>
- one of the values below</i>
- </dd>
- <dd>
- This attribute indicates whether to load the image from the cache or not. This would be useful if the images are stored remotely or you plan on swapping the image frequently. The following values are accepted, or leave out the attribute entirely for default handling:</dd>
-</dl>
-<ul>
- <li><code>always</code>: The image is always checked to see whether it should be reloaded.</li>
- <li><code>never</code>: The image will be loaded from the cache if possible.</li>
-</ul>
-
-<p></p>
-</div><p></p>
-<h3 id="Properties">Properties</h3>
-<p></p><div id="p-accessibleType">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessibleType">accessibleType</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- A value indicating the type of accessibility object for the element.</dd>
-</dl>
-
-<p></p></div> <div id="p-src">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/src">src</a></span></code></dt>
- <dd>Type: <em>URL</em></dd>
- <dd>Gets and sets the value of the <code id="a-src"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/src">src</a></code> attribute.</dd>
-</dl></div> <table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited Properties</strong><br> <small> <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/align">align</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/allowEvents">allowEvents</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/boxObject">boxObject</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/builder">builder</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/className">className</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/collapsed">collapsed</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/contextMenu">contextMenu</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/controllers">controllers</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/database">database</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/datasources">datasources</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/dir">dir</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/flex">flex</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/height">height</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/hidden">hidden</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/id">id</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/left">left</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/maxHeight">maxHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/maxWidth">maxWidth</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/menu">menu</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/minHeight">minHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/minWidth">minWidth</a></span></code>, , , , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/observes">observes</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/ordinal">ordinal</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/orient">orient</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/pack">pack</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/persist">persist</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/ref">ref</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/resource">resource</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/statusText">statusText</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/style">style</a></span></code>, ,, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tooltip">tooltip</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tooltipText">tooltipText</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/top">top</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/width">width</a></span></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Methods">Methods</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited from XUL element</strong><br> <small> <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span></small></p> <p><strong>Inherited from DOM element</strong><br> <small> <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Style_classes">Style classes</h3>
-<p></p><dl>
- <dt>
- <code><a href="https://developer.mozilla.org/en-US/docs/XUL/Style/alert-icon">alert-icon</a></code></dt>
- <dd>
- Class that adds an alert icon. This typically looks like an exclamation mark. This and the other icon classes may be used by <code><a href="/en-US/docs/Mozilla/Tech/XUL/image" title="image">image</a></code> elements or other elements which can have an image.</dd>
-</dl> <dl>
- <dt><code><a href="https://developer.mozilla.org/en-US/docs/XUL/Style/error-icon">error-icon</a></code></dt>
- <dd>Class that adds an error icon. This will typically be a red "X" icon.</dd>
-</dl> <dl>
- <dt><code><a href="https://developer.mozilla.org/en-US/docs/XUL/Style/message-icon">message-icon</a></code></dt>
- <dd>Class that adds a message box icon.</dd>
-</dl> <dl>
- <dt><code><a href="https://developer.mozilla.org/en-US/docs/XUL/Style/question-icon">question-icon</a></code></dt>
- <dd>Class that adds a question icon, which usually looks like a question mark.</dd>
-</dl><p></p>
-<h3 id="Related">Related</h3>
-<p>See also the <code id="a-image"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/image">image</a></code> and <code id="a-icon"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/icon">icon</a></code> attributes.</p>
-<h3 id="Interfaces">Interfaces</h3>
-<ul>
- <li><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIAccessibleProvider" title="">nsIAccessibleProvider</a></code></li>
- <li><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMXULImageElement" title="">nsIDOMXULImageElement</a></code></li>
-</ul>
-<div class="noinclude">
- </div>
diff --git a/files/zh-cn/mozilla/tech/xul/index.html b/files/zh-cn/mozilla/tech/xul/index.html
deleted file mode 100644
index ac0e9697f5..0000000000
--- a/files/zh-cn/mozilla/tech/xul/index.html
+++ /dev/null
@@ -1,79 +0,0 @@
----
-title: XUL
-slug: Mozilla/Tech/XUL
-tags:
- - XUL
-translation_of: Archive/Mozilla/XUL
----
-<div class="callout-box">
- <strong><a href="/cn/XUL_%E6%95%99%E7%A8%8B" title="cn/XUL_教程">从这里开始</a></strong><br>
-   帮助你对XUL有一个比较直观的理解(该教程首发于 XULPlanet)</div>
-<div>
- <p><strong>XUL</strong> 是一个Mozilla使用XML来描述用户界面的一种技术,使用XUL你可以快速的创建出跨平台,基于因特网的应用程序。基于XUL技术的应用程序可以很方便的使用好看的字体、图形以及方便的界面布局,而且也更容易部署和定制。如果程序员已经熟悉了Dynamic HTML (<a href="/cn/DHTML" title="cn/DHTML">DHTML</a>),那学习XUL将是更容易的事,也可以更快的开发基于XUL的应用程序.</p>
-</div>
-<table class="topicpage-table">
- <tbody>
- <tr>
- <td>
- <h4 id=".E6.8E.A8.E8.8D.90.E7.9A.84.E6.96.87.E7.AB.A0" name=".E6.8E.A8.E8.8D.90.E7.9A.84.E6.96.87.E7.AB.A0">推荐的文章</h4>
- <dl>
- <dt>
- <a href="/cn/XUL_Reference" title="cn/XUL Reference">XUL模板手册</a></dt>
- <dd>
- <small>XUL模板是用于提供来自查询或是类似于结果集的内容块的一种方法.一个比较好的例子像数据库查询集.对于每个查询结果集,生成相关的内容块.XUL模板允许使用不的规则来生成基于特定要求的不同内容块,也允许给返回结果集设置属性.</small></dd>
- </dl>
- <dl>
- <dt>
- <a class="internal" href="/cn/XUL/XUL_教程" title="cn/XUL/XUL 教程">XUL 教程</a></dt>
- <dd>
- <small>这份教程教你如何进入XUL (XML User Interface Language,Mozilla的平台无关界面描述语言)神奇世界.设计一个简单的"查找文件"的界面, 对XUL的各种特性进行了解和学习.</small></dd>
- </dl>
- <dl>
- <dt>
- <a href="/Cn/XUL/用XUL做你意想不到的事" title="cn/XUL/用XUL做你意想不到的事">XUL:用XUL做你意想不到的事</a></dt>
- <dd>
- <small>Vlad Vukicevic 写完了这个大杂烩式的 FAQ, 列出了在 XUL 中可以做的事情 (hopefully with bug numbers), 不可以做的事情 (hopefully with explanations), 以及如何解决它们的办法. 欢迎各位添加自己的 XUL 体验到文章里.</small></dd>
- </dl>
- <dl>
- <dt>
- <a href="/cn/XTech_2005_Presentations/XUL_-_Mozilla's_XML_User_Interface_Language" title="cn/XTech_2005_Presentations/XUL_-_Mozilla's_XML_User_Interface_Language">Mozilla's XML 用户接口语言</a> (表现层)</dt>
- <dd>
- <small>Ben Goodger 在阿姆斯特丹(</small><small>Amsterdam</small><small>)的</small><small> XTech 2005 大会上给出了这份关于 XUL 的表现层</small><small>.</small></dd>
- </dl>
- <dl>
- <dt>
- <span class="exlink"><a href="/cn/XUL应用程序教程" title="cn/XUL应用程序教程">XUL应用程序教程</a></span></dt>
- <dd>
- <small>这个教程被设计用来教你学会如何创建一个基于 XUL 的简单程序, 通过循序渐进地开发一个 XUL 程序来演示要讨论的概念.</small></dd>
- </dl>
- <p><br>
- <span class="alllinks"><a href="/Special:Tags?tag=XUL:Articles&amp;language=zh-cn" title="Special:Tags?tag=XUL:Articles&amp;language=zh-cn">显示所有...</a></span></p>
- </td>
- <td>
- <p> </p>
- <h4 id=".E7.89.B9.E8.89.B2.E4.B8.BB.E9.A2.98" name=".E7.89.B9.E8.89.B2.E4.B8.BB.E9.A2.98">特色主题</h4>
- <ul>
- <li><a href="/cn/XUL_%E6%95%99%E7%A8%8B" title="cn/XUL_教程">XUL 教程</a></li>
- <li><a href="/cn/Preferences_System" title="cn/Preferences_System">Preferences System</a></li>
- <li><a href="/cn/XUL/Template_Guide" title="cn/XUL/Template_Guide">模板手册</a></li>
- <li><a href="/cn/Adapting_XUL_Applications_for_Firefox_1.5" title="cn/Adapting_XUL_Applications_for_Firefox_1.5">Adapting XUL Applications for Firefox 1.5</a></li>
- </ul>
- <h4 id=".E5.85.B6.E4.BB.96.E9.A1.B5.E9.9D.A2" name=".E5.85.B6.E4.BB.96.E9.A1.B5.E9.9D.A2">其他页面</h4>
- <ul>
- <li><a href="/Special:Tags?tag=XUL:References&amp;language=zh-cn" title="Special:Tags?tag=XUL:References&amp;language=zh-cn">XUL 手册</a></li>
- <li><a href="/Special:Tags?tag=XUL:Articles&amp;language=zh-cn" title="Special:Tags?tag=XUL:Articles&amp;language=zh-cn">XUL 文章</a></li>
- <li><a href="/Special:Tags?tag=XUL:Tools&amp;language=zh-cn" title="Special:Tags?tag=XUL:Tools&amp;language=zh-cn">工具</a></li>
- <li><a href="/Special:Tags?tag=XUL:Examples&amp;language=zh-cn" title="Special:Tags?tag=XUL:Examples&amp;language=zh-cn">示例</a></li>
- <li><a href="/cn/XUL/Community" title="cn/XUL/Community">社区</a></li>
- <li><a href="/cn/XUL/Other_Resources" title="cn/XUL/Other_Resources">其他资源</a></li>
- </ul>
- <h4 id=".E5.85.B3.E8.81.94.E4.B8.BB.E9.A2.98" name=".E5.85.B3.E8.81.94.E4.B8.BB.E9.A2.98">关联主题</h4>
- <dl>
- <dd>
- <a href="/cn/JavaScript" title="cn/JavaScript">JavaScript</a>, <a href="/cn/xbl" title="cn/xbl">XBL</a>, <a href="/cn/CSS" title="cn/CSS">CSS</a>, <a href="/cn/RDF" title="cn/RDF">RDF</a><span class="alllinks"><a class="external" href="http://developer.mozilla.org/webwatch/?cat=23">显示所有...</a></span></dd>
- </dl>
- </td>
- </tr>
- </tbody>
-</table>
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/key/index.html b/files/zh-cn/mozilla/tech/xul/key/index.html
deleted file mode 100644
index 13fabfbd2d..0000000000
--- a/files/zh-cn/mozilla/tech/xul/key/index.html
+++ /dev/null
@@ -1,166 +0,0 @@
----
-title: key
-slug: Mozilla/Tech/XUL/key
-tags:
- - XUL Elements
- - XUL Reference
-translation_of: Archive/Mozilla/XUL/key
----
-<div class="noinclude">
- <span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-<p>The <code>key</code> element defines a keyboard shortcut. Event handlers can be used to respond when the appropriate keys are pressed. A <code>key</code> element must be placed inside a <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/keyset" title="keyset">keyset</a></code> element.</p>
-<p>When a key matching the attributes on the key element is pressed, the command will be fired on the key element. The key pressed must match the key attribute (or keycode attribute) as well as the modifiers attribute in order for the key element to be activated and fire a command event.</p>
-<p>For example, consider the following key:</p>
-<pre class="eval">&lt;key key="r" modifiers="shift"/&gt;
-</pre>
-<p>This key will only match when the Shift key is pressed as well as the R key, and no other keys. For instance, if the Shift, Control and R keys are all pressed, the key will not match.</p>
-<p>To indiciate that a modifier key may optionally be pressed, place the word 'any' after listing the optional modifier key. For example:</p>
-<pre class="eval">&lt;key key="r" modifiers="shift any control"/&gt;
-</pre>
-<p>In this example, the shift key may or may not be pressed, while the control key must be pressed. This allows keys to match more loosely for modifier keys that aren't relevant, yet still allows specific modifiers to be required.</p>
-<p>If the modifiers attribute is not specified, then no modifiers may be pressed for the key to match.</p>
-<p>If neither the key or keycode attribute are used, the key element will handle all key events. However, if one of the attributes is set to an empty string, the element doesn't handle any key events. For example:</p>
-<pre class="eval">&lt;!-- This element handles all key events --&gt;
-&lt;key/&gt;
-
-&lt;!-- These elements don't handle any key events --&gt;
-&lt;key key="" modifiers="control"/&gt;
-&lt;key keycode="" modifiers="control"/&gt;
-</pre>
-<p>More information is available in the <a href="cn/XUL_Tutorial/Keyboard_Shortcuts">XUL tutorial</a>.</p>
-<dl>
- <dt>
- Attributes</dt>
- <dd>
- <a href="#a-command">command</a>, <a href="#a-disabled">disabled</a>, <a href="#a-key">key</a>, <a href="#a-keycode">keycode</a>, <a href="#a-keytext">keytext</a>, <a href="#a-modifiers">modifiers</a>, <a href="#a-oncommand">oncommand</a>, <a href="#a-phase">phase</a></dd>
-</dl>
-<h3 id="Examples" name="Examples">Examples</h3>
-<p>(example needed)</p>
-<h3 id="Attributes" name="Attributes">Attributes</h3>
-<p> </p><div id="a-command">
-
-<dl>
- <dt>
- <code id="a-command"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/command">command</a></code></dt>
- <dd>
- Type:
- <i>
- element id</i>
- </dd>
- <dd>
- Set to the <code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code> of a <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/command" title="command">command</a></code> element that is being observed by the element.</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-disabled">
-
-
-<dl>
- <dt><code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code></dt>
- <dd> </dd>
- <dd>
- <h5 id="类型boolean">类型:<em>boolean</em></h5>
- </dd>
- <dd>
- <h5 id="表示元素是被禁用的。">表示元素是被禁用的。</h5>
-
- <p>如果这个元素的disabled属性被设置为true,表示元素被禁用,被禁用的属性在页面上通常会显示灰色文本,它无法响应用户的操作,它也无法得到光标。</p>
-
- <p>然而,这个元素仍然能够响应鼠标事件,如果要启用这个元素,把disabled设置为false</p>
- </dd>
-</dl>
-
-<h4 id="示例:">示例:</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_attr_disabled.png" src="https://mdn.mozillademos.org/files/1742/XUL_ref_attr_disabled.png"></div>
-
-<pre><code>// Disabling an element
-document.getElementById('buttonRemove').setAttribute("disabled", "true");
-
-// Enabling back an element by removing the "disabled" attribute
-document.getElementById('buttonRemove').removeAttribute("disabled");</code></pre>
-
-<p></p><div class="blockIndicator standardNote standardNoteBlock">
- <p><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Firefox/Releases/3.5">Firefox 3.5 note</a></p>
- <p style="font-weight: 400;">For <a href="https://developer.mozilla.org/en-US/docs/XUL/keyset" title="en/XUL/Keyset"><code>keyset</code></a> elements, support for this attribute was added in Firefox 3.5.</p>
-</div><p></p>
-</div> <div id="a-key">
-
-
-<dl>
- <dt><code id="a-key"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/key">key</a></code></dt>
- <dd>Type: <em>character</em></dd>
- <dd>The character that must be pressed. This should be set to a displayable character.</dd>
-</dl>
-</div> <div id="a-keycode">
-
-
-<dl>
- <dt><code id="a-keycode"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/keycode">keycode</a></code></dt>
- <dd>Type: <em>string key code</em></dd>
- <dd>For keys that do not have displayable characters, such as the Enter key or function keys, use this attribute instead of the <code id="a-key"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/key">key</a></code> attribute. Valid keys are listed at <a class="internal" href="/en/XUL_Tutorial/Keyboard_Shortcuts" title="en/XUL Tutorial/Keyboard Shortcuts">Keyboard Shortcuts</a>.</dd>
-</dl>
-</div> <div id="a-keytext">
-
-
-<dl>
- <dt><code id="a-keytext"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/keytext">keytext</a></code></dt>
- <dd>Type: <em>string</em></dd>
- <dd>A label for the keyboard shortcut. This text would appear next to a <code><a href="/en-US/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code> label if that <code><a href="/en-US/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code> is associated with the <code><a href="/en-US/docs/Mozilla/Tech/XUL/key" title="key">key</a></code> element via its <code id="a-key"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/key">key</a></code> attribute.</dd>
-</dl>
-</div> <div id="a-modifiers">
-
-
-<dl>
- <dt><code id="a-modifiers"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/modifiers">modifiers</a></code></dt>
- <dd>Type: <em>space-separated list of the values below</em></dd>
- <dd>A list of modifier keys that should be pressed to invoke the keyboard shortcut. Multiple keys may be separated by spaces or commas. Keys will map to other keys on platforms that do not have them.</dd>
-</dl>
-
-<ul>
- <li><code>shift</code>: The Shift key.</li>
- <li><code>alt</code>: The Alt key. On the Macintosh, this is the Option key. On Macintosh this can only be used in conjunction with another modifier, since Alt+Letter combinations are reserved for entering special characters in text.</li>
- <li><code>meta</code>: The Meta key. On the Macintosh, this is the Command key.</li>
- <li><code>control</code>: The Control key.</li>
- <li><code>os</code>: Windows logo key on Windows, Super or Hyper key on Linux. This shouldn't be specified directly because it may conflict with system wide shortcut key. </li>
- <li><code>accel</code>: The key used for keyboard shortcuts on the user's platform, which is Control on Windows and Linux, and Command on Mac. Usually, this would be the value you would use.</li>
- <li><code>access</code>: The access key for activating menus and other elements. On Windows, this is the Alt key, used in conjuction with an element's accesskey.</li>
- <li><code>any</code>: Indicates that all modifiers preceding it are optional.</li>
-</ul>
-</div> <div id="a-oncommand">
-
-
-<dl>
- <dt><code id="a-oncommand"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/oncommand">oncommand</a></code></dt>
- <dd>Type: <em>script code</em></dd>
- <dd>This event handler is called when the command is activated. This occurs when a user selects a menu item or presses a keyboard shortcut attached to the command.</dd>
-</dl>
-
-
-</div> <div id="a-phase">
-
-
-<dl>
- <dt><code id="a-phase"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/phase">phase</a></code></dt>
- <dd>Type: <em>string</em></dd>
- <dd>The event phase where the handler is invoked. This should be set to the value <code>capturing</code> to indicate during the event capturing phase or <code>target</code> to indicate at the target element or left out entirely for the bubbling phase.</dd>
-</dl>
-</div><p></p>
-<h3 id="Properties" name="Properties">Properties</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited Properties</strong><br> <small> <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/align">align</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/allowEvents">allowEvents</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/boxObject">boxObject</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/builder">builder</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/className">className</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/collapsed">collapsed</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/contextMenu">contextMenu</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/controllers">controllers</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/database">database</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/datasources">datasources</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/dir">dir</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/flex">flex</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/height">height</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/hidden">hidden</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/id">id</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/left">left</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/maxHeight">maxHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/maxWidth">maxWidth</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/menu">menu</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/minHeight">minHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/minWidth">minWidth</a></span></code>, , , , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/observes">observes</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/ordinal">ordinal</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/orient">orient</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/pack">pack</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/persist">persist</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/ref">ref</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/resource">resource</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/statusText">statusText</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/style">style</a></span></code>, ,, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tooltip">tooltip</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tooltipText">tooltipText</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/top">top</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/width">width</a></span></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Methods" name="Methods">Methods</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited from XUL element</strong><br> <small> <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span></small></p> <p><strong>Inherited from DOM element</strong><br> <small> <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Related" name="Related">Related</h3>
-<p>TBD</p>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/label/index.html b/files/zh-cn/mozilla/tech/xul/label/index.html
deleted file mode 100644
index f6201f62c0..0000000000
--- a/files/zh-cn/mozilla/tech/xul/label/index.html
+++ /dev/null
@@ -1,298 +0,0 @@
----
-title: label
-slug: Mozilla/Tech/XUL/label
-tags:
- - XUL Elements
- - XUL Reference
-translation_of: Archive/Mozilla/XUL/label
----
-<div class="noinclude">
- <span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-<p>This element is used to provide a label for a control element. If the user clicks the label, it will move the focus to the associated control, specified with the <code id="a-control"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/control">control</a></code> attribute.</p>
-<p>More information is available in the <a href="cn/XUL_Tutorial/Adding_Labels_and_Images">XUL tutorial</a>.</p>
-<dl>
- <dt>
- Attributes</dt>
- <dd>
- <a href="#a-accesskey">accesskey</a>, <a href="#a-control">control</a>, <a href="#a-crop">crop</a>, <a href="#a-disabled">disabled</a>, <a href="#a-href">href</a>, <a href="#a-label.value">value</a></dd>
-</dl>
-<dl>
- <dt>
- Properties</dt>
- <dd>
- <a href="#p-accessKey">accessKey</a>, <a href="#p-accessibleType">accessibleType</a>, <a href="#p-control">control</a>, <a href="#p-crop">crop</a>, <a href="#p-disabled">disabled</a>, <a href="#p-value">value</a></dd>
-</dl>
-<dl>
- <dt>
- Style classes</dt>
- <dd>
- <a href="#s-header">header</a>, <a href="#s-indent">indent</a>, <a href="#s-monospace">monospace</a>, <a href="#s-plain">plain</a>, <a href="#s-small-margin">small-margin</a>, <a href="#s-text-link">text-link</a></dd>
-</dl>
-<h3 id="Examples" name="Examples">Examples</h3>
-<div class="float-right">
- <img alt="Image:XUL_ref_label.png"></div>
-<pre class="eval">&lt;label value="Email address" control="email"/&gt;
-&lt;textbox id="email"/&gt;
-</pre>
-<h3 id="Attributes" name="Attributes">Attributes</h3>
-<p> </p><div id="a-accesskey">
-
-
-
-
-<dl>
- <dt><code id="a-accesskey"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/accesskey">accesskey</a></code></dt>
- <dd>类型:
- <i>character【字符】</i>
- </dd>
- <dd>本属性允许为控件(元素)设定一个字符作为快捷键,这个字符应该是 <code><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></code> 属性文本中的一个字符。该字符将会被加下划线以重点强调,平台和主体的变换并不影响这一表现行为。 当用户点击 ALT (在其他平台上具有类似功能的键) 和这个字符对应的按键时, 控件(元素)将立刻被从窗口中的某处激活或/并且获得焦点 <b>。虽说字符不分大小写,但是当label中存在大写字符和小写字符时,快捷键的字符将首先选择与之完全匹配的那一个,如果label中存在两个或更多的与accesskey字符相同的字符,其中的第一个字符将被加下划线。</b></dd>
- <dt>      *(有些键在监听按键事件时,分别对应event.ctrlKey和event.metaKey。)</dt>
-</dl>
-
-<p> </p>
-
-<h4 id="Example" name="Example">Example</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_accesskey_attr.png"></div>
-
-<pre>&lt;vbox&gt;
- &lt;label value="Enter Name" accesskey="e" control="myName"/&gt;
- &lt;textbox id="myName"/&gt;
- &lt;button label="Cancel" accesskey="n"/&gt;
- &lt;button label="Ok" accesskey="O"/&gt;
-&lt;/vbox&gt;
-</pre>
-
-<h4 id="See_also" name="See_also">See also</h4>
-
-<p><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code> attribute, <code id="a-acceltext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/acceltext">acceltext</a></code> attribute</p>
-
-<p></p>
-</div> <div id="a-control">
-
-<dl>
- <dt>
- <code id="a-control"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/control">control</a></code></dt>
- <dd>
- Type: <em>element id</em></dd>
- <dd>
- This attribute specifies the <code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code> of the element with which the label is associated. When the user clicks on the label, the associated element is given focus.<br>
- 这个属性定义了元素的<code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code>,它与<code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code>相关联。当用户点击 <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code> 的时候,相关联的元素将获得焦点。</dd>
-</dl>
-
-<p> </p>
-</div> <div id="a-crop">
-
-<dl>
- <dt>
- <code id="a-crop"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/crop">crop</a></code></dt>
- <dd>
- Type:
- <i>
- one of the values below</i>
- </dd>
- <dd>
- If the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the <code>crop</code> attribute. An ellipsis will be used in place of the cropped text. If the box direction is reversed, the cropping is reversed.</dd>
-</dl>
-<ul>
- <li><code>start</code>: The text will be cropped on its left side.</li>
- <li><code>end</code>: The text will be cropped on its right side.</li>
- <li><code>left</code>: <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> The text will be cropped on its left side.</li>
- <li><code>right</code>: <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> The text will be cropped on its right side.</li>
- <li><code>center</code>: The text will be cropped in the middle, showing both the start and end of the text normally.</li>
- <li><code>none</code>: The text will be not be cropped using an ellipsis. However, the text will simply be cut off if it is too large. The side depends on the CSS text alignment.</li>
-</ul>
-
-<p></p>
-</div> <div id="a-disabled">
-
-
-<dl>
- <dt><code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code></dt>
- <dd> </dd>
- <dd>
- <h5 id="类型boolean">类型:<em>boolean</em></h5>
- </dd>
- <dd>
- <h5 id="表示元素是被禁用的。">表示元素是被禁用的。</h5>
-
- <p>如果这个元素的disabled属性被设置为true,表示元素被禁用,被禁用的属性在页面上通常会显示灰色文本,它无法响应用户的操作,它也无法得到光标。</p>
-
- <p>然而,这个元素仍然能够响应鼠标事件,如果要启用这个元素,把disabled设置为false</p>
- </dd>
-</dl>
-
-<h4 id="示例:">示例:</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_attr_disabled.png" src="https://mdn.mozillademos.org/files/1742/XUL_ref_attr_disabled.png"></div>
-
-<pre><code>// Disabling an element
-document.getElementById('buttonRemove').setAttribute("disabled", "true");
-
-// Enabling back an element by removing the "disabled" attribute
-document.getElementById('buttonRemove').removeAttribute("disabled");</code></pre>
-
-<p></p><div class="blockIndicator standardNote">
- <p><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Firefox/Releases/3.5">Firefox 3.5 note</a></p>
- <p style="font-weight: 400;">For <a href="https://developer.mozilla.org/en-US/docs/XUL/keyset" title="en/XUL/Keyset"><code>keyset</code></a> elements, support for this attribute was added in Firefox 3.5.</p>
-</div><p></p>
-</div> <div id="a-href">
-
-
-<dl>
- <dt><code id="a-href"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/href">href</a></code></dt>
- <dd>类型: <em>文本</em></dd>
- <dd>定义一个当元素被点击时将会打开的 URL 。需要引用类 <a href="/en/XUL/Style/text-link" title="en/XUL/Style/text-link">text-link </a>。</dd>
-</dl>
-
-
-
-
-</div> <div id="a-label.value">
-
-
-<dl>
- <dt><code id="a-label.value"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/label.value">value</a></code></dt>
- <dd>Type: <em>string</em></dd>
- <dd>The text to be used for the label.</dd>
-</dl>
-</div><p></p>
-<h3 id="Properties" name="Properties">Properties</h3>
-<p> </p><div id="p-accessKey">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessKey">accessKey</a></span></code></dt>
- <dd>
- Type:
- <i>
- character</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-accesskey"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/accesskey">accesskey</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-accessibleType">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessibleType">accessibleType</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- A value indicating the type of accessibility object for the element.</dd>
-</dl>
-
-<p></p></div> <div id="p-control">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/control">control</a></span></code></dt>
- <dd>
- Type: <em>element id</em></dd>
- <dd>
- Gets and sets the value of the <code id="a-control"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/control">control</a></code> attribute.</dd>
-</dl>
-</div> <div id="p-crop">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/crop">crop</a></span></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-crop"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/crop">crop</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-disabled">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/disabled">disabled</a></span></code></dt>
- <dd>
- Type:
- <i>
- boolean</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-value">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/value">value</a></span></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code> attribute.</dd>
-</dl>
-
-<p></p></div><p></p>
-<h3 id="Methods" name="Methods">Methods</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited from XUL element</strong><br> <small> <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span></small></p> <p><strong>Inherited from DOM element</strong><br> <small> <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Style_classes" name="Style_classes">Style classes</h3>
-<p>The following classes may be used to style the element. These classes should be used instead of changing the style of the element directly since they will fit more naturally with the user's selected theme.</p>
-<p></p><dl>
- <dt><code><a href="https://developer.mozilla.org/en-US/docs/XUL/Style/header">header</a></code></dt>
- <dd>A class used for headings. Typically, this will cause the text to appear bold.</dd>
-</dl> <dl>
- <dt><code><a href="https://developer.mozilla.org/en-US/docs/XUL/Style/indent">indent</a></code></dt>
- <dd>This class causes the text to be indented on its left side.</dd>
-</dl> <dl>
- <dt><code><a href="https://developer.mozilla.org/en-US/docs/XUL/Style/monospace">monospace</a></code></dt>
- <dd>This class causes the text to be displayed in a monospace font.</dd>
-</dl> <dl>
- <dt><code><a href="https://developer.mozilla.org/en-US/docs/XUL/Style/plain">plain</a></code></dt>
- <dd>This class causes the element to be displayed with no border or margin.</dd>
-</dl> <dl>
- <dt><code><a href="https://developer.mozilla.org/en-US/docs/XUL/Style/small-margin">small-margin</a></code></dt>
- <dd>This class causes the text to be displayed with a smaller margin.</dd>
-</dl> <dl>
- <dt><code><a href="https://developer.mozilla.org/en-US/docs/XUL/Style/text-link">text-link</a></code></dt>
- <dd>Labels with this class may be focused and the click handler run or the address in the <a href="/en/XUL/Attribute/href" title="en/XUL/Attribute/href">href attribute</a> opened on a mouse click or Enter key press. Labels will appear like a link (blue and underlined).</dd>
-</dl><p></p>
-<h3 id="Related" name="Related">Related</h3>
-<dl>
- <dt>
- Elements</dt>
- <dd>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/description" title="description">description</a></code></dd>
-</dl>
-<dl>
- <dt>
- Attributes</dt>
- <dd>
- <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></dd>
-</dl>
-<dl>
- <dt>
- Interfaces</dt>
- <dd>
- <a href="cn/NsIAccessibleProvider">nsIAccessibleProvider</a>, <a href="cn/NsIDOMXULLabelElement">nsIDOMXULLabelElement</a></dd>
-</dl>
-<h3 id="User_notes" name="User_notes">User notes</h3>
-<p>Remember that the label element has a "value" attribute, unlike value in HTML whereas buttons, checkboxes use label="foo" as the attribute</p>
-<pre>&lt;label label="A Caption"/&gt; &lt;-- wrong --&gt;
-&lt;label value="A Caption"/&gt;
-
-&lt;label value="Click the button"/&gt;
-&lt;button label="A Button"/&gt;
-&lt;checkbox label="A Decision" value="1"/&gt;
-</pre>
-<p> </p>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/list_of_commands/index.html b/files/zh-cn/mozilla/tech/xul/list_of_commands/index.html
deleted file mode 100644
index 54ff23cabf..0000000000
--- a/files/zh-cn/mozilla/tech/xul/list_of_commands/index.html
+++ /dev/null
@@ -1,196 +0,0 @@
----
-title: List of commands
-slug: Mozilla/Tech/XUL/List_of_commands
-translation_of: Archive/Mozilla/XUL/List_of_commands
----
-<p>The following lists <a href="/en/XUL_Tutorial/Commands" title="en/XUL_Tutorial/Commands">commands</a> which might be usable by &lt;command&gt; or command dispatchers/controllers.</p>
-<h3 id="List_of_Commands_.28grouped_by_type.29" name="List_of_Commands_.28grouped_by_type.29">List of Commands (grouped by type)</h3>
-<h4 id="nsDomWindowController_commands_.28generally_legal_when_there_is_a_selection.29:" name="nsDomWindowController_commands_.28generally_legal_when_there_is_a_selection.29:">nsDomWindowController commands (generally legal when there is a selection):</h4>
-<ul>
- <li>cmd_copy - copy a selection to the clipboard</li>
- <li>cmd_cut - cut a selection into the clipboard</li>
- <li>cmd_paste - paste a selection from the clipboard</li>
- <li>cmd_selectAll</li>
- <li>cmd_selectNone</li>
- <li>cmd_copyLink</li>
- <li>cmd_copyImageLocation</li>
- <li>cmd_copyImageContents</li>
- <li>cmd_scrollTop</li>
- <li>cmd_scrollBottom</li>
- <li>cmd_scrollPageUp</li>
- <li>cmd_scrollPageDown</li>
- <li>cmd_scrollLineUp</li>
- <li>cmd_scrollLineDown</li>
- <li>cmd_scrollLeft</li>
- <li>cmd_scrollRight</li>
- <li>cmd_selectCharPrevious</li>
- <li>cmd_selectCharNext</li>
- <li>cmd_wordPrevious</li>
- <li>cmd_wordNext</li>
- <li>cmd_selectWordPrevious</li>
- <li>cmd_selectWordNext</li>
- <li>cmd_beginLine</li>
- <li>cmd_endLine</li>
- <li>cmd_selectBeginLine</li>
- <li>cmd_selectEndLine</li>
- <li>cmd_selectLinePrevious</li>
- <li>cmd_selectLineNext</li>
- <li>cmd_selectPagePrevious</li>
- <li>cmd_selectPageNext</li>
- <li>cmd_selectMoveTop</li>
- <li>cmd_selectMoveBottom</li>
-</ul>
-<h4 id="Editor_commands_.28legal_when_the_focus_is_anywhere_where_you_can_type_text.29:" name="Editor_commands_.28legal_when_the_focus_is_anywhere_where_you_can_type_text.29:">Editor commands (legal when the focus is anywhere where you can type text):</h4>
-<ul>
- <li>cmd_paste - paste a selection from the clipboard</li>
- <li>cmd_pasteQuote</li>
- <li>cmd_delete</li>
- <li>cmd_deleteCharBackward</li>
- <li>cmd_deleteCharForward</li>
- <li>cmd_deleteWordBackward</li>
- <li>cmd_deleteWordForward</li>
- <li>cmd_deleteToBeginningOfLine</li>
- <li>cmd_deleteToEndOfLine</li>
- <li>cmd_scrollTop</li>
- <li>cmd_scrollBottom</li>
- <li>cmd_moveTop</li>
- <li>cmd_moveBottom</li>
- <li>cmd_selectTop</li>
- <li>cmd_selectBottom</li>
- <li>cmd_lineNext</li>
- <li>cmd_linePrevious</li>
- <li>cmd_selectLineNext</li>
- <li>cmd_selectLinePrevious</li>
- <li>cmd_charPrevious</li>
- <li>cmd_charNext</li>
- <li>cmd_selectCharPrevious</li>
- <li>cmd_selectCharNext</li>
- <li>cmd_beginLine</li>
- <li>cmd_endLine</li>
- <li>cmd_selectBeginLine</li>
- <li>cmd_selectEndLine</li>
- <li>cmd_wordPrevious</li>
- <li>cmd_wordNext</li>
- <li>cmd_selectWordPrevious</li>
- <li>cmd_selectWordNext</li>
- <li>cmd_scrollPageUp</li>
- <li>cmd_scrollPageDown</li>
- <li>cmd_scrollLineUp</li>
- <li>cmd_scrollLineDown</li>
- <li>cmd_movePageUp</li>
- <li>cmd_movePageDown</li>
- <li>cmd_selectPageUp</li>
- <li>cmd_selectPageDown</li>
-</ul>
-<h4 id="Other_commands" name="Other_commands">Other commands</h4>
-<p>The following list other commands (prefixed by cmd_ or Browser:) which have not been categorized here yet (though they are in the alphabetical list below):</p>
-<ul>
- <li><a class="external" href="http://lxr.mozilla.org/seamonkey/source/xpfe/browser/resources/content/linkToolbarOverlay.xul" rel="freelink">http://lxr.mozilla.org/seamonkey/sou...barOverlay.xul</a></li>
- <li><a class="external" href="http://lxr.mozilla.org/seamonkey/source/xpfe/browser/resources/content/navigator.js" rel="freelink">http://lxr.mozilla.org/seamonkey/sou...t/navigator.js</a></li>
- <li><a class="external" href="http://lxr.mozilla.org/seamonkey/source/xpfe/browser/resources/content/navigatorOverlay.xul" rel="freelink">http://lxr.mozilla.org/seamonkey/sou...torOverlay.xul</a></li>
- <li><a class="external" href="http://lxr.mozilla.org/seamonkey/source/xpfe/browser/resources/content/personalToolbar.js" rel="freelink">http://lxr.mozilla.org/seamonkey/sou...onalToolbar.js</a></li>
- <li><a class="external" href="http://lxr.mozilla.org/seamonkey/source/xpfe/browser/resources/content/viewSourceOverlay.xul" rel="freelink">http://lxr.mozilla.org/seamonkey/sou...rceOverlay.xul</a></li>
- <li><a class="external" href="http://lxr.mozilla.org/seamonkey/source/xpfe/communicator/resources/content/contentAreaContextOverlay.xul" rel="freelink">http://lxr.mozilla.org/seamonkey/sou...extOverlay.xul</a></li>
- <li><a class="external" href="http://lxr.mozilla.org/seamonkey/source/xpfe/communicator/resources/content/utilityOverlay.js" rel="freelink">http://lxr.mozilla.org/seamonkey/sou...lityOverlay.js</a></li>
- <li><a class="external" href="http://lxr.mozilla.org/seamonkey/source/xpfe/communicator/resources/content/viewZoomOverlay.xul" rel="freelink">http://lxr.mozilla.org/seamonkey/sou...oomOverlay.xul</a></li>
- <li><a class="external" href="http://lxr.mozilla.org/seamonkey/source/xpfe/communicator/resources/content/unix/platformCommunicatorOverlay.xul" rel="freelink">http://lxr.mozilla.org/seamonkey/sou...torOverlay.xul</a></li>
- <li><a class="external" href="http://lxr.mozilla.org/seamonkey/source/xpfe/components/bookmarks/resources/locale/en-US/bookmark.properties" rel="freelink">http://lxr.mozilla.org/seamonkey/sou...ark.properties</a></li>
- <li><a class="external" href="http://lxr.mozilla.org/seamonkey/source/xpfe/components/bookmarks/resources/bookmarks-temp.js" rel="freelink">http://lxr.mozilla.org/seamonkey/sou...kmarks-temp.js</a></li>
- <li><a class="external" href="http://lxr.mozilla.org/seamonkey/source/xpfe/components/bookmarks/resources/bookmarks.xml" rel="freelink">http://lxr.mozilla.org/seamonkey/sou.../bookmarks.xml</a></li>
- <li><a class="external" href="http://lxr.mozilla.org/seamonkey/source/xpfe/components/bookmarks/resources/bookmarksOverlay.xul" rel="freelink">http://lxr.mozilla.org/seamonkey/sou...rksOverlay.xul</a></li>
- <li><a class="external" href="http://lxr.mozilla.org/seamonkey/source/xpfe/components/bookmarks/resources/bookmarksTree.js" rel="freelink">http://lxr.mozilla.org/seamonkey/sou...okmarksTree.js</a></li>
-</ul>
-<p> </p>
-<h3 id="List_of_commands_.28listed_alphabetically.29" name="List_of_commands_.28listed_alphabetically.29">List of commands (listed alphabetically)</h3>
-<ul>
- <li>Browser:AddBookmark</li>
- <li>Browser:AddBookmarkAs</li>
- <li>Browser:AddGroupmarkAs</li>
- <li>Browser:Back</li>
- <li>Browser:EditPage</li>
- <li>Browser:Find</li>
- <li>Browser:FindAgain</li>
- <li>Browser:FindPrev</li>
- <li>Browser:Forward</li>
- <li>Browser:Home</li>
- <li>Browser:ManageBookmark</li>
- <li>Browser:Open</li>
- <li>Browser:OpenFile</li>
- <li>Browser:Print</li>
- <li>Browser:PrintPreview</li>
- <li>Browser:SavePage</li>
- <li>Browser:SearchInternet</li>
- <li>Browser:SendPage</li>
- <li>Browser:UploadFile</li>
- <li>cmd_bm_copy</li>
- <li>cmd_bm_cut</li>
- <li>cmd_bm_delete</li>
- <li>cmd_bm_expandfolder</li>
- <li>cmd_bm_export</li>
- <li>cmd_bm_find</li>
- <li>cmd_bm_import</li>
- <li>cmd_bm_managefolder</li>
- <li>cmd_bm_movebookmark</li>
- <li>cmd_bm_newbookmark</li>
- <li>cmd_bm_newfolder</li>
- <li>cmd_bm_newseparator</li>
- <li>cmd_bm_open</li>
- <li>cmd_bm_openinnewtab</li>
- <li>cmd_bm_openinnewwindow</li>
- <li>cmd_bm_paste</li>
- <li>cmd_bm_properties</li>
- <li>cmd_bm_rename</li>
- <li>cmd_bm_selectAll</li>
- <li>cmd_bm_setnewbookmarkfolder</li>
- <li>cmd_bm_setnewsearchfolder</li>
- <li>cmd_bm_setpersonaltoolbarfolder</li>
- <li>cmd_bm_sortfolder</li>
- <li>cmd_bm_sortfolderbyname</li>
- <li>cmd_close</li>
- <li>cmd_closeOtherTabs</li>
- <li>cmd_closeWindow</li>
- <li>cmd_copy</li>
- <li>cmd_copyImage</li>
- <li>cmd_copyLink</li>
- <li>cmd_cut</li>
- <li>cmd_delete</li>
- <li>cmd_editPage</li>
- <li>cmd_findTypeLinks</li>
- <li>cmd_findTypeText</li>
- <li>cmd_goToLine</li>
- <li>cmd_handleBackspace</li>
- <li>cmd_handleShiftBackspace</li>
- <li>cmd_minimizeWindow</li>
- <li>cmd_newEditor</li>
- <li>cmd_newEditorDraft</li>
- <li>cmd_newEditorTemplate</li>
- <li>cmd_newNavigator</li>
- <li>cmd_newNavigatorTab</li>
- <li>cmd_newTabWithTarget</li>
- <li>cmd_openHelp</li>
- <li>cmd_paste - paste a selection from the clipboard</li>
- <li>cmd_printSetup</li>
- <li>cmd_quit</li>
- <li>cmd_redo</li>
- <li>cmd_savePage</li>
- <li>cmd_scrollPageDown</li>
- <li>cmd_scrollPageUp</li>
- <li>cmd_selectAll</li>
- <li>cmd_SwitchDocumentDirection</li>
- <li>cmd_switchTextDirection</li>
- <li>cmd_textZoomEnlarge</li>
- <li>cmd_textZoomReduce</li>
- <li>cmd_textZoomReset</li>
- <li>cmd_undo</li>
- <li>cmd_viewcomponentbar</li>
- <li>cmd_viewlinktoolbar</li>
- <li>cmd_viewlinktoolbar_false</li>
- <li>cmd_viewlinktoolbar_maybe</li>
- <li>cmd_viewlinktoolbar_true</li>
- <li>cmd_viewnavbar</li>
- <li>cmd_viewpersonaltoolbar</li>
- <li>cmd_viewtaskbar</li>
- <li>cmd_zoomWindow</li>
-</ul>
-<p>Thanks for help of joe.user0 in compiling: <a class="external" href="http://readlist.com/lists/mozilla.org/mozilla-general/3/15261.html" rel="freelink">http://readlist.com/lists/mozilla.or...l/3/15261.html</a> . Also obtained from <a class="external" href="http://www.mozilla.org/unix/customizing.html" rel="freelink">http://www.mozilla.org/unix/customizing.html</a></p>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/listbox/index.html b/files/zh-cn/mozilla/tech/xul/listbox/index.html
deleted file mode 100644
index 04489bf06d..0000000000
--- a/files/zh-cn/mozilla/tech/xul/listbox/index.html
+++ /dev/null
@@ -1,480 +0,0 @@
----
-title: listbox
-slug: Mozilla/Tech/XUL/listbox
-translation_of: Archive/Mozilla/XUL/listbox
----
-<div class="noinclude">
- <span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-<p>This element is used to create a list of items where one or more of the items may be selected. A listbox may contain multiple columns. There are numerous methods which allow the items in the listbox to be retrieved and modified.</p>
-<p>You may specify the number of rows to display in the list using the <code id="a-rows"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/rows">rows</a></code> attribute. Additional rows can be viewed using a scroll bar. A listbox is expected to contain <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listitem" title="listitem">listitem</a></code> elements. All the rows in the listbox are the same height, which is the height of the tallest item in the list. If you wish to create a list with variable height rows, or with non-text content, you should instead use the <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/richlistbox" title="richlistbox">richlistbox</a></code> element.</p>
-<p>See <a href="/en/XUL_Tutorial/List_Controls" title="en/XUL_Tutorial/List_Controls">List Controls</a> for more information.</p>
-<dl>
- <dt>
- Attributes</dt>
- <dd>
- <a href="#a-disabled">disabled</a>, <a href="#a-disableKeyNavigation">disableKeyNavigation</a>, <a href="#a-preference">preference</a>, <a href="#a-rows">rows</a>, <a href="#a-seltype">seltype</a>, <a href="#a-suppressonselect">suppressonselect</a>, <a href="#a-tabindex">tabindex</a>, <a href="#a-value">value</a></dd>
-</dl>
-<dl>
- <dt>
- Properties</dt>
- <dd>
- <a href="#p-accessibleType">accessibleType</a>, <a href="#p-listbox.currentIndex">currentIndex</a>, <a href="#p-currentItem">currentItem</a>, <a href="#p-disabled">disabled</a>, <a href="#p-disableKeyNavigation">disableKeyNavigation</a>, <a href="#p-itemCount">itemCount</a>, <a href="#p-listBoxObject">listBoxObject</a>, <a href="#p-selectedCount">selectedCount</a>, <a href="#p-selectedIndex">selectedIndex</a>, <a href="#p-selectedItem">selectedItem</a>, <a href="#p-selectedItems">selectedItems</a>, <a href="#p-selType">selType</a>, <a href="#p-suppressOnSelect">suppressOnSelect</a>, <a href="#p-tabIndex">tabIndex</a>, <a href="#p-value">value</a></dd>
-</dl>
-<dl>
- <dt>
- Methods</dt>
- <dd>
- <a href="#m-addItemToSelection">addItemToSelection</a>, <a href="#m-appendItem">appendItem</a>, <a href="#m-clearSelection">clearSelection</a>, <a href="#m-ensureElementIsVisible">ensureElementIsVisible</a>, <a href="#m-ensureIndexIsVisible">ensureIndexIsVisible</a>, <a href="#m-getIndexOfFirstVisibleRow">getIndexOfFirstVisibleRow</a>, <a href="#m-getIndexOfItem">getIndexOfItem</a>, <a href="#m-getItemAtIndex">getItemAtIndex</a>, <a href="#m-getNumberofVisibleRows">getNumberofVisibleRows</a>, <a href="#m-getRowCount">getRowCount</a>, <a href="#m-getSelectedItem">getSelectedItem</a>, <a href="#m-insertItemAt">insertItemAt</a>, <a href="#m-invertSelection">invertSelection</a>, <a href="#m-moveByOffset">moveByOffset</a>, <a href="#m-removeItemAt">removeItemAt</a>, <a href="#m-removeItemFromSelection">removeItemFromSelection</a>, <a href="#m-scrollToIndex">scrollToIndex</a>, <a href="#m-selectAll">selectAll</a>, <a href="#m-selectItem">selectItem</a>, <a href="#m-selectItemRange">selectItemRange</a>, <a href="#m-timedSelect">timedSelect</a>, <a href="#m-toggleItemSelection">toggleItemSelection</a></dd>
-</dl>
-<h3 id="Examples" name="Examples">Examples</h3>
-<div class="float-right">
- <img alt="Image:XUL_ref_listbox.png" class="internal" src="/@api/deki/files/461/=XUL_ref_listbox.png"></div>
-<pre> &lt;listbox id="theList"&gt;
- &lt;listitem label="Ruby"/&gt;
- &lt;listitem label="Emerald"/&gt;
- &lt;listitem label="Sapphire" selected="true"/&gt;
- &lt;listitem label="Diamond"/&gt;
- &lt;/listbox&gt;
-
-</pre>
-<p><img alt="XulListBoxMultiColumn.PNG" class="internal default" src="/@api/deki/files/4189/=XulListBoxMultiColumn.PNG"></p>
-<pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 0px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; font: normal normal normal 12px/normal 'Courier New', 'Andale Mono', monospace; color: rgb(37, 34, 29);">&lt;listbox id="theList" rows="10" width="400"&gt;
- &lt;listhead&gt;
- &lt;listheader label="1ct Gem" width="240"/&gt;
- &lt;listheader label="Price" width="150"/&gt;
- &lt;/listhead&gt;
- &lt;listcols&gt;
- &lt;listcol/&gt;
- &lt;listcol flex="1"/&gt;
- &lt;/listcols&gt;
-&lt;/listbox&gt;
-
-var theList = document.getElementById('theList ');
- gems = [ {gem: "Ruby", Price: "$3,500 - $4,600"},
- {gem: "Emerald", Price: "$700 - 4,250"},
- {gem: "Blue Sapphire", Price: "$3,400 - $4,500"},
- {gem: "Diamond", Price: "$5,600 - $16,000"} ];
-for (var i = 0; i &lt; gems.length; i++)
- {
- var row = document.createElement('listitem');
- var cell = document.createElement('listcell');
- cell.setAttribute('label', gems[i].gem);
- row.appendChild(cell);
-
- cell = document.createElement('listcell');
- cell.setAttribute('label', gems[i].Price );
- row.appendChild(cell);
-
- theList.appendChild(row);
- }
-</pre>
-<pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.7em; margin-left: 0px; padding-top: 10px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; font: normal normal normal 12px/normal 'Courier New', 'Andale Mono', monospace; color: rgb(37, 34, 29);"> </pre>
-<h3 id="Attributes" name="Attributes">Attributes</h3>
-<p> </p><div id="a-disabled">
-
-
-<dl>
- <dt><code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code></dt>
- <dd> </dd>
- <dd>
- <h5 id="类型boolean">类型:<em>boolean</em></h5>
- </dd>
- <dd>
- <h5 id="表示元素是被禁用的。">表示元素是被禁用的。</h5>
-
- <p>如果这个元素的disabled属性被设置为true,表示元素被禁用,被禁用的属性在页面上通常会显示灰色文本,它无法响应用户的操作,它也无法得到光标。</p>
-
- <p>然而,这个元素仍然能够响应鼠标事件,如果要启用这个元素,把disabled设置为false</p>
- </dd>
-</dl>
-
-<h4 id="示例:">示例:</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_attr_disabled.png" src="https://mdn.mozillademos.org/files/1742/XUL_ref_attr_disabled.png"></div>
-
-<pre><code>// Disabling an element
-document.getElementById('buttonRemove').setAttribute("disabled", "true");
-
-// Enabling back an element by removing the "disabled" attribute
-document.getElementById('buttonRemove').removeAttribute("disabled");</code></pre>
-
-<p></p><div class="blockIndicator standardNote standardNoteBlock">
- <p><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Firefox/Releases/3.5">Firefox 3.5 note</a></p>
- <p style="font-weight: 400;">For <a href="https://developer.mozilla.org/en-US/docs/XUL/keyset" title="en/XUL/Keyset"><code>keyset</code></a> elements, support for this attribute was added in Firefox 3.5.</p>
-</div><p></p>
-</div> <div id="a-disableKeyNavigation">
-
-
-<dl>
- <dt><code id="a-disableKeyNavigation"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/disableKeyNavigation">disableKeyNavigation</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>If this attribute is not used, the user can navigate to specific items within the element by pressing keys corresponding to letters in the item's label. This is done incrementally, so typing more letters with select more specific items. This feature may be disabled by setting this attribute to <code>true</code>.</dd>
-</dl>
-</div> <div id="a-preference">
-
-
-<dl>
- <dt><code id="a-preference"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/preference">preference</a></code></dt>
- <dd>Type: <em>id</em></dd>
- <dd>Connects the element to a corresponding <code><a href="/en-US/docs/Mozilla/Tech/XUL/preference" title="preference">preference</a></code>. This attribute only has any effect when used inside a <code><a href="/en-US/docs/Mozilla/Tech/XUL/prefwindow" title="prefwindow">prefwindow</a></code>. More information is available in the <a href="../../../../en/Preferences_System" rel="internal">Preferences System</a> article.</dd>
-</dl>
-</div> <div id="a-rows">
-
-<dl>
- <dt>
- <code id="a-rows"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/rows">rows</a></code></dt>
- <dd>
- Type: <em>integer</em></dd>
- <dd>
- The number of rows to display in the element. If the element contains more than this number of rows, a scrollbar will appear which the user can use to scroll to the other rows. To get the actual number of rows in the element, use the <span id="m-getRowCount"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/getRowCount">getRowCount</a></code></span> method.</dd>
-</dl>
-</div> <div id="a-seltype">
-
-
-<dl>
- <dt><code id="a-seltype"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/seltype">seltype</a></code></dt>
- <dd>Type: <em>one of the values below</em></dd>
- <dd>Used to indicate whether multiple selection is allowed.</dd>
- <dd>
- <dl>
- <dt><code>single</code></dt>
- <dd>Only one row may be selected at a time. (Default in <code>listbox</code> and <code>richlistbox</code>.)</dd>
- <dt><code>multiple</code></dt>
- <dd>Multiple rows may be selected at once. (Default in <code>tree</code>.)</dd>
- </dl>
- </dd>
- <dd>
- <p>For trees, you can also use the following values:</p>
-
- <dl>
- <dt><code>cell</code></dt>
- <dd>Individual cells can be selected </dd>
- <dt><code>text</code></dt>
- <dd>Rows are selected; however, the selection highlight appears only over the text of the primary column.</dd>
- </dl>
-
- <p>For <code>richlistbox</code>, this is new in Firefox 3.5.</p>
- </dd>
-</dl>
-</div> <div id="a-suppressonselect">
-
-
-<dl>
- <dt><code id="a-suppressonselect"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/suppressonselect">suppressonselect</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>If this attribute is not specified, a select event is fired whenever an item is selected, either by the user or by calling one of the select methods. If set to <code>true</code>, the select event is never fired.</dd>
-</dl>
-</div> <div id="a-tabindex">
-
-
-<dl>
- <dt><code id="a-tabindex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tabindex">tabindex</a></code></dt>
- <dd>Type:<em>integer</em></dd>
- <dd>当用户按下 "<kbd>tab</kbd>" 键时焦点移动到元素上的顺序。<code>tabindex</code> 数字越大,顺序越靠后。</dd>
-</dl>
-
-
-
-<p></p>
-</div> <div id="a-value">
-
-<dl>
- <dt>
- <code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- The string attribute allows you to associate a data value with an element. It is not used for any specific purpose, but you can access it with a script for your own use.</dd>
-</dl>
-
-<p></p>
-</div><p></p>
-<h3 id="Properties" name="Properties">Properties</h3>
-<p> </p><div id="p-accessibleType">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessibleType">accessibleType</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- A value indicating the type of accessibility object for the element.</dd>
-</dl>
-
-<p></p></div> <div id="p-listbox.currentIndex">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/listbox.currentIndex">currentIndex</a></span></code></dt>
- <dd>Type: <em>integer</em></dd>
- <dd>Set to the index of the currently focused item in the list. If no item is focused, the value will be <code>-1</code>. (or, on some platforms, <code>typeof(listboxcurrentIndex)</code> will be <code>undefined</code>) In a single selection list, the current index will always be the same as the selected index. In a multiple selection list, the currently focused row may be modified by the user without changing the selection by pressing the Control key and pressing the cursor keys to navigate.</dd>
-</dl></div> <div id="p-currentItem">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/currentItem">currentItem</a></span></code></dt>
- <dd>Type: <em>listitem element</em></dd>
- <dd>Returns the currently focused item in the list box, which is only useful in a multiple selection list box.</dd>
-</dl></div> <div id="p-disabled">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/disabled">disabled</a></span></code></dt>
- <dd>
- Type:
- <i>
- boolean</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-disableKeyNavigation">
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/disableKeyNavigation">disableKeyNavigation</a></span></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>Gets or sets the value of the <code id="a-disableKeyNavigation"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/disableKeyNavigation">disableKeyNavigation</a></code> attribute.</dd>
-</dl></div> <div id="p-itemCount">
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/itemCount">itemCount</a></span></code> </dt>
- <dd>Type: <em>integer</em></dd>
- <dd>Read only property holding the number of child items.</dd>
-</dl>
-</div> <div id="p-listBoxObject">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/listBoxObject">listBoxObject</a></span></code></dt>
- <dd>
- Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIListBoxObject" title="">nsIListBoxObject</a></code></em></dd>
- <dd>
- The <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIListBoxObject" title="">nsIListBoxObject</a></code> behind the list box. This property is read-only. Most of the features of the list box are already available directly in the <code><a href="/en-US/docs/Mozilla/Tech/XUL/listbox" title="listbox">listbox</a></code>, so you will rarely have need to use this box object directly.</dd>
-</dl></div> <div id="p-selectedCount">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/selectedCount">selectedCount</a></span></code></dt>
- <dd>Type: <em>integer</em></dd>
- <dd>Returns the number of items that are currently selected.</dd>
-</dl></div> <div id="p-selectedIndex">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectedIndex">selectedIndex</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- Returns the index of the currently selected item. You may select an item by assigning its index to this property. By assigning <code>-1</code> to this property, all items will be deselected.</dd>
-</dl>
-
-<p></p></div> <div id="p-selectedItem">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectedItem">selectedItem</a></span></code></dt>
- <dd>
- Type:
- <i>
- element</i>
- </dd>
- <dd>
- Holds the currently selected item. If no item is currently selected, this value will be <code>null</code>. You can select an item by setting this value. A select event will be sent to the element when it is changed either via this property, the <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectedIndex">selectedIndex</a></span></code> property, or changed by the user.</dd>
-</dl>
-
-<p></p></div> <div id="p-selectedItems">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/selectedItems">selectedItems</a></span></code></dt>
- <dd>Type: <em>array of listitems</em></dd>
- <dd>Returns an array of the selected items in the list.</dd>
-</dl></div> <div id="p-selType">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/selType">selType</a></span></code> </dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- Gets and sets the value of the <code id="a-seltype"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/seltype">seltype</a></code> attribute.</dd>
-</dl>
-<p> </p></div> <div id="p-suppressOnSelect">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/suppressOnSelect">suppressOnSelect</a></span></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>Gets and sets the value of the <code id="a-suppressonselect"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/suppressonselect">suppressonselect</a></code> attribute.</dd>
-</dl></div> <div id="p-tabIndex">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tabIndex">tabIndex</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-tabindex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tabindex">tabindex</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-value">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/value">value</a></span></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code> attribute.</dd>
-</dl>
-
-<p></p></div><p></p>
-<h3 id="Methods" name="Methods">Methods</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0 0 10px 10px; padding: 0 10px; background: rgb(238, 238, 238); float: right; width: 250px;">
-<tbody>
-<tr>
-<td>
-<p><strong>Inherited Methods</strong><br>
-<small><code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.cloneNode">cloneNode()</a></code>, <a href="/En/DOM/Node.compareDocumentPosition" title="En/DOM/Node.compareDocumentPosition">compareDocumentPosition</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getBoundingClientRect">getBoundingClientRect()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getClientRects">getClientRects()</a></code>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span>, <span id="m-getElementsByAttributeNS"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttributeNS">getElementsByAttributeNS</a></code></span>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByClassName">getElementsByClassName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getFeature">getFeature()</a></code>, <a href="/En/DOM/Node.getUserData" title="En/DOM/Node.getUserData">getUserData</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isDefaultNamespace">isDefaultNamespace()</a></code>, <a href="/En/DOM/Node.isEqualNode" title="En/DOM/Node.isEqualNode">isEqualNode</a>, <a href="/En/DOM/Node.isSameNode" title="En/DOM/Node.isSameNode">isSameNode</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <a href="/En/DOM/Node.lookupNamespaceURI" title="En/DOM/Node.lookupNamespaceURI">lookupNamespaceURI</a>, <a href="/En/DOM/Node.lookupPrefix" title="En/DOM/Node.lookupPrefix">lookupPrefix</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.querySelector">querySelector()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.querySelectorAll">querySelectorAll()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code>, <a href="/En/DOM/Node.setUserData" title="En/DOM/Node.setUserData">setUserData</a></small></p>
-
-</td>
-</tr>
-</tbody>
-</table> <dl>
- <dt><span id="m-addItemToSelection"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/addItemToSelection">addItemToSelection( item )</a></code></span></dt>
- <dd>Return type: <em>no return value</em></dd>
- <dd>Selects the given <var>item</var>, without deselecting any other items that are already selected.</dd>
-</dl> <dl>
- <dt>
- <span id="m-appendItem"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/appendItem">appendItem( label, value )</a></code></span></dt>
- <dd>
- Return type: <em>element</em></dd>
- <dd>
- Creates a new item and adds it to the end of the existing list of items. You may optionally set a value. The function returns the newly created element.</dd>
-</dl> <dl>
- <dt><span id="m-clearSelection"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/clearSelection">clearSelection()</a></code></span></dt>
- <dd>Return type: <em>no return value</em></dd>
- <dd>Deselects all of the items.  A select event is sent before the items are deselected.</dd>
-</dl> <dl>
- <dt><span id="m-ensureElementIsVisible"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/ensureElementIsVisible">ensureElementIsVisible( element )</a></code></span></dt>
- <dd>Return type: <em>no return value</em></dd>
- <dd>If the specified element is not currently visible to the user, the displayed items are scrolled so that it is. If the item is already visible, no scrolling occurs.</dd>
-</dl> <dl>
- <dt><span id="m-ensureIndexIsVisible"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/ensureIndexIsVisible">ensureIndexIsVisible( index )</a></code></span></dt>
- <dd>Return type: <em>no return value</em></dd>
- <dd>If the item at the specified index is not currently visible to the user the displayed items are scrolled so that it is. If the item is already visible, no scrolling occurs.</dd>
-</dl> <dl>
- <dt><span id="m-getIndexOfFirstVisibleRow"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/getIndexOfFirstVisibleRow">getIndexOfFirstVisibleRow()</a></code></span></dt>
- <dd>Return type: <em>integer</em></dd>
- <dd>Returns the index of the first displayed row. Note that this is not the same as the first row -- if the displayed items have been scrolled down, this function will retrieve the index of the first row that the user can see.</dd>
-</dl> <dl>
- <dt><span id="m-getIndexOfItem"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/getIndexOfItem">getIndexOfItem( item )</a></code></span></dt>
- <dd>Return type: <em>integer</em></dd>
- <dd>Returns the zero-based position of the specified item. Items are numbered starting at the first item displayed in the list.</dd>
-</dl> <dl>
- <dt><span id="m-getItemAtIndex"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/getItemAtIndex">getItemAtIndex( index )</a></code></span></dt>
- <dd>Return type: <em>element</em></dd>
- <dd>Returns the element that is at the specified index.</dd>
-</dl> <dl>
- <dt><span id="m-getNumberOfVisibleRows"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/getNumberOfVisibleRows">getNumberOfVisibleRows()</a></code></span></dt>
- <dd>Return type: <em>integer</em></dd>
- <dd>Returns the number of rows that are currently visible to the user.</dd>
-</dl> <dl>
- <dt>
- <span id="m-getRowCount"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/getRowCount">getRowCount()</a></code></span></dt>
- <dd>
- Return type: <em>integer</em></dd>
- <dd>
- Returns the total number of rows in the element, regardless of how many rows are displayed.</dd>
-</dl> <dl>
- <dt><span id="m-getSelectedItem"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/getSelectedItem">getSelectedItem( index )</a></code></span></dt>
- <dd>Return type: <em>element</em></dd>
- <dd>When multiple items are selected, you can retrieve each selected item using this method. The argument <var>index</var> specifies the index in the list of the selected items, not the row number of the item. The item index is zero-based, thus this example will return the first selected item: <code>getSelectedItem(0)</code>.</dd>
-</dl> <dl>
- <dt>
- <span id="m-insertItemAt"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/insertItemAt">insertItemAt( index, label, value )</a></code></span></dt>
- <dd>
- Return type: <em>element</em></dd>
- <dd>
- This method creates a new item and inserts it at the specified position. You may optionally set a value. The new item element is returned.</dd>
-</dl> <dl>
- <dt><span id="m-invertSelection"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/invertSelection">invertSelection()</a></code></span></dt>
- <dd>Return type: <em>no return value</em></dd>
- <dd>Reverses the selected state of all items. Selected items become deselected, and deselected items become selected.</dd>
-</dl> <dl>
- <dt><span id="m-moveByOffset"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/moveByOffset">moveByOffset( offset , isSelecting, isSelectingRange)</a></code></span></dt>
- <dd>Return type: <em>no return value</em></dd>
- <dd>If <code>offset</code> is positive, adjusts the focused item forward by that many items. If <code>offset</code> is negative, adjusts the focused item backward by that many items. If <code>isSelecting</code> is <code>true</code>, then the selection is also adjusted. If <code>isSelectingRange</code> is also <code>true</code>, then the new item is selected in addition to any currently selected items. If <code>isSelectingRange</code> is <code>false</code>, any existing selection is cleared. Items that are hidden are skipped.</dd>
-</dl> <dl>
- <dt>
- <span id="m-removeItemAt"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/removeItemAt">removeItemAt( index )</a></code></span></dt>
- <dd>
- Return type: <em>element</em></dd>
- <dd>
- Removes the child item in the element at the specified index. The method returns the removed item.</dd>
-</dl> <dl>
- <dt><span id="m-removeItemFromSelection"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/removeItemFromSelection">removeItemFromSelection( item )</a></code></span></dt>
- <dd>Return type: <em>no return value</em></dd>
- <dd>Deselects the specified item without deselecting other items.</dd>
-</dl> <dl>
- <dt><span id="m-scrollToIndex"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/scrollToIndex">scrollToIndex( index )</a></code></span></dt>
- <dd>Return type: <em>no return value</em></dd>
- <dd>Scrolls the element to the specified index. This is different than <span id="m-ensureIndexIsVisible"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/ensureIndexIsVisible">ensureIndexIsVisible</a></code></span> because the view is always scrolled.</dd>
-</dl> <dl>
- <dt>
- <span id="m-selectAll"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/selectAll">selectAll()</a></code></span></dt>
- <dd>
- Return type: <em>no return value</em></dd>
- <dd>
- Selects all of the items. A select event is sent after the selection is made.</dd>
-</dl> <dl>
- <dt>
- <span id="m-selectItem"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/selectItem">selectItem( item )</a></code></span></dt>
- <dd>
- Return type: <em>no return value</em></dd>
- <dd>
- Deselects all of the currently selected items and selects the given item. A select event is sent after the selection is made.</dd>
-</dl> <dl>
- <dt>
- <span id="m-selectItemRange"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/selectItemRange">selectItemRange( startItem, endItem )</a></code></span></dt>
- <dd>
- Return type: <em>no return value</em></dd>
- <dd>
- Selects the items between the two items given as arguments, including the start and end items. All other items are deselected. This method does nothing for single-selection list boxes. A select event is sent after the selection is made.</dd>
-</dl> <dl>
- <dt>
- <span id="m-timedSelect"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/timedSelect">timedSelect( item, timeout )</a></code></span></dt>
- <dd>
- Return type: <em>no return value</em></dd>
- <dd>
- Selects the item specified by the argument item after the number of milliseconds given by the timeout argument. All other items are deselected.</dd>
-</dl> <dl>
- <dt>
- <span id="m-toggleItemSelection"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/toggleItemSelection">toggleItemSelection( item )</a></code></span></dt>
- <dd>
- Return type: <em>no return value</em></dd>
- <dd>
- If the specified item is selected, it is deselected. If it is not selected, it is selected. Other items in the list box that are selected are not affected, and retain their selected state.</dd>
-</dl><p></p>
-<h3 id="Related" name="Related">Related</h3>
-<dl>
- <dt>
- Elements</dt>
- <dd>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listcell" title="listcell">listcell</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listcol" title="listcol">listcol</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listcols" title="listcols">listcols</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listhead" title="listhead">listhead</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listheader" title="listheader">listheader</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listitem" title="listitem">listitem</a></code></dd>
-</dl>
-<dl>
- <dt>
- Interfaces</dt>
- <dd>
- <a href="/en/XPCOM_Interface_Reference/nsIAccessibleProvider" title="en/nsIAccessibleProvider">nsIAccessibleProvider</a>, <a href="/en/NsIDOMXULMultiSelectControlElement" title="en/NsIDOMXULMultiSelectControlElement">nsIDOMXULMultiSelectControlElement</a></dd>
-</dl>
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/listheader/index.html b/files/zh-cn/mozilla/tech/xul/listheader/index.html
deleted file mode 100644
index d71bcb6e83..0000000000
--- a/files/zh-cn/mozilla/tech/xul/listheader/index.html
+++ /dev/null
@@ -1,180 +0,0 @@
----
-title: listheader
-slug: Mozilla/Tech/XUL/listheader
-translation_of: Archive/Mozilla/XUL/listheader
----
-<div class="noinclude">
- <span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-<p>A header for a single column in a <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listbox" title="listbox">listbox</a></code>.</p>
-<dl>
- <dt>
- Attributes</dt>
- <dd>
- <a href="#a-disabled">disabled</a></dd>
-</dl>
-<dl>
- <dt>
- Properties</dt>
- <dd>
- <a href="#p-acesssibleType">acesssibleType</a></dd>
-</dl>
-<h3 id="Examples" name="Examples">Examples</h3>
-<div class="float-right">
- <img alt="Image:XUL_ref_listheader.png" class="internal" src="/@api/deki/files/463/=XUL_ref_listheader.png"></div>
-<pre>&lt;listbox&gt;
- &lt;listhead&gt;
- &lt;listheader label="Name"/&gt;
- &lt;listheader label="Occupation"/&gt;
- &lt;/listhead&gt;
- &lt;listitem&gt;
- &lt;listcell label="George"/&gt;
- &lt;listcell label="House Painter"/&gt;
- &lt;/listitem&gt;
- &lt;listitem&gt;
- &lt;listcell label="Mary Ellen"/&gt;
- &lt;listcell label="Candle Maker"/&gt;
- &lt;/listitem&gt;
- &lt;listitem&gt;
- &lt;listcell label="Roger"/&gt;
- &lt;listcell label="Swashbuckler"/&gt;
- &lt;/listitem&gt;
-&lt;/listbox&gt;
-</pre>
-<h3 id="Attributes" name="Attributes">Attributes</h3>
-<p></p><div id="a-disabled">
-
-
-<dl>
- <dt><code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code></dt>
- <dd> </dd>
- <dd>
- <h5 id="类型boolean">类型:<em>boolean</em></h5>
- </dd>
- <dd>
- <h5 id="表示元素是被禁用的。">表示元素是被禁用的。</h5>
-
- <p>如果这个元素的disabled属性被设置为true,表示元素被禁用,被禁用的属性在页面上通常会显示灰色文本,它无法响应用户的操作,它也无法得到光标。</p>
-
- <p>然而,这个元素仍然能够响应鼠标事件,如果要启用这个元素,把disabled设置为false</p>
- </dd>
-</dl>
-
-<h4 id="示例:">示例:</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_attr_disabled.png" src="https://mdn.mozillademos.org/files/1742/XUL_ref_attr_disabled.png"></div>
-
-<pre><code>// Disabling an element
-document.getElementById('buttonRemove').setAttribute("disabled", "true");
-
-// Enabling back an element by removing the "disabled" attribute
-document.getElementById('buttonRemove').removeAttribute("disabled");</code></pre>
-
-<p></p><div class="blockIndicator standardNote standardNoteBlock">
- <p><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Firefox/Releases/3.5">Firefox 3.5 note</a></p>
- <p style="font-weight: 400;">For <a href="https://developer.mozilla.org/en-US/docs/XUL/keyset" title="en/XUL/Keyset"><code>keyset</code></a> elements, support for this attribute was added in Firefox 3.5.</p>
-</div><p></p>
-</div> <div id="a-label">
-
-<dl>
- <dt>
- <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- The label that will appear on the element. If this is left out, no text appears.<br>
- label 在元素上显示。如果左侧出界,则不显示任何文字。</dd>
-</dl>
-
-<p></p>
-</div> <table style="border: 1px solid rgb(204, 204, 204); margin: 0 0 10px 10px; padding: 0 10px; background: rgb(238, 238, 238);">
-<tbody>
-<tr>
-<td><p><strong>Inherited from XUL element</strong><br> <small>
-<code id="a-align"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/align">align</a></code>,
-<code id="a-allowevents"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/allowevents">allowevents</a></code>,
-<code id="a-allownegativeassertions"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/allownegativeassertions">allownegativeassertions</a></code>,
-<code id="a-class"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/class">class</a></code>,
-<code id="a-coalesceduplicatearcs"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/coalesceduplicatearcs">coalesceduplicatearcs</a></code>,
-<code id="a-collapsed"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/collapsed">collapsed</a></code>,
-<code id="a-container"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/container">container</a></code>,
-<code id="a-containment"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/containment">containment</a></code>,
-<code id="a-context"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/context">context</a></code>,
-<code id="a-contextmenu"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/contextmenu">contextmenu</a></code>,
-<code id="a-datasources"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/datasources">datasources</a></code>,
-<code id="a-dir"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/dir">dir</a></code>,
-<code id="a-empty"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/empty">empty</a></code>,
-<code id="a-equalsize"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/equalsize">equalsize</a></code>,
-<code id="a-flags"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/flags">flags</a></code>,
-<code id="a-flex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/flex">flex</a></code>,
-<code id="a-height"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/height">height</a></code>,
-<code id="a-hidden"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/hidden">hidden</a></code>,
-<code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code>,
-<code id="a-insertafter"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/insertafter">insertafter</a></code>,
-<code id="a-insertbefore"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/insertbefore">insertbefore</a></code>,
-<code id="a-left"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/left">left</a></code>,
-<code id="a-maxheight"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/maxheight">maxheight</a></code>,
-<code id="a-maxwidth"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/maxwidth">maxwidth</a></code>,
-<code id="a-menu"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/menu">menu</a></code>,
-<code id="a-minheight"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/minheight">minheight</a></code>,
-<code id="a-minwidth"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/minwidth">minwidth</a></code>,
-<code id="a-mousethrough"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/mousethrough">mousethrough</a></code>,
-<code id="a-observes"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/observes">observes</a></code>,
-<code id="a-ordinal"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/ordinal">ordinal</a></code>,
-<code id="a-orient"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/orient">orient</a></code>,
-<code id="a-pack"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/pack">pack</a></code>,
-<code id="a-persist"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/persist">persist</a></code>,
-<code id="a-popup"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/popup">popup</a></code>,
-<code id="a-position"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/position">position</a></code>,
-<code id="a-preference-editable"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/preference-editable">preference-editable</a></code>,
-<code id="a-querytype"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/querytype">querytype</a></code>,
-<code id="a-ref"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/ref">ref</a></code>,
-<code id="a-removeelement"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/removeelement">removeelement</a></code>,
-<code id="a-sortDirection"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/sortDirection">sortDirection</a></code>,
-<code id="a-sortResource"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/sortResource">sortResource</a></code>,
-<code id="a-sortResource2"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/sortResource2">sortResource2</a></code>,
-<code id="a-statustext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/statustext">statustext</a></code>,
-<code id="a-style"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/style">style</a></code>,
-<code id="a-template"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/template">template</a></code>,
-<code id="a-tooltip"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tooltip">tooltip</a></code>,
-<code id="a-tooltiptext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tooltiptext">tooltiptext</a></code>,
-<code id="a-top"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/top">top</a></code>,
-<code id="a-uri"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/uri">uri</a></code>,
-<code id="a-wait-cursor"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/wait-cursor">wait-cursor</a></code>,
-<code id="a-width"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/width">width</a></code> </small></p>
-</td>
-</tr>
-</tbody>
-</table><p></p>
-<h3 id="Properties" name="Properties">Properties</h3>
-<p></p><div id="p-accessibleType">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessibleType">accessibleType</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- A value indicating the type of accessibility object for the element.</dd>
-</dl>
-
-<p></p></div> <table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited Properties</strong><br> <small> <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/align">align</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/allowEvents">allowEvents</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/boxObject">boxObject</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/builder">builder</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/className">className</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/collapsed">collapsed</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/contextMenu">contextMenu</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/controllers">controllers</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/database">database</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/datasources">datasources</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/dir">dir</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/flex">flex</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/height">height</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/hidden">hidden</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/id">id</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/left">left</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/maxHeight">maxHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/maxWidth">maxWidth</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/menu">menu</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/minHeight">minHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/minWidth">minWidth</a></span></code>, , , , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/observes">observes</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/ordinal">ordinal</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/orient">orient</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/pack">pack</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/persist">persist</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/ref">ref</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/resource">resource</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/statusText">statusText</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/style">style</a></span></code>, ,, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tooltip">tooltip</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tooltipText">tooltipText</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/top">top</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/width">width</a></span></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Methods" name="Methods">Methods</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited from XUL element</strong><br> <small> <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span></small></p> <p><strong>Inherited from DOM element</strong><br> <small> <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Related" name="Related">Related</h3>
-<dl>
- <dt>
- Elements</dt>
- <dd>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listbox" title="listbox">listbox</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listcell" title="listcell">listcell</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listcol" title="listcol">listcol</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listcols" title="listcols">listcols</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listhead" title="listhead">listhead</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listitem" title="listitem">listitem</a></code></dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/menu/index.html b/files/zh-cn/mozilla/tech/xul/menu/index.html
deleted file mode 100644
index b204dcf14b..0000000000
--- a/files/zh-cn/mozilla/tech/xul/menu/index.html
+++ /dev/null
@@ -1,370 +0,0 @@
----
-title: menu
-slug: Mozilla/Tech/XUL/menu
-tags:
- - XUL Elements
- - XUL Reference
-translation_of: Archive/Mozilla/XUL/menu
----
-<div class="noinclude">
- <span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-<p>An element, much like a <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/button" title="button">button</a></code>, that is placed on a <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menubar" title="menubar">menubar</a></code>. When the user clicks the <code>menu</code> element, the child <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code> of the menu will be displayed. This element is also used to create submenus.</p>
-<p>More information is available in the <a href="cn/XUL_Tutorial/Simple_Menu_Bars">XUL tutorial</a>.</p>
-<dl>
- <dt>
- Attributes</dt>
- <dd>
- <a href="#a-acceltext">acceltext</a>, <a href="#a-accesskey">accesskey</a>, <a href="#a-allowevents">allowevents</a>, <a href="#a-command">command</a>, <a href="#a-crop">crop</a>, <a href="#a-disabled">disabled</a>, <a href="#a-image">image</a>, <a href="#a-label">label</a>, <a href="#a-menuactive">menuactive</a>, <a href="#a-open">open</a>, <a href="#a-sizetopopup">sizetopopup</a>, <a href="#a-tabindex">tabindex</a>, <a href="#a-value">value</a></dd>
-</dl>
-<dl>
- <dt>
- Properties</dt>
- <dd>
- <a href="#p-accessibleType">accessibleType</a>, <a href="#p-accessKey">accessKey</a>, <a href="#p-command">command</a>, <a href="#p-menuitem.control">control</a>, <a href="#p-crop">crop</a>, <a href="#p-disabled">disabled</a>, <a href="#p-image">image</a>, <a href="#p-itemCount">itemCount</a>, <a href="#p-label">label</a>, <a href="#p-labelElement">labelElement</a>, <a href="#p-menupopup">menupopup</a>, <a href="#p-menu.open">open</a>, <a href="#p-parentContainer">parentContainer</a>, <a href="#p-selected">selected</a>, <a href="#p-tabIndex">tabIndex</a>, <a href="#p-value">value</a></dd>
-</dl>
-<dl>
- <dt>
- Methods</dt>
- <dd>
- <a href="#m-appendItem">appendItem</a>, <a href="#m-getIndexOfItem">getIndexOfItem</a>, <a href="#m-getItemAtIndex">getItemAtIndex</a>, <a href="#m-insertItemAt">insertItemAt</a>, <a href="#m-removeItemAt">removeItemAt</a></dd>
-</dl>
-<h3 id="Example" name="Example">Example</h3>
-<pre> &lt;menubar id="sample-menubar"&gt;
- &lt;menu id="file-menu" label="File"&gt;
- &lt;menupopup id="file-popup"&gt;
- &lt;menuitem label="New"/&gt;
- &lt;menuitem label="Open"/&gt;
- &lt;menuitem label="Save"/&gt;
- &lt;menuseparator/&gt;
- &lt;menuitem label="Exit"/&gt;
- &lt;/menupopup&gt;
- &lt;/menu&gt;
- &lt;menu id="edit-menu" label="Edit"&gt;
- &lt;menupopup id="edit-popup"&gt;
- &lt;menuitem label="Undo"/&gt;
- &lt;menuitem label="Redo"/&gt;
- &lt;/menupopup&gt;
- &lt;/menu&gt;
- &lt;/menubar&gt;
-</pre>
-<h3 id="Attributes" name="Attributes">Attributes</h3>
-<p> </p><div id="a-acceltext">
-
-<dl>
- <dt>
- <code id="a-acceltext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/acceltext">acceltext</a></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Text that appears beside beside the <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code> label to indicate the shortcut key (accelerator key) to use to invoke the command. If this value is set, it overrides an assigned key set in the key attribute. This attribute does not apply to menus directly on the menubar.</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-accesskey">
-
-
-
-
-<dl>
- <dt><code id="a-accesskey"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/accesskey">accesskey</a></code></dt>
- <dd>类型:
- <i>character【字符】</i>
- </dd>
- <dd>本属性允许为控件(元素)设定一个字符作为快捷键,这个字符应该是 <code><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></code> 属性文本中的一个字符。该字符将会被加下划线以重点强调,平台和主体的变换并不影响这一表现行为。 当用户点击 ALT (在其他平台上具有类似功能的键) 和这个字符对应的按键时, 控件(元素)将立刻被从窗口中的某处激活或/并且获得焦点 <b>。虽说字符不分大小写,但是当label中存在大写字符和小写字符时,快捷键的字符将首先选择与之完全匹配的那一个,如果label中存在两个或更多的与accesskey字符相同的字符,其中的第一个字符将被加下划线。</b></dd>
- <dt>      *(有些键在监听按键事件时,分别对应event.ctrlKey和event.metaKey。)</dt>
-</dl>
-
-<p> </p>
-
-<h4 id="Example" name="Example">Example</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_accesskey_attr.png"></div>
-
-<pre>&lt;vbox&gt;
- &lt;label value="Enter Name" accesskey="e" control="myName"/&gt;
- &lt;textbox id="myName"/&gt;
- &lt;button label="Cancel" accesskey="n"/&gt;
- &lt;button label="Ok" accesskey="O"/&gt;
-&lt;/vbox&gt;
-</pre>
-
-<h4 id="See_also" name="See_also">See also</h4>
-
-<p><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code> attribute, <code id="a-acceltext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/acceltext">acceltext</a></code> attribute</p>
-
-<p></p>
-</div> <div id="a-allowevents">
-
-
-<dl>
- <dt><code id="a-allowevents"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/allowevents">allowevents</a></code></dt>
- <dd>Type:
- <i>boolean<br>
- </i>
- 类型:boolean</dd>
- <dd>If true, events are passed to children of the element. Otherwise, events are passed to the element only.<br>
- 如果为真,事件向子元素传递。否则,事件只传递到当前元素。</dd>
-</dl>
-
-
-
-<p></p>
-</div> <div id="a-crop">
-
-<dl>
- <dt>
- <code id="a-crop"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/crop">crop</a></code></dt>
- <dd>
- Type:
- <i>
- one of the values below</i>
- </dd>
- <dd>
- If the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the <code>crop</code> attribute. An ellipsis will be used in place of the cropped text. If the box direction is reversed, the cropping is reversed.</dd>
-</dl>
-<ul>
- <li><code>start</code>: The text will be cropped on its left side.</li>
- <li><code>end</code>: The text will be cropped on its right side.</li>
- <li><code>left</code>: <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> The text will be cropped on its left side.</li>
- <li><code>right</code>: <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> The text will be cropped on its right side.</li>
- <li><code>center</code>: The text will be cropped in the middle, showing both the start and end of the text normally.</li>
- <li><code>none</code>: The text will be not be cropped using an ellipsis. However, the text will simply be cut off if it is too large. The side depends on the CSS text alignment.</li>
-</ul>
-
-<p></p>
-</div> <div id="a-disabled">
-
-
-<dl>
- <dt><code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code></dt>
- <dd> </dd>
- <dd>
- <h5 id="类型boolean">类型:<em>boolean</em></h5>
- </dd>
- <dd>
- <h5 id="表示元素是被禁用的。">表示元素是被禁用的。</h5>
-
- <p>如果这个元素的disabled属性被设置为true,表示元素被禁用,被禁用的属性在页面上通常会显示灰色文本,它无法响应用户的操作,它也无法得到光标。</p>
-
- <p>然而,这个元素仍然能够响应鼠标事件,如果要启用这个元素,把disabled设置为false</p>
- </dd>
-</dl>
-
-<h4 id="示例:">示例:</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_attr_disabled.png" src="https://mdn.mozillademos.org/files/1742/XUL_ref_attr_disabled.png"></div>
-
-<pre><code>// Disabling an element
-document.getElementById('buttonRemove').setAttribute("disabled", "true");
-
-// Enabling back an element by removing the "disabled" attribute
-document.getElementById('buttonRemove').removeAttribute("disabled");</code></pre>
-
-<p></p><div class="blockIndicator standardNote standardNoteBlock">
- <p><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Firefox/Releases/3.5">Firefox 3.5 note</a></p>
- <p style="font-weight: 400;">For <a href="https://developer.mozilla.org/en-US/docs/XUL/keyset" title="en/XUL/Keyset"><code>keyset</code></a> elements, support for this attribute was added in Firefox 3.5.</p>
-</div><p></p>
-</div> <div id="a-label">
-
-<dl>
- <dt>
- <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- The label that will appear on the element. If this is left out, no text appears.<br>
- label 在元素上显示。如果左侧出界,则不显示任何文字。</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-menuactive">
-
-
-<dl>
- <dt><code id="a-menuactive"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/menuactive">menuactive</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>This attribute is set on an item in a menu when it is being hovered over. Typcially, the theme will use this to highlight the item. A <code>DOMMenuItemActive</code> event will be sent to the item when the item is hovered over, and a <code>DOMMenuItemInactive</code> event will be sent to the item when the selection moves away.</dd>
-</dl>
-</div> <div id="a-open">
-
-
-<dl>
- <dt><code id="a-open"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/open">open</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>For the <code>menu</code> <code id="a-type"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/type">type</a></code> buttons, the <code>open</code> attribute is set to <code>true</code> when the menu is open. The <code>open</code> attribute is not present if the menu is closed.</dd>
-</dl>
-</div> <div id="a-sizetopopup">
-
-
-<dl>
- <dt><code id="a-sizetopopup"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/sizetopopup">sizetopopup</a></code></dt>
- <dd>Type: <em>one of the values below</em></dd>
- <dd>Indicates how the menu width and the <code><a href="/en-US/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code> width are determined. If the <code>sizetopopup</code> attribute is left out or set to <code>none</code>, the menu will be its preferred width and the popup may extend outside of this width, unaffected by the maximum width of the menu itself. Otherwise, the menu will size itself to at least the size of the popup. If the menu has a maximum width, the popup will also be this width.</dd>
- <dd>
- <dl>
- <dt><code>none</code></dt>
- <dd>The width of the popup will not be constrained to the size of the menu.</dd>
- <dt><code>pref</code></dt>
- <dd>The preferred width of the menu label or button will be the size needed for the popup contents. This is the default value for menulists.</dd>
- <dt><code>always</code></dt>
- <dd>Both the preferred and minimum width of the menu label or button will be the same as that necessary for the <code><a href="/en-US/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code>.</dd>
- </dl>
- </dd>
-</dl>
-</div> <div id="a-value">
-
-<dl>
- <dt>
- <code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- The string attribute allows you to associate a data value with an element. It is not used for any specific purpose, but you can access it with a script for your own use.</dd>
-</dl>
-
-<p></p>
-</div><p></p>
-<h3 id="Properties" name="Properties">Properties</h3>
-<p> </p><div id="p-accessibleType">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessibleType">accessibleType</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- A value indicating the type of accessibility object for the element.</dd>
-</dl>
-
-<p></p></div> <div id="p-menuitem.control">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/menuitem.control">control</a></span></code></dt>
- <dd>
- Type:
- <i>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code> element</i>
- </dd>
- <dd>
- Returns the enclosing <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code> that the item is inside, if any, or <code>null</code> if there is no enclosing menu.</dd>
-</dl>
-
-<p></p></div> <div id="p-itemCount">
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/itemCount">itemCount</a></span></code> </dt>
- <dd>Type: <em>integer</em></dd>
- <dd>Read only property holding the number of child items.</dd>
-</dl>
-</div> <div id="p-menupopup">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/menupopup">menupopup</a></span></code></dt>
- <dd>Type: <em>menupopup element</em></dd>
- <dd>A reference to the <code><a href="/en-US/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code> used by the <code><a href="/en-US/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code> or <code><a href="/en-US/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code>. This property is read-only.</dd>
-</dl></div> <div id="p-menu.open">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/menu.open">open</a></span></code> </dt>
- <dd>
- Type: <em>boolean</em></dd>
- <dd>
- This property will be set to true when the menu is open. The menu may be opened by setting the open property to true and closed by setting it to false.</dd>
-</dl></div> <div id="p-parentContainer">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/parentContainer">parentContainer</a></span></code> </dt>
- <dd>
- Type:
- <i>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code> element</i>
- </dd>
- <dd>
- Read only property that returns the containing <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code> element, or <code>null</code> if there isn't a containing menu.</dd>
-</dl>
-
-<p></p></div> <div id="p-value">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/value">value</a></span></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code> attribute.</dd>
-</dl>
-
-<p></p></div><p></p>
-<h3 id="Methods" name="Methods">Methods</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0 0 10px 10px; padding: 0 10px; background: rgb(238, 238, 238); float: right; width: 250px;">
-<tbody>
-<tr>
-<td>
-<p><strong>Inherited Methods</strong><br>
-<small><code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.cloneNode">cloneNode()</a></code>, <a href="/En/DOM/Node.compareDocumentPosition" title="En/DOM/Node.compareDocumentPosition">compareDocumentPosition</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getBoundingClientRect">getBoundingClientRect()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getClientRects">getClientRects()</a></code>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span>, <span id="m-getElementsByAttributeNS"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttributeNS">getElementsByAttributeNS</a></code></span>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByClassName">getElementsByClassName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getFeature">getFeature()</a></code>, <a href="/En/DOM/Node.getUserData" title="En/DOM/Node.getUserData">getUserData</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isDefaultNamespace">isDefaultNamespace()</a></code>, <a href="/En/DOM/Node.isEqualNode" title="En/DOM/Node.isEqualNode">isEqualNode</a>, <a href="/En/DOM/Node.isSameNode" title="En/DOM/Node.isSameNode">isSameNode</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <a href="/En/DOM/Node.lookupNamespaceURI" title="En/DOM/Node.lookupNamespaceURI">lookupNamespaceURI</a>, <a href="/En/DOM/Node.lookupPrefix" title="En/DOM/Node.lookupPrefix">lookupPrefix</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.querySelector">querySelector()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.querySelectorAll">querySelectorAll()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code>, <a href="/En/DOM/Node.setUserData" title="En/DOM/Node.setUserData">setUserData</a></small></p>
-
-</td>
-</tr>
-</tbody>
-</table> <dl>
- <dt>
- <span id="m-appendItem"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/appendItem">appendItem( label, value )</a></code></span></dt>
- <dd>
- Return type: <em>element</em></dd>
- <dd>
- Creates a new item and adds it to the end of the existing list of items. You may optionally set a value. The function returns the newly created element.</dd>
-</dl> <dl>
- <dt><span id="m-getIndexOfItem"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/getIndexOfItem">getIndexOfItem( item )</a></code></span></dt>
- <dd>Return type: <em>integer</em></dd>
- <dd>Returns the zero-based position of the specified item. Items are numbered starting at the first item displayed in the list.</dd>
-</dl> <dl>
- <dt><span id="m-getItemAtIndex"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/getItemAtIndex">getItemAtIndex( index )</a></code></span></dt>
- <dd>Return type: <em>element</em></dd>
- <dd>Returns the element that is at the specified index.</dd>
-</dl> <dl>
- <dt>
- <span id="m-insertItemAt"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/insertItemAt">insertItemAt( index, label, value )</a></code></span></dt>
- <dd>
- Return type: <em>element</em></dd>
- <dd>
- This method creates a new item and inserts it at the specified position. You may optionally set a value. The new item element is returned.</dd>
-</dl> <dl>
- <dt>
- <span id="m-removeItemAt"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/removeItemAt">removeItemAt( index )</a></code></span></dt>
- <dd>
- Return type: <em>element</em></dd>
- <dd>
- Removes the child item in the element at the specified index. The method returns the removed item.</dd>
-</dl><p></p>
-<h3 id="Related" name="Related">Related</h3>
-<dl>
- <dt>
- Elements</dt>
- <dd>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menubar" title="menubar">menubar</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuseparator" title="menuseparator">menuseparator</a></code></dd>
-</dl>
-<dl>
- <dt>
- Interfaces</dt>
- <dd>
- <a href="cn/NsIAccessibleProvider">nsIAccessibleProvider</a>, <a href="cn/NsIDOMXULContainerElement">nsIDOMXULContainerElement</a>, <a href="cn/NsIDOMXULContainerItemElement">nsIDOMXULContainerItemElement</a>, <a href="cn/NsIDOMXULSelectControlItemElement">nsIDOMXULSelectControlItemElement</a></dd>
-</dl>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/menubar/index.html b/files/zh-cn/mozilla/tech/xul/menubar/index.html
deleted file mode 100644
index d7946debf9..0000000000
--- a/files/zh-cn/mozilla/tech/xul/menubar/index.html
+++ /dev/null
@@ -1,113 +0,0 @@
----
-title: menubar
-slug: Mozilla/Tech/XUL/menubar
-tags:
- - XUL Elements
- - XUL Reference
-translation_of: Archive/Mozilla/XUL/menubar
----
-<div class="noinclude">
- <span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-<p>A container that usually contains <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code> elements. On the Macintosh, the menubar is displayed along the top of the screen, and all non-menu related elements inside the menubar will be ignored.</p>
-<p>More information is available in the <a href="cn/XUL_Tutorial/Simple_Menu_Bars">XUL tutorial</a>.</p>
-<dl>
- <dt>
- Attributes</dt>
- <dd>
- <a href="#a-grippyhidden">grippyhidden</a>, <a href="#a-statusbar">statusbar</a></dd>
-</dl>
-<dl>
- <dt>
- Properties</dt>
- <dd>
- <a href="#p-accessibleType">accessibleType</a>, <a href="#p-statusbar">statusbar</a></dd>
-</dl>
-<h3 id="Examples" name="Examples">Examples</h3>
-<div class="float-right">
- <img alt="Image:XUL_ref_menu.png"></div>
-<pre>&lt;menubar id="sample-menubar"&gt;
- &lt;menu id="action-menu" label="Action"&gt;
- &lt;menupopup id="action-popup"&gt;
- &lt;menuitem label="New"/&gt;
- &lt;menuitem label="Save" disabled="true"/&gt;
- &lt;menuitem label="Close"/&gt;
- &lt;menuseparator/&gt;
- &lt;menuitem label="Quit"/&gt;
- &lt;/menupopup&gt;
- &lt;/menu&gt;
- &lt;menu id="edit-menu" label="Edit"&gt;
- &lt;menupopup id="edit-popup"&gt;
- &lt;menuitem label="Undo"/&gt;
- &lt;menuitem label="Redo"/&gt;
- &lt;/menupopup&gt;
- &lt;/menu&gt;
-&lt;/menubar&gt;
-</pre>
-<h3 id="Attributes" name="Attributes">Attributes</h3>
-<p> </p><div id="a-grippyhidden">
-
-
-<dl>
- <dt><code id="a-grippyhidden"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/grippyhidden">grippyhidden</a></code></dt>
- <dd><strong><span class="highlightred">SeaMonkey only</span></strong></dd>
- <dd>Type: <em>boolean</em></dd>
- <dd>When set to <code>true</code>, the grippy will be hidden. When set to <code>false</code>, the default, the grippy will be shown.</dd>
-</dl>
-</div> <div id="a-statusbar">
-
-
-<dl>
- <dt><code id="a-statusbar"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/statusbar">statusbar</a></code></dt>
- <dd>Type: <em>id</em></dd>
- <dd>If you set this attribute to the <code id="a-id"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code> of a <code><a href="/en-US/docs/Mozilla/Tech/XUL/statusbar" title="statusbar">statusbar</a></code> element, the label on the statusbar will update to the <code id="a-statustext"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/statustext">statustext</a></code> of the items on the menu as the user moves the mouse over them.</dd>
-</dl>
-</div><p></p>
-<h3 id="Properties" name="Properties">Properties</h3>
-<p></p><div id="p-accessibleType">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessibleType">accessibleType</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- A value indicating the type of accessibility object for the element.</dd>
-</dl>
-
-<p></p></div> <div id="p-statusbar">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/statusbar">statusbar</a></span></code></dt>
- <dd>Type: <em>id of statusbar element</em></dd>
- <dd>Gets and sets the value of the <code id="a-statusbar"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/statusbar">statusbar</a></code> attribute.</dd>
-</dl></div> <table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited Properties</strong><br> <small> <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/align">align</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/allowEvents">allowEvents</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/boxObject">boxObject</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/builder">builder</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/className">className</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/collapsed">collapsed</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/contextMenu">contextMenu</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/controllers">controllers</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/database">database</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/datasources">datasources</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/dir">dir</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/flex">flex</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/height">height</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/hidden">hidden</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/id">id</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/left">left</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/maxHeight">maxHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/maxWidth">maxWidth</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/menu">menu</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/minHeight">minHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/minWidth">minWidth</a></span></code>, , , , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/observes">observes</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/ordinal">ordinal</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/orient">orient</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/pack">pack</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/persist">persist</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/ref">ref</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/resource">resource</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/statusText">statusText</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/style">style</a></span></code>, ,, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tooltip">tooltip</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tooltipText">tooltipText</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/top">top</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/width">width</a></span></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Methods" name="Methods">Methods</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited from XUL element</strong><br> <small> <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span></small></p> <p><strong>Inherited from DOM element</strong><br> <small> <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Related" name="Related">Related</h3>
-<dl>
- <dt>
- Elements</dt>
- <dd>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuseparator" title="menuseparator">menuseparator</a></code></dd>
-</dl>
-<dl>
- <dt>
- Interfaces</dt>
- <dd>
- <a href="cn/NsIAccessibleProvider">nsIAccessibleProvider</a></dd>
-</dl>
-<p> </p>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/menuitem/index.html b/files/zh-cn/mozilla/tech/xul/menuitem/index.html
deleted file mode 100644
index a231f6a348..0000000000
--- a/files/zh-cn/mozilla/tech/xul/menuitem/index.html
+++ /dev/null
@@ -1,575 +0,0 @@
----
-title: menuitem
-slug: Mozilla/Tech/XUL/menuitem
-tags:
- - XUL Elements
- - XUL Reference
-translation_of: Archive/Mozilla/XUL/menuitem
----
-<div class="noinclude">
- <span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-<p>A single choice in a <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code> element. It acts much like a <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/button" title="button">button</a></code> but it is rendered on a <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code>.</p>
-<p>More information is available in the <a href="cn/XUL_Tutorial/Simple_Menu_Bars">XUL tutorial</a>.</p>
-<dl>
- <dt>
- Attributes</dt>
- <dd>
- <a href="#a-acceltext">acceltext</a>, <a href="#a-accesskey">accesskey</a>, <a href="#a-allowevents">allowevents</a>, <a href="#a-autocheck">autocheck</a>, <a href="#a-checked">checked</a>, <a href="#a-command">command</a>, <a href="#a-crop">crop</a>, <a href="#a-description">description</a>, <a href="#a-disabled">disabled</a>, <a href="#a-image">image</a>, <a href="#a-menuitem.key">key</a>, <a href="#a-label">label</a>, <a href="#a-menuitem.name">name</a>, <a href="#a-selected">selected</a>, <a href="#a-tabindex">tabindex</a>, <a href="#a-menuitem.type">type</a>, <a href="#a-validate">validate</a>, <a href="#a-value">value</a></dd>
-</dl>
-<dl>
- <dt>
- Properties</dt>
- <dd>
- <a href="#p-accessibleType">accessibleType</a>, <a href="#p-accessKey">accessKey</a>, <a href="#p-command">command</a>, <a href="#p-menuitem.control">control</a>, <a href="#p-crop">crop</a>, <a href="#p-disabled">disabled</a>, <a href="#p-image">image</a>, <a href="#p-label">label</a>, <a href="#p-labelElement">labelElement</a>, <a href="#p-parentContainer">parentContainer</a>, <a href="#p-selected">selected</a>, <a href="#p-tabIndex">tabIndex</a>, <a href="#p-value">value</a></dd>
-</dl>
-<dl>
- <dt>
- Style classes</dt>
- <dd>
- <a href="#s-menuitem-iconic">menuitem-iconic</a>, <a href="#s-menuitem-non-iconic">menuitem-non-iconic</a></dd>
-</dl>
-<h3 id="Example" name="Example">Example</h3>
-<pre>&lt;menu id="edit-menu" label="Edit"&gt;
- &lt;menupopup id="edit-popup"&gt;
- &lt;menuitem label="Undo"/&gt;
- &lt;menuitem label="Redo"/&gt;
- &lt;/menupopup&gt;
-&lt;/menu&gt;
-</pre>
-<h3 id="Attributes" name="Attributes">Attributes</h3>
-<p> </p><div id="a-acceltext">
-
-<dl>
- <dt>
- <code id="a-acceltext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/acceltext">acceltext</a></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Text that appears beside beside the <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code> label to indicate the shortcut key (accelerator key) to use to invoke the command. If this value is set, it overrides an assigned key set in the key attribute. This attribute does not apply to menus directly on the menubar.</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-accesskey">
-
-
-
-
-<dl>
- <dt><code id="a-accesskey"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/accesskey">accesskey</a></code></dt>
- <dd>类型:
- <i>character【字符】</i>
- </dd>
- <dd>本属性允许为控件(元素)设定一个字符作为快捷键,这个字符应该是 <code><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></code> 属性文本中的一个字符。该字符将会被加下划线以重点强调,平台和主体的变换并不影响这一表现行为。 当用户点击 ALT (在其他平台上具有类似功能的键) 和这个字符对应的按键时, 控件(元素)将立刻被从窗口中的某处激活或/并且获得焦点 <b>。虽说字符不分大小写,但是当label中存在大写字符和小写字符时,快捷键的字符将首先选择与之完全匹配的那一个,如果label中存在两个或更多的与accesskey字符相同的字符,其中的第一个字符将被加下划线。</b></dd>
- <dt>      *(有些键在监听按键事件时,分别对应event.ctrlKey和event.metaKey。)</dt>
-</dl>
-
-<p> </p>
-
-<h4 id="Example" name="Example">Example</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_accesskey_attr.png"></div>
-
-<pre>&lt;vbox&gt;
- &lt;label value="Enter Name" accesskey="e" control="myName"/&gt;
- &lt;textbox id="myName"/&gt;
- &lt;button label="Cancel" accesskey="n"/&gt;
- &lt;button label="Ok" accesskey="O"/&gt;
-&lt;/vbox&gt;
-</pre>
-
-<h4 id="See_also" name="See_also">See also</h4>
-
-<p><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code> attribute, <code id="a-acceltext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/acceltext">acceltext</a></code> attribute</p>
-
-<p></p>
-</div> <div id="a-allowevents">
-
-
-<dl>
- <dt><code id="a-allowevents"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/allowevents">allowevents</a></code></dt>
- <dd>Type:
- <i>boolean<br>
- </i>
- 类型:boolean</dd>
- <dd>If true, events are passed to children of the element. Otherwise, events are passed to the element only.<br>
- 如果为真,事件向子元素传递。否则,事件只传递到当前元素。</dd>
-</dl>
-
-
-
-<p></p>
-</div> <div id="a-autocheck">
-
-
-<dl>
- <dt><code id="a-autocheck"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/autocheck">autocheck</a></code></dt>
- <dd>类型:
- <i>boolean</i>
- </dd>
- <dd>如果此属性为 <code>true</code>,或空白, 每次点击按钮时,此按钮的状态检查都会被执行一次。如果此属性为<code>false</code>, 检查会手动的被拒绝。当autocheck值为true的时候,按钮将会变为多选框或者单选框。</dd>
-</dl>
-
-
-
-<p></p>
-</div> <div id="a-checked">
-
-<dl>
- <dt>
- <code id="a-checked"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/checked">checked</a></code></dt>
- <dd>
- Type:
- <i>
- boolean</i>
- </dd>
- <dd>
- Indicates whether the element is checked or not.</dd>
- <dd>
- Use <code>hasAttribute()</code> to determine whether this attribute is set instead of <code>getAttribute()</code>.</dd>
- <dd>
- For buttons, the <code>type</code> attribute must be set to <code>checkbox</code> or <code>radio</code> for this attribute to have any effect.&lt;magic name="\"PAGENAME\"/"&gt;&lt;/magic&gt;</dd>
-</dl>
-</div><p></p>
-<div class="note">
- <b>Note:</b> if the <code id="a-checked"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/checked">checked</a></code> attribute is set to <code>true</code>, and you persist its value via the <code id="a-persist"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/persist">persist</a></code> attribute, Mozilla will fail to persist its value when the <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code> is unchecked because of <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=15232" title="persist should be able to remove an attribute from an element">bug 15232</a>. A workaround is to set the <code id="a-autocheck"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/autocheck">autocheck</a></code> attribute to <code>false</code>, then programmatically set the <code id="a-checked"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/checked">checked</a></code> attribute when the user selects the item, and set it to <code>false</code> instead of removing the attribute (i.e. do <code>menuitem.setAttribute("checked", "false")</code> instead of <code>menuitem.removeAttribute("checked"))</code> when the user unchecks the <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code>, as a value of <code>false</code> will both correctly hide the checkmark and persist its hidden state.</div>
-<p></p><div id="a-command">
-
-<dl>
- <dt>
- <code id="a-command"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/command">command</a></code></dt>
- <dd>
- Type:
- <i>
- element id</i>
- </dd>
- <dd>
- Set to the <code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code> of a <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/command" title="command">command</a></code> element that is being observed by the element.</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-crop">
-
-<dl>
- <dt>
- <code id="a-crop"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/crop">crop</a></code></dt>
- <dd>
- Type:
- <i>
- one of the values below</i>
- </dd>
- <dd>
- If the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the <code>crop</code> attribute. An ellipsis will be used in place of the cropped text. If the box direction is reversed, the cropping is reversed.</dd>
-</dl>
-<ul>
- <li><code>start</code>: The text will be cropped on its left side.</li>
- <li><code>end</code>: The text will be cropped on its right side.</li>
- <li><code>left</code>: <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> The text will be cropped on its left side.</li>
- <li><code>right</code>: <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> The text will be cropped on its right side.</li>
- <li><code>center</code>: The text will be cropped in the middle, showing both the start and end of the text normally.</li>
- <li><code>none</code>: The text will be not be cropped using an ellipsis. However, the text will simply be cut off if it is too large. The side depends on the CSS text alignment.</li>
-</ul>
-
-<p></p>
-</div> <div id="a-description">
-
-<dl>
- <dt>
- <code id="a-description"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/description">description</a></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Descriptive text to appear in addition to the dialog title.</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-disabled">
-
-
-<dl>
- <dt><code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code></dt>
- <dd> </dd>
- <dd>
- <h5 id="类型boolean">类型:<em>boolean</em></h5>
- </dd>
- <dd>
- <h5 id="表示元素是被禁用的。">表示元素是被禁用的。</h5>
-
- <p>如果这个元素的disabled属性被设置为true,表示元素被禁用,被禁用的属性在页面上通常会显示灰色文本,它无法响应用户的操作,它也无法得到光标。</p>
-
- <p>然而,这个元素仍然能够响应鼠标事件,如果要启用这个元素,把disabled设置为false</p>
- </dd>
-</dl>
-
-<h4 id="示例:">示例:</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_attr_disabled.png" src="https://mdn.mozillademos.org/files/1742/XUL_ref_attr_disabled.png"></div>
-
-<pre><code>// Disabling an element
-document.getElementById('buttonRemove').setAttribute("disabled", "true");
-
-// Enabling back an element by removing the "disabled" attribute
-document.getElementById('buttonRemove').removeAttribute("disabled");</code></pre>
-
-<p></p><div class="blockIndicator standardNote">
- <p><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Firefox/Releases/3.5">Firefox 3.5 note</a></p>
- <p style="font-weight: 400;">For <a href="https://developer.mozilla.org/en-US/docs/XUL/keyset" title="en/XUL/Keyset"><code>keyset</code></a> elements, support for this attribute was added in Firefox 3.5.</p>
-</div><p></p>
-</div> <div id="a-image">
-
-<dl>
- <dt>
- <code id="a-image"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/image">image</a></code></dt>
- <dd>
- Type:
- <i>
- image URL</i>
- </dd>
- <dd>
- The URL of the image to appear on the element. If this attribute is empty or left out, no image appears. The position of the image is determined by the <code id="a-dir"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/dir">dir</a></code> and <code id="a-orient"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/orient">orient</a></code> attributes.</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-menuitem.key">
-
-<dl>
- <dt>
- <code id="a-menuitem.key"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/menuitem.key">key</a></code></dt>
- <dd>
- Type:
- <i>
- element id</i>
- </dd>
- <dd>
- Set to the <code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code> of a <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/key" title="key">key</a></code> element whose key shortcut is displayed in the <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code>.</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-label">
-
-<dl>
- <dt>
- <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- The label that will appear on the element. If this is left out, no text appears.<br>
- label 在元素上显示。如果左侧出界,则不显示任何文字。</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-menuitem.name">
-
-<dl>
- <dt>
- <code id="a-menuitem.name"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/menuitem.name">name</a></code></dt>
- <dd>
- Type:
- <i>
- string name</i>
- </dd>
- <dd>
- Radio <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code>s with the same name as put into a group. Only one <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code> in each radio group can be checked at a time.</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-selected">
-
-<dl>
- <dt>
- <code id="a-selected"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/selected">selected</a></code></dt>
- <dd>
- Type:
- <i>
- boolean</i>
- </dd>
- <dd>
- Indicates whether the element is selected or not. This value is read-only. To change the selection, set either the <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectedIndex">selectedIndex</a></span></code> or <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectedItem">selectedItem</a></span></code> property of the containing element.</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-tabindex">
-
-
-<dl>
- <dt><code id="a-tabindex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tabindex">tabindex</a></code></dt>
- <dd>Type:<em>integer</em></dd>
- <dd>当用户按下 "<kbd>tab</kbd>" 键时焦点移动到元素上的顺序。<code>tabindex</code> 数字越大,顺序越靠后。</dd>
-</dl>
-
-
-
-<p></p>
-</div> <div id="a-menuitem.type">
-
-<dl>
- <dt>
- <code id="a-menuitem.type"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/menuitem.type">type</a></code></dt>
- <dd>
- Type:
- <i>
- one of the values below</i>
- </dd>
- <dd>
- Can be used to create checkable menuitems or for radio button menuitems.</dd>
-</dl>
-<ul>
- <li><code>checkbox</code>: The <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code> is checked. The <code id="a-checked"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/checked">checked</a></code> attribute determines whether the menuitem is checked or not.</li>
- <li><code>radio</code>: The <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code> becomes part of a radio group. Other menuitems that have the same value for their <code id="a-name"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/name">name</a></code> attributes are part of the same <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/radio" title="radio">radio</a></code> group. Only one menuitem in the same radio group can be checked at once.</li>
-</ul>
-<p>More information on adding checkmarks to menus in the <a href="cn/XUL_Tutorial/More_Menu_Features#Adding_Checkmarks_to_Menus">XUL tutorial</a></p>
-
-<p></p>
-</div> <div id="a-validate">
-
-<dl>
- <dt>
- <code id="a-validate"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/validate">validate</a></code></dt>
- <dd>
- Type:
- <i>
- one of the values below</i>
- </dd>
- <dd>
- This attribute indicates whether to load the image from the cache or not. This would be useful if the images are stored remotely or you plan on swapping the image frequently. The following values are accepted, or leave out the attribute entirely for default handling:</dd>
-</dl>
-<ul>
- <li><code>always</code>: The image is always checked to see whether it should be reloaded.</li>
- <li><code>never</code>: The image will be loaded from the cache if possible.</li>
-</ul>
-
-<p></p>
-</div> <div id="a-value">
-
-<dl>
- <dt>
- <code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- The string attribute allows you to associate a data value with an element. It is not used for any specific purpose, but you can access it with a script for your own use.</dd>
-</dl>
-
-<p></p>
-</div><p></p>
-<h3 id="Properties" name="Properties">Properties</h3>
-<p></p><div id="p-accessibleType">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessibleType">accessibleType</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- A value indicating the type of accessibility object for the element.</dd>
-</dl>
-
-<p></p></div> <div id="p-accessKey">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessKey">accessKey</a></span></code></dt>
- <dd>
- Type:
- <i>
- character</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-accesskey"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/accesskey">accesskey</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-command">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/command">command</a></span></code></dt>
- <dd>
- Type:
- <i>
- element id</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-command"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/command">command</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-menuitem.control">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/menuitem.control">control</a></span></code></dt>
- <dd>
- Type:
- <i>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code> element</i>
- </dd>
- <dd>
- Returns the enclosing <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code> that the item is inside, if any, or <code>null</code> if there is no enclosing menu.</dd>
-</dl>
-
-<p></p></div> <div id="p-crop">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/crop">crop</a></span></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-crop"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/crop">crop</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-disabled">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/disabled">disabled</a></span></code></dt>
- <dd>
- Type:
- <i>
- boolean</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-image">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/image">image</a></span></code></dt>
- <dd>
- Type:
- <i>
- image URL</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-image"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/image">image</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-label">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/label">label</a></span></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-labelElement">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/labelElement">labelElement</a></span></code></dt>
- <dd>
- Type:
- <i>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/label" title="label">label</a></code> element</i>
- </dd>
- <dd>
- The <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/label" title="label">label</a></code> element associated with the control. This is set when a label has a <code id="a-control"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/control">control</a></code> attribute pointing to this element. This property will be <code>null</code> when no label is associated with the control.</dd>
-</dl>
-
-<p></p></div> <div id="p-parentContainer">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/parentContainer">parentContainer</a></span></code> </dt>
- <dd>
- Type:
- <i>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code> element</i>
- </dd>
- <dd>
- Read only property that returns the containing <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code> element, or <code>null</code> if there isn't a containing menu.</dd>
-</dl>
-
-<p></p></div> <div id="p-selected">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selected">selected</a></span></code>&lt;magic name="\"PAGENAME\"/"&gt;&lt;/magic&gt;</dt>
- <dd>
- Type:
- <i>
- boolean</i>
- </dd>
- <dd>
- This property's value is <code>true</code> if this element is selected, or <code>false</code> if it is not. This property is read only.</dd>
-</dl></div> <div id="p-tabIndex">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tabIndex">tabIndex</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-tabindex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tabindex">tabindex</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-value">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/value">value</a></span></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited Properties</strong><br> <small> <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/align">align</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/allowEvents">allowEvents</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/boxObject">boxObject</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/builder">builder</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/className">className</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/collapsed">collapsed</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/contextMenu">contextMenu</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/controllers">controllers</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/database">database</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/datasources">datasources</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/dir">dir</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/flex">flex</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/height">height</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/hidden">hidden</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/id">id</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/left">left</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/maxHeight">maxHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/maxWidth">maxWidth</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/menu">menu</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/minHeight">minHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/minWidth">minWidth</a></span></code>, , , , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/observes">observes</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/ordinal">ordinal</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/orient">orient</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/pack">pack</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/persist">persist</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/ref">ref</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/resource">resource</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/statusText">statusText</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/style">style</a></span></code>, ,, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tooltip">tooltip</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tooltipText">tooltipText</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/top">top</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/width">width</a></span></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Methods" name="Methods">Methods</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited from XUL element</strong><br> <small> <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span></small></p> <p><strong>Inherited from DOM element</strong><br> <small> <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Style_classes" name="Style_classes">Style classes</h3>
-<p></p><dl>
- <dt>
- <code><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Style/menuitem-iconic">menuitem-iconic</a></code></dt>
- <dd>
- Use this class to have an image appear on the <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code>. Specify the image using the <code id="a-image"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/image">image</a></code> attribute.</dd>
-</dl>
-
-<p></p> <dl>
- <dt>
- <code><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Style/menuitem-non-iconic">menuitem-non-iconic</a></code></dt>
- <dd>
- Normally, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code>s have a margin to the left for an image or checkmark. This class may be used to remove this margin so that the menuitem appears on the left edge of the menupopup.</dd>
-</dl>
-
-<p></p><p></p>
-<h3 id="Related" name="Related">Related</h3>
-<dl>
- <dt>
- Elements</dt>
- <dd>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menubar" title="menubar">menubar</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuseparator" title="menuseparator">menuseparator</a></code></dd>
-</dl>
-<dl>
- <dt>
- Interfaces</dt>
- <dd>
- <a href="cn/NsIAccessibleProvider">nsIAccessibleProvider</a>, <a href="cn/NsIDOMXULContainerItemElement">nsIDOMXULContainerItemElement</a>, <a href="cn/NsIDOMXULSelectControlItemElement">nsIDOMXULSelectControlItemElement</a></dd>
-</dl>
-<p> </p>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/menulist/index.html b/files/zh-cn/mozilla/tech/xul/menulist/index.html
deleted file mode 100644
index 7273d413e7..0000000000
--- a/files/zh-cn/mozilla/tech/xul/menulist/index.html
+++ /dev/null
@@ -1,509 +0,0 @@
----
-title: menulist
-slug: Mozilla/Tech/XUL/menulist
-tags:
- - XUL Elements
- - XUL Reference
-translation_of: Archive/Mozilla/XUL/menulist
----
-<div class="noinclude">
- <span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-<p>An element that can be used for drop-down choice lists. The user may select one of the elements displayed in the <code>menulist</code>. The currently selected choice is displayed on the <code>menulist</code> element. To create the drop-down, put a <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code> inside the <code>menulist</code> containing the choices as <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code> elements. The command event may be used to execute code when the menulist selection changes.</p>
-<p>More information is available in the <a href="cn/XUL_Tutorial/List_Controls">XUL tutorial</a>.</p>
-<dl>
- <dt>
- Attributes</dt>
- <dd>
- <a href="#a-accesskey">accesskey</a>, <a href="#a-crop">crop</a>, <a href="#a-disableautoselect">disableautoselect</a>, <a href="#a-disabled">disabled</a>, <a href="#a-editable">editable</a>, <a href="#a-focused">focused</a>, <a href="#a-image">image</a>, <a href="#a-label">label</a>, <a href="#a-oncommand">oncommand</a>, <a href="#a-open">open</a>, <a href="#a-preference">preference</a>, <a href="#a-readonly">readonly</a>, <a href="#a-sizetopopup">sizetopopup</a>, <a href="#a-tabindex">tabindex</a>, <a href="#a-value">value</a></dd>
-</dl>
-<dl>
- <dt>
- Properties</dt>
- <dd>
- <a href="#p-accessibleType">accessibleType</a>, <a href="#p-crop">crop</a>, <a href="#p-description">description</a>, <a href="#p-disableautoselect">disableautoselect</a>, <a href="#p-disabled">disabled</a>, <a href="#p-editable">editable</a>, <a href="#p-editor">editor</a>, <a href="#p-menulist.image">image</a>, <a href="#p-menulist.inputField">inputField</a>, <a href="#p-itemCount">itemCount</a>, <a href="#p-label">label</a>, <a href="#p-menuBoxObject">menuBoxObject</a>, <a href="#p-menupopup">menupopup</a>, <a href="#p-open">open</a>, <a href="#p-selectedIndex">selectedIndex</a>, <a href="#p-selectedItem">selectedItem</a>, <a href="#p-tabIndex">tabIndex</a>, <a href="#p-value">value</a></dd>
-</dl>
-<dl>
- <dt>
- Methods</dt>
- <dd>
- <a href="#m-menulist.appendItem">appendItem</a>, <a href="#m-contains">contains</a>, <a href="#m-getIndexOfItem">getIndexOfItem</a>, <a href="#m-getItemAtIndex">getItemAtIndex</a>, <a href="#m-insertItemAt">insertItemAt</a>, <a href="#m-removeAllItems">removeAllItems</a>, <a href="#m-removeItemAt">removeItemAt</a>, <a href="#m-menulist.select">select</a></dd>
-</dl>
-<h3 id="Examples" name="Examples">Examples</h3>
-<pre> &lt;menulist&gt;
- &lt;menupopup&gt;
- &lt;menuitem label="option 1" value="1"/&gt;
- &lt;menuitem label="option 2" value="2"/&gt;
- &lt;menuitem label="option 3" value="3"/&gt;
- &lt;menuitem label="option 4" value="4"/&gt;
- &lt;/menupopup&gt;
- &lt;/menulist&gt;
-</pre>
-<h3 id="Attributes" name="Attributes">Attributes</h3>
-<p> </p><div id="a-accesskey">
-
-
-
-
-<dl>
- <dt><code id="a-accesskey"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/accesskey">accesskey</a></code></dt>
- <dd>类型:
- <i>character【字符】</i>
- </dd>
- <dd>本属性允许为控件(元素)设定一个字符作为快捷键,这个字符应该是 <code><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></code> 属性文本中的一个字符。该字符将会被加下划线以重点强调,平台和主体的变换并不影响这一表现行为。 当用户点击 ALT (在其他平台上具有类似功能的键) 和这个字符对应的按键时, 控件(元素)将立刻被从窗口中的某处激活或/并且获得焦点 <b>。虽说字符不分大小写,但是当label中存在大写字符和小写字符时,快捷键的字符将首先选择与之完全匹配的那一个,如果label中存在两个或更多的与accesskey字符相同的字符,其中的第一个字符将被加下划线。</b></dd>
- <dt>      *(有些键在监听按键事件时,分别对应event.ctrlKey和event.metaKey。)</dt>
-</dl>
-
-<p> </p>
-
-<h4 id="Example" name="Example">Example</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_accesskey_attr.png"></div>
-
-<pre>&lt;vbox&gt;
- &lt;label value="Enter Name" accesskey="e" control="myName"/&gt;
- &lt;textbox id="myName"/&gt;
- &lt;button label="Cancel" accesskey="n"/&gt;
- &lt;button label="Ok" accesskey="O"/&gt;
-&lt;/vbox&gt;
-</pre>
-
-<h4 id="See_also" name="See_also">See also</h4>
-
-<p><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code> attribute, <code id="a-acceltext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/acceltext">acceltext</a></code> attribute</p>
-
-<p></p>
-</div> <div id="a-crop">
-
-<dl>
- <dt>
- <code id="a-crop"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/crop">crop</a></code></dt>
- <dd>
- Type:
- <i>
- one of the values below</i>
- </dd>
- <dd>
- If the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the <code>crop</code> attribute. An ellipsis will be used in place of the cropped text. If the box direction is reversed, the cropping is reversed.</dd>
-</dl>
-<ul>
- <li><code>start</code>: The text will be cropped on its left side.</li>
- <li><code>end</code>: The text will be cropped on its right side.</li>
- <li><code>left</code>: <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> The text will be cropped on its left side.</li>
- <li><code>right</code>: <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> The text will be cropped on its right side.</li>
- <li><code>center</code>: The text will be cropped in the middle, showing both the start and end of the text normally.</li>
- <li><code>none</code>: The text will be not be cropped using an ellipsis. However, the text will simply be cut off if it is too large. The side depends on the CSS text alignment.</li>
-</ul>
-
-<p></p>
-</div> <div id="a-disableautoselect">
-
-
-<dl>
- <dt><code id="a-disableautoselect"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/disableautoselect">disableautoselect</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>If this attribute is <code>true</code> or omitted, the selected item on the menu will update to match what the user entered in the textbox. If the text does not match any of the items in the list, the menu selection is cleared. If this attribute is <code>false</code>, the selection is never updated to match the text box. This attribute applies only to editable <code><a href="/en-US/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code>s.</dd>
-</dl>
-</div> <div id="a-disabled">
-
-
-<dl>
- <dt><code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code></dt>
- <dd> </dd>
- <dd>
- <h5 id="类型boolean">类型:<em>boolean</em></h5>
- </dd>
- <dd>
- <h5 id="表示元素是被禁用的。">表示元素是被禁用的。</h5>
-
- <p>如果这个元素的disabled属性被设置为true,表示元素被禁用,被禁用的属性在页面上通常会显示灰色文本,它无法响应用户的操作,它也无法得到光标。</p>
-
- <p>然而,这个元素仍然能够响应鼠标事件,如果要启用这个元素,把disabled设置为false</p>
- </dd>
-</dl>
-
-<h4 id="示例:">示例:</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_attr_disabled.png" src="https://mdn.mozillademos.org/files/1742/XUL_ref_attr_disabled.png"></div>
-
-<pre><code>// Disabling an element
-document.getElementById('buttonRemove').setAttribute("disabled", "true");
-
-// Enabling back an element by removing the "disabled" attribute
-document.getElementById('buttonRemove').removeAttribute("disabled");</code></pre>
-
-<p></p><div class="blockIndicator standardNote">
- <p><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Firefox/Releases/3.5">Firefox 3.5 note</a></p>
- <p style="font-weight: 400;">For <a href="https://developer.mozilla.org/en-US/docs/XUL/keyset" title="en/XUL/Keyset"><code>keyset</code></a> elements, support for this attribute was added in Firefox 3.5.</p>
-</div><p></p>
-</div> <div id="a-editable">
-
-
-<dl>
- <dt><code id="a-editable"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/editable">editable</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>Indicates that the value of the <code><a href="/en-US/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code> can be modified by typing directly into the value field. This is rendered as a textbox with a drop-down arrow beside it. The user may enter text into the textbox or select one of the choices by clicking from the drop-down.</dd>
-</dl>
-</div> <div id="a-focused">
-
-
-<dl>
- <dt><code id="a-focused"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/focused">focused</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>This attribute is <code>true</code> if the element is focused.</dd>
-</dl>
-</div> <div id="a-image">
-
-<dl>
- <dt>
- <code id="a-image"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/image">image</a></code></dt>
- <dd>
- Type:
- <i>
- image URL</i>
- </dd>
- <dd>
- The URL of the image to appear on the element. If this attribute is empty or left out, no image appears. The position of the image is determined by the <code id="a-dir"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/dir">dir</a></code> and <code id="a-orient"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/orient">orient</a></code> attributes.</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-label">
-
-<dl>
- <dt>
- <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- The label that will appear on the element. If this is left out, no text appears.<br>
- label 在元素上显示。如果左侧出界,则不显示任何文字。</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-oncommand">
-
-
-<dl>
- <dt><code id="a-oncommand"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/oncommand">oncommand</a></code></dt>
- <dd>Type: <em>script code</em></dd>
- <dd>This event handler is called when the command is activated. This occurs when a user selects a menu item or presses a keyboard shortcut attached to the command.</dd>
-</dl>
-
-
-</div> <div id="a-open">
-
-
-<dl>
- <dt><code id="a-open"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/open">open</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>For the <code>menu</code> <code id="a-type"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/type">type</a></code> buttons, the <code>open</code> attribute is set to <code>true</code> when the menu is open. The <code>open</code> attribute is not present if the menu is closed.</dd>
-</dl>
-</div> <div id="a-preference">
-
-
-<dl>
- <dt><code id="a-preference"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/preference">preference</a></code></dt>
- <dd>Type: <em>id</em></dd>
- <dd>Connects the element to a corresponding <code><a href="/en-US/docs/Mozilla/Tech/XUL/preference" title="preference">preference</a></code>. This attribute only has any effect when used inside a <code><a href="/en-US/docs/Mozilla/Tech/XUL/prefwindow" title="prefwindow">prefwindow</a></code>. More information is available in the <a href="../../../../en/Preferences_System" rel="internal">Preferences System</a> article.</dd>
-</dl>
-</div> <div id="a-readonly">
-
-
-<dl>
- <dt><code id="a-readonly"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/readonly">readonly</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>If set to <code>true</code>, then the user cannot change the value of the element. However, the value may still be modified by a script.</dd>
-</dl>
-</div> <div id="a-sizetopopup">
-
-
-<dl>
- <dt><code id="a-sizetopopup"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/sizetopopup">sizetopopup</a></code></dt>
- <dd>Type: <em>one of the values below</em></dd>
- <dd>Indicates how the menu width and the <code><a href="/en-US/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code> width are determined. If the <code>sizetopopup</code> attribute is left out or set to <code>none</code>, the menu will be its preferred width and the popup may extend outside of this width, unaffected by the maximum width of the menu itself. Otherwise, the menu will size itself to at least the size of the popup. If the menu has a maximum width, the popup will also be this width.</dd>
- <dd>
- <dl>
- <dt><code>none</code></dt>
- <dd>The width of the popup will not be constrained to the size of the menu.</dd>
- <dt><code>pref</code></dt>
- <dd>The preferred width of the menu label or button will be the size needed for the popup contents. This is the default value for menulists.</dd>
- <dt><code>always</code></dt>
- <dd>Both the preferred and minimum width of the menu label or button will be the same as that necessary for the <code><a href="/en-US/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code>.</dd>
- </dl>
- </dd>
-</dl>
-</div> <div id="a-tabindex">
-
-
-<dl>
- <dt><code id="a-tabindex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tabindex">tabindex</a></code></dt>
- <dd>Type:<em>integer</em></dd>
- <dd>当用户按下 "<kbd>tab</kbd>" 键时焦点移动到元素上的顺序。<code>tabindex</code> 数字越大,顺序越靠后。</dd>
-</dl>
-
-
-
-<p></p>
-</div> <div id="a-value">
-
-<dl>
- <dt>
- <code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- The string attribute allows you to associate a data value with an element. It is not used for any specific purpose, but you can access it with a script for your own use.</dd>
-</dl>
-
-<p></p>
-</div><p></p>
-<h3 id="Properties" name="Properties">Properties</h3>
-<p> </p><div id="p-accessibleType">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessibleType">accessibleType</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- A value indicating the type of accessibility object for the element.</dd>
-</dl>
-
-<p></p></div> <div id="p-crop">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/crop">crop</a></span></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-crop"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/crop">crop</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-description">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/description">description</a></span></code></dt>
- <dd>Type: <em>string</em></dd>
- <dd>Set to the description of the currently selected <code><a href="/en-US/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code>.</dd>
-</dl></div> <div id="p-disableautoselect">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/disableautoselect">disableautoselect</a></span></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>Gets and sets the value of the <code id="a-disableautoselect"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/disableautoselect">disableautoselect</a></code> attribute.</dd>
-</dl></div> <div id="p-disabled">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/disabled">disabled</a></span></code></dt>
- <dd>
- Type:
- <i>
- boolean</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-editable">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/editable">editable</a></span></code> </dt>
- <dd>
- Type: <em>boolean</em></dd>
- <dd>
- Returns <code>true</code> if the element is editable. Autocomplete fields are editable so this property always returns <code>true</code> for those.</dd>
-</dl>
-<p> </p></div> <div id="p-editor">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/editor">editor</a></span></code></dt>
- <dd>Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIEditor" title="">nsIEditor</a></code></em></dd>
- <dd>A reference to the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIEditor" title="">nsIEditor</a></code> for editable text. This property is read only.</dd>
-</dl></div> <div id="p-menulist.image">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/menulist.image">image</a></span></code></dt>
- <dd>Type: <em>image URL</em></dd>
- <dd>The image associated with the currently selected item.</dd>
-</dl></div> <div id="p-menulist.inputField">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/menulist.inputField">inputField</a></span></code></dt>
- <dd>Type: <em>textbox element</em></dd>
- <dd>A reference to the <code><a href="/en-US/docs/Mozilla/Tech/XUL/textbox" title="textbox">textbox</a></code> element used for editable menu lists. This property is read only and applies to editable <code><a href="/en-US/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code>s only.</dd>
-</dl>
-
-</div> <div id="p-itemCount">
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/itemCount">itemCount</a></span></code> </dt>
- <dd>Type: <em>integer</em></dd>
- <dd>Read only property holding the number of child items.</dd>
-</dl>
-</div> <div id="p-label">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/label">label</a></span></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-menuBoxObject">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/menuBoxObject">menuBoxObject</a></span></code></dt>
- <dd>Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMenuBoxObject" title="">nsIMenuBoxObject</a></code></em></dd>
- <dd>A reference to the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMenuBoxObject" title="">nsIMenuBoxObject</a></code> which implements the menu.</dd>
-</dl></div> <div id="p-menupopup">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/menupopup">menupopup</a></span></code></dt>
- <dd>Type: <em>menupopup element</em></dd>
- <dd>A reference to the <code><a href="/en-US/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code> used by the <code><a href="/en-US/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code> or <code><a href="/en-US/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code>. This property is read-only.</dd>
-</dl></div> <div id="p-open">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/open">open</a></span></code></dt>
- <dd>
- Type: <em>boolean</em></dd>
- <dd>
- Gets and sets the value of the <code id="a-open"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/open">open</a></code> attribute.</dd>
-</dl>
-</div> <div id="p-selectedIndex">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectedIndex">selectedIndex</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- Returns the index of the currently selected item. You may select an item by assigning its index to this property. By assigning <code>-1</code> to this property, all items will be deselected.</dd>
-</dl>
-
-<p></p></div> <div id="p-selectedItem">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectedItem">selectedItem</a></span></code></dt>
- <dd>
- Type:
- <i>
- element</i>
- </dd>
- <dd>
- Holds the currently selected item. If no item is currently selected, this value will be <code>null</code>. You can select an item by setting this value. A select event will be sent to the element when it is changed either via this property, the <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectedIndex">selectedIndex</a></span></code> property, or changed by the user.</dd>
-</dl>
-
-<p></p></div> <div id="p-tabIndex">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tabIndex">tabIndex</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-tabindex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tabindex">tabindex</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-value">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/value">value</a></span></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code> attribute.</dd>
-</dl>
-
-<p></p></div><p></p>
-<h3 id="Methods" name="Methods">Methods</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0 0 10px 10px; padding: 0 10px; background: rgb(238, 238, 238); float: right; width: 250px;">
-<tbody>
-<tr>
-<td>
-<p><strong>Inherited Methods</strong><br>
-<small><code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.cloneNode">cloneNode()</a></code>, <a href="/En/DOM/Node.compareDocumentPosition" title="En/DOM/Node.compareDocumentPosition">compareDocumentPosition</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getBoundingClientRect">getBoundingClientRect()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getClientRects">getClientRects()</a></code>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span>, <span id="m-getElementsByAttributeNS"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttributeNS">getElementsByAttributeNS</a></code></span>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByClassName">getElementsByClassName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getFeature">getFeature()</a></code>, <a href="/En/DOM/Node.getUserData" title="En/DOM/Node.getUserData">getUserData</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isDefaultNamespace">isDefaultNamespace()</a></code>, <a href="/En/DOM/Node.isEqualNode" title="En/DOM/Node.isEqualNode">isEqualNode</a>, <a href="/En/DOM/Node.isSameNode" title="En/DOM/Node.isSameNode">isSameNode</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <a href="/En/DOM/Node.lookupNamespaceURI" title="En/DOM/Node.lookupNamespaceURI">lookupNamespaceURI</a>, <a href="/En/DOM/Node.lookupPrefix" title="En/DOM/Node.lookupPrefix">lookupPrefix</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.querySelector">querySelector()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.querySelectorAll">querySelectorAll()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code>, <a href="/En/DOM/Node.setUserData" title="En/DOM/Node.setUserData">setUserData</a></small></p>
-
-</td>
-</tr>
-</tbody>
-</table> <dl>
- <dt><span id="m-menulist.appendItem"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/menulist.appendItem">appendItem( label, value, description )</a></code></span></dt>
- <dd>Return type: <em>element</em></dd>
- <dd>Creates a new <code><a href="/en-US/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code> element and adds it to the end of the menulist. You may optionally set a value and description. The function returns the new item.</dd>
-</dl> <dl>
- <dt><span id="m-contains"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/contains">contains( item )</a></code></span> </dt>
- <dd>Return type: <em>boolean</em></dd>
- <dd>Returns <code>true</code> if the <code><a href="/en-US/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code> contains the specified <code><a href="/en-US/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code> as one of its items.</dd>
-</dl> <dl>
- <dt><span id="m-getIndexOfItem"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/getIndexOfItem">getIndexOfItem( item )</a></code></span></dt>
- <dd>Return type: <em>integer</em></dd>
- <dd>Returns the zero-based position of the specified item. Items are numbered starting at the first item displayed in the list.</dd>
-</dl> <dl>
- <dt><span id="m-getItemAtIndex"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/getItemAtIndex">getItemAtIndex( index )</a></code></span></dt>
- <dd>Return type: <em>element</em></dd>
- <dd>Returns the element that is at the specified index.</dd>
-</dl> <dl>
- <dt>
- <span id="m-insertItemAt"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/insertItemAt">insertItemAt( index, label, value )</a></code></span></dt>
- <dd>
- Return type: <em>element</em></dd>
- <dd>
- This method creates a new item and inserts it at the specified position. You may optionally set a value. The new item element is returned.</dd>
-</dl> <dl>
- <dt><span id="m-removeAllItems"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/removeAllItems">removeAllItems()</a></code></span></dt>
- <dd>Return type: <em>no return value</em></dd>
- <dd>Removes all of the items in the <a href="/en/XUL/menu" title="en/XUL/menu">menu</a>.</dd>
-</dl> <dl>
- <dt>
- <span id="m-removeItemAt"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/removeItemAt">removeItemAt( index )</a></code></span></dt>
- <dd>
- Return type: <em>element</em></dd>
- <dd>
- Removes the child item in the element at the specified index. The method returns the removed item.</dd>
-</dl> <dl>
- <dt><span id="m-menulist.select"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/menulist.select">select()</a></code></span></dt>
- <dd>Return type: <em>no return value</em></dd>
- <dd>Select all the text in the <code><a href="/en-US/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code>'s textbox. This method applies to <code id="a-editable"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/editable">editable</a></code> menulists only.</dd>
-</dl><p></p>
-<h3 id="Related" name="Related">Related</h3>
-<dl>
- <dt>
- Elements</dt>
- <dd>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menubar" title="menubar">menubar</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuseparator" title="menuseparator">menuseparator</a></code></dd>
-</dl>
-<dl>
- <dt>
- Interfaces</dt>
- <dd>
- <a href="cn/NsIAccessibleProvider">nsIAccessibleProvider</a>, <a href="cn/NsIDOMXULMenuListElement">nsIDOMXULMenuListElement</a></dd>
-</dl>
-<p> </p>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/menupopup/index.html b/files/zh-cn/mozilla/tech/xul/menupopup/index.html
deleted file mode 100644
index 23b103ebb9..0000000000
--- a/files/zh-cn/mozilla/tech/xul/menupopup/index.html
+++ /dev/null
@@ -1,324 +0,0 @@
----
-title: menupopup
-slug: Mozilla/Tech/XUL/menupopup
-tags:
- - XUL Elements
- - XUL Reference
-translation_of: Archive/Mozilla/XUL/menupopup
----
-<div class="noinclude">
- <span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-<p>A container used to display the contents of a popup menu. When a menupopup is open, it floats above the window and may extend outside the window border. There are several ways in which a menupopup may be used:</p>
-<ol>
- <li>It may be placed inside a <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbarbutton" title="toolbarbutton">toolbarbutton</a></code>, or a <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/button" title="button">button</a></code> with the <a href="#a-type">type</a> attribute set to "menu" to create a popup that will open when the menu or button is pressed.</li>
- <li>It may be attached to any element using the <code id="a-popup"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/popup">popup</a></code> attribute. When the element is clicked with the left mouse button, the menupopup will be displayed.</li>
- <li>It may be attached to any element using the <code id="a-context"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/context">context</a></code> attribute. When a context menu is opened, the menupopup will be displayed. A context menu may be opened by right-clicking the element, or by pressing the menu key on the keyboard.</li>
-</ol>
-<p>More information is available in the <a href="cn/XUL_Tutorial/Simple_Menu_Bars">XUL tutorial</a>.</p>
-<dl>
- <dt>
- Attributes</dt>
- <dd>
- <a href="#a-ignorekeys">ignorekeys</a>, <a href="#a-popup.left">left</a>, <a href="#a-onpopuphidden">onpopuphidden</a>, <a href="#a-onpopuphiding">onpopuphiding</a>, <a href="#a-onpopupshowing">onpopupshowing</a>, <a href="#a-onpopupshown">onpopupshown</a>, <a href="#a-popup.position">position</a>, <a href="#a-popup.top">top</a></dd>
-</dl>
-<dl>
- <dt>
- Properties</dt>
- <dd>
- <a href="#p-accessibleType">accessibleType</a>, <a href="#p-popupBoxObject">popupBoxObject</a>, <a href="#p-popup">popup</a>, <a href="#p-state">state</a></dd>
-</dl>
-<dl>
- <dt>
- Methods</dt>
- <dd>
- <a href="#m-hidePopup">hidePopup</a>, <a href="#m-moveTo">moveTo</a>, <a href="#m-openPopup">openPopup</a>, <a href="#m-openPopupAtScreen">openPopupAtScreen</a>, <a href="#m-showPopup">showPopup</a>, <a href="#m-sizeTo">sizeTo</a></dd>
-</dl>
-<h3 id="Examples" name="Examples">Examples</h3>
-<p>The following example shows how a menupopup may be attached to a <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code>.</p>
-<pre>&lt;menulist&gt;
- &lt;menupopup&gt;
- &lt;menuitem label="Mozilla" value="http://mozilla.org"/&gt;
- &lt;menuitem label="Slashdot" value="http://slashdot.org"/&gt;
- &lt;menuitem label="Sourceforge" value="http://sf.net"/&gt;
- &lt;menuitem label="Freshmeat" value="http://freshmeat.net"/&gt;
- &lt;/menupopup&gt;
-&lt;/menulist&gt;
-</pre>
-<p>The following example shows how a menupopup can be used a context menu for an element. When the label is right-clicked, the menu will be displayed.</p>
-<div class="float-right">
- <img alt="Image:XUL_ref_popup.png"></div>
-<pre>&lt;menupopup id="clipmenu"&gt;
- &lt;menuitem label="Cut"/&gt;
- &lt;menuitem label="Copy"/&gt;
- &lt;menuitem label="Paste"/&gt;
-&lt;/menupopup&gt;
-&lt;label value="Right click for popup" context="clipmenu"/&gt;
-</pre>
-<h3 id="Attributes" name="Attributes">Attributes</h3>
-<p> </p><div id="a-ignorekeys">
-
-
-<dl>
- <dt><code id="a-ignorekeys"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/ignorekeys">ignorekeys</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>If <code>true</code>, keyboard navigation between items in the popup is disabled.</dd>
-</dl>
-</div> <div id="a-popup.left">
-
-
-<dl>
- <dt><code id="a-popup.left"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/popup.left">left</a></code></dt>
- <dd>Type: <em>integer</em></dd>
- <dd>Overrides the horizontal position of the popup specified by the <span id="m-showPopup"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/showPopup">showPopup</a></code></span> method.</dd>
-</dl>
-</div> <div id="a-onpopuphidden">
-
-
-<dl>
- <dt><code id="a-onpopuphidden"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/onpopuphidden">onpopuphidden</a></code></dt>
- <dd>Type: <em>script code</em></dd>
- <dd>This event is sent to a popup after it has been hidden.</dd>
- <dd>This event may also be received while the popup is still open, but when sub-menus contained within this popup are hidden.</dd>
- <dt>
- <h4 id="Example">Example:</h4>
- </dt>
-</dl>
-
-<pre>&lt;menupopup id="top" onpopuphidden="console.log('The onpopuphidden method of id=top was called.');"&gt;
-    &lt;menuitem label="item 1"/&gt;
-    &lt;menuitem label="item 2"/&gt;
-    &lt;menu id="submenu1" label="submenu 1"&gt;
-        &lt;menupopup id="submenu1-popup"&gt;
-            &lt;menuitem label="submenu1 item 1"/&gt;
-            &lt;menuitem label="submenu1 item 2"/&gt;
-        &lt;/menupopup&gt;
-    &lt;/menu&gt;
-    &lt;menu id="submenu2" label="submenu 1"&gt;
-        &lt;menupopup id="submenu2-popup"&gt;
-            &lt;menuitem label="submenu2 item 1"/&gt;
-            &lt;menuitem label="submenu2 item 2"/&gt;
-        &lt;/menupopup&gt;
-    &lt;/menu&gt;
-&lt;menupopup/&gt;
-</pre>
-
-
-</div> <div id="a-onpopuphiding">
-
-
-<dl>
- <dt><code id="a-onpopuphiding"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/onpopuphiding">onpopuphiding</a></code></dt>
- <dd>Type: <em>script code</em></dd>
- <dd>This event is sent to a popup when it is about to be hidden.</dd>
-</dl>
-</div> <div id="a-onpopupshowing">
-
-<dl>
- <dt>
- <code id="a-onpopupshowing"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/onpopupshowing">onpopupshowing</a></code></dt>
- <dd>
- Type: <em>script code</em></dd>
- <dd>
- This event is sent to a popup just before it is opened. This handler is usually used to dynamically set the contents when the user requests to display it. Returning <code>false</code> from this event handler prevents the popup from appearing.</dd>
- <dd>
- 该事件在 popup 打开之前传给它。它用于动态生成菜单项。如果返回 false 值,则 popup 将不会显示菜单项。</dd>
-</dl>
-
-<p> </p>
-</div> <div id="a-onpopupshown">
-
-<dl>
- <dt>
- <code id="a-onpopupshown"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/onpopupshown">onpopupshown</a></code></dt>
- <dd>
- Type: <em>script code</em></dd>
- <dd>
- This event is sent to a popup after it has been opened, much like the <code>onload</code> event is sent to a window when it is opened.</dd>
- <dd>
- 该事件在 popup 打开之后触发,与 window 的 onload 事件比较类似。</dd>
-</dl>
-
-<p> </p>
-</div> <div id="a-popup.position">
-
-
-<dl>
- <dt><code id="a-popup.position"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/popup.position">position</a></code></dt>
- <dd>Type: <em>string</em></dd>
- <dd>The <code>position</code> attribute determines where the popup appears relative to the element the user clicked to invoke the popup. This allows you to place the popup on one side of a button.  Note that a context menu will never respect this attribute, always appearing relative to the mouse cursor.</dd>
- <dd><br>
- This value can be specified either as a single word offering pre-defined alignment positions, or as 2 words specifying exactly which part of the anchor and popup should be aligned.</dd>
- <dd><br>
- If specified as 2 words, the value indicates which corner or edge of the anchor (the first word) is aligned which which corner of the popup (the second word).  The anchor value (ie, the first word) can be one of <code>topleft</code>, <code>topright</code>, <code>bottomleft</code>, <code>bottomright</code>, <code>leftcenter</code>, <code>rightcenter</code>, <code>topcenter</code> or <code>bottomcenter</code>.  The popup value (ie, the second word) can be one of <code>topleft</code>, <code>topright</code>, <code>bottomleft</code> or <code>bottomright</code>.</dd>
- <dd><br>
- Positions specified as a single word string are shortcuts for the values above.  Valid single-word values are <code>after_start</code>, <code>after_end</code>, <code>before_start</code>, <code>before_end</code>, <code>end_after</code>, <code>end_before</code>, <code>start_after</code>, <code>start_before</code>, <code>overlap</code>, <code>at_pointer</code> or <code>after_pointer</code>.</dd>
- <dd>For more details, including examples, please see <a href="/en-US/docs/XUL/PopupGuide/Positioning" title="/en-US/docs/XUL/PopupGuide/Positioning">popup positioning</a></dd>
-</dl>
-
-
-</div> <div id="a-popup.top">
-
-
-<dl>
- <dt><code id="a-popup.top"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/popup.top">top</a></code></dt>
- <dd>Type: <em>integer</em></dd>
- <dd>Overrides the vertical position of the popup specified by the <span id="m-showPopup"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/showPopup">showPopup</a></code></span> method.</dd>
-</dl>
-</div><p></p>
-<h3 id="Properties" name="Properties">Properties</h3>
-<p> </p><div id="p-accessibleType">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessibleType">accessibleType</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- A value indicating the type of accessibility object for the element.</dd>
-</dl>
-
-<p></p></div> <div id="p-popupBoxObject">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/popupBoxObject">popupBoxObject</a></span></code></dt>
- <dd>
- Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIPopupBoxObject" title="">nsIPopupBoxObject</a></code></em></dd>
- <dd>
- This read-only property holds the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIPopupBoxObject" title="">nsIPopupBoxObject</a></code> that implements the popup. You wouldn't normally need to use this property as all of its functions are available via the popup itself.</dd>
-</dl></div> <div id="p-position">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/position">position</a></span></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- Gets and sets the value of the <a href="/en/XUL/Attribute/popup.position" title="en/XUL/Attribute/popup.position">position</a> attribute.</dd>
-</dl></div> <div id="p-state">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/state">state</a></span></code> </dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- This read only property indicates whether the popup is open or not. Four values are possible:
- <ul>
- <li><code>closed</code>: The popup is closed and not visible.</li>
- <li><code>open</code>: The popup is open and visible on screen.</li>
- <li><code>showing</code>: A request has been made to open the popup, but it has not yet been shown. This state will occur during the popupshowing event.</li>
- <li><code>hiding</code>: The popup is about to be hidden. This state will occur during the popuphiding event.</li>
- </ul>
- </dd>
-</dl></div><p></p>
-<h3 id="Methods" name="Methods">Methods</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0 0 10px 10px; padding: 0 10px; background: rgb(238, 238, 238); float: right; width: 250px;">
-<tbody>
-<tr>
-<td>
-<p><strong>Inherited Methods</strong><br>
-<small><code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.cloneNode">cloneNode()</a></code>, <a href="/En/DOM/Node.compareDocumentPosition" title="En/DOM/Node.compareDocumentPosition">compareDocumentPosition</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getBoundingClientRect">getBoundingClientRect()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getClientRects">getClientRects()</a></code>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span>, <span id="m-getElementsByAttributeNS"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttributeNS">getElementsByAttributeNS</a></code></span>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByClassName">getElementsByClassName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getFeature">getFeature()</a></code>, <a href="/En/DOM/Node.getUserData" title="En/DOM/Node.getUserData">getUserData</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isDefaultNamespace">isDefaultNamespace()</a></code>, <a href="/En/DOM/Node.isEqualNode" title="En/DOM/Node.isEqualNode">isEqualNode</a>, <a href="/En/DOM/Node.isSameNode" title="En/DOM/Node.isSameNode">isSameNode</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <a href="/En/DOM/Node.lookupNamespaceURI" title="En/DOM/Node.lookupNamespaceURI">lookupNamespaceURI</a>, <a href="/En/DOM/Node.lookupPrefix" title="En/DOM/Node.lookupPrefix">lookupPrefix</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.querySelector">querySelector()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.querySelectorAll">querySelectorAll()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code>, <a href="/En/DOM/Node.setUserData" title="En/DOM/Node.setUserData">setUserData</a></small></p>
-
-</td>
-</tr>
-</tbody>
-</table> <dl>
- <dt>
- <span id="m-hidePopup"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/hidePopup">hidePopup()</a></code></span></dt>
- <dd>
- Return type: <em>no return value</em></dd>
- <dd>
- Closes the popup immediately.</dd>
-</dl> <dl>
- <dt>
- <span id="m-moveTo"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/moveTo">moveTo( x, y )</a></code></span></dt>
- <dd>
- Return type: <em>no return value</em></dd>
- <dd>
- Moves the popup to a new location defined by screen coordinates (and not client coordinates).</dd>
- <dd>
- If both x and y have the value -1 the call will realign the popup with its anchor node.</dd>
-</dl> <dl>
- <dt>
- <span id="m-openPopup"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/openPopup">openPopup( anchor , position , x , y , isContextMenu, attributesOverride, triggerEvent )</a></code></span> </dt>
- <dd>
- Return type: <em>no return value</em></dd>
-</dl>
-<p>Opens the popup relative to a specified node at a specific location.</p>
-<dl>
- <dt>
- anchor</dt>
- <dd>
- The popup may be either anchored to another node or opened freely. To anchor a popup to a node, supply an anchor node and set the position to a string indicating the manner in which the popup should be anchored. The anchor node does not need to be in the same document as the popup. Unanchored popups may be created by supplying <code>null</code> as the anchor node. The direction in which the popup is oriented depends on the direction of the anchor.</dd>
- <dt>
- position</dt>
- <dd>
- Possible values for position are: <code>before_start</code>, <code>before_end</code>, <code>after_start</code>, <code>after_end</code>, <code>start_before</code>, <code>start_after</code>, <code>end_before</code>, <code>end_after</code>, <code>overlap</code>, and <code>after_pointer</code>. Check <a href="/en/XUL/PopupGuide/Positioning" title="https://developer.mozilla.org/en/XUL/PopupGuide/Positioning">Positioning of the Popup Guide</a> for a precise description of the effect of the different values.</dd>
- <dt>
- x, y</dt>
- <dd>
- For an anchored popup, the <code>x</code> and <code>y</code> arguments may be used to offset the popup from its anchored position by some number, measured in CSS pixels. An unanchored popup appears at the position specified by x and y, relative to the viewport of the document containing the popup node. In this case, the <code>position</code> and <code>attributesOverride</code> arguments are ignored.</dd>
- <dt>
- isContextMenu</dt>
- <dd>
- The <code>isContextMenu</code> argument should be <code>true</code> for context menus and <code>false</code> for all other types of popups. It affects menu item highlighting; that is, while a context menu is open, menus opened earlier do not highlight or execute their items.</dd>
- <dt>
- attributesOverride</dt>
- <dd>
- If the <code>attributesOverride</code> argument is <code>true</code>, the position attribute on the popup node overrides the <code>position</code> value argument. If <code>attributesOverride</code> is <code>false</code>, the attribute is only used if the <code>position</code> argument is empty.</dd>
- <dt>
- triggerEvent</dt>
- <dd>
- The event that triggered the popup (such as a mouse click, if the user clicked something to open the popup).</dd>
-</dl> <dl>
- <dt>
- <span id="m-openPopupAtScreen"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/openPopupAtScreen">openPopupAtScreen( x, y, isContextMenu )</a></code></span> </dt>
- <dd>
- Return type: <em>no return value</em></dd>
- <dd>
- Open the popup at a specific screen position specified by x and y. This position may be adjusted if it would cause the popup to be off of the screen. The x and y coordinates are measured in CSS pixels.</dd>
-</dl> <dl>
- <dt><span id="m-showPopup"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/showPopup">showPopup( element, x, y, popupType, anchor, align )</a></code></span> <span class="inlineIndicator deprecated deprecatedInline" title="(Firefox 3)">Deprecated since Gecko 1.9</span></dt>
- <dd>Return type: <em>no return value</em><br>
- <em>Deprecated in favor of openPopup and <span>openPopupAtScreen</span></em></dd>
- <dd>Opens a popup element. There are two ways of specifying where the popup appears, either at a specific screen position, or relative to some element in the window. If either <var>x</var> or <var>y</var> are set to values, the popup will appear at the screen coordinate (<var>x</var>,<var>y</var>). If <var>x</var> and <var>y</var> are <code>-1</code>, the popup will be positioned relative to the <var>element</var> specified as the first argument. This is what you might do to show a popup below a button, for example. In this latter case, the <var>anchor</var> and <var>align</var> arguments may be used to further control where the popup appears relative to the element. The <var>anchor</var> argument corresponds to the <code id="a-popupanchor"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/popupanchor">popupanchor</a></code> attribute on the element. The <var>align</var> argument corresponds to the <code id="a-popupalign"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/popupalign">popupalign</a></code> attribute on the element. The <var>anchor</var> and <var>align</var> arguments are ignored if either <var>x</var> or <var>y</var> are not <code>-1</code>.</dd>
-</dl>
-
-<dl>
- <dd>To have a popup appear relative to another element yet still offset by some number of pixels, determine the actual screen position of the element using the <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/boxObject">boxObject</a></span></code>.screenX and <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/boxObject">boxObject</a></span></code>.screenY properties of the element, and use those as the <var>x</var> and <var>y</var> arguments offset by the desired values.</dd>
-</dl>
-
-<dl>
- <dd>The <var>popupType</var> should be one of the strings <code>popup</code>, <code>context</code>, or <code>tooltip</code>. Each type of popup is intended to be displayed only temporarily; they are not expected to be displayed permanently.</dd>
-</dl> <dl>
- <dt>
- <span id="m-sizeTo"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/sizeTo">sizeTo( width, height )</a></code></span></dt>
- <dd>
- Return type: <em>no return value</em></dd>
- <dd>
- Changes the current size of the popup to the new <var>width</var> and <var>height</var>.</dd>
-</dl><p></p>
-<h3 id="Related" name="Related">Related</h3>
-<dl>
- <dt>
- Elements</dt>
- <dd>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menubar" title="menubar">menubar</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuseparator" title="menuseparator">menuseparator</a></code></dd>
-</dl>
-<dl>
- <dt>
- Interfaces</dt>
- <dd>
- <a href="cn/NsIAccessibleProvider">nsIAccessibleProvider</a>, <a href="cn/NsIDOMXULPopupElement">nsIDOMXULPopupElement</a></dd>
-</dl>
-<p> </p>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/menuseparator/index.html b/files/zh-cn/mozilla/tech/xul/menuseparator/index.html
deleted file mode 100644
index 5b00451c60..0000000000
--- a/files/zh-cn/mozilla/tech/xul/menuseparator/index.html
+++ /dev/null
@@ -1,435 +0,0 @@
----
-title: menuseparator
-slug: Mozilla/Tech/XUL/menuseparator
-tags:
- - XUL Elements
- - XUL Reference
-translation_of: Archive/Mozilla/XUL/menuseparator
----
-<div class="noinclude">
- <span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-<p>Used to create a separator between menu items. Typically drawn as a thin line.</p>
-<p>More information is available in the <a href="cn/XUL_Tutorial/Simple_Menu_Bars">XUL tutorial</a>.</p>
-<dl>
- <dt>
- Attributes</dt>
- <dd>
- <a href="#a-acceltext">acceltext</a>, <a href="#a-accesskey">accesskey</a>, <a href="#a-allowevents">allowevents</a>, <a href="#a-command">command</a>, <a href="#a-crop">crop</a>, <a href="#a-disabled">disabled</a>, <a href="#a-image">image</a>, <a href="#a-label">label</a>, <a href="#a-selected">selected</a>, <a href="#a-tabindex">tabindex</a>, <a href="#a-value">value</a></dd>
-</dl>
-<dl>
- <dt>
- Properties</dt>
- <dd>
- <a href="#p-accessibleType">accessibleType</a>, <a href="#p-accessKey">accessKey</a>, <a href="#p-command">command</a>, <a href="#p-menuitem.control">control</a>, <a href="#p-crop">crop</a>, <a href="#p-disabled">disabled</a>, <a href="#p-image">image</a>, <a href="#p-label">label</a>, <a href="#p-labelElement">labelElement</a>, <a href="#p-parentContainer">parentContainer</a>, <a href="#p-selected">selected</a>, <a href="#p-tabIndex">tabIndex</a>, <a href="#p-value">value</a></dd>
-</dl>
-<h3 id="Examples" name="Examples">Examples</h3>
-<pre>&lt;menu label="Help"&gt;
- &lt;menupopup&gt;
- &lt;menuitem label="Contents"/&gt;
- &lt;menuseparator/&gt;
- &lt;menuitem label="Release Notes"/&gt;
- &lt;/menupopup&gt;
-&lt;/menu&gt;
-</pre>
-<h3 id="Attributes" name="Attributes">Attributes</h3>
-<p> </p><div id="a-acceltext">
-
-<dl>
- <dt>
- <code id="a-acceltext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/acceltext">acceltext</a></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Text that appears beside beside the <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code> label to indicate the shortcut key (accelerator key) to use to invoke the command. If this value is set, it overrides an assigned key set in the key attribute. This attribute does not apply to menus directly on the menubar.</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-accesskey">
-
-
-
-
-<dl>
- <dt><code id="a-accesskey"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/accesskey">accesskey</a></code></dt>
- <dd>类型:
- <i>character【字符】</i>
- </dd>
- <dd>本属性允许为控件(元素)设定一个字符作为快捷键,这个字符应该是 <code><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></code> 属性文本中的一个字符。该字符将会被加下划线以重点强调,平台和主体的变换并不影响这一表现行为。 当用户点击 ALT (在其他平台上具有类似功能的键) 和这个字符对应的按键时, 控件(元素)将立刻被从窗口中的某处激活或/并且获得焦点 <b>。虽说字符不分大小写,但是当label中存在大写字符和小写字符时,快捷键的字符将首先选择与之完全匹配的那一个,如果label中存在两个或更多的与accesskey字符相同的字符,其中的第一个字符将被加下划线。</b></dd>
- <dt>      *(有些键在监听按键事件时,分别对应event.ctrlKey和event.metaKey。)</dt>
-</dl>
-
-<p> </p>
-
-<h4 id="Example" name="Example">Example</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_accesskey_attr.png"></div>
-
-<pre>&lt;vbox&gt;
- &lt;label value="Enter Name" accesskey="e" control="myName"/&gt;
- &lt;textbox id="myName"/&gt;
- &lt;button label="Cancel" accesskey="n"/&gt;
- &lt;button label="Ok" accesskey="O"/&gt;
-&lt;/vbox&gt;
-</pre>
-
-<h4 id="See_also" name="See_also">See also</h4>
-
-<p><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code> attribute, <code id="a-acceltext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/acceltext">acceltext</a></code> attribute</p>
-
-<p></p>
-</div> <div id="a-allowevents">
-
-
-<dl>
- <dt><code id="a-allowevents"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/allowevents">allowevents</a></code></dt>
- <dd>Type:
- <i>boolean<br>
- </i>
- 类型:boolean</dd>
- <dd>If true, events are passed to children of the element. Otherwise, events are passed to the element only.<br>
- 如果为真,事件向子元素传递。否则,事件只传递到当前元素。</dd>
-</dl>
-
-
-
-<p></p>
-</div> <div id="a-command">
-
-<dl>
- <dt>
- <code id="a-command"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/command">command</a></code></dt>
- <dd>
- Type:
- <i>
- element id</i>
- </dd>
- <dd>
- Set to the <code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code> of a <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/command" title="command">command</a></code> element that is being observed by the element.</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-crop">
-
-<dl>
- <dt>
- <code id="a-crop"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/crop">crop</a></code></dt>
- <dd>
- Type:
- <i>
- one of the values below</i>
- </dd>
- <dd>
- If the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the <code>crop</code> attribute. An ellipsis will be used in place of the cropped text. If the box direction is reversed, the cropping is reversed.</dd>
-</dl>
-<ul>
- <li><code>start</code>: The text will be cropped on its left side.</li>
- <li><code>end</code>: The text will be cropped on its right side.</li>
- <li><code>left</code>: <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> The text will be cropped on its left side.</li>
- <li><code>right</code>: <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> The text will be cropped on its right side.</li>
- <li><code>center</code>: The text will be cropped in the middle, showing both the start and end of the text normally.</li>
- <li><code>none</code>: The text will be not be cropped using an ellipsis. However, the text will simply be cut off if it is too large. The side depends on the CSS text alignment.</li>
-</ul>
-
-<p></p>
-</div> <div id="a-disabled">
-
-
-<dl>
- <dt><code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code></dt>
- <dd> </dd>
- <dd>
- <h5 id="类型boolean">类型:<em>boolean</em></h5>
- </dd>
- <dd>
- <h5 id="表示元素是被禁用的。">表示元素是被禁用的。</h5>
-
- <p>如果这个元素的disabled属性被设置为true,表示元素被禁用,被禁用的属性在页面上通常会显示灰色文本,它无法响应用户的操作,它也无法得到光标。</p>
-
- <p>然而,这个元素仍然能够响应鼠标事件,如果要启用这个元素,把disabled设置为false</p>
- </dd>
-</dl>
-
-<h4 id="示例:">示例:</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_attr_disabled.png" src="https://mdn.mozillademos.org/files/1742/XUL_ref_attr_disabled.png"></div>
-
-<pre><code>// Disabling an element
-document.getElementById('buttonRemove').setAttribute("disabled", "true");
-
-// Enabling back an element by removing the "disabled" attribute
-document.getElementById('buttonRemove').removeAttribute("disabled");</code></pre>
-
-<p></p><div class="blockIndicator standardNote">
- <p><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Firefox/Releases/3.5">Firefox 3.5 note</a></p>
- <p style="font-weight: 400;">For <a href="https://developer.mozilla.org/en-US/docs/XUL/keyset" title="en/XUL/Keyset"><code>keyset</code></a> elements, support for this attribute was added in Firefox 3.5.</p>
-</div><p></p>
-</div> <div id="a-image">
-
-<dl>
- <dt>
- <code id="a-image"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/image">image</a></code></dt>
- <dd>
- Type:
- <i>
- image URL</i>
- </dd>
- <dd>
- The URL of the image to appear on the element. If this attribute is empty or left out, no image appears. The position of the image is determined by the <code id="a-dir"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/dir">dir</a></code> and <code id="a-orient"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/orient">orient</a></code> attributes.</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-label">
-
-<dl>
- <dt>
- <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- The label that will appear on the element. If this is left out, no text appears.<br>
- label 在元素上显示。如果左侧出界,则不显示任何文字。</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-selected">
-
-<dl>
- <dt>
- <code id="a-selected"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/selected">selected</a></code></dt>
- <dd>
- Type:
- <i>
- boolean</i>
- </dd>
- <dd>
- Indicates whether the element is selected or not. This value is read-only. To change the selection, set either the <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectedIndex">selectedIndex</a></span></code> or <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectedItem">selectedItem</a></span></code> property of the containing element.</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-tabindex">
-
-
-<dl>
- <dt><code id="a-tabindex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tabindex">tabindex</a></code></dt>
- <dd>Type:<em>integer</em></dd>
- <dd>当用户按下 "<kbd>tab</kbd>" 键时焦点移动到元素上的顺序。<code>tabindex</code> 数字越大,顺序越靠后。</dd>
-</dl>
-
-
-
-<p></p>
-</div> <div id="a-value">
-
-<dl>
- <dt>
- <code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- The string attribute allows you to associate a data value with an element. It is not used for any specific purpose, but you can access it with a script for your own use.</dd>
-</dl>
-
-<p></p>
-</div><p></p>
-<h3 id="Properties" name="Properties">Properties</h3>
-<p> </p><div id="p-accessibleType">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessibleType">accessibleType</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- A value indicating the type of accessibility object for the element.</dd>
-</dl>
-
-<p></p></div> <div id="p-accessKey">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessKey">accessKey</a></span></code></dt>
- <dd>
- Type:
- <i>
- character</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-accesskey"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/accesskey">accesskey</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-command">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/command">command</a></span></code></dt>
- <dd>
- Type:
- <i>
- element id</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-command"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/command">command</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-menuitem.control">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/menuitem.control">control</a></span></code></dt>
- <dd>
- Type:
- <i>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code> element</i>
- </dd>
- <dd>
- Returns the enclosing <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code> that the item is inside, if any, or <code>null</code> if there is no enclosing menu.</dd>
-</dl>
-
-<p></p></div> <div id="p-crop">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/crop">crop</a></span></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-crop"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/crop">crop</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-disabled">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/disabled">disabled</a></span></code></dt>
- <dd>
- Type:
- <i>
- boolean</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-image">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/image">image</a></span></code></dt>
- <dd>
- Type:
- <i>
- image URL</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-image"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/image">image</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-label">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/label">label</a></span></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-labelElement">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/labelElement">labelElement</a></span></code></dt>
- <dd>
- Type:
- <i>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/label" title="label">label</a></code> element</i>
- </dd>
- <dd>
- The <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/label" title="label">label</a></code> element associated with the control. This is set when a label has a <code id="a-control"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/control">control</a></code> attribute pointing to this element. This property will be <code>null</code> when no label is associated with the control.</dd>
-</dl>
-
-<p></p></div> <div id="p-parentContainer">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/parentContainer">parentContainer</a></span></code> </dt>
- <dd>
- Type:
- <i>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code> element</i>
- </dd>
- <dd>
- Read only property that returns the containing <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code> element, or <code>null</code> if there isn't a containing menu.</dd>
-</dl>
-
-<p></p></div> <div id="p-selected">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selected">selected</a></span></code>&lt;magic name="\"PAGENAME\"/"&gt;&lt;/magic&gt;</dt>
- <dd>
- Type:
- <i>
- boolean</i>
- </dd>
- <dd>
- This property's value is <code>true</code> if this element is selected, or <code>false</code> if it is not. This property is read only.</dd>
-</dl></div> <div id="p-tabIndex">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tabIndex">tabIndex</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-tabindex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tabindex">tabindex</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-value">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/value">value</a></span></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code> attribute.</dd>
-</dl>
-
-<p></p></div><p></p>
-<h3 id="Methods" name="Methods">Methods</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited from XUL element</strong><br> <small> <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span></small></p> <p><strong>Inherited from DOM element</strong><br> <small> <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Related" name="Related">Related</h3>
-<dl>
- <dt>
- Elements</dt>
- <dd>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menubar" title="menubar">menubar</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code></dd>
-</dl>
-<dl>
- <dt>
- Interfaces</dt>
- <dd>
- <a href="cn/NsIAccessibleProvider">nsIAccessibleProvider</a>, <a href="cn/NsIDOMXULContainerItemElement">nsIDOMXULContainerItemElement</a>, <a href="cn/NsIDOMXULSelectControlItemElement">nsIDOMXULSelectControlItemElement</a></dd>
-</dl>
-<p> </p>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/method/extra1/index.html b/files/zh-cn/mozilla/tech/xul/method/extra1/index.html
deleted file mode 100644
index 33546b4a30..0000000000
--- a/files/zh-cn/mozilla/tech/xul/method/extra1/index.html
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: extra1
-slug: Mozilla/Tech/XUL/Method/extra1
-translation_of: Archive/Mozilla/XUL/Method/extra1
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefMeth_breadcrumbs">« <a href="/en-US/docs/XUL_Reference" title="/en-US/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <span id="m-extra1"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/extra1">extra1()</a></code></span></dt>
- <dd>
- 返回值类型:无返回值</dd>
- <dd>
- 调用该方法可以模拟对extra1按钮的点击,同时也会触发并执行该元素的<code id="a-onextra1"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/onextra1">onextra1</a></code>属性上设置的代码.</dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/method/focus/index.html b/files/zh-cn/mozilla/tech/xul/method/focus/index.html
deleted file mode 100644
index 690ba10358..0000000000
--- a/files/zh-cn/mozilla/tech/xul/method/focus/index.html
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: focus
-slug: Mozilla/Tech/XUL/Method/focus
-translation_of: Archive/Mozilla/XUL/Method/focus
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefMeth_breadcrumbs">« <a href="/en-US/docs/XUL_Reference" title="/en-US/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus()</a></code></span></dt>
- <dd>
- 返回值类型: 无返回值</dd>
- <dd>
- 让指定的元素获得键盘焦点.</dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/method/getbrowserfortab/index.html b/files/zh-cn/mozilla/tech/xul/method/getbrowserfortab/index.html
deleted file mode 100644
index 483579d074..0000000000
--- a/files/zh-cn/mozilla/tech/xul/method/getbrowserfortab/index.html
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: getBrowserForTab
-slug: Mozilla/Tech/XUL/Method/getBrowserForTab
-translation_of: Archive/Mozilla/XUL/Method/getBrowserForTab
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefMeth_breadcrumbs">« <a href="/en-US/docs/XUL_Reference" title="/en-US/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <span id="m-getBrowserForTab"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getBrowserForTab">getBrowserForTab( tab )</a></code></span></dt>
- <dd>
- 返回值类型: <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/browser" title="browser">browser</a></code>元素</dd>
- <dd>
- 返回于指定的<code><a href="/zh-CN/docs/Mozilla/Tech/XUL/tab" title="tab">tab</a></code>元素相关联的<code><a href="/zh-CN/docs/Mozilla/Tech/XUL/browser" title="browser">browser</a></code>元素.</dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/method/getbutton/index.html b/files/zh-cn/mozilla/tech/xul/method/getbutton/index.html
deleted file mode 100644
index 11b4f91e6d..0000000000
--- a/files/zh-cn/mozilla/tech/xul/method/getbutton/index.html
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: getButton
-slug: Mozilla/Tech/XUL/Method/getButton
-translation_of: Archive/Mozilla/XUL/Method/getButton
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefMeth_breadcrumbs">« <a href="/en-US/docs/XUL_Reference" title="/en-US/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <span id="m-getButton"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getButton">getButton( type )</a></code></span></dt>
- <dd>
- 返回值类型: <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/button" title="button">button</a></code>元素</dd>
- <dd>
- 返回当前对话框中指定类型的<code><a href="/zh-CN/docs/Mozilla/Tech/XUL/button" title="button">button</a></code>元素.</dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/method/increase/index.html b/files/zh-cn/mozilla/tech/xul/method/increase/index.html
deleted file mode 100644
index b7431b355b..0000000000
--- a/files/zh-cn/mozilla/tech/xul/method/increase/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: increase
-slug: Mozilla/Tech/XUL/Method/increase
-translation_of: Archive/Mozilla/XUL/Method/increase
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefMeth_breadcrumbs">« <a href="/en-US/docs/XUL_Reference" title="/en-US/docs/XUL_Reference">XUL Reference home</a></span></div>
-<div class="noinclude">
- <dl>
- <dd>
- 拥有该方法的元素类型: <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/scale" title="scale">scale</a></code> <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/textbox" title="textbox">textbox</a></code></dd>
- </dl>
-</div>
-<dl>
- <dt>
- <span id="m-increase"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/increase">increase()</a></code></span></dt>
- <dd>
- 返回值类型: 无返回值</dd>
- <dd>
- 增大刻度条控件(scale元素)或者数字输入框控件(type属性为number的textbox元素)中的数字值(按照其<code id="a-increment"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/increment">increment</a></code>属性指定的值).</dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/method/index.html b/files/zh-cn/mozilla/tech/xul/method/index.html
deleted file mode 100644
index e5d7d023c0..0000000000
--- a/files/zh-cn/mozilla/tech/xul/method/index.html
+++ /dev/null
@@ -1,170 +0,0 @@
----
-title: Methods
-slug: Mozilla/Tech/XUL/Method
-tags:
- - XUL Methods
-translation_of: Archive/Mozilla/XUL/Method
----
-<p><span class="breadcrumbs XULRefMeth_breadcrumbs">« <a href="/en-US/docs/XUL_Reference" title="/en-US/docs/XUL_Reference">XUL Reference home</a></span> </p>
-<ul><li> <a href="cn/XUL/Method/acceptDialog">acceptDialog</a>
-</li><li> <a href="cn/XUL/Method/addItemToSelection">addItemToSelection</a>
-</li><li> <a href="cn/XUL/Method/addPane">addPane</a>
-</li><li> <a href="cn/XUL/Method/addProgressListener">addProgressListener</a>
-</li><li> <a href="cn/XUL/Method/addSession">addSession</a>
-</li><li> <a href="cn/XUL/Method/addTab">addTab</a>
-</li><li> <a href="cn/XUL/Method/advance">advance</a>
-</li><li> <a href="cn/XUL/Method/advanceSelectedTab">advanceSelectedTab</a>
-</li><li> <a href="cn/XUL/Method/appendCustomToolbar">appendCustomToolbar</a>
-</li><li> <a href="cn/XUL/Method/appendGroup">appendGroup</a>
-</li><li> <a href="cn/XUL/Method/appendItem">appendItem</a>
-</li><li> <a href="cn/XUL/Method/appendNotification">appendNotification</a>
-</li><li> <a href="cn/XUL/Method/blur">blur</a>
-</li><li> <a href="cn/XUL/Method/cancel">cancel</a>
-</li><li> <a href="cn/XUL/Method/cancelDialog">cancelDialog</a>
-</li><li> <a href="cn/XUL/Method/centerWindowOnScreen">centerWindowOnScreen</a>
-</li><li> <a href="cn/XUL/Method/checkAdjacentElement">checkAdjacentElement</a>
-</li><li> <a href="cn/XUL/Method/clearResults">clearResults</a>
-</li><li> <a href="cn/XUL/Method/clearSelection">clearSelection</a>
-</li><li> <a href="cn/XUL/Method/click">click</a>
-</li><li> <a href="cn/XUL/Method/close">close</a>
-</li><li> <a href="cn/XUL/Method/collapseToolbar">collapseToolbar</a>
-</li><li> <a href="cn/XUL/Method/contains">contains</a>
-</li><li> <a href="cn/XUL/Method/decrease">decrease</a>
-</li><li> <a href="cn/XUL/Method/decreasePage">decreasePage</a>
-</li><li> <a href="cn/XUL/Method/doCommand">doCommand</a>
-</li><li> <a href="cn/XUL/Method/ensureElementIsVisible">ensureElementIsVisible</a>
-</li><li> <a href="cn/XUL/Method/ensureIndexIsVisible">ensureIndexIsVisible</a>
-</li><li> <a href="cn/XUL/Method/ensureSelectedElementIsVisible">ensureSelectedElementIsVisible</a>
-</li><li> <a href="cn/XUL/Method/expandToolbar">expandToolbar</a>
-</li><li> <a href="cn/XUL/Method/extra1">extra1</a>
-</li><li> <a href="cn/XUL/Method/extra2">extra2</a>
-</li><li> <a href="cn/XUL/Method/focus">focus</a>
-</li><li> <a href="cn/XUL/Method/getBrowserAtIndex">getBrowserAtIndex</a>
-</li><li> <a href="cn/XUL/Method/getBrowserForDocument">getBrowserForDocument</a>
-</li><li> <a href="cn/XUL/Method/getBrowserForTab">getBrowserForTab</a>
-</li><li> <a href="cn/XUL/Method/getBrowserIndexForDocument">getBrowserIndexForDocument</a>
-</li><li> <a href="cn/XUL/Method/getButton">getButton</a>
-</li><li> <a href="cn/XUL/Method/getDefaultSession">getDefaultSession</a>
-</li><li> <a href="cn/XUL/Method/getEditor">getEditor</a>
-</li><li> <a href="cn/XUL/Method/getElementsByAttribute">getElementsByAttribute</a>
-</li><li> <a href="cn/XUL/Method/getFormattedString">getFormattedString</a>
-</li><li> <a href="cn/XUL/Method/getHTMLEditor">getHTMLEditor</a>
-</li><li> <a href="cn/XUL/Method/getIndexOfFirstVisibleRow">getIndexOfFirstVisibleRow</a>
-</li><li> <a href="cn/XUL/Method/getIndexOfItem">getIndexOfItem</a>
-</li><li> <a href="cn/XUL/Method/getItemAtIndex">getItemAtIndex</a>
-</li><li> <a href="cn/XUL/Method/getNextItem">getNextItem</a>
-</li><li> <a href="cn/XUL/Method/getNotificationBox">getNotificationBox</a>
-</li><li> <a href="cn/XUL/Method/getNotificationWithValue">getNotificationWithValue</a>
-</li><li> <a href="cn/XUL/Method/getNumberOfVisibleRows">getNumberOfVisibleRows</a>
-</li><li> <a href="cn/XUL/Method/getPageById">getPageById</a>
-</li><li> <a href="cn/XUL/Method/getPreviousItem">getPreviousItem</a>
-</li><li> <a href="cn/XUL/Method/getResultAt">getResultAt</a>
-</li><li> <a href="cn/XUL/Method/getResultCount">getResultCount</a>
-</li><li> <a href="cn/XUL/Method/getResultValueAt">getResultValueAt</a>
-</li><li> <a href="cn/XUL/Method/getRowCount">getRowCount</a>
-</li><li> <a href="cn/XUL/Method/getSearchAt">getSearchAt</a>
-</li><li> <a href="cn/XUL/Method/getSelectedItem">getSelectedItem</a>
-</li><li> <a href="cn/XUL/Method/getSession">getSession</a>
-</li><li> <a href="cn/XUL/Method/getSessionByName">getSessionByName</a>
-</li><li> <a href="cn/XUL/Method/getSessionResultAt">getSessionResultAt</a>
-</li><li> <a href="cn/XUL/Method/getSessionStatusAt">getSessionStatusAt</a>
-</li><li> <a href="cn/XUL/Method/getSessionValueAt">getSessionValueAt</a>
-</li><li> <a href="cn/XUL/Method/getString">getString</a>
-</li><li> <a href="cn/XUL/Method/goBack">goBack</a>
-</li><li> <a href="cn/XUL/Method/goBackGroup">goBackGroup</a>
-</li><li> <a href="cn/XUL/Method/goDown">goDown</a>
-</li><li> <a href="cn/XUL/Method/goForward">goForward</a>
-</li><li> <a href="cn/XUL/Method/goForwardGroup">goForwardGroup</a>
-</li><li> <a href="cn/XUL/Method/goHome">goHome</a>
-</li><li> <a href="cn/XUL/Method/goTo">goTo</a>
-</li><li> <a href="cn/XUL/Method/gotoIndex">gotoIndex</a>
-</li><li> <a href="cn/XUL/Method/goUp">goUp</a>
-</li><li> <a href="cn/XUL/Method/hasUserValue">hasUserValue</a>
-</li><li> <a href="cn/XUL/Method/hidePopup">hidePopup</a>
-</li><li> <a href="cn/XUL/Method/increase">increase</a>
-</li><li> <a href="cn/XUL/Method/increasePage">increasePage</a>
-</li><li> <a href="cn/XUL/Method/insertItem">insertItem</a>
-</li><li> <a href="cn/XUL/Method/insertItemAt">insertItemAt</a>
-</li><li> <a href="cn/XUL/Method/invertSelection">invertSelection</a>
-</li><li> <a href="cn/XUL/Method/loadGroup">loadGroup</a>
-</li><li> <a href="cn/XUL/Method/loadOneTab">loadOneTab</a>
-</li><li> <a href="cn/XUL/Method/loadTabs">loadTabs</a>
-</li><li> <a href="cn/XUL/Method/loadURI">loadURI</a>
-</li><li> <a href="cn/XUL/Method/loadURIWithFlags">loadURIWithFlags</a>
-</li><li> <a href="cn/XUL/Method/makeEditable">makeEditable</a>
-</li><li> <a href="cn/XUL/Method/moveByOffset">moveByOffset</a>
-</li><li> <a href="cn/XUL/Method/moveTo">moveTo</a>
-</li><li> <a href="cn/XUL/Method/moveToAlertPosition">moveToAlertPosition</a>
-</li><li> <a href="cn/XUL/Method/onSearchComplete">onSearchComplete</a>
-</li><li> <a href="cn/XUL/Method/onTextEntered">onTextEntered</a>
-</li><li> <a href="cn/XUL/Method/onTextReverted">onTextReverted</a>
-</li><li> <a href="cn/XUL/Method/openPopup">openPopup</a>
-</li><li> <a href="cn/XUL/Method/openPopupAtScreen">openPopupAtScreen</a>
-</li><li> <a href="cn/XUL/Method/openSubDialog">openSubDialog</a>
-</li><li> <a href="cn/XUL/Method/openWindow">openWindow</a>
-</li><li> <a href="cn/XUL/Method/preferenceForElement">preferenceForElement</a>
-</li><li> <a href="cn/XUL/Method/reload">reload</a>
-</li><li> <a href="cn/XUL/Method/reloadAllTabs">reloadAllTabs</a>
-</li><li> <a href="cn/XUL/Method/reloadTab">reloadTab</a>
-</li><li> <a href="cn/XUL/Method/reloadWithFlags">reloadWithFlags</a>
-</li><li> <a href="cn/XUL/Method/removeAllItems">removeAllItems</a>
-</li><li> <a href="cn/XUL/Method/removeAllNotifications">removeAllNotifications</a>
-</li><li> <a href="cn/XUL/Method/removeAllTabsBut">removeAllTabsBut</a>
-</li><li> <a href="cn/XUL/Method/removeCurrentNotification">removeCurrentNotification</a>
-</li><li> <a href="cn/XUL/Method/removeCurrentTab">removeCurrentTab</a>
-</li><li> <a href="cn/XUL/Method/removeItemAt">removeItemAt</a>
-</li><li> <a href="cn/XUL/Method/removeItemFromSelection">removeItemFromSelection</a>
-</li><li> <a href="cn/XUL/Method/removeNotification">removeNotification</a>
-</li><li> <a href="cn/XUL/Method/removeProgressListener">removeProgressListener</a>
-</li><li> <a href="cn/XUL/Method/removeSession">removeSession</a>
-</li><li> <a href="cn/XUL/Method/removeTab">removeTab</a>
-</li><li> <a href="cn/XUL/Method/removeTransientNotifications">removeTransientNotifications</a>
-</li><li> <a href="cn/XUL/Method/replaceGroup">replaceGroup</a>
-</li><li> <a href="cn/XUL/Method/reset">reset</a>
-</li><li> <a href="cn/XUL/Method/rewind">rewind</a>
-</li><li> <a href="cn/XUL/Method/scrollByIndex">scrollByIndex</a>
-</li><li> <a href="cn/XUL/Method/scrollByPixels">scrollByPixels</a>
-</li><li> <a href="cn/XUL/Method/scrollToIndex">scrollToIndex</a>
-</li><li> <a href="cn/XUL/Method/select">select</a>
-</li><li> <a href="cn/XUL/Method/selectAll">selectAll</a>
-</li><li> <a href="cn/XUL/Method/selectItem">selectItem</a>
-</li><li> <a href="cn/XUL/Method/selectItemRange">selectItemRange</a>
-</li><li> <a href="cn/XUL/Method/setSelectionRange">setSelectionRange</a>
-</li><li> <a href="cn/XUL/Method/showPane">showPane</a>
-</li><li> <a href="cn/XUL/Method/showPopup">showPopup</a>
-</li><li> <a href="cn/XUL/Method/sizeTo">sizeTo</a>
-</li><li> <a href="cn/XUL/Method/startEditing">startEditing</a>
-</li><li> <a href="cn/XUL/Method/stop">stop</a>
-</li><li> <a href="cn/XUL/Method/stopEditing">stopEditing</a>
-</li><li> <a href="cn/XUL/Method/syncSessions">syncSessions</a>
-</li><li> <a href="cn/XUL/Method/timedSelect">timedSelect</a>
-</li><li> <a href="cn/XUL/Method/toggleItemSelection">toggleItemSelection</a>
-</li></ul>
-<h3 id="Related_DOM_element_methods" name="Related_DOM_element_methods"> Related DOM element methods </h3>
-<ul><li> <a href="cn/DOM/element.addEventListener">DOM:element.addEventListener</a>
-</li><li> <a href="cn/DOM/element.appendChild">DOM:element.appendChild</a>
-</li><li> <a href="cn/DOM/element.dispatchEvent">DOM:element.dispatchEvent</a>
-</li><li> <a href="cn/DOM/element.getAttribute">DOM:element.getAttribute</a>
-</li><li> <a href="cn/DOM/element.getAttributeNode">DOM:element.getAttributeNode</a>
-</li><li> <a href="cn/DOM/element.getAttributeNodeNS">DOM:element.getAttributeNodeNS</a>
-</li><li> <a href="cn/DOM/element.getAttributeNS">DOM:element.getAttributeNS</a>
-</li><li> <a href="cn/DOM/element.getElementsByTagName">DOM:element.getElementsByTagName</a>
-</li><li> <a href="cn/DOM/element.getElementsByTagNameNS">DOM:element.getElementsByTagNameNS</a>
-</li><li> <a href="cn/DOM/element.hasAttribute">DOM:element.hasAttribute</a>
-</li><li> <a href="cn/DOM/element.hasAttributeNS">DOM:element.hasAttributeNS</a>
-</li><li> <a href="cn/DOM/element.hasAttributes">DOM:element.hasAttributes</a>
-</li><li> <a href="cn/DOM/element.hasChildNodes">DOM:element.hasChildNodes</a>
-</li><li> <a href="cn/DOM/element.insertBefore">DOM:element.insertBefore</a>
-</li><li> <a href="cn/DOM/element.isSupported">DOM:element.isSupported</a>
-</li><li> <a href="cn/DOM/element.normalize">DOM:element.normalize</a>
-</li><li> <a href="cn/DOM/element.removeAttribute">DOM:element.removeAttribute</a>
-</li><li> <a href="cn/DOM/element.removeAttributeNode">DOM:element.removeAttributeNode</a>
-</li><li> <a href="cn/DOM/element.removeAttributeNS">DOM:element.removeAttributeNS</a>
-</li><li> <a href="cn/DOM/element.removeChild">DOM:element.removeChild</a>
-</li><li> <a href="cn/DOM/element.removeEventListener">DOM:element.removeEventListener</a>
-</li><li> <a href="cn/DOM/element.replaceChild">DOM:element.replaceChild</a>
-</li><li> <a href="cn/DOM/element.setAttribute">DOM:element.setAttribute</a>
-</li><li> <a href="cn/DOM/element.setAttributeNode">DOM:element.setAttributeNode</a>
-</li><li> <a href="cn/DOM/element.setAttributeNodeNS">DOM:element.setAttributeNodeNS</a>
-</li><li> <a href="cn/DOM/element.setAttributeNS">DOM:element.setAttributeNS</a>
-</li></ul>
diff --git a/files/zh-cn/mozilla/tech/xul/method/reset/index.html b/files/zh-cn/mozilla/tech/xul/method/reset/index.html
deleted file mode 100644
index 258f4d53df..0000000000
--- a/files/zh-cn/mozilla/tech/xul/method/reset/index.html
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: reset
-slug: Mozilla/Tech/XUL/Method/reset
-translation_of: Archive/Mozilla/XUL/Method/reset
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefMeth_breadcrumbs">« <a href="/en-US/docs/XUL_Reference" title="/en-US/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <span id="m-reset"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/reset">reset()</a></code></span></dt>
- <dd>
- 返回值:无返回值</dd>
- <dd>
- 将用户偏好重置为默认值.</dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/method/stop/index.html b/files/zh-cn/mozilla/tech/xul/method/stop/index.html
deleted file mode 100644
index 181a6123ae..0000000000
--- a/files/zh-cn/mozilla/tech/xul/method/stop/index.html
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: stop
-slug: Mozilla/Tech/XUL/Method/stop
-translation_of: Archive/Mozilla/XUL/Method/stop
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefMeth_breadcrumbs">« <a href="/en-US/docs/XUL_Reference" title="/en-US/docs/XUL_Reference">XUL Reference home</a></span></div>
-<dl>
- <dt>
- <span id="m-stop"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/stop">stop()</a></code></span></dt>
- <dd>
- 返回值: 无返回值</dd>
- <dd>
- 效果等同于按下了停止按钮,停止当前页面中文档的加载.</dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/namespaces/index.html b/files/zh-cn/mozilla/tech/xul/namespaces/index.html
deleted file mode 100644
index 73a5099ae6..0000000000
--- a/files/zh-cn/mozilla/tech/xul/namespaces/index.html
+++ /dev/null
@@ -1,73 +0,0 @@
----
-title: Namespaces
-slug: Mozilla/Tech/XUL/Namespaces
-translation_of: Archive/Mozilla/XUL/Namespaces
----
-<p> </p>
-
-<p>除此文档外,请参阅<a href="/en/SVG/Namespaces_Crash_Course" title="en/SVG/Namespaces_Crash_Course">Namespaces Crash Course</a>。</p>
-
-<p><strong>XML namespaces</strong> 提供了区分重复元素和属性名称的方法。当XML文档包含来自两个或多个不同的XML模式 (或者DTD)的元素和属性时,可能会出现重复元素和属性名称。引用 <a class="external" href="http://en.wikipedia.org/wiki/Namespace">Wikipedia</a>: "一般来说,namespaces是一个抽象的容器,为项目提供上下文... 它拥有并且允许消除具有相同名称的项目的消歧。"</p>
-
-<p>如果你熟悉C++命名空间、Java包、Perl包或者Python模块导入,那么你已经熟悉了namespaces概念。</p>
-
-<p>XML namespace 由唯一的名称 (称为URI, 而不是URL, 即使它看起来像URL)标识。URI 可以是任何字符串,虽然大多数人选择基于URL的URI,因为URL是实现我们期望的唯一性的一种简单的方法。虽然没有任何理由去阻止其他人使用这个namespaces <code>http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul</code>, 但是不太可能有人会不小心选择这个namespaces。即使他们意外的选择了这个namespaces,他们也不可能在他们的模式/DTD中定义与XUL相同的元素 。</p>
-
-<p>XML namespace中的任何元素类型或者属性名称都可以通过其XML  namespace和其“local name”来唯一标识。 这两个项目一起定义了一个限定名称,或者 <a class="external" href="http://www.w3.org/TR/REC-xml-names/#dt-qualname">QName</a>.</p>
-
-<p>例如: <code>&lt;xul:textbox/&gt;</code> 使用名为"xul"的namespace和本地名称 "textbox"。它不同于例子所示,例如: <code>&lt;foobar:textbox/&gt;</code> 可能出现在同一个文档中。<strong>xul</strong>和<strong>foobar</strong> namespaces必须定义在它们所使用的XML文档的顶部, 如下:</p>
-
-<pre> &lt;foobar:some-element
- xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- xmlns:foobar="the-foobar-namespace"&gt;
- &lt;xul:textbox id="foo" value="bar"/&gt;
- &lt;foobar:textbox favorite-food="pancakes"/&gt;
- &lt;/foobar:some-element&gt;
-</pre>
-
-<p>注意我已经在同一个文档中混合了两个<code>&lt;textboxes/&gt;</code> 。区分他们的唯一的方法是他们有不同含义的namespaces.</p>
-
-<p>还有一个事情需要了解:“default namespace(默认namespace)”。每个XML元素有一个 "default namespace", 而且它总是和XUL 元素一起使用。在XUL 文档中,您通常会看到:</p>
-
-<pre> &lt;window
- id="foo"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;
- ...
- ...
- &lt;/window&gt;
-</pre>
-
-<p>在XHTML 文档中,您会看到:</p>
-
-<pre> &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
- ...
- ...
- &lt;/html&gt;
-</pre>
-
-<p>与之前相比,这里有一个非常微妙的差别。 我之前写过<code>xmlns<strong>:xul</strong>="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"</code> ,但是这儿的:<strong>xul</strong> 部分被省略。这意味着对XML解析器来说,<code>http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul</code> 是元素及其后代元素的 <strong>default namespace</strong> (除非在后代元素上被default namespace覆盖),并且,如果没有namespace 的任何元素(即,没有前缀和colon)属于default namespace。这就是为什么我们可以使用简写<code>&lt;textbox/&gt;</code>来代替XUL中的 <code>&lt;xul:textbox/&gt;</code> (即使后者在没有使用<code>http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul</code> 作为default namespace是正确的) -- XUL namespace被定义为最顶层元素的默认值。换句话说,default namespace允许一种简短的概括被用于一个元素的所有后代元素。</p>
-
-<p>这里有一个问题:在下面的XML文档中,什么namespace包含了foo元素?</p>
-
-<pre> &lt;foo/&gt;
-</pre>
-
-<p>答案是它不在namespace, 或者它在namespace中由空字符串表示:</p>
-
-<pre> &lt;foo xmlns=""/&gt;
-</pre>
-
-<p>第二个例子在语义上等同于第一个例子。</p>
-
-<p>那么第二个问题是:  <code>bar</code>、 <code>baz</code> 和 <code>quux</code> 是什么名称空间中的属性?</p>
-
-<p> </p>
-
-<pre> &lt;foo bar="value"&gt;
- &lt;element xmlns="namespace!" baz="value"&gt;
- &lt;element quux="value"/&gt;
- &lt;/element&gt;
- &lt;/foo&gt;
-</pre>
-
-<p><code>bar</code> 显然不在namespace中。那么 <code>baz<font face="Open Sans, arial, x-locale-body, sans-serif"><span style="background-color: #ffffff;">和</span></font></code><code>quux</code>怎么样呢?答案是他们也不在namespace中。实际上,在namespace中没有任何前缀不确定的属性,主要是因为XML最初没有namespaces,而且从那时起,所有的XML必须保持在无namespace.这是XML namespaces常年混乱的根源。</p>
diff --git a/files/zh-cn/mozilla/tech/xul/popup/index.html b/files/zh-cn/mozilla/tech/xul/popup/index.html
deleted file mode 100644
index 05ce34c3bc..0000000000
--- a/files/zh-cn/mozilla/tech/xul/popup/index.html
+++ /dev/null
@@ -1,23 +0,0 @@
----
-title: popup
-slug: Mozilla/Tech/XUL/popup
-tags:
- - XUL Elements
- - XUL Reference
-translation_of: Archive/Mozilla/XUL/popup
----
-<div class="noinclude">
- <span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-<p>The popup element is equivalent to the <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code> element which should be used instead. See the documentation on the <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code> element for more information.</p>
-<p>popup元素和<code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code>元素在功能上是等价的,具体用法可以参考<code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code>的说明文档。</p>
-<p> </p>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/property/accessibletype/index.html b/files/zh-cn/mozilla/tech/xul/property/accessibletype/index.html
deleted file mode 100644
index ae445e8bdb..0000000000
--- a/files/zh-cn/mozilla/tech/xul/property/accessibletype/index.html
+++ /dev/null
@@ -1,183 +0,0 @@
----
-title: accessibleType
-slug: Mozilla/Tech/XUL/Property/accessibleType
-translation_of: Archive/Mozilla/XUL/Property/accessibleType
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span></div>
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessibleType">accessibleType</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- A value indicating the type of accessibility object for the element.</dd>
-</dl>
-<div class="noinclude">
- <p>Possible values are:</p>
- <table>
- <tbody>
- <tr>
- <th>Constant</th>
- <th>Value</th>
- </tr>
- <tr>
- <td>XULAlert</td>
- <td>1001</td>
- </tr>
- <tr>
- <td>XULButton</td>
- <td>1002</td>
- </tr>
- <tr>
- <td>XULCheckbox</td>
- <td>1003</td>
- </tr>
- <tr>
- <td>XULColorPicker</td>
- <td>1004</td>
- </tr>
- <tr>
- <td>XULColorPickerTile</td>
- <td>1005</td>
- </tr>
- <tr>
- <td>XULCombobox</td>
- <td>1006</td>
- </tr>
- <tr>
- <td>XULDropmarker</td>
- <td>1007</td>
- </tr>
- <tr>
- <td>XULGroupbox</td>
- <td>1008</td>
- </tr>
- <tr>
- <td>XULImage</td>
- <td>1009</td>
- </tr>
- <tr>
- <td>XULLink</td>
- <td>100A</td>
- </tr>
- <tr>
- <td>XULListbox</td>
- <td>100B</td>
- </tr>
- <tr>
- <td>XULListCell</td>
- <td>1026</td>
- </tr>
- <tr>
- <td>XULListHead</td>
- <td>1024</td>
- </tr>
- <tr>
- <td>XULListHeader</td>
- <td>1025</td>
- </tr>
- <tr>
- <td>XULListitem</td>
- <td>100C</td>
- </tr>
- <tr>
- <td>XULMenubar</td>
- <td>100D</td>
- </tr>
- <tr>
- <td>XULMenuitem</td>
- <td>100E</td>
- </tr>
- <tr>
- <td>XULMenupopup</td>
- <td>100F</td>
- </tr>
- <tr>
- <td>XULMenuSeparator</td>
- <td>1010</td>
- </tr>
- <tr>
- <td>XULPane</td>
- <td>1011</td>
- </tr>
- <tr>
- <td>XULProgressMeter</td>
- <td>1012</td>
- </tr>
- <tr>
- <td>XULScale</td>
- <td>1013</td>
- </tr>
- <tr>
- <td>XULStatusBar</td>
- <td>1014</td>
- </tr>
- <tr>
- <td>XULRadioButton</td>
- <td>1015</td>
- </tr>
- <tr>
- <td>XULRadioGroup</td>
- <td>1016</td>
- </tr>
- <tr>
- <td>XULTab</td>
- <td>1017</td>
- </tr>
- <tr>
- <td>XULTabBox</td>
- <td>1018</td>
- </tr>
- <tr>
- <td>XULTabs</td>
- <td>1019</td>
- </tr>
- <tr>
- <td>XULText</td>
- <td>101A</td>
- </tr>
- <tr>
- <td>XULTextBox</td>
- <td>101B</td>
- </tr>
- <tr>
- <td>XULThumb</td>
- <td>101C</td>
- </tr>
- <tr>
- <td>XULTree</td>
- <td>101D</td>
- </tr>
- <tr>
- <td>XULTreeColumns</td>
- <td>101E</td>
- </tr>
- <tr>
- <td>XULTreeColumnItem</td>
- <td>101F</td>
- </tr>
- <tr>
- <td>XULToolbar</td>
- <td>1020</td>
- </tr>
- <tr>
- <td>XULToolbarSeparator</td>
- <td>1021</td>
- </tr>
- <tr>
- <td>XULTooltip</td>
- <td>1022</td>
- </tr>
- <tr>
- <td>XULToolbarButton</td>
- <td>1023</td>
- </tr>
- </tbody>
- </table>
- <p>&lt;/div&gt;</p>
-</div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/property/accesskey/index.html b/files/zh-cn/mozilla/tech/xul/property/accesskey/index.html
deleted file mode 100644
index 7b49328080..0000000000
--- a/files/zh-cn/mozilla/tech/xul/property/accesskey/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: accessKey
-slug: Mozilla/Tech/XUL/Property/accessKey
-translation_of: Archive/Mozilla/XUL/Property/accessKey
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span></div>
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessKey">accessKey</a></span></code></dt>
- <dd>
- Type:
- <i>
- character</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-accesskey"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/accesskey">accesskey</a></code> attribute.</dd>
-</dl>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/property/browser.preferences/index.html b/files/zh-cn/mozilla/tech/xul/property/browser.preferences/index.html
deleted file mode 100644
index 7a0bd25201..0000000000
--- a/files/zh-cn/mozilla/tech/xul/property/browser.preferences/index.html
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: browser.preferences
-slug: Mozilla/Tech/XUL/Property/browser.preferences
-translation_of: Archive/Mozilla/XUL/Property/browser.preferences
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span></div>
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/browser.preferences">preferences</a></span></code></dt>
- <dd>
- 类型: <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIPrefService" title="">nsIPrefService</a></code></dd>
- <dd>
- 这是一个只读属性,其值为一个<code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIPref" title="">nsIPref</a></code>对象,可以用来读取或设置用户的首选项.</dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/property/buttons/index.html b/files/zh-cn/mozilla/tech/xul/property/buttons/index.html
deleted file mode 100644
index 67304e8fa1..0000000000
--- a/files/zh-cn/mozilla/tech/xul/property/buttons/index.html
+++ /dev/null
@@ -1,10 +0,0 @@
----
-title: buttons
-slug: Mozilla/Tech/XUL/Property/buttons
-translation_of: Archive/Mozilla/XUL/Property/buttons
----
-<div class="noinclude"><span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span></div>
-<dl> <dt><code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/buttons">buttons</a></span></code></dt> <dd>类型: 列表,下面的值用逗号分隔</dd> <dd>需要显示在对话框上的按钮的一个列表,使用逗号分隔。将按钮放置在合适的位置,将根据用户平台自动执行基本的事件处理。在列表中可以使用以下值: <ul> <li><code>accept</code>:“确定”按钮,按下按钮时将接受更改。此按钮为默认按钮。</li> <li><code>cancel</code>:“取消”按钮,将取消操作。</li> <li><code>help</code>:“帮助”按钮,在对话框显示一个“帮助”按钮。</li> <li><code>disclosure</code>:“更多信息”按钮,显示一个“more info”按钮。该按钮可能是一个按钮或一个三角形。</li> <li><code>extra1</code>:一个可选的额外的按钮。你可以通过<code><code id="a-buttonlabelextra1"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/buttonlabelextra1">buttonlabelextra1</a></code></code> 属性设置它的label。</li> <li><code>extra2</code>:第二个可选的额外的按钮。你可以通过 <code><code id="a-buttonlabelextra2"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/buttonlabelextra2">buttonlabelextra2</a></code></code> 属性设置它的label。</li> </ul> </dd>
-</dl>
-<div class="noinclude"> <p></p><div class="blockIndicator note"><strong>Note:</strong> If you don't want to display any buttons in the dialog box, set the value of this attribute to "," (a single comma).</div><p></p> <p></p>
-</div>
diff --git a/files/zh-cn/mozilla/tech/xul/property/command/index.html b/files/zh-cn/mozilla/tech/xul/property/command/index.html
deleted file mode 100644
index 10993a17e6..0000000000
--- a/files/zh-cn/mozilla/tech/xul/property/command/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: command
-slug: Mozilla/Tech/XUL/Property/command
-translation_of: Archive/Mozilla/XUL/Property/command
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span></div>
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/command">command</a></span></code></dt>
- <dd>
- Type:
- <i>
- element id</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-command"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/command">command</a></code> attribute.</dd>
-</dl>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/property/crop/index.html b/files/zh-cn/mozilla/tech/xul/property/crop/index.html
deleted file mode 100644
index 54a99a746b..0000000000
--- a/files/zh-cn/mozilla/tech/xul/property/crop/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: crop
-slug: Mozilla/Tech/XUL/Property/crop
-translation_of: Archive/Mozilla/XUL/Property/crop
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span></div>
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/crop">crop</a></span></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-crop"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/crop">crop</a></code> attribute.</dd>
-</dl>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/property/defaultvalue/index.html b/files/zh-cn/mozilla/tech/xul/property/defaultvalue/index.html
deleted file mode 100644
index 7aca9067cb..0000000000
--- a/files/zh-cn/mozilla/tech/xul/property/defaultvalue/index.html
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: defaultValue
-slug: Mozilla/Tech/XUL/Property/defaultValue
-translation_of: Archive/Mozilla/XUL/Property/defaultValue
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span></div>
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/defaultValue">defaultValue</a></span></code> </dt>
- <dd>
- 类型: 字符串</dd>
- <dd>
- 获取或设置一个<code>textbox</code>元素中显示的默认值.</dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/property/disabled/index.html b/files/zh-cn/mozilla/tech/xul/property/disabled/index.html
deleted file mode 100644
index 500640dc2a..0000000000
--- a/files/zh-cn/mozilla/tech/xul/property/disabled/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: disabled
-slug: Mozilla/Tech/XUL/Property/disabled
-translation_of: Archive/Mozilla/XUL/Property/disabled
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span></div>
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/disabled">disabled</a></span></code></dt>
- <dd>
- Type:
- <i>
- boolean</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code> attribute.</dd>
-</dl>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/property/image/index.html b/files/zh-cn/mozilla/tech/xul/property/image/index.html
deleted file mode 100644
index 5079e489cd..0000000000
--- a/files/zh-cn/mozilla/tech/xul/property/image/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: image
-slug: Mozilla/Tech/XUL/Property/image
-translation_of: Archive/Mozilla/XUL/Property/image
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span></div>
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/image">image</a></span></code></dt>
- <dd>
- Type:
- <i>
- image URL</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-image"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/image">image</a></code> attribute.</dd>
-</dl>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/property/index.html b/files/zh-cn/mozilla/tech/xul/property/index.html
deleted file mode 100644
index caec3163d8..0000000000
--- a/files/zh-cn/mozilla/tech/xul/property/index.html
+++ /dev/null
@@ -1,266 +0,0 @@
----
-title: Property
-slug: Mozilla/Tech/XUL/Property
-tags:
- - XUL Properties
-translation_of: Archive/Mozilla/XUL/Property
----
-<p><span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span>
-</p>
-<ul><li> <a href="cn/XUL/Property/accessible">accessible</a>
-</li><li> <a href="cn/XUL/Property/accessKey">accessKey</a>
-</li><li> <a href="cn/XUL/Property/align">align</a>
-</li><li> <a href="cn/XUL/Property/allNotifications">allNotifications</a>
-</li><li> <a href="cn/XUL/Property/allowEvents">allowEvents</a>
-</li><li> <a href="cn/XUL/Property/alwaysOpenPopup">alwaysOpenPopup</a>
-</li><li> <a href="cn/XUL/Property/amIndicator">amIndicator</a>
-</li><li> <a href="cn/XUL/Property/appLocale">appLocale</a>
-</li><li> <a href="cn/XUL/Property/autoCheck">autoCheck</a>
-</li><li> <a href="cn/XUL/Property/autoFill">autoFill</a>
-</li><li> <a href="cn/XUL/Property/autoFillAfterMatch">autoFillAfterMatch</a>
-</li><li> <a href="cn/XUL/Property/boxObject">boxObject</a>
-</li><li> <a href="cn/XUL/Property/browsers">browsers</a>
-</li><li> <a href="cn/XUL/Property/builder">builder</a>
-</li><li> <a href="cn/XUL/Property/builderView">builderView</a>
-</li><li> <a href="cn/XUL/Property/buttons">buttons</a>
-</li><li> <a href="cn/XUL/Property/canAdvance">canAdvance</a>
-</li><li> <a href="cn/XUL/Property/canGoBack">canGoBack</a>
-</li><li> <a href="cn/XUL/Property/canGoForward">canGoForward</a>
-</li><li> <a href="cn/XUL/Property/canRewind">canRewind</a>
-</li><li> <a href="cn/XUL/Property/checked">checked</a>
-</li><li> <a href="cn/XUL/Property/checkState">checkState</a>
-</li><li> <a href="cn/XUL/Property/child">child</a>
-</li><li> <a href="cn/XUL/Property/children">children</a>
-</li><li> <a href="cn/XUL/Property/className">className</a>
-</li><li> <a href="cn/XUL/Property/clickSelectsAll">clickSelectsAll</a>
-</li><li> <a href="cn/XUL/Property/collapsed">collapsed</a>
-</li><li> <a href="cn/XUL/Property/color">color</a>
-</li><li> <a href="cn/XUL/Property/columns">columns</a>
-</li><li> <a href="cn/XUL/Property/command">command</a>
-</li><li> <a href="cn/XUL/Property/commandManager">commandManager</a>
-</li><li> <a href="cn/XUL/Property/completeDefaultIndex">completeDefaultIndex</a>
-</li><li> <a href="cn/XUL/Property/container">container</a>
-</li><li> <a href="cn/XUL/Property/contentDocument">contentDocument</a>
-</li><li> <a href="cn/XUL/Property/contentPrincipal">contentPrincipal</a>
-</li><li> <a href="cn/XUL/Property/contentTitle">contentTitle</a>
-</li><li> <a href="cn/XUL/Property/contentView">contentView</a>
-</li><li> <a href="cn/XUL/Property/contentViewerEdit">contentViewerEdit</a>
-</li><li> <a href="cn/XUL/Property/contentViewerFile">contentViewerFile</a>
-</li><li> <a href="cn/XUL/Property/contentWindow">contentWindow</a>
-</li><li> <a href="cn/XUL/Property/contextMenu">contextMenu</a>
-</li><li> <a href="cn/XUL/Property/control">control</a>
-</li><li> <a href="cn/XUL/Property/controller">controller</a>
-</li><li> <a href="cn/XUL/Property/controllers">controllers</a>
-</li><li> <a href="cn/XUL/Property/crop">crop</a>
-</li><li> <a href="cn/XUL/Property/current">current</a>
-</li><li> <a href="cn/XUL/Property/currentIndex">currentIndex</a>
-</li><li> <a href="cn/XUL/Property/currentItem">currentItem</a>
-</li><li> <a href="cn/XUL/Property/currentPage">currentPage</a>
-</li><li> <a href="cn/XUL/Property/currentPane">currentPane</a>
-</li><li> <a href="cn/XUL/Property/currentSet">currentSet</a>
-</li><li> <a href="cn/XUL/Property/currentURI">currentURI</a>
-</li><li> <a href="cn/XUL/Property/customToolbarCount">customToolbarCount</a>
-</li><li> <a href="cn/XUL/Property/database">database</a>
-</li><li> <a href="cn/XUL/Property/datasources">datasources</a>
-</li><li> <a href="cn/XUL/Property/date">date</a>
-</li><li> <a href="cn/XUL/Property/dateLeadingZero">dateLeadingZero</a>
-</li><li> <a href="cn/XUL/Property/dateValue">dateValue</a>
-</li><li> <a href="cn/XUL/Property/decimalPlaces">decimalPlaces</a>
-</li><li> <a href="cn/XUL/Property/decimalSymbol">decimalSymbol</a>
-</li><li> <a href="cn/XUL/Property/defaultButton">defaultButton</a>
-</li><li> <a href="cn/XUL/Property/description">description</a>
-</li><li> <a href="cn/XUL/Property/dir">dir</a>
-</li><li> <a href="cn/XUL/Property/disableAutocomplete">disableAutocomplete</a>
-</li><li> <a href="cn/XUL/Property/disableAutoComplete">disableAutoComplete</a>
-</li><li> <a href="cn/XUL/Property/disableKeyNavigation">disableKeyNavigation</a>
-</li><li> <a href="cn/XUL/Property/disableautoselect">disableautoselect</a>
-</li><li> <a href="cn/XUL/Property/disabled">disabled</a>
-</li><li> <a href="cn/XUL/Property/disableKeyNavigation">disableKeyNavigation</a>
-</li><li> <a href="cn/XUL/Property/dlgType">dlgType</a>
-</li><li> <a href="cn/XUL/Property/docShell">docShell</a>
-</li><li> <a href="cn/XUL/Property/documentCharsetInfo">documentCharsetInfo</a>
-</li><li> <a href="cn/XUL/Property/editable">editable</a>
-</li><li> <a href="cn/XUL/Property/editingColumn">editingColumn</a>
-</li><li> <a href="cn/XUL/Property/editingRow">editingRow</a>
-</li><li> <a href="cn/XUL/Property/editingSession">editingSession</a>
-</li><li> <a href="cn/XUL/Property/editor">editor</a>
-</li><li> <a href="cn/XUL/Property/editortype">editortype</a>
-</li><li> <a href="cn/XUL/Property/emptyText">emptyText</a>
-</li><li> <a href="cn/XUL/Property/enableColumnDrag">enableColumnDrag</a>
-</li><li> <a href="cn/XUL/Property/eventNode">eventNode</a>
-</li><li> <a href="cn/XUL/Property/firstOrdinalColumn">firstOrdinalColumn</a>
-</li><li> <a href="cn/XUL/Property/firstPermanentChild">firstPermanentChild</a>
-</li><li> <a href="cn/XUL/Property/flex">flex</a>
-</li><li> <a href="cn/XUL/Property/focused">focused</a>
-</li><li> <a href="cn/XUL/Property/focusedItem">focusedItem</a>
-</li><li> <a href="cn/XUL/Property/forceComplete">forceComplete</a>
-</li><li> <a href="cn/XUL/Property/group">group</a>
-</li><li> <a href="cn/XUL/Property/handleCtrlPageUpDown">handleCtrlPageUpDown</a>
-</li><li> <a href="cn/XUL/Property/handleCtrlTab">handleCtrlTab</a>
-</li><li> <a href="cn/XUL/Property/height">height</a>
-</li><li> <a href="cn/XUL/Property/hidden">hidden</a>
-</li><li> <a href="cn/XUL/Property/hideSeconds">hideSeconds</a>
-</li><li> <a href="cn/XUL/Property/homePage">homePage</a>
-</li><li> <a href="cn/XUL/Property/hour">hour</a>
-</li><li> <a href="cn/XUL/Property/hourLeadingZero">hourLeadingZero</a>
-</li><li> <a href="cn/XUL/Property/id">id</a>
-</li><li> <a href="cn/XUL/Property/ignoreBlurWhileSearching">ignoreBlurWhileSearching</a>
-</li><li> <a href="cn/XUL/Property/image">image</a>
-</li><li> <a href="cn/XUL/Property/increment">increment</a>
-</li><li> <a href="cn/XUL/Property/inputField">inputField</a>
-</li><li> <a href="cn/XUL/Property/inverted">inverted</a>
-</li><li> <a href="cn/XUL/Property/is24HourClock">is24HourClock</a>
-</li><li> <a href="cn/XUL/Property/isPM">isPM</a>
-</li><li> <a href="cn/XUL/Property/isSearching">isSearching</a>
-</li><li> <a href="cn/XUL/Property/isWaiting">isWaiting</a>
-</li><li> <a href="cn/XUL/Property/itemCount">itemCount</a>
-</li><li> <a href="cn/XUL/Property/label">label</a>
-</li><li> <a href="cn/XUL/Property/labelElement">labelElement</a>
-</li><li> <a href="cn/XUL/Property/lastPermanentChild">lastPermanentChild</a>
-</li><li> <a href="cn/XUL/Property/lastSelected">lastSelected</a>
-</li><li> <a href="cn/XUL/Property/left">left</a>
-</li><li> <a href="cn/XUL/Property/linkedPanel">linkedPanel</a>
-</li><li> <a href="cn/XUL/Property/listBoxObject">listBoxObject</a>
-</li><li> <a href="cn/XUL/Property/locked">locked</a>
-</li><li> <a href="cn/XUL/Property/markupDocumentViewer">markupDocumentViewer</a>
-</li><li> <a href="cn/XUL/Property/max">max</a>
-</li><li> <a href="cn/XUL/Property/maxHeight">maxHeight</a>
-</li><li> <a href="cn/XUL/Property/maxLength">maxLength</a>
-</li><li> <a href="cn/XUL/Property/maxRows">maxRows</a>
-</li><li> <a href="cn/XUL/Property/maxWidth">maxWidth</a>
-</li><li> <a href="cn/XUL/Property/menu">menu</a>
-</li><li> <a href="cn/XUL/Property/menuBoxObject">menuBoxObject</a>
-</li><li> <a href="cn/XUL/Property/menupopup">menupopup</a>
-</li><li> <a href="cn/XUL/Property/min">min</a>
-</li><li> <a href="cn/XUL/Property/minHeight">minHeight</a>
-</li><li> <a href="cn/XUL/Property/minResultsForPopup">minResultsForPopup</a>
-</li><li> <a href="cn/XUL/Property/minWidth">minWidth</a>
-</li><li> <a href="cn/XUL/Property/minute">minute</a>
-</li><li> <a href="cn/XUL/Property/minuteLeadingZero">minuteLeadingZero</a>
-</li><li> <a href="cn/XUL/Property/mode">mode</a>
-</li><li> <a href="cn/XUL/Property/month">month</a>
-</li><li> <a href="cn/XUL/Property/monthLeadingZero">monthLeadingZero</a>
-</li><li> <a href="cn/XUL/Property/name">name</a>
-</li><li> <a href="cn/XUL/Property/next">next</a>
-</li><li> <a href="cn/XUL/Property/noMatch">noMatch</a>
-</li><li> <a href="cn/XUL/Property/notificationsHidden">notificationsHidden</a>
-</li><li> <a href="cn/XUL/Property/object">object</a>
-</li><li> <a href="cn/XUL/Property/observes">observes</a>
-</li><li> <a href="cn/XUL/Property/onFirstPage">onFirstPage</a>
-</li><li> <a href="cn/XUL/Property/onLastPage">onLastPage</a>
-</li><li> <a href="cn/XUL/Property/open">open</a>
-</li><li> <a href="cn/XUL/Property/ordinal">ordinal</a>
-</li><li> <a href="cn/XUL/Property/orient">orient</a>
-</li><li> <a href="cn/XUL/Property/pack">pack</a>
-</li><li> <a href="cn/XUL/Property/pageCount">pageCount</a>
-</li><li> <a href="cn/XUL/Property/pageid">pageid</a>
-</li><li> <a href="cn/XUL/Property/pageIncrement">pageIncrement</a>
-</li><li> <a href="cn/XUL/Property/pageIndex">pageIndex</a>
-</li><li> <a href="cn/XUL/Property/pageStep">pageStep</a>
-</li><li> <a href="cn/XUL/Property/parentContainer">parentContainer</a>
-</li><li> <a href="cn/XUL/Property/palette">palette</a>
-</li><li> <a href="cn/XUL/Property/persist">persist</a>
-</li><li> <a href="cn/XUL/Property/persistence">persistence</a>
-</li><li> <a href="cn/XUL/Property/popup">popup</a>
-</li><li> <a href="cn/XUL/Property/popupBoxObject">popupBoxObject</a>
-</li><li> <a href="cn/XUL/Property/popupOpen">popupOpen</a>
-</li><li> <a href="cn/XUL/Property/position">position</a>
-</li><li> <a href="cn/XUL/Property/predicate">predicate</a>
-</li><li> <a href="cn/XUL/Property/preferenceElements">preferenceElements</a>
-</li><li> <a href="cn/XUL/Property/preferencePanes">preferencePanes</a>
-</li><li> <a href="cn/XUL/Property/preferences">preferences</a>
-</li><li> <a href="cn/XUL/Property/priority">priority</a>
-</li><li> <a href="cn/XUL/Property/radioGroup">radioGroup</a>
-</li><li> <a href="cn/XUL/Property/readonly">readonly</a>
-</li><li> <a href="cn/XUL/Property/readonly">readOnly</a>
-</li><li> <a href="cn/XUL/Property/ref">ref</a>
-</li><li> <a href="cn/XUL/Property/resource">resource</a>
-</li><li> <a href="cn/XUL/Property/resultsPopup">resultsPopup</a>
-</li><li> <a href="cn/XUL/Property/scrollBoxObject">scrollBoxObject</a>
-</li><li> <a href="cn/XUL/Property/scrollIncrement">scrollIncrement</a>
-</li><li> <a href="cn/XUL/Property/searchCount">searchCount</a>
-</li><li> <a href="cn/XUL/Property/searchLabel">searchLabel</a>
-</li><li> <a href="cn/XUL/Property/searchParam">searchParam</a>
-</li><li> <a href="cn/XUL/Property/searchSessions">searchSessions</a>
-</li><li> <a href="cn/XUL/Property/second">second</a>
-</li><li> <a href="cn/XUL/Property/secondLeadingZero">secondLeadingZero</a>
-</li><li> <a href="cn/XUL/Property/securityUI">securityUI</a>
-</li><li> <a href="cn/XUL/Property/selected">selected</a>
-</li><li> <a href="cn/XUL/Property/selectedBrowser">selectedBrowser</a>
-</li><li> <a href="cn/XUL/Property/selectedCount">selectedCount</a>
-</li><li> <a href="cn/XUL/Property/selectedIndex">selectedIndex</a>
-</li><li> <a href="cn/XUL/Property/selectedItem">selectedItem</a>
-</li><li> <a href="cn/XUL/Property/selectedItems">selectedItems</a>
-</li><li> <a href="cn/XUL/Property/selectedPanel">selectedPanel</a>
-</li><li> <a href="cn/XUL/Property/selectedTab">selectedTab</a>
-</li><li> <a href="cn/XUL/Property/selectionEnd">selectionEnd</a>
-</li><li> <a href="cn/XUL/Property/selectionStart">selectionStart</a>
-</li><li> <a href="cn/XUL/Property/selstyle">selstyle</a>
-</li><li> <a href="cn/XUL/Property/selType">selType</a>
-</li><li> <a href="cn/XUL/Property/sessionCount">sessionCount</a>
-</li><li> <a href="cn/XUL/Property/sessionHistory">sessionHistory</a>
-</li><li> <a href="cn/XUL/Property/showCommentColumn">showCommentColumn</a>
-</li><li> <a href="cn/XUL/Property/showPopup">showPopup</a>
-</li><li> <a href="cn/XUL/Property/size">size</a>
-</li><li> <a href="cn/XUL/Property/smoothScroll">smoothScroll</a>
-</li><li> <a href="cn/XUL/Property/spinButtons">spinButtons</a>
-</li><li> <a href="cn/XUL/Property/src">src</a>
-</li><li> <a href="cn/XUL/Property/state">state</a>
-</li><li> <a href="cn/XUL/Property/statusbar">statusbar</a>
-</li><li> <a href="cn/XUL/Property/statusText">statusText</a>
-</li><li> <a href="cn/XUL/Property/stringBundle">stringBundle</a>
-</li><li> <a href="cn/XUL/Property/strings">strings</a>
-</li><li> <a href="cn/XUL/Property/style">style</a>
-</li><li> <a href="cn/XUL/Property/subject">subject</a>
-</li><li> <a href="cn/XUL/Property/suppressOnSelect">suppressOnSelect</a>
-</li><li> <a href="cn/XUL/Property/tabContainer">tabContainer</a>
-</li><li> <a href="cn/XUL/Property/tabIndex">tabIndex</a>
-</li><li> <a href="cn/XUL/Property/tabs">tabs</a>
-</li><li> <a href="cn/XUL/Property/tabScrolling">tabScrolling</a>
-</li><li> <a href="cn/XUL/Property/tabpanels">tabpanels</a>
-</li><li> <a href="cn/XUL/Property/tag">tag</a>
-</li><li> <a href="cn/XUL/Property/textLength">textLength</a>
-</li><li> <a href="cn/XUL/Property/textValue">textValue</a>
-</li><li> <a href="cn/XUL/Property/timeout">timeout</a>
-</li><li> <a href="cn/XUL/Property/title">title</a>
-</li><li> <a href="cn/XUL/Property/toolbarName">toolbarName</a>
-</li><li> <a href="cn/XUL/Property/toolbarset">toolbarset</a>
-</li><li> <a href="cn/XUL/Property/tooltip">tooltip</a>
-</li><li> <a href="cn/XUL/Property/tooltipText">tooltipText</a>
-</li><li> <a href="cn/XUL/Property/top">top</a>
-</li><li> <a href="cn/XUL/Property/treeBoxObject">treeBoxObject</a>
-</li><li> <a href="cn/XUL/Property/type">type</a>
-</li><li> <a href="cn/XUL/Property/uri">uri</a>
-</li><li> <a href="cn/XUL/Property/userAction">userAction</a>
-</li><li> <a href="cn/XUL/Property/value">value</a>
-</li><li> <a href="cn/XUL/Property/valueNumber">valueNumber</a>
-</li><li> <a href="cn/XUL/Property/view">view</a>
-</li><li> <a href="cn/XUL/Property/webBrowserFind">webBrowsereFind</a>
-</li><li> <a href="cn/XUL/Property/webNavigation">webNavigation</a>
-</li><li> <a href="cn/XUL/Property/webProgress">webProgress</a>
-</li><li> <a href="cn/XUL/Property/width">width</a>
-</li><li> <a href="cn/XUL/Property/wizardPages">wizardPages</a>
-</li><li> <a href="cn/XUL/Property/wrapAround">wrapAround</a>
-</li><li> <a href="cn/XUL/Property/year">year</a>
-</li><li> <a href="cn/XUL/Property/yearLeadingZero">yearLeadingZero</a>
-</li></ul>
-<h3 id="Related_DOM_element_properties" name="Related_DOM_element_properties"> Related DOM element properties </h3>
-<ul><li> <a href="cn/DOM/element.attributes">DOM:element.attributes</a>
-</li><li> <a href="cn/DOM/element.childNodes">DOM:element.childNodes</a>
-</li><li> <a href="cn/DOM/element.cloneNode">DOM:element.cloneNode</a>
-</li><li> <a href="cn/DOM/element.firstChild">DOM:element.firstChild</a>
-</li><li> <a href="cn/DOM/element.lastChild">DOM:element.lastChild</a>
-</li><li> <a href="cn/DOM/element.localName">DOM:element.localName</a>
-</li><li> <a href="cn/DOM/element.namespaceURI">DOM:element.namespaceURI</a>
-</li><li> <a href="cn/DOM/element.nextSibling">DOM:element.nextSibling</a>
-</li><li> <a href="cn/DOM/element.nodeName">DOM:element.nodeName</a>
-</li><li> <a href="cn/DOM/element.nodeType">DOM:element.nodeType</a>
-</li><li> <a href="cn/DOM/element.nodeValue">DOM:element.nodeValue</a>
-</li><li> <a href="cn/DOM/element.ownerDocument">DOM:element.ownerDocument</a>
-</li><li> <a href="cn/DOM/element.parentNode">DOM:element.parentNode</a>
-</li><li> <a href="cn/DOM/element.prefix">DOM:element.prefix</a>
-</li><li> <a href="cn/DOM/element.previousSibling">DOM:element.previousSibling</a>
-</li><li> <a href="cn/DOM/element.tagName">DOM:element.tagName</a>
-</li></ul>
-<div class="noinclude">
-</div>
diff --git a/files/zh-cn/mozilla/tech/xul/property/label/index.html b/files/zh-cn/mozilla/tech/xul/property/label/index.html
deleted file mode 100644
index 83f85cc1e3..0000000000
--- a/files/zh-cn/mozilla/tech/xul/property/label/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: label
-slug: Mozilla/Tech/XUL/Property/label
-translation_of: Archive/Mozilla/XUL/Property/label
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span></div>
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/label">label</a></span></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code> attribute.</dd>
-</dl>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/property/labelelement/index.html b/files/zh-cn/mozilla/tech/xul/property/labelelement/index.html
deleted file mode 100644
index 6baead11d3..0000000000
--- a/files/zh-cn/mozilla/tech/xul/property/labelelement/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: labelElement
-slug: Mozilla/Tech/XUL/Property/labelElement
-translation_of: Archive/Mozilla/XUL/Property/labelElement
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span></div>
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/labelElement">labelElement</a></span></code></dt>
- <dd>
- Type:
- <i>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/label" title="label">label</a></code> element</i>
- </dd>
- <dd>
- The <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/label" title="label">label</a></code> element associated with the control. This is set when a label has a <code id="a-control"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/control">control</a></code> attribute pointing to this element. This property will be <code>null</code> when no label is associated with the control.</dd>
-</dl>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/property/markupdocumentviewer/index.html b/files/zh-cn/mozilla/tech/xul/property/markupdocumentviewer/index.html
deleted file mode 100644
index 8719292f2d..0000000000
--- a/files/zh-cn/mozilla/tech/xul/property/markupdocumentviewer/index.html
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: markupDocumentViewer
-slug: Mozilla/Tech/XUL/Property/markupDocumentViewer
-translation_of: Archive/Mozilla/XUL/Property/markupDocumentViewer
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span></div>
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/markupDocumentViewer">markupDocumentViewer</a></span></code></dt>
- <dd>
- 类型: <em><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMarkupDocumentViewer" title="">nsIMarkupDocumentViewer</a></code></em></dd>
- <dd>
- 这个只读的属性包含 <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMarkupDocumentViewer" title="">nsIMarkupDocumentViewer</a></code> 接口,负责document文档的绘制。</dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/property/max/index.html b/files/zh-cn/mozilla/tech/xul/property/max/index.html
deleted file mode 100644
index 3d20dae617..0000000000
--- a/files/zh-cn/mozilla/tech/xul/property/max/index.html
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: max
-slug: Mozilla/Tech/XUL/Property/max
-translation_of: Archive/Mozilla/XUL/Property/max
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span></div>
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/max">max</a></span></code></dt>
- <dd>
- 类型:整数</dd>
- <dd>
- 获取或设置<code id="a-max"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/max">max</a></code>特性(attribute)的值.</dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/property/menuitem.control/index.html b/files/zh-cn/mozilla/tech/xul/property/menuitem.control/index.html
deleted file mode 100644
index a8cd738934..0000000000
--- a/files/zh-cn/mozilla/tech/xul/property/menuitem.control/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: menuitem.control
-slug: Mozilla/Tech/XUL/Property/menuitem.control
-translation_of: Archive/Mozilla/XUL/Property/menuitem.control
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span></div>
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/menuitem.control">control</a></span></code></dt>
- <dd>
- Type:
- <i>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code> element</i>
- </dd>
- <dd>
- Returns the enclosing <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code> that the item is inside, if any, or <code>null</code> if there is no enclosing menu.</dd>
-</dl>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/property/parentcontainer/index.html b/files/zh-cn/mozilla/tech/xul/property/parentcontainer/index.html
deleted file mode 100644
index f8a29d42ae..0000000000
--- a/files/zh-cn/mozilla/tech/xul/property/parentcontainer/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: parentContainer
-slug: Mozilla/Tech/XUL/Property/parentContainer
-translation_of: Archive/Mozilla/XUL/Property/parentContainer
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span></div>
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/parentContainer">parentContainer</a></span></code> </dt>
- <dd>
- Type:
- <i>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code> element</i>
- </dd>
- <dd>
- Read only property that returns the containing <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code> element, or <code>null</code> if there isn't a containing menu.</dd>
-</dl>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/property/selected/index.html b/files/zh-cn/mozilla/tech/xul/property/selected/index.html
deleted file mode 100644
index eee4b31285..0000000000
--- a/files/zh-cn/mozilla/tech/xul/property/selected/index.html
+++ /dev/null
@@ -1,18 +0,0 @@
----
-title: selected
-slug: Mozilla/Tech/XUL/Property/selected
-translation_of: Archive/Mozilla/XUL/Property/selected
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span></div>
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selected">selected</a></span></code>&lt;magic name="\"PAGENAME\"/"&gt;&lt;/magic&gt;</dt>
- <dd>
- Type:
- <i>
- boolean</i>
- </dd>
- <dd>
- This property's value is <code>true</code> if this element is selected, or <code>false</code> if it is not. This property is read only.</dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/property/selectedindex/index.html b/files/zh-cn/mozilla/tech/xul/property/selectedindex/index.html
deleted file mode 100644
index 22d1a4fba1..0000000000
--- a/files/zh-cn/mozilla/tech/xul/property/selectedindex/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: selectedIndex
-slug: Mozilla/Tech/XUL/Property/selectedIndex
-translation_of: Archive/Mozilla/XUL/Property/selectedIndex
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span></div>
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectedIndex">selectedIndex</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- Returns the index of the currently selected item. You may select an item by assigning its index to this property. By assigning <code>-1</code> to this property, all items will be deselected.</dd>
-</dl>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/property/selecteditem/index.html b/files/zh-cn/mozilla/tech/xul/property/selecteditem/index.html
deleted file mode 100644
index 1583c5f526..0000000000
--- a/files/zh-cn/mozilla/tech/xul/property/selecteditem/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: selectedItem
-slug: Mozilla/Tech/XUL/Property/selectedItem
-translation_of: Archive/Mozilla/XUL/Property/selectedItem
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span></div>
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectedItem">selectedItem</a></span></code></dt>
- <dd>
- Type:
- <i>
- element</i>
- </dd>
- <dd>
- Holds the currently selected item. If no item is currently selected, this value will be <code>null</code>. You can select an item by setting this value. A select event will be sent to the element when it is changed either via this property, the <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectedIndex">selectedIndex</a></span></code> property, or changed by the user.</dd>
-</dl>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/property/selectionstart/index.html b/files/zh-cn/mozilla/tech/xul/property/selectionstart/index.html
deleted file mode 100644
index 27ecd267c6..0000000000
--- a/files/zh-cn/mozilla/tech/xul/property/selectionstart/index.html
+++ /dev/null
@@ -1,16 +0,0 @@
----
-title: selectionStart
-slug: Mozilla/Tech/XUL/Property/selectionStart
-translation_of: Archive/Mozilla/XUL/Property/selectionStart
----
-<div class="noinclude"><span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span></div>
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectionStart">selectionStart</a></span></code></dt>
- <dd>类型: <em>integer</em></dd>
- <dd>获取或设置字段文本的选定部分的开始。 与<code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectionEnd">selectionEnd</a></span></code> 属性结合使用。 该值指定第一个选定字符的索引。</dd>
-</dl>
-
-<div class="noinclude">
-<p></p>
-</div>
diff --git a/files/zh-cn/mozilla/tech/xul/property/spinbuttons/index.html b/files/zh-cn/mozilla/tech/xul/property/spinbuttons/index.html
deleted file mode 100644
index aadb3a3a31..0000000000
--- a/files/zh-cn/mozilla/tech/xul/property/spinbuttons/index.html
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: spinButtons
-slug: Mozilla/Tech/XUL/Property/spinButtons
-translation_of: Archive/Mozilla/XUL/Property/spinButtons
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span></div>
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/spinButtons">spinButtons</a></span></code></dt>
- <dd>
- 类型:<code><a href="/zh-CN/docs/Mozilla/Tech/XUL/spinbuttons" title="spinbuttons">spinbuttons</a></code>元素</dd>
- <dd>
- 一个只读属性,返回了数字输入框元素(<code>type</code>属性为<code>number的textbox元素</code>)中包含的<code><a href="/zh-CN/docs/Mozilla/Tech/XUL/spinbuttons" title="spinbuttons">spinbuttons</a></code>元素(也就是右侧调整数字大小的上下小箭头).</dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/property/tabindex/index.html b/files/zh-cn/mozilla/tech/xul/property/tabindex/index.html
deleted file mode 100644
index 5e41049910..0000000000
--- a/files/zh-cn/mozilla/tech/xul/property/tabindex/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: tabIndex
-slug: Mozilla/Tech/XUL/Property/tabIndex
-translation_of: Archive/Mozilla/XUL/Property/tabIndex
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span></div>
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tabIndex">tabIndex</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-tabindex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tabindex">tabindex</a></code> attribute.</dd>
-</dl>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/property/textbox.value/index.html b/files/zh-cn/mozilla/tech/xul/property/textbox.value/index.html
deleted file mode 100644
index 860ed2fd39..0000000000
--- a/files/zh-cn/mozilla/tech/xul/property/textbox.value/index.html
+++ /dev/null
@@ -1,15 +0,0 @@
----
-title: textbox.value
-slug: Mozilla/Tech/XUL/Property/textbox.value
-translation_of: Archive/Mozilla/XUL/Property/textbox.value
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span></div>
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/textbox.value">value</a></span></code></dt>
- <dd>
- 类型:字符串</dd>
- <dd>
- 读取或设置该<code>textbox</code>元素中的文本内容.</dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/property/value/index.html b/files/zh-cn/mozilla/tech/xul/property/value/index.html
deleted file mode 100644
index b56deb5fc4..0000000000
--- a/files/zh-cn/mozilla/tech/xul/property/value/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: value
-slug: Mozilla/Tech/XUL/Property/value
-translation_of: Archive/Mozilla/XUL/Property/value
----
-<div class="noinclude">
- <span class="breadcrumbs XULRefProp_breadcrumbs">« <a href="/zh-CN/docs/XUL_Reference" title="XUL_Reference">XUL Reference</a></span></div>
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/value">value</a></span></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code> attribute.</dd>
-</dl>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/radio/index.html b/files/zh-cn/mozilla/tech/xul/radio/index.html
deleted file mode 100644
index ecadeea308..0000000000
--- a/files/zh-cn/mozilla/tech/xul/radio/index.html
+++ /dev/null
@@ -1,379 +0,0 @@
----
-title: radio
-slug: Mozilla/Tech/XUL/radio
-tags:
- - XUL Elements
- - XUL Reference
-translation_of: Archive/Mozilla/XUL/radio
----
-<div class="noinclude">
- <span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-<p>An element that can be turned on and off. Radio buttons are almost always grouped together in groups. Only one radio button within the same <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/radiogroup" title="radiogroup">radiogroup</a></code> may be selected at a time. The user can switch which radio button is turned on by selecting it with the mouse or keyboard. Other radio buttons in the same group are turned off. A label, specified with the <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code> attribute may be added beside the radio button.</p>
-<p>More information is available in the <a href="cn/XUL_Tutorial/Input_Controls">XUL tutorial</a>.</p>
-<dl>
- <dt>
- Attributes</dt>
- <dd>
- <a href="#a-accesskey">accesskey</a>, <a href="#a-command">command</a>, <a href="#a-crop">crop</a>, <a href="#a-disabled">disabled</a>, <a href="#a-focused">focused</a>, <a href="#a-group">group</a>, <a href="#a-image">image</a>, <a href="#a-label">label</a>, <a href="#a-selected">selected</a>, <a href="#a-tabindex">tabindex</a>, <a href="#a-value">value</a></dd>
-</dl>
-<dl>
- <dt>
- Properties</dt>
- <dd>
- <a href="#p-accessKey">accessKey</a>, <a href="#p-accessibleType">accessibleType</a>, <a href="#p-radio.control">control</a>, <a href="#p-crop">crop</a>, <a href="#p-disabled">disabled</a>, <a href="#p-image">image</a>, <a href="#p-label">label</a>, <a href="#p-radioGroup">radioGroup</a>, <a href="#p-selected">selected</a>, <a href="#p-tabIndex">tabIndex</a>, <a href="#p-value">value</a></dd>
-</dl>
-<h3 id="Examples" name="Examples">Examples</h3>
-<div class="float-right">
- <img alt="Image:XUL_ref_radio.png"></div>
-<pre>&lt;radiogroup&gt;
- &lt;radio id="orange" label="Red" accesskey="R"/&gt;
- &lt;radio id="violet" label="Green" accesskey="G" selected="true"/&gt;
- &lt;radio id="yellow" label="Blue" accesskey="B" disabled="true"/&gt;
-&lt;/radiogroup&gt;
-</pre>
-<h3 id="Attributes" name="Attributes">Attributes</h3>
-<p> </p><div id="a-accesskey">
-
-
-
-
-<dl>
- <dt><code id="a-accesskey"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/accesskey">accesskey</a></code></dt>
- <dd>类型:
- <i>character【字符】</i>
- </dd>
- <dd>本属性允许为控件(元素)设定一个字符作为快捷键,这个字符应该是 <code><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></code> 属性文本中的一个字符。该字符将会被加下划线以重点强调,平台和主体的变换并不影响这一表现行为。 当用户点击 ALT (在其他平台上具有类似功能的键) 和这个字符对应的按键时, 控件(元素)将立刻被从窗口中的某处激活或/并且获得焦点 <b>。虽说字符不分大小写,但是当label中存在大写字符和小写字符时,快捷键的字符将首先选择与之完全匹配的那一个,如果label中存在两个或更多的与accesskey字符相同的字符,其中的第一个字符将被加下划线。</b></dd>
- <dt>      *(有些键在监听按键事件时,分别对应event.ctrlKey和event.metaKey。)</dt>
-</dl>
-
-<p> </p>
-
-<h4 id="Example" name="Example">Example</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_accesskey_attr.png"></div>
-
-<pre>&lt;vbox&gt;
- &lt;label value="Enter Name" accesskey="e" control="myName"/&gt;
- &lt;textbox id="myName"/&gt;
- &lt;button label="Cancel" accesskey="n"/&gt;
- &lt;button label="Ok" accesskey="O"/&gt;
-&lt;/vbox&gt;
-</pre>
-
-<h4 id="See_also" name="See_also">See also</h4>
-
-<p><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code> attribute, <code id="a-acceltext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/acceltext">acceltext</a></code> attribute</p>
-
-<p></p>
-</div> <div id="a-command">
-
-<dl>
- <dt>
- <code id="a-command"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/command">command</a></code></dt>
- <dd>
- Type:
- <i>
- element id</i>
- </dd>
- <dd>
- Set to the <code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code> of a <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/command" title="command">command</a></code> element that is being observed by the element.</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-crop">
-
-<dl>
- <dt>
- <code id="a-crop"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/crop">crop</a></code></dt>
- <dd>
- Type:
- <i>
- one of the values below</i>
- </dd>
- <dd>
- If the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the <code>crop</code> attribute. An ellipsis will be used in place of the cropped text. If the box direction is reversed, the cropping is reversed.</dd>
-</dl>
-<ul>
- <li><code>start</code>: The text will be cropped on its left side.</li>
- <li><code>end</code>: The text will be cropped on its right side.</li>
- <li><code>left</code>: <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> The text will be cropped on its left side.</li>
- <li><code>right</code>: <span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> The text will be cropped on its right side.</li>
- <li><code>center</code>: The text will be cropped in the middle, showing both the start and end of the text normally.</li>
- <li><code>none</code>: The text will be not be cropped using an ellipsis. However, the text will simply be cut off if it is too large. The side depends on the CSS text alignment.</li>
-</ul>
-
-<p></p>
-</div> <div id="a-disabled">
-
-
-<dl>
- <dt><code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code></dt>
- <dd> </dd>
- <dd>
- <h5 id="类型boolean">类型:<em>boolean</em></h5>
- </dd>
- <dd>
- <h5 id="表示元素是被禁用的。">表示元素是被禁用的。</h5>
-
- <p>如果这个元素的disabled属性被设置为true,表示元素被禁用,被禁用的属性在页面上通常会显示灰色文本,它无法响应用户的操作,它也无法得到光标。</p>
-
- <p>然而,这个元素仍然能够响应鼠标事件,如果要启用这个元素,把disabled设置为false</p>
- </dd>
-</dl>
-
-<h4 id="示例:">示例:</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_attr_disabled.png" src="https://mdn.mozillademos.org/files/1742/XUL_ref_attr_disabled.png"></div>
-
-<pre><code>// Disabling an element
-document.getElementById('buttonRemove').setAttribute("disabled", "true");
-
-// Enabling back an element by removing the "disabled" attribute
-document.getElementById('buttonRemove').removeAttribute("disabled");</code></pre>
-
-<p></p><div class="blockIndicator standardNote standardNoteBlock">
- <p><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Firefox/Releases/3.5">Firefox 3.5 note</a></p>
- <p style="font-weight: 400;">For <a href="https://developer.mozilla.org/en-US/docs/XUL/keyset" title="en/XUL/Keyset"><code>keyset</code></a> elements, support for this attribute was added in Firefox 3.5.</p>
-</div><p></p>
-</div> <div id="a-focused">
-
-
-<dl>
- <dt><code id="a-focused"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/focused">focused</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>This attribute is <code>true</code> if the element is focused.</dd>
-</dl>
-</div> <div id="a-group">
-
-
-<dl>
- <dt><code id="a-group"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/group">group</a></code></dt>
- <dd>Type: <em>string group name</em> </dd>
- <dd>Buttons with type="radio" and the same value for their group attribute are put into the same group. Only one button from each group can be checked at a time. If the user selects one the buttons, the others in the group are unchecked.</dd>
-</dl>
-</div> <div id="a-image">
-
-<dl>
- <dt>
- <code id="a-image"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/image">image</a></code></dt>
- <dd>
- Type:
- <i>
- image URL</i>
- </dd>
- <dd>
- The URL of the image to appear on the element. If this attribute is empty or left out, no image appears. The position of the image is determined by the <code id="a-dir"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/dir">dir</a></code> and <code id="a-orient"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/orient">orient</a></code> attributes.</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-label">
-
-<dl>
- <dt>
- <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- The label that will appear on the element. If this is left out, no text appears.<br>
- label 在元素上显示。如果左侧出界,则不显示任何文字。</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-selected">
-
-<dl>
- <dt>
- <code id="a-selected"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/selected">selected</a></code></dt>
- <dd>
- Type:
- <i>
- boolean</i>
- </dd>
- <dd>
- Indicates whether the element is selected or not. This value is read-only. To change the selection, set either the <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectedIndex">selectedIndex</a></span></code> or <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectedItem">selectedItem</a></span></code> property of the containing element.</dd>
-</dl>
-
-<p></p>
-</div> <div id="a-tabindex">
-
-
-<dl>
- <dt><code id="a-tabindex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tabindex">tabindex</a></code></dt>
- <dd>Type:<em>integer</em></dd>
- <dd>当用户按下 "<kbd>tab</kbd>" 键时焦点移动到元素上的顺序。<code>tabindex</code> 数字越大,顺序越靠后。</dd>
-</dl>
-
-
-
-<p></p>
-</div> <div id="a-value">
-
-<dl>
- <dt>
- <code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- The string attribute allows you to associate a data value with an element. It is not used for any specific purpose, but you can access it with a script for your own use.</dd>
-</dl>
-
-<p></p>
-</div><p></p>
-<h3 id="Properties" name="Properties">Properties</h3>
-<p> </p><div id="p-accessKey">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessKey">accessKey</a></span></code></dt>
- <dd>
- Type:
- <i>
- character</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-accesskey"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/accesskey">accesskey</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-accessibleType">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessibleType">accessibleType</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- A value indicating the type of accessibility object for the element.</dd>
-</dl>
-
-<p></p></div> <div id="p-radio.control">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/radio.control">control</a></span></code></dt>
- <dd>Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XUL/radiogroup" title="radiogroup">radiogroup</a></code> element</em></dd>
- <dd>Returns the enclosing <code><a href="/en-US/docs/Mozilla/Tech/XUL/radiogroup" title="radiogroup">radiogroup</a></code> that the <code><a href="/en-US/docs/Mozilla/Tech/XUL/radio" title="radio">radio</a></code> element is contained within, which may or may not be its direct parent.</dd>
-</dl></div> <div id="p-crop">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/crop">crop</a></span></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-crop"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/crop">crop</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-disabled">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/disabled">disabled</a></span></code></dt>
- <dd>
- Type:
- <i>
- boolean</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-image">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/image">image</a></span></code></dt>
- <dd>
- Type:
- <i>
- image URL</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-image"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/image">image</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-label">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/label">label</a></span></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-radioGroup">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/radioGroup">radioGroup</a></span></code></dt>
- <dd>Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XUL/radiogroup" title="radiogroup">radiogroup</a></code> element</em></dd>
- <dd>Equivalent to the <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/control">control</a></span></code> property.</dd>
-</dl></div> <div id="p-selected">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selected">selected</a></span></code>&lt;magic name="\"PAGENAME\"/"&gt;&lt;/magic&gt;</dt>
- <dd>
- Type:
- <i>
- boolean</i>
- </dd>
- <dd>
- This property's value is <code>true</code> if this element is selected, or <code>false</code> if it is not. This property is read only.</dd>
-</dl></div> <div id="p-tabIndex">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tabIndex">tabIndex</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-tabindex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tabindex">tabindex</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-value">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/value">value</a></span></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code> attribute.</dd>
-</dl>
-
-<p></p></div><p></p>
-<h3 id="Methods" name="Methods">Methods</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited from XUL element</strong><br> <small> <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span></small></p> <p><strong>Inherited from DOM element</strong><br> <small> <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Related" name="Related">Related</h3>
-<dl>
- <dt>
- Elements</dt>
- <dd>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/radiogroup" title="radiogroup">radiogroup</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/checkbox" title="checkbox">checkbox</a></code></dd>
-</dl>
-<dl>
- <dt>
- Interfaces</dt>
- <dd>
- <a href="cn/NsIAccessibleProvider">nsIAccessibleProvider</a>, <a href="cn/NsIDOMXULSelectControlItemElement">nsIDOMXULSelectControlItemElement</a>, <a href="cn/NsIDOMXULLabeledControlElement">nsIDOMXULLabeledControlElement</a></dd>
-</dl>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/radiogroup/index.html b/files/zh-cn/mozilla/tech/xul/radiogroup/index.html
deleted file mode 100644
index a91c7aa8e0..0000000000
--- a/files/zh-cn/mozilla/tech/xul/radiogroup/index.html
+++ /dev/null
@@ -1,275 +0,0 @@
----
-title: radiogroup
-slug: Mozilla/Tech/XUL/radiogroup
-tags:
- - radiogroup
- - 单选按钮组
-translation_of: Archive/Mozilla/XUL/radiogroup
----
-<div class="noinclude"><span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-
-<p>一组单选按钮。在单选按钮组内一次只能选择一个单选按钮。<code><a href="/zh-CN/docs/Mozilla/Tech/XUL/radio" title="radio">radio</a></code> 按钮可以指示单选按钮组或后代的子节点。 如果您想要一个边框或 <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/caption" title="caption">caption</a></code> ,请将Radiogroup放在一个 <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/groupbox" title="groupbox">groupbox</a></code>内。<strong>radiogroup </strong>默认为垂直方向。</p>
-
-<p>更多信息可以在 <a href="/en/XUL_Tutorial/Input_Controls" title="en/XUL_Tutorial/Input_Controls">XUL 教程</a> 中找到。</p>
-
-<dl>
- <dt>Attributes</dt>
- <dd><a href="#a-disabled">disabled</a>, <a href="#a-focused">focused</a>, <a href="#a-preference">preference</a>, <a href="#a-tabindex">tabindex</a>, <a href="#a-value">value</a></dd>
-</dl>
-
-<dl>
- <dt>Properties</dt>
- <dd><a href="#p-accessibleType">accessibleType</a>, <a href="#p-disabled">disabled</a>, <a href="#p-focusedItem">focusedItem</a>, <a href="#p-itemCount">itemCount</a>, <a href="#p-selectedIndex">selectedIndex</a>, <a href="#p-selectedItem">selectedItem</a>, <a href="#p-tabIndex">tabIndex</a>, <a href="#p-value">value</a></dd>
-</dl>
-
-<dl>
- <dt>Methods</dt>
- <dd><a href="#m-appendItem">appendItem</a>, <a href="#m-checkAdjacentElement">checkAdjacentElement</a>, <a href="#m-getIndexOfItem">getIndexOfItem</a>, <a href="#m-getItemAtIndex">getItemAtIndex</a>, <a href="#m-insertItemAt">insertItemAt</a>, <a href="#m-removeItemAt">removeItemAt</a></dd>
-</dl>
-
-<h3 id="Examples" name="Examples">范例</h3>
-
-<div class="float-right"><img alt="Image:XUL_ref_radios.png" class="internal" src="/@api/deki/files/469/=XUL_ref_radios.png"></div>
-
-<pre>&lt;radiogroup&gt;
- &lt;radio id="orange" label="Red"/&gt;
- &lt;radio id="violet" label="Green" selected="true"/&gt;
- &lt;radio id="yellow" label="Blue"/&gt;
-&lt;/radiogroup&gt;
-</pre>
-
-<h3 id="Attributes" name="Attributes">Attributes</h3>
-
-<p> </p><div id="a-disabled">
-
-
-<dl>
- <dt><code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code></dt>
- <dd> </dd>
- <dd>
- <h5 id="类型boolean">类型:<em>boolean</em></h5>
- </dd>
- <dd>
- <h5 id="表示元素是被禁用的。">表示元素是被禁用的。</h5>
-
- <p>如果这个元素的disabled属性被设置为true,表示元素被禁用,被禁用的属性在页面上通常会显示灰色文本,它无法响应用户的操作,它也无法得到光标。</p>
-
- <p>然而,这个元素仍然能够响应鼠标事件,如果要启用这个元素,把disabled设置为false</p>
- </dd>
-</dl>
-
-<h4 id="示例:">示例:</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_attr_disabled.png" src="https://mdn.mozillademos.org/files/1742/XUL_ref_attr_disabled.png"></div>
-
-<pre><code>// Disabling an element
-document.getElementById('buttonRemove').setAttribute("disabled", "true");
-
-// Enabling back an element by removing the "disabled" attribute
-document.getElementById('buttonRemove').removeAttribute("disabled");</code></pre>
-
-<p></p><div class="blockIndicator standardNote">
- <p><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Firefox/Releases/3.5">Firefox 3.5 note</a></p>
- <p style="font-weight: 400;">For <a href="https://developer.mozilla.org/en-US/docs/XUL/keyset" title="en/XUL/Keyset"><code>keyset</code></a> elements, support for this attribute was added in Firefox 3.5.</p>
-</div><p></p>
-</div> <div id="a-focused">
-
-
-<dl>
- <dt><code id="a-focused"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/focused">focused</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>This attribute is <code>true</code> if the element is focused.</dd>
-</dl>
-</div> <div id="a-preference">
-
-
-<dl>
- <dt><code id="a-preference"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/preference">preference</a></code></dt>
- <dd>Type: <em>id</em></dd>
- <dd>Connects the element to a corresponding <code><a href="/en-US/docs/Mozilla/Tech/XUL/preference" title="preference">preference</a></code>. This attribute only has any effect when used inside a <code><a href="/en-US/docs/Mozilla/Tech/XUL/prefwindow" title="prefwindow">prefwindow</a></code>. More information is available in the <a href="../../../../en/Preferences_System" rel="internal">Preferences System</a> article.</dd>
-</dl>
-</div> <div id="a-tabindex">
-
-
-<dl>
- <dt><code id="a-tabindex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tabindex">tabindex</a></code></dt>
- <dd>Type:<em>integer</em></dd>
- <dd>当用户按下 "<kbd>tab</kbd>" 键时焦点移动到元素上的顺序。<code>tabindex</code> 数字越大,顺序越靠后。</dd>
-</dl>
-
-
-
-<p></p>
-</div> <div id="a-value">
-
-<dl>
- <dt>
- <code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- The string attribute allows you to associate a data value with an element. It is not used for any specific purpose, but you can access it with a script for your own use.</dd>
-</dl>
-
-<p></p>
-</div><p></p>
-
-<h3 id="Properties" name="Properties">Properties</h3>
-
-<p> </p><div id="p-accessibleType">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessibleType">accessibleType</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- A value indicating the type of accessibility object for the element.</dd>
-</dl>
-
-<p></p></div> <div id="p-disabled">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/disabled">disabled</a></span></code></dt>
- <dd>
- Type:
- <i>
- boolean</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-focusedItem">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/focusedItem">focusedItem</a></span></code></dt>
- <dd>Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XUL/radio" title="radio">radio</a></code> element</em></dd>
- <dd>Holds the currently focused item in the <code><a href="/en-US/docs/Mozilla/Tech/XUL/radiogroup" title="radiogroup">radiogroup</a></code>, which may or may not be the same as the selected item. You can change the focused item by setting this property.</dd>
-</dl></div> <div id="p-itemCount">
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/itemCount">itemCount</a></span></code> </dt>
- <dd>Type: <em>integer</em></dd>
- <dd>Read only property holding the number of child items.</dd>
-</dl>
-</div> <div id="p-selectedIndex">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectedIndex">selectedIndex</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- Returns the index of the currently selected item. You may select an item by assigning its index to this property. By assigning <code>-1</code> to this property, all items will be deselected.</dd>
-</dl>
-
-<p></p></div> <div id="p-selectedItem">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectedItem">selectedItem</a></span></code></dt>
- <dd>
- Type:
- <i>
- element</i>
- </dd>
- <dd>
- Holds the currently selected item. If no item is currently selected, this value will be <code>null</code>. You can select an item by setting this value. A select event will be sent to the element when it is changed either via this property, the <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectedIndex">selectedIndex</a></span></code> property, or changed by the user.</dd>
-</dl>
-
-<p></p></div> <div id="p-tabIndex">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tabIndex">tabIndex</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-tabindex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tabindex">tabindex</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-value">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/value">value</a></span></code></dt>
- <dd>
- Type:
- <i>
- string</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code> attribute.</dd>
-</dl>
-
-<p></p></div><p></p>
-
-<h3 id="Methods" name="Methods">Methods</h3>
-
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0 0 10px 10px; padding: 0 10px; background: rgb(238, 238, 238); float: right; width: 250px;">
-<tbody>
-<tr>
-<td>
-<p><strong>Inherited Methods</strong><br>
-<small><code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.cloneNode">cloneNode()</a></code>, <a href="/En/DOM/Node.compareDocumentPosition" title="En/DOM/Node.compareDocumentPosition">compareDocumentPosition</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getBoundingClientRect">getBoundingClientRect()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getClientRects">getClientRects()</a></code>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span>, <span id="m-getElementsByAttributeNS"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttributeNS">getElementsByAttributeNS</a></code></span>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByClassName">getElementsByClassName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getFeature">getFeature()</a></code>, <a href="/En/DOM/Node.getUserData" title="En/DOM/Node.getUserData">getUserData</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isDefaultNamespace">isDefaultNamespace()</a></code>, <a href="/En/DOM/Node.isEqualNode" title="En/DOM/Node.isEqualNode">isEqualNode</a>, <a href="/En/DOM/Node.isSameNode" title="En/DOM/Node.isSameNode">isSameNode</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <a href="/En/DOM/Node.lookupNamespaceURI" title="En/DOM/Node.lookupNamespaceURI">lookupNamespaceURI</a>, <a href="/En/DOM/Node.lookupPrefix" title="En/DOM/Node.lookupPrefix">lookupPrefix</a>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.querySelector">querySelector()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.querySelectorAll">querySelectorAll()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code>, <a href="/En/DOM/Node.setUserData" title="En/DOM/Node.setUserData">setUserData</a></small></p>
-
-</td>
-</tr>
-</tbody>
-</table> <dl>
- <dt>
- <span id="m-appendItem"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/appendItem">appendItem( label, value )</a></code></span></dt>
- <dd>
- Return type: <em>element</em></dd>
- <dd>
- Creates a new item and adds it to the end of the existing list of items. You may optionally set a value. The function returns the newly created element.</dd>
-</dl> <dl>
- <dt><span id="m-checkAdjacentElement"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/checkAdjacentElement">checkAdjacentElement( dir )</a></code></span></dt>
- <dd>Return type: <em>no return value</em></dd>
- <dd>Deselects the currently selected <code><a href="/en-US/docs/Mozilla/Tech/XUL/radio" title="radio">radio</a></code> button in the group and selects the one adjacent to it. If the argument <var>dir</var> is <code>true</code>, the next radio button is selected. If it is <code>false</code>, the previous radio button is selected.</dd>
-</dl> <dl>
- <dt><span id="m-getIndexOfItem"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/getIndexOfItem">getIndexOfItem( item )</a></code></span></dt>
- <dd>Return type: <em>integer</em></dd>
- <dd>Returns the zero-based position of the specified item. Items are numbered starting at the first item displayed in the list.</dd>
-</dl> <dl>
- <dt><span id="m-getItemAtIndex"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/getItemAtIndex">getItemAtIndex( index )</a></code></span></dt>
- <dd>Return type: <em>element</em></dd>
- <dd>Returns the element that is at the specified index.</dd>
-</dl> <dl>
- <dt>
- <span id="m-insertItemAt"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/insertItemAt">insertItemAt( index, label, value )</a></code></span></dt>
- <dd>
- Return type: <em>element</em></dd>
- <dd>
- This method creates a new item and inserts it at the specified position. You may optionally set a value. The new item element is returned.</dd>
-</dl> <dl>
- <dt>
- <span id="m-removeItemAt"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/removeItemAt">removeItemAt( index )</a></code></span></dt>
- <dd>
- Return type: <em>element</em></dd>
- <dd>
- Removes the child item in the element at the specified index. The method returns the removed item.</dd>
-</dl><p></p>
-
-<h3 id="Related" name="Related">Related</h3>
-
-<dl>
- <dt>Interfaces</dt>
- <dd><code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIAccessibleProvider" title="">nsIAccessibleProvider</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMXULSelectControlElement" title="">nsIDOMXULSelectControlElement</a></code></dd>
-</dl>
-
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/script/index.html b/files/zh-cn/mozilla/tech/xul/script/index.html
deleted file mode 100644
index 6006a33298..0000000000
--- a/files/zh-cn/mozilla/tech/xul/script/index.html
+++ /dev/null
@@ -1,117 +0,0 @@
----
-title: script
-slug: Mozilla/Tech/XUL/script
-translation_of: Archive/Mozilla/XUL/script
----
-<div class="noinclude">
- <span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-<p>Much like the HTML <code>script</code> element, this is used to declare a script to be used by the XUL window. You should usually put scripts in a separate file pointed to by the <code id="a-src"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/src">src</a></code> attribute, but you may also place the script inline inside the opening and closing <code>script</code> tags.</p>
-<p>More information is available in the <a href="/en/XUL_Tutorial/Adding_Event_Handlers" title="en/XUL_Tutorial/Adding_Event_Handlers">XUL tutorial</a>.</p>
-<dl>
- <dt>
- Attributes</dt>
- <dd>
- <a href="#a-script.src">src</a>, <a href="#a-script.type">type</a></dd>
-</dl>
-<h3 id="Examples" name="Examples">Examples</h3>
-<pre> &lt;script src="test.js"/&gt;
- &lt;script src="http://example.com/js/test.js"/&gt;
- &lt;script&gt;
- function foo(){
- // code
- }
- &lt;/script&gt;
-</pre>
-<h3 id="Attributes" name="Attributes">Attributes</h3>
-<p></p><div id="a-script.src">
-
-
-<dl>
- <dt><code id="a-script.src"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/script.src">src</a></code></dt>
- <dd>Type: <em>URI</em></dd>
- <dd>The URI of the script.</dd>
-</dl>
-</div> <div id="a-script.type">
-
-
-<dl>
- <dt><code id="a-script.type"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/script.type">type</a></code></dt>
- <dd>Type: <em>language content type</em></dd>
- <dd>The language of the script. Usually, you would set this to <code>application/javascript</code>.<br>
- <br>
- <strong>Note: </strong>If the JavaScript file is in chrome://, setting this attribute to <code>application/javascript</code> will always use the latest available JavaScript version. If you omit this attribute, the default (and older) JavaScript version is used (like you get when including a JavaScript file from web content without specifying a version number).</dd>
-</dl>
-</div> <table style="border: 1px solid rgb(204, 204, 204); margin: 0 0 10px 10px; padding: 0 10px; background: rgb(238, 238, 238);">
-<tbody>
-<tr>
-<td><p><strong>Inherited from XUL element</strong><br> <small>
-<code id="a-align"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/align">align</a></code>,
-<code id="a-allowevents"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/allowevents">allowevents</a></code>,
-<code id="a-allownegativeassertions"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/allownegativeassertions">allownegativeassertions</a></code>,
-<code id="a-class"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/class">class</a></code>,
-<code id="a-coalesceduplicatearcs"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/coalesceduplicatearcs">coalesceduplicatearcs</a></code>,
-<code id="a-collapsed"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/collapsed">collapsed</a></code>,
-<code id="a-container"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/container">container</a></code>,
-<code id="a-containment"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/containment">containment</a></code>,
-<code id="a-context"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/context">context</a></code>,
-<code id="a-contextmenu"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/contextmenu">contextmenu</a></code>,
-<code id="a-datasources"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/datasources">datasources</a></code>,
-<code id="a-dir"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/dir">dir</a></code>,
-<code id="a-empty"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/empty">empty</a></code>,
-<code id="a-equalsize"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/equalsize">equalsize</a></code>,
-<code id="a-flags"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/flags">flags</a></code>,
-<code id="a-flex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/flex">flex</a></code>,
-<code id="a-height"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/height">height</a></code>,
-<code id="a-hidden"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/hidden">hidden</a></code>,
-<code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code>,
-<code id="a-insertafter"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/insertafter">insertafter</a></code>,
-<code id="a-insertbefore"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/insertbefore">insertbefore</a></code>,
-<code id="a-left"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/left">left</a></code>,
-<code id="a-maxheight"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/maxheight">maxheight</a></code>,
-<code id="a-maxwidth"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/maxwidth">maxwidth</a></code>,
-<code id="a-menu"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/menu">menu</a></code>,
-<code id="a-minheight"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/minheight">minheight</a></code>,
-<code id="a-minwidth"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/minwidth">minwidth</a></code>,
-<code id="a-mousethrough"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/mousethrough">mousethrough</a></code>,
-<code id="a-observes"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/observes">observes</a></code>,
-<code id="a-ordinal"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/ordinal">ordinal</a></code>,
-<code id="a-orient"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/orient">orient</a></code>,
-<code id="a-pack"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/pack">pack</a></code>,
-<code id="a-persist"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/persist">persist</a></code>,
-<code id="a-popup"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/popup">popup</a></code>,
-<code id="a-position"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/position">position</a></code>,
-<code id="a-preference-editable"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/preference-editable">preference-editable</a></code>,
-<code id="a-querytype"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/querytype">querytype</a></code>,
-<code id="a-ref"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/ref">ref</a></code>,
-<code id="a-removeelement"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/removeelement">removeelement</a></code>,
-<code id="a-sortDirection"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/sortDirection">sortDirection</a></code>,
-<code id="a-sortResource"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/sortResource">sortResource</a></code>,
-<code id="a-sortResource2"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/sortResource2">sortResource2</a></code>,
-<code id="a-statustext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/statustext">statustext</a></code>,
-<code id="a-style"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/style">style</a></code>,
-<code id="a-template"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/template">template</a></code>,
-<code id="a-tooltip"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tooltip">tooltip</a></code>,
-<code id="a-tooltiptext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tooltiptext">tooltiptext</a></code>,
-<code id="a-top"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/top">top</a></code>,
-<code id="a-uri"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/uri">uri</a></code>,
-<code id="a-wait-cursor"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/wait-cursor">wait-cursor</a></code>,
-<code id="a-width"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/width">width</a></code> </small></p>
-</td>
-</tr>
-</tbody>
-</table><p></p>
-<h3 id="Properties" name="Properties">Properties</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited Properties</strong><br> <small> <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/align">align</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/allowEvents">allowEvents</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/boxObject">boxObject</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/builder">builder</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/className">className</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/collapsed">collapsed</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/contextMenu">contextMenu</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/controllers">controllers</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/database">database</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/datasources">datasources</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/dir">dir</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/flex">flex</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/height">height</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/hidden">hidden</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/id">id</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/left">left</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/maxHeight">maxHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/maxWidth">maxWidth</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/menu">menu</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/minHeight">minHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/minWidth">minWidth</a></span></code>, , , , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/observes">observes</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/ordinal">ordinal</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/orient">orient</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/pack">pack</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/persist">persist</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/ref">ref</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/resource">resource</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/statusText">statusText</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/style">style</a></span></code>, ,, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tooltip">tooltip</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tooltipText">tooltipText</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/top">top</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/width">width</a></span></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Methods" name="Methods">Methods</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited from XUL element</strong><br> <small> <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span></small></p> <p><strong>Inherited from DOM element</strong><br> <small> <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Related" name="Related">Related</h3>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/statusbar/index.html b/files/zh-cn/mozilla/tech/xul/statusbar/index.html
deleted file mode 100644
index dec688952e..0000000000
--- a/files/zh-cn/mozilla/tech/xul/statusbar/index.html
+++ /dev/null
@@ -1,131 +0,0 @@
----
-title: statusbar
-slug: Mozilla/Tech/XUL/statusbar
-translation_of: Archive/Mozilla/XUL/statusbar
----
-<p></p><div class="blockIndicator deprecated deprecatedHeader">
- <p><strong><span class="icon-only-inline" title="This is an obsolete API and is no longer guaranteed to work."><i class="icon-trash"> </i></span> 已废弃</strong><br>该特性已经从 Web 标准中删除,虽然一些浏览器目前仍然支持它,但也许会在未来的某个时间停止支持,请尽量不要使用该特性。</p>
- </div><p></p>
-<div class="noinclude">
- 我建议使用<a href="/en-US/docs/The_add-on_bar" title="/en-US/docs/The_add-on_bar">附加组件栏</a>来代替.</div>
-<div class="noinclude">
-  </div>
-<div class="noinclude">
- <span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-<div class="noinclude">
-  </div>
-<p>用来创建状态栏的元素,通常位于窗口底部.可以包含多个<code><a href="/zh-CN/docs/Mozilla/Tech/XUL/statusbarpanel" title="statusbarpanel">statusbarpanel</a></code>元素.</p>
-<dl>
- <dt>
- 属性</dt>
- <dd>
- <a href="#p-accessibleType">accessibleType</a></dd>
-</dl>
-<h3 id="Examples" name="Examples">示例</h3>
-<pre>&lt;statusbar&gt;
- &lt;statusbarpanel label="Left panel"/&gt;
- &lt;spacer flex="1"/&gt;
- &lt;progressmeter mode="determined" value="82"/&gt;
- &lt;statusbarpanel label="Right panel"/&gt;
-&lt;/statusbar&gt;
-</pre>
-<p><img alt="Image:XUL_ref_statusbar.png" class="internal" src="/@api/deki/files/470/=XUL_ref_statusbar.png"></p>
-<h3 id="Attributes" name="Attributes">XUL属性(Attribute)</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0 0 10px 10px; padding: 0 10px; background: rgb(238, 238, 238);">
-<tbody>
-<tr>
-<td><p><strong>Inherited from XUL element</strong><br> <small>
-<code id="a-align"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/align">align</a></code>,
-<code id="a-allowevents"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/allowevents">allowevents</a></code>,
-<code id="a-allownegativeassertions"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/allownegativeassertions">allownegativeassertions</a></code>,
-<code id="a-class"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/class">class</a></code>,
-<code id="a-coalesceduplicatearcs"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/coalesceduplicatearcs">coalesceduplicatearcs</a></code>,
-<code id="a-collapsed"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/collapsed">collapsed</a></code>,
-<code id="a-container"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/container">container</a></code>,
-<code id="a-containment"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/containment">containment</a></code>,
-<code id="a-context"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/context">context</a></code>,
-<code id="a-contextmenu"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/contextmenu">contextmenu</a></code>,
-<code id="a-datasources"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/datasources">datasources</a></code>,
-<code id="a-dir"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/dir">dir</a></code>,
-<code id="a-empty"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/empty">empty</a></code>,
-<code id="a-equalsize"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/equalsize">equalsize</a></code>,
-<code id="a-flags"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/flags">flags</a></code>,
-<code id="a-flex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/flex">flex</a></code>,
-<code id="a-height"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/height">height</a></code>,
-<code id="a-hidden"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/hidden">hidden</a></code>,
-<code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code>,
-<code id="a-insertafter"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/insertafter">insertafter</a></code>,
-<code id="a-insertbefore"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/insertbefore">insertbefore</a></code>,
-<code id="a-left"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/left">left</a></code>,
-<code id="a-maxheight"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/maxheight">maxheight</a></code>,
-<code id="a-maxwidth"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/maxwidth">maxwidth</a></code>,
-<code id="a-menu"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/menu">menu</a></code>,
-<code id="a-minheight"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/minheight">minheight</a></code>,
-<code id="a-minwidth"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/minwidth">minwidth</a></code>,
-<code id="a-mousethrough"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/mousethrough">mousethrough</a></code>,
-<code id="a-observes"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/observes">observes</a></code>,
-<code id="a-ordinal"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/ordinal">ordinal</a></code>,
-<code id="a-orient"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/orient">orient</a></code>,
-<code id="a-pack"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/pack">pack</a></code>,
-<code id="a-persist"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/persist">persist</a></code>,
-<code id="a-popup"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/popup">popup</a></code>,
-<code id="a-position"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/position">position</a></code>,
-<code id="a-preference-editable"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/preference-editable">preference-editable</a></code>,
-<code id="a-querytype"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/querytype">querytype</a></code>,
-<code id="a-ref"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/ref">ref</a></code>,
-<code id="a-removeelement"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/removeelement">removeelement</a></code>,
-<code id="a-sortDirection"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/sortDirection">sortDirection</a></code>,
-<code id="a-sortResource"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/sortResource">sortResource</a></code>,
-<code id="a-sortResource2"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/sortResource2">sortResource2</a></code>,
-<code id="a-statustext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/statustext">statustext</a></code>,
-<code id="a-style"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/style">style</a></code>,
-<code id="a-template"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/template">template</a></code>,
-<code id="a-tooltip"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tooltip">tooltip</a></code>,
-<code id="a-tooltiptext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tooltiptext">tooltiptext</a></code>,
-<code id="a-top"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/top">top</a></code>,
-<code id="a-uri"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/uri">uri</a></code>,
-<code id="a-wait-cursor"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/wait-cursor">wait-cursor</a></code>,
-<code id="a-width"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/width">width</a></code> </small></p>
-</td>
-</tr>
-</tbody>
-</table><p></p>
-<h3 id="Properties" name="Properties">DOM属性(Propertie)</h3>
-<p></p><div id="p-accessibleType">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessibleType">accessibleType</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- A value indicating the type of accessibility object for the element.</dd>
-</dl>
-
-<p></p></div> <table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited Properties</strong><br> <small> <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/align">align</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/allowEvents">allowEvents</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/boxObject">boxObject</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/builder">builder</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/className">className</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/collapsed">collapsed</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/contextMenu">contextMenu</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/controllers">controllers</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/database">database</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/datasources">datasources</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/dir">dir</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/flex">flex</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/height">height</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/hidden">hidden</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/id">id</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/left">left</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/maxHeight">maxHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/maxWidth">maxWidth</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/menu">menu</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/minHeight">minHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/minWidth">minWidth</a></span></code>, , , , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/observes">observes</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/ordinal">ordinal</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/orient">orient</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/pack">pack</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/persist">persist</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/ref">ref</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/resource">resource</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/statusText">statusText</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/style">style</a></span></code>, ,, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tooltip">tooltip</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tooltipText">tooltipText</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/top">top</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/width">width</a></span></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Methods" name="Methods">方法</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited from XUL element</strong><br> <small> <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span></small></p> <p><strong>Inherited from DOM element</strong><br> <small> <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Related" name="Related">相关</h3>
-<dl>
- <dt>
- 元素</dt>
- <dd>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/statusbarpanel" title="statusbarpanel">statusbarpanel</a></code></dd>
-</dl>
-<dl>
- <dt>
- 接口</dt>
- <dd>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIAccessibleProvider" title="">nsIAccessibleProvider</a></code></dd>
-</dl>
diff --git a/files/zh-cn/mozilla/tech/xul/style/index.html b/files/zh-cn/mozilla/tech/xul/style/index.html
deleted file mode 100644
index 173c741e34..0000000000
--- a/files/zh-cn/mozilla/tech/xul/style/index.html
+++ /dev/null
@@ -1,6 +0,0 @@
----
-title: Style classes
-slug: Mozilla/Tech/XUL/Style
-translation_of: Archive/Mozilla/XUL/Style
----
-<p>This page was auto-generated because a user created a sub-page to this page.</p>
diff --git a/files/zh-cn/mozilla/tech/xul/style/menuitem-iconic/index.html b/files/zh-cn/mozilla/tech/xul/style/menuitem-iconic/index.html
deleted file mode 100644
index 8b41b0497e..0000000000
--- a/files/zh-cn/mozilla/tech/xul/style/menuitem-iconic/index.html
+++ /dev/null
@@ -1,16 +0,0 @@
----
-title: menuitem-iconic
-slug: Mozilla/Tech/XUL/Style/menuitem-iconic
-translation_of: Archive/Mozilla/XUL/Style/menuitem-iconic
----
-<div class="noinclude">
- <a href="/zh-CN/docs/XUL_Reference" title="« XUL Reference">« XUL Reference</a></div>
-<dl>
- <dt>
- <code><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Style/menuitem-iconic">menuitem-iconic</a></code></dt>
- <dd>
- Use this class to have an image appear on the <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code>. Specify the image using the <code id="a-image"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/image">image</a></code> attribute.</dd>
-</dl>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/style/menuitem-non-iconic/index.html b/files/zh-cn/mozilla/tech/xul/style/menuitem-non-iconic/index.html
deleted file mode 100644
index c9873b5c31..0000000000
--- a/files/zh-cn/mozilla/tech/xul/style/menuitem-non-iconic/index.html
+++ /dev/null
@@ -1,16 +0,0 @@
----
-title: menuitem-non-iconic
-slug: Mozilla/Tech/XUL/Style/menuitem-non-iconic
-translation_of: Archive/Mozilla/XUL/Style/menuitem-non-iconic
----
-<div class="noinclude">
- <a href="/zh-CN/docs/XUL_Reference" title="« XUL Reference">« XUL Reference</a></div>
-<dl>
- <dt>
- <code><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Style/menuitem-non-iconic">menuitem-non-iconic</a></code></dt>
- <dd>
- Normally, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code>s have a margin to the left for an image or checkmark. This class may be used to remove this margin so that the menuitem appears on the left edge of the menupopup.</dd>
-</dl>
-<div class="noinclude">
-  </div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tabbox/index.html b/files/zh-cn/mozilla/tech/xul/tabbox/index.html
deleted file mode 100644
index c0decfea4f..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tabbox/index.html
+++ /dev/null
@@ -1,156 +0,0 @@
----
-title: tabbox
-slug: Mozilla/Tech/XUL/tabbox
-translation_of: Archive/Mozilla/XUL/tabbox
----
-<div class="noinclude">
- <span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-<p>A container used to display a set of tabbed pages of elements. A row of tabs is displayed at the top of tabbox which may be used to switch between each page. The <code>tabbox</code> should contain two children, the first a <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/tabs" title="tabs">tabs</a></code> element which contains the tabs and the second a <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/tabpanels" title="tabpanels">tabpanels</a></code> element which contains the contents of the pages.</p>
-<p>More information is available in the <a href="/en/XUL_Tutorial/Tabboxes" title="en/XUL_Tutorial/Tabboxes">XUL tutorial</a>.</p>
-<dl>
- <dt>
- Attributes</dt>
- <dd>
- <a href="#a-eventnode">eventnode</a>, <a href="#a-handleCtrlPageUpDown">handleCtrlPageUpDown</a>, <a href="#a-handleCtrlTab">handleCtrlTab</a></dd>
-</dl>
-<dl>
- <dt>
- Properties</dt>
- <dd>
- <a href="#p-accessibleType">accessibleType</a>, <a href="#p-eventNode">eventNode</a>, <a href="#p-handleCtrlPageUpDown">handleCtrlPageUpDown</a>, <a href="#p-handleCtrlTab">handleCtrlTab</a>, <a href="#p-selectedIndex">selectedIndex</a>, <a href="#p-selectedPanel">selectedPanel</a>, <a href="#p-selectedTab">selectedTab</a>, <a href="#p-tabbox.tabs">tabs</a>, <a href="#p-tabpanels">tabpanels</a></dd>
-</dl>
-<h3 id="Examples" name="Examples">Examples</h3>
-<pre>&lt;tabbox id="myTabList" selectedIndex="2"&gt;
- &lt;tabs&gt;
- &lt;tab label="A First tab"/&gt;
- &lt;tab label="Second tab"/&gt;
- &lt;tab label="Another tab"/&gt;
- &lt;tab label="Last tab"/&gt;
- &lt;/tabs&gt;
- &lt;tabpanels&gt;
- &lt;tabpanel&gt;&lt;!-- tabpanel First elements go here --&gt;&lt;/tabpanel&gt;
- &lt;tabpanel&gt;&lt;!-- tabpanel Second elements go here --&gt;&lt;/tabpanel&gt;
- &lt;tabpanel&gt;&lt;button label="Click me"/&gt;&lt;/tabpanel&gt;
- &lt;tabpanel&gt;&lt;!-- tabpanel Fourth elements go here --&gt;&lt;/tabpanel&gt;
- &lt;/tabpanels&gt;
-&lt;/tabbox&gt;
-</pre>
-<p><img alt="Image:XUL_REF_tabboxes.gif" class="internal" src="/@api/deki/files/434/=XUL_REF_tabboxes.gif"></p>
-<h3 id="Attributes" name="Attributes">Attributes</h3>
-<p> </p><div id="a-eventnode">
-
-
-<dl>
- <dt><code id="a-eventnode"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/eventnode">eventnode</a></code></dt>
- <dd>Type: <em>one of the values below</em></dd>
- <dd>Indicates where keyboard navigation events are listened to. If this attribute is not specified, events are listened to from the <code><a href="/en-US/docs/Mozilla/Tech/XUL/tabbox" title="tabbox">tabbox</a></code>. Thus, if this attribute is not used, the <code><a href="/en-US/docs/Mozilla/Tech/XUL/tabbox" title="tabbox">tabbox</a></code> or an element inside it must have the focus for the keyboard navigation to apply.</dd>
- <dd>
- <dl>
- <dt><code>parent</code></dt>
- <dd>Keyboard navigation is captured at the parent of the <code><a href="/en-US/docs/Mozilla/Tech/XUL/tabbox" title="tabbox">tabbox</a></code>.</dd>
- <dt><code>window</code></dt>
- <dd>Keyboard navigation is captured at the window level. Tab navigation will occur as long as any element in the window is focused.</dd>
- <dt><code>document</code></dt>
- <dd>Keyboard navigation is captured at the document level. Tab navigation will occur as long as any element in the document is focused.</dd>
- </dl>
- </dd>
-</dl>
-</div> <div id="a-handleCtrlPageUpDown">
-
-</div> <div id="a-handleCtrlTab">
-
-
-<dl>
- <dt><code id="a-handleCtrlTab"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/handleCtrlTab">handleCtrlTab</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>If set to <code>true</code> or omitted, the <code><a href="/en-US/docs/Mozilla/Tech/XUL/tabbox" title="tabbox">tabbox</a></code> will switch to the next tab when the Control and Tab keys are pressed. If the Shift key is also held down, the previous tab will be displayed. If this attribute is set to <code>false</code>, these keys do not navigate between tabs.</dd>
-</dl>
-</div><p></p>
-<h3 id="Properties" name="Properties">Properties</h3>
-<p> </p><div id="p-accessibleType">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessibleType">accessibleType</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- A value indicating the type of accessibility object for the element.</dd>
-</dl>
-
-<p></p></div> <div id="p-eventNode">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/eventNode">eventNode</a></span></code></dt>
- <dd>Type: <em>EventTarget</em></dd>
- <dd>Indicates the node where keyboard navigation events listener is set up. The initial value for this property is determined by the value of the <code id="a-eventnode"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/eventnode">eventnode</a></code> attribute.</dd>
-</dl></div> <div id="p-handleCtrlPageUpDown">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/handleCtrlPageUpDown">handleCtrlPageUpDown</a></span></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>Gets and sets the value of the <code id="a-handleCtrlPageUpDown"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/handleCtrlPageUpDown">handleCtrlPageUpDown</a></code> attribute.</dd>
-</dl></div> <div id="p-handleCtrlTab">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/handleCtrlTab">handleCtrlTab</a></span></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>Gets and sets the value of the <code id="a-handleCtrlTab"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/handleCtrlTab">handleCtrlTab</a></code> attibute.</dd>
-</dl></div> <div id="p-selectedIndex">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectedIndex">selectedIndex</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- Returns the index of the currently selected item. You may select an item by assigning its index to this property. By assigning <code>-1</code> to this property, all items will be deselected.</dd>
-</dl>
-
-<p></p></div> <div id="p-selectedPanel">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/selectedPanel">selectedPanel</a></span></code></dt>
- <dd>Type: <em>element</em></dd>
- <dd>Holds a reference to the currently selected panel within a <code>&lt;tabbox&gt;</code> element. Assigning a value to this property will modify the selected panel. A select event will be sent when the selected panel is changed.</dd>
-</dl></div> <div id="p-selectedTab">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/selectedTab">selectedTab</a></span></code></dt>
- <dd>Type: <em>tab element</em></dd>
- <dd>A reference to the currently selected tab, which will always be one of the <code><a href="/en-US/docs/Mozilla/Tech/XUL/tab" title="tab">tab</a></code> elements in the <code><a href="/en-US/docs/Mozilla/Tech/XUL/tabs" title="tabs">tabs</a></code> element. Assign a value to this property to modify the currently selected tab.</dd>
-</dl></div> <div id="p-tabbox.tabs">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/tabbox.tabs">tabs</a></span></code></dt>
- <dd>Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XUL/tabs" title="tabs">tabs</a></code> element</em></dd>
- <dd>The <code><a href="/en-US/docs/Mozilla/Tech/XUL/tabs" title="tabs">tabs</a></code> element contained within the tabbox.</dd>
-</dl></div> <div id="p-tabpanels">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/tabpanels">tabpanels</a></span></code></dt>
- <dd>Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XUL/tabpanels" title="tabpanels">tabpanels</a></code> element</em></dd>
- <dd>The <code><a href="/en-US/docs/Mozilla/Tech/XUL/tabpanels" title="tabpanels">tabpanels</a></code> element contained within the tabbox.</dd>
-</dl></div><p></p>
-<h3 id="Methods" name="Methods">Methods</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited from XUL element</strong><br> <small> <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span></small></p> <p><strong>Inherited from DOM element</strong><br> <small> <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Related" name="Related">Related</h3>
-<dl>
- <dt>
- Elements</dt>
- <dd>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/tabs" title="tabs">tabs</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/tab" title="tab">tab</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/tabpanels" title="tabpanels">tabpanels</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/tabpanel" title="tabpanel">tabpanel</a></code>.</dd>
-</dl>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/template_guide/index.html b/files/zh-cn/mozilla/tech/xul/template_guide/index.html
deleted file mode 100644
index 9a6ac79352..0000000000
--- a/files/zh-cn/mozilla/tech/xul/template_guide/index.html
+++ /dev/null
@@ -1,68 +0,0 @@
----
-title: Template Guide
-slug: Mozilla/Tech/XUL/Template_Guide
-translation_of: Archive/Mozilla/XUL/Template_Guide
----
-<p>Basics of XUL Templates</p>
-<ul>
- <li><a href="/en/XUL/Template_Guide/Introduction" title="en/XUL/Template_Guide/Introduction">Introduction</a></li>
- <li><a href="/en/XUL/Template_Guide/Rule_Compilation" title="en/XUL/Template_Guide/Rule_Compilation">Rule Compilation</a></li>
-</ul>
-<h2 id="RDF_Template_Syntax" name="RDF_Template_Syntax">RDF Template Syntax</h2>
-<ul>
- <li><a href="/en/XUL/Template_Guide/Result_Generation" title="en/XUL/Template_Guide/Result_Generation">Result Generation</a></li>
- <li><a href="/en/XUL/Template_Guide/RDF_Query_Syntax" title="en/XUL/Template_Guide/RDF_Query_Syntax">RDF Query Syntax</a></li>
- <li><a href="/en/XUL/Template_Guide/Actions" title="en/XUL/Template_Guide/Actions">Actions</a></li>
- <li><a href="/en/XUL/Template_Guide/Recursive_Generation" title="en/XUL/Template_Guide/Recursive_Generation">Recursive Generation</a></li>
- <li><a href="/en/XUL/Template_Guide/Simple_Example" title="en/XUL/Template_Guide/Simple_Example">Simple Example</a></li>
- <li><a href="/en/XUL/Template_Guide/Bindings" title="en/XUL/Template_Guide/Bindings">Bindings</a></li>
- <li><a href="/en/XUL/Template_Guide/Additional_Navigation" title="en/XUL/Template_Guide/Additional_Navigation">Additional Navigation</a></li>
- <li><a href="/en/XUL/Template_Guide/Filtering" title="en/XUL/Template_Guide/Filtering">Filtering</a></li>
- <li><a href="/en/XUL/Template_Guide/Static_Content" title="en/XUL/Template_Guide/Static_Content">Static Content</a></li>
- <li><a href="/en/XUL/Template_Guide/Simple_Query_Syntax" title="en/XUL/Template_Guide/Simple_Query_Syntax">Simple Query Syntax</a></li>
- <li><a href="/en/XUL/Template_Guide/Containment_Properties" title="en/XUL/Template_Guide/Containment_Properties">Containment Properties</a></li>
-</ul>
-<h2 id="XML_Template_Syntax" name="XML_Template_Syntax">XML Template Syntax</h2>
-<ul>
- <li><a href="/en/XUL/Template_Guide/XML_Templates" title="en/XUL/Template_Guide/XML_Templates">XML Templates</a></li>
- <li><a href="/en/XUL/Template_Guide/XML_Assignments" title="en/XUL/Template_Guide/XML_Assignments">XML Assignments</a></li>
-</ul>
-<h2 id="SQL_Template_Syntax" name="SQL_Template_Syntax">SQL Template Syntax</h2>
-<ul>
- <li><a href="/en/XUL/Template_Guide/SQLite_Templates" title="en/XUL/Template_Guide/SQLite_Templates">SQLite Templates</a></li>
-</ul>
-<h2 id="Common_Template_Syntax" name="Common_Template_Syntax">Common Template Syntax</h2>
-<ul>
- <li><a href="/en/XUL/Template_Guide/Attribute_Substitution" title="en/XUL/Template_Guide/Attribute_Substitution">Attribute Substitution</a></li>
- <li><a href="/en/XUL/Template_Guide/Multiple_Rules" title="en/XUL/Template_Guide/Multiple_Rules">Multiple Rules</a></li>
- <li><a href="/en/XUL/Template_Guide/Using_Recursive_Templates" title="en/XUL/Template_Guide/Using_Recursive_Templates">Using Recursive Templates</a></li>
- <li><a href="/en/XUL/Template_Guide/Building_Menus_With_Templates" title="en/XUL/Template_Guide/Building_Menus_With_Templates">Building Menus With Templates</a></li>
- <li><a href="/en/XUL/Template_Guide/Special_Condition_Tests" title="en/XUL/Template_Guide/Special_Condition_Tests">Special Condition Tests</a></li>
- <li><a href="/en/XUL/Template_Guide/Multiple_Queries" title="en/XUL/Template_Guide/Multiple_Queries">Multiple Queries</a></li>
- <li><a href="/en/XUL/Template_Guide/Using_Multiple_Queries_to_Generate_More_Results" title="en/XUL/Template_Guide/Using_Multiple_Queries_to_Generate_More_Results">Using Multiple Queries to Generate More Results</a></li>
-</ul>
-<h2 id="Building_Trees_with_Templates" name="Building_Trees_with_Templates">Building Trees with Templates</h2>
-<ul>
- <li><a href="/en/XUL/Template_Guide/Building_Trees" title="en/XUL/Template_Guide/Building_Trees">Building Trees</a></li>
- <li><a href="/en/XUL/Template_Guide/Building_Hierarchical_Trees" title="en/XUL/Template_Guide/Building_Hierarchical_Trees">Building Hierarchical Trees</a></li>
-</ul>
-<h2 id="Template_Modifications" name="Template_Modifications">Template Modifications</h2>
-<ul>
- <li><a href="/en/XUL/Template_Guide/Template_Builder_Interface" title="en/XUL/Template_Guide/Template_Builder_Interface">Template Builder Interface</a></li>
- <li><a href="/en/XUL/Template_Guide/Template_and_Tree_Listeners" title="en/XUL/Template_Guide/Template_and_Tree_Listeners">Template and Tree Listeners</a></li>
- <li><a href="/en/XUL/Template_Guide/RDF_Modifications" title="en/XUL/Template_Guide/RDF_Modifications">RDF Modifications</a></li>
-</ul>
-<h2 id="Additional_Topics" name="Additional_Topics">Additional Topics</h2>
-<ul>
- <li><a href="/en/XUL/Template_Guide/Sorting_Results" title="en/XUL/Template_Guide/Sorting_Results">Sorting Results</a></li>
- <li><a href="/en/XUL/Template_Guide/Additional_Template_Attributes" title="en/XUL/Template_Guide/Additional_Template_Attributes">Additional Template Attributes</a></li>
- <li><a href="/en/XUL/Template_Guide/Template_Logging" title="en/XUL/Template_Guide/Template_Logging">Template Logging</a></li>
- <li><a href="/en/XUL/Template_Guide/Namespaces" title="en/XUL/Template Guide/Namespaces">XML Namespaces</a></li>
-</ul>
-<h2 id="Alternative_Approaches" name="Alternative_Approaches">Alternative Approaches</h2>
-<ul>
- <li><a href="/en/JavaScript_templates" title="en/JavaScript_templates">JavaScript templates</a></li>
- <li><a class="link-https" href="https://github.com/laurentj/XulJsDatasource" title="https://github.com/laurentj/XulJsDatasource">XulJsDatasource</a>: a component for extensions, which bring a "JavaScript Template syntax". It allows to use JavaScript objects as a data source for XUL templates.</li>
-</ul>
-<p><span class="comment">Interwiki Language Links</span></p>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/textbox/index.html b/files/zh-cn/mozilla/tech/xul/textbox/index.html
deleted file mode 100644
index 4d032ca259..0000000000
--- a/files/zh-cn/mozilla/tech/xul/textbox/index.html
+++ /dev/null
@@ -1,653 +0,0 @@
----
-title: textbox
-slug: Mozilla/Tech/XUL/textbox
-translation_of: Archive/Mozilla/XUL/textbox
----
-<div class="noinclude">
- <span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-<p>An input field where the user can enter text. It is similar to the HTML <code>input</code> element. Only one line of text is displayed by default. The <code id="a-multiline"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/multiline">multiline</a></code> attribute can be specified to display a field with multiple rows.</p>
-<p>More information is available in the <a href="/en/XUL_Tutorial/Input_Controls" title="en/XUL_Tutorial/Input_Controls">XUL tutorial</a>.</p>
-<dl>
- <dt>
- Attributes</dt>
- <dd>
- <a href="#a-cols">cols</a>, <a href="#a-decimalplaces">decimalplaces</a>, <a href="#a-disabled">disabled</a>, , <a href="#a-emptytext">emptytext</a>, <a href="#a-hidespinbuttons">hidespinbuttons</a>, <a href="#a-increment">increment</a>, <a href="#a-textbox.label">label</a>, <a href="#a-max">max</a>, <a href="#a-maxlength">maxlength</a>, <a href="#a-min">min</a>, <a href="#a-multiline">multiline</a>, <a href="#a-newlines">newlines</a>, <a href="#a-textbox.onchange">onchange</a>, <a href="#a-oninput">oninput</a>, <a href="#a-placeholder">placeholder</a>, <a href="#a-preference">preference</a>, <a href="#a-readonly">readonly</a>, <a href="#a-rows">rows</a>, <a href="#a-searchbutton">searchbutton</a>, <a href="#a-size">size</a>, <a href="#a-spellcheck">spellcheck</a>, <a href="#a-tabindex">tabindex</a>, <a href="#a-timeout">timeout</a>, <a href="#a-textbox.type">type</a>, <a href="#a-textbox.value">value</a>, <a href="#a-wrap">wrap</a>, <a href="#a-wraparound">wraparound</a></dd>
-</dl>
-<dl>
- <dt>
- Properties</dt>
- <dd>
- <a href="#p-accessibleType">accessibleType</a>, <a href="#p-clickSelectsAll">clickSelectsAll</a>, <a href="#p-decimalPlaces">decimalPlaces</a>, <a href="#p-decimalSymbol">decimalSymbol</a>, <a href="#p-defaultValue">defaultValue</a>, <a href="#p-disabled">disabled</a>, <a href="#p-editor">editor</a>, <a href="#p-emptyText">emptyText</a>, <a href="#p-increment">increment</a>, <a href="#p-inputField">inputField</a>, <a href="#p-textbox.label">label</a>, <a href="#p-max">max</a>, <a href="#p-maxLength">maxLength</a>, <a href="#p-min">min</a>, <a href="#p-placeholder">placeholder</a>, <a href="#p-readOnly">readOnly</a>, <a href="#p-searchButton">searchButton</a>, <a href="#p-selectionEnd">selectionEnd</a>, <a href="#p-selectionStart">selectionStart</a>, <a href="#p-size">size</a>, <a href="#p-spinButtons">spinButtons</a>, <a href="#p-tabIndex">tabIndex</a>, <a href="#p-textLength">textLength</a>, <a href="#p-timeout">timeout</a>, <a href="#p-type">type</a>, <a href="#p-textbox.value">value</a>, <a href="#p-valueNumber">valueNumber</a>, <a href="#p-wrapAround">wrapAround</a></dd>
-</dl>
-<dl>
- <dt>
- Methods</dt>
- <dd>
- <a href="#m-decrease">decrease</a>, <a href="#m-increase">increase</a>, <a href="#m-reset">reset</a>, <a href="#m-select">select</a>, <a href="#m-setSelectionRange">setSelectionRange</a></dd>
-</dl>
-<dl>
- <dt>
- Style classes</dt>
- <dd>
- <a href="#s-plain">plain</a></dd>
-</dl>
-<h3 id="Examples" name="Examples">Examples</h3>
-<div class="float-right">
- <img alt="Image:XUL_ref_textbox.png" class="internal" src="/@api/deki/files/471/=XUL_ref_textbox.png"></div>
-<pre>&lt;vbox&gt;
-&lt;label control="your-name" value="Enter your name:"/&gt;
-&lt;textbox id="your-name" value="John"/&gt;
-&lt;/vbox&gt;
-</pre>
-<h3 id="Attributes" name="Attributes">Attributes</h3>
-<p> </p><div id="a-cols">
-
-
-<dl>
- <dt><code id="a-cols"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/cols">cols</a></code></dt>
- <dd>Type: <em>integer</em></dd>
- <dd>For multiline textboxes, the number of columns to display.</dd>
-</dl>
-</div> <div id="a-decimalplaces">
-
-
-<dl>
- <dt><code id="a-decimalplaces"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/decimalplaces">decimalplaces</a></code> </dt>
- <dd>Type: <em>integer</em></dd>
- <dd>The number of decimal places to display. The default is 0, which doesn't show any decimal places. The value <code>Infinity</code> may be used if you want no limit on the number of decimal places. Note that decimal numbers are stored as floats.</dd>
-</dl>
-</div> <div id="a-disabled">
-
-
-<dl>
- <dt><code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code></dt>
- <dd> </dd>
- <dd>
- <h5 id="类型boolean">类型:<em>boolean</em></h5>
- </dd>
- <dd>
- <h5 id="表示元素是被禁用的。">表示元素是被禁用的。</h5>
-
- <p>如果这个元素的disabled属性被设置为true,表示元素被禁用,被禁用的属性在页面上通常会显示灰色文本,它无法响应用户的操作,它也无法得到光标。</p>
-
- <p>然而,这个元素仍然能够响应鼠标事件,如果要启用这个元素,把disabled设置为false</p>
- </dd>
-</dl>
-
-<h4 id="示例:">示例:</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_attr_disabled.png" src="https://mdn.mozillademos.org/files/1742/XUL_ref_attr_disabled.png"></div>
-
-<pre><code>// Disabling an element
-document.getElementById('buttonRemove').setAttribute("disabled", "true");
-
-// Enabling back an element by removing the "disabled" attribute
-document.getElementById('buttonRemove').removeAttribute("disabled");</code></pre>
-
-<p></p><div class="blockIndicator standardNote standardNoteBlock">
- <p><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Firefox/Releases/3.5">Firefox 3.5 note</a></p>
- <p style="font-weight: 400;">For <a href="https://developer.mozilla.org/en-US/docs/XUL/keyset" title="en/XUL/Keyset"><code>keyset</code></a> elements, support for this attribute was added in Firefox 3.5.</p>
-</div><p></p>
-</div> <div id="a-emptytext">
-
-
-<dl>
- <dt><code id="a-emptytext"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/emptytext">emptytext</a></code> <span class="inlineIndicator deprecated deprecatedInline" title="(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)">Deprecated since Gecko 2</span></dt>
- <dd>Type: <em>string</em></dd>
- <dd>A string that appears in the textbox when it has no value. This is superseded by the <code id="a-placeholder"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/placeholder">placeholder</a></code> attribute in Gecko 2.0. The old name is retained for compatibility, but you should update your code.</dd>
-</dl>
-</div> <div id="a-hidespinbuttons">
-
-
-<dl>
- <dt><code id="a-hidespinbuttons"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/hidespinbuttons">hidespinbuttons</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>If <code>true</code>, the number box does not have arrow buttons next to it to allow the user to adjust the value. The value may still be adjusted with the keyboard. The default value is <code>false</code>.</dd>
-</dl>
-</div> <div id="a-increment">
-
-<dl>
- <dt>
- <code id="a-increment"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/increment">increment</a></code></dt>
- <dd>
- 类型:整数</dd>
- <dd>
- 拖动刻度条控件(<code>scale</code>元素)中的拉杆,点击滚动条控件(<code>scrollbar</code>元素)中的箭头(拖动拉杆也可以),点击数字输入框(<code>type</code>属性为<code>number</code>的<code>textbox</code>元素)中的箭头时,其<code id="a-curpos"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/curpos">curpos</a></code>属性或者value属性每次改变的数字值,默认值为1.</dd>
-</dl>
-</div> <div id="a-textbox.label">
-
-
-<dl>
- <dt><code id="a-textbox.label"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/textbox.label">label</a></code> </dt>
- <dd>Type: <em>string</em></dd>
- <dd>If present and not empty, this will be exposed to screen readers through the <a href="/en/XUL/Property/textbox.label" title="en/XUL/Property/textbox.label">label</a> property.</dd>
-</dl>
-</div> <div id="a-max">
-
-<dl>
- <dd>
- 类型:整数</dd>
- <dd>
- 设置刻度条控件(scale元素)或者数字输入框控件(type属性为number的textbox元素)中能输入的最大数字.刻度条控件中,该属性的默认值为100,数字输入框中,该属性的默认值为无穷大.</dd>
-</dl>
-
-<p> </p>
-</div> <div id="a-maxlength">
-
-
-<dl>
- <dt><code id="a-maxlength"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/maxlength">maxlength</a></code></dt>
- <dd>Type: <em>integer</em></dd>
- <dd>The maximum number of characters that the textbox allows to be entered.</dd>
-</dl>
-</div> <div id="a-min">
-
-<dl>
- <dt>
- <code id="a-min"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/min">min</a></code></dt>
- <dd>
- 类型:整数</dd>
- <dd>
- 该控件可以有的最小的整数值,默认值为0.</dd>
-</dl>
-<p> </p>
-</div> <div id="a-multiline">
-
-
-<dl>
- <dt><code id="a-multiline"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/multiline">multiline</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>If <code>true</code>, the textbox displays multiple lines. If the user presses Enter, a new line is started. If <code>false</code>, the textbox only allows entry of one line.</dd>
-</dl>
-</div> <div id="a-newlines">
-
-
-<dl>
- <dt><code id="a-newlines"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/newlines">newlines</a></code></dt>
- <dd>Type: <em>one of the values below</em></dd>
- <dd>How the text box handles pastes with newlines in them.</dd>
- <dd>Possible values:
- <dl>
- <dt><code>pasteintact</code></dt>
- <dd>Paste newlines unchanged</dd>
- <dt><code>pastetofirst</code></dt>
- <dd>Paste text up to the first newline, dropping the rest of the text</dd>
- <dt><code>replacewithcommas</code></dt>
- <dd>Pastes the text with the newlines replaced with commas</dd>
- <dt><code>replacewithspaces</code></dt>
- <dd>Pastes the text with newlines replaced with spaces</dd>
- <dt><code>strip</code></dt>
- <dd>Pastes the text with the newlines removed</dd>
- <dt><code>stripsurroundingwhitespace</code></dt>
- <dd>Pastes the text with newlines and adjacent whitespace removed</dd>
- </dl>
- </dd>
-</dl>
-</div> <div id="a-textbox.onchange">
-
-
-<dl>
- <dt><code id="a-textbox.onchange"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/textbox.onchange">onchange</a></code></dt>
- <dd>Type: <em>script code</em></dd>
- <dd>This event is sent when the value of the textbox is changed. The event is not sent until the focus is moved to another element.</dd>
-</dl>
-
-
-</div> <div id="a-oninput">
-
-
-<dl>
- <dt><code id="a-oninput"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/oninput">oninput</a></code></dt>
- <dd>Type: <em>script code</em></dd>
- <dd>This event is sent when a user enters text in a <code><a href="/en-US/docs/Mozilla/Tech/XUL/textbox" title="textbox">textbox</a></code>. This event is only called when the text displayed would change, thus it is not called when the user presses non-displayable keys.</dd>
-</dl>
-
-
-</div> <div id="a-placeholder">
-
-
-<dl>
- <dt><code id="a-placeholder"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/placeholder">placeholder</a></code> </dt>
- <dd>Type: <em>string</em></dd>
- <dd>A string that appears in the textbox when it has no value.</dd>
-</dl>
-</div> <div id="a-preference">
-
-
-<dl>
- <dt><code id="a-preference"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/preference">preference</a></code></dt>
- <dd>Type: <em>id</em></dd>
- <dd>Connects the element to a corresponding <code><a href="/en-US/docs/Mozilla/Tech/XUL/preference" title="preference">preference</a></code>. This attribute only has any effect when used inside a <code><a href="/en-US/docs/Mozilla/Tech/XUL/prefwindow" title="prefwindow">prefwindow</a></code>. More information is available in the <a href="../../../../en/Preferences_System" rel="internal">Preferences System</a> article.</dd>
-</dl>
-</div> <div id="a-readonly">
-
-
-<dl>
- <dt><code id="a-readonly"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/readonly">readonly</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>If set to <code>true</code>, then the user cannot change the value of the element. However, the value may still be modified by a script.</dd>
-</dl>
-</div> <div id="a-rows">
-
-<dl>
- <dt>
- <code id="a-rows"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/rows">rows</a></code></dt>
- <dd>
- Type: <em>integer</em></dd>
- <dd>
- The number of rows to display in the element. If the element contains more than this number of rows, a scrollbar will appear which the user can use to scroll to the other rows. To get the actual number of rows in the element, use the <span id="m-getRowCount"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/getRowCount">getRowCount</a></code></span> method.</dd>
-</dl>
-</div> <div id="a-searchbutton">
-
-
-<dl>
- <dt><code id="a-searchbutton"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/searchbutton">searchbutton</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>If <code>true</code>, the search field will only fire a command event when the user presses the search button or presses the <code>Enter</code> key. Otherwise, the command event is fired whenever the user modifies the value. This attribute only applies to textboxes with the type <code>search</code>.</dd>
-</dl>
-</div><div id="a-size">
-
-
-<dl>
- <dt><code id="a-size"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/size">size</a></code></dt>
- <dd>Type: <em>integer</em></dd>
- <dd>The number of characters that can be displayed in the textbox.</dd>
-</dl>
-</div> <div id="a-spellcheck">
-
-
-<dl>
- <dt><code id="a-spellcheck"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/spellcheck">spellcheck</a></code> </dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>If <code>true</code>, spell checking is enabled by default for the text box; if <code>false</code>, spell checking is disabled by default.</dd>
- <dd>If not specified, this defaults to <code>false</code></dd>
-</dl>
-
-<p><span style="font-family: Georgia,Times,'Times New Roman',serif; font-size: 1.628em; font-style: inherit; font-variant: inherit; line-height: 1.1em;">The HTML</span></p>
-
-<article style="margin: 0px; padding: 0px; border: 0px; font-family: 'Open Sans', Arial, sans-serif; line-height: 16px; font-size: 16px; vertical-align: baseline; position: relative;">
-<p style="margin: 0px 0px 0.8em; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: 1.6em; vertical-align: baseline;">The <code style="margin: 0px; padding: 2px 7px; border: 0px; font-family: monospace, sans-serif; font-style: inherit; font-variant: inherit; font-weight: bold; line-height: inherit; font-size: 16px; vertical-align: baseline; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px;">spellcheck</code> attribute uses values of true or false (you cannot simply add the spellcheck attribute to a given element):</p>
-
-<pre class="html language-html" style="margin-top: 0.5em; margin-bottom: 0.5em; padding: 1em; border: 0px; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-style: inherit; font-variant: inherit; line-height: 1.6em; font-size: 0.8em; vertical-align: baseline; background-color: rgb(245, 242, 240); color: black; text-shadow: white 0px 1px; direction: ltr;"><code class="language-html" style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Monaco, 'Andale Mono', monospace; font-style: inherit; font-variant: inherit; line-height: inherit; font-size: 13px; vertical-align: baseline; text-shadow: white 0px 1px; direction: ltr;"><span class="comment token" style="border: 0px; color: #708090; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">&lt;!-- spellcheck everything! --&gt;</span>
-<span class="tag token" style="border: 0px; color: #990055; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="tag token" style="border: 0px; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">&lt;</span>input</span> <span class="attr-name token" style="border: 0px; color: #669900; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">type</span><span class="attr-value token" style="border: 0px; color: #0077aa; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">=</span><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"</span>text<span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"</span></span> <span class="attr-name token" style="border: 0px; color: #669900; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">spellcheck</span><span class="attr-value token" style="border: 0px; color: #0077aa; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">=</span><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"</span>true<span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"</span></span> <span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">/&gt;</span></span><span class="tag token" style="border: 0px; color: #990055; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="tag token" style="border: 0px; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">&lt;</span>br</span> <span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">/&gt;</span></span>
-<span class="tag token" style="border: 0px; color: #990055; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="tag token" style="border: 0px; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">&lt;</span>textarea</span> <span class="attr-name token" style="border: 0px; color: #669900; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">spellcheck</span><span class="attr-value token" style="border: 0px; color: #0077aa; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">=</span><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"</span>true<span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"</span></span><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">&gt;</span></span><span class="tag token" style="border: 0px; color: #990055; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="tag token" style="border: 0px; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">&lt;/</span>textarea</span><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">&gt;</span></span>
-<span class="tag token" style="border: 0px; color: #990055; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="tag token" style="border: 0px; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">&lt;</span>div</span> <span class="attr-name token" style="border: 0px; color: #669900; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">contenteditable</span><span class="attr-value token" style="border: 0px; color: #0077aa; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">=</span><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"</span>true<span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"</span></span> <span class="attr-name token" style="border: 0px; color: #669900; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">spellcheck</span><span class="attr-value token" style="border: 0px; color: #0077aa; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">=</span><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"</span>true<span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"</span></span><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">&gt;</span></span>I am some content<span class="tag token" style="border: 0px; color: #990055; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="tag token" style="border: 0px; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">&lt;/</span>div</span><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">&gt;</span></span>
-
-<span class="comment token" style="border: 0px; color: #708090; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">&lt;!-- spellcheck nothing! --&gt;</span>
-<span class="tag token" style="border: 0px; color: #990055; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="tag token" style="border: 0px; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">&lt;</span>input</span> <span class="attr-name token" style="border: 0px; color: #669900; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">type</span><span class="attr-value token" style="border: 0px; color: #0077aa; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">=</span><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"</span>text<span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"</span></span> <span class="attr-name token" style="border: 0px; color: #669900; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">spellcheck</span><span class="attr-value token" style="border: 0px; color: #0077aa; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">=</span><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"</span>false<span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"</span></span> <span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">/&gt;</span></span><span class="tag token" style="border: 0px; color: #990055; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="tag token" style="border: 0px; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">&lt;</span>br</span> <span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">/&gt;</span></span>
-<span class="tag token" style="border: 0px; color: #990055; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="tag token" style="border: 0px; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">&lt;</span>textarea</span> <span class="attr-name token" style="border: 0px; color: #669900; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">spellcheck</span><span class="attr-value token" style="border: 0px; color: #0077aa; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">=</span><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"</span>false<span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"</span></span><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">&gt;</span></span><span class="tag token" style="border: 0px; color: #990055; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="tag token" style="border: 0px; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">&lt;/</span>textarea</span><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">&gt;</span></span>
-<span class="tag token" style="border: 0px; color: #990055; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="tag token" style="border: 0px; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">&lt;</span>div</span> <span class="attr-name token" style="border: 0px; color: #669900; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">contenteditable</span><span class="attr-value token" style="border: 0px; color: #0077aa; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">=</span><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"</span>true<span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"</span></span> <span class="attr-name token" style="border: 0px; color: #669900; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">spellcheck</span><span class="attr-value token" style="border: 0px; color: #0077aa; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">=</span><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"</span>false<span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">"</span></span><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">&gt;</span></span>I am some content<span class="tag token" style="border: 0px; color: #990055; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="tag token" style="border: 0px; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">&lt;/</span>div</span><span class="punctuation token" style="border: 0px; color: #999999; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">&gt;</span></span></code></pre>
-
-<p style="margin: 0px 0px 0.8em; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: 1.6em; vertical-align: baseline;">You can use spellcheck on <code style="margin: 0px; padding: 2px 7px; border: 0px; font-family: monospace, sans-serif; font-style: inherit; font-variant: inherit; font-weight: bold; line-height: inherit; font-size: 16px; vertical-align: baseline; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px;">INPUT</code>, <code style="margin: 0px; padding: 2px 7px; border: 0px; font-family: monospace, sans-serif; font-style: inherit; font-variant: inherit; font-weight: bold; line-height: inherit; font-size: 16px; vertical-align: baseline; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px;">TEXTAREA</code>, and <code style="margin: 0px; padding: 2px 7px; border: 0px; font-family: monospace, sans-serif; font-style: inherit; font-variant: inherit; font-weight: bold; line-height: inherit; font-size: 16px; vertical-align: baseline; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px;">contenteditable</code> elements.  The<code style="margin: 0px; padding: 2px 7px; border: 0px; font-family: monospace, sans-serif; font-style: inherit; font-variant: inherit; font-weight: bold; line-height: inherit; font-size: 16px; vertical-align: baseline; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px;">spellcheck</code> attribute works well paired with the <font face="inherit"><span style="font-style: inherit; font-variant: inherit; line-height: inherit;">autocomplete, autocapitalize, and autocorrect attributes</span></font> too!</p>
-
-<p style="margin: 0px 0px 0.8em; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant: inherit; line-height: 1.6em; vertical-align: baseline;">Added from David Walsh's article on <a href="http://davidwalsh.name/spellcheck">Spell Check</a>.</p>
-</article>
-</div> <div id="a-tabindex">
-
-
-<dl>
- <dt><code id="a-tabindex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tabindex">tabindex</a></code></dt>
- <dd>Type:<em>integer</em></dd>
- <dd>当用户按下 "<kbd>tab</kbd>" 键时焦点移动到元素上的顺序。<code>tabindex</code> 数字越大,顺序越靠后。</dd>
-</dl>
-
-
-
-<p></p>
-</div> <div id="a-timeout">
-
-
-<dl>
- <dt><code id="a-timeout"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/timeout">timeout</a></code></dt>
- <dd>Type: <em>integer</em></dd>
- <dd>For autocomplete textboxes, the number of milliseconds before the textbox starts searching for completions. The default is 50 milliseconds. For search textboxes, the number of milliseconds before the timer fires a command event. The default is 500 milliseconds. For timed textboxes, the number of milliseconds before the timer fires a command event. There is no default. The timer starts after the user types a character. If the user types another character, the timer resets.</dd>
-</dl>
-</div> <div id="a-textbox.type">
-
-
-<dl>
- <dt><code id="a-textbox.type"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/textbox.type">type</a></code></dt>
- <dd>Type: <em>one of the values below</em></dd>
- <dd>You can set the type attribute to one of the values below for a more specialized type of textbox. Don't set the type if you wish to use a regular textbox.</dd>
- <dd>
- <dl>
- <dt><code>autocomplete</code></dt>
- <dd>A textbox that supports autocomplete. For more information about autocomplete textboxes, see the autocomplete documentation (<a href="/En/XUL/Textbox_(XPFE_autocomplete)" title="En/XUL/Textbox (XPFE autocomplete)">XPFE</a> [Thunderbird/SeaMonkey]) (<a href="/En/XUL/Textbox_(Toolkit_autocomplete)" title="en/XUL/textbox_(Firefox_autocomplete)">Firefox</a>)</dd>
- <dt><code>number</code></dt>
- <dd> A textbox that only allows the user to enter numbers. In addition, arrow buttons appear next to the textbox to let the user step through values. There are several attributes that allow the number textbox to be configured, including <code id="a-decimalplaces"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/decimalplaces">decimalplaces</a></code>, <code id="a-min"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/min">min</a></code>, <code id="a-max"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/max">max</a></code>, <code id="a-increment"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/increment">increment</a></code>, <code id="a-wraparound"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/wraparound">wraparound</a></code>, <code id="a-hidespinbuttons"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/hidespinbuttons">hidespinbuttons</a></code>, and <code id="a-textbox.value"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/textbox.value">textbox.value</a></code>.</dd>
- <dt><code>password</code></dt>
- <dd>A textbox that hides what is typed, used for entering passwords.</dd>
- <dt><code>search</code></dt>
- <dd> A textbox intended for searching. The command event will fire as the user modifies the value. A listener for the command event should update search results. If the <code id="a-searchbutton"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/searchbutton">searchbutton</a></code> attribute is set to <code>true</code>, the command event is only fired if the user presses the search button or presses the <code>Enter </code>key. You may specify grey text to appear when the search box is empty using the <code id="a-emptytext"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/emptytext">emptytext</a></code> attribute, and a timeout may be set for the command event using the <code id="a-timeout"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/timeout">timeout</a></code> attribute (defaults to 500).</dd>
- <dt><code>timed</code></dt>
- <dd><span title="This deprecated API should no longer be used, but will probably still work."><i class="icon-thumbs-down-alt"> </i></span> This textbox will fire a command event after the user types characters and a certain time has passed. The delay is set with the <code id="a-timeout"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/timeout">timeout</a></code> attribute. The command event will fire if the user presses the <code>Enter </code>key. The <code>timed</code> type is deprecated in Gecko 1.9.1 and the <code>search</code> textbox may be used instead.</dd>
- </dl>
- </dd>
-</dl>
-
-
-</div> <div id="a-textbox.value">
-
-
-<dl>
- <dt><code id="a-textbox.value"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/textbox.value">value</a></code></dt>
- <dd>Type: <em>string</em></dd>
- <dd>The default value entered in a textbox. The attribute only holds the default value and is never modified when the user enters text. To get the updated value, use the <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/value">value</a></span></code> property. For number boxes, the default is 0 or the minimum value returned by the <code>min</code> property, whichever is higher.</dd>
-</dl>
-
-
-</div> <div id="a-wrap">
-
-
-<dl>
- <dt><code id="a-wrap"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/wrap">wrap</a></code></dt>
- <dd>Type: <em>string</em></dd>
- <dd>Set this attribute to the value <code>off</code> to disable word wrapping in the textbox. If this attribute is not specified, word wrapping is enabled.</dd>
-</dl>
-</div> <div id="a-wraparound">
-
-
-<dl>
- <dt><code id="a-wraparound"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/wraparound">wraparound</a></code> </dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>If <code>true</code>, the value of the number box will wrap around when the maximum or minimum value is exceeded. The minimum and maximum values must both not be infinity.</dd>
-</dl>
-</div><p></p>
-<h3 id="Properties" name="Properties">Properties</h3>
-<p> </p><div id="p-accessibleType">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessibleType">accessibleType</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- A value indicating the type of accessibility object for the element.</dd>
-</dl>
-
-<p></p></div> <div id="p-clickSelectsAll">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/clickSelectsAll">clickSelectsAll</a></span></code></dt>
- <dd>
- Type: <em>boolean</em></dd>
- <dd>
- If set to <code>true</code>, the contents of the textbox are selected when focused; otherwise, the cursor is left unchanged.</dd>
-</dl></div> <div id="p-decimalPlaces">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/decimalPlaces">decimalPlaces</a></span></code></dt>
- <dd>
- Type: <em>integer</em></dd>
- <dd>
- Gets and sets the value of the <code id="a-decimalplaces"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/decimalplaces">decimalplaces</a></code> attribute.</dd>
-</dl></div> <div id="p-decimalSymbol">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/decimalSymbol">decimalSymbol</a></span></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- The character used for the decimal place indicator. The default value is a period (.)</dd>
-</dl></div> <div id="p-defaultValue">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/defaultValue">defaultValue</a></span></code> </dt>
- <dd>
- 类型: 字符串</dd>
- <dd>
- 获取或设置一个<code>textbox</code>元素中显示的默认值.</dd>
-</dl></div> <div id="p-disabled">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/disabled">disabled</a></span></code></dt>
- <dd>
- Type:
- <i>
- boolean</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-editor">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/editor">editor</a></span></code></dt>
- <dd>Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIEditor" title="">nsIEditor</a></code></em></dd>
- <dd>A reference to the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIEditor" title="">nsIEditor</a></code> for editable text. This property is read only.</dd>
-</dl></div> <div id="p-emptyText">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/emptyText">emptyText</a></span></code> <span class="inlineIndicator deprecated deprecatedInline" title="(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)">Deprecated since Gecko 2</span></dt>
- <dd>Type: <em>string</em></dd>
- <dd>Gets and sets a string that appears in the textbox when it has no value. This is superseded by the  <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/placeholder">placeholder</a></span></code> property in Gecko 2.0. The old name is retained for compatibility, but you should update your code.</dd>
-</dl></div> <div id="p-increment">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/increment">increment</a></span></code></dt>
- <dd>
- Type: <em>integer</em></dd>
- <dd>
- Gets and sets the value of the <code id="a-increment"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/increment">increment</a></code> attribute.</dd>
-</dl></div> <div id="p-inputField">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/inputField">inputField</a></span></code></dt>
- <dd>Type: <em>textbox element</em></dd>
- <dd>In Mozilla, the XUL textbox is implemented as a wrapper around an HTML input element. This read only property holds a reference to this inner input element.</dd>
-</dl></div> <div id="p-textbox.label">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/textbox.label">label</a></span></code></dt>
- <dd>Type: <em>string</em></dd>
- <dd>Sets the <code id="a-textbox.label"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/textbox.label">label</a></code> attribute. Gets the <code id="a-textbox.label"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/textbox.label">label</a></code> attribute if it is present and not empty. Otherwise it returns the <code id="a-label.value"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/label.value">value</a></code> of the associated <code><a href="/en-US/docs/Mozilla/Tech/XUL/label" title="label">label</a></code> element, if applicable. Otherwise it returns the <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/placeholder">placeholder</a></span></code> or <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/emptyText">emptyText</a></span></code> property. The getter is mostly useful for screen readers.
- <div class="blockIndicator note">
- <p><strong>Note:</strong> Prior to Firefox 3, and always in Thunderbird and SeaMonkey, the label property of an autocomplete textbox returns its value, for compatibility with the <code><a href="/en-US/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code> element.</p>
- </div>
- </dd>
-</dl></div> <div id="p-max">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/max">max</a></span></code></dt>
- <dd>
- 类型:整数</dd>
- <dd>
- 获取或设置<code id="a-max"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/max">max</a></code>特性(attribute)的值.</dd>
-</dl></div> <div id="p-maxLength">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/maxLength">maxLength</a></span></code></dt>
- <dd>Type: <em>integer</em></dd>
- <dd>The maximum number of characters that the textbox allows to be entered.</dd>
-</dl></div> <div id="p-min">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/min">min</a></span></code></dt>
- <dd>
- Type: <em>integer</em></dd>
- <dd>
- Gets and sets the value of the <code id="a-min"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/min">min</a></code> attribute.</dd>
-</dl></div> <div id="p-placeholder">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/placeholder">placeholder</a></span></code> </dt>
- <dd>Type: <em>string</em></dd>
- <dd>Gets and sets a string that appears in the textbox when it has no value.</dd>
-</dl></div> <div id="p-readOnly">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/readOnly">readOnly</a></span></code></dt>
- <dd>
- Type: <em>boolean</em></dd>
- <dd>
- If set to <code>true</code>, then the user cannot modify the value of the element.</dd>
-</dl></div> <div id="p-searchButton">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/searchButton">searchButton</a></span></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>Gets and sets the value of the <code id="a-searchbutton"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/searchbutton">searchbutton</a></code> attribute.</dd>
-</dl></div> <div id="p-selectionEnd">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/selectionEnd">selectionEnd</a></span></code></dt>
- <dd>Type: <em>integer</em></dd>
- <dd>Get or set the end of the selected portion of the field's text. Use in conjuction with the <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/selectionStart">selectionStart</a></span></code> property. The value specifies the index of the character after the selection. If this value is equal to the value of the <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/selectionStart">selectionStart</a></span></code> property, no text is selected, but the value indicates the position of the caret (cursor) within the textbox.</dd>
-</dl></div> <div id="p-selectionStart">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/selectionStart">selectionStart</a></span></code></dt>
- <dd>Type: <em>integer</em></dd>
- <dd>Get or set the beginning of the selected portion of the field's text. Use in conjuction with the <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/selectionEnd">selectionEnd</a></span></code> property. The value specifies the index of the first selected character.</dd>
-</dl></div> <div id="p-size">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/size">size</a></span></code></dt>
- <dd>Type: <em>integer</em></dd>
- <dd>Gets and sets the value of the <code id="a-size"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/size">size</a></code> attribute.</dd>
-</dl></div> <div id="p-spinButtons">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/spinButtons">spinButtons</a></span></code></dt>
- <dd>
- 类型:<code><a href="/zh-CN/docs/Mozilla/Tech/XUL/spinbuttons" title="spinbuttons">spinbuttons</a></code>元素</dd>
- <dd>
- 一个只读属性,返回了数字输入框元素(<code>type</code>属性为<code>number的textbox元素</code>)中包含的<code><a href="/zh-CN/docs/Mozilla/Tech/XUL/spinbuttons" title="spinbuttons">spinbuttons</a></code>元素(也就是右侧调整数字大小的上下小箭头).</dd>
-</dl></div> <div id="p-tabIndex">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tabIndex">tabIndex</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-tabindex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tabindex">tabindex</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-textLength">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/textLength">textLength</a></span></code></dt>
- <dd>Type: <em>integer</em></dd>
- <dd>Holds the length of the text entered in the textbox. This property is read-only.</dd>
-</dl></div> <div id="p-timeout">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/timeout">timeout</a></span></code></dt>
- <dd>Type: <em>integer</em></dd>
- <dd>Gets and sets the value of the <code id="a-timeout"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/timeout">timeout</a></code> attribute.</dd>
-</dl></div> <div id="p-type">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/type">type</a></span></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- Gets and sets the value of the <code id="a-type"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/type">type</a></code> attribute.</dd>
-</dl>
-</div> <div id="p-textbox.value">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/textbox.value">value</a></span></code></dt>
- <dd>
- 类型:字符串</dd>
- <dd>
- 读取或设置该<code>textbox</code>元素中的文本内容.</dd>
-</dl></div> <div id="p-valueNumber">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/valueNumber">valueNumber</a></span></code></dt>
- <dd>
- Type: <em>number</em></dd>
- <dd>
- In contrast to the <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/value">value</a></span></code> property which holds a string representation, the <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/valueNumber">valueNumber</a></span></code> property is a number containing the current value of the number box.</dd>
-</dl></div> <div id="p-wrapAround">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/wrapAround">wrapAround</a></span></code></dt>
- <dd>
- Type: <em>boolean</em></dd>
- <dd>
- Gets and sets the value of the <code id="a-wraparound"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/wraparound">wraparound</a></code> attribute.</dd>
-</dl></div><p></p>
-<h3 id="Methods" name="Methods">Methods</h3>
-<p></p><dl>
- <dt>
- <span id="m-decrease"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/decrease">decrease()</a></code></span></dt>
- <dd>
- Return type: <em>no return value</em></dd>
- <dd>
- Decreases the value of the scale or number box by the <code id="a-increment"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/increment">increment</a></code>.</dd>
-</dl> <dl>
- <dt>
- <span id="m-increase"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/increase">increase()</a></code></span></dt>
- <dd>
- 返回值类型: 无返回值</dd>
- <dd>
- 增大刻度条控件(scale元素)或者数字输入框控件(type属性为number的textbox元素)中的数字值(按照其<code id="a-increment"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/increment">increment</a></code>属性指定的值).</dd>
-</dl> <dl>
- <dt>
- <span id="m-reset"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/reset">reset()</a></code></span></dt>
- <dd>
- 返回值:无返回值</dd>
- <dd>
- 将用户偏好重置为默认值.</dd>
-</dl> <dl>
- <dt>
- <span id="m-select"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/select">select()</a></code></span></dt>
- <dd>
- Return type: <em>no return value</em></dd>
- <dd>
- Selects all the text in the textbox.</dd>
-</dl> <dl>
- <dt>
- <span id="m-setSelectionRange"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/setSelectionRange">setSelectionRange( start, end )</a></code></span></dt>
- <dd>
- Return type: <em>no return value</em></dd>
- <dd>
- Sets the selected portion of the textbox, where the <var>start</var> argument is the index of the first character to select and the <var>end</var> argument is the index of the character after the selection. Set both arguments to the same value to move the cursor to the corresponding position without selecting text.</dd>
-</dl> <table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited from XUL element</strong><br> <small> <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span></small></p> <p><strong>Inherited from DOM element</strong><br> <small> <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Style_classes" name="Style_classes">Style classes</h3>
-<p>The following classes may be used to style the element. These classes should be used instead of changing the style of the element directly since they will fit more naturally with the user's selected theme.</p>
-<p></p><dl>
- <dt><code><a href="https://developer.mozilla.org/en-US/docs/XUL/Style/plain">plain</a></code></dt>
- <dd>This class causes the element to be displayed with no border or margin.</dd>
-</dl><p></p>
-<h3 id="Notes">Notes</h3>
-<p>The <code>maxlength</code> attribute does not work when in multiline mode. A workaround using JavaScript and the <code>onkeypress</code> event handler as shown in abstract below may be your solution.</p>
-<p>The XUL script:</p>
-<pre class="deki-transform">&lt;textbox id="pnNote" multiline="true" rows="2" cols="70" onkeypress="return pnCountNoteChars(event);"/&gt;
-</pre>
-<p>The Javascript:</p>
-<pre class="deki-transform">function pnCountNoteChars(evt) {
-    //allow non character keys (delete, backspace and and etc.)
-    if ((evt.charCode == 0) &amp;&amp; (evt.keyCode != 13))
-      return true;
-
-    if(evt.target.value.length &lt; 10) {
-        return true;
-    } else {
-        return false;
-    }
-}</pre>
-<h3 id="Related" name="Related">Related</h3>
-<dl>
- <dt>
- Interfaces</dt>
- <dd>
- <a href="/en/XPCOM_Interface_Reference/nsIAccessibleProvider" title="en/nsIAccessibleProvider">nsIAccessibleProvider</a>, <a href="/en/NsIDOMXULTextboxElement" title="en/NsIDOMXULTextboxElement">nsIDOMXULTextboxElement</a></dd>
-</dl>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/toolbarpalette/index.html b/files/zh-cn/mozilla/tech/xul/toolbarpalette/index.html
deleted file mode 100644
index 7df0ea3483..0000000000
--- a/files/zh-cn/mozilla/tech/xul/toolbarpalette/index.html
+++ /dev/null
@@ -1,103 +0,0 @@
----
-title: toolbarpalette
-slug: Mozilla/Tech/XUL/toolbarpalette
-translation_of: Archive/Mozilla/XUL/toolbarpalette
----
-<div class="noinclude">
- <span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-<p><strong><span class="highlightred">Firefox only</span></strong></p>
-<p>The item is a palette of available <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbar" title="toolbar">toolbar</a></code> items. It is not displayed, but is used by the toolbar customization dialog to display the list of items. The children of the <code>toolbarpalette</code> should be the complete list of <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbarbutton" title="toolbarbutton">toolbarbutton</a></code>s and <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbaritem" title="toolbaritem">toolbaritem</a></code>s that can be added to the toolbar. Do not add the various spacing items, as those are added automatically.</p>
-<p>这个控件(item不知道是不是这个意思,下同)是一个调色板控件,它不会显示出来,但是是被工具栏用来个性化对话框从而显示控件列表的。toolbarpalette的子类应该是一个可以被添加入工具栏toolbarbutton和toolbaritem的完整列表。不要加入spacing items,因为它们是被自动添加的。</p>
-<p>You can add your own custom buttons to the Firefox browser by using an <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/overlay" title="overlay">overlay</a></code> that overlays the <code>toolbarpalette</code> with the <code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code><code>BrowserToolbarPalette</code>.</p>
-<p>你可以通过overlay来向火狐浏览器添加个性化的按钮,这是通过用BrowserToolbarPalette覆盖toolbarpalette实现的</p>
-<p>不过个人感觉这个palette好像不怎么用</p>
-<h3 id="Examples" name="Examples">Examples(实例)</h3>
-<pre class="eval">&lt;toolbarpalette id="BrowserToolbarPalette"&gt;
- &lt;toolbarbutton id="toolbarpalette-button"
- class="toolbarbutton-class"
- label="&amp;mylabel;"
- tooltiptext="&amp;mytiptext;"
- oncommand="somefunction()"/&gt;
-&lt;/toolbarpalette&gt;
-</pre>
-<h3 id="Attributes" name="Attributes">Attributes</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0 0 10px 10px; padding: 0 10px; background: rgb(238, 238, 238);">
-<tbody>
-<tr>
-<td><p><strong>Inherited from XUL element</strong><br> <small>
-<code id="a-align"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/align">align</a></code>,
-<code id="a-allowevents"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/allowevents">allowevents</a></code>,
-<code id="a-allownegativeassertions"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/allownegativeassertions">allownegativeassertions</a></code>,
-<code id="a-class"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/class">class</a></code>,
-<code id="a-coalesceduplicatearcs"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/coalesceduplicatearcs">coalesceduplicatearcs</a></code>,
-<code id="a-collapsed"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/collapsed">collapsed</a></code>,
-<code id="a-container"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/container">container</a></code>,
-<code id="a-containment"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/containment">containment</a></code>,
-<code id="a-context"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/context">context</a></code>,
-<code id="a-contextmenu"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/contextmenu">contextmenu</a></code>,
-<code id="a-datasources"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/datasources">datasources</a></code>,
-<code id="a-dir"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/dir">dir</a></code>,
-<code id="a-empty"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/empty">empty</a></code>,
-<code id="a-equalsize"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/equalsize">equalsize</a></code>,
-<code id="a-flags"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/flags">flags</a></code>,
-<code id="a-flex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/flex">flex</a></code>,
-<code id="a-height"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/height">height</a></code>,
-<code id="a-hidden"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/hidden">hidden</a></code>,
-<code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code>,
-<code id="a-insertafter"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/insertafter">insertafter</a></code>,
-<code id="a-insertbefore"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/insertbefore">insertbefore</a></code>,
-<code id="a-left"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/left">left</a></code>,
-<code id="a-maxheight"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/maxheight">maxheight</a></code>,
-<code id="a-maxwidth"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/maxwidth">maxwidth</a></code>,
-<code id="a-menu"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/menu">menu</a></code>,
-<code id="a-minheight"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/minheight">minheight</a></code>,
-<code id="a-minwidth"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/minwidth">minwidth</a></code>,
-<code id="a-mousethrough"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/mousethrough">mousethrough</a></code>,
-<code id="a-observes"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/observes">observes</a></code>,
-<code id="a-ordinal"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/ordinal">ordinal</a></code>,
-<code id="a-orient"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/orient">orient</a></code>,
-<code id="a-pack"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/pack">pack</a></code>,
-<code id="a-persist"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/persist">persist</a></code>,
-<code id="a-popup"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/popup">popup</a></code>,
-<code id="a-position"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/position">position</a></code>,
-<code id="a-preference-editable"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/preference-editable">preference-editable</a></code>,
-<code id="a-querytype"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/querytype">querytype</a></code>,
-<code id="a-ref"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/ref">ref</a></code>,
-<code id="a-removeelement"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/removeelement">removeelement</a></code>,
-<code id="a-sortDirection"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/sortDirection">sortDirection</a></code>,
-<code id="a-sortResource"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/sortResource">sortResource</a></code>,
-<code id="a-sortResource2"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/sortResource2">sortResource2</a></code>,
-<code id="a-statustext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/statustext">statustext</a></code>,
-<code id="a-style"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/style">style</a></code>,
-<code id="a-template"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/template">template</a></code>,
-<code id="a-tooltip"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tooltip">tooltip</a></code>,
-<code id="a-tooltiptext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tooltiptext">tooltiptext</a></code>,
-<code id="a-top"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/top">top</a></code>,
-<code id="a-uri"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/uri">uri</a></code>,
-<code id="a-wait-cursor"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/wait-cursor">wait-cursor</a></code>,
-<code id="a-width"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/width">width</a></code> </small></p>
-</td>
-</tr>
-</tbody>
-</table><p></p>
-<h3 id="Properties" name="Properties">Properties</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited Properties</strong><br> <small> <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/align">align</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/allowEvents">allowEvents</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/boxObject">boxObject</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/builder">builder</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/className">className</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/collapsed">collapsed</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/contextMenu">contextMenu</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/controllers">controllers</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/database">database</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/datasources">datasources</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/dir">dir</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/flex">flex</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/height">height</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/hidden">hidden</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/id">id</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/left">left</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/maxHeight">maxHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/maxWidth">maxWidth</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/menu">menu</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/minHeight">minHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/minWidth">minWidth</a></span></code>, , , , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/observes">observes</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/ordinal">ordinal</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/orient">orient</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/pack">pack</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/persist">persist</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/ref">ref</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/resource">resource</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/statusText">statusText</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/style">style</a></span></code>, ,, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tooltip">tooltip</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tooltipText">tooltipText</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/top">top</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/width">width</a></span></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Methods" name="Methods">Methods</h3>
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited from XUL element</strong><br> <small> <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span></small></p> <p><strong>Inherited from DOM element</strong><br> <small> <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-<h3 id="Related" name="Related">Related</h3>
-<dl>
- <dt>
- Elements(意思应该是这里面含有的元素吧,看样子既然toolbox都在里面说明这个item还是挺大的)</dt>
- <dd>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbar" title="toolbar">toolbar</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbarbutton" title="toolbarbutton">toolbarbutton</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbargrippy" title="toolbargrippy">toolbargrippy</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbaritem" title="toolbaritem">toolbaritem</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbarseparator" title="toolbarseparator">toolbarseparator</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbarset" title="toolbarset">toolbarset</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbarspacer" title="toolbarspacer">toolbarspacer</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbarspring" title="toolbarspring">toolbarspring</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbox" title="toolbox">toolbox</a></code></dd>
-</dl>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/toolbars/creating_toolbar_buttons/index.html b/files/zh-cn/mozilla/tech/xul/toolbars/creating_toolbar_buttons/index.html
deleted file mode 100644
index 363a3b9e2b..0000000000
--- a/files/zh-cn/mozilla/tech/xul/toolbars/creating_toolbar_buttons/index.html
+++ /dev/null
@@ -1,183 +0,0 @@
----
-title: 添加工具栏按钮 (定制工具栏)
-slug: Mozilla/Tech/XUL/Toolbars/Creating_toolbar_buttons
-translation_of: Archive/Mozilla/XUL/Toolbars/Creating_toolbar_buttons
----
-<p>此文章解释如何使用 <a href="/en/XUL_Overlays" title="en/XUL_Overlays">overlays</a> 为工具包(firefox,Thunderbird 或 Kompozer) 添加工具栏按钮(就是浏览器右上方一系列按钮,home,下载之类的)。适用用户是拥有 <a href="/en/XUL" title="en/XUL">XUL</a> 和 <a href="/en/CSS" title="en/CSS">CSS</a> 基础知识的 <a href="/en/Extensions" title="en/Extensions">扩展</a> 开发人员。</p>
-<p>我们假设您已经会创建基础的火狐插件,并且已经成功创建了 <a href="/en/Building_an_Extension" title="en/Building_an_Extension">Hello World extension</a> ,另外,还有一份更加完全的初学者示例指南,请查看 <a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Toolbars/Custom_toolbar_button" title="en/Custom_Toolbar_Button">自定义工具栏按钮。</a></p>
-<h3 id="Creating_an_overlay" name="Creating_an_overlay">创建一个 overlay</h3>
-<p>The first step is to create an <a href="/en/XUL_Overlays" title="en/XUL_Overlays">overlay</a> for the document containing the toolbar you wish to enhance. Explaining overlays is beyond the scope of this tutorial -- you can read about them in the <a href="/en/XUL_Tutorial/Cross_Package_Overlays" title="en/XUL_Tutorial/Cross_Package_Overlays">XUL Tutorial</a>.</p>
-<p>To overlay a document, you need to know its URI. You can find a list of URIs for the most commonly overlaid documents at the <a href="#A_list_of_commonly_overlayed_windows_with_toolbars">bottom of this page</a>.</p>
-<div class="note">
- <strong>Note:</strong> Some people overlay <span class="nowiki"><code>chrome://messenger/content/mailWindowOverlay.xul</code></span>. That should cause the button to appear on all windows that <code>mailWindowOverlay.xul</code> is applied to (i.e. Main window and View Message window). This needs to be looked into.</div>
-<h3 id="Adding_the_toolbar_button" name="Adding_the_toolbar_button">在工具栏添加按钮</h3>
-<p>Toolkit applications have customizable toolbars; therefore, it's common practice for extensions to add their toolbar buttons to the toolbar palette, rather than adding them directly to the toolbar. The latter is possible but is not recommended and is harder to implement.</p>
-<p>Adding a button to the toolbar palette is very easy. Just add code like this to your overlay:</p>
-<pre>&lt;toolbarpalette id="BrowserToolbarPalette"&gt;
- &lt;toolbarbutton id="myextension-button" class="toolbarbutton-1"
- label="&amp;toolbarbutton.label;" tooltiptext="&amp;toolbarbutton.tooltip;"
- oncommand="MyExtension.onToolbarButtonCommand(event);"/&gt;
-&lt;/toolbarpalette&gt;
-</pre>
-<p>注意:</p>
-<ul>
- <li>The <code>id</code> of the palette (<code>BrowserToolbarPalette</code> in the example) depends on the window whose toolbar you wish to insert a button into. See <a href="#A_list_of_commonly_overlayed_windows_with_toolbars"> below</a> for the list of common palette IDs.</li>
- <li><code>class="toolbarbutton-1"</code> makes the toolbar button appear correctly in Icons and Text mode; it also adjusts padding.</li>
- <li>If you need to handle middle-click, add this line after the oncommand line.</li>
-</ul>
-<pre class="prettyprint language-html"><span class="pln">onclick</span><span class="pun">=</span><span class="str">"checkForMiddleClick(this, event)"</span></pre>
-<ul>
- <li>you can also handle middle-lick and right-click using <code>onclick</code> handler and check <code>event.button</code> in it. like this:</li>
-</ul>
-<pre class="language-html">&lt;toolbarpalette id="BrowserToolbarPalette"&gt;
- &lt;toolbarbutton id="myextension-button" class="toolbarbutton-1"
- label="&amp;toolbarbutton.label;" tooltiptext="&amp;toolbarbutton.tooltip;"
- onclick="MyExtension.onclick(event);"/&gt;
-&lt;/toolbarpalette&gt;</pre>
-<pre>onclick: function(event) {
- switch(event.button) {
- case 0:
- // Left click
- break;
- case 1:
- // Middle click
- break;
- case 2:
- // Right click
- break;
- }
-}
-</pre>
-<p>To add more buttons, put more <code>&lt;toolbarbutton&gt;</code> elements inside the <code>&lt;toolbarpalette&gt;</code> element. Wrap elements other than <code>&lt;toolbarbutton&gt;</code> in <code>&lt;toolbaritem&gt;</code>.</p>
-<h3 id="Styling_the_button" name="Styling_the_button">为按键应用风格</h3>
-<p>Most toolbar buttons have an icon. To attach an image to the button we use standard Mozilla skinning facilities. If you're unfamiliar with how that works, read the <a class="external" href="http://www.borngeek.com/firefox/toolbar-tutorial/" title="http://www.borngeek.com/firefox/toolbar-tutorial/">skinning section of Jonah Bishop's excellent Toolbar Tutorial</a>. Although the article covers creating an entire toolbar, rather than just a button, it has a great explanation of the techniques we'll use here.</p>
-<h4 id="Icon_size" name="Icon_size">图标大小</h4>
-<p>Toolbar buttons can have two different sizes -- big and small. This means you'll need to provide two icons for each of your toolbar buttons. The dimensions of the icons in various applications for both modes are summarized in the following table (feel free to add information about other applications):</p>
-<table>
- <tbody>
- <tr>
- <th>Application (Theme name)</th>
- <th>Big icon size</th>
- <th>Small icon size</th>
- </tr>
- <tr>
- <td>Firefox 1.0 (Winstripe)</td>
- <td>24x24</td>
- <td>16x16</td>
- </tr>
- <tr>
- <td>Thunderbird 1.0 (Qute)</td>
- <td>24x24</td>
- <td>16x16</td>
- </tr>
- </tbody>
-</table>
-<h4 id="The_stylesheet" name="The_stylesheet">CSS 样式表</h4>
-<p>To set the image for your toolbar button, use the following CSS rules:</p>
-<pre>/* skin/toolbar-button.css */
-
-#myextension-button {
- list-style-image: url("chrome://myextension/skin/btn_large.png");
-}
-
-toolbar[iconsize="small"] #myextension-button {
- list-style-image: url("chrome://myextension/skin/btn_small.png");
-}
-</pre>
-<h4 id="Applying_the_stylesheet" name="Applying_the_stylesheet">应用样式表</h4>
-<p>Remember to attach the stylesheet you created to both the overlay file and the Customize Toolbar window. To attach it to the overlay, put this processing instruction (PI) at the top of the overlay file:</p>
-<pre class="eval">&lt;?xml-stylesheet href="<a class="external" rel="freelink">chrome://myextension/skin/toolbar-button.css</a>" type="text/css"?&gt;
-</pre>
-<div class="note">
- <strong>Note:</strong> The CSS file with your toolbar styles needs to be included in the overlay file, as you would expect, but also in the <code>chrome.manifest</code> file. This is very important because the toolbar customization dialog won't work correctly without this.</div>
-<p>To include the style on your chrome.manifest file:</p>
-<pre class="eval">style <a class="external" rel="freelink">chrome://global/content/customizeToolbar.xul</a> <a class="external" rel="freelink">chrome://myextension/skin/toolbar-button.css</a>
-</pre>
-<p>If you are developing for Firefox 1.0, attach it to the Customize Toolbar window (<code><a class="external" rel="freelink">chrome://global/content/customizeToolbar.xul</a></code>) using <code>skin/contents.rdf</code>. The code looks like this:</p>
-<pre>&lt;?xml version="1.0"?&gt;
-&lt;RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:chrome="http://www.mozilla.org/rdf/chrome#"&gt;
-
- &lt;Seq about="urn:mozilla:skin:root"&gt;
- &lt;li resource="urn:mozilla:skin:classic/1.0"/&gt;
- &lt;/Seq&gt;
-
- &lt;Description about="urn:mozilla:skin:classic/1.0"&gt;
- &lt;chrome:packages&gt;
- &lt;Seq about="urn:mozilla:skin:classic/1.0:packages"&gt;
- &lt;li resource="urn:mozilla:skin:classic/1.0:myextension"/&gt;
- &lt;/Seq&gt;
- &lt;/chrome:packages&gt;
- &lt;/Description&gt;
-
- &lt;Seq about="urn:mozilla:stylesheets"&gt;
- &lt;li resource="chrome://global/content/customizeToolbar.xul"/&gt;
- &lt;/Seq&gt;
-
- &lt;Seq about="chrome://global/content/customizeToolbar.xul"&gt;
- &lt;li&gt;chrome://myextension/skin/toolbar-button.css&lt;/li&gt;
- &lt;/Seq&gt;
-&lt;/RDF&gt;
-</pre>
-<p>The <code>skin/contents.rdf</code> file is denigrated in developing for later releases of Firefox. Extensions for Firefox/Thunderbird 1.5 and above should instead use something like this in their <a href="/en/Chrome_Registration" title="en/Chrome_Registration">chrome.manifest</a>:</p>
-<pre class="eval">skin myextension classic/1.0 chrome/skin/
-style <a class="external" rel="freelink">chrome://global/content/customizeToolbar.xul</a> <a class="external" rel="freelink">chrome://myextension/skin/toolbar-button.css</a>
-ia</pre>
-<p>Take note of the <a class="external" href="http://kb.mozillazine.org/Getting_started_with_extension_development#Packaging">Packaging section</a> in this article; you may need to include .jar references if you are delivering your extension as a .xpi file.</p>
-<h3 id="Common_mistakes" name="Common_mistakes">常见错误</h3>
-<p>This is a list of the most common mistakes made by extension authors, including both symptoms and solutions.</p>
-<p><strong>Problem:</strong> The whole set of default buttons is painted on the toolbar or in the Customize Toolbars window, instead of your own icon.</p>
-<p><strong>Caused by:</strong> Malformed or not applied stylesheet.</p>
-<p><strong>Solution:</strong> Check to be sure your stylesheet is correct, make sure your <code>contents.rdf</code> (or <code>chrome.manifest</code>) is correct, and be sure you didn't forget to <a href="#Applying_the_stylesheet">apply the stylesheet</a> to <code>customizeToolbar.xul</code>.</p>
-<h3 id="A_list_of_commonly_overlayed_windows_with_toolbars" name="A_list_of_commonly_overlayed_windows_with_toolbars">常见工具栏的 overlayed windows</h3>
-<table class="fullwidth-table">
- <tbody>
- <tr>
- <th>URL</th>
- <th>Application and affected window(s)</th>
- <th>Palette id</th>
- </tr>
- <tr>
- <td><small><a class="external" rel="freelink">chrome://browser/content/browser.xul</a></small></td>
- <td>Firefox - Main window</td>
- <td>BrowserToolbarPalette</td>
- </tr>
- <tr>
- <td><small><a class="external" rel="freelink">chrome://navigator/content/navigator.xul</a></small></td>
- <td>SeaMonkey 2.0 - Browser window</td>
- <td>BrowserToolbarPalette</td>
- </tr>
- <tr>
- <td><small><a class="external" rel="freelink">chrome://messenger/content/messenger.xul</a></small></td>
- <td>Thunderbird - Main window</td>
- <td>MailToolbarPalette</td>
- </tr>
- <tr>
- <td><small><a class="external" rel="freelink">chrome://messenger/content/messenger...gercompose.xul</a></small></td>
- <td>Thunderbird - Compose window</td>
- <td>MsgComposeToolbarPalette</td>
- </tr>
- <tr>
- <td><small><a class="external" rel="freelink">chrome://messenger/content/addressbo...ddressbook.xul</a></small></td>
- <td>Thunderbird - Address book</td>
- <td>AddressBookToolbarPalette</td>
- </tr>
- <tr>
- <td><small><a class="external" rel="freelink">chrome://editor/content/editor.xul</a></small></td>
- <td>Kompozer - Main window</td>
- <td>NvuToolbarPalette</td>
- </tr>
- <tr>
- <td><small><a class="external" rel="freelink">chrome://calendar/content/calendar.xul</a></small></td>
- <td>Sunbird - Main window</td>
- <td>calendarToolbarPalette</td>
- </tr>
- </tbody>
-</table>
-<h3 id="More_information" name="More_information">更多信息</h3>
-<ul>
- <li>XulPlanet.com references: <a class="external" href="/en/XUL/toolbarbutton" title="https://developer.mozilla.org/en/XUL/toolbarbutton"><code>&lt;toolbarbutton&gt;</code></a>, <a class="external" href="/en/XUL/toolbaritem" title="https://developer.mozilla.org/en/XUL/toolbaritem"><code>&lt;toolbaritem&gt;</code></a>.</li>
- <li><a class="external" href="http://forums.mozillazine.org/viewtopic.php?t=220220">How to adjust toolbarbutton's label position</a></li>
- <li><a class="external" href="http://forums.mozillazine.org/viewtopic.php?t=189667">A forum thread</a> about adding an item to the toolbar (instead of just adding it to palette) right after an extension is installed. Note that doing this is not recommended.</li>
- <li>There is <a href="/en/XUL/Toolbars/Custom_toolbar_button/SeaMonkey" title="en/Custom_Toolbar_Button/SeaMonkey">another page</a> on mdc with information about adding buttons to various windows in SeaMonkey. Includes useful information about overlays for ChatZilla.</li>
-</ul>
diff --git a/files/zh-cn/mozilla/tech/xul/toolbars/custom_toolbar_button/index.html b/files/zh-cn/mozilla/tech/xul/toolbars/custom_toolbar_button/index.html
deleted file mode 100644
index 9030e502a8..0000000000
--- a/files/zh-cn/mozilla/tech/xul/toolbars/custom_toolbar_button/index.html
+++ /dev/null
@@ -1,332 +0,0 @@
----
-title: 自定义工具栏按钮
-slug: Mozilla/Tech/XUL/Toolbars/Custom_toolbar_button
-translation_of: Archive/Mozilla/XUL/Toolbars/Custom_toolbar_button
----
-<p>此教程教您一步步为 Firefox, SeaMonkey 2.0, Thunderbird 或 Sunbird 制作工具栏按钮 (对于 SeaMonkey 1.x,请查看 <a href="/en/XUL/Toolbars/Custom_toolbar_button/SeaMonkey" title="en/Custom_Toolbar_Button/SeaMonkey">Custom Toolbar Button:SeaMonkey</a>.)</p>
-<p>你不需要任何技巧和工具,所以需要的信息全部在本页。</p>
-<p> </p>
-<h3 id="Introduction" name="Introduction">介绍</h3>
-<p>本页所述技术不包括任何黑科技。你可以自己定制属于自己的扩展。</p>
-<p>适用示例上的代码可以制作出很多很有用的按钮,如果你懂得 JS 编程,你可以自己编代码,实现更多其他功能。</p>
-<p>如果你需要创建一个具某项功能的按钮,那么你来对地方了</p>
-<p>在此页你也能学到扩展程序的基础知识,有利于将来写更复杂的插件。注意,扩展程序非常简单,你或许得查看其他教程,那么-主 <a href="/en/Extensions" title="en/Extensions">扩展</a> 页就是您该去的地方。另外, <a href="/en/XUL/Toolbars/Creating_toolbar_buttons" title="en/Creating_toolbar_buttons">创建工具栏按钮</a> 这篇文章(译注:建议先看本文再看这个,那里面有几句没说清楚该放哪去)和 <a href="/en/Building_an_Extension" title="en/Building_an_Extension">创建一个扩展</a> 更好的展示了创建过程。</p>
-<h4 id="Supported_applications" name="Supported_applications">支持的程序</h4>
-<p>本文中步骤适用于下列 Mozilla 应用:</p>
-<ul>
- <li>Firefox 1.5 以后</li>
- <li>SeaMonkey 2.0 以后</li>
- <li>Thunderbird 1.5 以后</li>
- <li>Sunbird 0.3 以后</li>
-</ul>
-<p>提前发行版一般都支持 (alphas, betas 和 release candidates) 。</p>
-<p><strong>译注:本文的例子适用于很多Mozilla 开发的应用程序,原文用Application 代表这些程序,所以我按照原文翻译成了应用/程序,所以如果将来遇到应用/程序等字样,就是指Firefox 等。</strong></p>
-<div class="note">
- <p><strong>Note: </strong> There is a similar tutorial for SeaMonkey 1.x on the page: <a href="/en/XUL/Toolbars/Custom_toolbar_button/SeaMonkey" title="en/Custom_Toolbar_Button/SeaMonkey">Custom Toolbar Button:SeaMonkey</a></p>
- <p>Earlier versions and other Mozilla applications also support extensions, but some parts of this tutorial are not appropriate for them.</p>
-</div>
-<h4 id="Required_tools" name="Required_tools">所需工具</h4>
-<p>需要两个工具,系统一般都默认提供了:</p>
-<ul>
- <li>能操作文件,文件夹的环境</li>
- <li>纯文本编辑器</li>
-</ul>
-<h5 id="Character_encoding" name="Character_encoding">字符编码</h5>
-<p>有些文本编辑器有调整字符编码的选项。</p>
-<p>如果你使用拉丁 (ASCII) 字符,那就将你的文本编辑器设为除 Unicode 外的任意编码</p>
-<p>如果你的语言包含非拉丁字符,那保存文件时请选择 UTF-8 编码。</p>
-<p>要想测试编辑器,新建一个文件<code>test.txt</code>。在文件中输入属于您语言的文字,然后保存。</p>
-<p>使用火狐打开此文件,(例如,直接将文件拖动到火狐上,或在菜单中选择 文件 – 打开文件)。</p>
-<p>在火狐的菜单栏中,选择 查看– 字符编码 – Unicode (UTF-8)。然后看在此设置下,文本中的文字是否能正常显示。</p>
-<p>如果你的文本编辑器不支持 UTF-8,自己上网搜索装一个。</p>
-<h4 id="Optional_tools" name="Optional_tools">可选工具</h4>
-<p>可以使用任意图像编辑器编辑图片。</p>
-<p>可以使用 jar 工具或 zip 工具将此按钮项目压缩成跨平台的安装文件 (XPI),方便别人安装使用。</p>
-<h3 id="Making_a_button" name="Making_a_button">制作一个按钮</h3>
-<p>按照下面10步完成</p>
-<p>完成所有步骤后,文件夹结构应该如下图所示:</p>
-<dl>
- <dd>
- <img alt="Directory and file structure" class="internal" src="/@api/deki/files/633/=Custom-button-structure.png"></dd>
-</dl>
-<p> profile 和 <code>extensions</code> 文件夹已存在,需要添加图中其他的文件和文件夹(当然此目录下可能还会有其他文件,只是没显示.)</p>
-<div style="margin-left: 4ex;">
- <div style="margin-left: -4ex; width: 4ex; float: left;">
- 1.</div>
- 前往应用程序的配置文件夹,然后找到<code>extensions</code> 文件夹。
- <p><strong>注意: </strong> 至于如何找到配置文件夹,请查看:<a class="external" href="http://kb.mozillazine.org/Profile_folder">配置文件夹</a></p>
- <p><em>说明: </em> 配置文件夹包含用户指定的设置,和主程序分开存放。所以程序重装或升级之后,这些信息不受影响。</p>
- <div style="margin-left: -4ex; width: 4ex; float: left;">
- 2.</div>
- 在 <code>extensions</code> 文件夹中,创建一个文件夹,名称如下:
- <p>建议直接复制粘贴,以免出错</p>
- <dl>
- <dd>
- <code><a class="link-mailto" href="mailto:custom-toolbar-button@example.com" rel="freelink">custom-toolbar-button@example.com</a></code></dd>
- </dl>
- <p>按照后面的步骤,创建两个文件和一个文件夹。</p>
- <p><em>说明: </em> 此文件夹名称是用于区分不同扩展程序的唯一标识符。在稍后的部分会有详细的标识符。</p>
- <div style="margin-left: -4ex; width: 4ex; float: left;">
- 3.</div>
- 创建一个文本文档,名称为 <code>install.rdf</code>.
- <p>完整复制下面内容,粘贴到文档中:</p>
- <pre>&lt;?xml version="1.0"?&gt;
-
-&lt;RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:em="http://www.mozilla.org/2004/em-rdf#"&gt;
-
- &lt;Description
- about="urn:mozilla:install-manifest"
-
- em:name="Custom Button"
- em:description="My custom toolbar button"
- em:creator="My name"
-
- em:id="custom-toolbar-button@example.com"
- em:version="1.0"
- em:homepageURL="http://developer.mozilla.org/en/docs/Custom_Toolbar_Button"
-
- em:iconURL="chrome://custombutton/content/icon.png" &gt;
-
- &lt;em:targetApplication&gt;&lt;!-- Firefox --&gt;
- &lt;Description
- em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
- em:minVersion="1.4"
- em:maxVersion="99" /&gt;
- &lt;/em:targetApplication&gt;
-
- &lt;em:targetApplication&gt;&lt;!-- Thunderbird --&gt;
- &lt;Description
- em:id="{3550f703-e582-4d05-9a08-453d09bdfdc6}"
- em:minVersion="1.4"
- em:maxVersion="99" /&gt;
- &lt;/em:targetApplication&gt;
-
- &lt;em:targetApplication&gt;&lt;!-- Sunbird --&gt;
- &lt;Description
- em:id="{718e30fb-e89b-41dd-9da7-e25a45638b28}"
- em:minVersion="0.2.9"
- em:maxVersion="99" /&gt;
- &lt;/em:targetApplication&gt;
-
- &lt;em:file&gt;
- &lt;Description
- about="urn:mozilla:extension:custombutton"
- em:package="content/custombutton/" /&gt;
- &lt;/em:file&gt;
-
- &lt;/Description&gt;
-
-&lt;/RDF&gt;
-</pre>
- <p>可选:改变 name, description 和 creator。改变这三行中双引号间的文字即可</p>
- <p>根据需求,移除不需要的软件说明部分(译注:假如你只想给firefox创建插件,那么就可以删掉别的部分)。</p>
- <p>保存文件</p>
- <p><em>说明: </em> 此文件包含应用程序扩展管理器需要的信息。target applications这一大段表示能运行扩展程序的应用以及版本号。 最后一段描述此插件会添加内容到应用程序。</p>
- <div style="margin-left: -4ex; width: 4ex; float: left;">
- 4.</div>
- 创建一个文本文档,名称为 <code>chrome.manifest</code>.
- <p>完整复制下面内容,粘贴到文档中:</p>
- <pre>content custombutton chrome/
-style chrome://global/content/customizeToolbar.xul chrome://custombutton/content/button.css
-
-# Firefox
-overlay chrome://browser/content/browser.xul chrome://custombutton/content/button.xul
-
-# Thunderbird mail
-overlay chrome://messenger/content/messenger.xul chrome://custombutton/content/button.xul
-
-# Thunderbird compose
-overlay chrome://messenger/content/messengercompose/messengercompose.xul chrome://custombutton/content/button.xul
-
-# Thunderbird address book
-overlay chrome://messenger/content/addressbook/addressbook.xul chrome://custombutton/content/button.xul
-
-# Sunbird
-overlay chrome://calendar/content/calendar.xul chrome://custombutton/content/button.xul
-</pre>
- <p>移除不需要的部分(同上段说明)。</p>
- <p>保存文件</p>
- <p><em>说明: </em> 此文件定义扩展的内容结构。先给工具栏窗口应用一个样式表。然后给每个工具栏都指定一个 overlay 。</p>
- <div style="margin-left: -4ex; width: 4ex; float: left;">
- 5.</div>
- 创建文件夹: <code>chrome</code>.
- <p>按照下放说明,创建 5 个文件。</p>
- <p><em>说明: </em>  <code>chrome</code> 文件夹包含扩展的可执行部分,即扩展是干什的。</p>
- <div style="margin-left: -4ex; width: 4ex; float: left;">
- 6.</div>
- 创建一个文本文档,名称为 <code>button.xul</code>.
- <p>完整复制下面内容,粘贴到文档中:</p>
- <pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;?xml-stylesheet type="text/css"
- href="chrome://custombutton/content/button.css"?&gt;
-
-&lt;!DOCTYPE overlay &gt;
-&lt;overlay id="custombutton-overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;
-
-&lt;script type="application/javascript"
- src="chrome://custombutton/content/button.js"/&gt;
-
-&lt;!-- Firefox --&gt;
-&lt;toolbarpalette id="BrowserToolbarPalette"&gt;
- &lt;toolbarbutton id="custom-button-1"/&gt;
- &lt;/toolbarpalette&gt;
-
-&lt;!-- Thunderbird mail --&gt;
-&lt;toolbarpalette id="MailToolbarPalette"&gt;
- &lt;toolbarbutton id="custom-button-1"/&gt;
- &lt;/toolbarpalette&gt;
-
-&lt;!-- Thunderbird compose --&gt;
-&lt;toolbarpalette id="MsgComposeToolbarPalette"&gt;
- &lt;toolbarbutton id="custom-button-1"/&gt;
- &lt;/toolbarpalette&gt;
-
-&lt;!-- Thunderbird address book --&gt;
-&lt;toolbarpalette id="AddressBookToolbarPalette"&gt;
- &lt;toolbarbutton id="custom-button-1"/&gt;
- &lt;/toolbarpalette&gt;
-
-&lt;!-- Sunbird --&gt;
-&lt;toolbarpalette id="calendarToolbarPalette"&gt;
- &lt;toolbarbutton id="custom-button-1"/&gt;
- &lt;/toolbarpalette&gt;
-
-
-&lt;!-- button details --&gt;
-&lt;toolbarbutton id="custom-button-1"
- label="Custom"
- tooltiptext="My custom toolbar button"
- oncommand="CustomButton[1]()"
- class="toolbarbutton-1 chromeclass-toolbar-additional custombutton"
- /&gt;
-
-&lt;/overlay&gt;
-</pre>
- <p>可选:你可以自定义最后一块中的 label 和 tooltiptext 。更改双括号间的内容即可。</p>
- <p>可选地,移除不需要的部分。。</p>
- <p>保存文件。</p>
- <p><em>说明: </em> 此 <a href="/en/XUL" title="en/XUL">XUL</a> 文件会添加一个按钮到应用程序的 toolbar customization palette。此文件还链接了CSS样式表 和 JavaScript 脚本。最后一部分描述按钮的信息(译注;就是按钮名+鼠标放上面会提示什么文字)</p>
- <div style="margin-left: -4ex; width: 4ex; float: left;">
- 7.</div>
- 创建一个文本文档,名称为: <code>button.css</code>.
- <p>完整复制下面内容,粘贴到文档中:</p>
- <pre>#custom-button-1,
-#wrapper-custom-button-1
- {list-style-image: url("chrome://custombutton/content/button-1.png");}
-
-/* common style for all custom buttons */
-.custombutton
- {-moz-image-region: rect( 0px 24px 24px 0px);}
-
-.custombutton:hover
- {-moz-image-region: rect(24px 24px 48px 0px);}
-
-[iconsize="small"] .custombutton
- {-moz-image-region: rect( 0px 40px 16px 24px);}
-
-[iconsize="small"] .custombutton:hover
- {-moz-image-region: rect(24px 40px 40px 24px);}
-</pre>
- <p>没有什么能优化的,保存文件即可</p>
- <p><em>说明: </em> 此 <a href="/en/CSS" title="en/CSS">CSS</a> 样式表定义按钮如何显示。它链接到了按钮图片,指定了图片四个部分的尺寸。(译注;这里你就可以看文章开头提到的文章了,比这里举的例子更好实现,你只需在css中指定一大一小两个图片即可)</p>
- <div style="margin-left: -4ex; width: 4ex; float: left;">
- 8.</div>
- 创建一个文本文档,名称为: <code>button.js</code>.
- <p>完整复制下面内容,粘贴到文档中:</p>
- <div style="width: 40em;">
- <pre>CustomButton = {
-
-1: function () {
- alert("Just testing")
- },
-
-}
-</pre>
- </div>
- <p>没有什么能优化的,保存文件即可</p>
- <p>接下来一部分的教程包含几个实例代码,你可以用他们来实现有用的功能。</p>
- <p><em>说明: </em> 此文件指定当按钮按下时执行什么操作。它使用  <a href="/en/JavaScript" title="en/JavaScript">JavaScript</a> 语言,加应用自己提供的一些特性。</p>
- <div style="margin-left: -4ex; width: 4ex; float: left;">
- 9.</div>
- 下载按钮图片。
- <p>右击图片,另存为,保存到 <code>chrome</code> 目录下。请确保文件名为: <code>button-1.png</code></p>
- <div style="margin: 0 0 1em 4ex; border: 6px solid #ddd; float: left;">
- <img alt="button-1.png" class="internal" src="/@api/deki/files/576/=Button-1.png"></div>
- <p style=""><em>说明: </em> 此图片包含四个部分。左上方是常用的图标。左下是深色的,按下按钮后显示,右侧的是小图标,工具栏设置成使用小图标时需要用。</p>
- <div style="margin-left: -4ex; width: 4ex; float: left;">
- 10.</div>
- 下载扩展的图片。
- <p>右击图片,另存为,保存到 <code>chrome</code> 目录下。请确保文件名为:<code>icon.png</code></p>
- <div style="margin: 0 0 1em 4ex; border: 6px solid #ddd; float: left;">
- <img alt="icon.png" class="internal" src="/@api/deki/files/717/=Icon.png"></div>
- <p style=""><em>说明: </em> 此图片显示在应用扩展管理窗口中。</p>
-</div>
-<h4 id="Testing_your_new_button" name="Testing_your_new_button">测试您的按钮</h4>
-<p>重启应用程序(firefox)</p>
-<p>右击工具栏,选中定制,或者在菜单中,依次选择:查看 – 工具栏 – 定制</p>
-<p>将刚才的新按钮拖动到工具栏,点击“退出定制”保存设置。</p>
-<p>点击按钮,应该能看到弹出信息了。</p>
-<h3 id="Further_development" name="Further_development">进一步开发</h3>
-<p>此部分描述如何进一步开发按钮。</p>
-<h4 id="Uninstalling_the_button" name="Uninstalling_the_button">卸载按钮</h4>
-<p>如果想卸载按钮,删掉步骤 2 创建的文件夹即可。</p>
-<p>或者,使用程序自己的 扩展管理窗口 正常卸载应用,在下次重启时应用就会删掉此文件夹。</p>
-<p>重启程序</p>
-<h4 id="Troubleshooting" name="Troubleshooting">排错</h4>
-<p>如果按钮没在工具栏中显示,或是其他问题,可以按照下列步骤排查。</p>
-<p>如果有必要,卸载按钮,重头开始,这次不要修改任何内容</p>
-<p>在能成功让按钮工作后,小心的修改文件。</p>
-<p>要想看到修改后的结果,需要重启应用。</p>
-<h5 id="Advanced_troubleshooting" name="Advanced_troubleshooting">高级排错</h5>
-<p>如果你有一定的技术只是,那么你可以使用应用程序的 JavaScript console 查看错误信息。但是不一定都有用,而且易混淆,或是看到了其他程序的执行结果。</p>
-<p>在 工具栏 - 开发者(web developer) - Browser Console 中开启 JS 选项。或使用快捷键"Ctrl + Shift + J"</p>
-<p> JavaScript console 里会显示 JavaScript, XUL 或 CSS 文件的信息。</p>
-<div class="note">
- <strong>Note</strong>: The preference setting <a class="external" href="http://kb.mozillazine.org/Javascript.options.strict">javascript.options.strict</a> imposes restrictions that are not appropriate for the simple scripts in this tutorial. If you choose to use this setting, either ignore the warnings that it generates, or change the coding style to keep it quiet.</div>
-<h4 id="Programming_the_button" name="Programming_the_button">为按钮编程</h4>
-<p>要想改变按钮功能,去修改步骤 8 里的 <code>button.js</code> 。</p>
-<p>移除行: <code>alert("Just testing")</code> ,替换成其他 js 语句。</p>
-<p>可以在 <a href="/en/XUL/Toolbars/Custom_toolbar_button/Code_Samples" title="en/Custom_Toolbar_Button/Code_Samples">Code Samples</a> 查看很多代码示例,不用知道编程知识就能修改并使用。</p>
-<p>需要重启才能生效变更。</p>
-<h4 id="Adding_more_buttons" name="Adding_more_buttons">添加更多的按钮</h4>
-<p>要想添加更多的按钮,请编辑 <code>button.xul 文件,对于每个应用,复制指定</code> <code>custom-button-1 的那行</code>,然后将新行指定成 <code>custom-button-2</code>。</p>
-<p>重复最后一部分。在 <code>id</code> 和 <code>oncommand</code> 参数中,将 1 改为 2。然后改变 <code>label</code> 和 <code>tooltiptext</code> 。<strong>不要</strong>改变 <code>class</code> 参数。</p>
-<p>然后编辑 <code>button.css</code>。复制前三行,改变新行成为 <code>button-2</code>.</p>
-<p>编辑 <code>button.js</code> 为新按钮添加 js 语句。请确保<strong>添加的语句在最后一个花括号的前面</strong>,例如,这么添加命令:</p>
-<pre class="eval">2: function () {
- alert("Just testing again")
- },
-</pre>
-<p>为新按钮创建图标,命名为 <code>button-2.png</code>。下面提供的文件有40 像素宽,48像素高,256色,透明背景,PNG格式,其他格式也能工作。</p>
-<p>你可以下载使用下列图片:</p>
-<div style="margin: 0 0 1em 4ex; border: 6px solid #ddd; float: left;">
- <img alt="button-2.png" class="internal" src="/@api/deki/files/580/=Button-2.png"></div>
-<div style="margin: 0 0 1em 4ex; border: 6px solid #ddd; float: left;">
- <img alt="button-3.png" class="internal" src="/@api/deki/files/583/=Button-3.png"></div>
-<div style="margin: 0 0 1em 4ex; border: 6px solid #ddd; float: left;">
- <img alt="button-4.png" class="internal" src="/@api/deki/files/586/=Button-4.png"></div>
-<div style="margin: 0 0 1em 4ex; border: 6px solid #ddd; float: left;">
- <img alt="button-5.png" class="internal" src="/@api/deki/files/589/=Button-5.png"></div>
-<p style="">重启程序,并将新按钮添加到工具栏。</p>
-<p>你可以重复这些步骤,创建更多按钮</p>
-<h3 id="Distributing_your_button_to_other_users" name="Distributing_your_button_to_other_users">将您的按钮分发给其他用户</h3>
-<p>如果你想将按钮程序分发给他人,那就必须做些修改以和其他扩展程序做区分。</p>
-<p>创建一个扩展 ID,格式为:</p>
-<dl>
- <dd>
- <code><em>something</em>@<em>domain-name</em></code></dd>
-</dl>
-<p>必须包含at符号 (<code>@</code>),格式和邮箱地址挺像,但不必是真实邮箱地址。@符号的前后,只能使用字符 : A-Z, a-z, 0-9, 英文句号( . ), 连字符(-)和下划线(_)。如果您没有域名(domain-name),可以自己编个,如果你想让这域名看着不像真正的域名,那就在结尾加个 <code>.invalid</code> 。</p>
-<p>使用你的 扩展ID (extension ID)重命名文件夹,然后在 <code>install.rdf</code> 文件中指定相同的 ID。</p>
-<p><code>在 install.rdf</code> 文件中,移除您扩展不能正常工作的应用项。例如,如果您的按钮只能在 Thunderbird 上运行,就删除 Firefox 和 Sunbird 的部分。同样道理,修改 <code>button.xul</code> 和 <code>chrome.manifest</code>.</p>
-<p>改变所有文件中的 "custombutton", "custom-button" 和 "CustomButton" 字样。</p>
-<p>可以自己更改的:</p>
-<ul>
- <li>按钮的图片</li>
- <li>扩展的图片: <code>icon.png</code></li>
- <li> <code>install.rdf</code> 中的版本号和主页</li>
-</ul>
-<p>使用 jar 工具或 zip 工具打包整个文件夹的内容命名为 <code>.xpi</code> 文件。方便用于其他程序。</p>
-<p>用户可在应用程序的扩展管理窗口中安装此 XPI 文件。</p>
diff --git a/files/zh-cn/mozilla/tech/xul/toolbars/index.html b/files/zh-cn/mozilla/tech/xul/toolbars/index.html
deleted file mode 100644
index b028d9cd69..0000000000
--- a/files/zh-cn/mozilla/tech/xul/toolbars/index.html
+++ /dev/null
@@ -1,65 +0,0 @@
----
-title: Toolbars
-slug: Mozilla/Tech/XUL/Toolbars
-tags:
- - NeedsTranslation
- - TopicStub
-translation_of: Archive/Mozilla/XUL/Toolbars
----
-<p>Toolbars, implemented using the XUL <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbar" title="toolbar">toolbar</a></code> element, are containers for toolbar buttons and other user interface objects. The following articles provide details about implementing and working with toolbars.</p>
-<table class="topicpage-table">
- <tbody>
- <tr>
- <td>
- <h2 class="Documentation" id="Documentation" name="Documentation">Documentation</h2>
- <dl>
- <dt><a href="/en-US/docs/XUL/School_tutorial/Adding_Toolbars_and_Toolbar_Buttons" title="XUL/School_tutorial/Adding Toolbars and Toolbar Buttons">XUL School: Adding Toolbars and Toolbar Buttons</a></dt>
- <dd>A helpful tutorial to creating toolbars and toolbar buttons.</dd>
- <dt><a href="/en-US/docs/XUL/Toolbars/Toolbar_customization_events" title="XUL/Toolbars/Toolbar customization events">Toolbar customization events</a></dt>
- <dd>A look at the events that are sent during toolbar customization; you can use these to be kept aware of changes to toolbars.</dd>
- <dt><a href="/en-US/docs/XUL/Toolbars/Creating_toolbar_buttons" title="XUL/Toolbars/Creating toolbar buttons">Creating toolbar buttons</a></dt>
- <dd>How to use overlays to add toolbar buttons to Mozilla applications.</dd>
- <dt><a href="/en-US/docs/XUL/Toolbars/Custom_toolbar_button" title="XUL/Toolbars/Custom toolbar button">Custom toolbar button</a></dt>
- <dd>Another example of how to create a toolbar button, complete with a sample extension you can download and try.</dd>
- <dt><a href="/en-US/docs/Code_snippets/Toolbar" title="Code snippets/Toolbar">Code snippets: Toolbar</a></dt>
- <dd>Code snippets that are helpful when working with toolbars.</dd>
- <dt></dt>
- </dl>
- <p><span class="alllinks"><a href="/en-US/docs/tag/Extensions" title="Tags:Toolbars">View all pages tagged with "Toolbars"...</a></span></p>
- </td>
- <td>
- <h2 class="Community" id="Community" name="Community">Community</h2>
- <ul>
- <li>View Mozilla extension development forums... <ul>
- <li><a href="https://lists.mozilla.org/listinfo/dev-extensions"> 邮件列表</a></li>
-
-
- <li><a href="http://groups.google.com/group/mozilla.dev.extensions"> 新闻组</a></li>
- <li><a href="http://groups.google.com/group/mozilla.dev.extensions/feeds"> Web feed</a></li>
-</ul></li>
- <li><a class="link-irc" href="irc://irc.mozilla.org/extdev">#extdev IRC channel</a></li>
- <li><a href="http://forums.mozillazine.org/?c=11">MozillaZine forum</a></li>
- <li><a href="/devnews/index.php/categories/about-addons" title="https://developer.mozilla.org/editor/fckeditor/core/editor/devnews/index.php/categories/about-addons/">about:addons newsletter</a></li>
- <li><a href="/web-tech" title="https://developer.mozilla.org/editor/fckeditor/core/editor/web-tech/">Mozilla's Web-Tech blog</a></li>
- <li><a href="http://mozdev.org/mailman/listinfo/project_owners">mozdev project owners</a></li>
- <li><a href="http://planet.mozilla.org/" title="http://planet.mozilla.org/">Planet Mozilla</a></li>
- <li><a href="/en-US/docs/Extensions/Community" title="Extensions/Community">Other community links...</a></li>
- </ul>
- <h2 class="Tools" id="Tools" name="Tools">Tools</h2>
- <ul>
- <li><a class="link-https" href="https://addons.mozilla.org/en-US/firefox/addon/6622" rel="external nofollow" title="https://addons.mozilla.org/en-US/firefox/addon/6622">DOM Inspector</a> edit the live DOM (Firefox and Thunderbird)</li>
- <li><a class="link-https" href="https://builder.mozillalabs.com/" title="https://builder.mozillalabs.com/">Mozilla Labs Add-on Builder</a></li>
- <li><a class="link-https" href="https://addons.mozilla.org/en-US/firefox/addon/7434/" rel="external nofollow" title="https://addons.mozilla.org/en-US/firefox/addon/7434/">Extension Developer's Extension</a> a suite of development tools</li>
- <li><a href="http://www.gijsk.com/" rel="external nofollow" title="http://www.gijsk.com/">Chrome List</a> view files in chrome:// (<a href="http://addons.mozilla.org/en-US/firefox/addon/4453" rel="external nofollow" title="http://addons.mozilla.org/en-US/firefox/addon/4453">Firefox</a>, <a href="http://addons.mozilla.org/en-US/thunderbird/addon/4453" rel="external nofollow" title="http://addons.mozilla.org/en-US/thunderbird/addon/4453">Thunderbird</a>)</li>
- <li><a href="http://ted.mielczarek.org/code/mozilla/extensionwiz/" rel="external nofollow" title="http://ted.mielczarek.org/code/mozilla/extensionwiz/">Extension Wizard</a> a web-based extension skeleton generator (Firefox and Thunderbird)</li>
- </ul>
- <p>... <a href="/en-US/docs/Setting_up_extension_development_environment#Development_extensions" title="Setting up extension development environment#Development extensions">more tools</a> ...</p>
-
- <h2 class="Related_Topics" id="Related_Topics" name="Related_Topics">Related Topics</h2>
- <ul>
- <li><a href="/en-US/docs/XUL" title="XUL">XUL</a>, <a href="/en-US/docs/Themes" title="Themes">Themes</a>, <a href="/en-US/docs/Developer_Guide" title="Developing_Mozilla">Developing Mozilla</a></li>
- </ul>
- </td>
- </tr>
- </tbody>
-</table>
diff --git a/files/zh-cn/mozilla/tech/xul/toolbox/index.html b/files/zh-cn/mozilla/tech/xul/toolbox/index.html
deleted file mode 100644
index 4417170b3e..0000000000
--- a/files/zh-cn/mozilla/tech/xul/toolbox/index.html
+++ /dev/null
@@ -1,6 +0,0 @@
----
-title: toolbox
-slug: Mozilla/Tech/XUL/toolbox
-translation_of: Archive/Mozilla/XUL/toolbox
----
-<p>This page has no content. Enrich MDC by contributing.</p>
diff --git a/files/zh-cn/mozilla/tech/xul/tree/index.html b/files/zh-cn/mozilla/tech/xul/tree/index.html
deleted file mode 100644
index 7e2de0b669..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tree/index.html
+++ /dev/null
@@ -1,512 +0,0 @@
----
-title: tree
-slug: Mozilla/Tech/XUL/tree
-translation_of: Archive/Mozilla/XUL/tree
----
-<div class="noinclude"><span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-
-<p>tree是用来显示表格或层级行元素的容器。 包含若干行 (rows )和列(columns)。树的每行包含若干缩进显示的子行(child rows)。 和其他元素不同的是,用来显示的数据不是通过标签(tags),而是通过一个显示对象(view object)来确定的。这个显示对象(view object)实现了接口 <a href="/en/XPCOM_Interface_Reference/nsITreeView" title="en/nsITreeView">nsITreeView</a> . The view is queried for the data to appear in the tree. 树的使用有以下几种方法, 第二列列出了通过树的 <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/view">view</a></span></code>属性(property)的可用的接口. 第三列指示<code><a href="/zh-CN/docs/Mozilla/Tech/XUL/treeitem" title="treeitem">treeitem</a></code> 元素是否使用.</p>
-
-<p>If you would like to allow the tree to be horizontally scrolled, simply set the <code id="a-width"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/width">width</a></code> attributes for each column to make the tree wider than its containing object.</p>
-
-<table class="fullwidth-table">
- <tbody>
- <tr>
- <th>Tree type</th>
- <th>View interfaces</th>
- <th>Has DOM nodes?</th>
- <th>Description</th>
- </tr>
- <tr>
- <td>Content tree</td>
- <td><a href="/en/XPCOM_Interface_Reference/nsITreeView" title="en/nsITreeView">nsITreeView</a>, <a href="/en/XPCOM_Interface_Reference/NsITreeContentView" title="en/NsITreeContentView">nsITreeContentView</a></td>
- <td>Yes</td>
- <td>This tree has <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/treeitem" title="treeitem">treeitem</a></code> elements placed within the <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/treechildren" title="treechildren">treechildren</a></code> element. In this situation, a content view (which implements the interface <a href="/en/XPCOM_Interface_Reference/NsITreeContentView" title="en/NsITreeContentView">nsITreeContentView</a>) which is a more specialized type of view, uses the <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/treeitem" title="treeitem">treeitem</a></code> elements and their descendants to determine the data to display in the tree. However, the treeitems are not displayed directly; they are used only as data to the content view. However, the content view will automatically update the tree if treeitems are changed.</td>
- </tr>
- <tr>
- <td>RDF tree</td>
- <td><a href="/en/XPCOM_Interface_Reference/nsITreeView" title="en/nsITreeView">nsITreeView</a>, <a href="/en/NsIXULTreeBuilder" title="en/NsIXULTreeBuilder">nsIXULTreeBuilder</a></td>
- <td>No</td>
- <td>This tree is generated from an RDF datasource. It is used when a tree has a <code id="a-datasources"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/datasources">datasources</a></code> attribute, and has <code>dont-build-content</code> in its <code id="a-flags"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/flags">flags</a></code> attribute. For this tree, the data comes directly from the RDF datasource. DOM <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/treeitem" title="treeitem">treeitem</a></code>s are not created. Even though the template uses treeitem elements to define the content, DOM nodes for these elements are not created. This is the type that should be used for RDF generated trees with lots of rows.</td>
- </tr>
- <tr>
- <td>RDF content tree</td>
- <td><a href="/en/XPCOM_Interface_Reference/nsITreeView" title="en/nsITreeView">nsITreeView</a>, <a href="/en/NsIXULTreeBuilder" title="en/NsIXULTreeBuilder">nsIXULTreeBuilder</a>, <a href="/en/XPCOM_Interface_Reference/NsITreeContentView" title="en/NsITreeContentView">nsITreeContentView</a></td>
- <td>Yes</td>
- <td>This tree is generated from an RDF datasource. It is similar to the previous type but is used when the tree does not have <code>dont-build-content</code> in its <code id="a-flags"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/flags">flags</a></code> attribute. DOM <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/treeitem" title="treeitem">treeitem</a></code>s are created, so you can access the data using RDF functions or DOM functions. This type is suitable for RDF generated trees with a fairly small number of rows.</td>
- </tr>
- <tr>
- <td>Custom tree view</td>
- <td><a href="/en/XPCOM_Interface_Reference/nsITreeView" title="en/nsITreeView">nsITreeView</a></td>
- <td>No</td>
- <td>For this tree you implement the <a href="/en/XPCOM_Interface_Reference/nsITreeView" title="en/nsITreeView">nsITreeView</a> interface yourself. The tree's data is retrieved from this custom view. The custom view should be attached to the tree by setting its <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/view">view</a></span></code> property.</td>
- </tr>
- </tbody>
-</table>
-
-<p>More information is available in the <a href="/en/XUL_Tutorial/Trees" title="en/XUL_Tutorial/Trees">XUL tutorial</a>. Also <a href="/en/Tree_Widget_Changes" title="en/Tree_Widget_Changes">Tree Widget Changes</a>.</p>
-
-<table style="background: #eeeeee none repeat scroll 0% 0%; border: 1px solid #cccccc; margin: 0px 0px 10px 10px; padding: 0px 10px;">
- <tbody>
- <tr>
- <td><strong><a href="/en/XUL_accessibility_guidelines#Trees" title="en/XUL_accessibility_guidelines#Trees">Relevant accessbility guidelines</a></strong><small> </small>
-
- <ul>
- <li><small>Provide alternative access (e.g., via menus) to column picker and for header behaviors like sorting (these have no default keyboard access).</small></li>
- </ul>
- </td>
- </tr>
- </tbody>
-</table>
-
-<dl>
- <dt>Attributes</dt>
- <dd><a href="#a-disableKeyNavigation">disableKeyNavigation</a>, <a href="#a-disabled">disabled</a>, <a href="#a-tree.editable">editable</a>, <a href="#a-enableColumnDrag">enableColumnDrag</a>, <a href="#a-flags">flags</a>, <a href="#a-hidecolumnpicker">hidecolumnpicker</a>, <a href="#a-tree.onselect">onselect</a>, <a href="#a-rows">rows</a>, <a href="#a-seltype">seltype</a>, <a href="#a-statedatasource">statedatasource</a>, <a href="#a-tabindex">tabindex</a>, <a href="#a-treelines">treelines</a></dd>
-</dl>
-
-<dl>
- <dt>Properties</dt>
- <dd><a href="#p-accessibleType">accessibleType</a>, <a href="#p-builderView">builderView</a>, <a href="#p-columns">columns</a>, <a href="#p-contentView">contentView</a>, <a href="#p-currentIndex">currentIndex</a>, <a href="#p-disableKeyNavigation">disableKeyNavigation</a>, <a href="#p-disabled">disabled</a>, <a href="#p-editingColumn">editingColumn</a>, <a href="#p-editingRow">editingRow</a>, <a href="#p-enableColumnDrag">enableColumnDrag</a>, <a href="#p-firstOrdinalColumn">firstOrdinalColumn</a>, <a href="#p-tree.inputField">inputField</a>, <a href="#p-selType">selType</a>, <a href="#p-selstyle">selstyle</a>, <a href="#p-tabIndex">tabIndex</a>, <a href="#p-treeBoxObject">treeBoxObject</a>, <a href="#p-view">view</a></dd>
-</dl>
-
-<h3 id="Examples" name="Examples">Examples</h3>
-
-<h4 id="A_tree_with_several_columns">A tree with several columns</h4>
-
-<pre class="script">&lt;tree flex="1" rows="2"&gt;
-
- &lt;treecols&gt;
- &lt;treecol id="sender" label="Sender" flex="1"/&gt;
- &lt;treecol id="subject" label="Subject" flex="2"/&gt;
- &lt;/treecols&gt;
-
- &lt;treechildren&gt;
- &lt;treeitem&gt;
- &lt;treerow&gt;
- &lt;treecell label="joe@somewhere.com"/&gt;
- &lt;treecell label="Top secret plans"/&gt;
- &lt;/treerow&gt;
- &lt;/treeitem&gt;
- &lt;treeitem&gt;
- &lt;treerow&gt;
- &lt;treecell label="mel@whereever.com"/&gt;
- &lt;treecell label="Let's do lunch"/&gt;
- &lt;/treerow&gt;
- &lt;/treeitem&gt;
- &lt;/treechildren&gt;
-
-&lt;/tree&gt;
-</pre>
-
-<div><img alt="Image:trees1.png" class="internal" src="/@api/deki/files/899/=Trees1.png"></div>
-
-<h4 id="A_tree_with_several_columns_and_nested_items">A tree with several columns and nested items</h4>
-
-<pre class="script">&lt;tree id="myTree" flex="1" hidecolumnpicker="false" seltype="single" class="tree"
- rows="5"&gt;
- &lt;treecols id="myTree2-treeCols"&gt;
- &lt;treecol id="myTree2-treeCol0" primary="true" flex="2" label="Column A"
- persist="width" ordinal="1"/&gt;
- &lt;splitter class="tree-splitter" ordinal="2"/&gt;
- &lt;treecol id="myTree2-treeCol1" flex="1" label="Column B"
- persist="width" ordinal="3"/&gt;
- &lt;/treecols&gt;
- &lt;treechildren&gt;
- &lt;treeitem&gt;
- &lt;treerow&gt;
- &lt;treecell label="1"/&gt;
- &lt;treecell label="a"/&gt;
- &lt;/treerow&gt;
- &lt;/treeitem&gt;
- &lt;!-- Make sure to set container="true" --&gt;
- &lt;treeitem container="true" open="true"&gt;
- &lt;treerow&gt;
- &lt;treecell label="2"/&gt;
- &lt;treecell label="b"/&gt;
- &lt;/treerow&gt;
- &lt;treechildren&gt;
- &lt;treeitem&gt;
- &lt;treerow&gt;
- &lt;treecell label="2a"/&gt;
- &lt;treecell label="ba"/&gt;
- &lt;/treerow&gt;
- &lt;/treeitem&gt;
- &lt;/treechildren&gt;
- &lt;/treeitem&gt;
- &lt;/treechildren&gt;
-&lt;/tree&gt;
-</pre>
-
-<h3 id="Attributes" name="Attributes">Attributes</h3>
-
-<p> </p><div id="a-disabled">
-
-
-<dl>
- <dt><code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code></dt>
- <dd> </dd>
- <dd>
- <h5 id="类型boolean">类型:<em>boolean</em></h5>
- </dd>
- <dd>
- <h5 id="表示元素是被禁用的。">表示元素是被禁用的。</h5>
-
- <p>如果这个元素的disabled属性被设置为true,表示元素被禁用,被禁用的属性在页面上通常会显示灰色文本,它无法响应用户的操作,它也无法得到光标。</p>
-
- <p>然而,这个元素仍然能够响应鼠标事件,如果要启用这个元素,把disabled设置为false</p>
- </dd>
-</dl>
-
-<h4 id="示例:">示例:</h4>
-
-<div class="float-right"><img alt="Image:XUL_ref_attr_disabled.png" src="https://mdn.mozillademos.org/files/1742/XUL_ref_attr_disabled.png"></div>
-
-<pre><code>// Disabling an element
-document.getElementById('buttonRemove').setAttribute("disabled", "true");
-
-// Enabling back an element by removing the "disabled" attribute
-document.getElementById('buttonRemove').removeAttribute("disabled");</code></pre>
-
-<p></p><div class="blockIndicator standardNote standardNoteBlock">
- <p><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Firefox/Releases/3.5">Firefox 3.5 note</a></p>
- <p style="font-weight: 400;">For <a href="https://developer.mozilla.org/en-US/docs/XUL/keyset" title="en/XUL/Keyset"><code>keyset</code></a> elements, support for this attribute was added in Firefox 3.5.</p>
-</div><p></p>
-</div> <div id="a-disableKeyNavigation">
-
-
-<dl>
- <dt><code id="a-disableKeyNavigation"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/disableKeyNavigation">disableKeyNavigation</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>If this attribute is not used, the user can navigate to specific items within the element by pressing keys corresponding to letters in the item's label. This is done incrementally, so typing more letters with select more specific items. This feature may be disabled by setting this attribute to <code>true</code>.</dd>
-</dl>
-</div> <div id="a-tree.editable">
-
-
-<dl>
- <dt><code id="a-tree.editable"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/tree.editable">editable</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>Indicates that the cells of the <code><a href="/en-US/docs/Mozilla/Tech/XUL/tree" title="tree">tree</a></code> may be edited.</dd>
-</dl>
-</div> <div id="a-enableColumnDrag">
-
-
-<dl>
- <dt><code id="a-enableColumnDrag"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/enableColumnDrag">enableColumnDrag</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>When set to <code>true</code>, the user may drag the column headers around to change the order in which they are displayed.</dd>
-</dl>
-</div> <div id="a-flags">
-
-
-<dl>
- <dt><code id="a-flags"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/flags">flags</a></code></dt>
- <dd>Type: <em>space-separated list of the values below</em></dd>
- <dd>A set of flags used for miscellaneous purposes. Two flags are defined, which may be the value of this attribute.
- <ul>
- <li><code>dont-test-empty</code>: For template generated content, the builder will not check that a container is empty.</li>
- <li><code>dont-build-content</code>: This flag may be used on a tree to indicate that content elements should not be generated. This results in a performance enhancement, but you will not be able to use the DOM functions to retrieve the tree rows.</li>
- </ul>
- </dd>
-</dl>
-</div> <div id="a-hidecolumnpicker">
-
-
-<dl>
- <dt><code id="a-hidecolumnpicker"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/hidecolumnpicker">hidecolumnpicker</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>When set to <code>false</code>, a drop-down will appear in the upper right corner of the <code><a href="/en-US/docs/Mozilla/Tech/XUL/tree" title="tree">tree</a></code>, which the user may use to show and hide columns. When set to <code>true</code>, the column picker will be hidden. The default value is <code>false</code>.</dd>
-</dl>
-</div> <div id="a-tree.onselect">
-
-
-<dl>
- <dt><code id="a-tree.onselect"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/tree.onselect">onselect</a></code></dt>
- <dd>Type: <em>script code</em></dd>
- <dd>This event is sent to a <code><a href="/en-US/docs/Mozilla/Tech/XUL/tree" title="tree">tree</a></code> when a row is selected, or whenever the selection changes. The user can select multiple rows by holding down Shift or Control and clicking on a row. The <code>onselect</code> event will be sent for each item added to or removed from the selection.</dd>
-</dl>
-
-
-</div> <div id="a-rows">
-
-<dl>
- <dt>
- <code id="a-rows"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/rows">rows</a></code></dt>
- <dd>
- Type: <em>integer</em></dd>
- <dd>
- The number of rows to display in the element. If the element contains more than this number of rows, a scrollbar will appear which the user can use to scroll to the other rows. To get the actual number of rows in the element, use the <span id="m-getRowCount"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/getRowCount">getRowCount</a></code></span> method.</dd>
-</dl>
-</div> <div id="a-seltype">
-
-
-<dl>
- <dt><code id="a-seltype"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/seltype">seltype</a></code></dt>
- <dd>Type: <em>one of the values below</em></dd>
- <dd>Used to indicate whether multiple selection is allowed.</dd>
- <dd>
- <dl>
- <dt><code>single</code></dt>
- <dd>Only one row may be selected at a time. (Default in <code>listbox</code> and <code>richlistbox</code>.)</dd>
- <dt><code>multiple</code></dt>
- <dd>Multiple rows may be selected at once. (Default in <code>tree</code>.)</dd>
- </dl>
- </dd>
- <dd>
- <p>For trees, you can also use the following values:</p>
-
- <dl>
- <dt><code>cell</code></dt>
- <dd>Individual cells can be selected </dd>
- <dt><code>text</code></dt>
- <dd>Rows are selected; however, the selection highlight appears only over the text of the primary column.</dd>
- </dl>
-
- <p>For <code>richlistbox</code>, this is new in Firefox 3.5.</p>
- </dd>
-</dl>
-</div> <div id="a-statedatasource">
-
-
-<dl>
- <dt><code id="a-statedatasource"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/statedatasource">statedatasource</a></code></dt>
- <dd>Type: <em>URI</em></dd>
- <dd>Chrome XUL may specify an RDF datasource to use to store <code><a href="/en-US/docs/Mozilla/Tech/XUL/tree" title="tree">tree</a></code> state information. This is used to hold which tree items are open and which items are collapsed. This information will be remembered for the next time the XUL file is opened. If you do not specify this attribute, state information will be stored in the local store (<code>rdf:local-store</code>).</dd>
-</dl>
-</div> <div id="a-tabindex">
-
-
-<dl>
- <dt><code id="a-tabindex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tabindex">tabindex</a></code></dt>
- <dd>Type:<em>integer</em></dd>
- <dd>当用户按下 "<kbd>tab</kbd>" 键时焦点移动到元素上的顺序。<code>tabindex</code> 数字越大,顺序越靠后。</dd>
-</dl>
-
-
-
-<p></p>
-</div> <div id="a-treelines">
-
-<dl><dt> <code id="a-treelines"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/treelines">treelines</a></code> <br>
-</dt><dd> Type: <em>boolean</em> </dd><dd> When set to <code>true</code>, lines are drawn connecting the lines in the tree; when <code>false</code>, the lines are not drawn. This is <code>false</code> by default.<br>
-</dd></dl>
-</div><p></p>
-
-<h3 id="Properties" name="Properties">Properties</h3>
-
-<p> </p><div id="p-accessibleType">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/accessibleType">accessibleType</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- A value indicating the type of accessibility object for the element.</dd>
-</dl>
-
-<p></p></div> <div id="p-builderView">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/builderView">builderView</a></span></code></dt>
- <dd>Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIXULTreeBuilder" title="">nsIXULTreeBuilder</a></code></em></dd>
- <dd>A reference to the tree builder which constructed the <code><a href="/en-US/docs/Mozilla/Tech/XUL/tree" title="tree">tree</a></code> data. The builder provides access to the RDF resources for each row in the tree, and allows sorting the data by column. In newer versions of Mozilla, the <code>builderView</code> property is actually a synonym for the <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/view">view</a></span></code> property, since the two interfaces are flattened together into a single interface in <a href="/en/JavaScript" title="en/JavaScript">JavaScript</a>. This property is read-only.</dd>
-</dl></div> <div id="p-columns">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/columns">columns</a></span></code></dt>
- <dd>
- Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsITreeColumns" title="">nsITreeColumns</a></code></em></dd>
- <dd>
- Returns the columns for the tree as an <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsITreeColumns" title="">nsITreeColumns</a></code> object.</dd>
-</dl></div> <div id="p-contentView">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/contentView">contentView</a></span></code></dt>
- <dd>
- Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsITreeContentView" title="">nsITreeContentView</a></code></em></dd>
- <dd>
- For trees built with a content builder - that is, those that do not have <code id="a-flags"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/flags">flags</a></code> set -- the <code>contentView</code> will be a reference to the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsITreeContentView" title="">nsITreeContentView</a></code> for the tree. This interface lets you retrieve the DOM element corresponding to a given a row index and vice versa. For trees that are not built with a content builder, the functions of <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsITreeContentView" title="">nsITreeContentView</a></code> will not be available, since there are no DOM nodes to retrieve. In newer versions of Mozilla, the <code>contentView</code> property is actually a synonym for the <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/view">view</a></span></code> property, since the two interfaces are flattened together into a single interface in <a href="/en-US/docs/JavaScript" title="JavaScript">JavaScript</a>. This property is read-only.</dd>
-</dl></div> <div id="p-currentIndex">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/currentIndex">currentIndex</a></span></code></dt>
- <dd>
- Type: <em>integer</em></dd>
- <dd>
- <p>Set to the row index of the tree caret in the <code><a href="/en-US/docs/Mozilla/Tech/XUL/tree" title="tree">tree</a></code>. For trees with focus, the caret's position is indicated by the focus ring, but unfocused trees won't show  a focus ring, naturally. For unfocused trees, the (undrawn) caret's position can still be obtained by this property. If the caret isn't present for any row (for example, because the tree has never been focused), the value will be <code>-1</code>.</p>
- <p><strong>You cannot rely on this property to change or determine a tree selection</strong>, except for trees with <code><code id="a-seltype"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/seltype">seltype</a></code>="single"</code>. (All trees have <code>seltype="multiple"</code> by default.) To reliably change or determine a selection, instead use the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsITreeSelection" title="">nsITreeSelection</a></code> interface methods available via <code>tree.view.selection</code>.</p>
- </dd>
-</dl>
-</div> <div id="p-disabled">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/disabled">disabled</a></span></code></dt>
- <dd>
- Type:
- <i>
- boolean</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-disableKeyNavigation">
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/disableKeyNavigation">disableKeyNavigation</a></span></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>Gets or sets the value of the <code id="a-disableKeyNavigation"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/disableKeyNavigation">disableKeyNavigation</a></code> attribute.</dd>
-</dl></div> <div id="p-editingColumn">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/editingColumn">editingColumn</a></span></code> </dt>
- <dd>Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsITreeColumn" title="">nsITreeColumn</a></code></em></dd>
- <dd>The column of the <code><a href="/en-US/docs/Mozilla/Tech/XUL/tree" title="tree">tree</a></code> cell currently being edited, or <code>null</code> if there is no cell being edited.</dd>
-</dl></div> <div id="p-editingRow">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/editingRow">editingRow</a></span></code> </dt>
- <dd>Type: <em>integer</em></dd>
- <dd>The row index of the <a href="/en/XUL/tree" title="en/XUL/tree">tree</a> cell currently being edited, or <code>-1</code> if there is no cell currently being edited.</dd>
-</dl></div> <div id="p-enableColumnDrag">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/enableColumnDrag">enableColumnDrag</a></span></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>When set to <code>true</code>, the user may drag the column headers around to change the order in which they are displayed.</dd>
-</dl></div> <div id="p-firstOrdinalColumn">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/firstOrdinalColumn">firstOrdinalColumn</a></span></code></dt>
- <dd>Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XUL/treecol" title="treecol">treecol</a></code> element</em></dd>
- <dd>A reference to the first <code><a href="/en-US/docs/Mozilla/Tech/XUL/treecol" title="treecol">treecol</a></code> element, which or may not be the first column displayed in the tree.</dd>
-</dl></div> <div id="p-tree.inputField">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/tree.inputField">inputField</a></span></code></dt>
- <dd>Type: <em>textbox element</em></dd>
- <dd>Read-only property that holds the <code><a href="/en-US/docs/Mozilla/Tech/XUL/textbox" title="textbox">textbox</a></code> that is used for editing.</dd>
-</dl></div> <div id="p-selType">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/selType">selType</a></span></code> </dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- Gets and sets the value of the <code id="a-seltype"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/seltype">seltype</a></code> attribute.</dd>
-</dl>
-<p> </p></div> <div id="p-selstyle">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/selstyle">selstyle</a></span></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- If set to the value <code>primary</code>, only the label of the primary column will be highlighted when an item in the tree is selected. Otherwise, the entire row will be highlighted. To see the difference, compare the selection style in the folder list and the message list in Mozilla mail.</dd>
-</dl></div> <div id="p-tabIndex">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tabIndex">tabIndex</a></span></code></dt>
- <dd>
- Type:
- <i>
- integer</i>
- </dd>
- <dd>
- Gets and sets the value of the <code id="a-tabindex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tabindex">tabindex</a></code> attribute.</dd>
-</dl>
-
-<p></p></div> <div id="p-treeBoxObject">
-
-<dl>
- <dt><code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/treeBoxObject">treeBoxObject</a></span></code></dt>
- <dd>Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsITreeBoxObject" title="">nsITreeBoxObject</a></code></em></dd>
- <dd>The box object is responsible for rendering the <code><a href="/en-US/docs/Mozilla/Tech/XUL/tree" title="tree">tree</a></code> on the window. This object implements the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsITreeBoxObject" title="">nsITreeBoxObject</a></code> interface and contains functions for retrieving the cells at certain coordinates, redrawing cells and scrolling the tree. This property is equivalent to the <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/boxObject">boxObject</a></span></code> property.</dd>
-</dl></div> <div id="p-view">
-<dl>
- <dt>
- <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/view">view</a></span></code></dt>
- <dd>
- Type: <em><code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsITreeView" title="">nsITreeView</a></code></em></dd>
- <dd>
- The view for the <code><a href="/en-US/docs/Mozilla/Tech/XUL/tree" title="tree">tree</a></code>, which is the object which generates the data to be displayed. You can assign an object which implements <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsITreeView" title="">nsITreeView</a></code> to this property. Trees built from RDF or those which use <code><a href="/en-US/docs/Mozilla/Tech/XUL/treeitem" title="treeitem">treeitem</a></code>s directly will already have a view. Functions available in the view allow one to retrieve the data within the cells, and determine which rows are nested within others. For a complete list of view functions, see the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsITreeView" title="">nsITreeView</a></code> interface.</dd>
-</dl></div><p></p>
-
-<h3 id="Methods" name="Methods">Methods</h3>
-
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited from XUL element</strong><br> <small> <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span></small></p> <p><strong>Inherited from DOM element</strong><br> <small> <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code></small></p> </td> </tr> </tbody>
-</table> <dl>
- <dt><span id="m-startEditing"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/startEditing">startEditing( row, column )</a></code></span> </dt>
- <dd>Return type: <em>no return value</em></dd>
- <dd>Activates user editing of the given cell, which is specified by row index number and the <code><a href="/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsITreeColumn" title="">nsITreeColumn</a></code> in which it is located. The tree view's <code><a href="https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsITreeView#getCellText()">nsITreeView.getCellText()</a></code> method is called to obtain the cell contents.</dd>
-</dl> <dl>
- <dt><span id="m-stopEditing"><code><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Method/stopEditing">stopEditing( shouldaccept )</a></code></span> </dt>
- <dd>Return type: <em>no return value</em></dd>
- <dd>Stops editing the cell currently being edited. If the <code>shouldAccept</code> parameter is <code>true</code>, the cell's label is changed to the edited value (the tree view's <code><a href="https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsITreeView#setCellText()">nsITreeView.setCellText()</a></code> method is called to change the cell contents). Otherwise the cell label is reverted to the value it had prior to editing.</dd>
-</dl><p></p>
-
-<h3 id="Related" name="Related">Related</h3>
-
-<dl>
- <dt>Elements</dt>
- <dd><a href="/en/XUL/treecols" title="en/XUL/treecols">treecols</a>, <a href="/en/XUL/treecol" title="en/XUL/treecol">treecol</a>, <a href="/en/XUL/treechildren" title="en/XUL/treechildren">treechildren</a>, <a href="/en/XUL/treeitem" title="en/XUL/treeitem">treeitem</a>, <a href="/en/XUL/treerow" title="en/XUL/treerow">treerow</a>, <a href="/en/XUL/treecell" title="en/XUL/treecell">treecell</a> and <a href="/en/XUL/treeseparator" title="en/XUL/treeseparator">treeseparator</a>.</dd>
- <dt>Interfaces</dt>
- <dd><a href="/en/XPCOM_Interface_Reference/nsIAccessibleProvider" title="en/nsIAccessibleProvider">nsIAccessibleProvider</a>, <a href="/en/NsIDOMXULTreeElement" title="en/NsIDOMXULTreeElement">nsIDOMXULTreeElement</a>, <a href="/en/NsIDOMXULMultiSelectControlElement" title="en/NsIDOMXULMultiSelectControlElement">nsIDOMXULMultiSelectControlElement</a></dd>
-</dl>
-
-<h3 id="Script_Examples" name="Script_Examples">Script Examples</h3>
-
-<p>To have alternating colors for each row, use the style rules like the following: <small>pma at daffodil dot uk dot com</small></p>
-
-<pre class="script">treechildren::-moz-tree-row(selected) { background-color: #FFFFAA; }
-treechildren::-moz-tree-row(odd) { background-color: #EEEEEE; }
-treechildren::-moz-tree-row(odd, selected) { background-color: #FFFFAA; }
-treechildren::-moz-tree-cell-text(selected) { color: #000000; }
-treechildren::-moz-tree-cell-text(odd, selected) { color: #000000; }
-</pre>
-
-<p>If using a content tree view, use the following to get the value of the id attribute for each of the selected rows of a tree: <small>tcooper_mont at yahoo dot com</small></p>
-
-<pre class="script">var idList = [];
-var rangeCount = tree.view.selection.getRangeCount();
-for (var i = 0; i &lt; rangeCount; i++)
-{
- var start = {};
- var end = {};
- tree.view.selection.getRangeAt(i, start, end);
- for(var c = start.value; c &lt;= end.value; c++)
- {
- idList.push(tree.view.getItemAtIndex(c).firstChild.id);
- }
-}
-</pre>
-
-<p>The following returns a array of the indicies of the rows where the value is checked in a checkbox type column: <small>jfabre at ismans dot fr</small></p>
-
-<pre class="script">function getCellChecked(tree, columnid)
-{
- var arr = [];
- var column = tree.columns.getNamedColumn(columnid);
- for (var i = 0; i &lt; tree.view.rowCount; i++){
- if (tree.view.getCellValue(i, column) == 'true')
- arr.push(i);
- }
- return arr;
-}
-</pre>
-
-<p>To get the text value for a specific column (e.g. column 'age') from the currently focused row in the tree:</p>
-
-<pre class="script">var t = document.getElementById('mytree');
-document.title = t.view.getCellText(t.currentIndex,t.columns.getNamedColumn('age'));
-</pre>
-
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/adding_buttons/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/adding_buttons/index.html
deleted file mode 100644
index 607e4d0abc..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/adding_buttons/index.html
+++ /dev/null
@@ -1,98 +0,0 @@
----
-title: XUL_教程/增加一些按钮
-slug: Mozilla/Tech/XUL/Tutorial/Adding_Buttons
-tags:
- - XUL_教程
-translation_of: Archive/Mozilla/XUL/Tutorial/Adding_Buttons
----
-<p> </p>
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Creating_a_Window" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Adding_Labels_and_Images">下一页 »</a></p>
-</div><p></p>
-<p> </p>
-<p>在本章,我们将学习如何向window添加button。</p>
-<h3 id=".E6.B7.BB.E5.8A.A0.E5.A4.9A.E4.B8.AA.E6.8C.89.E9.92.AE.E5.88.B0.E4.B8.80.E4.B8.AA.E7.AA.97.E5.8F.A3" name=".E6.B7.BB.E5.8A.A0.E5.A4.9A.E4.B8.AA.E6.8C.89.E9.92.AE.E5.88.B0.E4.B8.80.E4.B8.AA.E7.AA.97.E5.8F.A3">添加多个按钮到一个窗口</h3>
-<p>到目前为止我们创建的这个窗口里面什么也没有,因此还不算非常有趣. 在这一节中,我们将添加两个按钮, 一个“查找”按钮和一个“取消”按钮.我们还将学到一个简单的方法在窗口上来定位它们.</p>
-<p>像HTML, XUL也有许多标记,它们被用来当作创建用户接口的元素. 最基本的一个 <code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/button" title="button">button</a></code></code> 标记. 这个元素被用来创建简单的按钮。</p>
-<p>按钮元素有两个主要的属性,一个<code>label</code>和一个<code>image</code>。你可以要一个或两个都要。因此,按钮可以只有一个标签,一个图片或标签和图片都有。通常在对话框中会使用“确定”和“取消”按钮。</p>
-<h4 id=".E6.8C.89.E9.92.AE.E7.9A.84.E8.AF.AD.E6.B3.95" name=".E6.8C.89.E9.92.AE.E7.9A.84.E8.AF.AD.E6.B3.95">按钮的语法</h4>
-<p><code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/button" title="button">button</a></code></code>标签有下面的语法要求:</p>
-<pre>&lt;button
- id="identifier"
- class="dialog"
- label="OK"
- image="images/image.jpg"
- disabled="true"
- accesskey="t"/&gt;
-</pre>
-<p>可用的属性如下,有一些是可选的:</p>
-<dl>
- <dt>
- <code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code> </dt>
- <dd>
- 你用来标识按钮的唯一标识。你会在所有的元素中看到此属性。你可以在样式表(style)或脚本(script)中通过它来引用按钮。因此,你几乎可以在所有的元素中添加这个属性。在这个教程中它不是一直都出现在元素中(It isn't always placed on elements in this tutorial for simplicity)。</dd>
- <dt>
- <code id="a-class"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/class">class</a></code> </dt>
- <dd>
- 按钮的样式表。在这里的用法和在HTML中是一样的。它是使用在显示按钮里面的样式。在这节中的<code>dialog</code>值就使用了。多数情况下,你不用在按钮上使用此属性。</dd>
- <dt>
- <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code> </dt>
- <dd>
- 标签会显示在按钮上。例如,“确定”或者“取消”。如果没人设置这个参数,在按钮上就不会显示文字。</dd>
- <dt>
- <code id="a-image"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/image">image</a></code> </dt>
- <dd>
- 在按钮上显示指定路径的图片。如果没有给出此属性,则不会显示图片。你通常可以使用如下的样式表属性<code><a href="/cn/CSS/list-style-image" title="cn/CSS/list-style-image">list-style-image</a></code>来指定要显示的图片。</dd>
- <dt>
- <code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code> </dt>
- <dd>
- 如果这个属性被设置为<code>true</code>,按钮就会被禁用。这样通常按钮上的文字将会显示为灰色(grey)。如果按钮被禁用,按钮上的功能就不可以被执行。如果这个属性没有设置,按钮就是启用的。你可以用<a href="/cn/JavaScript" title="cn/JavaScript">JavaScript</a>来对按钮的可用状态进行控制。</dd>
- <dt>
- <code id="a-accesskey"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/accesskey">accesskey</a></code> </dt>
- <dd>
- 这个属性让你可以设置一个字母它的功能就像是一个快捷键。这个字母会被划上下划线并显示在标签里。当用户按ALT键(或者在每个平台中一个功能类似的键)的同时按下这里设置的键时,不论按钮在窗口的任何地方都能取得到焦点。</dd>
-</dl>
-<p>注释:按钮支持比上面列出的更多的属性。其他的属性可以参考 <a href="/cn/XUL_教程/More_Button_Features" title="cn/XUL_教程/More_Button_Features">discussed later</a>.</p>
-<h4 id=".E6.9B.B4.E5.A4.9A.E7.9A.84.E6.8C.89.E9.92.AE.E4.BE.8B.E5.AD.90" name=".E6.9B.B4.E5.A4.9A.E7.9A.84.E6.8C.89.E9.92.AE.E4.BE.8B.E5.AD.90">更多的按钮例子</h4>
-<p><span id="Example_1"><a id="Example_1"></a><strong>Example 1</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_buttons_1.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_buttons_1.xul">View</a></p>
-<div class="float-right">
- <img alt="image:Buttons1.png" class="internal" src="/@api/deki/files/2609/=Buttons1.png"></div>
-<pre>&lt;button label="Normal"/&gt;
-&lt;button label="Disabled" disabled="true"/&gt;
-</pre>
-<p>上面的这些例子是在图片里面生成按钮。第一个按钮是一个标准的按钮。第二个按钮是禁用的,所以它整个显示为灰色。</p>
-<p>注:label属性不应该指定中文名称,否则解析xul时会报错。对于本地化,应该通过locale包来完成。</p>
-<p>我们将从为查找文件工具创建一个简单的查找按钮开始。下面这个例子的源码显示怎么去做这件事。</p>
-<pre>&lt;button id="find-button" label="Find"/&gt;
-</pre>
-<div class="note">
- 注释:Firefox不允许你从网页上打开chrome,因此查看教程中的链接时会显示在一个标准的浏览器窗口中。至此,按钮会显示在窗口中间并自动伸展。你可以增加align="start"到window标签阻止其自动伸展。</div>
-<div class="highlight">
- <h5 id=".E4.BE.8B.E5.AD.90_findfile.xul" name=".E4.BE.8B.E5.AD.90_findfile.xul">例子 findfile.xul</h5>
- <p>请添加我们在前面章节创建的这些代码到findfile.xul文件。这些代码必须插入到 <code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/window" title="window">window</a></code></code> 标签里面。代码是下面红色显示的部份:</p>
- <pre class="eval">&lt;?xml version="1.0"?&gt;
-&lt;?xml-stylesheet href="<a class="external" rel="freelink">chrome://global/skin/</a>" type="text/css"?&gt;
-&lt;window
- id="findfile-window"
- title="Find Files"
- orient="horizontal"
- xmlns="<span class="nowiki">http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul</span>"&gt;
-
- <span class="highlightred">&lt;button id="find-button" label="Find"/&gt;</span>
- <span class="highlightred">&lt;button id="cancel-button" label="Cancel"/&gt;</span>
-
-&lt;/window&gt;
-</pre>
- <div class="float-right">
- <img alt="Image:buttons2.png" class="internal" src="/@api/deki/files/2652/=Buttons2.png"></div>
- <p>你也可以注释掉“取消”按钮。窗口提供水平对齐地显示两个按钮。如果你在Mozilla中打开这个文件,你就可以获得和这里显示的图片一样的效果。</p>
-</div>
-<p> </p>
-<div class="note">
- 注解:我们不能直接在XUL文件中写文本标签。我们可以使用 <a href="/Cn/XUL_教程/本地化" title="Cn/XUL_教程/本地化">实体替换这样文本可以很容易地进行翻译</a>.</div>
-<p>在下一节,我们将会学会怎么<a href="/cn/XUL_教程/增加标签和图像" title="cn/XUL_教程/增加标签和图像">向窗口中增加标签和图片</a>。</p>
-<p><small>查看更多参考 <a href="/cn/XUL_教程/更多的按钮特性" title="cn/XUL_教程/更多的按钮特性">更多按钮特性</a></small></p>
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Creating_a_Window" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Adding_Labels_and_Images">下一页 »</a></p>
-</div><p></p>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/adding_event_handlers/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/adding_event_handlers/index.html
deleted file mode 100644
index ef85e01bd1..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/adding_event_handlers/index.html
+++ /dev/null
@@ -1,161 +0,0 @@
----
-title: 添加事件处理函数
-slug: Mozilla/Tech/XUL/Tutorial/Adding_Event_Handlers
-translation_of: Archive/Mozilla/XUL/Tutorial/Adding_Event_Handlers
----
-<p><span style="float: left;">« <a href="../../../../en/XUL_Tutorial/Scrolling_Menus" rel="internal">Previous</a></span> <span style="float: right;"><a href="../../../../en/XUL_Tutorial/More_Event_Handlers" rel="internal">Next</a> »</span></p>
-
-<p> </p>
-
-<p>  </p>
-
-<p> </p>
-
-<p>    到此为止我们的 findfile 看起来很棒。我们还没有搞定它,因为到此为止我们仅只是建立了一个简单的用户界面。接下来我们将给他添加脚本。</p>
-
-<div id="section_1">
-<h3 class="editable" id="使用脚本"><span>使用脚本</span></h3>
-
-<div class="editIcon"><a href="/../../../../en/XUL_Tutorial/Adding_Event_Handlers#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
-
-<p>    为了使 find files 对话框工作,我们需要添加一些脚本来完成与用户的交互。我们想要为查找按钮、取消按钮以及各级菜单项添加脚本。我们会像在 <a href="../../../../en/HTML" rel="internal">HTML</a> 中一样使用 <a href="../../../../en/JavaScript" rel="internal">JavaScript</a> 来写一些函数。</p>
-
-<p>    你可以使用 <code><span class="lang lang-en"><a href="../../../../en/XUL/script" rel="internal">script</a> <span style="font-family: verdana,tahoma,sans-serif;">元素为</span></span></code> XUL 文件引入脚本。你可以直接在<code> &lt;script&gt;</code>  <code>&lt;/</code><code>script&gt;</code>标签之间嵌入脚本,但是最好是使用独立的文件来包含脚本,这样 XUL 窗口加载会快一些。 <code><span class="lang lang-en"><a href="../../../../en/XUL/Attribute/src" rel="internal">src</a> <span style="font-family: verdana,tahoma,sans-serif;">属性用于引入外部脚本文件。</span></span></code></p>
-
-<div class="highlight">
-<div id="section_2">
-<h5 class="editable" id="find_files_的例子"><span> find files 的例子</span></h5>
-
-<div class="editIcon"><a href="/../../../../en/XUL_Tutorial/Adding_Event_Handlers#" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
-
-<p>    让我们为 find file 对话框添加脚本。尽管脚本文件的文件名无关紧要,但通常的它采用与 XUL 文件相同的文件名并以 .js 作为后缀。我们建立一个 findfile.js 文件。把下面的一行加到 <code><span class="lang lang-en"><a href="../../../../en/XUL/window" rel="internal">window</a> 开标记之后,所有元素<strong>之前</strong>。</span></code></p>
-
-<pre class="eval"><span class="highlightred">&lt;script src="findfile.js"/&gt;</span>
-</pre>
-
-<p>    当我们知道改在脚本文件里添加什么之后,我们再建立这个文件。我们会在这个文件中定义一些函数,并且我们把这些函数称为事件处理函数。</p>
-</div>
-</div>
-
-<p>    你可以通过使用多个 <code>script</code> 标记向 XUL 文件添加多个脚本文件,此时你可以使用相对或绝对 URLs。比如下面的例子:</p>
-
-<pre class="eval">&lt;script src="findfile.js"/&gt;
-&lt;script src="<a class="external" rel="freelink">chrome://findfiles/content/help.js</a>"/&gt;
-&lt;script src="<a class="external" href="http://www.example.com/js/items.js" rel="freelink">http://www.example.com/js/items.js</a>"/&gt;
-</pre>
-
-<p>    本教程不涉及与事件处理无关的 JavaScript 的使用。因为这实在有太多的内容需要讲述,而且也可以从很多其他其他的资料获得所需的知识。</p>
-
-<div class="note">默认的 JavaScript 仅在页面上显示错误。为了显示在 chrome JavaScript 中的错误,有必要更改以下设置: <code>javascript.options.showInConsole = true</code><br>
-如果设置<code> javascript.options.strict = true</code> 那么任何不标准的,写法不良的,有语法上导致逻辑错误的,都将会写到日志中。</div>
-</div>
-
-<div id="section_3">
-<h3 class="editable" id="响应事件"><span>响应事件</span></h3>
-
-<div class="editIcon"><a href="/../../../../en/XUL_Tutorial/Adding_Event_Handlers#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
-
-<p>    脚本需要响应一系列的事件包括用户触发的或是其他状态引起的。起码有三种不同的事件需要用不同的方法来处理。一种是用户按下鼠标键或是按下一个键盘按键。每一个 XUL 元素都有能力在不同的状态触发特定事件。一些事件仅由特定元素触发。</p>
-
-<p>    每一个事件都有一个名字,如 'mousemove' 是用户在一个 UI 元素上移动鼠标所触发的事件。XUL 与 <a class="external" href="http://www.w3.org/TR/DOM-Level-2-Events/" rel="external nofollow" title="http://www.w3.org/TR/DOM-Level-2-Events/">DOM Events</a>使用同样的机制来处理事件。当一个动作发生就会触发一个事件,比如用户移动鼠标,就会由一个相应类型的事件对象产生。 事件对象中包含一系列的属性包括:鼠标位置,哪个键被按下等。</p>
-
-<p>    事件按阶段被发送到 XUL。</p>
-
-<ul>
- <li>路由阶段,事件先发送到窗口,然后是文件,沿着继承关系向下传递直到到达触发元素。</li>
- <li>目标阶段,事件被发送的目标元素。</li>
- <li>返回阶段,事件被逐级上传直到回到窗口。</li>
-</ul>
-
-<p>    可以在路由及返回阶段响应事件。一旦事件完成以上传播过程而为得以处理将使用默认的动作来处理该事件。</p>
-
-<p>    比如,当鼠标在一个包含在 box 中的按钮上移动时,产生一个 'mousemove' 事件,这个事件先被发送到窗口,紧接着是文件,然后是这个 box ,这样就完成了路由过程。然后事件被发送给按钮。最后,返回阶段,事件被发给 box、文件及窗口。返回阶段本质上是路由过程的逆过程。需要说明的是,有些事件没有返回阶段。</p>
-
-<p>    在事件传播的每一个阶段你都可以在任何元素上监听。由于事件会传递给所有祖先你可以在继承关系的更高层来添加监听器。当然,一个高层收到事件会通知它的全部子元素,而对于按钮的事件仅属于这个按钮。这一点对与你希望使用同样的代码控制一些元素是有用的。</p>
-
-<p>    大多数公共事件使用 'command' 事件。 当使用者启动一个元素 command 事件会被触发,例如按按钮,选择菜单项等。对与不同的触发元素 command 会自动的按照不同的方式进行处理,比如,无论用户是使用鼠标点击按钮还是通过快捷键都会触发 command 事件。</p>
-
-<p>    有两种办法来为一个元素添加事件监听器。其一,把脚本本身作为其属性;其二,使用元素的 <code>addEventListener</code> 方法。 前者只处理返回事件但写起来更方便。后者可以控制事件的任何阶段,并且对同一个元素、事件可以使用多个监听器。对大多数元素来说,更多的使用属性的方式。</p>
-</div>
-
-<div id="section_4">
-<h3 class="editable" id="事件监听器属性"><span>事件监听器属性</span></h3>
-
-<div class="editIcon"><a href="/../../../../en/XUL_Tutorial/Adding_Event_Handlers#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
-
-<p>    使用属性形式,在你希望监听的元素上加一个属性,名字是待监听的事件名前加'on'。如,为了响应事件  'command' 属性名为 'oncommand'。属性值是处理此事件的一段脚本。通常代码短小,或者就是调用独立脚本文件中的函数。下面的例子响应按钮按下。</p>
-
-<p><span class="lang lang-en"><span id="Example_1"><strong>Example 1</strong></span> </span> : <span class="lang lang-en"><a class="external" href="http://developer.mozilla.org/samples/xultu/examples/ex_events_1.xul.txt" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples/ex_events_1.xul.txt">Source</a> <a class="external" href="http://developer.mozilla.org/samples/xultu/examples/ex_events_1.xul" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples/ex_events_1.xul">View</a> </span></p>
-
-<pre class="eval">&lt;button label="OK" oncommand="alert('Button was pressed!');"/&gt;
-</pre>
-
-<p>    由于 'command' 事件会返回,也可以把事件监听器添加到封装元素中。下面的例子监听器会响应全部两元素。</p>
-
-<p><span class="lang lang-en"><span id="Example_2"><strong>Example 2</strong></span> </span> : <span class="lang lang-en"><a class="external" href="http://developer.mozilla.org/samples/xultu/examples/ex_events_2.xul.txt" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples/ex_events_2.xul.txt">Source</a> <a class="external" href="http://developer.mozilla.org/samples/xultu/examples/ex_events_2.xul" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples/ex_events_2.xul">View</a> </span></p>
-
-<pre class="eval">&lt;vbox oncommand="alert(event.target.tagName);"&gt;
- &lt;button label="OK"/&gt;
- &lt;checkbox label="Show images"/&gt;
-&lt;/vbox&gt;
-</pre>
-
-<p>    在这个例子中,command 事件会有 button 或 checkbox 返回到设置了事件处理的 vbox 上。如果在按钮上在加一个监听器 (<code>oncommand</code> 属性) ,按钮上的代码会先调用,然后是 vbox 的。事件处理函数会传递一个隐含参数 'event',这参数可以获得事件的额外信息。一个常用的属性是 'target' ,它保存着事件是由谁产生的。这个例子里,显示事件产生者的标签名。target 很有用,因为你可以在一段代码里为一系列按钮作响应。</p>
-
-<p>    你可能注意到这里使用的语法与 HTML 中的一样。事实上, HTML 和 XUL 共用统计的事件机制。一个重要的不同是 'click' 事件 (或  <code>onclick</code> 属性) 在 HTML 中它仅用于响应按钮,而在 XUL 中 command 事件被用于替代它。XUL 有一个 click 事件,但是仅响应鼠标点击,不响应键盘。因此点击事件在XUL中应避免使用,除非你希望一个元素仅可以通过鼠标触发。补充一下,如果元素的 disable 属性为 true 时 command 事件不会被发送,而 click 事件则不然。</p>
-
-<div class="highlight">
-<div id="section_5">
-<h5 class="editable" id="find_files_的例子_2"><span>find files 的例子</span></h5>
-
-<div class="editIcon"><a href="/../../../../en/XUL_Tutorial/Adding_Event_Handlers#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
-
-<p>     command 处理器可以用于响应查找和取消按钮,按查找按钮开始查找,当然由于我们没有实现这部分,我们现在还不能,这部分我们以后再完成,按取消按钮关闭窗口,下面的代码显示怎么做。并且我们也为关闭菜单也写了相同的代码。</p>
-
-<pre class="eval">&lt;menuitem label="Close" accesskey="c" <span class="highlightred">oncommand="window.close();"</span>/&gt;
-...
-
-&lt;button id="cancel-button" label="Cancel"
- <span class="highlightred">oncommand="window.close();</span>"/&gt;
-</pre>
-
-<p>      这里加了两个处理器。<code>oncommand</code> 被加到关闭菜单项中了。通过使用这个处理器,用户可以使用鼠标点击菜单或使用键盘来选择此菜单来关闭窗口。<code>oncommand</code> 处理器也加到了取消按钮上。</p>
-</div>
-</div>
-</div>
-
-<h3 class="editable" id="DOM_事件监听器"><span>DOM 事件监听器</span></h3>
-
-<div class="editIcon"><a href="/../../../../en/XUL_Tutorial/Adding_Event_Handlers#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
-
-<p>    为一个元素添加事件处理的另一种方法是使用元素的 addEventListener 方法,这允许你动态的监听事件或在路由阶段处理事件。语法如下。</p>
-
-<p><span class="lang lang-en"><span id="Example_3"><strong>Example 3</strong></span> </span> : <span class="lang lang-en"><a class="external" href="http://developer.mozilla.org/samples/xultu/examples/ex_events_3.xul.txt" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples/ex_events_3.xul.txt">Source</a> <a class="external" href="http://developer.mozilla.org/samples/xultu/examples/ex_events_3.xul" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples/ex_events_3.xul">View</a> </span></p>
-
-<pre>&lt;button id="okbutton" label="OK"/&gt;
-
-&lt;script&gt;
-function buttonPressed(event){
- alert('Button was pressed!');
-}
-
-var button = document.getElementById("okbutton");
-button.addEventListener('command', buttonPressed, true);
-&lt;/script&gt;
-</pre>
-
-<p>     <code><a href="../../../../en/DOM/document.getElementById" rel="internal">getElementById()</a></code> 函数返回给定 id 的元素,这里返回这个按钮。<code><a href="../../../../en/DOM/element.addEventListener" rel="internal">addEventListener()</a></code> 函数新建一个路由阶段的事件监听器。第一个参数是待监听的事件名,第而个参数是事件发生时要调用的函数名,最后一个参数如是 <code>true</code> 表示这是一个路由阶段的监听器,设为 false 则监听返回阶段。作为事件处理函数的第二个参数需要带一个参数(这个事件对象),就像上面定义的 <code>buttonPressed</code> 函数一样。</p>
-
-<div class="highlight"><span class="lang lang-en"><span id="Find_files_example_so_far"><strong>Find files example so far</strong></span> </span> : <span class="lang lang-en"><a class="external" href="http://developer.mozilla.org/samples/xultu/examples//findfile/findfile-events.xul.txt" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples//findfile/findfile-events.xul.txt">Source</a> <a class="external" href="http://developer.mozilla.org/samples/xultu/examples//findfile/findfile-events.xul" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples//findfile/findfile-events.xul">View</a> </span></div>
-
-<p> </p>
-
-<p>    接下来,我们详细的看看 <a href="../../../../en/XUL_Tutorial/More_Event_Handlers" rel="internal">事件对象</a>(<a href="../../../../en/XUL_Tutorial/More_Event_Handlers" rel="internal">event object</a>)。</p>
-
-<p> </p>
-
-<div class="prevnext">
-<p><span style="float: left;">« <a href="../../../../en/XUL_Tutorial/Scrolling_Menus" rel="internal">Previous</a></span> <span style="float: right;"><a href="../../../../en/XUL_Tutorial/More_Event_Handlers" rel="internal">Next</a> »</span></p>
-</div>
-
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/adding_html_elements/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/adding_html_elements/index.html
deleted file mode 100644
index 6e1f8c38c6..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/adding_html_elements/index.html
+++ /dev/null
@@ -1,113 +0,0 @@
----
-title: XUL_教程/增加HTML元素
-slug: Mozilla/Tech/XUL/Tutorial/Adding_HTML_Elements
-tags:
- - XUL_教程
-translation_of: Archive/Mozilla/XUL/Tutorial/Adding_HTML_Elements
----
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Progress_Meters" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Using_Spacers">下一页 »</a></p>
-</div><p></p>
-<p> </p>
-<h3 id=".E5.A2.9E.E5.8A.A0HTML.E5.85.83.E7.B4.A0.E5.88.B0.E7.AA.97.E5.8F.A3" name=".E5.A2.9E.E5.8A.A0HTML.E5.85.83.E7.B4.A0.E5.88.B0.E7.AA.97.E5.8F.A3">增加HTML元素到窗口</h3>
-<p>除了可以使用XUL的所有元素,你也可以直接将HTML元素添加到XUL文件的内部。现在你可以在XUL文件中使用任意的HTML元素,意思是说可以在窗口中布置JAVA小应用程序(applet)和表格。如果可以你应该避免在XUL文件中使用HTML元素。(这是有原因的,主要涉及<a href="/cn/XUL_教程/Box_Model_Details" title="cn/XUL_教程/Box_Model_Details">版面的控制</a>这将在后面进行描述)。然而,不管怎样这节将描述如何使用它们。记住XML是大小写敏感的,因此你必须用小写输入标签和属性。</p>
-<h4 id="XHTML.E5.91.BD.E5.90.8D.E7.A9.BA.E9.97.B4.28namespace.29" name="XHTML.E5.91.BD.E5.90.8D.E7.A9.BA.E9.97.B4.28namespace.29">XHTML命名空间(namespace)</h4>
-<p>为了在XUL文件中使用HTML元素,你必须声明你要用到的XHTML命令空间。这个方法是Mozilla从XUL中区分HTML标签的。 下面的属性应该加在XUL文件的<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/window" title="window">window</a></code></code> 标签中,或者放到HTML元素的最外面。</p>
-<pre class="eval"><span class="nowiki">xmlns:html="http://www.w3.org/1999/xhtml"</span>
-</pre>
-<p>这个HTML的声明很像我们用过的XUL声明。要正常显示必须正确地输入这句,否则它不能正常运行。注意:Mozilla不会去下载这个URL的内容,但它会在运行HTML时对它进行验证。</p>
-<p>这是一个可以加到文件查找窗口的例子:</p>
-<pre class="eval"> &lt;?xml version="1.0"?&gt;
- &lt;?xml-stylesheet href="<a class="external" rel="freelink">chrome://global/skin/</a>" type="text/css"?&gt;
- &lt;window
- id="findfile-window"
- title="Find Files"
- orient="horizontal"
- <span class="highlightred"><span class="nowiki">xmlns:html="http://www.w3.org/1999/xhtml"</span></span>
- xmlns="<span class="nowiki">http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul</span>"&gt;
-</pre>
-<p>因此,你可以像平常一样使用HTML,下面列出需注意的守则:</p>
-<ul>
- <li>你必须在每个标检的开始增加一个<code>html:</code>的前缀,像上面一样声明的HTML命名空间。</li>
- <li>标签<em>必须用小写输入</em>.</li>
- <li>"双引号" 必须完全把所有的属性值括起来。</li>
- <li>在没有内容的XML标签的末端(&gt;)前一定要加上结束符(/),下面的例子很清楚地进行了示范。</li>
-</ul>
-<h4 id=".E4.BD.BF.E7.94.A8HTML.E5.85.83.E7.B4.A0" name=".E4.BD.BF.E7.94.A8HTML.E5.85.83.E7.B4.A0">使用HTML元素</h4>
-<p>你可以像<code>head</code> 和 <code>body</code>使用所有的HTML标签,不是真的有益。下面演示一些使用HTML元素的例子。</p>
-<pre>&lt;html:img src="banner.jpg"/&gt;
-
-&lt;html:input type="checkbox" value="true"/&gt;
-
-&lt;html:table&gt;
- &lt;html:tr&gt;
- &lt;html:td&gt;
- A simple table
- &lt;/html:td&gt;
- &lt;/html:tr&gt;
-&lt;/html:table&gt;
-</pre>
-<p>这些示例将从banner.jpg创建一个图像,一个多选项和一个只有一个单元格的表。如果XUL的特性是可用的你应该总是使用它们并且你不应该在XUL中使用表格作为布局。(XUL有自己的布局元素可以用)。注意<code>html:</code>前缀需要添加到每个标签的前面。这是Mozilla为什么会知道它是一个HTML标签而不是一个XUL标签。如果你没有加上<code>html:</code>部份,浏览器就会认为元素是一个XUL元素并且它们不能被正常显示,因为 img, input, table, 等都不是有效的XUL标签。</p>
-<p>在XUL,你可以使用<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/description" title="description">description</a></code></code>或<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/label" title="label">label</a></code></code>元素添加文本标签。当你要用时应该使用这些元素。你也可以使用HTML的<code>label</code>元素添加文本标签的操作或者你可以像下面的例子一样简单地将文本放在不同的HTML元素之间(就像<code>p</code>或<code>div</code>)。</p>
-<p><span id="%E4%BE%8B1"><a id="%E4%BE%8B1"></a><strong>例1</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_htmlelem_1.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_htmlelem_1.xul">View</a></p>
-<pre>&lt;html:p&gt;
- 搜索:
- &lt;html:input id="find-text"/&gt;
- &lt;button id="okbutton" label="确定"/&gt;
-&lt;/html:p&gt;
-</pre>
-<p>这段代码的目的是显示'搜索:',接着显示一个文本输入框元素和一个确定按钮。注意XUL按钮可以显示在HTML元素之间,在这里它可以正常使用。在HTML元素之间的纯文本仅仅用来显示通常用来显示文字(就像<code>p</code>标签)。放在外面的文本是不能被显示的,除非XUL元素允许将文本放在里面(例如:<code>description</code>元素)。下面的例子可以帮助你理解。</p>
-<h3 id="HTML.E5.85.83.E7.B4.A0.E7.9A.84.E5.AE.9E.E4.BE.8B" name="HTML.E5.85.83.E7.B4.A0.E7.9A.84.E5.AE.9E.E4.BE.8B">HTML元素的实例</h3>
-<p>下面是在窗口在添加HTML元素的一些例子。在每个例子的窗口边都能找到简单的说明信息。</p>
-<h4 id=".E5.B8.A6.E5.A4.9A.E9.80.89.E6.A1.86.E7.9A.84.E5.AF.B9.E8.AF.9D.E6.A1.86" name=".E5.B8.A6.E5.A4.9A.E9.80.89.E6.A1.86.E7.9A.84.E5.AF.B9.E8.AF.9D.E6.A1.86">带多选框的对话框</h4>
-<p><span id="%E4%BE%8B2"><a id="%E4%BE%8B2"></a><strong>例2</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_htmlelem_2.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_htmlelem_2.xul">View</a></p>
-<div class="float-right">
- <img alt="Image:htmlelem-ex1.png" class="internal" src="/@api/deki/files/2661/=Htmlelem-ex1.png"></div>
-<pre>&lt;html:p&gt;
- 点击下面方框会记住这个结果。
- &lt;html:p&gt;
- &lt;html:input id="rtd" type="checkbox"/&gt;
- &lt;html:label for="rtd"&gt;记住这个结果&lt;/html:label&gt;
- &lt;/html:p&gt;
-&lt;/html:p&gt;
-</pre>
-<p>在这个例子,一个 <code>p</code> 标签用来放置文本,另外一人用来放置分离的多行文本。</p>
-<h4 id=".E5.9C.A8HTML.E5.9D.97.E5.A4.96.E9.9D.A2.E7.9A.84.E6.96.87.E6.9C.AC" name=".E5.9C.A8HTML.E5.9D.97.E5.A4.96.E9.9D.A2.E7.9A.84.E6.96.87.E6.9C.AC">在HTML块外面的文本</h4>
-<p><span id="%E4%BE%8B3"><a id="%E4%BE%8B3"></a><strong>例3</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_htmlelem_3.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_htmlelem_3.xul">View</a></p>
-<div class="float-right">
- <img alt="Image:htmlelem-ex2.png" class="internal" src="/@api/deki/files/2662/=Htmlelem-ex2.png"></div>
-<pre>&lt;html:div&gt;
- 你想保存下面的文档吗?
- &lt;html:hr/&gt;
-&lt;/html:div&gt;
-Expense Report 1
-What I Did Last Summer
-&lt;button id="yes" label="Yes"/&gt;
-&lt;button id="no" label="No"/&gt;
-</pre>
-<p>从图像上可以看到,在<code>div</code>标签里面的文本可以显示出来但其它的文本没有显示(Expense Report 1 和 What I Did Last Summer)。这是因为要显示的文本没有被HTML或XUL元素围绕起来。要显示这些文本,你必须将它放在<code>div</code>标签里面,或者用<code>description</code> 标签将它围起来。</p>
-<h4 id=".E6.97.A0.E6.95.88.E7.9A.84HTML.E5.85.83.E7.B4.A0" name=".E6.97.A0.E6.95.88.E7.9A.84HTML.E5.85.83.E7.B4.A0">无效的HTML元素</h4>
-<pre>&lt;html:po&gt;Case 1&lt;/html:po&gt;
-&lt;div&gt;Case 2&lt;/div&gt;
-&lt;html:description value="Case 3"/&gt;
-</pre>
-<p>上面这三个样例不能被显示,每个都有一个不同的原因。</p>
-<dl>
- <dt>
- 样例1 </dt>
- <dd>
- <code>po</code>不是一个正确的HTML标签,所以Mozilla不知怎么去处理它。</dd>
- <dt>
- 样例2 </dt>
- <dd>
- <code>div</code>是有效的,但是只能用在HTML中。如果要在这里使用,你必须为它添加html:限定符。</dd>
- <dt>
- 样例3 </dt>
- <dd>
- <code>description</code>元素仅仅在XUL中是有效的,而不是在HTML中。它不可以有html:限定符。</dd>
-</dl>
-<p>接下来,我们将要学习如何用 <a href="/cn/XUL_教程/使用定位格" title="cn/XUL_教程/使用定位格">在元素间添加定位格</a>.</p>
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Progress_Meters" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Using_Spacers">下一页 »</a></p>
-</div><p></p>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/adding_labels_and_images/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/adding_labels_and_images/index.html
deleted file mode 100644
index e3850373fc..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/adding_labels_and_images/index.html
+++ /dev/null
@@ -1,40 +0,0 @@
----
-title: XUL_教程/增加标签和图像
-slug: Mozilla/Tech/XUL/Tutorial/Adding_Labels_and_Images
-translation_of: Archive/Mozilla/XUL/Tutorial/Adding_Labels_and_Images
----
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Adding_Buttons" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Input_Controls">下一页 »</a></p>
-</div> <p></p>
-<p> </p>
-<p>这一章描述了向窗口中加入标签和图像的方法。另外,我们将看到如何将一些元素包含到一个组中。</p>
-<h3 id=".E6.96.87.E6.9C.AC.E5.85.83.E7.B4.A0" name=".E6.96.87.E6.9C.AC.E5.85.83.E7.B4.A0">文本元素</h3>
-<p>在不使用标记的情况下,你不能直接向XUL文件中插入文本,它也不会做任何显示。为了达到这个目的你使用如下两个XUL元素来完成。</p>
-<h4 id=".E6.A0.87.E7.AD.BE.E5.85.83.E7.B4.A0" name=".E6.A0.87.E7.AD.BE.E5.85.83.E7.B4.A0">标签元素</h4>
-<p>将文本加入到将文本加入到窗体中的一个最基本的方法就是使用<code><a href="/zh-CN/docs/Mozilla/Tech/XUL/label" title="label">label</a></code>元素。请看下面的例子:</p>
-<p><span id="Example_1"><a id="Example_1"></a><strong>Example 1</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_textimage_1.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_textimage_1.xul">View</a></p>
-<pre>&lt;label value="This is some text"/&gt;
-</pre>
-<p><code><code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code></code>属性被用于指定要显示的文本。这样设置的文本在显示的时候不会换行,所以适合于较短的文本。这种语法适用于多数情况中使用的标签。</p>
-<p>如果文本需要换行,你可以如下例所示将文本放在开启和关闭元素之间:</p>
-<p><span id="Example_2"><a id="Example_2"></a><strong>Example 2</strong></span> :</p>
-<pre>&lt;label&gt;This is some longer text that will wrap onto several lines.&lt;/label&gt;
-</pre>
-<p>就像HTML,换行和多余的空格将被压缩为一个空格。 接下来, 我们可以在 <a href="/cn/XUL_Tutorial/Element_Positioning" title="cn/XUL_Tutorial/Element_Positioning">找到怎么去控制元素的宽度</a> 这样我们就可以很容易地控制换行。</p>
-<h5 id=".E6.93.8D.E4.BD.9C.28Control.29.E5.B1.9E.E6.80.A7" name=".E6.93.8D.E4.BD.9C.28Control.29.E5.B1.9E.E6.80.A7">操作(Control)属性</h5>
-<p>你可以使用 <code><code id="a-control"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/control">control</a></code></code> 属性去设置关联的标签。当用户在标签上进行点击操作时,已关联的控件就会被触发。<a href="/cn/Accessibility" title="cn/Accessibility">accessibility</a>这种关联的辅助操作很重要,这样屏幕阅读器就可以对选中的文本进行语音提示。设置<code>control</code>属性的值会触发与这个值对应的<code><code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code></code>的元素。 <span id="Example_3"><a id="Example_3"></a><strong>Example 3</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_textimage_3.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_textimage_3.xul">View</a></p>
-<pre>&lt;label value="Click here:" control="open-button"/&gt;
-&lt;button id="open-button" label="Open"/&gt;
-</pre>
-<p>在上面这个例子中,在标签上点击会使得按钮被触发。</p>
-<h4 id=".E6.8F.8F.E8.BF.B0.28Descriptive.29.E5.85.83.E7.B4.A0" name=".E6.8F.8F.E8.BF.B0.28Descriptive.29.E5.85.83.E7.B4.A0">描述(Descriptive)元素</h4>
-<p>在没有一些特定的关联操作的文本时你可以使用 <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/description" title="description">description</a></code> 标签。 这个元素使用于在对话框的上面或实例的一组控制的文本提示信息. 与 <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/label" title="label">label</a></code> 元素一样, 你既可以在 <code>value</code> 属性中指定单行的文本也可以在开合标签之间填充一大块的文本。在描述元素的大多数属性和文本内容的语法是与标签元素(label)是一样的。</p>
-<p><span id="%E4%BE%8B4"><a id="%E4%BE%8B4"></a><strong>例4</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_textimage_2.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_textimage_2.xul">View</a></p>
-<pre>&lt;description&gt;
- This longer section of text is displayed.
-&lt;/description&gt;
-</pre>
-<p>从内部看, 标签元素(<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/label" title="label">label</a></code></code>)和描述元素( <code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/description" title="description">description</a></code></code>)是相同的。标签元素(<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/label" title="label">label</a></code></code>)用于有操作的标签,就像一个文本框(text field)。 操作属性仅仅为标签提供支持。 描述元素(<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/description" title="description">description</a></code></code>)用于其他描述性的情况,如对话框(<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/dialog" title="dialog">dialog</a></code></code>)上面的提示信息文本。</p>
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Adding_Buttons" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Input_Controls">下一页 »</a></p>
-</div><p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/adding_more_elements/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/adding_more_elements/index.html
deleted file mode 100644
index 9af4cc954f..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/adding_more_elements/index.html
+++ /dev/null
@@ -1,115 +0,0 @@
----
-title: 增加更多的元素
-slug: Mozilla/Tech/XUL/Tutorial/Adding_More_Elements
-translation_of: Archive/Mozilla/XUL/Tutorial/Adding_More_Elements
----
-<div class="pageTitle">
- <h1 id="添加元素">添加元素</h1>
-</div>
-<div id="page-top">
- <div class="pageText" id="pageText">
- <p> </p>
- <p> </p>
- <div class="prevnext">
- <p><span style="float: left;">« <a href="../../../../en/XUL_Tutorial/Groupboxes" rel="internal">Previous</a></span> <span style="float: right;"><a href="../../../../en/XUL_Tutorial/Stacks_and_Decks" rel="internal">Next</a> »</span></p>
- </div>
- <p>  </p>
- <p> </p>
- <p>    我们继续通过为findfile对话框添加一些box来讨论box。</p>
- <div class="highlight">
- <div id="section_1">
- <h3 class="editable" id="为_find_files_的例子添加元素"><span>为 find files 的例子添加元素</span></h3>
- <div class="editIcon">
- <a href="../../../../en/XUL_Tutorial/Adding_More_Elements#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    现在我们将为findfile对话框添加一些元素,首先添加选择其他检索信息的能力(如尺寸和数据):</p>
- <pre class="eval">&lt;hbox&gt;
- <span class="highlightred">&lt;menulist id="searchtype"&gt;
- &lt;menupopup&gt;
- &lt;menuitem label="Name"/&gt;
- &lt;menuitem label="Size"/&gt;
- &lt;menuitem label="Date Modified"/&gt;
- &lt;/menupopup&gt;
- &lt;/menulist&gt;
- &lt;spacer style="width: 10px;"/&gt;
- &lt;menulist id="searchmode"&gt;
- &lt;menupopup&gt;
- &lt;menuitem label="Is"/&gt;
- &lt;menuitem label="Is Not"/&gt;
- &lt;/menupopup&gt;
- &lt;/menulist&gt;
- &lt;spacer style="width: 10px;"/&gt;</span>
- &lt;textbox id="find-text" flex="1" style="min-width: 15em;"/&gt;
-&lt;/hbox&gt;
-</pre>
- <div class="float-right">
- <img alt="Image:boxfinal1.png" class="internal" src="../../../../@api/deki/files/567/=Boxfinal1.png"></div>
- <p>    加了两个 <a href="../../../../en/XUL_Tutorial/List_Controls#_Drop-down_Lists" rel="internal">drop down boxes</a> 。一个 <a href="../../../../en/XUL_Tutorial/Using_Spacers" rel="internal">spacer</a> 加进来用于分割各元素,每个空白有10像素,你会看到当窗口尺寸改变时,文本框会改变尺寸而其他元素不会 ,也会看到标签被移除了。</p>
- <p>    如果垂直的改变窗口尺寸,元素不会改变尺寸,这是因为他们在水平的box中。 Find 和 Cancel 按钮总在春光看的底部是合适的。这很容易通过在两个水平box间添加空白实现。</p>
- <pre class="eval"><span class="highlightred">&lt;spacer style="height: 10px"/&gt;</span>
-&lt;hbox&gt;
- &lt;menulist id="searchtype"&gt;
- &lt;menupopup&gt;
- &lt;menuitem label="Name"/&gt;
- &lt;menuitem label="Size"/&gt;
- &lt;menuitem label="Date Modified"/&gt;
- &lt;/menupopup&gt;
- &lt;/menulist&gt;
- &lt;spacer style="width: 10px;"/&gt;
- &lt;menulist id="searchmode"&gt;
- &lt;menupopup&gt;
- &lt;menuitem label="Is"/&gt;
- &lt;menuitem label="Is Not"/&gt;
- &lt;/menupopup&gt;
- &lt;/menulist&gt;
- &lt;spacer style="width: 10px;"/&gt;
- &lt;textbox id="find-text" flex="1" style="min-width: 15em;"/&gt;
-&lt;/hbox&gt;
-
-<span class="highlightred">&lt;spacer style="height: 10px" flex="1"/&gt;</span>
-
-&lt;hbox&gt;
-</pre>
- <p>    现在当窗口改变尺寸,这两个按钮会移动以确保总在窗口的底部。 <span class="lang lang-en"><a href="../../../../en/XUL/spacer" rel="internal">spacer</a> 被添加在标题和检索条件之间。</span></p>
- <p>    在检索条件上画上边框可能会更好看。可以使用 CSS <code>border</code> 属性或使用 <code><span class="lang lang-en"><a href="../../../../en/XUL/groupbox" rel="internal">groupbox</a> <span style="font-family: Verdana,Tahoma,sans-serif;">元素</span></span></code>,第一种方法需要设置box的样式。我们使用后一种方法。  <a href="../../../../en/XUL_Tutorial/Groupboxes" rel="internal">groupbox</a> 可以画出适合当前主题的漂亮的边框。</p>
- <p>    把box改为 <code>groupbox</code>:</p>
- <pre class="eval"><span class="highlightred">&lt;groupbox orient="horizontal"&gt;</span>
- <span class="highlightred">&lt;caption label="Search Criteria"/&gt;</span>
- &lt;menulist id="searchtype"&gt;
- .
- .
- .
- &lt;spacer style="width: 10px;"/&gt;
- &lt;textbox id="find-text" flex="1" style="min-width: 15em;"/&gt;
-<span class="highlightred">&lt;/groupbox&gt;</span>
-</pre>
- <div class="float-right">
- <img alt="Image:boxfinal2.png" class="internal" src="../../../../@api/deki/files/568/=Boxfinal2.png"></div>
- <p>   当然还有其他的美化方案,比如让组框延伸到窗口底边。也可以修饰一下边界让他们看起来更漂亮。</p>
- <p>    我们会在这个教程中看到更多关于box的例子及其功能因为我们还有在findfile对话框中添加新的元素。</p>
- <p>Find files example so far <span class="lang lang-en"><a class="external" href="http://developer.mozilla.org/samples/xultu/examples//findfile/findfile-boxfinal.xul.txt" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples//findfile/findfile-boxfinal.xul.txt">Source</a> <a class="external" href="http://developer.mozilla.org/samples/xultu/examples//findfile/findfile-boxfinal.xul" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples//findfile/findfile-boxfinal.xul">View</a> </span></p>
- </div>
- </div>
- <p><br>
-      下一章,<a href="../../../../en/XUL_Tutorial/Stacks_and_Decks" rel="internal">create stacks</a>.</p>
- <p> </p>
- <div class="prevnext">
- <p><span style="float: left;">« <a href="../../../../en/XUL_Tutorial/Groupboxes" rel="internal">Previous</a></span> <span style="float: right;"><a href="../../../../en/XUL_Tutorial/Stacks_and_Decks" rel="internal">Next</a> »</span></p>
- </div>
- <p>  </p>
- <p> </p>
- </div>
-</div>
-<div class="printfooter" id="printfooter">
- <hr>
- <p>Retrieved from "<a href="../../../../En/XUL_Tutorial/Adding_More_Elements">https://developer.mozilla.org/En/XUL_Tutorial/Adding_More_Elements</a>"</p>
-</div>
-<div class="collapsed" id="languages">
- <h5 id="Languages">Languages</h5>
- <ul style="display: none;">
- <li><a href="../../../../es/Tutorial_de_XUL/A%c3%b1adiendo_m%c3%a1s_elementos" rel="internal">Español</a></li>
- <li><a href="../../../../fr/Tutoriel_XUL/Ajouter_plus_d%27%c3%a9l%c3%a9ments" rel="internal">Français</a></li>
- <li><a href="../../../../pl/Kurs_XUL/Dodawanie_innych_element%c3%b3w" rel="internal">Polski</a></li>
- <li><a href="../../../../ja/XUL_Tutorial/Adding_More_Elements" rel="internal">日本語</a></li>
- </ul>
-</div>
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/adding_style_sheets/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/adding_style_sheets/index.html
deleted file mode 100644
index 630627f941..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/adding_style_sheets/index.html
+++ /dev/null
@@ -1,10 +0,0 @@
----
-title: 添加样式表
-slug: Mozilla/Tech/XUL/Tutorial/Adding_Style_Sheets
-translation_of: Archive/Mozilla/XUL/Tutorial/Adding_Style_Sheets
----
-<pre id="line1"><span class="pi">&lt;?xml version="1.0"?&gt;</span>
-<span class="pi">&lt;?xml-stylesheet href="css/ued.css" type="text/css"?&gt;</span>
-
-</pre>
-<p>用xml-stylesheet引入CSS文件!可以是本地或来自网络的文件。使用http或chrome协议均可。</p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/anonymous_content/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/anonymous_content/index.html
deleted file mode 100644
index 6362be89f6..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/anonymous_content/index.html
+++ /dev/null
@@ -1,166 +0,0 @@
----
-title: XUL_教程/匿名内容
-slug: Mozilla/Tech/XUL/Tutorial/Anonymous_Content
-translation_of: Archive/Mozilla/XUL/Tutorial/Anonymous_Content
----
-<p> </p>
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/Introduction_to_XBL" style="float: left;">« 上一页</a><a href="/zh-CN/docs/&lt;a_href=">Anonymous_Content</a>"&gt;下一页 »</p>
-</div><p></p>
-<p>在这一节,我们将讲解用XBL创建content。</p>
-<h3 id="XBL_Content" name="XBL_Content">XBL Content</h3>
-<p>XBL被用来自动在另一个元素中添加一组元素。当内部元素用XBL描述时,XUL文件只需要指定外部元素。对于创建由其它控件构成的单独的控件来说这是很有用的,但只被认为是单独的控件。这里讲解了向由外部元素指定的内部元素添加属性的机理。</p>
-<h4 id="Declaring_Scrollbar_Example" name="Declaring_Scrollbar_Example">Declaring Scrollbar Example</h4>
-<p>以下的例子指出了滚动条是怎么声明的(从实例简化1bit)</p>
-<pre>&lt;bindings xmlns="http://www.mozilla.org/xbl"
- xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;
- &lt;binding id="scrollbarBinding"&gt;
- &lt;content&gt;
- &lt;xul:scrollbarbutton type="decrement"/&gt;
- &lt;xul:slider flex="1"&gt;
- &lt;xul:thumb/&gt;
- &lt;/xul:slider&gt;
- &lt;xul:scrollbarbutton type="increment"/&gt;
- &lt;/content&gt;
- &lt;/binding&gt;
-&lt;/bindings&gt;
-</pre>
-<p>这个文件包含一个用binding元素声明的单独的binding。ID属性应该设置为binding的标识符。这会在css文件中设置-moz-binding属性时用到。</p>
-<p>content标签被用来声明将被增进滚动条的anonymous content。content标签里的所有元素将被添加进被绑定界面元素内部。这种 binding将被绑定到滚动条,虽然没必要这样。将CSS -moz-binding 属性的设置为binding的URI的任何元素都将使用它。</p>
-<p>使用上述 binding会导致下面的XUL的行会如下扩展,假设滚动条与上述的XBL相关联:</p>
-<pre class="eval">&lt;scrollbar/&gt;
-
-<strong>expands to:</strong>
-
-&lt;scrollbar&gt;
- &lt;xul:scrollbarbutton type="decrement"/&gt;
- &lt;xul:slider flex="1"&gt;
- &lt;xul:thumb/&gt;
- &lt;/xul:slider&gt;
- &lt;xul:scrollbarbutton type="increment"/&gt;
-&lt;/scrollbar&gt;
-</pre>
-<p>含有content标签的元素被无记录的添加到滚动条。虽然无记录内容被显示在屏幕上,但在正常方式下,不能通过脚本得到它。对于XUL,就像只有一个元素,尽管它实际上由大量元素构成。</p>
-<p>检查 Mozilla窗口中的滚动条,就会发现它由一个arrow按钮、一个slider、内部thumb和一个末尾的second arrow 按钮组成。它们都是XBL上面出现过的元素。这些元素将依次绑定在运用基础XUL元素的其它bindings上。请注意 content元素需要XUL姓名空间(他们出现在XUL之前:),因为他们是XUL元素,而且在XBL中无效。这个命名空间声明在bindings标签内。如果您不想使用XUL元素的命名空间, Mozilla将假定元素都是XBL,不理解这里,您的元素可能不会正常工作。</p>
-<h4 id="Filename_Input_Field_Example" name="Filename_Input_Field_Example">Filename Input Field Example</h4>
-<p>另一个例子是关于输入一个文件名的域:</p>
-<pre>&lt;binding id="fileentry"&gt;
- &lt;content&gt;
- &lt;textbox/&gt;
- &lt;button label="Browse..."/&gt;
- &lt;/content&gt;
-&lt;/binding&gt;
-</pre>
-<p>连接这个元素的binding将会导致输入浏览按钮之后的文本时它包含一个域。这个内部内容被匿名的创建了,而且用DOM不能查看到。</p>
-<h3 id="Override_the_Bound_Element" name="Override_the_Bound_Element">Override the Bound Element</h3>
-<p>Anonymous content被匿名的创建在 binding连接到一个元素的任何地方。如果您在XUL里放置子元素,他们将覆盖由binding提供的元素。例如XUL段,假设它早期与滚动条XBL绑定:(如果在xul文件中,给被绑定界面元素添加子元素,那么会覆盖掉binding中的元素。例如下面的xul片断,假设它被绑定到了前面的scrollbar的binding上)</p>
-<pre>&lt;scrollbar/&gt;
-
-&lt;scrollbar&gt;
- &lt;button label="Overridden"/&gt;
-&lt;/scrollbar&gt;
-</pre>
-<p>第一个滚动条,因为它没有自己的内容,它将从在XBL文件里声明的binding来生成它的内容。第二个滚动条有它自己的内容,因此它将不会运用XBL内容,这产生了不完全是滚动条的产品。请注意比如滚动条这样的内建元素,从toolkit包的bindings目录得到它们的XBL。</p>
-<p>这只应用于在content标签内定义的元素。不论content是否从XBL而来或不论XUL是否提供自己的content,XBL的属性、方法和其它方面仍然可用。</p>
-<h3 id="Using_the_Children_Element" name="Using_the_Children_Element">Using the Children Element</h3>
-<p>当您想将XBL的内容和由XUL文件提供的内容一起都显示出来,可能需要重复几次。您能运用children元素来实现。在XUL中添加的子元素被添加来替代children元素。当创建自定义菜单控件时,这是很容易操作的。例如,一个简单的可编辑的menulist元素,可能如下创建:</p>
-<pre class="eval"><strong>XUL:</strong>
-
-&lt;menu class="dropbox"&gt;
- &lt;menupopup&gt;
- &lt;menuitem label="1000"/&gt;
- &lt;menuitem label="2000"/&gt;
- &lt;/menupopup&gt;
-&lt;/menu&gt;
-
-<strong>CSS:</strong>
-
-menu.dropbox {
- -moz-binding: url('<a class="external" rel="freelink">chrome://example/skin/example.xml#dropbox'</a>);
-}
-
-<strong>XBL:</strong>
-
-&lt;binding id="dropbox"&gt;
- &lt;content&gt;
- &lt;children/&gt;
- &lt;xul:textbox flex="1"/&gt;
- &lt;xul:button src="<a class="external" rel="freelink">chrome://global/skin/images/dropbox.jpg</a>"/&gt;
- &lt;/content&gt;
-&lt;/binding&gt;
-</pre>
-<p>这个例子用旁边的按钮创建了一个输入域,menupopup将添加到由children元素指定位置。请注意对DOM结构来说,这些内容将与在XUL文件中显示的一样,因此menupopup将成为menu的一个子元素。对于开发者来说xbl的内容是看不到的,所以也没必要知道它的位置。</p>
-<p>结果内容应该是:</p>
-<pre>&lt;menu class="dropbox"&gt;
- &lt;menupopup&gt;
- &lt;menuitem label="1000"/&gt;
- &lt;menuitem label="2000"/&gt;
- &lt;/menupopup&gt;
- &lt;textbox flex="1"/&gt;
- &lt;button src="chrome://global/skin/images/dropbox.jpg"/&gt;
-&lt;/menu&gt;
-</pre>
-<h4 id="includes_Attribute" name="includes_Attribute"><code>includes</code> Attribute</h4>
-<p>某些情况下,您可能希望只包括特定类型的内容。或者您只希望在不同的位置放置不同类型的内容。includes属性能够用来使只有某些元素才能在children的内容里出现。它的值应该设定到一个单独的标签名。或者到一个由“|”分隔的标签列表</p>
-<pre>&lt;children includes="button"/&gt;
-</pre>
-<p>所有的button将会被添加到被绑定元素的children所指明的位置。其它元素将不会与这个标签匹配。您能够放置多个children 元素到一个binding中,来在不同的地方放置不同类型的内容。如果XUL中一个元素没有匹配任何children元素,那个元素(和其他任何不匹配的元素)将会被用来替代这个绑定的内容。</p>
-<p>这里有另一个例子。让我们来介绍一下创建一个控件,并用两边的zoom in 和zoom out 按钮显示图象的方法。这将用一个box来创建,它包含图象和两个按钮。因为每个用法不同,这个图象元素得放置在XBL外部。</p>
-<pre class="eval"><strong>XUL:</strong>
-
-&lt;box class="zoombox"&gt;
- &lt;image src="images/happy.jpg"/&gt;
- &lt;image src="images/angry.jpg"/&gt;
-&lt;/box&gt;
-
-<strong>XBL:</strong>
-
-&lt;binding id="zoombox"&gt;
- &lt;content&gt;
- &lt;xul:box flex="1"&gt;
- &lt;xul:button label="Zoom In"/&gt;
- &lt;xul:box flex="1" style="border: 1px solid black"&gt;
- &lt;children includes="image"/&gt;
- &lt;/xul:box&gt;
- &lt;xul:button label="Zoom Out"/&gt;
- &lt;/xul:box&gt;
- &lt;/content&gt;
-&lt;/binding&gt;
-</pre>
-<p>XUL文件中详述的子元素将放置在children标签位置。有两幅图象,因此两个都将被添加到彼此的旁边。显示结果等价如下:</p>
-<pre>&lt;binding id="zoombox"&gt;
- &lt;content&gt;
- &lt;xul:box flex="1"&gt;
- &lt;xul:button label="Zoom In"/&gt;
- &lt;xul:box flex="1" style="border: 1px solid black"&gt;
- &lt;xul:image src="images/happy.jpg"/&gt;
- &lt;xul:image src="images/angry.jpg"/&gt;
- &lt;/xul:box&gt;
- &lt;xul:button label="Zoom Out"/&gt;
- &lt;/xul:box&gt;
- &lt;/content&gt;
-&lt;/binding&gt;
-</pre>
-<p>从 DOM的观点来看,子元素仍然在初始的存储单元。这就是说,外部的XUL box有两个子元素,它们是这两幅图像。里边带边框的box有一个子元素,就是children 标签。当使用带XBL的DOM时,这是一个重要的区别。这也可以应用于CSS选择器规则。</p>
-<h4 id="Multiple_Children_Elements" name="Multiple_Children_Elements">多个子元素</h4>
-<p>您也能够使用多个children元素而且可以把某些元素放置在一个地方,其它元素放置在其它地方,通过添加一个includes属性和将它设置成标签的垂直的bar-separated列表,您能够使得只有在那个列表里的元素被放置在那个地方。例如,下面的XBL将导致文本标签和按钮出现在与其他元素不同的地方。</p>
-<p><a href="https://developer.mozilla.org/samples/xultu/examples/ex_xblcontent_1.xml.txt">Source</a></p>
-<pre>&lt;binding id="navbox"&gt;
- &lt;content&gt;
- &lt;xul:vbox&gt;
- &lt;xul:label value="Labels and Buttons"/&gt;
- &lt;children includes="label|button"/&gt;
- &lt;/xul:vbox&gt;
- &lt;xul:vbox&gt;
- &lt;xul:label value="Other Elements"/&gt;
- &lt;children/&gt;
- &lt;/xul:vbox&gt;
- &lt;/content&gt;
-&lt;/binding&gt;
-</pre>
-<p>第一个children元素只含有标签和按钮元素,正如它的includes属性指示的一样。第二个children元素因为它没有includes属性,它将包含所有的剩余的元素。</p>
-<p>See also <a href="/en/XBL/XBL_1.0_Reference/Anonymous_Content" title="en/XBL/XBL_1.0_Reference/Anonymous_Content">Anonymous Content</a> section of the XBL reference.</p>
-<p>(Next)在下一节,我们将研究属性如何被继承到 anonymous  content中.</p>
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/Introduction_to_XBL" style="float: left;">« 上一页</a><a href="/zh-CN/docs/&lt;a_href=">Anonymous_Content</a>"&gt;下一页 »</p>
-</div><p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/box_model_details/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/box_model_details/index.html
deleted file mode 100644
index 7b647957ba..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/box_model_details/index.html
+++ /dev/null
@@ -1,6 +0,0 @@
----
-title: 分组细节
-slug: Mozilla/Tech/XUL/Tutorial/Box_Model_Details
-translation_of: Archive/Mozilla/XUL/Tutorial/Box_Model_Details
----
-<p>This page has no content. Enrich MDC by contributing.</p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/content_panels/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/content_panels/index.html
deleted file mode 100644
index b2909f9a05..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/content_panels/index.html
+++ /dev/null
@@ -1,63 +0,0 @@
----
-title: 内容面板
-slug: Mozilla/Tech/XUL/Tutorial/Content_Panels
-translation_of: Archive/Mozilla/XUL/Tutorial/Content_Panels
----
-<p>这一节我们来看看如何向HTML页面或者其他XUL文件中添加面板。</p>
-<h3 id="添加子面板">添加子面板</h3>
-<p>你可能经常想要使用不同页面的文件中的一部分。有时候你或许想将一个窗口中的一部分进行改变。一个很好的例子是一个一步接一步的向导,可以通过很多页面、询问一系列问题来指导你。每当用户点击下一步按钮的时候,向导就会显示下一个画面。</p>
-<p>你可以通过为每个不同的画面打开一个新的窗口来创建向导。但这样有三个问题。首先,每个窗口会出现在不同的位置。第二,后退和下一步按钮都是一样的,如果这是内容区域变化将会更好。第三,当在不同的窗口中运行的时候使用脚本会非常困难。</p>
-<p>注意,XUL有一个wizard元素可以用来创建向导接口。这将会在后面的章节中进行描述。</p>
-<p>另一种方法是使用iframe元素。这与HTML中有相同的名字。它可以在一个窗口中创建独立的文档。其优点是可以在任何需要内容的地方加载不同的文件。将文档的URL设置这个框架的src属性。这个URL可以指向任意类型的文件,尽管通常是指向一个HTML文件或者其他XUL文件。你可以使用脚本来控制iframe中的内容而不需要影响主窗口。</p>
-<p>在mozilla浏览器中,网页显示的区域就是用iframe创建的。当用户输入一个URL或者点击一个文档的链接的时候,这个frame的资源就变化了。</p>
-<h4 id="Iframe例子">Iframe例子</h4>
-<p>例子1:</p>
-<table>
- <tbody>
- <tr>
- <td style="width: 568px;">
- <p>&lt;toolbox&gt;</p>
- <p>  &lt;toolbar id="nav-toolbar"&gt;</p>
- <p>    &lt;toolbarbutton label="Back"/&gt;</p>
- <p>    &lt;toolbarbutton label="Forward"/&gt;</p>
- <p>    &lt;textbox id="urlfield"/&gt;</p>
- <p>  &lt;/toolbar&gt;</p>
- <p>&lt;/toolbox&gt;</p>
- <p> </p>
- <p>&lt;iframe id="content-body" src="<a class="external" href="http://www.mozilla.org/index.html" rel="freelink">http://www.mozilla.org/index.html</a>" flex="1"/&gt;</p>
- </td>
- </tr>
- </tbody>
-</table>
-<p>这个例子为浏览器创建了一个非常简单的接口。创建了一个格子来容纳两个元素,一个是工具栏一个是iframe。一个后退按钮,一个前进按钮,以及一个用来输入URL的输入区。在iframe里面将会出现一个网页。这里会默认的出现index.html文件。</p>
-<p>这个例子功能并不完全。下面我们将会添加一个脚本在需要的时候来改变src属性,例如当用户按回车键的时候。</p>
-<h3 id="browser"> browser</h3>
-<p>还有一种内容面板,使用browser标签。如果你想创建一个像浏览器一样显示内容的框架就可以使用这个元素。事实上iframe也可以完成这样的功能,但是browser又很多附加特性。例如browser可以保持历史页面用来进行前进和后退。Browser还可以加载带有参照页和其他标志的页面。需要的时候,你可以使用browser标签来常见一个像浏览器一样的接口,但是如果只需要一个简单的面板的话可以使用iframe来实现。</p>
-<p>一个类似的元素tabbrowser,可以提供browser的全部功能而且还提供一个tab标签来在多个页面中切换。这是用在mozilla浏览器中的标签页浏览的小工具。元素tabbrowser事实上提供了一个含有一系列browser的tabbox元素。两种类型的browser都提供了相同的页面显示控制方式。</p>
-<h4 id="Browser实例">Browser实例</h4>
-<p>例子2:</p>
-<table>
- <tbody>
- <tr>
- <td style="width: 568px;">
- <p>&lt;browser src="<a class="external" href="http://www.mozilla.org" rel="freelink">http://www.mozilla.org</a>" flex="1"/&gt;</p>
- </td>
- </tr>
- </tbody>
-</table>
-<p>与iframe一样,你可以使用src属性来指定browser的URL。对tabbrowser,你不可以设置直接像这样设置URL,因为他不会仅仅显示一个URL,相反的,你必须使用脚本调用loadURL函数来实现。</p>
-<p>有三种类型的browser,基于你想要显示的内容的内部机制。可以使用type属性来指定其类型。</p>
-<p>第一种类型如果不指定的话是默认的类型。这种情况,加载内容的内部browser就是与应用程序相同的,而且可以在外部窗口中访问。这意味着当一个脚本在browser内部加载文件的时候会获取最顶层的窗口。,会获得XUL窗口中的最外部的窗口。</p>
-<p>这可能对于一个应用程序的子XUL面板比较合适,但是当你想要用browser来加载网页的时候,就不是你想要的了。相反的,你可能想现限制网页仅仅获取网页的内容,你可能注意到mozilla浏览器窗口的工具条和状态条有一个XUL内容以及更高级的tabbrowser组成了主要的区域。这个内部的区域显示了一个网页,但是网页无法访问其周围的XUL。这是因为使用的是第二种类型的browser,指定type属性为content。这可以阻止内容穿越到XUL窗口中,示例如下:</p>
-<table>
- <tbody>
- <tr>
- <td style="width: 568px;">
- <p>&lt;browser src="<a class="external" href="http://www.mozilla.org" rel="freelink">http://www.mozilla.org</a>" type="content" flex="1"/&gt;</p>
- </td>
- </tr>
- </tbody>
-</table>
-<p>元素tabbrowser的每个标签页在创建的时候默认类型都设置为content。因此你不需要明确的为它指定类型。</p>
-<p>第三种类型在你的程序中包含多个browser元素的时候使用的,例如,你有一个侧边栏来显示额外的内容,将主browser元素的type属性设置为content-primary来表明其内容是窗口中的主内容。这与content值一样,只是里面的内容只有使用XUL窗口的content属性才可以访问。这使得用脚本访问主窗口的内容时变得容易。对tabbrowser自动将可见的browser设置为content-primary,也就是说,这样你总是可以在当前可见的窗口中看到内容。</p>
-<p>下一节,我们看看如何创建分隔线</p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/creating_a_skin/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/creating_a_skin/index.html
deleted file mode 100644
index 4fabb4c388..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/creating_a_skin/index.html
+++ /dev/null
@@ -1,177 +0,0 @@
----
-title: 创建一个皮肤
-slug: Mozilla/Tech/XUL/Tutorial/Creating_a_Skin
-translation_of: Archive/Mozilla/XUL/Tutorial/Creating_a_Skin
----
-<p>本节讲述如何创建一个简单的皮肤,简单起见,我们只将其应用于查找文件对话框。</p>
-
-<h3 id="A_Simple_Skin" name="A_Simple_Skin">一个简单的皮肤。</h3>
-
-<p>下图是当前的查找文件对话框的样子。我们将创建一个应用于其上的皮肤。当然,一个皮肤可以应用于任何程序,但是当我们只关注于文件查找对话框时,事情就回简单些。因此我们只修改findfile.css 而 不修改global.css 文件。本节假设你正在使用经典的皮肤。你可能希望再工作之前留有一个原来皮肤的备份。</p>
-
-<p><img alt="Image:cskin1.jpg"></p>
-
-<p>你需要再用户皮肤中创建文件'findfile.css' 。或者你可以临时把他放在内容目录中并用样式表指令引用。你也可以直接修改当前的findfile.css文件,看看他会变的怎样,或者你可以创建一个用户皮肤并连接到其上。</p>
-
-<h4 id="Creating_a_Custom_Skin_Package" name="Creating_a_Custom_Skin_Package">创建用户皮肤包</h4>
-
-<p>创建皮肤,步骤如下:(如果使用火狐1.5或以上,参见 <a href="/en/XUL_Tutorial/Manifest_Files" title="en/XUL_Tutorial/Manifest_Files">配置文件</a> 代替以下步骤)</p>
-
-<ol>
- <li>创建一个放置皮肤文件的文件夹。</li>
- <li>从经典或现代皮肤文件夹中复制配置文件 (contents.rdf) 到这个新建的文件夹。</li>
- <li>修改配置文件引用你的皮肤。比如:将 'classic/1.0' 改为 'blueswayedshoes/1.0'.</li>
- <li>在文件‘chrome/installed-chrome.txt’ 中增加如下一行: <code><a class="external" href="skin,install,url,file:///stuff/blueswayedshoes/" rel="freelink">skin,install,url,file:///stuff/blueswayedshoes/</a></code> 其中最后一部分是你现在创建的目录。务必在最后加一个斜杠。</li>
-</ol>
-
-<p>把文件findfile.css 复制到新目录。我们将使用它作为新皮肤的基础。我们可以使用 '<a class="external" rel="freelink">chrome://findfile/skin/findfile.css'来引用它</a>。</p>
-
-<h4 id="Adding_Style_Rules" name="Adding_Style_Rules">添加样式规则</h4>
-
-<p>首先决定要做怎样的改变。我们会修改颜色、改变按钮样式、稍微改变间隔,让我们从菜单、工具栏、标签面板开始。</p>
-
-<p>把下面的内容加到findfile.css 就会产生如下图的改变。</p>
-
-<pre>window &gt; box {
- background-color: #0088CC;
-}
-
-menubar,menupopup,toolbar,tabpanels {
- background-color: lightblue;
- border-top: 1px solid white;
- border-bottom: 1px solid #666666;
- border-left: 1px solid white;
- border-right: 1px solid #666666;
-}
-
-caption {
- background-color: lightblue;
-}
-</pre>
-
-<p><img alt="Image:cskin2.jpg" class="internal" src="/@api/deki/files/627/=Cskin2.jpg"></p>
-
-<ul>
- <li>窗口的内框 (包围窗口全部内容的box)被改为蓝色。</li>
- <li>你可以在标签的间隙和窗口的底部看到这种蓝色。</li>
- <li>四个元素 <code>:<code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menubar" title="menubar">menubar</a></code></code>、 <code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code><span style="font-family: Verdana,Tahoma,sans-serif;">、</span></code><code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbar" title="toolbar">toolbar</a></code></code>、<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/tabpanels" title="tabpanels">tabpanels</a></code></code> 是浅蓝色</li>
- <li>边框改为3D样式,仔细看就会发现。</li>
- <li><code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/caption" title="caption">caption</a></code></code> 的底色也被改变用以适应背景色的改变。</li>
-</ul>
-
-<p>上面的第一条规则(用于 'window &gt; box') 制定窗口的内框使用不同的颜色,这可能不是最好的办法,我们可以使用样式类来做出这样的改变。那样做的话,我们可以修改XUL文件,不必要求box是窗口的第一个子元素。</p>
-
-<pre class="eval"><strong>CSS:</strong>
-.findfilesbox {
- background-color: #0088CC;
-}
-
-<strong>XUL:</strong>
-&lt;vbox <span class="highlightred">class="findfilesbox"</span> orient="vertical" flex="100%"&gt;
-&lt;toolbox&gt;
-</pre>
-
-<h4 id="Rounding_on_the_Tabs" name="Rounding_on_the_Tabs">把标签修圆</h4>
-
-<p>下面,修改标签。我们将要使选中的标签变为粗体,并且修圆标签。</p>
-
-<pre>tab:first-child {
- -moz-border-radius: 4px 0px 0px 0px;
-}
-
-tab:last-child {
- -moz-border-radius: 0px 4px 0px 0px;
-}
-
-tab[selected="true"] {
- color: #000066;
- font-weight: bold;
- text-decoration: underline;
-}
-</pre>
-
-<div class="float-right"><img alt="Image:cskin3.jpg" class="internal" src="/@api/deki/files/628/=Cskin3.jpg"></div>
-
-<p>这里添加了两条规则,第一条将第一个标签修圆,第二条将最后一个标签修圆。这里使用了一个特殊的样式规则, <code><a href="/en/CSS/-moz-border-radius" title="en/CSS/-moz-border-radius">-moz-border-radius</a></code>, 他再边框的角上创建一个圆弧。第一个标签的左上角,第二个标签的右上角用4个像素修圆而其他的角都设为0,这相当于没有修圆,值越大就越接近圆,值越小就越接近矩形。</p>
-
-<p>最后的规则只有当标签的属性 <code><code id="a-selected"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/selected">selected</a></code></code> 设为 <code>true</code>时才有效,他是使选中的标签的文字以粗体,下划线、深蓝色显示,注意图中只有第一个标签这样显示,第二个不会,因为他没有被选中。</p>
-
-<h4 id="Adding_Toolbar_Icons" name="Adding_Toolbar_Icons">添加工具栏按钮</h4>
-
-<p>有时候我们很难区分工具栏上的按钮和菜单栏的命令,如果我们为工具栏的按钮添加图标就会更清楚。火狐的创造者为例如打开保存等按钮创建了图标,我们直接用再这里可以节省时间。我们可以使用 <code><a href="/en/CSS/list-style-image" title="en/CSS/list-style-image">list-style-image</a></code> CSS 属性为按钮添加图标。</p>
-
-<pre>#opensearch {
- list-style-image: url("chrome://editor/skin/icons/btn1.gif");
- -moz-image-region: rect(48px 16px 64px 0);
- -moz-box-orient: vertical;
-}
-
-#savesearch {
- list-style-image: url("chrome://editor/skin/icons/btn1.gif");
- -moz-image-region: rect(80px 16px 96px 0);
- -moz-box-orient: vertical;
-}
-</pre>
-
-<div class="float-right"><img alt="Image:cskin4.jpg" class="internal" src="/@api/deki/files/629/=Cskin4.jpg"></div>
-
-<p>Mozilla provides a custom style property <code><a href="/en/CSS/-moz-image-region" title="en/CSS/-moz-image-region">-moz-image-region</a></code> which can be used to make an element use part of an image. You can think of it as a clip region for the image. You set the property to a position and size within an image and the button will display only that section of the image. This allows you to use the same image for multiple buttons and set a different region for each one. When you have lots of buttons, with states for hover, active and disabled, this saves space that would normally be occupied by mutliple images. In the code above, we use the same image for each button, but set a different image region each one. If you look at this image (btn1.gif), you will notice that it contains a grid of smaller images, each one 16 by 16 pixels.</p>
-
-<p>The <code><a href="/en/CSS/-moz-box-orient" title="en/CSS/-moz-box-orient">-moz-box-orient</a></code> property is used to orient the button vertically, so that the image appears above the label. This property has the same meaning as the <code><code id="a-orient"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/orient">orient</a></code></code> attribute. This is convenient because the skin cannot change the XUL. Most of the box attributes have corresponding CSS properties.</p>
-
-<h4 id="Other_Changes" name="Other_Changes">其他改变</h4>
-
-<p>Next, we'll make a couple of changes to the buttons along the bottom, again reusing some icons from Mozilla to save time. If creating your own skin, you will need to create new icons or copy the icons to new files. If following the example in this section, just copy the files to your new skin and change the URLs accordingly.</p>
-
-<pre>#find-button {
- list-style-image: url("chrome://global/skin/checkbox/images/cbox-check.jpg");
- font-weight: bold;
-}
-
-#cancel-button {
- list-style-image: url("chrome://global/skin/icons/images/close-button.jpg");
-}
-
-button:hover {
- color: #000066;
-}
-</pre>
-
-<div class="float-right"><img alt="Image:cskin5.jpg" class="internal" src="/@api/deki/files/630/=Cskin5.jpg"></div>
-
-<p>We add some images to the buttons and make the Find button have bold text to indicate that it is the default button. The last rule applies to buttons when the mouse is hovering over them. We set the text color to dark blue in this case. Finally, some minor changes to the spacing around the items, by setting margins:</p>
-
-<pre>tabbox {
- margin: 4px;
-}
-
-toolbarbutton {
- margin-left: 3px;
- margin-right: 3px;
-}
-</pre>
-
-<p>After those changes, the find files dialog now looks like the image.</p>
-
-<p><img alt="Image:cskin6.jpg" class="internal" src="/@api/deki/files/631/=Cskin6.jpg"></p>
-
-<p>As you can see, some simple changes to the style rules has resulted in quite a different appearance to the find files dialog. We could continue by changing the menus, the grippies on the toolbar and the input and checkbox elements.</p>
-
-<h3 id="Creating_a_Global_Skin" name="Creating_a_Global_Skin">创建全局皮肤</h3>
-
-<p>The skin created above is simple and only applies to the find files dialog. Some of the changes made to the skin could be placed in the global style sheets (those in the global directory of the skin) to be applied to all applications. For example, having different images for the check boxes in the find files dialog as other windows looks a little odd. This change should really be moved into the global style sheet.</p>
-
-<p>Try moving the CSS styles from findfile.css into global.css and then look at some of the dialogs in Mozilla. (The cookie viewer is a good example.) You will notice that it has adopted the rules that we have added. Some of the rules conflict with those already in the global stylesheets. For example, rules are already defined for buttons and tabs and so on and we defined additional rules for them. When changing the global skin, you would need to merge the changes into the existing rules.</p>
-
-<p>For the best skinnability, it is best to declare appearance related style rules in the global directory rather than in individual style files. This includes colors, fonts and general widget appearances. If you change the color of something in a local skin file (such as findfile.css), the dialog may look odd if the user changes their global skin. Don't expect the user to be using the default one.</p>
-
-<div class="highlight">
-<p>Our Find files example with this skin: <a href="https://developer.mozilla.org/samples/xultu/examples/findfile/findfile-cskin.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/findfile/findfile-cskin.xul">View</a> <a href="https://developer.mozilla.org/samples/xultu/examples/findfile/findfile-cskin.css">Stylesheet</a></p>
-</div>
-
-<h3 id="See_also"><small>See also</small></h3>
-
-<p><small><a href="/en/CSS_Reference/Mozilla_Extensions" title="en/CSS_Reference/Mozilla_Extensions">Mozilla CSS extensions</a>, and <a href="/en/CSS_Reference" title="en/CSS_Reference">CSS reference</a></small></p>
-
-<p><br>
- 下一章讨论 <a href="/en/XUL_Tutorial/Localization" title="en/XUL_Tutorial/Localization">XUL程序的本地化</a></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/creating_a_window/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/creating_a_window/index.html
deleted file mode 100644
index 5a7329bac3..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/creating_a_window/index.html
+++ /dev/null
@@ -1,116 +0,0 @@
----
-title: 创建一个窗口
-slug: Mozilla/Tech/XUL/Tutorial/Creating_a_Window
-translation_of: Archive/Mozilla/XUL/Tutorial/Creating_a_Window
----
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Manifest_Files" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Adding_Buttons">下一页 »</a></p>
-</div><p></p>
-
-<p> </p>
-
-<p>前面提到: 我们要在本教程中创建一个简单的查找文件工具。不过开始之前,我们得先看看XUL文件的基本语法。</p>
-
-<p> </p>
-
-<h3 id=".E5.88.9B.E5.BB.BA.E4.B8.80.E4.B8.AA_XUL_.E6.96.87.E4.BB.B6" name=".E5.88.9B.E5.BB.BA.E4.B8.80.E4.B8.AA_XUL_.E6.96.87.E4.BB.B6">创建一个 XUL 文件</h3>
-
-<p>一个 XUL 文件可以有任何名字,但它必须拥有一个 .xul 的扩展名。最简单的 XUL 文件具有下述结构:</p>
-
-<pre>&lt;?xml version="1.0"?&gt;
-&lt;?xml-stylesheet href="chrome://global/skin/" type="text/css"?&gt;
-
-&lt;window
- id="findfile-window"
- title="查找文件"
- orient="horizontal"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;
-&lt;!-- Other elements go here --&gt;
-&lt;/window&gt;
-</pre>
-
-<p>这个窗口不会做任何事情,因为它没有包含任何用户界面元素。那些元素会在下面的部分中添加。这里对上面的代码进行逐行断开解释:</p>
-
-<ol>
- <li><strong>&lt;?xml version="1.0"?&gt;</strong><br>
- 这一行只是简单声明这是一个 XML 文件。你通常在每一个 xul 文件的顶端都会添加这一行,非常像在一个 HTML 文件的顶端添加 HTML 的标识。</li>
- <li><strong>&lt;?xml-stylesheet href="<a class="external" rel="freelink">chrome://global/skin/</a>" type="text/css"?&gt;</strong><br>
- 这一行是用来指定文件使用的样式表的。这是 XML 文件用以导入样式表的语法。在这种情况下,我们从一个皮肤包的全局部分导入样式。我们没有指定特定的文件,所以 Mozilla 会确定使用文件夹中的哪一个文件。在这种情况下,会选中最重要的 global.css 文件。这个文件包括了所有 XUL 元件的默认声明。因为 XML 并不知道如何显示元件,因此这个文件指出怎样去做。通常,你会将这一行放在每一个 XUL 文件的顶部。你也可以采用类似语法导入其他的样式表。需要注意的是你一般都会在你的样式表文件中导入全局样式表。</li>
- <li><strong>&lt;window</strong><br>
- 这一行说明你在描述一个 <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/window" title="window">window</a></code> 。每一个用户界面窗口都在一个单独的文件中进行描述。这个标记非常类似 HTML 中包围全部内容的 BODY 标记。 <a href="/cn/XUL/window#Attributes" title="cn/XUL/window#Attributes">一些属性</a>可以放到 <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/window" title="window">window</a></code> 标记中——在本例中有四个属性。在本例中,每一个属性都占一个单独的行,但并不是必须这样做。</li>
- <li><strong>id="findfile-window"</strong><br>
- <code><code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code></code> 属性用作标识以便窗口被脚本所引用。你通常会为所有的软件放上 <code>id</code> 属性。虽然名字可由你任起,但应该是有一定关联的。</li>
- <li><strong>title="查找文件"</strong><br>
- The <code><code id="a-title"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/title">title</a></code></code> Attribute 属性描述显示时将在窗口的标题栏上显现的文本。在本例中将显示'查找文件'。</li>
- <li><strong>orient="horizontal"</strong><br>
- <code><code id="a-orient"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/orient">orient</a></code></code> 属性确定窗口中元件的排布。值 <code>horizontal</code> 意味着元件应该横过窗口水平放置。你也可以使用值 <code>vertical</code>,这表示元件将成一列放置。这是默认值,所以如果你希望使用垂直方向的话可以将这个属性完全关闭。</li>
- <li><strong>xmlns="<span class="nowiki">http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul</span>"&gt;</strong><br>
- 这一行声名了 XUL 的名空间,你应该将它放到窗口元件以表示它的所有子元件都是 XUL。注意这个 URL 实际上不需要下载的。Mozilla 内部会识别这个 URL。</li>
- <li><strong><span class="nowiki">&lt;!-- 其他元件写到这里 --&gt;</span></strong><br>
- 将这个注释块替换成其他显示在窗口中的元件(按钮、菜单以及其他用户界面组件)。我们在接下面的部分将添加一些元件。</li>
- <li><strong>&lt;/window&gt;</strong><br>
- 最后,我们需要在文件的结尾关闭 <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/window" title="window">window</a></code> 标记。</li>
-</ol>
-
-<h3 id=".E6.89.93.E5.BC.80.E7.AA.97.E5.8F.A3" name=".E6.89.93.E5.BC.80.E7.AA.97.E5.8F.A3">打开窗口</h3>
-
-<p>声明完一个窗口,如果打开它呢?这里有几种方法:</p>
-
-<ul>
- <li>如果是进行开发,你可以直接在浏览器的定位栏(location bar)中输入URL(chrome:、file:或其它形式的URL)。如果使用chrome则要按前面所讲的注册包。如果使用file:协议,可以直接打开。chrome的好处是可以获得比一般URL更多的权限。不过,现在还用不上。但建议还是把chrome配好。</li>
- <li>如果.xul文件已经与Mozilla作了关联,在资源管理器上双击即可。这种方式与file:方式效果一样。</li>
-</ul>
-
-<p>不过,因为我们的XUL中没有定义其它元素,因此使用Mozilla打开时,什么也看不到。并且在浏览器中打开时,窗口会显示在浏览器中,这不是一个真正的应用,不过进行测试没有关系。</p>
-
-<ul>
- <li>正确的方法是使用Javascript来打开。使用window.open()函数,同打开HTML文档一样。不过需要一个额外的参数,叫"chrome",它用来指明要打开的文档是一个chrome文档。语法描述如下:
- <blockquote>
- <p>window.open(url,windowname,flags);</p>
-
- <p>其中 flags 必须包含 "chrome"。</p>
-
- <p>例如:<br>
- window.open("<a class="external" rel="freelink">chrome://navigator/content/navigator.xul</a>", "bmarks", "chrome,width=600,height=300");</p>
- </blockquote>
- </li>
- <li>还可以在命令行下使用-chrome参数来指明Mozilla启动时打开的XUL文件。例如:
- <blockquote>
- <p>mozilla -chrome <a class="external" rel="freelink">chrome://findfile/content/findfile.xul</a></p>
-
- <p>mozilla -chrome resource:/chrome/findfile/content/findfile.xul</p>
- </blockquote>
- </li>
-</ul>
-
-<p>-chrome参数并不会带来特殊权限,而是chrome URL备具特殊权限。</p>
-
-<p>到这里可以把已经学过的做一个测试。包的组织不一定要是content/skin/locale这种形式。象我的测试就是:</p>
-
-<blockquote>
-<p>d:\project\test\xul\findfile</p>
-</blockquote>
-
-<p>现在目录下有两个文件:</p>
-
-<blockquote>
-<p>findfile.xul和contents.rdf</p>
-</blockquote>
-
-<p>然后修改installed-chrome.txt文件。</p>
-
-<p>切换到Mozilla目录,然后在命令行下输入:</p>
-
-<blockquote>
-<p>mozilla -chrome <a class="external" rel="freelink">chrome://findfile/content/filefile.xul</a></p>
-</blockquote>
-
-<p dir="ltr">不过执行完后,什么都没有,就一个标题条。</p>
-
-<p dir="ltr">(英文原文: <a class="external" href="http://developer.mozilla.org/en/docs/XUL_Tutorial:Creating_a_Window">XUL_Tutorial:Creating_a_Window</a> ) 本篇wiki基于limodou的学习记录: <a class="external" href="http://blog.donews.com/limodou/archive/2005/01/10/233420.aspx">XUL学习:XUL Tutorial(五) -- Creating a Window</a></p>
-
-<p dir="ltr"> </p>
-
-<p dir="ltr"></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Manifest_Files" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Adding_Buttons">下一页 »</a></p>
-</div><p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/creating_an_installer/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/creating_an_installer/index.html
deleted file mode 100644
index aef43ec39b..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/creating_an_installer/index.html
+++ /dev/null
@@ -1,98 +0,0 @@
----
-title: 创建安装程序
-slug: Mozilla/Tech/XUL/Tutorial/Creating_an_Installer
-translation_of: Archive/Mozilla/XUL/Tutorial/Creating_an_Installer
----
-<p> <span class="lang lang-en"> </span></p>
-<div class="warning">
- <p>Parts of this page show the use of the <a href="../../../../en/XPInstall_API_Reference" rel="internal">XPInstall API</a>. The majority of this API is now deprecated and as of Gecko 1.9 no longer available. <a href="../../../../en/Extensions" rel="internal">Extension</a>, <a href="../../../../en/Themes" rel="internal">theme</a>, and <a href="../../../../en/Plugins" rel="internal">plug-in</a> developers must switch away from <code>install.js</code> based packages to the new <a href="../../../../en/Bundles" rel="internal">packaging scheme</a> with an <code><a href="../../../../en/Install.rdf" rel="internal">install.rdf</a></code> manifest. In particular plugin developers should see <a href="../../../../en/Shipping_a_plugin_as_an_extension" rel="internal">how to package a plugin as an extension</a>.</p>
-</div>
-<p> </p>
-<p> </p>
-<div class="prevnext">
- <p><span style="float: left;">« <a href="../../../../en/XUL_Tutorial/Cross_Package_Overlays" rel="internal">Previous</a></span> <span style="float: right;"><a href="../../../../en/XUL_Tutorial/Install_Scripts" rel="internal">Next</a> »</span></p>
-</div>
-<p>  </p>
-<p> </p>
-<p>This section will describe packaging a XUL application into an installer.</p>
-<div id="section_1">
- <h3 class="editable" id="XPInstall_Packages"><span>XPInstall Packages </span></h3>
- <div class="editIcon">
- <a href="../../../../en/XUL_Tutorial/Creating_an_Installer#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>Mozilla provides a mechanism which can be used to package XUL windows, scripts, skins and other files into single file installers. You can place this installer file somewhere for users to download. A simple script can be used to have the package downloaded and installed. This mechanism is called <a href="../../../../en/XPInstall" rel="internal">XPInstall</a> (Cross platform Install).</p>
- <p>XPInstall installers are packaged into JAR files. Inside the JAR file, you can add all the various files that you want to have installed. In addition, installers should contain an install script (a file named install.js) which can be used to script the installation process. This script has access to various install functions which can be used to install files and components.</p>
- <p>The JAR file installers typically have the extension .xpi (pronounced zippy) to distinguish them from other archives. The installers will be usually used to install Mozilla components such as new skins, plugins and packages.</p>
- <p>There are several steps involved in launching an installer and installing components. These are described step by step below.</p>
- <ol>
- <li>Create a Web page from which the user can download the software to be installed. This page will contain an install trigger which is a small piece of script which launches the install.</li>
- <li>The user is presented with a dialog which indicates the package being installed. It is possible for the install trigger to launch multiple installers. In this case, they will be presented in a list. The user may choose to continue or cancel.</li>
- <li>If the user chooses to continue, the installer XPI file is downloaded. A progress bar is displayed to the user during this process.</li>
- <li>The file install.js is extracted from the install archive and executed. This script will call install functions which will indicate which files from the archive should be installed.</li>
- <li>Once the script is complete, the new package has been installed. If multiple packages are being installed, their scripts will run in sequence.</li>
- </ol>
-</div>
-<div id="section_2">
- <h3 class="editable" id="Install_Triggers"><span>Install Triggers </span></h3>
- <div class="editIcon">
- <a href="../../../../en/XUL_Tutorial/Creating_an_Installer#" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>As indicated above, the install process is started by an install trigger. This involves the use of the special global object InstallTrigger. It contains a number of methods which can be used to start an installation. You can use this object in local or remote content, meaning that it is suitable for a download from a Web site.</p>
- <p>Let's create an example install trigger. This involves the use of the function <code>InstallTrigger.install()</code>. This function takes two arguments, the first is a list of packages to install, and the second is a callback function which will be called when the installation is complete. Here is an example:</p>
- <pre>function doneFn ( name , result ){
- alert("The package " + name + " was installed with a result of " + result);
-}
-
-var xpi = new Object();
-xpi["Calendar"] = "calendar.xpi";
-InstallTrigger.install(xpi,doneFn);
-</pre>
- <p>First, we define a callback function doneFn() which will be called when the install is complete. You can name the function whatever you like of course. This function has two arguments. The first is the name of the package that was just installed. This is important if you are installing multiple components. The second argument is a result code. If the result is 0, the installation completed successfully. If the result is non-zero, an error occured and the value is an error code. The function doneFn() here just displays an alert box to the user.</p>
- <p>Next, we create an array xpi which will hold the name (Calendar) and URL (calendar.xpi) of the installer. You can add an additional similar such line for each package you wish to have installed. Finally, we call the install function.</p>
- <p>When this section of script is executed, the file calendar.xpi will be installed.</p>
- <div class="highlight">
- <div id="section_3">
- <h4 class="editable" id="Our_find_files_example"><span>Our find files example </span></h4>
- <div class="editIcon">
- <a href="../../../../en/XUL_Tutorial/Creating_an_Installer#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>Let's try this with the find files dialog.</p>
- <pre>function doneFn ( name , result ){
- if (result) alert("An error occured: " + result);
-}
-
-var xpi = new Object();
-xpi["Find Files"] = "findfile.xpi";
-InstallTrigger.install(xpi,doneFn);
-</pre>
- </div>
- </div>
-</div>
-<h3 class="editable" id="The_XPI_Archive"><span>The XPI Archive </span></h3>
-<div class="editIcon">
- <a href="../../../../en/XUL_Tutorial/Creating_an_Installer#" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
-<div class="note">
- <strong>Note</strong>: If you want to create a new <a href="../../../../en/XULRunner" rel="internal">XULRunner application</a>, <a href="../../../../en/Extensions" rel="internal">extension</a>, or <a href="../../../../en/Themes" rel="internal">theme</a>, see <a href="../../../../en/Bundles" rel="internal">Bundles</a>.</div>
-<p>The installer XPI file is required to contain one file called install.js which is a <a href="../../../../en/JavaScript" rel="internal">JavaScript</a> file which is executed during the installation. The remaining files are the files to be installed. These files will typically be placed inside a directory in the archive but they do not have to be. For chrome files, they might be structured like the chrome directory.</p>
-<p>Often, the only files placed in an XPI archive will be the install script (install.js) and a JAR file. This JAR file contains all of the files used by your application. The components provided with Mozilla are stored in this manner.</p>
-<p>Because the XPI file is just a special ZIP file, you can create it and add files to it using a zip utility.</p>
-<div class="highlight">
- <div id="section_5">
- <h4 class="editable" id="Our_find_files_example_2"><span>Our find files example </span></h4>
- <div class="editIcon">
- <a href="../../../../en/XUL_Tutorial/Creating_an_Installer#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>For the find files dialog, we'll create a structure in the archive much like the following:</p>
- <pre>install.js
-findfile
- content
- contents.rdf
- findfile.xul
- findfile.js
- skin
- contents.rdf
- findfile.css
- locale
- contents.rdf
- findfile.dtd
-</pre>
- </div>
-</div>
-<p>A directory has been added for each part of the package, the content, the skin and the locale. The contents.rdf files have also been added because they will be needed to register the chrome files.</p>
-<p>Next, we'll look further at the <a href="../../../../en/XUL_Tutorial/Install_Scripts" rel="internal">install script</a>.</p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/creating_dialogs/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/creating_dialogs/index.html
deleted file mode 100644
index 1b3dbb2fab..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/creating_dialogs/index.html
+++ /dev/null
@@ -1,6 +0,0 @@
----
-title: Creating Dialogs
-slug: Mozilla/Tech/XUL/Tutorial/Creating_Dialogs
-translation_of: Archive/Mozilla/XUL/Tutorial/Creating_Dialogs
----
-<p>This page has no content. Enrich MDC by contributing.</p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/document_object_model/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/document_object_model/index.html
deleted file mode 100644
index 15112d1cc7..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/document_object_model/index.html
+++ /dev/null
@@ -1,220 +0,0 @@
----
-title: 文档对象模型
-slug: Mozilla/Tech/XUL/Tutorial/Document_Object_Model
-tags:
- - DOM
- - XUL_教程_cn
-translation_of: Archive/Mozilla/XUL/Tutorial/Document_Object_Model
----
-<div id="page-top">
- <div class="pageText" id="pageText">
- <p> </p>
- <p> </p>
- <div class="prevnext">
- <p><span style="float: left;">« <a href="../../../../en/XUL_Tutorial/Broadcasters_and_Observers" rel="internal">Previous</a></span> <span style="float: right;"><a href="../../../../en/XUL_Tutorial/Modifying_a_XUL_Interface" rel="internal">Next</a> »</span></p>
- </div>
- <p>  </p>
- <p> </p>
- <p>    XUL元素的文档对象模型 (DOM) 可以用于获取信息或修改他们。</p>
- <div id="section_1">
- <h3 class="editable" id="DOM_介绍"><span>DOM 介绍</span></h3>
- <div class="editIcon">
- <a href="/../../../../en/XUL_Tutorial/Document_Object_Model#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    <a href="../../../../en/DOM" rel="internal">文档对象模型</a> (DOM) 用于储存XUL节点树。当一个XUL文件加载后,标记被解析并转换成节点的继承关系结构。每个节点包含标记及一个文本块。DOM 结构可以使用一系列方法检查并修改。特殊的XUL 元素也提供了附加的方法可供使用。</p>
- <p>    每一个加载了的XUL 文件都有一个可以显示在窗口或框架内的文档。尽管在特定时间只有一个文档与窗口相关,也有一系列方法使你可以加载更多的文档。</p>
- <p>    Mozilla中, <a href="../../../../en/DOM" rel="internal">DOM</a> 可以被<a href="../../../../en/JavaScript" rel="internal">JavaScript</a>访问并操作。大量的文件对象包含可以被脚本使用的函数。然而,需要了解的是 DOM 是一个可以被 JavaScript 访问的 API 。JavaScript 本身仅是一种脚本语言,它能够访问这些对象是因为 Mozilla 为他提供了这些。</p>
- <p>    <a href="../../../../en/JavaScript" rel="internal">JavaScript</a> 中,由一个全局对象总可以被访问。你可以不使用对象就引用这个全局对象的属性及方法。比如,如果这个全局对象由一个 'name' 属性,你可以用这样的代码来改变它 'name = 7',而不用指明你所使用的对象。在浏览器环境中,window 是这个全局对象,对于XUL同样。当然对于不同的窗口这个全局对象也有所不同。每一个框架都含有一个独立的窗口对象。</p>
- <p>    窗口经常使用 <a href="../../../../en/DOM/window.window" rel="internal"><code>window</code> property</a> 引用,尽管这是可选的。有时这仅是为了澄清你所引用的方法的范围。举例来说,下面的两行等效的打开了一个新窗口。</p>
- <pre>window.open("test.xul","_new");
-open("test.xul","_new");
-</pre>
- <p>    当你在脚本的顶层定义一个函数或变量时,你实际上是为全局对象定义了一个属性。在 XUL中你定义的每一个函数都会被设为窗口对象的属性,比如下面的代码会在提示框中显示 'Message' 两次。</p>
- <pre>function getText(){
- return "Message";
-}
-
-alert(getText());
-alert(window.getText());
-</pre>
- <p>    如果你希望访问在另一个窗口的脚本中定义的变量或函数,你值需要使用另一个窗口的 <code><a href="../../../../en/DOM/window" rel="internal">window</a></code> 对象。比如,把上面的两个例子做成一个我们希望在另一个窗口(比如test.xul窗口)中调用getText()函数,可以这样做:</p>
- <pre>alert(window.opener.getText());
-</pre>
- <p>    每一个窗口都有一个 <code><a href="../../../../en/DOM/window.opener" rel="internal">opener</a></code> 属性,它保存着这个窗口对象是由谁打开的。在这个例子中,我们得到窗口的打开者,并调用这个窗口的 getText() 函数。注意,我们使用窗口属性前缀 'window' 仅为了清晰。</p>
- <p>    窗口的 <code><a href="../../../../en/DOM/window.open" rel="internal">open()</a></code> 方法也返回一个新窗口的引用,我们也可以从 <code><a href="../../../../en/DOM/window.opener" rel="internal">opener</a></code>调用新窗口的函数。提示: <code><a href="../../../../en/DOM/window.open" rel="internal">open()</a></code> 在窗口完全加载前返回函数可能不会有效。</p>
- <p>    窗口对象并不是有由 DOM 标准定义的,但在 Mozilla中有时把这部分称作 <a href="../../../../Special:Tags?tag=DOM_0&amp;language=en" rel="internal">DOM Level 0</a>——一个一些开发者称呼那些还未加入标准的类 DOM 功能的名字。在春光看中显示的文档可以通过窗口的 <code><a href="../../../../en/DOM/window.document" rel="internal">document</a></code> 属性获得。由于它是窗口最常用的属性 <code><a href="../../../../en/DOM/window.document" rel="internal">document</a></code> 属性经常不使用 'window.' 前缀。</p>
- <p>     Mozilla 为不同的文档提供了一系列文档对象。三个主要的是<a class="external" href="http://www.xulplanet.com/references/objref/HTMLDocument.html" rel="external nofollow" title="http://www.xulplanet.com/references/objref/HTMLDocument.html">HTMLDocument</a>, <a class="external" href="http://www.xulplanet.com/references/objref/XMLDocument.html" rel="external nofollow" title="http://www.xulplanet.com/references/objref/XMLDocument.html">XMLDocument</a>, a及 <a class="external" href="http://www.xulplanet.com/references/objref/XULDocument.html" rel="external nofollow" title="http://www.xulplanet.com/references/objref/XULDocument.html">XULDocument</a>, 分别支持 <a href="../../../../en/HTML" rel="internal">HTML</a>, <a href="../../../../en/XML" rel="internal">XML</a> 及 <a href="../../../../en/XUL" rel="internal">XUL</a> 文档。这三种文件类型十分相似,事实上他们共享基本实现。然而,一些函数在一种或几种文档类型是特殊的。</p>
- </div>
- <div id="section_2">
- <h3 class="editable" id="检索元素"><span>检索元素</span></h3>
- <div class="editIcon">
- <a href="/../../../../en/XUL_Tutorial/Document_Object_Model#" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    最常用的检索元素的方法是给出待检索元素的<code><a href="../../../../en/DOM/element.id" rel="internal">id</a></code> 属性利用<code><a href="../../../../en/DOM/document.getElementById" rel="internal">getElementById()</a></code> 方法检索。在 find file 对话框中我们为不少元素都添加了id属性,比如,我们可以使用这样的代码获得check box 的状态。</p>
- <pre>var state = document.getElementById('casecheck').checked;
-</pre>
- <p>     <code>casecheck</code> 代表待检索 <a href="../../../../en/XUL_Tutorial/Input_Controls#Checkboxes_and_Radio_Buttons" rel="internal">checkbox</a> 的id,如果我们需要检查是否它被选中,我们只需按上面的方法检查。我们可以对其他的单选框或其他有id的元素作相同的检查。比如获得输入框中的字符。;</p>
- <div class="highlight">
- <div id="section_3">
- <h4 class="editable" id="find_files_的例子"><span>find files 的例子</span></h4>
- <div class="editIcon">
- <a href="/../../../../en/XUL_Tutorial/Document_Object_Model#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    要让 <a href="../../../../en/XUL_Tutorial/Progress_Meters" rel="internal">progress bar</a> 及 <a href="../../../../en/XUL_Tutorial/Trees" rel="internal">tree data</a>在findfile对话框显示时就显示出来,这不是难题。只要加在XUL文件中就可以了。现在我们要先去掉它,然后在按下 Find 按钮后显示。 首先,应将他们初始化化为不可见。<code><span class="lang lang-en"><a href="../../../../en/XUL/Attribute/hidden" rel="internal">hidden</a> </span></code>属性用于确定元素是否显示。</p>
- <p>    把进度条初始化为隐藏,同时为了能够用脚本引用添加一个 <code><span class="lang lang-en"><a href="../../../../en/XUL/Attribute/id" rel="internal">id</a> <span style="font-family: Verdana,Tahoma,sans-serif;">属性。同样的为了隐藏tree我们也将</span></span></code><a href="../../../../en/XUL_Tutorial/Splitters" rel="internal">splitter</a> 隐藏。</p>
- <pre class="eval">&lt;tree <span class="highlightred">id="results" hidden="true"</span> flex="1"&gt;
- .
- .
- .
-&lt;splitter <span class="highlightred">id="splitbar"</span> resizeafter="grow" <span class="highlightred">hidden="true"</span>/&gt;
-
-&lt;hbox&gt;
-
- &lt;progressmeter <span class="highlightred">id="progmeter"</span> value="50%"
- style="margin: 4px;" <span class="highlightred">hidden="true"</span>/&gt;
-</pre>
- <p>    添加 <code><span class="lang lang-en"><a href="../../../../en/XUL/Attribute/hidden" rel="internal">hidden</a> </span></code>属性并设值为 <code>true</code>。这将导致窗口首次显示时该元素不可见。</p>
- <p>    接下来,我们添加一个在Find按钮按下时调用的函数。我们把脚本写在findfile.js里,在上一章,我们已经在XUL文件中添加了脚本( <code><span class="lang lang-en"><a href="../../../../en/XUL/script" rel="internal">script</a> )<span style="font-family: Verdana,Tahoma,sans-serif;">元素,如果你还不知道如何添加,请看下面的例子。</span></span></code> <code><span class="lang lang-en"><a href="../../../../en/XUL/Attribute/oncommand" rel="internal">oncommand</a> </span></code> 控制器也被加到 Find 按钮上。</p>
- <pre class="eval">&lt;script src="findfile.js"/&gt;
- .
- .
- .
-&lt;button id="find-button" label="Find"
- <span class="highlightred">oncommand="doFind();"</span>/&gt;
-</pre>
- <p>    现在与findfile.xul相同的目录中创建一个叫 findfile.js 的文件,我们在文件中写一个 doFind() 函数。 script 标签允许直接编写脚本代码,但是出于包括格式在内的多种原因,脚本经常写在独立的文件里,除非它可以直接放到处理器中。</p>
- <pre class="eval">function doFind(){
- var meter = document.getElementById('progmeter');
- meter.hidden = false;
-}
-</pre>
- <p>    这个函数首先通过进度条的id引用它,然后改变的hidden属性。</p>
- <p>    最后用一个提示框显示需要检索的文字。当然,这不是最后的版本,但现在我们需要让它发生些什么以使我们确认。</p>
- <pre class="eval">function doFind(){
- var meter=document.getElementById('progmeter');
- meter.hidden = false;
- <span class="highlightred">var searchtext=document.getElementById('find-text').value;
- alert("Searching for \"" + searchtext + "\"");</span>
-}
-</pre>
- <p>    现在,由于提示框的存在,我们知道当点击Find按钮时,会发生什么。同样,我们也需要为 drop-down boxes 添加代码以获得用用户选项。</p>
- </div>
- </div>
- </div>
- <div id="section_4">
- <h3 class="editable" id="XUL_元素的_DOM"><span>XUL 元素的 DOM </span></h3>
- <div class="editIcon">
- <a href="/../../../../en/XUL_Tutorial/Document_Object_Model#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    每一个 XUL 元素都还有一系列的属性,功能及子元素。</p>
- <ul>
- <li>属性是在源文件中定义的,如flex="1"将 <code><span class="lang lang-en"><a href="../../../../en/XUL/Attribute/flex" rel="internal">flex</a> </span></code>属性设为 <code>1</code>。</li>
- <li>JavaScript 中属性使用点语法。例如:element.hidden 引用延伸的hidden 属性</li>
- <li>子元素的是指嵌在源文件标签中的元素。</li>
- </ul>
- <p>    使用DOM方法可以动态的处理一个元素的属性,方法及子元素。</p>
- <p>    注意属性及方法是不一样的东西。有一个属性并不意味着有一个同名的方法,当然通常会有这样一个方法。比如说获得元素的flex属性可以使用flex方法。这种情况下方法的代码就返回这属性。对于其他的方法 XUL 会进行更复杂的处理</p>
- <p>    你可以用以下的方法处理元素的属性:</p>
- <dl>
- <dt>
- <a href="../../../../en/DOM/element.getAttribute" rel="internal">getAttribute</a> ( name )</dt>
- <dd>
- 返回给定元素的属性。</dd>
- <dt>
- <a href="../../../../en/DOM/element.hasAttribute" rel="internal">hasAttribute</a> ( name )</dt>
- <dd>
- 如果元素有指定名字的属性返回真。</dd>
- <dt>
- <a href="../../../../en/DOM/element.setAttribute" rel="internal">setAttribute</a> ( name , value )</dt>
- <dd>
- 将value 为给定名字为name 的属性赋值。</dd>
- <dt>
- <a href="../../../../en/DOM/element.removeAttribute" rel="internal">removeAttribute</a> ( name )</dt>
- <dd>
- 删除给定名字的属性。</dd>
- </dl>
- <p>    这些方法可以让你在任何时候取得或改变属性的值。比如:</p>
- <pre> var box = document.getElementById('somebox');
- var flex = box.getAttribute("flex");
-
- var box2 = document.getElementById('anotherbox');
- box2.setAttribute("flex", "2");
-</pre>
- <p>   当然 <code><span class="lang lang-en"><a href="../../../../en/XUL/Attribute/flex" rel="internal">flex</a> 属性有</span></code><a href="../../../../en/XUL/Property/flex" rel="internal">对应的脚本方法</a> 可以用以代替。它并不更为有效,当更为简洁。下面的例子与上面的效果相同。</p>
- <pre> var box = document.getElementById('somebox');
- var flex = box.flex;
-
- var box2 = document.getElementById('anotherbox');
- box2.flex = 2;
-</pre>
- <p>    一旦你引用了元素你就可以引用它的方法。比如,为了获得一个元素的 <code><span class="lang lang-en"><a href="../../../../en/XUL/Property/hidden" rel="internal">hidden</a> 方法可以使用</span></code><code><em>element</em>.hidden</code> 。你可能已经注意到了在方法参考中,一项会同时出现在属性及方法中,这是不一样的。比如,对于隐藏的元素 <strong><font color="green">getAttribute("hidden") 返回字符串 'true'</font></strong> ,而 hidden <strong><font color="green">方法返回‘值true’ </font></strong> 。用方法会自动完成类型转换。</p>
- <p>    像 <a href="../../../../en/HTML" rel="internal">HTML</a> 和 <a href="../../../../en/XML" rel="internal">XML</a> 元素一样,每一个 XUL 元素实现 <a class="external" href="http://www.xulplanet.com/references/objref/XULElement.html" rel="external nofollow" title="http://www.xulplanet.com/references/objref/XULElement.html">XULElement</a> 接口。一个 XUL 元素可以是任何定义在 XUL 名空间中的元素。所以XUL有非XUL 元素没有的属性及方法。XULElement 接口有一系列属性及方法来定义XUL 元素,其中有很多继承至 DOM 元素接口。</p>
- <p>    一个名空间用一个URI 描述元素,下面是例子。</p>
- <pre>&lt;button xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"/&gt;
-&lt;button xmlns="http://www.w3.org/1999/xhtml"/&gt;
-&lt;html:button xmlns:html="http://www.w3.org/1999/xhtml"/&gt;
-&lt;html:button xmlns:html="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"/&gt;</pre>
- <p>    名空间使用 <code>xmlns</code> 属性</p>
- <ul>
- <li>第一个按钮是被置于XUL名空间在的 XUL 元素。</li>
- <li>第二个按钮是被置于XHTML名空间在的 XHTML 元素。</li>
- <li>第三个例子,前缀 'html' 关联到 '<a class="external" href="http://www.w3.org/1999/xhtml" rel="freelink">http://www.w3.org/1999/xhtml</a>',当你的文档中需要多个名空间时,你也可以使用使用冒号语法来使用前缀名空间。本例创建一个 XHTML 按钮。</li>
- <li>第四个按钮是XUL按钮,尽管使用的‘html’前缀,这要看前缀关联到哪个名空间。</li>
- </ul>
- <p>    这是一个很重要的区别,不过在真正的文档中会为不同的名空间使用不同的前缀。</p>
- <p>    DOM 提供了与无名空间相似的名空间相关的方法。比如 <code><a href="../../../../en/DOM/element.getAttributeNS" rel="internal">getAttributeNS()</a></code> 和 <code><a href="../../../../en/DOM/element.getAttribute" rel="internal">getAttribute()</a></code> 相似除了需要一个指明名空间的参数。</p>
- <p>    许多XUL元素有不同于其他元素的方法。参见 <a href="../../../../en/XUL_Reference" rel="internal">element reference</a> 。</p>
- </div>
- <div id="section_5">
- <h3 class="editable" id="DOM遍历"><span>DOM遍历</span></h3>
- <div class="editIcon">
- <a href="/../../../../en/XUL_Tutorial/Document_Object_Model#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    DOM是一个只有一个根的树。可以使用<code><a href="../../../../en/DOM/document.documentElement" rel="internal">documentElement</a></code> 方法获取根节点。根节点只要一个,但其他节点则不一定。一个元素对应与源文件中的标签,但也有文本节点、注释节点、及其他类型的节点。在XUL文档中根节点是源文件中的<code><span class="lang lang-en"><a href="../../../../en/XUL/window" rel="internal">window</a><span style="font-family: Verdana,Tahoma,sans-serif;">标签。</span></span></code> 树中的每一个节点都可能有其子节点,每个子节点又有它字节的子节点。由于DOM是树结构所以可以用一系列方法来遍历它。常用的几个列在下面:</p>
- <dl>
- <dt>
- <a href="../../../../en/DOM/element.firstChild" rel="internal">firstChild</a></dt>
- <dd>
- 引用元素的第一个子节点。</dd>
- <dt>
- <a href="../../../../en/DOM/element.lastChild" rel="internal">lastChild</a></dt>
- <dd>
- 引用元素的最后一个子节点。</dd>
- <dt>
- <a href="../../../../en/DOM/element.childNodes" rel="internal">childNodes</a></dt>
- <dd>
- 返回元素子节点的列表。</dd>
- <dt>
- <a href="../../../../en/DOM/element.parentNode" rel="internal">parentNode</a></dt>
- <dd>
- 返回元素的亲节点。</dd>
- <dt>
- <a href="../../../../en/DOM/element.nextSibling" rel="internal">nextSibling</a></dt>
- <dd>
- 引用下一个兄弟节点。</dd>
- <dt>
- <a href="../../../../en/DOM/element.previousSibling" rel="internal">previousSibling</a></dt>
- <dd>
- 引用前一个兄弟节点。</dd>
- </dl>
- <p>    这些方法允许你以多种方法遍历文件,比如,使用 <code><a href="../../../../en/DOM/element.firstChild" rel="internal">firstChild</a></code> 方法获得第一个子节点并用 <code><a href="../../../../en/DOM/element.nextSibling" rel="internal">nextSibling</a></code> 方法遍历子节点,或者可以用<code><a href="../../../../en/DOM/element.childNodes" rel="internal">childNodes</a></code> 返回子节点列表。在Mozilla中后者更有效。</p>
- <p>    这个例子展示如何遍历根节点的全部子节点:</p>
- <pre>var childNodes = document.documentElement.childNodes;
-for (var i = 0; i &lt; childNodes.length; i++) {
- var child = childNodes[i];
- // do something with child
-}
-</pre>
- <p>    变量 <code><a href="../../../../en/DOM/element.childNodes" rel="internal">childNodes</a></code> 保存着文档根节点的全部子节点。然后像处理数组一样用一个 for 循环枚举全部元素。</p>
- <div class="highlight">
- Find files example so far: <span class="lang lang-en"><a class="external" href="http://developer.mozilla.org/samples/xultu/examples//findfile/findfile-dom.xul.txt" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples//findfile/findfile-dom.xul.txt">Source</a> <a class="external" href="http://developer.mozilla.org/samples/xultu/examples//findfile/findfile-dom.xul" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples//findfile/findfile-dom.xul">View</a> </span></div>
- <p><small>See also: <a href="../../../../en/A_re-introduction_to_JavaScript" rel="internal">A re-introduction to JavaScript</a> and the <a href="../../../../en/Core_JavaScript_1.5_Reference" rel="internal">JavaScript reference</a></small></p>
- <p>    下一章学习修改DOM <a href="../../../../en/XUL_Tutorial/Modifying_a_XUL_Interface" rel="internal">modify the DOM</a>.</p>
- <p> </p>
- <div class="prevnext">
- <p><span style="float: left;">« <a href="../../../../en/XUL_Tutorial/Broadcasters_and_Observers" rel="internal">Previous</a></span> <span style="float: right;"><a href="../../../../en/XUL_Tutorial/Modifying_a_XUL_Interface" rel="internal">Next</a> »</span></p>
- </div>
- <p>  </p>
- <p> </p>
- </div>
- </div>
-</div>
-<div class="printfooter" id="printfooter">
- <hr>
-</div>
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/element_positioning/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/element_positioning/index.html
deleted file mode 100644
index df6c75dee6..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/element_positioning/index.html
+++ /dev/null
@@ -1,254 +0,0 @@
----
-title: XUL_教程/元素定位
-slug: Mozilla/Tech/XUL/Tutorial/Element_Positioning
-tags:
- - XUL_Tutorial
-translation_of: Archive/Mozilla/XUL/Tutorial/Element_Positioning
----
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:The_Box_Model" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Box_Model_Details">下一页 »</a></p>
-</div><p></p>
-
-<h2 id=".E5.88.86.E7.BB.84.E5.85.83.E7.B4.A0.E5.AE.9A.E4.BD.8D" name=".E5.88.86.E7.BB.84.E5.85.83.E7.B4.A0.E5.AE.9A.E4.BD.8D">分组元素定位</h2>
-
-<p>迄今为止, 我们知道怎么在一个分组里面将元素进行水平或垂直定位。我们通常需要在分组内对元素的定位和尺寸进行更多的控制。为此,我们首先需要知道一个分组是怎么工作的。</p>
-
-<p>一个元素的定位由他所属容器的布局样式决定。例如,在水平分组中的一个按钮在前面的按钮的右边。一个元素的尺寸由两个因素决定:元素期望的大小和用户指定的大小。元素期望的大小由该元素所包含的内容决定。例如,一个按钮的宽度由按钮上所显示文本的长度决定。</p>
-
-<p>一般来说元素的大小仅够容纳它的内容。一些元素,像文本输入框会使用一个默认的尺寸。分组会分配足够的尺寸去将元素放在它里面。一个包括三个按钮的水平分组将会包含比三个按钮更多的宽度,插入一些填充。</p>
-
-<div class="float-right"><img alt="Image:boxstyle1n.png" class="internal" src="/@api/deki/files/2649/=Boxstyle1n.png"></div>
-
-<p>在图片中,开始两个按钮为它们的文本提供了合适的尺寸。第三个按钮比较长因为它包含更多的内容。分组的宽度包含按钮间的填充空间和按钮的宽度总和。按钮的高度采用能够放置它的文本的合适尺寸。</p>
-
-<h3 id=".E5.AE.BD.E5.BA.A6.E5.92.8C.E9.AB.98.E5.BA.A6.E5.B1.9E.E6.80.A7" name=".E5.AE.BD.E5.BA.A6.E5.92.8C.E9.AB.98.E5.BA.A6.E5.B1.9E.E6.80.A7">宽度和高度属性</h3>
-
-<p>在窗口中你可能需要对元素的尺寸进行更多的控制。有更多的特性允许你去控制元素的尺寸。有一个快捷的方法可以通过在元素中简单添加<code><code id="a-width"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/width">width</a></code></code> 和 <code><code id="a-height"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/height">height</a></code></code> 属性,更像你在HTML中的 <code>img</code> 标签的用法。下面展示了一个例子:</p>
-
-<p><span id="%E4%BE%8B1"><a id="%E4%BE%8B1"></a><strong>例1</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_boxstyle_1.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_boxstyle_1.xul">View</a></p>
-
-<pre>&lt;button label="确认" width="100" height="40"/&gt;
-</pre>
-
-<p>然而,不推荐这样做。这么做适用性不好且可能与某些主题不匹配。一个更好的方法是使用样式表属性,它可以像中HTML中的样式表一样工作。可以使用下面的CSS属性。</p>
-
-<dl>
- <dt>width </dt>
- <dd>指定元素的宽度。</dd>
- <dt>height </dt>
- <dd>指定元素的高度。</dd>
-</dl>
-
-<p>随便设置这两属性中的一个,元素将会创建它的宽度和高度。如果你只指定一个尺寸属性,另一个需要被算出。这些样式表属性的尺寸可以指定一个数字后面跟着一个单位。</p>
-
-<h4 id=".E5.8F.AF.E4.BC.B8.E7.BC.A9.E5.85.83.E7.B4.A0" name=".E5.8F.AF.E4.BC.B8.E7.BC.A9.E5.85.83.E7.B4.A0">可伸缩元素</h4>
-
-<p>非伸缩元素可以很简单快捷地计算尺寸。它们的宽度和高度可以直接被指定,如果没有指定尺寸,元素的默认尺寸就是刚好能放下它的内容的大小。对于可伸缩元素,计算需要一点窍门。</p>
-
-<p>可伸缩元素有一个可以设置为大于0的属性<code><code id="a-flex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/flex">flex</a></code></code>。被用来设置在可伸缩性元素中可以扩展和收缩的有用填充空间。它们的默认尺寸可以像非伸缩元素一样被计算。下面的例子做了这个的演示:</p>
-
-<p><span id="%E4%BE%8B2"><a id="%E4%BE%8B2"></a><strong>例2</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_boxstyle_2.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_boxstyle_2.xul">View</a></p>
-
-<pre>&lt;window orient="horizontal"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;
-
-&lt;hbox&gt;
- &lt;button label="Yes" flex="1"/&gt;
- &lt;button label="No"/&gt;
- &lt;button label="I really don't know one way or the other"/&gt;
-&lt;/hbox&gt;
-
-&lt;/window&gt;
-</pre>
-
-<p>这个窗口会像之前的图片所显示的一样。前面两个按钮将一个合适尺寸作为默认宽度,第三个按钮将会比较大因为它有一个较长的标签。第一个按钮被建成是可伸缩的,并且将所有的三元素放在一个分组里面。分组的宽度被设置成全部三个元素的总宽度(图片的宽度大约是430像素)。</p>
-
-<p>如果你增加窗口的宽度,元素会被检查清楚它们是否是可伸缩的,然后被分配到填充的空白空间。按钮只是可伸缩元素,但它不会增加宽度。这是因为按钮所在的分组不是可伸缩的。一个非伸缩元素在空间有效时也不会改变尺寸,所以按钮不会比其他情况下变得更宽。因此,按钮不会变得更宽。</p>
-
-<p>这个解决方案也用于创建可伸缩性的分组。于是,当你创建一个更宽的窗口时,因此分组会伸长以便填充多余的空间。因为分组比较大,更多的空余空间可以被放在它里面,放在它里面的可伸缩按钮可以填充有效空间而得到扩展。这会被许多内嵌的分组重复处理。</p>
-
-<h2 id=".E8.AE.BE.E7.BD.AE.E6.9C.80.E5.B0.8F.E5.92.8C.E6.9C.80.E5.A4.A7.E5.B0.BA.E5.AF.B8" name=".E8.AE.BE.E7.BD.AE.E6.9C.80.E5.B0.8F.E5.92.8C.E6.9C.80.E5.A4.A7.E5.B0.BA.E5.AF.B8">设置最小和最大尺寸</h2>
-
-<p>你可以允许一个元素能够扩展但限制它的尺寸不能比一个确定的尺寸更大。或者,你可设置一个最小尺寸。你可以通过以下四个属性来达到这个目的:</p>
-
-<dl>
- <dt><code id="a-minwidth"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/minwidth">minwidth</a></code> </dt>
- <dd>指定元素的最小宽度。</dd>
- <dt><code id="a-minheight"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/minheight">minheight</a></code> </dt>
- <dd>指定元素的最小高度。</dd>
- <dt><code id="a-maxwidth"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/maxwidth">maxwidth</a></code> </dt>
- <dd>指定元素的最大宽度。</dd>
- <dt><code id="a-maxheight"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/maxheight">maxheight</a></code> </dt>
- <dd>指定元素的最大高度。</dd>
-</dl>
-
-<p>这个值的单位是像素。你也可以使用相应的CSS属性:<code>min-width</code>, <code>min-height</code>, <code>max-width</code> 和 <code>max-height</code>。</p>
-
-<p>这些属性只可以用于可伸缩元素。例如,设置一个最大高度,一个可伸缩的按钮将只能扩展到一个 确定的最大高度。你可以更改窗口的尺寸超过这个值但按钮会在指定的尺寸停止扩展。分组中的按钮将会一直扩展到你设置的分组最大高度时止。</p>
-
-<p>如果两个按钮都具有相等的弹性值,普通情况下它们两个会共享相同的多余空间。如果一个按钮有一个最大宽度,第二个将会一直扩展直到用光所有的空间为止。</p>
-
-<p>如果一个分组有一个最大宽度或高度,子分组不会扩展超出它的最大尺寸。如果一个分组有一个最小宽度或高度,它的子分组不能缩小到比它的最小尺寸更小。</p>
-
-<h5 id=".E8.AE.BE.E7.BD.AE.E5.AE.BD.E5.BA.A6.E5.92.8C.E9.AB.98.E5.BA.A6.E7.9A.84.E4.BE.8B.E5.AD.90" name=".E8.AE.BE.E7.BD.AE.E5.AE.BD.E5.BA.A6.E5.92.8C.E9.AB.98.E5.BA.A6.E7.9A.84.E4.BE.8B.E5.AD.90">设置宽度和高度的例子</h5>
-
-<pre>&lt;button label="1" style="width: 100px;"/&gt;
-&lt;button label="2" style="width: 100em; height: 10px;"/&gt;
-&lt;button label="3" flex="1" style="min-width: 50px;"/&gt;
-&lt;button label="4" flex="1" style="min-height: 2ex; max-width: 100px"/&gt;
-&lt;textbox flex="1" style="max-width: 10em;"/&gt;
-&lt;description style="max-width: 50px"&gt;This is some boring but simple
-wrapping text.&lt;/description&gt;
-</pre>
-
-<dl>
- <dt>例1 </dt>
- <dd>第一个按钮将显示成宽度为100像素的(px 的意思是像素)。你必须增加单位否则宽度将被忽略。</dd>
- <dt>例2 </dt>
- <dd>第二个按钮将显示成高度为10像素和宽度为100em(em是当前字体一个字符的尺寸)。</dd>
- <dt>例3 </dt>
- <dd>第三个按钮是可伸缩的所以它可以基于包含它的分组的尺寸进行扩展。然而,按钮不能收缩到比50像素更小。其它可伸缩组件像定位格可以吸收保留空间,而不管弹性比率。</dd>
- <dt>例4 </dt>
- <dd>第四个按钮是可伸缩的并且不能有一个比2ex(ex是当前字体中的字母x的高度)小的高度或比100像素更大的宽度。</dd>
- <dt>例5 </dt>
- <dd>文本输入框是可伸缩的但不能扩展超过10em。你会经常去使用em单位作为指定文本内容它们的尺寸。这个单位用于文本输入框因此字体可以更改并且文本输入框可以一直有个合适的尺寸,如果字体非常大时也一样。</dd>
- <dt>例6 </dt>
- <dd><code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/description" title="description">description</a></code></code> 元素包含50像素的最大宽度。在50像素后,文本会自动被截到下一行。</dd>
-</dl>
-
-<div class="highlight">
-<h5 id=".E6.88.91.E4.BB.AC.E7.9A.84.E6.96.87.E4.BB.B6.E6.9F.A5.E6.89.BE.E5.AF.B9.E8.AF.9D.E6.A1.86" name=".E6.88.91.E4.BB.AC.E7.9A.84.E6.96.87.E4.BB.B6.E6.9F.A5.E6.89.BE.E5.AF.B9.E8.AF.9D.E6.A1.86">我们的文件查找对话框</h5>
-
-<p>让我们将这些样式增加到文件查找对话框。我们将会创建它因此文本输入框可以在输入窗口中改变尺寸。</p>
-
-<pre>&lt;textbox id="find-text" flex="1" style="min-width: 15em;"/&gt;
-</pre>
-
-<div class="float-right"><img alt="Image:boxstyle1.png" class="internal" src="/@api/deki/files/2648/=Boxstyle1.png"></div>
-在这里,文本输入框被做成可伸缩的。这样,它可以在用户改变对话框的尺寸时进行扩展。这可以用于如果用户想要输入一个很长的文本字符串时。通常地,设置了一个最小宽度为15em则输入框会一直显示为至少15个字符的宽度。如果用户更改对话框的尺寸到很小,文本输入框不会缩小超过15个字符长度。在窗口里面的输入框将会被画出来,并超出窗口的范围。注解:在图片中文本输入框被扩展为充满窗口的尺寸。</div>
-
-<h2 id="Box_Packing" name="Box_Packing">Box Packing</h2>
-
-<p>Let's say you have a box with two child elements, both of which are not flexible, but the box is flexible. For example:</p>
-
-<p><span id="Example_3"><a id="Example_3"></a><strong>Example 3</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_boxstyle_3.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_boxstyle_3.xul">View</a></p>
-
-<pre>&lt;box flex="1"&gt;
- &lt;button label="Happy"/&gt;
- &lt;button label="Sad"/&gt;
-&lt;/box&gt;
-</pre>
-
-<p>If you resize the window, the box will stretch to fit the window size. The buttons are not flexible, so they will not change their widths. The result is extra space that will appear on the right side of the window, inside the box. You may wish, however, for the extra space to appear on the left side instead, so that the buttons stay right aligned in the window.</p>
-
-<p>You could accomplish this by placing a <code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/spacer" title="spacer">spacer</a></code></code> inside the box, but that gets messy when you have to do it numerous times. A better way is to use an additional attribute <code><code id="a-pack"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/pack">pack</a></code></code> on the <code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/box" title="box">box</a></code></code>. This attribute indicates how to <code><code id="a-pack"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/pack">pack</a></code></code> the child elements inside the box. For horizontally oriented boxes, it controls the horizonal positioning of the children. For vertically oriented boxes, it controls the vertical positioning of the children. You can use the following values:</p>
-
-<dl>
- <dt>start </dt>
- <dd>This positions elements at the left edge for horizontal boxes and at the top edge for vertical boxes. This is the default value.</dd>
- <dt>center </dt>
- <dd>This centers the child elements in the box.</dd>
- <dt>end </dt>
- <dd>This positions elements at the right edge for horizontal boxes and at the bottom edge for vertical boxes.</dd>
-</dl>
-
-<p>The <code><code id="a-pack"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/pack">pack</a></code></code> attribute applies to the box containing the elements to be packed, not to the elements themselves.</p>
-
-<p>We can change the earlier example to center the elements as follows:</p>
-
-<p><span id="Example_4"><a id="Example_4"></a><strong>Example 4</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_boxstyle_4.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_boxstyle_4.xul">View</a></p>
-
-<pre>&lt;box flex="1" pack="center"&gt;
- &lt;button label="Happy"/&gt;
- &lt;button label="Sad"/&gt;
-&lt;/box&gt;
-</pre>
-
-<p>Now, when the window is resized, the buttons center themselves horizontally. Compare this behavior to that of the previous example.</p>
-
-<h2 id="Box_Alignment" name="Box_Alignment">Box Alignment</h2>
-
-<p>If you resize the window in the Happy-Sad example above horizontally, the box will grow in width. If you resize the window vertically however, you will note that the buttons grow in height. This is because the flexibility is assumed by default in the other direction.</p>
-
-<p>You can control this behavior with the <code><code id="a-align"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/align">align</a></code></code> attribute. For horizontal boxes, it controls the position of the children vertically. For vertical boxes, it controls the position of the children horizontally. The possible values are similar to those for <code><code id="a-pack"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/pack">pack</a></code></code>.</p>
-
-<dl>
- <dt>start </dt>
- <dd>This aligns elements along the top edge for horizontal boxes and along the left edge for vertical boxes.</dd>
- <dt>center </dt>
- <dd>This centers the child elements in the box.</dd>
- <dt>end </dt>
- <dd>This aligns elements along the bottom edge for horizontal boxes and along the right edge for vertical boxes.</dd>
- <dt>baseline </dt>
- <dd>This aligns the elements so that the text lines up. This is only useful for horizontal boxes.</dd>
- <dt>stretch </dt>
- <dd>This value, the default, causes the elements to grow to fit the size of the box, much like a flexible element, but in the opposite direction.</dd>
-</dl>
-
-<p>As with the <code><code id="a-pack"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/pack">pack</a></code></code> attribute, the <code><code id="a-align"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/align">align</a></code></code> attribute applies to the box containing the elements to be aligned, not to the elements themselves.</p>
-
-<p>For example, the first box below will have its children stretch, because that is the default. The second box has an <code><code id="a-align"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/align">align</a></code></code> attribute, so its children will be placed centered.</p>
-
-<p><span id="Example_5"><a id="Example_5"></a><strong>Example 5</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_boxstyle_5.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_boxstyle_5.xul">View</a></p>
-
-<pre>&lt;?xml version="1.0"?&gt;
-&lt;?xml-stylesheet href="chrome://global/skin/" type="text/css"?&gt;
-
-&lt;window id="yesno" title="Question" orient="horizontal"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;
-
- &lt;hbox&gt;
- &lt;button label="Yes"/&gt;
- &lt;button label="No"/&gt;
- &lt;/hbox&gt;
- &lt;hbox align="center"&gt;
- &lt;button label="Maybe"/&gt;
- &lt;button label="Perhaps"/&gt;
- &lt;/hbox&gt;
-
-&lt;/window&gt;
-</pre>
-
-<div class="float-right"><img alt="Image:boxstyle2-b.png" class="internal" src="/@api/deki/files/2650/=Boxstyle2-b.png"></div>
-
-<p>You can also use the style properties <code><a href="/cn/CSS/-moz-box-pack" title="cn/CSS/-moz-box-pack">-moz-box-pack</a></code> and <code><a href="/cn/CSS/-moz-box-align" title="cn/CSS/-moz-box-align">-moz-box-align</a></code> instead of specifying attributes.</p>
-
-<div class="note">You may find the <a class="external" href="http://developer.mozilla.org/samples/xultu/examples/aligner.xul">Box Alignment Example</a> useful for trying out the various box properties.</div>
-
-<h2 id="Cropping_Text_and_Buttons" name="Cropping_Text_and_Buttons">Cropping Text and Buttons</h2>
-
-<p>You could potentially create a button element that contains a label that is larger than the maximum width of the button. Of course, a solution would be to increase the size of the button. However, buttons (and other elements with a label) have a special attribute called <code>crop</code> that allows you to specify how the text may be cropped if it is too big.</p>
-
-<p>If the text is cropped, an ellipsis (...) will appear on the button where the text was taken out. Four possible values are valid:</p>
-
-<dl>
- <dt>left </dt>
- <dd>The text is cropped on its left side</dd>
- <dt>right </dt>
- <dd>The text is cropped on its right side</dd>
- <dt>center </dt>
- <dd>The text is cropped in the middle.</dd>
- <dt>none </dt>
- <dd>The text is not cropped. This is the default value.</dd>
-</dl>
-
-<p>This attribute is really only useful when a dialog has been designed to be useful at any size. The <code>crop</code> attribute can also be used with other elements that use the <code>label</code> attribute for labels. The following shows this attribute in use:</p>
-
-<p><span id="Example_6"><a id="Example_6"></a><strong>Example 6</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_boxstyle_6.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_boxstyle_6.xul">View</a></p>
-
-<div class="float-right"><img alt="Image:boxstyle2.png" class="internal" src="/@api/deki/files/2651/=Boxstyle2.png"></div>
-
-<pre>&lt;button label="Push Me Please!" crop="right" flex="1"/&gt;
-</pre>
-
-<p>Notice how the text on the button has had the right side of it cropped after the window is made smaller.</p>
-
-<div class="highlight">
-<p><span id="Find_files_example_so_far"><a id="Find_files_example_so_far"></a><strong>Find files example so far</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/findfile/findfile-boxstyle.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/findfile/findfile-boxstyle.xul">View</a></p>
-</div>
-
-<p>Next, a summary and some <a href="/cn/XUL_Tutorial/Box_Model_Details" title="cn/XUL_Tutorial/Box_Model_Details">additional details of the box model are described</a>.</p>
-
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:The_Box_Model" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Box_Model_Details">下一页 »</a></p>
-</div><p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/features_of_a_window/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/features_of_a_window/index.html
deleted file mode 100644
index cae533b206..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/features_of_a_window/index.html
+++ /dev/null
@@ -1,6 +0,0 @@
----
-title: Features of a Window
-slug: Mozilla/Tech/XUL/Tutorial/Features_of_a_Window
-translation_of: Archive/Mozilla/XUL/Tutorial/Features_of_a_Window
----
-<p>This page has no content. Enrich MDC by contributing.</p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/grids/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/grids/index.html
deleted file mode 100644
index 47201b797c..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/grids/index.html
+++ /dev/null
@@ -1,175 +0,0 @@
----
-title: 网格
-slug: Mozilla/Tech/XUL/Tutorial/Grids
-translation_of: Archive/Mozilla/XUL/Tutorial/Grids
----
-<p>XUL有一系列的元素来创建表格布局</p>
-<h3 id="XUL的表格布局"> XUL的表格布局</h3>
-<p>使用grid元素可以在XUL中使用一系列的元素来进行元素的布局。这与HTML中的table有很大的相似性。网格本身不会有任何的显示,它仅仅是使用行和列的形式来定位其他元素。</p>
-<p>一个网格内部的元素排列成行。在grid里面,你需要声明两种东西,columns和rows。正如HTML的table,你可以将label和button等内容放在row里面。但是,grid只支持单独的row或者单独的column,因此你可以将内容放在rows里面或者columns里面。通常是使用rows。但是在grid中你还是可以使用column并制定其大小和显示方式。或者你可以将内容放在columns里面,然后用row来指定其显示方式。首先看看以row的方式组织元素的方法。</p>
-<h4 id="声明一个网格">声明一个网格</h4>
-<p>使用rows标签来声明一系列的row。Rows必须是grid的子元素。在rows里面你可以添加row元素,row用在每一行。在row元素中你可以放任何你想要的内容在里面。</p>
-<p>相似的,列由columns来声明。其中有单独的column元素,每个你想添加的列都是一个column元素。</p>
-<p>用一个例子更容易理解。</p>
-<p>例子1:</p>
-<p><img alt=""></p>
-<table>
- <tbody>
- <tr>
- <td style="width: 568px;">
- <p>&lt;grid flex="1"&gt;</p>
- <p>  &lt;columns&gt;</p>
- <p>    &lt;column flex="2"/&gt;</p>
- <p>    &lt;column flex="1"/&gt;</p>
- <p>  &lt;/columns&gt;</p>
- <p>  &lt;rows&gt;</p>
- <p>    &lt;row&gt;</p>
- <p>      &lt;button label="Rabbit"/&gt;</p>
- <p>      &lt;button label="Elephant"/&gt;</p>
- <p>    &lt;/row&gt;</p>
- <p>    &lt;row&gt;</p>
- <p>      &lt;button label="Koala"/&gt;</p>
- <p>      &lt;button label="Gorilla"/&gt;</p>
- <p>    &lt;/row&gt;</p>
- <p>  &lt;/rows&gt;</p>
- <p>&lt;/grid&gt;</p>
- </td>
- </tr>
- </tbody>
-</table>
-<p>添加了一个两行两列的grid。每个列由一个column标签声明。每一列都设置了flex属性。每行航油两个元素都是半年。每个单元格不需要进行声明,可以直接将内容放在row元素里面。</p>
-<h4 id="带有更多元素的网格">带有更多元素的网格</h4>
-<p>你可以使用任何元素来代替上面的button元素,。如果你想要一个详细的关于容纳多个元素的单元,你可以使用嵌套的hbox或者其他box元素。一个hbox元素是一个单一的元素,但是你可以在里面放任意多的元素。例如:</p>
-<p>例子2:</p>
-<table>
- <tbody>
- <tr>
- <td style="width: 568px;">
- <p>&lt;grid flex="1"&gt;</p>
- <p> </p>
- <p>  &lt;columns&gt;</p>
- <p>    &lt;column/&gt;</p>
- <p>    &lt;column flex="1"/&gt;</p>
- <p>  &lt;/columns&gt;</p>
- <p> </p>
- <p>  &lt;rows&gt;</p>
- <p>    &lt;row&gt;</p>
- <p>      &lt;label control="doctitle" value="Document Title:"/&gt;</p>
- <p>      &lt;textbox id="doctitle" flex="1"/&gt;</p>
- <p>    &lt;/row&gt;</p>
- <p>    &lt;row&gt;</p>
- <p>      &lt;label control="docpath" value="Path:"/&gt;</p>
- <p>      &lt;hbox flex="1"&gt;</p>
- <p>        &lt;textbox id="docpath" flex="1"/&gt;</p>
- <p>        &lt;button label="Browse..."/&gt;</p>
- <p>      &lt;/hbox&gt;  </p>
- <p>    &lt;/row&gt;</p>
- <p>  &lt;/rows&gt;</p>
- <p> </p>
- <p>&lt;/grid&gt;</p>
- </td>
- </tr>
- </tbody>
-</table>
-<p><img alt=""></p>
-<p>注意第二列的第二行,含有一个box,box里面有一个文本框和一个按钮。你可以添加嵌套的box或者在里面放置另外一个grid。</p>
-<p>由于第二行和文本框都设置了flex属性,所以改变窗口尺寸的时候文本框会改变大小,而其他元素不会改变。</p>
-<p>一列的宽度由该列中最宽的元素决定。同牙膏的一行的高度由这一行中最高的元素决定。你可以使用minwidth和maxwidth以及相关的属性来对尺寸作更多的定义。</p>
-<h4 id="按列组织">按列组织</h4>
-<p>你也可以在列中添加元素,这样一来,row元素就只是用来表示有多少行了。</p>
-<p>例子3:</p>
-<table>
- <tbody>
- <tr>
- <td style="width: 568px;">
- <p>&lt;grid&gt;</p>
- <p>  &lt;rows&gt;</p>
- <p>    &lt;row/&gt;</p>
- <p>    &lt;row/&gt;</p>
- <p>    &lt;row/&gt;</p>
- <p>  &lt;/rows&gt;</p>
- <p> </p>
- <p>  &lt;columns&gt;</p>
- <p>    &lt;column&gt;</p>
- <p>      &lt;label control="first" value="First Name:"/&gt;</p>
- <p>      &lt;label control="middle" value="Middle Name:"/&gt;</p>
- <p>      &lt;label control="last" value="Last Name:"/&gt;</p>
- <p>    &lt;/column&gt;</p>
- <p>    &lt;column&gt;</p>
- <p>      &lt;textbox id="first"/&gt;</p>
- <p>      &lt;textbox id="middle"/&gt;</p>
- <p>      &lt;textbox id="last"/&gt;</p>
- <p>    &lt;/column&gt;</p>
- <p>  &lt;/columns&gt;</p>
- <p> </p>
- <p>&lt;/grid&gt;</p>
- </td>
- </tr>
- </tbody>
-</table>
-<p>这个网格有桑航两列。元素row仅仅表示有多少行。你可以添加flex属性来使其自适应。内容在每一列中。</p>
-<p>如果你在列和行中都填内容,内容将会相互覆盖,不过他们会在grid中合适的进行排列。就像在网格中有堆元素一样。</p>
-<p>Grid中元素的顺序决定了哪一个会显示在上面,哪一个在下面。如果rows元素放在columns元素后面,在rows中的内容会显示在上面。如果columns放在rows元素后面,列中的内容会显示在上面。事件的获取也一样。</p>
-<h4 id="网格自适应">网格自适应</h4>
-<p>网格的一个优点是在一系列嵌套box中你可以创建在水平和竖直方向上都自适应的单元格。你可以通过使用flex属性在row和column元素上来实现。下面的例子说明了这一点:</p>
-<p>例子4:</p>
-<table>
- <tbody>
- <tr>
- <td style="width: 568px;">
- <p>&lt;grid flex="1"&gt;</p>
- <p> &lt;columns&gt;</p>
- <p>  &lt;column flex="5"/&gt;</p>
- <p>  &lt;column/&gt;</p>
- <p>  &lt;column/&gt;</p>
- <p> &lt;/columns&gt;</p>
- <p> &lt;rows&gt;</p>
- <p>  &lt;row flex="10"&gt;</p>
- <p>    &lt;button label="Cherry"/&gt;</p>
- <p>    &lt;button label="Lemon"/&gt;</p>
- <p>    &lt;button label="Grape"/&gt;</p>
- <p>  &lt;/row&gt;</p>
- <p>  &lt;row flex="1"&gt;</p>
- <p>    &lt;button label="Strawberry"/&gt;</p>
- <p>    &lt;button label="Raspberry"/&gt;</p>
- <p>    &lt;button label="Peach"/&gt;</p>
- <p>  &lt;/row&gt;</p>
- <p> &lt;/rows&gt;</p>
- <p>&lt;/grid&gt;</p>
- </td>
- </tr>
- </tbody>
-</table>
-<p>第一列和所有两行都设置为自适应。这样的结果是第一列中的单元格在水平方向上自适应,另外每个单元格都会在竖直方向上自适应,因为两行都是自适应的,不过第一行还不止这样。第一列和第一行的单元格将会在水平方向上以5的倍率伸缩,在竖直方向上以10的倍率伸缩。</p>
-<p>元素grid也要设置flex属性,这样所有的网格才能自适应,否则就只会在一个方向上自适应。</p>
-<h3 id="列宽扩展">列宽扩展</h3>
-<p>让很多行和列中的一个单元格扩展是没有意义的。但是可以让一行或者一列整个的扩展。为了实现这一点只需要在rows元素中添加一个元素。比如可以使用一个box样式。让回将其他元素放在里面。下面是一个简单的例子:</p>
-<p>例子5:</p>
-<table>
- <tbody>
- <tr>
- <td style="width: 568px;">
- <p>&lt;grid&gt;</p>
- <p>  &lt;columns&gt;</p>
- <p>    &lt;column flex="1"/&gt;</p>
- <p>    &lt;column flex="1"/&gt;</p>
- <p>  &lt;/columns&gt;</p>
- <p> </p>
- <p>  &lt;rows&gt;</p>
- <p>    &lt;row&gt;</p>
- <p>      &lt;label value="Northwest"/&gt;</p>
- <p>      &lt;label value="Northeast"/&gt;</p>
- <p>    &lt;/row&gt;</p>
- <p>    &lt;button label="Equator"/&gt;</p>
- <p>    &lt;row&gt;</p>
- <p>      &lt;label value="Southwest"/&gt;</p>
- <p>      &lt;label value="Southeast"/&gt;</p>
- <p>    &lt;/row&gt;</p>
- <p>  &lt;/rows&gt;</p>
- <p>&lt;/grid&gt;</p>
- </td>
- </tr>
- </tbody>
-</table>
-<p>按钮将会扩展以适合整个grid的宽带,因为它不是一个grid的行中的元素。你也可以将相似的方式用在两个列中。这样就会扩展以一与网格的高度相适应。你可以在行和列上都使用,如果你想这样做。</p>
-<p>下一节我们来看看内容面板</p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/groupboxes/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/groupboxes/index.html
deleted file mode 100644
index c62dd0f004..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/groupboxes/index.html
+++ /dev/null
@@ -1,85 +0,0 @@
----
-title: 分组框
-slug: Mozilla/Tech/XUL/Tutorial/Groupboxes
-translation_of: Archive/Mozilla/XUL/Tutorial/Groupboxes
----
-<p>    本章介绍在组框中添加元素的方法。</p>
-<div id="section_1">
- <h3 class="editable" id="Groupboxes"><span>Groupboxes </span></h3>
- <div class="editIcon">
- <a href="../../../../en/XUL_Tutorial/Groupboxes#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    HTML 通过了 <code>fieldset</code> 元素来使元素分组,一般的会在元素的边上画一个框来显示元素的关系。比如一系列单选按钮。XUL 也通过了 <code><span class="lang lang-en"><a href="../../../../en/XUL/groupbox" rel="internal">groupbox</a> </span></code>元素来完成相似的功能。</p>
- <p>    就像名字暗示的一样 <code><span class="lang lang-en"><a href="../../../../en/XUL/groupbox" rel="internal">groupbox</a> <span style="font-family: Verdana,Tahoma,sans-serif;">是一类box,这意味着在其中的元素可以安装box指定的形式排列。与一般的box相比groupbox有两点不同。</span></span></code></p>
- <ul>
- <li>默认的组框会画出边界,你可以使用 CSS 来改变这种行为。</li>
- <li>groupbox 支持在边框顶部画出标题。</li>
- </ul>
- <p>    因为组框是一种box,你可以使用如 <code><span class="lang lang-en"><a href="../../../../en/XUL/Attribute/orient" rel="internal">orient</a> </span></code>及 <code><span class="lang lang-en"><a href="../../../../en/XUL/Attribute/flex" rel="internal">flex</a> 等属性<span style="font-family: Verdana,Tahoma,sans-serif;">。你可以把任何你想放入box中的元素放入组框中,无论他们有什么关系。</span></span></code></p>
- <p>    组框顶端的标签使用 <code><span class="lang lang-en"><a href="../../../../en/XUL/caption" rel="internal">caption</a> <span style="font-family: Verdana,Tahoma,sans-serif;">元素创建,类似于</span></span></code> HTML 中的<code>legend</code> 元素,请把 <code><span class="lang lang-en"><a href="../../../../en/XUL/caption" rel="internal">caption</a> </span></code>作为第一个元素放入组框。</p>
- <div id="section_2">
- <h4 class="editable" id="一个组框的例子"><span>一个组框的例子 </span></h4>
- <div class="editIcon">
- <a href="../../../../en/XUL_Tutorial/Groupboxes#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    下面的例子显示一个简单组框。</p>
- <p><span class="lang lang-en"><span id="Example_1"><strong>Example 1</strong></span> </span> : <span class="lang lang-en"><a class="external" href="http://developer.mozilla.org/samples/xultu/examples/ex_titledbox_1.xul.txt" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples/ex_titledbox_1.xul.txt">Source</a> <a class="external" href="http://developer.mozilla.org/samples/xultu/examples/ex_titledbox_1.xul" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples/ex_titledbox_1.xul">View</a> </span></p>
- <div class="float-right">
- <img alt="Image:titledbox1.png" class="internal" src="../../../../@api/deki/files/891/=Titledbox1.png"></div>
- <pre>&lt;groupbox&gt;
- &lt;caption label="Answer"/&gt;
- &lt;description value="Banana"/&gt;
- &lt;description value="Tangerine"/&gt;
- &lt;description value="Phone Booth"/&gt;
- &lt;description value="Kiwi"/&gt;
-&lt;/groupbox&gt;
-</pre>
- <p>    以上代码表示:四条文本被一个以 <em>Answer </em>为标签的box框起来,注意组框默认的定向方式为垂直定向,所以元素会排成一列。</p>
- </div>
- <div id="section_3">
- <h4 class="editable" id="更复杂的标题"><span>更复杂的标题</span></h4>
- <div class="editIcon">
- <a href="../../../../en/XUL_Tutorial/Groupboxes#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    你可以在 <code><span class="lang lang-en"><a href="../../../../en/XUL/caption" rel="internal">caption</a> <span style="font-family: Verdana,Tahoma,sans-serif;">元素中添加子元素构造一个更复杂的标题,比如,</span></span></code>Mozilla的字体选择面板使用一个下拉菜单作为标题。尽管任何元素都可以在这里使用,通常的是使用下拉菜单和复选框。</p>
- <p><span class="lang lang-en"><span id="Example_2"><strong>Example 2</strong></span> </span> : <span class="lang lang-en"><a class="external" href="http://developer.mozilla.org/samples/xultu/examples/ex_titledbox_2.xul.txt" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples/ex_titledbox_2.xul.txt">Source</a> <a class="external" href="http://developer.mozilla.org/samples/xultu/examples/ex_titledbox_2.xul" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples/ex_titledbox_2.xul">View</a> </span></p>
- <div class="float-right">
- <img alt="Image:groupbox2.png" class="internal" src="../../../../@api/deki/files/706/=Groupbox2.png"></div>
- <pre>&lt;groupbox flex="1"&gt;
- &lt;caption&gt;
- &lt;checkbox label="Enable Backups"/&gt;
- &lt;/caption&gt;
- &lt;hbox&gt;
- &lt;label control="dir" value="Directory:"/&gt;
- &lt;textbox id="dir" flex="1"/&gt;
- &lt;/hbox&gt;
- &lt;checkbox label="Compress archived files"/&gt;
-&lt;/groupbox&gt;
-</pre>
- <p><br>
-     这个例子里一个 <a href="../../../../en/XUL_Tutorial/Input_Controls#Checkboxes_and_Radio_Buttons" rel="internal">checkbox</a> 被作为标题。我看可以根据复选框是否被选中,使用脚本来控制组框中的元素是否有效。组框中包含了一个有 <span class="lang lang-en"><a href="../../../../en/XUL/label" rel="internal">label</a> 和</span> <span class="lang lang-en"><a href="../../../../en/XUL/textbox" rel="internal">textbox</a> </span>的水平框,文本框和组框均被设定为是可变的,所以元素会随着窗口延伸。复选框出现在组框底下是因为组框默认为垂直定向。下一章我们为find files 对话框添加一个组框。</p>
- </div>
-</div>
-<div id="section_4">
- <h3 class="editable" id="单选组"><span>单选组</span></h3>
- <div class="editIcon">
- <a href="../../../../en/XUL_Tutorial/Groupboxes#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    你可以使用 <code><span class="lang lang-en"><a href="../../../../en/XUL/radiogroup" rel="internal">radiogroup</a> <span style="font-family: Verdana,Tahoma,sans-serif;">把单选按钮组织在一起。</span></span></code> <code><span class="lang lang-en"><a href="../../../../en/XUL/radiogroup" rel="internal">radiogroup</a> </span></code>是一种box,你可以在其中放置任何元素,并且他对 <code><span class="lang lang-en"><a href="../../../../en/XUL/radio" rel="internal">radio</a> <span style="font-family: Verdana,Tahoma,sans-serif;">按钮具有特殊的处理。</span></span></code></p>
- <p>    那些放在单选组里的单选按钮会被组织起来,即使它在其他的box中 。也可添加额外的元素,如下例:</p>
- <p><span class="lang lang-en"><span id="Example_3"><strong>Example 3</strong></span> </span> : <span class="lang lang-en"><a class="external" href="http://developer.mozilla.org/samples/xultu/examples/ex_titledbox_3.xul.txt" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples/ex_titledbox_3.xul.txt">Source</a> <a class="external" href="http://developer.mozilla.org/samples/xultu/examples/ex_titledbox_3.xul" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples/ex_titledbox_3.xul">View</a> </span></p>
- <pre>&lt;radiogroup&gt;
- &lt;radio id="no" value="no" label="No Number"/&gt;
- &lt;radio id="random" value="random" label="Random Number"/&gt;
- &lt;hbox&gt;
- &lt;radio id="specify" value="specify" label="Specify Number:"/&gt;
- &lt;textbox id="specificnumber"/&gt;
- &lt;/hbox&gt;
-&lt;/radiogroup&gt;
-</pre>
- <p>    注意 <code><span class="lang lang-en"><a href="../../../../en/XUL/radiogroup" rel="internal">radiogroup</a> <span style="font-family: Verdana,Tahoma,sans-serif;">不会画出边框。如果需要边框及标题请放置在</span></span></code> <code><span class="lang lang-en"><a href="../../../../en/XUL/groupbox" rel="internal">groupbox</a> <span style="font-family: Verdana,Tahoma,sans-serif;">中。</span></span></code></p>
- <p>    接下来,我们使用学到的新知识来为findfile对话框添加元素。<a href="../../../../en/XUL_Tutorial/Adding_More_Elements" rel="internal">(additional elements to the find files dialog</a>.)</p>
- <p> </p>
- <div class="prevnext">
- <p><span style="float: left;">« <a href="../../../../en/XUL_Tutorial/Box_Model_Details" rel="internal">Previous</a></span> <span style="float: right;"><a href="../../../../en/XUL_Tutorial/Adding_More_Elements" rel="internal">Next</a> »</span></p>
- </div>
- <p>  </p>
- <p> </p>
-</div>
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/index.html
deleted file mode 100644
index a164d16f7f..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/index.html
+++ /dev/null
@@ -1,171 +0,0 @@
----
-title: XUL 教程
-slug: Mozilla/Tech/XUL/Tutorial
-tags:
- - XUL
- - XUL_Tutorial
-translation_of: Archive/Mozilla/XUL/Tutorial
----
-<p>
- 这份XUL的教程是源自 <a class="external" href="http://www.xulplanet.com/ndeakin/">Neil Deakin</a>之手。很感谢他能给MDC授权使用这篇文章。</p>
-
-<p>这篇教程会教你如何开发和设计基于<a href="/cn/XUL" title="cn/XUL">XUL</a>(<a href="/cn/XML" title="cn/XML">XML</a> User-interface Language XML用户交互语言)的应用程序. XUL是Mozilla创建的并且应用在Mozilla的应用程序的界面描述语言。</p>
-
-<h5 id=".E7.AC.AC.E4.B8.80.E7.AB.A0__.E5.BC.95.E8.A8.80" name=".E7.AC.AC.E4.B8.80.E7.AB.A0__.E5.BC.95.E8.A8.80">第一章 引言</h5>
-
-<ul>
- <li><a href="Tutorial/Introduction">引言</a></li>
- <li><a href="Tutorial/XUL_Structure" title="cn/XUL_教程/1-2_XUL的结构">XUL的结构</a></li>
- <li><a class="external" href="Tutorial/The_Chrome_URL" title="关于Chrome URL">关于Chrome URL</a></li>
- <li><a href="Tutorial/Manifest_Files" title="cn/XUL_教程/1-4_关于Manifest文件">关于Manifest文件</a></li>
-</ul>
-
-<h5 id=".E7.AE.80.E5.8D.95.E7.9A.84.E7.A4.BA.E4.BE.8B" name=".E7.AE.80.E5.8D.95.E7.9A.84.E7.A4.BA.E4.BE.8B">简单的示例</h5>
-
-<ul>
- <li><a href="Tutorial/Creating_a_Window" title="cn/XUL_教程/创建一个窗口">创建一个窗口</a></li>
- <li><a href="/cn/XUL_教程/增加一些按钮" title="cn/XUL_教程/增加一些按钮">增加一些按钮</a></li>
- <li><a href="/cn/XUL_教程/增加标签和图像" title="cn/XUL_教程/增加标签和图像">增加标签和图像</a></li>
- <li><a href="/cn/XUL_教程/输入控件" title="cn/XUL_教程/输入控件">输入控件</a></li>
- <li><a href="/cn/XUL_教程/数值控件" title="cn/XUL 教程/数值控件">数值控件</a></li>
- <li><a href="/cn/XUL_教程/列表控件" title="cn/XUL_教程/列表控件">列表控件 </a></li>
- <li><a href="/cn/XUL_教程/进度条" title="cn/XUL_教程/进度条">进度条</a></li>
- <li><a href="/cn/XUL_教程/增加HTML元素" title="cn/XUL_教程/增加HTML元素">增加HTML元素</a></li>
- <li><a href="/cn/XUL_教程/使用定位格" title="cn/XUL_教程/使用定位格">使用定位格</a></li>
- <li><a href="/cn/XUL_教程/更多的按钮特性" title="cn/XUL_教程/更多的按钮特性">更多的按钮特性</a></li>
-</ul>
-
-<h5 id=".E7.9B.92.E6.A8.A1.E5.9E.8B" name=".E7.9B.92.E6.A8.A1.E5.9E.8B">箱模型</h5>
-
-<ul>
- <li><a href="/cn/XUL_教程/分组方式" title="cn/XUL_教程/分组方式">分组方式</a></li>
- <li><a href="/cn/XUL_教程/元素定位" title="cn/XUL_教程/元素定位">元素定位</a></li>
- <li><a href="/Cn/XUL_教程/分组细节" title="cn/XUL_教程/分组细节">分组细节</a></li>
- <li><a href="/Cn/XUL_教程/分组框" title="cn/XUL_教程/分组框">分组框</a></li>
- <li><a href="/Cn/XUL_教程/增加更多的元素" title="cn/XUL_教程/增加更多的元素">增加更多的元素</a></li>
-</ul>
-
-<h5 id=".E6.9B.B4.E5.A4.9A.E7.9A.84.E5.B8.83.E5.B1.80.E5.85.83.E7.B4.A0" name=".E6.9B.B4.E5.A4.9A.E7.9A.84.E5.B8.83.E5.B1.80.E5.85.83.E7.B4.A0">更多的布局元素</h5>
-
-<ul>
- <li><a href="/Cn/XUL_教程/层和卡片" title="cn/XUL_教程/层和卡片">层和卡片</a></li>
- <li><a href="/cn/XUL_教程/定位层" title="cn/XUL_教程/定位层">定位层</a></li>
- <li><a href="/cn/XUL_教程/分页组" title="cn/XUL_教程/分页组">分页组</a></li>
- <li><a href="/cn/XUL_教程/表格" title="cn/XUL_教程/表格">表格</a></li>
- <li><a href="/Cn/XUL_教程/内容面板" title="cn/XUL_教程/内容面板">内容面板</a></li>
- <li><a href="/cn/XUL_教程/Splitters" title="cn/XUL_教程/Splitters">Splitters</a></li>
- <li><a href="/Cn/XUL_教程/滚动栏" title="cn/XUL_教程/滚动栏">滚动栏</a></li>
-</ul>
-
-<h5 id=".E5.B7.A5.E5.85.B7.E6.A0.8F.E5.92.8C.E8.8F.9C.E5.8D.95" name=".E5.B7.A5.E5.85.B7.E6.A0.8F.E5.92.8C.E8.8F.9C.E5.8D.95">工具栏和菜单</h5>
-
-<ul>
- <li><a href="/cn/XUL_教程/工具栏" title="cn/XUL_教程/工具栏">工具栏</a></li>
- <li><a href="/cn/XUL_教程/简单菜单栏" title="cn/XUL_教程/简单菜单栏">简单菜单栏</a></li>
- <li><a href="/cn/XUL_教程/更多菜单特性" title="cn/XUL_教程/更多菜单特性">更多菜单特性</a></li>
- <li><a href="/cn/XUL_教程/弹出菜单" title="cn/XUL_教程/弹出菜单">弹出菜单</a></li>
- <li><a href="/cn/XUL_教程/滚动菜单" title="cn/XUL_教程/滚动菜单">滚动菜单</a></li>
-</ul>
-
-<h5 id=".E4.BA.8B.E4.BB.B6.E5.92.8C.E8.84.9A.E6.9C.AC" name=".E4.BA.8B.E4.BB.B6.E5.92.8C.E8.84.9A.E6.9C.AC">事件和脚本</h5>
-
-<ul>
- <li><a href="/cn/XUL_教程/添加事件处理器" title="cn/XUL_教程/添加事件处理器">添加事件处理器</a></li>
- <li><a href="/Cn/XUL_教程/其他事件处理器" title="cn/XUL_教程/其他事件处理器">其他事件处理器</a></li>
- <li><a href="/cn/XUL_教程/键盘的快捷键" title="cn/XUL_教程/键盘的快捷键">键盘的快捷键</a></li>
- <li><a href="/cn/XUL_教程/焦点和选择" title="cn/XUL_教程/焦点和选择">焦点和选择 Focus and Selection</a></li>
- <li><a href="/cn/XUL_教程/命令" title="cn/XUL_教程/命令">命令 Commands</a></li>
- <li><a href="/cn/XUL_教程/更新操作" title="cn/XUL_教程/更新操作">更新操作</a></li>
- <li><a href="/cn/XUL_教程/广播和监听器" title="cn/XUL_教程/广播和监听器">广播和监听器 Broadcasters and Observers</a></li>
-</ul>
-
-<h5 id=".E6.96.87.E6.A1.A3.E5.AF.B9.E8.B1.A1.E6.A8.A1.E5.9E.8B" name=".E6.96.87.E6.A1.A3.E5.AF.B9.E8.B1.A1.E6.A8.A1.E5.9E.8B">文档对象模型</h5>
-
-<ul>
- <li><a href="/cn/XUL_教程/文档对象模型" title="cn/XUL_教程/文档对象模型">文档对象模型 Document Object Model</a></li>
- <li><a href="/cn/XUL_教程/修改XUL界面" title="cn/XUL_教程/修改XUL界面">修改XUL界面 Modifying a XUL Interface</a></li>
- <li><a href="/cn/XUL_教程/使用列表" title="cn/XUL_教程/使用列表">使用列表 Manipulating Lists</a></li>
- <li><a href="/cn/XUL_教程/Box对象" title="cn/XUL_教程/Box对象">Box对象 Box Objects</a></li>
- <li><a href="/Cn/XUL_教程/XPCOM_接口" title="cn/XUL_教程/XPCOM_接口">XPCOM 接口 XPCOM Interfaces</a></li>
- <li><a href="/cn/XUL_教程/XPCOM_示例" title="cn/XUL_教程/XPCOM_示例">XPCOM 示例 XPCOM Examples</a></li>
-</ul>
-
-<h5 id=".E6.A0.91" name=".E6.A0.91">树</h5>
-
-<ul>
- <li><a href="/cn/XUL_教程/Trees" title="cn/XUL_教程/Trees">树</a></li>
- <li><a href="/cn/XUL_教程/More_Tree_Features" title="cn/XUL_教程/More_Tree_Features">更多树的特性</a></li>
- <li><a href="/cn/XUL_教程/Tree_Selection" title="cn/XUL_教程/Tree_Selection">Tree Selection</a></li>
- <li><a href="/cn/XUL_教程/Custom_Tree_Views" title="cn/XUL_教程/Custom_Tree_Views">Custom Tree Views</a></li>
- <li><a href="/cn/XUL_教程/Tree_View_Details" title="cn/XUL_教程/Tree_View_Details">Tree View Details</a></li>
- <li><a href="/cn/XUL_教程/Tree_Box_Objects" title="cn/XUL_教程/Tree_Box_Objects">Tree Box Objects</a></li>
-</ul>
-
-<h5 id="RDF_.E5.92.8C.E6.A8.A1.E6.9D.BF" name="RDF_.E5.92.8C.E6.A8.A1.E6.9D.BF">RDF 和模板</h5>
-
-<ul>
- <li><a class="internal" href="/Cn/XUL_教程/RDF介绍" title="cn/XUL 教程/RDF介绍">RDF介绍</a></li>
- <li><a href="/Cn/XUL_教程/Templates" title="cn/XUL_教程/Templates">模板</a></li>
- <li><a href="/cn/XUL_教程/Trees_and_Templates" title="cn/XUL_教程/Trees_and_Templates">树和模板 Trees and Templates</a></li>
- <li><a href="/cn/XUL_教程/RDF_Datasources" title="cn/XUL_教程/RDF_Datasources">RDF数据源 RDF Datasources</a></li>
- <li><a href="/cn/XUL_教程/Advanced_Rules" title="cn/XUL_教程/Advanced_Rules">高级规则 Advanced Rules</a></li>
- <li><a href="/cn/XUL_教程/Persistent_Data" title="cn/XUL_教程/Persistent_Data">Persistent Data</a></li>
-</ul>
-
-<h5 id=".E6.9C.AC.E5.9C.B0.E5.8C.96.E5.92.8C.E7.9A.AE.E8.82.A4" name=".E6.9C.AC.E5.9C.B0.E5.8C.96.E5.92.8C.E7.9A.AE.E8.82.A4">本地化和皮肤</h5>
-
-<ul>
- <li><a href="/cn/XUL_教程/添加样式表" title="cn/XUL_教程/添加样式表">添加样式表</a></li>
- <li><a href="/cn/XUL_教程/样式化树" title="cn/XUL_教程/样式化树">对树进行样式化</a></li>
- <li><a href="/cn/XUL_教程/修改默认的皮肤" title="cn/XUL_教程/修改默认的皮肤">修改默认的皮肤</a></li>
- <li><a href="/cn/XUL_教程/创建一个皮肤" title="cn/XUL_教程/创建一个皮肤">创建一个皮肤</a></li>
- <li><a href="/Cn/XUL_教程/本地化" title="cn/XUL_教程/本地化">本地化</a></li>
- <li><a href="/Cn/XUL_教程/属性文件" title="cn/XUL_教程/属性文件">属性文件</a></li>
-</ul>
-
-<h5 id=".E7.BB.91.E5.AE.9A" name=".E7.BB.91.E5.AE.9A">绑定</h5>
-
-<ul>
- <li><a href="/Cn/XUL_教程/XBL介绍" title="cn/XUL_教程/XBL介绍">Introduction to XBL</a></li>
- <li><a class="internal" href="/cn/XUL_教程/匿名内容" title="cn/XUL 教程/匿名内容">匿名内容</a></li>
- <li><a href="/cn/XUL_教程/XBL_Attribute_Inheritance" title="cn/XUL_教程/XBL_Attribute_Inheritance">XBL Attribute Inheritance</a></li>
- <li><a href="/cn/XUL_教程/Adding_Properties_to_XBL-defined_Elements" title="cn/XUL_教程/Adding_Properties_to_XBL-defined_Elements">Adding Properties</a></li>
- <li><a href="/cn/XUL_教程/Adding_Methods_to_XBL-defined_Elements" title="cn/XUL_教程/Adding_Methods_to_XBL-defined_Elements">Adding Methods</a></li>
- <li><a href="/cn/XUL_教程/Adding_Event_Handlers_to_XBL-defined_Elements" title="cn/XUL_教程/Adding_Event_Handlers_to_XBL-defined_Elements">Adding Event Handlers</a></li>
- <li><a href="/cn/XUL_教程/XBL_Inheritance" title="cn/XUL_教程/XBL_Inheritance">XBL Inheritance</a></li>
- <li><a href="/cn/XUL_教程/XBL_Example" title="cn/XUL_教程/XBL_Example">XBL示例</a></li>
-</ul>
-
-<h5 id=".E7.89.B9.E6.AE.8A.E7.9A.84.E7.AA.97.E5.8F.A3.E7.B1.BB.E5.9E.8B" name=".E7.89.B9.E6.AE.8A.E7.9A.84.E7.AA.97.E5.8F.A3.E7.B1.BB.E5.9E.8B">特殊的窗口类型</h5>
-
-<ul>
- <li><a href="/cn/XUL_教程/Features_of_a_Window" title="cn/XUL_教程/Features_of_a_Window">窗口特征</a></li>
- <li><a href="/Cn/XUL_教程/Creating_Dialogs" title="cn/XUL_教程/Creating_Dialogs">创建对话框 Creating Dialogs</a></li>
- <li><a href="/cn/XUL_教程/Open_and_Save_Dialogs" title="cn/XUL_教程/Open_and_Save_Dialogs">打开并保存对话框 Open and Save Dialogs</a></li>
- <li><a href="/cn/XUL_教程/Creating_a_Wizard" title="cn/XUL_教程/Creating_a_Wizard">创建一个向导 Creating a Wizard</a></li>
- <li><a href="/cn/XUL_教程/More_Wizards" title="cn/XUL_教程/More_Wizards">More Wizards</a></li>
- <li><a href="/cn/XUL_教程/Overlays" title="cn/XUL_教程/Overlays">Overlays</a></li>
- <li><a href="/cn/XUL_教程/Cross_Package_Overlays" title="cn/XUL_教程/Cross_Package_Overlays">Cross Package Overlays</a></li>
-</ul>
-
-<h5 id=".E5.AE.89.E8.A3.85" name=".E5.AE.89.E8.A3.85">安装</h5>
-
-<ul>
- <li><a href="/cn/XUL_教程/Creating_an_Installer" title="cn/XUL_教程/Creating_an_Installer">创建安装程序</a></li>
- <li><a href="/cn/XUL_教程/Install_Scripts" title="cn/XUL_教程/Install_Scripts">安装脚本</a></li>
- <li><a href="/cn/XUL_教程/Additional_Install_Features" title="cn/XUL_教程/Additional_Install_Features">其它安装功能</a></li>
-</ul>
-
-<div class="originaldocinfo">
-<h5 id=".E5.85.B3.E4.BA.8E.E5.8E.9F.E5.A7.8B.E6.96.87.E6.A1.A3.E7.9A.84.E4.BF.A1.E6.81.AF" name=".E5.85.B3.E4.BA.8E.E5.8E.9F.E5.A7.8B.E6.96.87.E6.A1.A3.E7.9A.84.E4.BF.A1.E6.81.AF">关于原始文档的信息</h5>
-
-<ul>
- <li>作者: <a class="external" href="http://www.xulplanet.com/ndeakin/">Neil Deakin</a></li>
- <li>最后修改时间: 2005年6月3日</li>
- <li>版权信息: © 1999-2005 XULPlanet.com</li>
-</ul>
-</div>
-
-<p> </p>
-
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/input_controls/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/input_controls/index.html
deleted file mode 100644
index d901c50eeb..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/input_controls/index.html
+++ /dev/null
@@ -1,110 +0,0 @@
----
-title: XUL_教程/输入控件
-slug: Mozilla/Tech/XUL/Tutorial/Input_Controls
-tags:
- - XUL_教程
-translation_of: Archive/Mozilla/XUL/Tutorial/Input_Controls
----
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Adding_Labels_and_Images" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Numeric_Controls">下一页 »</a></p>
-</div><p></p>
-<p> </p>
-<h3 id=".E6.96.87.E6.9C.AC.E8.BE.93.E5.85.A5.E6.A1.86" name=".E6.96.87.E6.9C.AC.E8.BE.93.E5.85.A5.E6.A1.86">文本输入框</h3>
-<p>HTML有一个输入元素可以用于文本输入操作。 XUL 有一个相似的元素, <code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/textbox" title="textbox">textbox</a></code></code>, 用于文本输入。 不用任何属性, <code>textbox</code> 元素创建一个框让用户可以输入文本。文本框具有像HTML的输入操作相同的许多属性。下面列出其中一部份:</p>
-<dl>
- <dt>
- <code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code> </dt>
- <dd>
- 控件的唯一性标识。</dd>
- <dt>
- <code id="a-class"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/class">class</a></code> </dt>
- <dd>
- 输入框的样式。</dd>
- <dt>
- <code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code> </dt>
- <dd>
- 如果你要输入框显示一个默认值,可以指定此属性。</dd>
- <dt>
- <code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code> </dt>
- <dd>
- 如果需要禁用文本输入框可以将这个属性设为<code>true</code>。</dd>
- <dt>
- <code id="a-type"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/type">type</a></code> </dt>
- <dd>
- 你可以将这个属性的值设为<code>password</code>, 创建一个输入框隐藏用户的输入内容。 通常用于密码输入框。</dd>
- <dt>
- <code id="a-maxlength"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/maxlength">maxlength</a></code> </dt>
- <dd>
- 输入框允许输入的字符最大数量。</dd>
-</dl>
-<p>注解:在HTML里, 使用<code>input</code>元素区分几个不同类型的字段,在XUL里用每种类型对元素进行区分。</p>
-<p>下面列出输入框的一些属性:</p>
-<p><span id="%E4%BE%8B1"><a id="%E4%BE%8B1"></a><strong>例1</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_inputs_1.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_inputs_1.xul">View</a></p>
-<pre>&lt;label control="some-text" value="Enter some text"/&gt;
-&lt;textbox id="some-text"/&gt;
-&lt;label control="some-password" value="Enter a password"/&gt;
-&lt;textbox id="some-password" type="password" maxlength="8"/&gt;
-</pre>
-<h4 id=".E5.A4.9A.E8.A1.8C.E6.96.87.E6.9C.AC.E8.BE.93.E5.85.A5.E6.A1.86" name=".E5.A4.9A.E8.A1.8C.E6.96.87.E6.9C.AC.E8.BE.93.E5.85.A5.E6.A1.86">多行文本输入框</h4>
-<p>上面的<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/textbox" title="textbox">textbox</a></code></code> 例子创建的输入框仅仅可以输入一行文本。HTML也有一个<code>textarea</code>元素用来创建一个大的文本输入区域。在XUL,你可以使用<code>textbox</code>元素达到很好的效果 -- 这两种元素都不是很常用。如果你设置<code><code id="a-multiline"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/multiline">multiline</a></code></code>属性为<code>true</code>,文本输入框将显示为多行。</p>
-<p><span id="%E4%BE%8B2"><a id="%E4%BE%8B2"></a><strong>例2</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_inputs_2.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_inputs_2.xul">View</a></p>
-<pre>&lt;textbox multiline="true"
- value="This is some text that could wrap onto multiple lines."/&gt;
-</pre>
-<p>就像HTML中的<code>textarea</code>,你可以使用 <code>rows</code> 和<code>cols</code> 属性设置大小。这可以设置显示字符的行和列数量。</p>
-<div class="highlight">
- <h4 id=".E6.88.91.E4.BB.AC.E6.96.87.E4.BB.B6.E6.9F.A5.E6.89.BE.E7.9A.84.E4.BE.8B.E5.AD.90" name=".E6.88.91.E4.BB.AC.E6.96.87.E4.BB.B6.E6.9F.A5.E6.89.BE.E7.9A.84.E4.BE.8B.E5.AD.90">我们文件查找的例子</h4>
- <p>让我们给文件查找对话框添加一个搜索输入框。我们将要使用 <code>textbox</code> 元素。</p>
- <pre class="eval"><span class="highlightred">&lt;label value="Search for:" control="find-text"/&gt;</span>
-<span class="highlightred">&lt;textbox id="find-text"/&gt;</span>
-
-&lt;button id="find-button" label="Find"/&gt;
-</pre>
- <div class="float-right">
- <div class="float-right">
- <img alt="Image:inputs1.png" class="internal" src="/@api/deki/files/730/=Inputs1.png"></div>
- </div>
- <p>将这些行插入到在前一节最后我们创建的按钮的前面。如果你打开这个窗口,你将会看到像显示的图片一样的效果。</p>
- <p>注解:标签和文本输入框现在已经显示在窗口里。文本输入框已具有完全的功能你可以在它里面输入文本和选中文本。使用<code><code id="a-control"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/control">control</a></code></code> 属性后因此当<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/label" title="label">label</a></code></code> 被点击后输入框被选中。</p>
- <h3 id=".E5.A4.9A.E9.80.89.E5.92.8C.E5.8D.95.E9.80.89.E6.8C.89.E9.92.AE" name=".E5.A4.9A.E9.80.89.E5.92.8C.E5.8D.95.E9.80.89.E6.8C.89.E9.92.AE">多选和单选按钮</h3>
- <p>另外两个元素是用于创建多选输入框和单选按钮。它们是按钮的变体。多选输入框元素(checkbox element)有多个选择项,可以被选或不选。单选按钮的用法相似,它有一个集合并且只能选择其中之一。</p>
- <p>你可以像使用按钮的属性一样使用多选输入框和单选按钮。下面的例子向你展示一些简单的多选输入框和单选按钮。</p>
- <pre>&lt;checkbox id="case-sensitive" checked="true" label="Case sensitive"/&gt;
-&lt;radio id="orange" label="Orange"/&gt;
-&lt;radio id="violet" selected="true" label="Violet"/&gt;
-&lt;radio id="yellow" label="Yellow"/&gt;
-</pre>
- <p>第一行创建一个简单的 <code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/checkbox" title="checkbox">checkbox</a></code></code>。当用户点击多选项,它在选中和非选中之间切换。<code><code id="a-checked"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/checked">checked</a></code></code> 属性可以用在表明它的默认状态。你可以将它的值设为<code>true</code>或者<code>false</code>。<code><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></code>属性可以用于设置显示在多选项旁边的文本。对于<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/radio" title="radio">radio</a></code></code> 按钮,你可以使用 <code><code id="a-selected"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/selected">selected</a></code></code> 属性代替 <code><code id="a-checked"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/checked">checked</a></code></code> 属性。设置它的值为 <code>true</code> 让默认选中其中的一个单选按钮,或者不选中其他的单选按钮。</p>
- <h4 id=".E5.8D.95.E9.80.89.E9.A1.B9.E7.BB.84.E5.85.83.E7.B4.A0" name=".E5.8D.95.E9.80.89.E9.A1.B9.E7.BB.84.E5.85.83.E7.B4.A0">单选项组元素</h4>
- <p>为了把单选按钮组合在一起,你需要用到<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/radiogroup" title="radiogroup">radiogroup</a></code></code> 元素。 在单选按钮组中同一时间只允许其中的一个单选按钮被选中。在其中的一个中点击将会把同一组中的其他按钮都设成关闭。下面的例子很好地示范了这一点。</p>
- <p><span id="%E4%BE%8B3"><a id="%E4%BE%8B3"></a><strong>例3</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_inputs_3.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_inputs_3.xul">View</a></p>
- <pre>&lt;radiogroup&gt;
- &lt;radio id="orange" label="Orange"/&gt;
- &lt;radio id="violet" selected="true" label="Violet"/&gt;
- &lt;radio id="yellow" label="Yellow"/&gt;
-&lt;/radiogroup&gt;
-</pre>
- <h4 id=".E5.B1.9E.E6.80.A7" name=".E5.B1.9E.E6.80.A7">属性</h4>
- <p>像按钮一样,多选框和单选按钮可以用文本标签和图片进行包装,当它被按下时通过切换图片来表达选中或没选中。多选项有很多与按钮相同的属性:</p>
- <dl>
- <dt>
- <code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code> </dt>
- <dd>
- 在多选项或单选按钮上的文本标签。</dd>
- <dt>
- <code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code> </dt>
- <dd>
- 设为<code>true</code> 或 <code>false</code> 去禁用或启用多选项或单选按钮。</dd>
- <dt>
- <code id="a-accesskey"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/accesskey">accesskey</a></code> </dt>
- <dd>
- 用于选中元素的快捷键。字母会在标签中以下划线显示。</dd>
- </dl>
- <div class="highlight">
- <p><span id="%E5%88%B0%E7%9B%AE%E5%89%8D%E4%B8%BA%E6%AD%A2%E6%96%87%E4%BB%B6%E6%9F%A5%E6%89%BE%E7%9A%84%E4%BE%8B%E5%AD%90"><a id="%E5%88%B0%E7%9B%AE%E5%89%8D%E4%B8%BA%E6%AD%A2%E6%96%87%E4%BB%B6%E6%9F%A5%E6%89%BE%E7%9A%84%E4%BE%8B%E5%AD%90"></a><strong>到目前为止文件查找的例子</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/findfile/findfile-inputs.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/findfile/findfile-inputs.xul">View</a></p>
- </div>
- <p>在下一节,我们将可以看到一些适用于<a href="/XUL_Tutorial:Numeric_Controls" title="XUL Tutorial:Numeric Controls">输入和选择数值</a>的元素。</p>
- <div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Adding_Labels_and_Images" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Numeric_Controls">下一页 »</a></p>
-</div></div>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/introduction/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/introduction/index.html
deleted file mode 100644
index 5e80393d30..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/introduction/index.html
+++ /dev/null
@@ -1,70 +0,0 @@
----
-title: XUL_教程/引言
-slug: Mozilla/Tech/XUL/Tutorial/Introduction
-tags:
- - XUL_Tutorial
-translation_of: Archive/Mozilla/XUL/Tutorial/Introduction
----
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_教程:XUL的结构">下一页 »</a></p>
-</div><p></p>
-
-<p>这份教程可以帮助你如何用 XUL (XML用户界面语言) 来创建跨平台的可描述界面的应用程序.</p>
-
-<p>这份教程将设计出一个"查找文件"的应用程序界面, 类似于Macintosh的Sherlock或是Windows的文件查找的窗口. 只会提供基本的界面以及一些简单的功能函数. 真正的文件查找功能并没有实现,.</p>
-
-<h2 id=".E4.BB.80.E4.B9.88.E6.98.AFXUL.EF.BC.8C.E5.8F.8A.E4.B8.BA.E4.BB.80.E4.B9.88.E8.A6.81.E5.88.9B.E5.BB.BA.E5.AE.83.EF.BC.9F" name=".E4.BB.80.E4.B9.88.E6.98.AFXUL.EF.BC.8C.E5.8F.8A.E4.B8.BA.E4.BB.80.E4.B9.88.E8.A6.81.E5.88.9B.E5.BB.BA.E5.AE.83.EF.BC.9F">什么是XUL,及为什么要创建它?</h2>
-
-<p>XUL (发音是 zool,有点像cool) 是为开发更快更简单的Mozilla浏览器而开发的. 这是一个基于 XML 可扩展描述语言 的语言 ,所以XML的所有特性都适用于XUL.</p>
-
-<p>大多数应用程序在开发的时候都需要应用某个特定平台的特性,这就使得创建一个跨平台的软件变得费时费力。而这对于某些用户或许并非重要,但是对那些想在其它设备上,比如手持设备或机顶盒上,运行一个应用程序的用户来说却,跨平台确是至关重要的。</p>
-
-<p>在过去诸多跨平台的解决方案都已被开发出来。比如Java的可移植性就是其主要卖点。XUL则是一个那样的语言,它被设计出用于创建可移植的用户界面。</p>
-
-<p>创建一个应用程序是要花费好多时间的,哪怕它只工作在某个平台下。编译和排错需要的时间可能会很多。而使用XUL,一个界面可以被快速方便地制作和修改。</p>
-
-<p>XUL具备所有其它XML语言的所有优点。举例来说,XHTML或者其它XML语言,比如MathML 数学标记语言 或 SVG 可伸缩矢量图,可以被插入到XUL当中。同样,XUL中的文本也可以很容易地被本地化,那意味着它可以稍加努力就可以被翻译成其它国家的语言。样式表可以被提供用于修改用户界面的外观(就像WinAmp的主题和皮肤或者某些窗口管理器)。</p>
-
-<h2 id=".E7.94.A8XUL.E5.8F.AF.E4.BB.A5.E5.81.9A.E4.BA.9B.E4.BB.80.E4.B9.88.E7.B1.BB.E5.9E.8B.E7.9A.84.E7.94.A8.E6.88.B7.E7.95.8C.E9.9D.A2.EF.BC.9F" name=".E7.94.A8XUL.E5.8F.AF.E4.BB.A5.E5.81.9A.E4.BA.9B.E4.BB.80.E4.B9.88.E7.B1.BB.E5.9E.8B.E7.9A.84.E7.94.A8.E6.88.B7.E7.95.8C.E9.9D.A2.EF.BC.9F">用XUL可以做些什么类型的用户界面?</h2>
-
-<p>XUL有能力创建现代图形界面中的大多数元件。它的应用广泛到可以满足特定设备特殊要求,而它的强大足以使开发者创建出复杂的界面。</p>
-
-<p>下列组件可以被创建:</p>
-
-<ul>
- <li>输入组件,如文本框和复选框</li>
- <li>带按钮和其它组件的工具条</li>
- <li>带菜单和弹出菜单的菜单条</li>
- <li>选项卡对话框</li>
- <li>树形控件或栅格控件</li>
- <li>快捷键</li>
-</ul>
-
-<p>显示的内容创建自XUL文件及数据源的数据,在Mozilla中,数据源包含用户邮件箱、书签、搜索结果等等,菜单、树状列表和其它元素都能从那添加,也可以从RDF文件添加自定义的数据。</p>
-
-<p>创建XUL应用程序的方法有几种:</p>
-
-<ul>
- <li>Firefox扩展:扩展可以增强浏览器的功能,一般出现在工具栏、菜单,或自定义的界面里面。这里使用一种在XUL里称为overlay的东西完成,可以被主界面所引用,在实际使用中,Firefox将从扩展里面引入相关界面。扩展也可以被其它基于Mozilla平台的产品所使用,例如Thunderbird。</li>
- <li>基于XULRunner的程序:XULRunner是创建基于Mozilla平台XUL程序的一个独立程序,它有自己的可执行文件,因而不需要浏览器。</li>
- <li>XUL包:有别与前面基于Firefox扩展及XULRunner,它更像是有独立运行窗口的独立程序,一般用于不想携带大体积的XULRunner程序,但仍然需要Mozilla浏览器来允许该包。</li>
- <li>远程XUL程序:你可以把XUL代码放在Web服务器,然后在浏览器打开访问,但基于安全方面的原因,该方法有局限性。</li>
-</ul>
-
-<p>前三种类型需要在用户电脑做安装操作,但是这样程序就没有安全限制了,可以访问本地文件和读写属性。例如扩展,所包含的XUL文件、脚本和图像将被打包成单一文件,用户下载后安装到本地。基于Mozilla的程序比如Firefox,提供了扩展管理器来对包进行安装管理,而不需要很多代码操作。 XUL也可以从远程WEB站点打开,然而这样很多类型操作会有限制,以及一些XUL外观效果会失效。如果你需要从远程站点载入XUL内容,WEB服务器必须设置XUL文件头格式为'application/vnd.mozilla.xul+xml'。通常XUL文件使用.xul为扩展名,你可以从Mozilla浏览器打开它,跟打开其它文件一样,点击菜单【打开文件】或者直接在地址栏输入URL地址。</p>
-
-<h2 id=".E5.AD.A6.E4.B9.A0.E8.BF.99.E4.BB.BD.E6.95.99.E7.A8.8B.E4.B9.8B.E5.89.8D.EF.BC.8C.E6.88.91.E9.9C.80.E8.A6.81.E5.81.9A.E4.BA.9B.E4.BB.80.E4.B9.88.E7.9F.A5.E8.AF.86.E5.87.86.E5.A4.87.EF.BC.9F" name=".E5.AD.A6.E4.B9.A0.E8.BF.99.E4.BB.BD.E6.95.99.E7.A8.8B.E4.B9.8B.E5.89.8D.EF.BC.8C.E6.88.91.E9.9C.80.E8.A6.81.E5.81.9A.E4.BA.9B.E4.BB.80.E4.B9.88.E7.9F.A5.E8.AF.86.E5.87.86.E5.A4.87.EF.BC.9F">学习这份教程之前,我需要做些什么知识准备?</h2>
-
-<p>你需要理解HTML,以及了解XML和CSS一些基础知识,下面几点建议需要注意:</p>
-
-<ul>
- <li>XUL标签和属性全部用小写,XML是区分大小写的(不像HTML)</li>
- <li>XUL属性值都要写在引号内,即使是数字</li>
- <li>XUL文件一般分割为四部分,一是布局和元素,二是样式描述,三是脚本,四是语言包,另外通常还会包括一些图片和数据文件</li>
-</ul>
-
-<p>基于Mozilla和Gecko平台的程序都支持XUL,例如Mozilla Firefox和Netscape6。随着时间推移XUL在语法有些不同,你可能需要使用适当的版本来进行工作。在大多例子里使用的是Mozilla 1.0或更高版本。XUL在Firefox和其它基于Mozilla浏览器中是相似的,虽然也存在一些细微的差别,例如工具栏。 该指南将最大限度介绍XUL方方面面,然而还是无法讲述所有的特征。一旦你熟悉XUL,可以使用<a class="external" href="http://www.xulplanet.com/references/elemref/">XUL Element Reference</a>来查找其它标签的属性特征。</p>
-
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_教程:XUL的结构">下一页 »</a></p>
-</div><p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/introduction_to_rdf/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/introduction_to_rdf/index.html
deleted file mode 100644
index 03e0c64a88..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/introduction_to_rdf/index.html
+++ /dev/null
@@ -1,109 +0,0 @@
----
-title: XUL_教程/RDF介绍
-slug: Mozilla/Tech/XUL/Tutorial/Introduction_to_RDF
-translation_of: Archive/Mozilla/XUL/Tutorial/Introduction_to_RDF
----
-<p> </p>
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Tree_Box_Objects" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Templates">下一页 »</a></p>
-</div><p></p>
-<p> </p>
-<p>    本章我们关注与RDF (资源描述框架).</p>
-<h3 id="Resource_Description_Framework" name="Resource_Description_Framework">资源描述框架</h3>
-<p>    我们可以使用 <a href="/en/XUL_Tutorial/Trees" title="en/XUL_Tutorial/Trees">tree</a> 元素呈现数据集,就像书签和邮件管理器一样。然而这样却使向 <a href="/en/XUL" title="en/XUL">XUL</a> 文件中直接添加数据变得很不方便。直接在XUL文件中修改书签变得十分困难。这就需要RDF 数据结构。</p>
-<p><a href="/en/RDF" title="en/RDF">    RDF</a> (资源描述框架)是一种用于储存像书签或邮件这样的资源的格式。其他形式的数据可以被编码为RDF,也可以有RDF创建其他形式的数据。这是 Mozilla 处理像书签、邮件、历史等的方法。Mozilla 为这些常用的数据提供了数据源,使我们很容易使用他们。</p>
-<p>    你可以使用任意的RDF数据源来填充树结构,或者仅把RDF指向一个存有数据的XML文件。这使得显示含有许多行的树变得非常容易。RDF 也可以填充其他的 XUL 元素比如列表及菜单,见下一章。</p>
-<p>    这里是关于RDF的一个非常简略的概述,希望看到更为详尽的内容请访问XULPlanet上的 <a class="external" href="http://www.xulplanet.com/tutorials/mozsdk/rdfstart.php">Introduction to the RDF Model</a>。如果你刚刚接触RDF请继续向下阅读。</p>
-<p>    更多信息参见 <a class="external" href="http://www.w3.org/RDF/">RDF specification</a>.</p>
-<h4 id="RDF.2FXML" name="RDF.2FXML">RDF/XML</h4>
-<p>    RDF 包含这数据的图表示形式。 RDF/XML 时一种用于表示RDF数据的XML语言。它包含非常简单的元素集,下面的例子显示一个简单的RDF模板。</p>
-<pre>&lt;?xml version="1.0"?&gt;
-&lt;RDF:RDF
- xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"&gt;
- ...
-&lt;/RDF:RDF&gt;
-</pre>
-<p>    与XUL头有些相似,<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/window" title="window">window</a></code></code> 元素被 <code>RDF</code> 元素代替。同样为RDF定义了名空间,在RDF元素中将填充一些数据。可以在Mozilla文件夹中找到一些 RDF/XML 文件的例子,他们以rdf作为后缀。</p>
-<h4 id="RDF_database" name="RDF_database">RDF 数据库</h4>
-<p>    让我们来以有RDF产生的书签列表为例。书签列表包含一系列记录,每项记录都有一系列数据相关联,比如书签标题,URL,访问日期等。</p>
-<p>    把书签当作数据库来考虑,这个数据库是一个含有多个域的表格。这个列表需要分级,因为我们需要利用文件夹来分组书签。每一个域都来源与RDF数据库,都由名字相关联。名字用URI描述。</p>
-<p>    例如Mozilla书签列表的名字的RUI描述如下:</p>
-<table class="fullwidth-table">
- <tbody>
- <tr>
- <td>Name</td>
- <td><span class="nowiki">http://home.netscape.com/NC-rdf#Name</span></td>
- <td>Bookmark name</td>
- </tr>
- <tr>
- <td>URL</td>
- <td><span class="nowiki">http://home.netscape.com/NC-rdf#URL</span></td>
- <td>URL to link to</td>
- </tr>
- <tr>
- <td>Description</td>
- <td><span class="nowiki">http://home.netscape.com/NC-rdf#Description</span></td>
- <td>Bookmark description</td>
- </tr>
- <tr>
- <td>Last Visited</td>
- <td><span class="nowiki">http://home.netscape.com/WEB-rdf#LastVisitDate</span></td>
- <td>Date of last visit</td>
- </tr>
- </tbody>
-</table>
-<p>    这些是按照名空间加域名构造的。下一章,我们利用它来自动填充数据域。注意访问日期的名空间与其他的不同。</p>
-<h4 id="RDF.2FXML_file_example" name="RDF.2FXML_file_example">RDF/XML 文件样例</h4>
-<p>    下面是一个RDF/XML文件,有三条记录和三个域。</p>
-<pre>&lt;RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:ANIMALS="http://www.some-fictitious-zoo.com/rdf#"&gt;
-
- &lt;RDF:Seq about="http://www.some-fictitious-zoo.com/all-animals"&gt;
- &lt;RDF:li&gt;
- &lt;RDF:Description about="http://www.some-fictitious-zoo.com/mammals/lion"&gt;
- &lt;ANIMALS:name&gt;Lion&lt;/ANIMALS:name&gt;
- &lt;ANIMALS:species&gt;Panthera leo&lt;/ANIMALS:species&gt;
- &lt;ANIMALS:class&gt;Mammal&lt;/ANIMALS:class&gt;
- &lt;/RDF:Description&gt;
- &lt;/RDF:li&gt;
- &lt;RDF:li&gt;
- &lt;RDF:Description about="http://www.some-fictitious-zoo.com/arachnids/tarantula"&gt;
- &lt;ANIMALS:name&gt;Tarantula&lt;/ANIMALS:name&gt;
- &lt;ANIMALS:species&gt;Avicularia avicularia&lt;/ANIMALS:species&gt;
- &lt;ANIMALS:class&gt;Arachnid&lt;/ANIMALS:class&gt;
- &lt;/RDF:Description&gt;
- &lt;/RDF:li&gt;
- &lt;RDF:li&gt;
- &lt;RDF:Description about="http://www.some-fictitious-zoo.com/mammals/hippopotamus"&gt;
- &lt;ANIMALS:name&gt;Hippopotamus&lt;/ANIMALS:name&gt;
- &lt;ANIMALS:species&gt;Hippopotamus amphibius&lt;/ANIMALS:species&gt;
- &lt;ANIMALS:class&gt;Mammal&lt;/ANIMALS:class&gt;
- &lt;/RDF:Description&gt;
- &lt;/RDF:li&gt;
- &lt;/RDF:Seq&gt;
-&lt;/RDF:RDF&gt;
-</pre>
-<p>    对每一种动物使用一条记录描述。每一个 <code>RDF:Description</code> 标签描述一条记录。每条记录定义了三个域:<code>name</code>, <code>species</code> ,<code>class</code>。虽然没有必要让每一条记录拥有相同的域,但是最好如此。</p>
-<p>    三个域都在 <code>ANIMALS</code>名空间下, <code>ANIMALS名空间在</code><code>RDF标签中定义<span style="font-family: Verdana,Tahoma,sans-serif;">。选择这个名字是因为它的意思,但完全可以选择其他名字。这里的名空间定义是有用的,因为如果使用样式表</span></code><code>class</code> 域可能发生冲突。</p>
-<p>     <code>Seq</code> 和 <code>li</code> 元素在列表中区分每一条记录,与HTML 列表中的定义很相似。 <code>Seq</code> 指明记录是有序的紧挨着的,对于无序内容使用 <code>Bag</code> 标签, <code>Alt 用于指明其中的记录只能选择其一</code>(如映射 URL)。</p>
-<p>    在XUL文件中可以通过名空间和域名来引用其中的数据,在上例中,下面的URI描述其中的数据域:</p>
-<table class="fullwidth-table">
- <tbody>
- <tr>
- <td>Name</td>
- <td><span class="nowiki">http://www.some-fictitious-zoo.com/rdf#name</span></td>
- </tr>
- <tr>
- <td>Species</td>
- <td><span class="nowiki">http://www.some-fictitious-zoo.com/rdf#species</span></td>
- </tr>
- <tr>
- <td>Class</td>
- <td><span class="nowiki">http://www.some-fictitious-zoo.com/rdf#class</span></td>
- </tr>
- </tbody>
-</table>
-<p>    记下来,看看如何使用RDF来填充XUL数据。</p>
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Tree_Box_Objects" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Templates">下一页 »</a></p>
-</div><p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/list_controls/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/list_controls/index.html
deleted file mode 100644
index 27486e030b..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/list_controls/index.html
+++ /dev/null
@@ -1,133 +0,0 @@
----
-title: XUL_教程/列表控件
-slug: Mozilla/Tech/XUL/Tutorial/List_Controls
-tags:
- - XUL_教程
-translation_of: Archive/Mozilla/XUL/Tutorial/List_Controls
----
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Numeric_Controls" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Progress_Meters">下一页 »</a></p>
-</div><p></p>
-<p> </p>
-<h3 id=".E5.88.97.E8.A1.A8.E6.8E.A7.E4.BB.B6" name=".E5.88.97.E8.A1.A8.E6.8E.A7.E4.BB.B6">列表控件</h3>
-<p>列表控件用来在列表中显示许多的项目。用户可以从列表中选择一个项。</p>
-<p>XUL提供两种类型的元素去创建列表,<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listbox" title="listbox">listbox</a></code></code>元素用于创建多行的列表框,和<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code></code>元素用于创建下拉列表框。它们的工作方法类似于在HTML中的 <code>select</code>元素,它们执行的功能相同,但XUL的元素包括更多的特性。</p>
-<p>简单列表框使用<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listbox" title="listbox">listbox</a></code></code>元素创建列表框,和使用<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listitem" title="listitem">listitem</a></code></code>元素创建每个项目。例如,这个列表框有四行,每个项目使用一行。</p>
-<p><span id="%E4%BE%8B1"><a id="%E4%BE%8B1"></a><strong>例1</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_lists_1.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_lists_1.xul">View</a></p>
-<div class="float-right">
- <img alt="图像:lists1.png" class="internal" src="/@api/deki/files/2628/=Lists1.png"></div>
-<pre>&lt;listbox&gt;
- &lt;listitem label="Butter Pecan"/&gt;
- &lt;listitem label="Chocolate Chip"/&gt;
- &lt;listitem label="Raspberry Ripple"/&gt;
- &lt;listitem label="Squash Swirl"/&gt;
-&lt;/listbox&gt;
-</pre>
-<p>如HTML中的<code>option</code>元素,你可以使用<code><code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code></code>为每个项指定一个值。你也可以在脚本中使用这个值。列表框会默认设置一个合适的尺寸,但你可以通过<code><code id="a-rows"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/rows">rows</a></code></code>属性来控制尺寸。通过设置它来确定在列表框中显示的行数。如果列表包括的项超出这个值,在显示时将会出现滚动条。</p>
-<p>下面这个例子演示这些不同的特性:</p>
-<p><span id="%E4%BE%8B2"><a id="%E4%BE%8B2"></a><strong>例2</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_lists_2.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_lists_2.xul">View</a></p>
-<pre>&lt;listbox rows="3"&gt;
- &lt;listitem label="Butter Pecan" value="bpecan"/&gt;
- &lt;listitem label="Chocolate Chip" value="chocchip"/&gt;
- &lt;listitem label="Raspberry Ripple" value="raspripple"/&gt;
- &lt;listitem label="Squash Swirl" value="squash"/&gt;
-&lt;/listbox&gt;
-</pre>
-<p>这个例子已改成一次只显示3行。已经为列表中的每个项目添加了值。列表框还有其他的一些特性,将在后面进行描述。</p>
-<h3 id=".E5.A4.9A.E5.88.97.E5.88.97.E8.A1.A8.E6.A1.86" name=".E5.A4.9A.E5.88.97.E5.88.97.E8.A1.A8.E6.A1.86">多列列表框</h3>
-<p>列表框也支持多列。每个单元格可以有独有的内容,即使只使用文本。当用户选择列表中的一个项目时,当前的行将被选中。你不能只选中其中的一个单元格。</p>
-<p>在列表框中有两个标签可以使用。<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listcols" title="listcols">listcols</a></code></code>元素用来对列信息进行控制,每个列指定一个<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listcol" title="listcol">listcol</a></code></code>元素。在列表框中你将需要为每个列指定一个<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listcol" title="listcol">listcol</a></code></code>元素。</p>
-<p><code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listcell" title="listcell">listcell</a></code></code>元素用于一行中的每个单元格。 如果你需要3列,你就需要增加3个<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listcell" title="listcell">listcell</a></code></code>元素到每个<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listitem" title="listitem">listitem</a></code></code>里面。要给单元格指定文本内容,替换<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listcell" title="listcell">listcell</a></code></code>元素里面的<code><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></code>属性。</p>
-<p>一个简单的例子,如果只有一个列,你也需要将 <code><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></code>属性直接地填充在<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listitem" title="listitem">listitem</a></code></code>元素里面的<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listcell" title="listcell">listcell</a></code></code>元素中, 看起来像前面的例子里一样。</p>
-<p>下面是一个有2列和3行的列表框的例子:</p>
-<p><span id="%E4%BE%8B3"><a id="%E4%BE%8B3"></a><strong>例3</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_lists_3.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_lists_3.xul">View</a></p>
-<pre>&lt;listbox&gt;
- &lt;listcols&gt;
- &lt;listcol/&gt;
- &lt;listcol/&gt;
- &lt;/listcols&gt;
- &lt;listitem&gt;
- &lt;listcell label="George"/&gt;
- &lt;listcell label="House Painter"/&gt;
- &lt;/listitem&gt;
- &lt;listitem&gt;
- &lt;listcell label="Mary Ellen"/&gt;
- &lt;listcell label="Candle Maker"/&gt;
- &lt;/listitem&gt;
- &lt;listitem&gt;
- &lt;listcell label="Roger"/&gt;
- &lt;listcell label="Swashbuckler"/&gt;
- &lt;/listitem&gt;
-&lt;/listbox&gt;
-</pre>
-<h3 id=".E8.A1.A8.E5.A4.B4.E8.A1.8C" name=".E8.A1.A8.E5.A4.B4.E8.A1.8C">表头行</h3>
-<p>列表框一直允许使用一个特殊的表头行。 这和正常的行显示有很大不同。你可以使用它来创建列头。有两个新的元素可以使用。</p>
-<p><code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listhead" title="listhead">listhead</a></code></code>元素用于表头行,就像<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listitem" title="listitem">listitem</a></code></code>元素用于普通行。表头行不是普通行,因此使用脚本去获取列表的首行时获得的将是表头行的下一行。</p>
-<p><code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listheader" title="listheader">listheader</a></code></code>元素用于表头行里的单元格。使用 <code><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></code>属性设置表头行单元格的标签。</p>
-<p>这是一个带表头行的简单例子:</p>
-<p><span id="%E4%BE%8B4"><a id="%E4%BE%8B4"></a><strong>例4</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_lists_4.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_lists_4.xul">View</a></p>
-<div class="float-right">
- <img alt="Image:morelists1.png" class="internal" src="/@api/deki/files/2629/=Morelists1.png"></div>
-<pre>&lt;listbox&gt;
-
- &lt;listhead&gt;
- &lt;listheader label="Name"/&gt;
- &lt;listheader label="Occupation"/&gt;
- &lt;/listhead&gt;
-
- &lt;listcols&gt;
- &lt;listcol/&gt;
- &lt;listcol flex="1"/&gt;
- &lt;/listcols&gt;
-
- &lt;listitem&gt;
- &lt;listcell label="George"/&gt;
- &lt;listcell label="House Painter"/&gt;
- &lt;/listitem&gt;
- &lt;listitem&gt;
- &lt;listcell label="Mary Ellen"/&gt;
- &lt;listcell label="Candle Maker"/&gt;
- &lt;/listitem&gt;
- &lt;listitem&gt;
- &lt;listcell label="Roger"/&gt;
- &lt;listcell label="Swashbuckler"/&gt;
- &lt;/listitem&gt;
-
-&lt;/listbox&gt;
-</pre>
-<p>在这个例子中,<code><code id="a-flex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/flex">flex</a></code></code>属性用于制作灵活的列。这个属性将在最后一节中说明,这里它允许列进行水平扩展。你可以调整窗口的大小去查看列根据窗口而进行伸缩的效果。如果你水平缩小,表格中的标签会自动截成带省略号(...)的样子。你可以在表格或项中使用<code><code id="a-crop"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/crop">crop</a></code></code>属性的值为<code>none</code>去禁止标签被截。</p>
-<h3 id=".E4.B8.8B.E6.8B.89.E5.88.97.E8.A1.A8" name=".E4.B8.8B.E6.8B.89.E5.88.97.E8.A1.A8">下拉列表</h3>
-<p>在HTML里可以使用<code>select</code>元素创建下拉列表。用户可以在文本框内看到一个单选并且点击箭头或其他类似按钮文本制做成不同的选项。其他的选择将会显示在一个弹出的窗口中。 XUL有一个<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code></code>元素可以实现这种效果。它是使用在一个文本框的旁边加一个按钮。选中这个名字是因为当它被选中时会弹出一个菜单。</p>
-<p>描述一个下拉列表需要三个元素。第一个是<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code></code> 元素, 在按钮的旁边创建一个文本输入框。第二,<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code></code>,当按钮被点击时创建并显示弹出窗口。第三,<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code></code>,创建单独的选择。</p>
-<p>下面的范例很好地描述了它的语法:</p>
-<p><span id="Example_5"><a id="Example_5"></a><strong>Example 5</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_lists_5.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_lists_5.xul">View</a></p>
-<div class="float-right">
- <img alt="Image:inputs2.png" class="internal" src="/@api/deki/files/2627/=Inputs2.png"></div>
-<pre>&lt;menulist label="Bus"&gt;
- &lt;menupopup&gt;
- &lt;menuitem label="Car"/&gt;
- &lt;menuitem label="Taxi"/&gt;
- &lt;menuitem label="Bus" selected="true"/&gt;
- &lt;menuitem label="Train"/&gt;
- &lt;/menupopup&gt;
-&lt;/menulist&gt;
-</pre>
-<p>这个菜单列表包括了四个项,全部都使用一个<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code></code> 元素。要显示菜单里的项,点击菜单列表中的箭头按钮。当一个被选中,它会在菜单列表中显示为选中。<code><code id="a-selected"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/selected">selected</a></code></code>属性用于设置哪个被默认选中。</p>
-<h4 id=".E5.8F.AF.E7.BC.96.E8.BE.91.E7.9A.84.E8.8F.9C.E5.8D.95.E5.88.97.E8.A1.A8" name=".E5.8F.AF.E7.BC.96.E8.BE.91.E7.9A.84.E8.8F.9C.E5.8D.95.E5.88.97.E8.A1.A8">可编辑的菜单列表</h4>
-<p>默认情况,你只可以从列表中进行选择。你不能在它上面输入你自己的文本。一个特别的菜单列表允许编辑文件框中的文本。例如,浏览器的地址输入框有一个下拉列表去选择以前输入过的地址,但你也可以输入你自己的地址。</p>
-<p>创建一个可编辑的菜单列表,像下面这样添加<code><code id="a-editable"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/editable">editable</a></code></code> 属性:</p>
-<p><span id="%E4%BE%8B6"><a id="%E4%BE%8B6"></a><strong>例6</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_lists_6.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_lists_6.xul">View</a></p>
-<pre>&lt;menulist editable="true"&gt;
- &lt;menupopup&gt;
- &lt;menuitem label="www.mozilla.org"/&gt;
- &lt;menuitem label="www.xulplanet.com"/&gt;
- &lt;menuitem label="www.dmoz.org"/&gt;
- &lt;/menupopup&gt;
-&lt;/menulist&gt;
-</pre>
-<p>这里创建的地址输入框由三个预设的选择,用户可以从中选择或者他们可以在文本框内输入一个他们自己的地址。用户输入的文本不会添加到新的选择中。因为<code><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></code>属性没有用在这个例子中,默认是空的。</p>
-<p>在下一节我们将会学习<a href="/cn/XUL_教程/Progress_Meters" title="cn/XUL_教程/Progress_Meters">creating progress meters</a>。</p>
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Numeric_Controls" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Progress_Meters">下一页 »</a></p>
-</div><p></p>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/localization/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/localization/index.html
deleted file mode 100644
index ffa7dd99de..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/localization/index.html
+++ /dev/null
@@ -1,296 +0,0 @@
----
-title: 本地化
-slug: Mozilla/Tech/XUL/Tutorial/Localization
-translation_of: Archive/Mozilla/XUL/Tutorial/Localization
----
-<p> </p>
-<div class="prevnext">
- <p><span style="float: left;">« <a href="../../../../en/XUL_Tutorial/Creating_a_Skin" rel="internal">Previous</a></span> <span style="float: right;"><a href="../../../../en/XUL_Tutorial/Property_Files" rel="internal">Next</a> »</span></p>
-</div>
-<p>  </p>
-<p> </p>
-<p>XUL 和 XML 提供的实体(entities)是一个本地化的好方法。</p>
-<div id="section_1">
- <h3 class="editable" id="实体"><span>实体</span></h3>
- <div class="editIcon">
- <a href="/../../../../en/XUL_Tutorial/Localization#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    不少软件都希望将界面上的语言尽可能简单的翻译为另外的语言。通常他们会为每一种语言创建一份字符串列表,来代替在代码中进行硬编码。代码中的每一段文本都代表字符串列表中的一项, <a href="../../../../en/XML" rel="internal">XML</a> 提供的实体正好实现这一目的。</p>
- <p>    如果你写过 <a href="../../../../en/HTML" rel="internal">HTML</a> 代码,你应该对实体很熟悉 , 像这样的代码 <code>&amp;lt;</code> 和 <code>&amp;gt;</code> 是作为“小于”和“大于”在文本中的替代出现的。XML 的语法允许你定义用户实体。你可以使用这些实体代替它实际的值,当然这个值可以是一段文本。实体可以用在任何文本应该出现的地方,包括属性。下面的例子在一个按钮中使用了实体。</p>
- <pre>&lt;button label="&amp;findLabel;"/&gt;
-</pre>
- <p>    出现在按钮上的文本将是 <code>&amp;findLabel;</code> 所代表的值。对每一种所要支持的语言需要创建一个文件包含对实体的定义。在英语中,<code>&amp;findLabel;</code> 实体可能代表文本 "Find"。</p>
-</div>
-<div id="section_2">
- <h3 class="editable" id="DTD_文件"><span>DTD 文件 </span></h3>
- <div class="editIcon">
- <a href="/../../../../en/XUL_Tutorial/Localization#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    实体在 <em>Document Type Definition</em> (DTD) 文件中定义。这类文件往往用于特定 XML 文件的语法和语义的定义,当然也可以用来定义实体。在  Mozilla 的 chrome 体系中,你会在<code> locales</code> 子目录中找到 DTD 文件。对应一个XUL 文件,一般会有一个 DTD 文件 (extension <code>.dtd</code>)。</p>
- <p>    如果你查看 chrome 目录,你会看到一个针对你所用语言的压缩包 (<code>en-US.jar</code> 默认是英语的语言包) 。你也可能会找到多种语言的语言包:美式英语 (en-US) 、法语 (fr)等。在这些压缩包中,你会发现它保存着每个窗口的本地化文本。这种压缩包的结构与 <a href="../../../../en/XUL_Tutorial/Creating_a_Skin" rel="internal">skins</a> 是很相似的。</p>
- <p>    你可以把你定义实体的 DTD 文件放置到语言包里,一般的,你应该为每一个 XUL 文件建立一个 DTD 文件,通常使用相同的文件名但以 <code>.dtd</code> 作为后缀。因此对应我们的 findfile 对话框,我们需要一个 <code>findfile.dtd</code> 文件。</p>
- <p>    对于非安装的 chrome 文件,你可以简单的把 DTD 文件放在与 XUL 相同的目录中。</p>
- <div class="note">
- <strong>注意:</strong> 你需要将含有非 ASCII 字符的 DTD 文件的字符编码设为 UTF-8。也就是说你应该按照 UTF-8 格式 (<a class="external" href="http://www.mozdev.org/notes/l10n/unicode/editors-en.html" rel="external nofollow" title="http://www.mozdev.org/notes/l10n/unicode/editors-en.html">without BOM</a>)保存。参见 <a class="external" href="http://www.mozilla.org/projects/l10n/mlp_chrome.html#text" rel="external nofollow" title="http://www.mozilla.org/projects/l10n/mlp_chrome.html#text">Mozilla Language Packs</a>.</div>
- <p>    一旦为你的 XUL 文件创立 DTD 文件,你应该在 XUL 文件上添加一行以声明使用 DTD 文件。否则会发生找不到实体的错误,在 XUL 文件的头部加如下一行。</p>
- <pre>&lt;!DOCTYPE window SYSTEM "chrome://findfile/locale/findfile.dtd"&gt;
-</pre>
- <p>    这一行表示这个 URL 被当作一个 DTD 使用。在这个例子中,我们引入了我们需要的 <code>findfile.dtd</code> 文件,这一行通常放在 <code><span class="lang lang-en"><a href="../../../../en/XUL/window" rel="internal">window</a> <span style="font-family: Verdana,Tahoma,sans-serif;">元素之前。</span></span></code></p>
- <p>    你同样需要在 <a href="../../../../en/Chrome_Registration#locale" rel="internal">chrome.manifest</a> 文件中添加本地化信息,如下:</p>
- <pre class="eval">locale findfile en-US locale/
-</pre>
-</div>
-<div id="section_3">
- <h3 class="editable" id="申明实体"><span>申明实体 </span></h3>
- <div class="editIcon">
- <a href="/../../../../en/XUL_Tutorial/Localization#" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    实体的申明使用如下语法:</p>
- <pre>&lt;!ENTITY findLabel "Find"&gt;
-</pre>
- <p>    上例创建了一个名为 <code>findLabel</code> 值为 "Find" 的实体,这意味着在文本中的任意位置出现的 "&amp;findLabel;" 都将会被 "Find" 替代。注意实体申明无需反斜杠结束。在不同语言的 DTD 文件中,文件使用的不同的语言替代即可。</p>
- <pre class="eval"><strong>日文:</strong>
-&lt;!ENTITY findLabel "検索"&gt;
-</pre>
- <p>    例如,下面的文字:</p>
- <pre>&lt;description value="&amp;findLabel;"/&gt;
-</pre>
- <p>被翻译为:</p>
- <pre class="eval"><strong>英文版:</strong>
-&lt;description value="Find"/&gt;
-
-<strong>日文版:</strong>
-&lt;description value="検索"/&gt;
-</pre>
- <p>    你应该为你在界面中出现的每一个标签或字符串申明一个实体,在XUL文件中不应出现任何的显示文本。</p>
- <p>    补充来说你可以在任何因语言不同而不同的的地方使用实体。以 <a href="../../../../en/XUL_Tutorial/Keyboard_Shortcuts" rel="internal">Access keys 及 keyboard shortcuts </a>为例。</p>
- <pre class="eval"> <strong>XUL</strong>
- &lt;menuitem label="&amp;undo.label;" accesskey="&amp;undo.key;"/&gt;
- <strong>DTD</strong>
- &lt;!ENTITY undo.label "Undo"&gt;
- &lt;!ENTITY undo.key "u"&gt;
-</pre>
- <p>    上面的例子使用了两个实体,一个由于 Undo 菜单项的标签,第二个用于快捷键。</p>
- <div class="highlight">
- <div id="section_4">
- <h3 class="editable" id="改写_Find_Files_的例子"><span>改写 Find Files 的例子</span></h3>
- <div class="editIcon">
- <a href="/../../../../en/XUL_Tutorial/Localization#" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    让我们看一看如何使用DTD文件修改我们的find files 对话框并将所有文本放在一起。整个文件列在下面。</p>
- <pre class="eval">&lt;?xml version="1.0"?&gt;
-
-&lt;?xml-stylesheet href="<a class="external" rel="freelink">chrome://global/skin/global.css</a>" type="text/css"?&gt;
-&lt;?xml-stylesheet href="findfile.css" type="text/css"?&gt;
-
-<span class="highlightred">&lt;!DOCTYPE window SYSTEM "<a class="external" rel="freelink">chrome://findfile/locale/findfile.dtd</a>"&gt;</span>
-
-&lt;window
- id="findfile-window"
- title="<span class="highlightred">&amp;findWindow.title;</span>"
- persist="screenX screenY width height"
- orient="horizontal"
- onload="initSearchList()"
- xmlns="<a class="external" href="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" rel="freelink">http://www.mozilla.org/keymaster/gat...re.is.only.xul</a>"&gt;
-
-&lt;script src="findfile.js"/&gt;
-
-&lt;popupset&gt;
- &lt;menupopup id="editpopup"&gt;
- &lt;menuitem label="<span class="highlightred">&amp;cutCmd.label;</span>" accesskey="<span class="highlightred">&amp;cutCmd.accesskey;</span>"/&gt;
- &lt;menuitem label="<span class="highlightred">&amp;copyCmd.label;</span>" accesskey="<span class="highlightred">&amp;copyCmd.accesskey;</span>"/&gt;
- &lt;menuitem label="<span class="highlightred">&amp;pasteCmd.label;</span>" accesskey="<span class="highlightred">&amp;pasteCmd.accesskey;</span>" disabled="true"/&gt;
- &lt;/menupopup&gt;
-&lt;/popupset&gt;
-
-&lt;keyset&gt;
- &lt;key id="cut_cmd" modifiers="accel" key="<span class="highlightred">&amp;cutCmd.commandkey;</span>"/&gt;
- &lt;key id="copy_cmd" modifiers="accel" key="<span class="highlightred">&amp;copyCmd.commandkey;</span>"/&gt;
- &lt;key id="paste_cmd" modifiers="accel" key="<span class="highlightred">&amp;pasteCmd.commandkey;</span>"/&gt;
- &lt;key id="close_cmd" keycode="VK_ESCAPE" oncommand="window.close();"/&gt;
-&lt;/keyset&gt;
-
-&lt;vbox flex="1"&gt;
-
- &lt;toolbox&gt;
-
- &lt;menubar id="findfiles-menubar"&gt;
- &lt;menu id="file-menu" label="<span class="highlightred">&amp;fileMenu.label;</span>"
- accesskey="<span class="highlightred">&amp;fileMenu.accesskey;</span>"&gt;
- &lt;menupopup id="file-popup"&gt;
- &lt;menuitem label="<span class="highlightred">&amp;openCmd.label;</span>"
- accesskey="<span class="highlightred">&amp;openCmd.accesskey;</span>"/&gt;
- &lt;menuitem label="<span class="highlightred">&amp;saveCmd.label;</span>"
- accesskey="<span class="highlightred">&amp;saveCmd.accesskey;</span>"/&gt;
- &lt;menuseparator/&gt;
- &lt;menuitem label="<span class="highlightred">&amp;closeCmd.label;</span>"
- accesskey="<span class="highlightred">&amp;closeCmd.accesskey;" key="close_cmd" oncommand="window.close();</span>"/&gt;
- &lt;/menupopup&gt;
- &lt;/menu&gt;
- &lt;menu id="edit-menu" label="<span class="highlightred">&amp;editMenu.label;</span>"
- accesskey="<span class="highlightred">&amp;editMenu.accesskey;</span>"&gt;
- &lt;menupopup id="edit-popup"&gt;
- &lt;menuitem label="<span class="highlightred">&amp;cutCmd.label;</span>"
- accesskey="<span class="highlightred">&amp;cutCmd.accesskey;</span>" key="cut_cmd"/&gt;
- &lt;menuitem label="<span class="highlightred">&amp;copyCmd.label;</span>"
- accesskey="<span class="highlightred">&amp;copyCmd.accesskey;</span>" key="copy_cmd"/&gt;
- &lt;menuitem label="<span class="highlightred">&amp;pasteCmd.label;</span>"
- accesskey="<span class="highlightred">&amp;pasteCmd.accesskey;</span>" key="paste_cmd" disabled="true"/&gt;
- &lt;/menupopup&gt;
- &lt;/menu&gt;
- &lt;/menubar&gt;
-
- &lt;toolbar id="findfiles-toolbar"&gt;
- &lt;toolbarbutton id="opensearch" label="<span class="highlightred">&amp;openCmdToolbar.label;</span>"/&gt;
- &lt;toolbarbutton id="savesearch" label="<span class="highlightred">&amp;saveCmdToolbar.label;</span>"/&gt;
- &lt;/toolbar&gt;
- &lt;/toolbox&gt;
-
- &lt;tabbox&gt;
- &lt;tabs&gt;
- &lt;tab label="<span class="highlightred">&amp;searchTab;</span>" selected="true"/&gt;
- &lt;tab label="<span class="highlightred">&amp;optionsTab;</span>"/&gt;
- &lt;/tabs&gt;
-
- &lt;tabpanels&gt;
-
- &lt;tabpanel id="searchpanel" orient="vertical" context="editpopup"&gt;
-
- &lt;description&gt;
- <span class="highlightred">&amp;findDescription;</span>
- &lt;/description&gt;
-
- &lt;spacer class="titlespace"/&gt;
-
- &lt;groupbox orient="horizontal"&gt;
- &lt;caption label="<span class="highlightred">&amp;findCriteria;</span>"/&gt;
-
- &lt;menulist id="searchtype"&gt;
- &lt;menupopup&gt;
- &lt;menuitem label="<span class="highlightred">&amp;type.name;</span>"/&gt;
- &lt;menuitem label="<span class="highlightred">&amp;type.size;</span>"/&gt;
- &lt;menuitem label="<span class="highlightred">&amp;type.date;</span>"/&gt;
- &lt;/menupopup&gt;
- &lt;/menulist&gt;
- &lt;spacer class="springspace"/&gt;
- &lt;menulist id="searchmode"&gt;
- &lt;menupopup&gt;
- &lt;menuitem label="<span class="highlightred">&amp;mode.is;</span>"/&gt;
- &lt;menuitem label="<span class="highlightred">&amp;mode.isnot;</span>"/&gt;
- &lt;/menupopup&gt;
- &lt;/menulist&gt;
- &lt;spacer class="springspace"/&gt;
-
- &lt;menulist id="find-text" flex="1"
- editable="true"
- datasources="<a class="external" rel="freelink">file:///mozilla/recents.rdf</a>"
- ref="<a class="external" href="http://www.xulplanet.com/rdf/recent/all" rel="freelink">http://www.xulplanet.com/rdf/recent/all</a>"&gt;
- &lt;template&gt;
- &lt;menupopup&gt;
- &lt;menuitem label="rdf:<a class="external" href="http://www.xulplanet.com/rdf/recent#Label" rel="freelink">http://www.xulplanet.com/rdf/recent#Label</a>" uri="rdf:*"/&gt;
- &lt;/menupopup&gt;
- &lt;/template&gt;
- &lt;/menulist&gt;
-
- &lt;/groupbox&gt;
-
- &lt;/tabpanel&gt;
-
- &lt;tabpanel id="optionspanel" orient="vertical"&gt;
- &lt;checkbox id="casecheck" label="<span class="highlightred">&amp;casesensitive;</span>"/&gt;
- &lt;checkbox id="wordscheck" label="<span class="highlightred">&amp;matchfilename;</span>"/&gt;
- &lt;/tabpanel&gt;
-
- &lt;/tabpanels&gt;
- &lt;/tabbox&gt;
-
- &lt;tree id="results" style="display: none;" flex="1"&gt;
- &lt;treecols&gt;
- &lt;treecol id="name" label="<span class="highlightred">&amp;results.filename;</span>" flex="1"/&gt;
- &lt;treecol id="location" label="<span class="highlightred">&amp;results.location;</span>" flex="2"/&gt;
- &lt;treecol id="size" label="<span class="highlightred">&amp;results.size;</span>" flex="1"/&gt;
- &lt;/treecols&gt;
-
- &lt;treechildren&gt;
- &lt;treeitem&gt;
- &lt;treerow&gt;
- &lt;treecell label="mozilla"/&gt;
- &lt;treecell label="/usr/local"/&gt;
- &lt;treecell label="<span class="highlightred">&amp;bytes.before;</span>2520<span class="highlightred">&amp;bytes.after;</span>"/&gt;
- &lt;/treerow&gt;
- &lt;/treeitem&gt;
- &lt;/treechildren&gt;
- &lt;/tree&gt;
-
- &lt;splitter id="splitbar" resizeafter="grow" style="display: none;"/&gt;
-
- &lt;spacer class="titlespace"/&gt;
-
- &lt;hbox&gt;
- &lt;progressmeter id="progmeter" value="50%" style="display: none;"/&gt;
- &lt;spacer flex="1"/&gt;
- &lt;button id="find-button" label="<span class="highlightred">&amp;button.find;</span>"
- oncommand="doFind()"/&gt;
- &lt;button id="cancel-button" label="<span class="highlightred">&amp;button.cancel;</span>"
- oncommand="window.close();"/&gt;
- &lt;/hbox&gt;
-&lt;/vbox&gt;
-
-&lt;/window&gt;
-</pre>
- <p>    每一个字符串均被实体引用代替。一个 DTD 文件被包含在XUL文件的开头。每一个被引用的实体必须在DTD文件中申明,如果发现引用的实体没有申明,则窗口不会显示。</p>
- <p>    注意实体的名字并不重要,在上面的例子里实体的名字被分成几段来写,请你不要这样,请按照其他代码的书写习惯来写实体引用。</p>
- <p>    你可能已经注意到里字符串 '2520 bytes' 被两个实体代替。这是因为在别的语言中可能会有不同的语法要求。比如,可能要求数字写在后面而把 'bytes' 写在前面。当然对于 KB 、MB 会有更复杂的顺序要求。</p>
- <p>    <font>键盘访问键</font>及快捷键也被翻译为实体因为对不同的语言这些也会不同。</p>
- <p>    下面是 DTD 文件 - findfile.dtd:</p>
- <pre>&lt;!ENTITY findWindow.title "Find Files"&gt;
-&lt;!ENTITY fileMenu.label "File"&gt;
-&lt;!ENTITY editMenu.label "Edit"&gt;
-&lt;!ENTITY fileMenu.accesskey "f"&gt;
-&lt;!ENTITY editMenu.accesskey "e"&gt;
-&lt;!ENTITY openCmd.label "Open Search..."&gt;
-&lt;!ENTITY saveCmd.label "Save Search..."&gt;
-&lt;!ENTITY closeCmd.label "Close"&gt;
-&lt;!ENTITY openCmd.accesskey "o"&gt;
-&lt;!ENTITY saveCmd.accesskey "s"&gt;
-&lt;!ENTITY closeCmd.accesskey "c"&gt;
-&lt;!ENTITY cutCmd.label "Cut"&gt;
-&lt;!ENTITY copyCmd.label "Copy"&gt;
-&lt;!ENTITY pasteCmd.label "Paste"&gt;
-&lt;!ENTITY cutCmd.accesskey "t"&gt;
-&lt;!ENTITY copyCmd.accesskey "c"&gt;
-&lt;!ENTITY pasteCmd.accesskey "p"&gt;
-&lt;!ENTITY cutCmd.commandkey "X"&gt;
-&lt;!ENTITY copyCmd.commandkey "C"&gt;
-&lt;!ENTITY pasteCmd.commandkey "V"&gt;
-&lt;!ENTITY openCmdToolbar.label "Open"&gt;
-&lt;!ENTITY saveCmdToolbar.label "Save"&gt;
-&lt;!ENTITY searchTab "Search"&gt;
-&lt;!ENTITY optionsTab "Options"&gt;
-&lt;!ENTITY findDescription "Enter your search criteria below and select the Find button to begin the search."&gt;
-&lt;!ENTITY findCriteria "Search Criteria"&gt;
-&lt;!ENTITY type.name "Name"&gt;
-&lt;!ENTITY type.size "Size"&gt;
-&lt;!ENTITY type.date "Date Modified"&gt;
-&lt;!ENTITY mode.is "Is"&gt;
-&lt;!ENTITY mode.isnot "Is Not"&gt;
-&lt;!ENTITY casesensitive "Case Sensitive Search"&gt;
-&lt;!ENTITY matchfilename "Match Entire Filename"&gt;
-&lt;!ENTITY results.filename "Filename"&gt;
-&lt;!ENTITY results.location "Location"&gt;
-&lt;!ENTITY results.size "Size"&gt;
-&lt;!ENTITY bytes.before ""&gt;
-&lt;!ENTITY bytes.after "bytes"&gt;
-&lt;!ENTITY button.find "Find"&gt;
-&lt;!ENTITY button.cancel "Cancel"&gt;
-</pre>
- <p>    现在,为一个新语言添加文本仅需创建一个新的DTD文件。使用 chrome 系统把 DTD 文件加到另一个 <code> locales</code> 中,这样同一个 XUL 文件就可以使用不同的语言。</p>
- <p>Find files example so far: <span class="lang lang-en"><a class="external" href="http://developer.mozilla.org/samples/xultu/examples//findfile/findfile-locale.xul.txt" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples//findfile/findfile-locale.xul.txt">Source</a> </span></p>
- </div>
- </div>
- <p> </p>
- <p>    下一章,看看 <a href="../../../../en/XUL_Tutorial/Property_Files" rel="internal">property files</a>.</p>
- <p> </p>
- <div class="prevnext">
- <p><span style="float: left;">« <a href="../../../../en/XUL_Tutorial/Creating_a_Skin" rel="internal">Previous</a></span> <span style="float: right;"><a href="../../../../en/XUL_Tutorial/Property_Files" rel="internal">Next</a> »</span></p>
- </div>
- <p>  </p>
- <p> </p>
-</div>
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/manifest_files/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/manifest_files/index.html
deleted file mode 100644
index 10dcc5a2dd..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/manifest_files/index.html
+++ /dev/null
@@ -1,113 +0,0 @@
----
-title: Manifest Files
-slug: Mozilla/Tech/XUL/Tutorial/Manifest_Files
-translation_of: Archive/Mozilla/XUL/Tutorial/Manifest_Files
----
-<h3 id="Contents.rdf_.E6.96.87.E4.BB.B6" name="Contents.rdf_.E6.96.87.E4.BB.B6">Contents.rdf 文件</h3>
-<p>这部分内容,我们将了解如何将chrome和XUL文件打成包,以及为它们创建manifest文件。</p>
-<p>&lt;big&gt;<b>包</b>&lt;/big&gt;</p>
-<p>一个包,就是一组XUL文件和定义了用户界面功能的脚本的集合,它可以直接存成一个目录,也可以打成JAR文件。包可以被安装到Mozilla里,并且可以被chrome URL 引用。一个包里面包含了多种类型的文件,这些文件也可以划分到包内的不同的子目录里。</p>
-<p>&lt;big&gt;<b>Manifest 文件</b>&lt;/big&gt;</p>
-<p>manifest文件描述了包在硬盘上的物理存放位置与chrome URL的映射关系。当一个Mozilla应用启动时,它将检查chrome文件夹中的manifest文件,从而知道已经安装了哪些包。也就是说,当安装了一个新包时,你需要在应用程序的chrome目录下或者用户自己的chrome目录中加入一个新的manifest文件。一般情况下,当应用程序没有足够的权限向其目录中写入manifest文件时,才会将manifest文件放到用户自己的chrome目录中。</p>
-<p>如果你想在Firefox浏览器中测试一下XUL代码的效果,只要在manifest文件中加入一行,就可以轻松实现了:</p>
-<ol>
- <li>创建一个目录. 例如, 在系统盘下创建一个目录, 就可以用 C:\testfiles</li>
- <li>在chrome目录下创建一个新的名为 test.manifest 的文件(实际上,文件叫什么名字并不重要,只要扩展名是.manifest就可以了),则用下面一句:</li>
-</ol>
-<p><code>content tests <a class="external" rel="freelink">file:///C:/testfiles/</a></code></p>
-<blockquote>
- 这里的文件路径是指向上面创建的目录的。如果你不知道应该怎么写这个文件路径,可以在浏览器中打开那个目录,然后将地址栏里面的URL拷贝下来,就可以了。</blockquote>
-<p>好了,现在,你只需要向上面新建的那个目录中加入一些XUL文件,然后,按照chrome://tests/content/&lt;filename&gt; 的格式键入chrome URL,就可以看到你的成果了。当然,为了你的修改能够起作用,需要重启浏览器。如果你创建的文件没有被加载,确认一下你键入的文件路径是否是正确的。</p>
-<p>manifest 文件中每一行的基本语法是:</p>
-<p><code>content &lt;packagename&gt; &lt;filepath&gt;</code></p>
-<p>第一个字段指明了包类型。主题包是'skin',语言地区包是'locale'。上面例子中,包名为'tests',也就意味着chrome URL中第一个部分是'tests',例如:<a class="external" rel="freelink">chrome://tests/content/sample.xul</a>。如果包名为'browser',那么chrome <a class="external" href="URL就变成chrome://browser/content/" rel="freelink">URL就变成chrome://browser/content/</a>。基本语法中最后一个字段为文件所在的路径。这既可以是用file URL(译者注:如file:///c:/dir/a)表示的本地文件路径,又可以是下面我们马上要说到的jar URL表示的JAR包。在manifest文件中添加多行,可以指定多个包。</p>
-<p>Firefox用到的browser.manifest文件看起来是这样的:</p>
-<pre><code>content branding jar:browser.jar!/content/branding/ xpcnativewrappers=yes
-content browser jar:browser.jar!/content/browser/ xpcnativewrappers=yes
-overlay chrome://global/content/viewSource.xul chrome://browser/content/viewSourceOverlay.xul
-overlay chrome://global/content/viewPartialSource.xul chrome://browser/content/viewSourceOverlay.xul
-overlay chrome://browser/content/pageInfo.xul chrome://pippki/content/PageInfoOverlay.xul
-</code></pre>
-<p>这里有两个包,'branding'和'browser'。此外还有三个overlay,它们使得来自不同包的内容可以组合在一起。扩展(Extension)中会大量使用overlay,因为overlay的功能是将包的用户界面与浏览器的用户界面融合在一起。</p>
-<p>由于内容被打包成jar,branding和browser包中文件的路径使用了jar URL。一个jar包可以通过ZIP工具来生成。在chrome目录中的JAR文件,语法相当简单:</p>
-<p><code>jar:&lt;filename.jar&gt;!/&lt;path_in_archive&gt;</code></p>
-<p>browser包对应的JAR包是browser.jar,与manifest文件放在同一个chrome目录中。'content/browser'指明了在JAR压缩包中XUL的路径。若压缩包里面不含任何目录,则无需指明任何路径。在我们的例子中,压缩包里面有目录,所以这里需要指明。</p>
-<p>对于上面我们建立的'tests'包,文件没有压缩到一个jar包里,所以我们用直接的文件路径来代替jar路径。这样做有利于开发——我们就不用每次在改动文件后重新打包。不过,在发布一个扩展或者应用是,为了避免安装一堆的小文件,通产都会采用打包的方式。</p>
-<p>在manifest文件的最后,<b>xpcnativewrappers=yes</b>是一个可选的标志。JavaScript可以将网页中内置的函数替换成自己的代码。如果有xpcnativewrappers标志,这就表明在特权环境(privileged context)下的脚本不运行覆盖的版本而是运行原始自带的版本。否则,如果一个扩展试图调用一个修改版的脚本,就有可能无法正常工作甚至更糟——产生安全漏洞。添加这个标志就是为了避免类似的问题,在新的扩展中应当坚持使用,而对于那些无法兼容改变的老扩展可以不用这个标志。</p>
-<h3 id=".E4.B8.BB.E9.A2.98.EF.BC.88Themes.EF.BC.89.E5.92.8C.E6.9C.AC.E5.9C.B0.E5.8C.96.EF.BC.88Locales.EF.BC.89" name=".E4.B8.BB.E9.A2.98.EF.BC.88Themes.EF.BC.89.E5.92.8C.E6.9C.AC.E5.9C.B0.E5.8C.96.EF.BC.88Locales.EF.BC.89">主题(Themes)和本地化(Locales)</h3>
-<p>主题(Themes)和本地化(Locales)的打包语法,与内容(content)打包的语法上是相似的。如果你要提供一个主题(Themes)和本地化(Locales)时,你需要了解更多细节。例如:</p>
-<p><code>skin browser classic/1.0 jar:classic.jar!/skin/classic/browser/</code><br>
- <code>locale browser en-US jar:en-US.jar!/locale/browser/</code></p>
-<p>如上面例子, 浏览器用来表示皮肤和本地化的特殊的项被加入。皮肤的名称是 'classic/1.0'。这里, 版本号被作为主体的一部分来使用, 但如果你制作自己的主题它是可选的。 Mozilla浏览器并不是用特殊方式来处理版本号;版本号仅仅作为主体名称的一部分。本地化语言是 'en-US'。映射的chrome <a class="external" href="URL应该是chrome://browser/skin和chrome://browser/locale" rel="freelink">URL应该是chrome://browser/skin和chrome://browser/locale</a>。如果你正在创作你自己的主题或者本地化浏览器,你说要做的全部是建立一个包含着两行内容的manifest文件,再修改内容来适应你的主题(Themes)和本地化(Locales)。</p>
-<p>如果必要,也能够合并全部的三种类型内容放到一个单独文件里面。这种情况通常发生在当创建一个扩展(extension/Add on)时,你也许会把所有部分放到一个文件里面。例如,我们想做一个查找文件对话框时可以这样做。在chrome目录建立一个名称为findfiles.manifest的文件。把下面的内容加到文件里面:</p>
-<pre><code>content findfiles file:///findfiles/content/
-skin findfiles classic/1.0 file:///findfiles/skin/
-locale findfiles en-US file:///findfiles/locale/
-</code></pre>
-<p>通常, 你希望目录路径内够适应你的系统(不同的文件系统,目录的结构不同)。 这种情况下, 我们仅仅建立测试路径。如果我们在发布这个包,我们应该把全部内容打包成一个JAR文件,并且修改路径。这里只是一个例子,今后可以参照这个例子来做。注意,例子里的skinhe和 locale行的第二项被指定为'findfiles'。这意味着,skin和locale可以访问和修改在第一行定义的findfiles包。</p>
-<p>上述的三个路径每部分有自己的子路径,意味着你可以给每一部分建立和指定的特殊子路径。</p>
-<h3 id=".E5.AE.89.E8.A3.85.E5.8C.85" name=".E5.AE.89.E8.A3.85.E5.8C.85">安装包</h3>
-<p>为了安装一个应用,你将需要建立一个安装器,或者把它作为另一个应用的一部分。方式依赖于你所创建的是那种应用,一般来说不同的应用类型安装包是不同的。例如<a href="cn/%e6%89%a9%e5%b1%95">扩展</a>,你需要建立一个名为install.rdf的安装描述文件,它描述了哪些东西被安装,以及扩展的作者和兼容性(那一个版本的浏览器,与那些程序兼容等等)。 还需要一个<a href="cn/Bundles">专用的目录结构</a>,安装文件也许被安装到里面,并被限制在这个目录。一个扩展通常打包成一个 <a href="cn/XPI">XPI</a> 文件。 <a href="cn/XPI">XPI</a> 是XPInstall的缩写,被以Mozilla为基础的浏览器用来安装组件。类似于JAR文件,一个 XPI文件仅仅是一个带有不同的扩展的ZIP文件,所以你可以用ZIP格式兼容的工具来创建和察看 <a href="cn/XPI">XPI</a> 文件。</p>
-<p>Firefox的扩展管理器能够自动的安装 <a href="cn/XPI">XPI</a> 文件内部的扩展包。他建议上传你的扩展到[<a class="external" href="https://addons.mozilla.org/|Mozilla">Add-ons site</a>],用户通常在这个地址寻找扩展包来安装特殊的应用。当然他们也可以从任何网址安装,不过不是Firefox默认的网址。</p>
-<p>也可以用JavaScript写一个安装脚本来安装文件。这样你可以把文件复制到任何位置并执行文件管理任务。但是,用脚本安装的应用不能够被扩展管理器列出,意味着不能像其他应用那样自动地卸载。所以通常不使用脚本安装文件。</p>
-<p>标准的应用,可以使用<a href="cn/XULRunner">XULRunner</a>来打包。由于与执行文件分离,可以被发布成与浏览器版本无依赖的应用。</p>
-<p>创建<a href="cn/%e6%89%a9%e5%b1%95">扩展</a>的更多信息请参照<a href="cn/%e6%9e%84%e5%bb%ba%e4%b8%80%e4%b8%aa%e6%89%a9%e5%b1%95">构建一个扩展</a>。 <a href="cn/XULRunner">XULRunner</a>的更多信息请参照http://developer.mozilla.org/en/docs/XULRunner</p>
-<h3 id=".E6.97.A7.E7.89.88.E6.9C.AC.E5.BA.94.E7.94.A8.E7.A8.8B.E5.BA.8F" name=".E6.97.A7.E7.89.88.E6.9C.AC.E5.BA.94.E7.94.A8.E7.A8.8B.E5.BA.8F">旧版本应用程序</h3>
-<p>如果你为旧版本的Mozilla软件创建应用程序,比如Firefox 1.5或者Mozilla 1.8,那么这一章就很重要的。以下便是讲解怎样为先前版本建立包。如果你正在写新的扩展或者XUL应用程序的话,完全可以跳过此章。</p>
-<p>1. 在你的磁盘上创建一个目录。许多人喜欢在Mozilla的chrome目录下面创建一个子目录,这样是没有必要的。这个目录可以在任何地方建立,随你喜欢。然后将你的XUL文件放置其中。</p>
-<p>2. 创建一个名为contents.rdf,并放置在前面你所建立的目录中。将下面的文本框中的内容复制粘贴进新的contents.rdf文件中。这个文件是用来区别应用程序的id,它的名字,作者,版本等等的。</p>
-<table class="standard-table">
- <tbody>
- <tr>
- <td>
- <pre class="eval">
- &lt;?xml version="1.0"?&gt;
-</pre>
- <pre class="eval">
- &lt;RDF:RDF xmlns:RDF="<a class="external" href="http://www.w3.org/1999/02/22-rdf-syntax-ns#" rel="freelink">http://www.w3.org/1999/02/22-rdf-syntax-ns#</a>"
- xmlns:chrome="<a class="external" href="http://www.mozilla.org/rdf/chrome#" rel="freelink">http://www.mozilla.org/rdf/chrome#</a>"&gt;
-</pre>
- <pre class="eval">
- &lt;RDF:Seq about="urn:mozilla:package:root"&gt;
- &lt;RDF:li resource="urn:mozilla:package:myapplication"/&gt;
- &lt;/RDF:Seq&gt;
-</pre>
- <pre class="eval">
- &lt;RDF:Description about="urn:mozilla:package:myapplication"
- chrome:displayName="Application Title"
- chrome:author="Author Name"
- chrome:name="myapplication"
- chrome:extension="true"/&gt;
-</pre>
- <pre class="eval">
- &lt;/RDF:RDF&gt;
-</pre>
- </td>
- </tr>
- </tbody>
-</table>
-<p>3. 将文本中的高亮显示部分改换成你自己的信息。比如红色部分“myapplication”应该是你应用程序的ID。你把它填写上,这个ID和你的应用程序名是相似的。用你的应用程序的题目和作者来替换文本中的蓝色高亮部分。</p>
-<p>4. 如果'chrome:extension'字段为真,那么这个应用程序是Mozilla Firefox Extension(即Mozilla Firefox的扩展),而且还会在浏览器相应的附加软件窗口中见到。否则,它将不会显示。</p>
-<p>5. 保存contents.rdf文件,同时确认它在你在步骤一中创建的那个文件内。</p>
-<p>6. 打开&lt;mozilla-directory&gt;/chrome/installed-chrome.txt 这个文件,&lt;mozilla-directory&gt;就是Mozilla程序所安装的那个目录。记住在此之前先退出Mozilla程序。</p>
-<p>7. 接下来,你必须在注册新的应用程序,这样Mozilla程序就可以找到它。在installed-chrome.txt中的最后添加新的一行,来指向你在步骤一中创建的那个目录。</p>
-<p> </p>
-<pre class="eval"> content,install,url,<a class="external" rel="freelink">file:///main/app/</a>
-</pre>
-<blockquote>
- 用你的目录的URL来替换掉上面高亮的文字。并且必须在最后的保留一个斜杠再加一个回车。如果你不能确定那个URL是什么,那么就用Mozilla浏览器来打开该目录,并复制地址栏中所显示的URL。注意这一项必须是个目录的显示,而不是具体到文件的显示。</blockquote>
-<p>8. 删除 &lt;mozilla-directory&gt;/chrome/chrome.rdf 文件.</p>
-<p>9. 打开 Mozilla 程序.你将可以看到任何你放到那个目录下的XUL文件,以下面的URL:<b><a class="external" rel="freelink">chrome://</a><font color="red">applicationid</font>/content/file.xul</b>其中file.xul是文件名。主XUL文件应该是:<b>applicationid.xul</b>,你可以用以下的方式打开它<b><a class="external" rel="freelink">chrome://</a><font color="red">applicationid</font>/content/</b>。</p>
-<p>如果你要创建skin和locale这两项的话,重复以上步骤,除了contents.rdf的形式略有不同。可以参考contents.rdf为其它应用程序所设置的细节。</p>
-<p>创建一个chrome包是一件艰难的事情,诊断问题也很困难。以下是一些小小的提示,如果你遇到困难时也许用得着。</p>
-<ul>
- <li>打开&lt;mozilla-directory&gt;/chrome/chrome.rdf。你应该能够找到,你的应用程序ID。否则说明注册存在问题。如果有的话,也许你在调用文件时用了错误的chrome URL。</li>
- <li>当你试着删除&lt;mozilla-directory&gt;/chrome/chrome.rdf时,它会自动重新建立。甚至是删除整个&lt;mozilla-directory&gt;/chrome/overlayinfo/目录也一样,因为你用了overlays(叠加)。</li>
- <li>确定在installed-chrome.txt中的URL最后又一个斜杠,还有这个文件的最后有一个空行。</li>
- <li>在Windows操作系统中,文件的URLs是这样的形式:///C|/files/app/,其中C 是盘符。</li>
- <li>确认contents.rdf在正确的目录下,并有着正确的格式。在Mozilla程序中打开contents.rdf来看是不是一个完好的XML。否则,你就会看到有带着黄色的背景的错误显示。</li>
- <li>如果你应用Mozilla调试构建,有些信息会显示到终端,在最开始会提示哪些chrome应用程序checked(被查出问题?)。请自己清查一些那上面所列出的应用程序。</li>
-</ul>
-<hr>
-<div>
- <a href="cn/XUL_%e6%95%99%e7%a8%8b/%e5%85%b3%e4%ba%8eChrome_URL">&lt;&lt; 前页</a> <a href="cn/XUL_%e6%95%99%e7%a8%8b/%e5%88%9b%e5%bb%ba%e4%b8%80%e4%b8%aa%e7%aa%97%e5%8f%a3">后页 &gt;&gt;</a></div>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/modifying_a_xul_interface/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/modifying_a_xul_interface/index.html
deleted file mode 100644
index 3ee3d691e0..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/modifying_a_xul_interface/index.html
+++ /dev/null
@@ -1,118 +0,0 @@
----
-title: XUL_教程/修改XUL界面
-slug: Mozilla/Tech/XUL/Tutorial/Modifying_a_XUL_Interface
-tags:
- - DOM
- - XUL_教程
-translation_of: Archive/Mozilla/XUL/Tutorial/Modifying_a_XUL_Interface
----
-<p> </p>
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_教程:文档对象模型" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Manipulating_Lists">下一页 »</a></p>
-</div><p></p>
-<p>    </p>
-<p>DOM 提供了一系列方法来修改文档。</p>
-<h3 id=".E5.88.9B.E5.BB.BA.E6.96.B0.E5.85.83.E7.B4.A0__Creating_New_Elements" name=".E5.88.9B.E5.BB.BA.E6.96.B0.E5.85.83.E7.B4.A0__Creating_New_Elements">创建新元素 </h3>
-<p>    你可以使用文档对象的 <code><a href="/cn/DOM/document.createElement" title="cn/DOM/document.createElement">createElement()</a></code> 方法创建新元素。它有一个参数,待创建元素的标签名。可以使用元素的 <code><a href="/cn/DOM/element.setAttribute" title="cn/DOM/element.setAttribute">setAttribute()</a></code> 方法设置属性,使用 <code><a href="/cn/DOM/element.appendChild" title="cn/DOM/element.appendChild">appendChild()</a></code> 方法将其加入到XUL文件之中。例如下面的例子将一个按钮加入的XUL窗口中。</p>
-<p><span id="Example_1"><a id="Example_1"></a><strong>Example 1</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_dommodify_1.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_dommodify_1.xul">View</a></p>
-<pre>&lt;script&gt;
-function addButton(){
- var aBox = document.getElementById("aBox");
- var button = document.createElement("button");
- button.setAttribute("label","A new Button");
- aBox.appendChild(button);
-}
-&lt;/script&gt;
-
-&lt;box id="aBox" width="200"&gt;
- &lt;button label="Add" oncommand="addButton();"/&gt;
-&lt;/box&gt;
-</pre>
-<ul>
- <li>脚本先用<code><a href="/cn/DOM/document.getElementById" title="cn/DOM/document.getElementById">getElementById()</a></code>获得 一个容纳按钮的box的引用。</li>
- <li>用<code><a href="/cn/DOM/document.createElement" title="cn/DOM/document.createElement">createElement()</a></code>方法创建新按钮。</li>
- <li>用 <code><a href="/cn/DOM/element.setAttribute" title="cn/DOM/element.setAttribute">setAttribute()</a></code> 方法设置按钮的标签属性。</li>
- <li>用<code><a href="/cn/DOM/element.appendChild" title="cn/DOM/element.appendChild">box.appendChild()</a></code> 方法将按钮加入其中。</li>
-</ul>
-<p>    <code><a href="/cn/DOM/document.createElement" title="cn/DOM/document.createElement">createElement()</a></code> 方法将为文档创建一个默认类型的元素。对于XUL 文档,通常会创建一个XUL元素。对于 HTML 文档会创建一个HTML元素,它会包含HTML元素的功能及方法。 <code><a href="/cn/DOM/document.createElementNS" title="cn/DOM/document.createElementNS">createElementNS()</a></code> 方法用于在不同的名空间创建元素。</p>
-<p>     <code><a href="/cn/DOM/element.appendChild" title="cn/DOM/element.appendChild">appendChild()</a></code> 方法用于像一个元素添加另一个元素。有三个相关的方法: <code><a href="/cn/DOM/element.insertBefore" title="cn/DOM/element.insertBefore">insertBefore()</a></code>,<code><a href="/cn/DOM/element.replaceChild" title="cn/DOM/element.replaceChild">replaceChild()</a></code> , <code><a href="/cn/DOM/element.removeChild" title="cn/DOM/element.removeChild">removeChild</a></code> 语法如下。</p>
-<pre>parent.appendChild(child);
-parent.insertBefore(child, referenceChild);
-parent.replaceChild(newChild, oldChild);
-parent.removeChild(child);
-</pre>
-<p>    下面是这桑函数的简单说明。</p>
-<ul>
- <li>  <code><a href="/cn/DOM/element.insertBefore" title="cn/DOM/element.insertBefore">insertBefore()</a></code> 方法在存在的元素之前插入一个新的子节点。它可以在一些子元素之间插入元素,而不像 <code><a href="/cn/DOM/element.appendChild" title="cn/DOM/element.appendChild">appendChild()</a></code> 只在最后插入。</li>
- <li><code><a href="/cn/DOM/element.replaceChild" title="cn/DOM/element.replaceChild">replaceChild()</a></code> 方法移除一个旧的元素并在相同的位置插入新元素。</li>
- <li><code><a href="/cn/DOM/element.removeChild" title="cn/DOM/element.removeChild">removeChild()</a></code> 删除一个节点。</li>
-</ul>
-<p>    注意,以上所有的方法中的 referenceChild 及 child 必须是一个已经存在的节点否则会出错。</p>
-<p>    通常你会希望移除一个现有的节点,并把它放到其他的位置。那么你没有必要先删除它。因为一个节点在同一时间只能在一个位置,插入方法总是先将节点从当前位置删除再插入新位置。这是一个在文档中移动节点的好方法。</p>
-<h4 id=".E6.8B.B7.E8.B4.9D.E8.8A.82.E7.82.B9__Copying_Nodes" name=".E6.8B.B7.E8.B4.9D.E8.8A.82.E7.82.B9__Copying_Nodes">拷贝节点</h4>
-<p>    可以使用 <code><a href="/cn/DOM/element.cloneNode" title="cn/DOM/element.cloneNode">cloneNode()</a></code> 方法复制节点。这方法复制现有的节点,你可以将新的节点放置到任何位置(原始节点不动),此方法带一个 boolean 型参数确定是否复制此元素的全部子节点。如果‘否’只复制此节点,不包含任何子节点。如果‘是’,将复制全部子节点。此函数会递归调用,如需复制树结构请传递true给函数,如下例。</p>
-<p><span id="Example_2"><a id="Example_2"></a><strong>Example 2</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_dommodify_2.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_dommodify_2.xul">View</a></p>
-<pre>&lt;hbox height="400"&gt;
- &lt;button label="Copy"
- oncommand="this.parentNode.appendChild(this.nextSibling.cloneNode(true));"/&gt;
-
- &lt;vbox&gt;
- &lt;button label="First"/&gt;
- &lt;button label="Second"/&gt;
- &lt;/vbox&gt;
-&lt;/hbox&gt;
-</pre>
-<p>当 Copy 按钮按下:</p>
-<ul>
- <li><code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/button" title="button">button</a></code>元素</code>的 <code><a href="/cn/DOM/element.nextSibling" title="cn/DOM/element.nextSibling">nextSibling</a></code> 是<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/vbox" title="vbox">vbox</a></code></code>元素。</li>
- <li>用 <code><a href="/cn/DOM/element.cloneNode" title="cn/DOM/element.cloneNode">cloneNode()</a></code> 方法获得拷贝。</li>
- <li>用 <code><a href="/cn/DOM/element.appendChild" title="cn/DOM/element.appendChild">appendChild()</a></code>加入。</li>
-</ul>
-<p>    注意:有些元素,如<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/listbox" title="listbox">listbox</a></code></code> 和 <code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code></code> 提供了一些其他的修改方法,可以使用他们来代替,下一章( <a href="/cn/XUL_Tutorial/Manipulating_Lists" title="cn/XUL_Tutorial/Manipulating_Lists">next section</a>)会讨论。</p>
-<h3 id=".E5.A4.84.E7.90.86.E5.9F.BA.E6.9C.AC.E5.85.83.E7.B4.A0__Manipulating_Basic_Elements" name=".E5.A4.84.E7.90.86.E5.9F.BA.E6.9C.AC.E5.85.83.E7.B4.A0__Manipulating_Basic_Elements">处理基本元素</h3>
-<p>    像按钮,复选框,单选按钮这些XUL的注意元素可以通过脚本属性处理。这些属性列在 <a href="/cn/XUL_Reference" title="cn/XUL_Reference">element reference</a> 。一些公共的属性如 <code><code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/label">label</a></span></code></code>, <code><code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/value">value</a></span></code></code>, <code><code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/checked">checked</a></span></code></code> 及<code><code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/disabled">disabled</a></span></code></code> 。可以根据需要来设定他们。</p>
-<h4 id=".E4.BE.8B.EF.BC.9A.E6.A0.87.E7.AD.BE.E5.92.8C.E5.80.BC.E7.89.B9.E6.80.A7__Label_and_value_properties_examples" name=".E4.BE.8B.EF.BC.9A.E6.A0.87.E7.AD.BE.E5.92.8C.E5.80.BC.E7.89.B9.E6.80.A7__Label_and_value_properties_examples">例:标签和值特性</h4>
-<p>    这里有一个改变按钮标签的例子。</p>
-<p><span id="Example_3"><a id="Example_3"></a><strong>Example 3</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_dommodify_3.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_dommodify_3.xul">View</a></p>
-<pre>&lt;button label="Hello" oncommand="this.label = 'Goodbye';"/&gt;
-</pre>
-<p>    当按钮按下时<code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/label">label</a></span></code>会改变。对于有标签的元素这是通用的。比如文本框。同样的可以修改 <code><code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/value">value</a></span></code></code> 属性。</p>
-<p><span id="Example_4"><a id="Example_4"></a><strong>Example 4</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_dommodify_4.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_dommodify_4.xul">View</a></p>
-<pre>&lt;button label="Add" oncommand="this.nextSibling.value += '1';"/&gt;
-&lt;textbox/&gt;
-</pre>
-<p>    当按钮按下时文本框中的内容每次加 '1' 。 <code><a href="/cn/DOM/element.nextSibling" title="cn/DOM/element.nextSibling">nextSibling</a></code> 重当前元素转移到下一个元素(textbox)。 += 用于像当前值加一个值,此处把 1 加到文本的末尾。注意此时你仍可以在文本框中输入,你也可以获取现在的标签和值属性的值,如下例。</p>
-<p><span id="Example_5"><a id="Example_5"></a><strong>Example 5</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_dommodify_5.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_dommodify_5.xul">View</a></p>
-<pre>&lt;button label="Hello" oncommand="alert(this.label);"/&gt;
-</pre>
-<h4 id="Toggling_a_checkbox" name="Toggling_a_checkbox">标记checkbox</h4>
-<p>    Checkboxes 有 <code><code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/checked">checked</a></span></code></code> 属性可以是 check 或 uncheck 。很容易知道怎么样。下一个例子,当按钮按下时把<code><code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/checked">checked</a></span></code>属性取反<span style="font-family: Verdana,Tahoma,sans-serif;">。</span></code> 注意 <code><code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/label">label</a></span></code></code> 和<code><code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/value">value</a></span></code></code> 属性是字符串,而 <code><code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/checked">checked</a></span></code></code> 属性是布尔值。</p>
-<p><span id="Example_6"><a id="Example_6"></a><strong>Example 6</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_dommodify_6.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_dommodify_6.xul">View</a></p>
-<pre>&lt;button label="Change" oncommand="this.nextSibling.checked = !this.nextSibling.checked;"/&gt;
-&lt;checkbox label="Check for messages"/&gt;
-</pre>
-<p>    单选按钮也可以用属性选中或取消,注意在一个组中一次只能选中一个,这无需手工操作。单选组的 <code><code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectedIndex">selectedIndex</a></span></code></code>属性用在这里 <code><code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectedIndex">selectedIndex</a></span></code></code> 属性用于获得被选中的单选按钮的序号,同样可改变它。</p>
-<h4 id=".E6.BF.80.E6.B4.BB.E6.88.96.E6.97.A0.E6.95.88.E4.B8.80.E4.B8.AA.E5.85.83.E7.B4.A0__Changing_a_element_disabled_or_enabled" name=".E6.BF.80.E6.B4.BB.E6.88.96.E6.97.A0.E6.95.88.E4.B8.80.E4.B8.AA.E5.85.83.E7.B4.A0__Changing_a_element_disabled_or_enabled">激活或无效一个元素</h4>
-<p>    在某些情况下一些操作将不被支持,有些内容将会无效。比如,在参数选择对话框中,能选择一系列参数但只有一项允许用户改变。下面的例子创建这样的一个界面。</p>
-<p><span id="Example_7"><a id="Example_7"></a><strong>Example 7</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_dommodify_7.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_dommodify_7.xul">View</a></p>
-<pre>&lt;script&gt;
-function updateState(){
- var name = document.getElementById("name");
- var sindex = document.getElementById("group").selectedIndex;
- name.disabled = sindex == 0;
-}
-&lt;/script&gt;
-
-&lt;radiogroup id="group" onselect="updateState();"&gt;
- &lt;radio label="Random name" selected="true"/&gt;
- &lt;hbox&gt;
- &lt;radio label="Specify a name:"/&gt;
- &lt;textbox id="name" value="Jim" disabled="true"/&gt;
- &lt;/hbox&gt;
-&lt;/radiogroup&gt;
-</pre>
-<p>    当单选组中的一个选择事件发生时会调用updateState() 方法。这个函数用<code><code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/selectedIndex">selectedIndex</a></span></code></code> 属性返回当前被选中的 <code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/radio" title="radio">radio</a></code></code> 元素。。注意<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/hbox" title="hbox">hbox</a></code></code>中的元素也被包含在单选组中。如果第一个按钮 (序0)被选中,通过设置文本框的 <code><code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/disabled">disabled</a></span></code> 属性,使文本框无效<span style="font-family: Verdana,Tahoma,sans-serif;">,第二个按钮被选中时,文本框又被激活了。</span></code></p>
-<p>下一章将提供关于单选框和列表的更多信息。</p>
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Document_Object_Model" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Manipulating_Lists">下一页 »</a></p>
-</div><p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/modifying_the_default_skin/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/modifying_the_default_skin/index.html
deleted file mode 100644
index 5bf9abae27..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/modifying_the_default_skin/index.html
+++ /dev/null
@@ -1,63 +0,0 @@
----
-title: 修改默认的皮肤
-slug: Mozilla/Tech/XUL/Tutorial/Modifying_the_Default_Skin
-translation_of: Archive/Mozilla/XUL/Tutorial/Modifying_the_Default_Skin
----
-<p>  本章论述如何修改窗口的皮肤。</p>
-
-<div id="section_1">
-<h3 class="editable" id="关于皮肤"><span>关于皮肤</span><a href="../../../../en/XUL_Tutorial/Modifying_the_Default_Skin#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif">  </span></a></h3>
-
-<p><a href="../../../../en/Creating_a_Skin_for_Firefox/Getting_Started" rel="internal">皮肤</a> 是一组样式表,图片及应用于XUL的行为文件。 通过使用不同的皮肤,你可以再不改变窗口的功能的前提下改变其外观。火狐提供了一个默认的皮肤,并且你也可以下载到其他的一些。对于所有的皮肤来说XUL是一样的,只是,他们使用的样式表及图片不同罢了。</p>
-
-<p>  如果你想让你的火狐窗口看起来更有个性,你可以简单的改变与之关联的样式表文件。当然可以创建一个全新的皮肤来进行进一步的修改。火狐有一个主题管理器用以修改默认的皮肤(尽管在底层代码中,人们把皮肤和用户界面叫“主题”,但实际上他们就是指一个相同的东西)。</p>
-
-<p>  皮肤使用 <a href="../../../../en/CSS" rel="internal">CSS</a>描述,允许你定义绘图元素使用的颜色、边框和图片。再文件classic.jar中包含有皮肤的定义。此包中的全局目录中有一个主样式定义,他用于定义一系列XUL元素是如何显示的。通过修改这些文件,你就能改变XUL程序的外观。。</p>
-</div>
-
-<div id="section_2">
-<h3 class="editable" id="使用userChrome.css定制"><span>  使用userChrome.css定制</span><a href="../../../../en/XUL_Tutorial/Modifying_the_Default_Skin#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"> </span></a></h3>
-
-<p>  在你的profile文件夹中,'chrome'文件夹下放置一个'userChrome.css' 文件你就可以通过覆盖而不是修改主题包来改变程序外观。当你创建一个profile 是就会创建这样一个文件夹,并且其中会包含一些内容。文件'userContent.css' 定制网页, 文件'userChrome.css' 定制chrome 文件。</p>
-
-<p>  下例,把下面这行加到文件的底部,你会发现所有的菜单栏都变成了红色背景。</p>
-
-<pre>menubar {
- background-color: red;
-}
-</pre>
-
-<p>  当你进行了以上修改之后,你会发现所有的火狐窗口都已改变,所有的菜单栏都是红色的。因为他改变了用户样式表,并且作用于所有的窗口。也就是说,浏览器菜单栏、书签菜单栏甚至是查找菜单栏都是红色的。</p>
-</div>
-
-<p> </p>
-
-<h3 class="editable" id="皮肤包"><span>皮肤包 </span></h3>
-
-<div class="editIcon"><a href="../../../../en/XUL_Tutorial/Modifying_the_Default_Skin#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
-
-<p>  仅改变一个窗口,你需要修改与XUL文件相关的样式表。比如,为书签管理器的菜单命令增加一个红色的边框,把下面的内容加到classic.jar或你要用的其他主题包的 bookmarksManager.css 文件最后。</p>
-
-<pre>menuitem {
- border: 1px solid red;
-}
-</pre>
-
-<p>  如果你观察一个皮肤包,你就会注意到其中包含有一系列的样式表及图片。样式表引用图片。当你希望你的程序可以改变皮肤时,你应该避免在XUL文件中直接引用图片。这是因为一个别的什么皮肤设计者可能不希望使用图片,但是如果在XUL文件中直接使用了图片,就会使他的工作变得复杂。请使用CSS间接引用图片,这样就很容易被移除。</p>
-
-<p>  使用<code>list-style-image属性,</code>你可以为按钮、复选框或是其他什么元素设计图形,如下例:</p>
-
-<pre>checkbox {
- list-style-image: url("chrome://findfile/skin/images/check-off.jpg");
-}
-
-checkbox[checked="true"] {
- list-style-image: url("chrome://findfile/skin/images/check-on.jpg");
-}
-</pre>
-
-<p>  这些代码改变了与复选框相关的图形,首先复选框有一个一般的外观,然后为选中的复选框设置了一个新的图像。修饰'checked=true' makes the style only apply to elements which have their checked attributes set to true.</p>
-
-<p><small><span class="lang lang-en"><span id="See_also"><strong>See also</strong></span> </span> : <a href="../../../../en/Creating_a_Skin_for_Firefox" rel="internal">creating a skin for Firefox</a> and <a href="../../../../en/CSS/Getting_Started" rel="internal">CSS getting started</a> </small></p>
-
-<p>下一节,创建一个新皮肤</p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/more_button_features/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/more_button_features/index.html
deleted file mode 100644
index a5dc1c3a54..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/more_button_features/index.html
+++ /dev/null
@@ -1,216 +0,0 @@
----
-title: 沙盒
-slug: Mozilla/Tech/XUL/Tutorial/More_Button_Features
-tags:
- - test
- - 沙盒
- - 练习
-translation_of: Sandbox
----
-<article class="approved">
-<div class="boxed translate-rendered text-content">
-<p class="summary">{{EmbedLiveSample('Sample')}}</p>
-
-<p class="summary">How To Edit The Sandbox For Publication</p>
-
-<p>There should be a video editing add-on.</p>
-
-<h2 id="Steven" name="Steven">Another in this article section (<em>maybe</em>)</h2>
-
-<h3 id="adam" name="adam">Nesting?</h3>
-
-<p>Hmmm, maybe this works? I don't <a href="http://google.com/">know</a>.</p>
-
-<p>I will get there!</p>
-
-<p><a href="https://wiki.developer.mozilla.org/en-US/docs/MDN/Contribute/Howto/Convert_code_samples_to_be_live">link testing</a></p>
-
-<pre class="brush: js line-numbers language-js"><code class="language-js"><span class="keyword token">let</span> there <span class="operator token">=</span> <span class="number token">999999999</span><span class="punctuation token">;</span>
-
-<span class="keyword token">let</span> stepCount <span class="operator token">=</span> <span class="number token">1</span><span class="punctuation token">;</span>
-
-<span class="keyword token">while</span><span class="punctuation token">(</span><span class="operator token">!</span>there<span class="punctuation token">)</span> <span class="punctuation token">{</span>
- stepCount<span class="operator token">++</span><span class="punctuation token">;</span>
-<span class="punctuation token">}</span>
-<span class="comment token">//you cannot got there</span>
-<span class="function token">alert</span><span class="punctuation token">(</span><span class="string token">'I GOT THERE!!!!!!'</span><span class="punctuation token">)</span><span class="punctuation token">;</span></code></pre>
-
-<h4 id="H4_heading">H4 heading</h4>
-
-<h5 id="h5_indicates_that_youve_dug_too_deep!">h5 indicates that you've dug too deep!</h5>
-
-<h2 id="Code_Sample">Code Sample</h2>
-
-<pre class="brush: cpp line-numbers language-cpp"><code class="language-cpp">#include <span class="operator token">&lt;</span>iostream<span class="operator token">&gt;</span>
-
-int <span class="function token">main</span><span class="punctuation token">(</span><span class="punctuation token">)</span>
-
-<span class="punctuation token">{</span>
-
-<span class="function token">print</span><span class="punctuation token">(</span><span class="string token">"This is a sample code!"</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
-
-<span class="keyword token">return</span> <span class="number token">3</span><span class="punctuation token">;</span>
-
-<span class="punctuation token">}</span></code></pre>
-
-<h2 id="Alerts_in_Javascript">Alert's in Javascript</h2>
-
-<h3 id="HTML">HTML</h3>
-
-<pre class="brush: html line-numbers language-html"><code class="language-html"><span class="tag token"><span class="tag token"><span class="punctuation token">&lt;</span>p</span> <span class="attr-name token">id</span><span class="attr-value token"><span class="punctuation token">=</span><span class="punctuation token">'</span>test_code<span class="punctuation token">'</span></span><span class="punctuation token">&gt;</span></span>
- Test Sample Code
-<span class="tag token"><span class="tag token"><span class="punctuation token">&lt;/</span>p</span><span class="punctuation token">&gt;</span></span></code></pre>
-
-<h3 id="CSS">CSS</h3>
-
-<pre class="brush: css line-numbers language-css"><code class="language-css"><span class="selector token"><span class="id token">#test_code</span></span> <span class="punctuation token">{</span>
- <span class="property token">background-color</span><span class="punctuation token">:</span> purple<span class="punctuation token">;</span>
-<span class="punctuation token">}</span></code></pre>
-
-<h3 id="JavaScript">JavaScript</h3>
-
-<pre class="brush: js line-numbers language-js"><code class="language-js">console<span class="punctuation token">.</span><span class="function token">log</span><span class="punctuation token">(</span><span class="string token">"Hi there !!"</span><span class="punctuation token">)</span><span class="punctuation token">;</span></code></pre>
-
-<h3 id="Result">Result</h3>
-
-<p>{{EmbedLiveSample('My_Alert')}}</p>
-
-<h2 id="Hello_World">Hello World</h2>
-
-<h3 id="HTML_2">HTML</h3>
-
-<pre class="brush: html line-numbers language-html"><code class="language-html"><span class="tag token"><span class="tag token"><span class="punctuation token">&lt;</span>input</span> <span class="attr-name token">type</span><span class="attr-value token"><span class="punctuation token">=</span><span class="punctuation token">"</span>date<span class="punctuation token">"</span></span><span class="punctuation token">&gt;</span></span></code></pre>
-
-<h3 id="Result_2">Result</h3>
-
-<p>{{EmbedLiveSample('Hello_World')}}</p>
-
-<h2 id="sand" name="sand">结论</h2>
-
-<p>本文档提供了JavaScript中alerts---警告的基本信息</p>
-
-<h2 id="webgl" name="webgl">WebGL 基本原理</h2>
-
-<p>WebglRenderingContext的shaderSource方法非常酷!</p>
-
-<h2 id="子导航">子导航</h2>
-
-<section id="Quick_Links">
-<ol>
- <li><strong><a href="https://wiki.developer.mozilla.org/en-US/docs/Sandbox">Sandbox</a></strong> {{ListSubpages("/en-US/docs/Sandbox", 2, 0, 1)}}</li>
-</ol>
-</section>
-</div>
-</article>
-
-<article class="localized">
-<header>
-<h3 id="中文_简体_翻译:">中文 (简体) 翻译:</h3>
-</header>
-
-<div class="guide-links"><a href="https://wiki.developer.mozilla.org/zh-CN/docs/MDN/Community" rel="noopener">需要帮助?</a> • <a href="https://wiki.developer.mozilla.org/zh-CN/docs/MDN/Contribute/Editor" rel="noopener">编者指南</a> • <a href="https://wiki.developer.mozilla.org/zh-CN/docs/MDN/Contribute/Content/Style_guide" rel="noopener">风格指南</a></div>
-
-<div class="editor-wrapper" id="editor-wrapper">
-<div class="draft-container">
-<div class="draft-old"></div>
-
-<div class="draft-status"><span id="draft-action">草稿已自动保存: <time class="time-ago" id="draft-time" title="2019-11-15T05:28:03.006Z">2019/11/15 下午1:28:03</time></span></div>
-</div>
-
-<div class="ckeditor-container editor-container dirty">
-<div class="editor">
-<div class="editor-tools"></div>
-
-<div style="height: 232px;">
-<div style="border: 1px solid rgb(182, 182, 182); width: 702px; position: relative; top: 0px;"></div>
-</div>
-</div>
-</div>
-</div>
-</article>
-
-<article class="localized">
-<div class="editor-wrapper" id="editor-wrapper">
-<div class="ckeditor-container editor-container dirty">
-<div class="editor">
-<div class="cke" dir="ltr" id="cke_id_content" lang="zh-cn">
-<div>
-<div id="cke_1_contents" style="height: 2399.9px;"></div>
-</div>
-</div>
-</div>
-</div>
-</div>
-</article>
-
-<p class="summary" id="bob">如何编辑沙盒页面的发布版本test</p>
-
-<p>这里应该有一个视频编辑插件。</p>
-
-<h2 id="vvv" name="vvv">本文的另一个小节(<em>大概</em>)</h2>
-
-<h3 id="adam" name="adam">嵌套?</h3>
-
-<p>嗯, 这样能行吧? 我也不<a href="http://google.com/">知道</a>。</p>
-
-<p>我会做到的!</p>
-
-<p><a href="/zh-CN/docs/MDN/Contribute/Howto/Convert_code_samples_to_be_live">链接测试</a></p>
-
-<pre class="brush: js">let there = 999999999;
-
-let stepCount = 1;
-
-while(!there) {
- stepCount++;
-}
-
-alert('I GOT THERE!!!!!!');</pre>
-
-<h4 id="H4_标题">H4 标题</h4>
-
-<h5 id="h5_表明你钻研的太深奥了有么?">h5 表明你钻研的太深奥了(有么?)</h5>
-
-<h2 id="代码示例">代码示例</h2>
-
-<pre class="brush: cpp line-numbers language-cpp"><code class="language-cpp">#include <span class="operator token">&lt;</span>iostream<span class="operator token">&gt;</span>
-
-int <span class="function token">main</span><span class="punctuation token">(</span><span class="punctuation token">)</span>
-
-<span class="punctuation token">{</span>
-
-<span class="function token">print</span><span class="punctuation token">(</span><span class="string token">"This is a sample code!"</span><span class="punctuation token">)</span><span class="punctuation token">;</span>
-
-<span class="keyword token">return</span> <span class="number token">3</span><span class="punctuation token">;</span>
-
-<span class="punctuation token">}</span></code></pre>
-
-<h2 id="我的警示">我的警示</h2>
-
-<h3 id="HTML_3">HTML</h3>
-
-<pre class="brush: html">&lt;p id='test_code'&gt;
-  测试示例代码
-&lt;/p&gt;</pre>
-
-<h3 id="CSS_2">CSS</h3>
-
-<pre class="brush: css line-numbers language-css"><code class="language-css"><span class="selector token"><span class="id token">#test_code</span></span> <span class="punctuation token">{</span>
- <span class="property token">background-color</span><span class="punctuation token">:</span> purple<span class="punctuation token">;</span>
-<span class="punctuation token">}</span></code></pre>
-
-<h3 id="JavaScript_2">JavaScript</h3>
-
-<pre class="brush: js">console.log("嗨,我在这儿 !!");</pre>
-
-<h3 id="结果">结果</h3>
-
-<p>{{EmbedLiveSample('My_Alert')}}</p>
-
-<h2 id="sand" name="sand">大家好</h2>
-
-<p>本文档旨在健全科学。</p>
-
-<h2 id="webgl" name="webgl">WebGL基本原理</h2>
-
-<p>WebglRenderingContext中的shaderSource方法非常酷炫!</p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/more_event_handlers/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/more_event_handlers/index.html
deleted file mode 100644
index efb14f298f..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/more_event_handlers/index.html
+++ /dev/null
@@ -1,183 +0,0 @@
----
-title: 其他事件处理器
-slug: Mozilla/Tech/XUL/Tutorial/More_Event_Handlers
-translation_of: Archive/Mozilla/XUL/Tutorial/More_Event_Handlers
----
-<div class="pageTitle">
- <h1 id="更多关于事件处理">更多关于事件处理</h1>
-</div>
-<div id="page-top">
- <div class="pageText" id="pageText">
- <p> </p>
- <p> </p>
- <div class="prevnext">
- <p><span style="float: left;">« <a href="../../../../en/XUL_Tutorial/Adding_Event_Handlers" rel="internal">Previous</a></span> <span style="float: right;"><a href="../../../../en/XUL_Tutorial/Keyboard_Shortcuts" rel="internal">Next</a> »</span></p>
- </div>
- <p>  </p>
- <p> </p>
- <p>    在这一章,详细讨论事件对象,并引入一些新事件。</p>
- <div id="section_1">
- <h3 class="editable" id="事件对象"><span>事件对象</span></h3>
- <div class="editIcon">
- <a href="/../../../../en/XUL_Tutorial/More_Event_Handlers#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    每一个事件处理函数都包含一个保存这事件( <a href="../../../../en/DOM/event" rel="internal">event</a> )对象的参数。在以属性的发生添加的事件监听器里也有一个隐含的事件对象(event)被当作参数传递到事件监听器中。在 <a href="../../../../en/DOM/element.addEventListener" rel="internal">addEventListener</a> 的形式中,事件监听器的第一个参数就是事件对象。实践大学有一系列的属性,完整列表参见 <a href="../../../../en/DOM/event" rel="internal"> reference</a>。</p>
- <p>    我们已经在上一章知道了<code><a href="../../../../en/DOM/event.target" rel="internal">target</a></code> 属性,它保存这产生事件元素的一个引用。一个相似的 <code><a href="../../../../en/DOM/event.currentTarget" rel="internal">currentTarget</a></code> 属性当前处理此事件的元素,下面的例子 <code><a href="../../../../en/DOM/event.currentTarget" rel="internal">currentTarget</a></code> 总是 vbox,而 <code><a href="../../../../en/DOM/event.target" rel="internal">target</a></code> 可能是不同的元素, button 或 checkbox。</p>
- <p><span class="lang lang-en"><span id="Example_1"><strong>Example 1</strong></span> </span> : <span class="lang lang-en"><a class="external" href="http://developer.mozilla.org/samples/xultu/examples/ex_advevents_1.xul.txt" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples/ex_advevents_1.xul.txt">Source</a> <a class="external" href="http://developer.mozilla.org/samples/xultu/examples/ex_advevents_1.xul" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples/ex_advevents_1.xul">View</a> </span></p>
- <pre>&lt;vbox oncommand="alert(event.currentTarget.tagName);"&gt;
- &lt;button label="OK"/&gt;
- &lt;checkbox label="Show images"/&gt;
-&lt;/vbox&gt;
-</pre>
- <div id="section_2">
- <h4 class="editable" id="停止事件传播"><span>停止事件传播</span></h4>
- <div class="editIcon">
- <a href="/../../../../en/XUL_Tutorial/More_Event_Handlers#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    一旦你处理一个事件,无论事件传播到什么程度,你都希望停止事件继续向下传播。因为添加事件监听器的方式不同有以下两种方式停止事件传播。</p>
- <p>    由于路由阶段先于返回阶段发生所以路由监听器会先于返回监听器触发。如果路由阶段停止事件传播,那么其后的路由监听器及所有返回监听器都不会触发。手动停止事件对象传播使用 <code><a href="../../../../en/DOM/event.stopPropagation" rel="internal">stopPropagation</a></code> 方法,如下例。</p>
- <p><span class="lang lang-en"><span id="Example_2"><strong>Example 2</strong></span> </span> : <span class="lang lang-en"><a class="external" href="http://developer.mozilla.org/samples/xultu/examples/ex_advevents_2.xul.txt" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples/ex_advevents_2.xul.txt">Source</a> <a class="external" href="http://developer.mozilla.org/samples/xultu/examples/ex_advevents_2.xul" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples/ex_advevents_2.xul">View</a> </span></p>
- <pre>&lt;hbox id="outerbox"&gt;
- &lt;button id="okbutton" label="OK"/&gt;
-&lt;/hbox&gt;
-
-&lt;script&gt;
-function buttonPressed(event){
- alert('Button was pressed!');
-}
-
-function boxPressed(event){
- alert('Box was pressed!');
- event.stopPropagation();
-}
-
-var button = document.getElementById("okbutton");
-button.addEventListener('command',buttonPressed,true);
-
-var outerbox = document.getElementById("outerbox");
-outerbox.addEventListener('command',boxPressed,true);
-&lt;/script&gt;
-</pre>
- <p>    这里分别在按钮和box上添加事件监听器,在调用box的监听器中使用了 <code><a href="../../../../en/DOM/event.stopPropagation" rel="internal">stopPropagation</a></code> 方法,因此按钮的监听器永远不会被调用。如果去掉此命令两个监听器的显示都会出现。</p>
- </div>
- <div id="section_3">
- <h4 class="editable" id="阻止默认响应"><span>阻止默认响应</span></h4>
- <div class="editIcon">
- <a href="/../../../../en/XUL_Tutorial/More_Event_Handlers#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    如果没有注册事件处理,那么当完成路由及返回后,元素会以一种默认的方式对事件作出响应。这种默认响应依赖于元素的定义。比如, 'popupshowing' 事件在快捷菜单显示之前被发送。默认的响应就是显示快捷菜单。如果默认的响应被阻止,那么快捷菜单就不会显示。默认的响应可以使用事件对象的 <code><a href="../../../../en/DOM/event.preventDefault" rel="internal">preventDefault</a></code> 方法阻止,如下例。</p>
- <p><span class="lang lang-en"><span id="Example_3"><strong>Example 3</strong></span> </span> : <span class="lang lang-en"><a class="external" href="http://developer.mozilla.org/samples/xultu/examples/ex_advevents_3.xul.txt" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples/ex_advevents_3.xul.txt">Source</a> <a class="external" href="http://developer.mozilla.org/samples/xultu/examples/ex_advevents_3.xul" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples/ex_advevents_3.xul">View</a> </span></p>
- <pre>&lt;button label="Types" type="menu"&gt;
- &lt;menupopup onpopupshowing="event.preventDefault();"&gt;
- &lt;menuitem label="Glass"/&gt;
- &lt;menuitem label="Plastic"/&gt;
- &lt;/menupopup&gt;
-&lt;/button&gt;
-</pre>
- <p>     另一种方式, 对于以属性形式使用的可以在代码中直接返回 false 。 注意阻止默认响应不同于 <code><a href="../../../../en/DOM/event.stopPropagation" rel="internal">stopPropagation</a></code> 方法,即使默认响应被阻止,事件依然会传播下去。同样的,定义 <code><a href="../../../../en/DOM/event.stopPropagation" rel="internal">stopPropagation</a></code> 方法也不会阻止默认响应。如果需要,必须同时调用。</p>
- <p>    注意一旦传播或默认调用被阻止,都不可恢复。</p>
- <p>    下面的几章列出可能用到的一些事件,一个完整的列表在这里 <a class="external" href="http://www.xulplanet.com/references/elemref/ref_EventHandlers.html" rel="external nofollow" title="http://www.xulplanet.com/references/elemref/ref_EventHandlers.html">XULPlanet event reference</a>。</p>
- </div>
- </div>
- <div id="section_4">
- <h3 class="editable" id="鼠标事件"><span>鼠标事件</span></h3>
- <div class="editIcon">
- <a href="/../../../../en/XUL_Tutorial/More_Event_Handlers#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    这里的一些事件用来描述鼠标动作,简单的描述如下:</p>
- <dl>
- <dt>
- click </dt>
- <dd>
- 当鼠标键在一个元素上按下并释放后调用。</dd>
- </dl>
- <dl>
- <dt>
- dblclick </dt>
- <dd>
- 当鼠标双击时调用。</dd>
- </dl>
- <dl>
- <dt>
- mousedown </dt>
- <dd>
- 当鼠标键在一个元素上按下时调用,事件处理会被立即调用,甚至在鼠标键释放之前。</dd>
- </dl>
- <dl>
- <dt>
- mouseup </dt>
- <dd>
- 当鼠标键在一个元素上释放时调用。</dd>
- </dl>
- <dl>
- <dt>
- mouseover </dt>
- <dd>
- 当鼠标移动到一个元素之上时调用,你可以使用它来高亮显示该元素,然而CSS提供了一个方案自动实现它,所以你可能不会使用它,当然你也可以在状态栏显示一些提示信息。</dd>
- </dl>
- <dl>
- <dt>
- mousemove </dt>
- <dd>
- 当鼠标在一个元素上移动时调用,在移动过程中可能会多次调用事件处理,请务必避免冗长,复杂操作。</dd>
- </dl>
- <dl>
- <dt>
- mouseout </dt>
- <dd>
- 当指针移除元素时调用。你可以将该元素取消高亮或移除状态栏提示。</dd>
- </dl>
- <p>    也有一些与拖动相关的事件,当用户按下鼠标键并移动鼠标时产生,这一部分参见 <a href="../../../../en/Drag_and_Drop" rel="internal">Drag and Drop</a>.</p>
- <div id="section_5">
- <h4 class="editable" id="鼠标键事件属性"><span>鼠标键事件属性</span></h4>
- <div class="editIcon">
- <a href="/../../../../en/XUL_Tutorial/More_Event_Handlers#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    当一个鼠标键事件产生,一系列附件属性也随之产生用以描述哪个鼠标键被按下及鼠标指针的位置。事件的 <code><a href="../../../../en/DOM/event.button" rel="internal">button</a></code> 可以用于确定哪个按键被按下。0 代表左键,1 代表中键 ,2代表右键。如果鼠标设置不同,值也不同。</p>
- <p>    <code><a href="../../../../en/DOM/event.detail" rel="internal">detail</a></code> 保存着鼠标键被短时间内快速点击的次数。这允许你检查这是一次单击,双击还是三击。当然如果你希望检查双击你可以使用 dblclick 事件代替。一旦第一次点击开始 click 事件就会触发,第二次点击会再触发一次,第三次又一次。但 dblclick 事件仅在双击发生时触发。</p>
- <p>     <code><a href="../../../../en/DOM/event.button" rel="internal">button</a></code> 及 <code><a href="../../../../en/DOM/event.detail" rel="internal">detail</a></code> 仅支持与鼠标键相关的事件,对鼠标移动事件无效。对于鼠标移动事件这两个值均为0。</p>
- </div>
- <div id="section_6">
- <h4 class="editable" id="鼠标位置事件属性"><span>鼠标位置事件属性 </span></h4>
- <div class="editIcon">
- <a href="/../../../../en/XUL_Tutorial/More_Event_Handlers#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    所以的鼠标事件都提供事件发生时鼠标的坐标位置。有两个坐标系统。其一是 <code><a href="../../../../en/DOM/event.screenX" rel="internal">screenX</a></code> 、 <code><a href="../../../../en/DOM/event.screenY" rel="internal">screenY</a></code> 属性他们是基于屏幕左上角的。另一个是 <code><a href="../../../../en/DOM/event.clientX" rel="internal">clientX</a></code> 、 <code><a href="../../../../en/DOM/event.clientY" rel="internal">clientY</a></code> 他们是相对于文件左上角的。这里有一个显示当前鼠标位置的例子。</p>
- <p><span class="lang lang-en"><span id="Example_4"><strong>Example 4</strong></span> </span> : <span class="lang lang-en"><a class="external" href="http://developer.mozilla.org/samples/xultu/examples/ex_advevents_4.xul.txt" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples/ex_advevents_4.xul.txt">Source</a> <a class="external" href="http://developer.mozilla.org/samples/xultu/examples/ex_advevents_4.xul" rel="external nofollow" title="http://developer.mozilla.org/samples/xultu/examples/ex_advevents_4.xul">View</a> </span></p>
- <pre>&lt;script&gt;
-
-function updateMouseCoordinates(e){
- var text = "X:" + e.clientX + " Y:" + e.clientY;
- document.getElementById("xy").value = text;
-}
-&lt;/script&gt;
-
-&lt;label id="xy"/&gt;
-&lt;hbox width="400" height="400" onmousemove="updateMouseCoordinates(event);"/&gt;
-</pre>
- <p>    在这个例子里,box 的尺寸被准确设定,这样更容易看出结果。事件处理器得到 <code><a href="../../../../en/DOM/event.clientX" rel="internal">clientX</a></code> 和 <code><a href="../../../../en/DOM/event.clientY" rel="internal">clientY</a></code> 属性并根据他们创建一个字符串。这个字符串又被设置成为 label.value 的值。注意事件对象必须作为参数传递给<code>updateMouseCoordinates</code> 函数。如果快速的在剥削的边缘上移动鼠标,你可能会发现坐标并不会准确的停到 400。这是因为 mousemove 事件触发的间隔取决于鼠标移动的速度。因为当鼠标移动过一段距离后新的事件才触发,因为发送鼠标每一像素的移动是十分没有效率的。</p>
- </div>
- <div id="section_7">
- <h4 class="editable" id="元素相关坐标"><span>元素相关坐标</span></h4>
- <div class="editIcon">
- <a href="/../../../../en/XUL_Tutorial/More_Event_Handlers#" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    你经常想知道事件发生时对元素的坐标而非对于这个窗口。这时你可以使用减法来计算,示例如下。</p>
- <pre>var element = event.target;
-var elementX = event.clientX - element.boxObject.x;
-var elementY = event.clientY - element.boxObject.y;
-</pre>
- <p>      XUL 元素有一个 box 对象可以通过 <code><span class="lang lang-en"><a href="../../../../en/XUL/Property/boxObject" rel="internal">boxObject</a> <span style="font-family: Verdana,Tahoma,sans-serif;">属性获得。在</span></span></code><a href="../../../../en/XUL_Tutorial/Box_Objects" rel="internal"><code><span class="lang lang-en"><span style="font-family: Verdana,Tahoma,sans-serif;">后一章</span></span></code></a><code><span class="lang lang-en"><span style="font-family: Verdana,Tahoma,sans-serif;">我们会学习更多相关内容</span></span></code>,但记住它保存着如何显示元素包括元素的x,y 位置。在这个例子中,这些坐标被从事件坐标中减去,这样就得到了事件相对于元素的坐标。</p>
- </div>
- </div>
- <div id="section_8">
- <h3 class="editable" id="加载事件"><span>加载事件 </span></h3>
- <div class="editIcon">
- <a href="/../../../../en/XUL_Tutorial/More_Event_Handlers#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    一旦XUL文件加载完成 load 事件就会被发送到文件 ( <code><span class="lang lang-en"><a href="../../../../en/XUL/window" rel="internal">window</a> <span style="font-family: Verdana,Tahoma,sans-serif;">标记</span></span></code>),此时正是内容显示之前。这个事件通常被用于初始化操作及完成一些任务使得用户可以使用窗口。你可以通过调用一个顶层的脚本函数来使用这一事件处理以上这些事情。这是因为XUL文件为完全加载,一些事情可能会处理出错。使用 load 事件,在 <code><span class="lang lang-en"><a href="../../../../en/XUL/window" rel="internal">window</a> </span></code>标记处放置 <code><span class="lang lang-en"><a href="../../../../en/XUL/Attribute/onload" rel="internal">onload</a> <span style="font-family: Verdana,Tahoma,sans-serif;">属性,调用处理加载事件的处理器来完成必要的界面初始化。</span></span></code></p>
- <p>    也有unload 事件,它当窗口关闭时被调用,或者作为浏览器的内容时,页面换为另一URL 时调用。你可以使用这一事件保存任何改变的信息。</p>
- <p><br>
-      接下来我们看看如何添加键盘快捷方式( <a href="../../../../en/XUL_Tutorial/Keyboard_Shortcuts" rel="internal">keyboard shortcuts</a>).</p>
- <p> </p>
- <div class="prevnext">
- <p><span style="float: left;">« <a href="../../../../en/XUL_Tutorial/Adding_Event_Handlers" rel="internal">Previous</a></span> <span style="float: right;"><a href="../../../../en/XUL_Tutorial/Keyboard_Shortcuts" rel="internal">Next</a> »</span></p>
- </div>
- <p>  </p>
- <p> </p>
- </div>
- </div>
-</div>
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/more_menu_features/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/more_menu_features/index.html
deleted file mode 100644
index 30cc1b3046..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/more_menu_features/index.html
+++ /dev/null
@@ -1,108 +0,0 @@
----
-title: XUL_教程/更多菜单特性
-slug: Mozilla/Tech/XUL/Tutorial/More_Menu_Features
-tags:
- - XUL_Tutorial
-translation_of: Archive/Mozilla/XUL/Tutorial/More_Menu_Features
----
-<p> </p>
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Simple_Menu_Bars" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Popup_Menus">下一页 »</a></p>
-</div><p></p>
-<p>在本节中,我们来学习如何创建子菜单和check菜单。</p>
-<h3 id=".E5.88.9B.E5.BB.BA.E5.AD.90.E8.8F.9C.E5.8D.95" name=".E5.88.9B.E5.BB.BA.E5.AD.90.E8.8F.9C.E5.8D.95">创建子菜单</h3>
-<p>使用已存在元素可以在其它菜单(递归菜单)中创建子菜单。记住可以在<code>menupopup</code>中放置任意元素。我们已经学过在<code>menuseparator</code>s中放置<code>menuitem</code>s。但是,还可以通过在<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code></code>元素中简单的放置<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code></code>元素来创建子菜单。这样也可以运行,因为菜单元素即使不直接放在菜单栏里面它也是有效的。下面的示例在 文件 菜单中创建了一个简单的子菜单:</p>
-<p><span id="Example_1"><a id="Example_1"></a><strong>Example 1</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_advmenu_1.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_advmenu_1.xul">View</a></p>
-<div class="float-right">
- <img alt="Image:menubar-ex3.png"></div>
-<pre>&lt;toolbox flex="1"&gt;
- &lt;menubar id="sample-menubar"&gt;
- &lt;menu id="file-menu" label="File"&gt;
- &lt;menupopup id="file-popup"&gt;
- &lt;menu id="new-menu" label="New"&gt;
- &lt;menupopup id="new-popup"&gt;
- &lt;menuitem label="Window"/&gt;
- &lt;menuitem label="Message"/&gt;
- &lt;/menupopup&gt;
- &lt;/menu&gt;
- &lt;menuitem label="Open"/&gt;
- &lt;menuitem label="Save"/&gt;
- &lt;menuseparator/&gt;
- &lt;menuitem label="Exit"/&gt;
- &lt;/menupopup&gt;
- &lt;/menu&gt;
- &lt;/menubar&gt;
-&lt;/toolbox&gt;
-</pre>
-<div class="highlight">
- <h3 id=".E5.9C.A8.E6.88.91.E4.BB.AC.E7.9A.84.E3.80.80.E6.9F.A5.E6.89.BE.E6.96.87.E4.BB.B6.E3.80.80.E7.A4.BA.E4.BE.8B.E4.B8.AD.E5.8A.A0.E5.85.A5.E8.8F.9C.E5.8D.95" name=".E5.9C.A8.E6.88.91.E4.BB.AC.E7.9A.84.E3.80.80.E6.9F.A5.E6.89.BE.E6.96.87.E4.BB.B6.E3.80.80.E7.A4.BA.E4.BE.8B.E4.B8.AD.E5.8A.A0.E5.85.A5.E8.8F.9C.E5.8D.95">在我们的 查找文件 示例中加入菜单</h3>
- <p>让我们在查找文件对话框中加入菜单。我们仅加入少量简单的命令至 文件 菜单和 编辑 菜单中。这与上面示例类似。</p>
- <pre class="eval">&lt;toolbox&gt;
-
- <span class="highlightred">&lt;menubar id="findfiles-menubar"&gt;
- &lt;menu id="file-menu" label="File" accesskey="f"&gt;
- &lt;menupopup id="file-popup"&gt;
- &lt;menuitem label="Open Search..." accesskey="o"/&gt;
- &lt;menuitem label="Save Search..." accesskey="s"/&gt;
- &lt;menuseparator/&gt;
- &lt;menuitem label="Close" accesskey="c"/&gt;
- &lt;/menupopup&gt;
- &lt;/menu&gt;
- &lt;menu id="edit-menu" label="Edit" accesskey="e"&gt;
- &lt;menupopup id="edit-popup"&gt;
- &lt;menuitem label="Cut" accesskey="t"/&gt;
- &lt;menuitem label="Copy" accesskey="c"/&gt;
- &lt;menuitem label="Paste" accesskey="p" disabled="true"/&gt;
- &lt;/menupopup&gt;
- &lt;/menu&gt;
- &lt;/menubar&gt;</span>
-
-&lt;toolbar id="findfiles-toolbar&gt;
-</pre>
- <div class="float-right">
- <img alt="Image:menubar1.png"></div>
- <p>在此我们已经加入了两个菜单以及一些不同的菜单命令。注意菜单栏是如何放置在toolbox内的。在 打开搜索 和 保存搜索 后面的三个点通常提示用户本命令操作会打开一个对话框。每个菜单和菜单项已经加入了访问快捷键。在图中可以看到菜单标签内的字母已经被打上了下划线。而 粘贴 命令在此被禁止。我们假定没有什么可以用来粘贴。</p>
- <p><span id="Our_Find_files_example_so_far"><a id="Our_Find_files_example_so_far"></a><strong>Our Find files example so far</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/findfile/findfile-advmenu.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/findfile/findfile-advmenu.xul">View</a></p>
-</div>
-<h3 id=".E7.BB.99.E8.8F.9C.E5.8D.95.E5.8A.A0.E5.85.A5.E5.8B.BE.E9.80.89.28check.29.E6.A0.87.E8.AE.B0" name=".E7.BB.99.E8.8F.9C.E5.8D.95.E5.8A.A0.E5.85.A5.E5.8B.BE.E9.80.89.28check.29.E6.A0.87.E8.AE.B0">给菜单加入勾选(check)标记</h3>
-<p>许多应用程序的菜单项都有check标记。例如,许可特性在命令里面会有一个check,而禁止特征则没有check在里面。当用户选择菜单后,check状态就进行了切换。你也可以在菜单项上创建radio按钮。</p>
-<p>check创建类似于<code><a href="/zh-CN/docs/Mozilla/Tech/XUL/checkbox" title="checkbox">checkbox</a></code>元素和<code><a href="/zh-CN/docs/Mozilla/Tech/XUL/radio" title="radio">radio</a></code>元素。包括了两个属性的使用:<code><a href="cn/XUL/Attribute/button.type">type</a></code>标识check的类型,而<code><a href="cn/XUL/Attribute/menuitem.name">name</a></code>标识同在一起的组命令。下面的示例创建一个带有check项的菜单。</p>
-<p><span id="Example_2"><a id="Example_2"></a><strong>Example 2</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_advmenu_2.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_advmenu_2.xul">View</a></p>
-<pre>&lt;toolbox&gt;
- &lt;menubar id="options-menubar"&gt;
- &lt;menu id="options_menu" label="Options"&gt;
- &lt;menupopup&gt;
- &lt;menuitem id="backups" label="Make Backups" type="checkbox"/&gt;
- &lt;menuitem id="backups" label="Email Administrator" type="checkbox" checked="true"/&gt;
- &lt;/menupopup&gt;
- &lt;/menu&gt;
- &lt;/menubar&gt;
-&lt;/toolbox&gt;
-</pre>
-<p>加入的<code><a href="cn/XUL/Attribute/button.type">type</a></code>属性用来标识菜单项是可以check的。通过设置<code>checkbox</code>的值,通过选择菜单项,使它被勾选或取消勾选。</p>
-<h4 id=".E5.B8.A6.E6.9C.89radio.E6.A0.87.E8.AE.B0.E7.9A.84.E8.8F.9C.E5.8D.95" name=".E5.B8.A6.E6.9C.89radio.E6.A0.87.E8.AE.B0.E7.9A.84.E8.8F.9C.E5.8D.95">带有radio标记的菜单</h4>
-<p>除标准check菜单外,还可以通过设置<code><a href="cn/XUL/Attribute/button.type">type</a></code>的值为<code>radio</code>来创建radio风格的check型菜单。radio风格的check菜单用于在一组目录项中仅选择一项的时候。例如在一个菜单中每次只能选取一个生效的情况。当选取另外一项时,前面的选择项就会自动取消选择。</p>
-<p>为了将一组菜单项放置在一起,需要将每一项的<code><a href="cn/XUL/Attribute/menuitem.name">name</a></code>属性设置为一样,就会形成一个菜单组。示例如下:</p>
-<p><span id="Example_3"><a id="Example_3"></a><strong>Example 3</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_advmenu_3.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_advmenu_3.xul">View</a></p>
-<pre>&lt;toolbox&gt;
- &lt;menubar id="planets-menubar"&gt;
- &lt;menu id="planet-menu" label="Planet"&gt;
- &lt;menupopup&gt;
- &lt;menuitem id="jupiter" label="Jupiter" type="radio" name="ringed"/&gt;
- &lt;menuitem id="saturn" label="Saturn" type="radio" name="ringed" checked="true"/&gt;
- &lt;menuitem id="uranus" label="Uranus" type="radio" name="ringed"/&gt;
- &lt;menuseparator/&gt;
- &lt;menuitem id="earth" label="Earth" type="radio" name="inhabited" checked="true"/&gt;
- &lt;menuitem id="moon" label="Moon" type="radio" name="inhabited"/&gt;
- &lt;/menupopup&gt;
- &lt;/menu&gt;
- &lt;/menubar&gt;
-&lt;/toolbox&gt;
-</pre>
-<p>试一下这个示例,可以发现前三个菜单项只有一个可以被勾选。它们被聚为一组,因为他们的name属性值相同。最后一个菜单项--Earth,一个radio按钮,由于拥有不同的name属性值,因此不是这个菜单组的一部分。</p>
-<p>当然,聚集在一组中的项只能放置在相同的菜单中。虽然将它们相邻的放在一起比分开放要直观得多,但在菜单中并没有必要将它们放在一起。</p>
-<p>下一回,我们将学习如何<a href="cn/XUL_%e6%95%99%e7%a8%8b/%e5%bc%b9%e5%87%ba%e8%8f%9c%e5%8d%95">创建弹出菜单</a>。</p>
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Simple_Menu_Bars" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Popup_Menus">下一页 »</a></p>
-</div><p></p>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/more_wizards/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/more_wizards/index.html
deleted file mode 100644
index 48648bb971..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/more_wizards/index.html
+++ /dev/null
@@ -1,64 +0,0 @@
----
-title: More Wizards
-slug: Mozilla/Tech/XUL/Tutorial/More_Wizards
-translation_of: Archive/Mozilla/XUL/Tutorial/More_Wizards
----
-<div>
- <div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial/Creating_a_Wizard" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial/Overlays">下一页 »</a></p>
-</div></div>
-<p>This section describes some additional features of wizards.</p>
-<h2 id="More_Complex_Wizard_Navigation" name="More_Complex_Wizard_Navigation">More Complex Wizard Navigation</h2>
-<p>Normally, a wizard displays each <code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/wizardpage" title="wizardpage">wizardpage</a></code></code> in the order that you place them in the XUL file. In some cases however, you may want to have different pages of the wizard appear depending on what the user selects in earlier pages.</p>
-<p>In this case, place a <code>pageid</code> attribute on each of the pages. This should be set to an identifier for each page. Then, to navigate to a page, use one of two methods:</p>
-<ol>
- <li>Set the <code>next</code> attribute on each page to the page ID of the next page to go to. You can change these attributes as needed to navigate to different pages.</li>
- <li>Call the wizard's <code>goTo()</code> method. It takes one argument, the page ID of a page to go to. You might call this method in the <code>onpageadvanced</code> or <code>onwizardnext</code> handlers. Remember to return false in this case, because you have already changed the page yourself. Note that the <code>goTo()</code> method, because it causes a page change, will fire the events again, so you'll have to make sure you handle that case.</li>
-</ol>
-<p>For example, here are a set of wizard pages (the inner content has been omitted):</p>
-<pre class="brush:xml">&lt;wizardpage pageid="type" next="font"&gt;
-&lt;wizardpage pageid="font" next="done"&gt;
-&lt;wizardpage pageid="color" next="done"&gt;
-&lt;wizardpage pageid="done"&gt;</pre>
-<ul>
- <li>The wizard always starts at the first page, which in this case has the page ID <code>type</code>. The next page is the one with the page ID <code>font</code>, so the wizard will navigate to that page next.</li>
- <li>On the page with the page ID <code>font</code>, we can see that the next page is <code>done</code>, so that page will be displayed afterwards.</li>
- <li>The page with the page ID <code>done</code> has no <code>next</code> attribute, so this will be the last page.</li>
-</ul>
-<p>A script will adjust the <code>next</code> attributes as necessary to go to the page with the page ID <code>color</code> when needed.</p>
-<h2 id="Wizard_Functions" name="Wizard_Functions">Wizard Functions</h2>
-<p>The wizard works much like a <a href="/en-US/docs/XUL_Tutorial/Tabboxes" title="XUL_Tutorial/Tabboxes">tabbed panel</a>, except that the tabs are not displayed and the user navigates between pages by using the buttons along the bottom. Because all of the pages are part of the same file, all of the values of the fields on all pages will be remembered. Thus, you do not have to load and save information between pages.</p>
-<p>However, you may want to do some validation of each field on each page. For this, use the handlers described in the previous section. If a field is invalid, you might display an alert. In some cases, it would be more convenient to disable the Next button until valid input has been entered.</p>
-<p>The wizard has a property <code>canAdvance</code>, which can be set to true to indicate that the Next button should be enabled. If set to false, the Next button is disabled. You can change the property when invalid or valid data has been entered.</p>
-<p>In the following example, the user must enter a secret code into a textbox on the first page of the wizard. The function checkCode() is called whenever the first page is shown as indicated by the <code>onpageshow</code> attribute. It is also called whenever a key is pressed in the textbox, to determine whether the Next button should be enabled again.</p>
-<h3 id="Wizard_example" name="Wizard_example">Wizard example</h3>
-<p><a href="https://developer.mozilla.org/samples/xultu/examples/ex_advwiz_1.xul.txt">Source</a></p>
-<pre class="brush:xml">&lt;?xml version="1.0"?&gt;
-&lt;?xml-stylesheet href="chrome://global/skin/" type="text/css"?&gt;
-
-&lt;wizard id="theWizard" title="Secret Code Wizard"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;
-
-&lt;script&gt;
-function checkCode(){
- document.getElementById('theWizard').canAdvance = (document.getElementById('secretCode').value == "cabbage");
-}
-&lt;/script&gt;
-
- &lt;wizardpage onpageshow="checkCode(); return true;"&gt;
- &lt;label value="Enter the secret code:"/&gt;
- &lt;textbox id="secretCode" onkeyup="checkCode();"/&gt;
- &lt;/wizardpage&gt;
-
- &lt;wizardpage&gt;
- &lt;label value="That is the correct secret code."/&gt;
- &lt;/wizardpage&gt;
-
-&lt;/wizard&gt;</pre>
-<p>There is also a corresponding <code>canRewind</code> property that you can use to enable or disable the Back button. Both properties are adjusted automatically as you switch pages. Thus, the Back button will be disabled on the first page so you don't have to set it yourself.</p>
-<p>Another useful property of the wizard is <code>currentPage</code>, which holds a reference to the currently displayed <code>wizardpage</code>. You can also modify the current page by changing this property. If you do change it, the various page change events will still be fired.</p>
-<p>Next, we'll see how to use overlays to <a href="/en-US/docs/XUL_Tutorial/Overlays" title="XUL_Tutorial/Overlays">handle common content</a>.</p>
-<div>
- <div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial/Creating_a_Wizard" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial/Overlays">下一页 »</a></p>
-</div></div>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/numeric_controls/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/numeric_controls/index.html
deleted file mode 100644
index 310abf97a4..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/numeric_controls/index.html
+++ /dev/null
@@ -1,78 +0,0 @@
----
-title: 数值控件
-slug: Mozilla/Tech/XUL/Tutorial/Numeric_Controls
-translation_of: Archive/Mozilla/XUL/Tutorial/Numeric_Controls
----
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Input_Controls" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:List_Controls">下一页 »</a></p>
-</div><p></p>
-<p></p>
-<p>XUL有两种输入数值或者范围的元素,两种输入日期和时间的元素。这些元素仅适用于Firefox 3以及后续版本。</p>
-<p>XUL has two elements used for the entry of numeric values or ranges, and well as two elements for entering dates and times. These elements are only available in Firefox 3 and later.</p>
-<h3 id="Number_Fields" name="Number_Fields">数值域Number Fields</h3>
-<p>textbox元素也可以用于输入数值,只要设置<code id="a-type"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/type">type</a></code>属性的值为<code>number</code>即可。这种类型的textbox可以仅用于输入数字而会忽略输入的其他类型字符。另外,textbox一侧添加了上下箭头,允许用户增减输入的值。</p>
-<p>A textbox may be used for entering numbers by setting the value of the <code id="a-type"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/type">type</a></code> attribute to the value <code>number</code>. This type of textbox may only be used to enter numbers. Other characters are not allowed and are just ignored if typed. In addition, arrow buttons appear beside the textbox to allow the user to cycle through the values.</p>
-<div class="float-right">
- <img alt="Image:Controlguide-textbox-number.gif" class="internal" src="/@api/deki/files/137/=Controlguide-textbox-number.gif"></div>
-<p>和其他类型的textbox一样,可以通过<code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code>属性指定默认值。自然,这个值应该是一个数值。另外,可以通过<code id="a-min"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/min">min</a></code>属性和<code id="a-max"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/max">max</a></code>属性指定元素的最小和最大值。如果指定了最小和最大值,你就设定了textbox可以输入的值域。如果用户输入了一个超出上下界的值,它会自动取最大值或最小值代替。例如,下面的数值类型textbox的值域是1到20。</p>
-<p>As with other textboxes, the default value can be specified with the <code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code> attribute. Naturally, this value should be a number. However, the minimum and maximum values can also be specified using the <code id="a-min"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/min">min</a></code> and <code id="a-max"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/max">max</a></code> attributes. If these are set, you can control the range of values that the textbox may be set to. If the user enters a value less or greater than this value, it will be reset to the minimum or maximum value as necessary. For instance, the following numeric textbox has a range between 1 and 20.</p>
-<pre>&lt;textbox type="number" min="1" max="20"/&gt;
-</pre>
-<p>由于没有指定默认值,元素默认取值1,即最小值。设置<code id="a-min"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/min">min</a></code>属性为1表明元素的最小可能值是1,同时设置<code id="a-max"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/max">max</a></code>属性为20表明最大可能值是20。如果没有设置最小值,那么默认是0。<code id="a-max"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/max">max</a></code>属性默认是<code>Infinity</code>,即最大值没有限制。</p>
-<p>As the default value isn't specified, it will default to 1, the minimum value. The <code id="a-min"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/min">min</a></code> attribute is set to <code>1</code> to indicate a minimum possible value of 1 and the <code id="a-max"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/max">max</a></code> attribute is set to <code>20</code> to indiciate a maximum possible value of 20. If the minimum value is not specified, it has a default value of 0. The maximum value defaults to the special value <code>Infinity</code> which means that there is no limit.</p>
-<h4 id="Other_numeric_textbox_attributes" name="Other_numeric_textbox_attributes">其他数值型textbox属性Other numeric textbox attributes</h4>
-<p><code id="a-increment"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/increment">increment</a></code>属性指定当点击箭头时数值的改变量。默认值是1,当然可以设置一个更大的值来加大改变量。例如,下面的例子设置为以10的倍数改变值。</p>
-<p>The <code id="a-increment"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/increment">increment</a></code> attribute may be used to specify by how much the value changes when the arrows are pressed. The default value is 1, but specifying a different value allows the number to change by a larger amount. For instance, the following example steps in multiples of 10.</p>
-<pre>&lt;textbox type="number" increment="10" max="100"/&gt;
-</pre>
-<p>这个textbox从0到100,依次取10的倍数。由于没有指定<code id="a-min"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/min">min</a></code>属性,默认是0。注意,用户仍然可以直接输入其他值。<code id="a-increment"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/increment">increment</a></code>属性只会影响到上下箭头。当textbox有焦点时,用户可以通过上箭头增加值,用下箭头减小值。</p>
-<p>This textbox steps in multiples of 10 from 0 to 100. Since the <code id="a-min"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/min">min</a></code> attribute was not specified, it defaults to 0. Note that the user can still enter other values if they are typed in. The <code id="a-increment"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/increment">increment</a></code> attribute only affects the arrow buttons. The user may also increment or decrement the value using this increment by using the up and down cursor keys while the textbox is focused.</p>
-<p><code id="a-decimalplaces"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/decimalplaces">decimalplaces</a></code>属性表明需要显示的小数位数。默认值是0,表明只显示整数部分。指定其他值则可用于显示小数。</p>
-<p>The <code id="a-decimalplaces"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/decimalplaces">decimalplaces</a></code> attribute indicates how many decimal places to show. The default value is 0, which means show integers only. However a different value may be used to show decimal values.</p>
-<pre>&lt;textbox type="number" decimalplaces="2"/&gt;
-</pre>
-<p>在这个例子中,textbox将显示小数点后两位数字。小数位数多于两位的数值会被舍入到两位小数。</p>
-<p>In this example, two digits right of the decimal point are shown. Values with additional fractional digits are rounded to two digits.</p>
-<h3 id="Scales" name="Scales">滑块Scales</h3>
-<p><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/scale" title="scale">scale</a></code>元素也可以用来从一个区间中选择值。和textbox不同的是滑轨代替了文本框。用户可以拖动滑轨上的滑块来调整值。</p>
-<p>A <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/scale" title="scale">scale</a></code> element may also be used to select from a range of values. Instead of a textbox however, a sliding scale is used. The user may drag the thumb of the scale to adjust the value.</p>
-<div class="float-right">
- <img alt="Image:Controlguide-scale.gif" class="internal" src="/@api/deki/files/133/=Controlguide-scale.gif"></div>
-<p>Scale与textbox有很多相同的属性:<code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code>, <code id="a-min"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/min">min</a></code>, <code id="a-max"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/max">max</a></code> and <code id="a-increment"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/increment">increment</a></code>,使用方法也类似。Scale并不实际显示数值,但这个值可能在脚本中用到。当值改变时,Scale将触发<code>change</code>事件。</p>
-<p>Many of the same attributes as a numeric textbox may be used with a scale: <code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code>, <code id="a-min"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/min">min</a></code>, <code id="a-max"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/max">max</a></code> and <code id="a-increment"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/increment">increment</a></code> may all be used in a similar fashion. The scale does not actually show the value as a number, but it may be used in a script. A scale will fire a <code>change</code> event whenever the scales's value is modified.</p>
-<pre>&lt;scale value="40" min="1" max="50"/&gt;
-</pre>
-<p>这个例子设置了一个默认值是40,值域是1到50的Scale元素。</p>
-<p>This scale defaults to a value of 40 and has a range between 1 and 50.</p>
-<p>数值型textbox一般应用于数值对用户而言很重要的情况,例如需要用户输入天数或者文件的最大大小。而Scale则应该用于实际值对用户不那么重要,只要用户能改变它就可以的情况。例如调整音量或者缩放。</p>
-<p>A numeric textbox would normally be used when the value was important to the user, for instance, a field to enter a number of days, or the maximum size of a file. A scale would be used when the actual value isn't important, just that sliding the scale decreases or increases a state. For instance, a volume slider or a zoom level.</p>
-<p>Scale元素的默认布局是小值在左,大值在右,水平放置。可以通过改变<code id="a-orient"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/orient">orient</a></code>属性和<code id="a-dir"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/dir">dir</a></code>属性修改。</p>
-<p>The default arrangement of a scale is horizontal with lower values to the left and higher values to the right. However, you can change this orientation with the <code id="a-orient"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/orient">orient</a></code> and <code id="a-dir"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/dir">dir</a></code> attributes.</p>
-<pre>&lt;scale orient="vertical" dir="reverse"/&gt;
-</pre>
-<p>这个例子设置Scale垂直显示,且小值在下,大值在上。</p>
-<p>This scale will be shown vertical with lower values at the bottom and higher values at the top.</p>
-<h3 id="Date_and_Time_Entry_Fields" name="Date_and_Time_Entry_Fields">日期时间输入域Date and Time Entry Fields</h3>
-<p><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/datepicker" title="datepicker">datepicker</a></code>元素和<code><a href="/zh-CN/docs/Mozilla/Tech/XUL/timepicker" title="timepicker">timepicker</a></code>元素用于用户输入日期和时间。他们会显示一组数值textbox用于输入日期和时间的各部分。</p>
-<p>The <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/datepicker" title="datepicker">datepicker</a></code> and <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/timepicker" title="timepicker">timepicker</a></code> elements may be used to allow the user to enter dates and times. When used, they display a set of numeric textboxes to enter each of the components of the date or time.</p>
-<pre>&lt;datepicker value="2004-03-24"/&gt;
-&lt;timepicker value="15:30:00"/&gt;
-</pre>
-<div class="float-right">
- <img alt="Image:Controlguide-timepicker.gif" class="internal" src="/@api/deki/files/141/=Controlguide-timepicker.gif"></div>
-<p><code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code>属性用于设置默认值;如果没有显示指定,则初始化为当前日期或时间。属性值的格式严格按照例子所示,日期为YYYY-MM-DD,时间是HH:MM:SS(也可以省去秒以及前面的冒号)。</p>
-<p>The <code>value</code> attribute is used to set the default value; if this attribute is omitted, the field will be initially set to the current date or time. The format of the attribute is exactly as above, that is dates are of the form YYYY/MM/DD and times are of the form HH:MM:SS (although the seconds and the accompanying colon may be omitted).</p>
-<p>这两个元素保证用户输入一个有效的日期或者时间,因此你就不用再自己校验用户输入的日是不是大于当月的总天数以及闰年等等。</p>
-<p>These two elements ensure that the user enters a value date or time. This way, you do not have to check for valid dates, ensure that the day isn't greater than the number of days in the month, handle leap years, and so forth.</p>
-<p><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/timepicker" title="timepicker">timepicker</a></code>元素只有一种样式,而<code><a href="/zh-CN/docs/Mozilla/Tech/XUL/datepicker" title="datepicker">datepicker</a></code>元素有三种不同的样式。默认样式是显示三个输入域分别对应年月日。<code id="a-type"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/type">type</a></code>属性用于选择另外两种样式。<code>grid</code>样式效果如下。</p>
-<p>While the <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/timepicker" title="timepicker">timepicker</a></code> only comes is one style, the <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/datepicker" title="datepicker">datepicker</a></code> has three different variations. The default style shows three fields for entering the year, month and date. The <code id="a-type"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/type">type</a></code> attribute may be used to select the other two. Using a value of <code>grid</code> uses a calendar grid, as shown in the image below.</p>
-<p><img alt="Image:Controlsguide-datepicker-grid.png" class="internal" src="/@api/deki/files/156/=Controlsguide-datepicker-grid.png"></p>
-<p>你也可以使用<code>popup样式,该样式结合了另两种,也有三个输入域用于输入年月日,同时提供一个下拉按钮,用于显示日历供用户选择一天。</code></p>
-<p>You can also use the value <code>popup</code> which creates a combination of the two types. This type has three fields for entering the year, month and date, as well as a dropdown button for displaying a popup calendar grid for selecting a day.</p>
-<pre>&lt;datepicker type="popup"/&gt;
-</pre>
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Input_Controls" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:List_Controls">下一页 »</a></p>
-</div><p></p>
-<p> </p>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/popup_menus/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/popup_menus/index.html
deleted file mode 100644
index 026ec62f83..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/popup_menus/index.html
+++ /dev/null
@@ -1,6 +0,0 @@
----
-title: 弹出菜单
-slug: Mozilla/Tech/XUL/Tutorial/Popup_Menus
-translation_of: Archive/Mozilla/XUL/Tutorial/Popup_Menus
----
-<p>[fd]</p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/progress_meters/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/progress_meters/index.html
deleted file mode 100644
index bacf39b352..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/progress_meters/index.html
+++ /dev/null
@@ -1,58 +0,0 @@
----
-title: XUL_教程/进度条
-slug: Mozilla/Tech/XUL/Tutorial/Progress_Meters
-tags:
- - XUL_教程
-translation_of: Archive/Mozilla/XUL/Tutorial/Progress_Meters
----
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:List_Controls" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Adding_HTML_Elements">下一页 »</a></p>
-</div><p></p>
-<p> </p>
-<h3 id=".E6.B7.BB.E5.8A.A0.E4.B8.80.E4.B8.AA.E8.BF.9B.E5.BA.A6.E6.9D.A1" name=".E6.B7.BB.E5.8A.A0.E4.B8.80.E4.B8.AA.E8.BF.9B.E5.BA.A6.E6.9D.A1">添加一个进度条</h3>
-<p>进度条是条状的,它用来指示一个任务完成了多少。你通常可以在当下载文件或当执行一个很长的操作时看到它。XUL有一个<code><a href="/zh-CN/docs/Mozilla/Tech/XUL/progressmeter" title="progressmeter">progressmeter</a></code>元素可以用来创建这些。有两种类型的进度条: 确定的和不确定的。</p>
-<p>确定的进度条可以用在当你已经知道完成某个操作的时间长度时。进度条将会被往上填充,并且在充 满时,操作刚好完成。这会用在文件的长度已经知道的下载文件对话框。</p>
-<p>不确定进度条会用于当你不知道一个操作的时间长度的情况。进度条是动态的就像一个不停循环移动的杆或一个可调整的框,发生在平台和外观被使用。</p>
-<p>确定的进度条: <img alt="Image:prog-det.png" class="internal" src="/@api/deki/files/2673/=Prog-det.png"></p>
-<p>不确定的进度条: <img alt="Image:prog-udet.png" class="internal" src="/@api/deki/files/2674/=Prog-udet.png"></p>
-<p>进度条的语法如下:</p>
-<pre>&lt;progressmeter
- id="identifier"
- mode="determined"
- value="50%"/&gt;
-</pre>
-<p>属性如下:</p>
-<dl>
- <dt>
- <code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code> </dt>
- <dd>
- 进度条的唯一标识符。</dd>
- <dt>
- <a href="/cn/XUL/Attribute/progressmeter.mode" title="cn/XUL/Attribute/progressmeter.mode">mode</a></dt>
- <dd>
- 进度条的类型。如果这里设置为<code>determined</code>,进度条就是确定型进行度,在任务完成时在填满。如果这里设置为<code>undetermined</code>,这个进度条就是不确定型进度条,用于当你不知道花费时间的长度时。如果不指定这个属性默认值为确定型。</dd>
- <dt>
- <code id="a-value"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/value">value</a></code> </dt>
- <dd>
- 当前进度条的尺度值。你只能在确定型进度条中使用这个属性。这个值可以设成从0%到100%的百分值。这个值可以在任务结束时由脚本来改变。</dd>
-</dl>
-<div class="highlight">
- <h5 id=".E6.96.87.E4.BB.B6.E6.9F.A5.E6.89.BE.E7.9A.84.E4.BE.8B.E5.AD.90" name=".E6.96.87.E4.BB.B6.E6.9F.A5.E6.89.BE.E7.9A.84.E4.BE.8B.E5.AD.90">文件查找的例子</h5>
- <p>让我们添加一个进度条到我们文件查找的对话框吧。我们应该使用不确定的进度条因为我们不知道能搜索到多少文件或者要多久才能搜索完成。然而,现在我们将要增加一个普通的因为动态的可以避免在开发期间的困恼。 进度条仅显示在搜索过程中。我们将在后面的脚本中对它进行开合控制。</p>
- <pre class="eval">&lt;hbox&gt;
-
- <span class="highlightred">&lt;progressmeter value="50%" style="margin: 4px;"/&gt;</span>
-
- &lt;spacer flex="1"/&gt;
-&lt;/hbox&gt;
-</pre>
- <p>值被设成50%因此我们能在窗口上看到尺度。边缘被设成4像素因此它会与窗口的边缘分开。最开始,我们只希望进度条被显示在搜索开始时。脚本会在需要时显示和隐藏它。</p>
- <p>例子太长了。 <a href="https://developer.mozilla.org/samples/xultu/examples/findfile/findfile-progress.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/findfile/findfile-progress.xul">View</a></p>
- <p><img alt="Image:progress1.png" class="internal" src="/@api/deki/files/2675/=Progress1.png"></p>
- <p> </p>
-</div>
-<p>在下一节,我们将学习如何<a href="/cn/XUL_教程/添加HTML元素" title="cn/XUL_教程/添加HTML元素">在窗口增加HTML的附加元素</a>。</p>
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:List_Controls" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Adding_HTML_Elements">下一页 »</a></p>
-</div><p></p>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/property_files/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/property_files/index.html
deleted file mode 100644
index a5800e69f9..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/property_files/index.html
+++ /dev/null
@@ -1,97 +0,0 @@
----
-title: 属性文件
-slug: Mozilla/Tech/XUL/Tutorial/Property_Files
-translation_of: Archive/Mozilla/XUL/Tutorial/Property_Files
----
-<div id="page-top">
- <div class="pageText" id="pageText">
- <p> </p>
- <p>    在脚本中,不能使用实体,用属性文件代替。</p>
- <p> </p>
- <div id="section_1">
- <h3 class="editable" id="属性"><span>属性</span></h3>
- <div class="editIcon">
- <a href="../../../../en/XUL_Tutorial/Property_Files#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    当你在XUL文件中使用DTD文件是恰当的。然而,脚本不解析实体。也就是说,如果你希望在脚本中显示信息而且你不知道到底要显示什么,请使用属性文件</p>
- <p>    一个属性文件包含一系列字符串。你可以在DTD文件旁边找到属性文件(.properties后缀)。属性按照以下语法定义 name=value。实例如下。</p>
- <pre>notFoundAlert=No files were found matching the criteria.
-deleteAlert=Click OK to have all your files deleted.
-resultMessage=%2$S files found in the %1$S directory.
-</pre>
- <p>    上例中,属性文件包含桑属性,可以由脚本读取显示给用户。</p>
- </div>
- <div id="section_2">
- <h3 class="editable" id="Stringbundles"><span>Stringbundles </span></h3>
- <div class="editIcon">
- <a href="../../../../en/XUL_Tutorial/Property_Files#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>   你可以写一段代码手动来读取属性,而在XUL中有一个 <code><span class="lang lang-en"><a href="../../../../en/XUL/stringbundle" rel="internal">stringbundle</a> </span></code>元素来帮你做。这个元素有一系列函数有属性文件中获取属性并得到本地化信息。这个元素有属性文件读取内容并为你建立一个属性列表。你可以通过名字来查找属性。</p>
- <pre>&lt;stringbundleset id="strbundles"&gt;
-&lt;stringbundle id="strings" src="strings.properties"/&gt;
-&lt;/stringbundleset&gt;
-</pre>
- <p>    这个元素会从与该XUL文件系统的目录中读取名为 'strings.properties'的文件。像其他非显示元素一样你可以使用一个 <code><span class="lang lang-en"><a href="../../../../en/XUL/stringbundleset" rel="internal">stringbundleset</a> <span style="font-family: Verdana,Tahoma,sans-serif;">来包含所以的</span></span></code><code><span class="lang lang-en"><a href="../../../../en/XUL/stringbundle" rel="internal">stringbundle</a> </span></code><code><span class="lang lang-en"><span style="font-family: Verdana,Tahoma,sans-serif;">。</span></span></code></p>
- <div id="section_3">
- <h4 class="editable" id="由_stringbundle获取字符串"><span>由 </span><code><span class="lang lang-en"><a href="../../../../en/XUL/stringbundle" rel="internal">stringbundle</a>获取字符串</span></code></h4>
- <div class="editIcon">
- <a href="../../../../en/XUL_Tutorial/Property_Files#" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>     <code><span class="lang lang-en"><a href="../../../../en/XUL/stringbundle" rel="internal">stringbundle</a> </span></code> 元素有一系列方法。首先是 <code>getString</code> 用于脚本读取字符串。</p>
- <pre>var strbundle = document.getElementById("strings");
-var nofilesfound=strbundle.getString("notFoundAlert");
-
-alert(nofilesfound);
-</pre>
- <ul>
- <li>本例首先使用 <code>id 获得字符串束的一个引用</code></li>
- <li>然后在属性文件中查找 'notFoundAlert' 字符串 <code>getString()</code> 函数返回字符串的值或 null (字符串不存在)。</li>
- <li>最后把职工文本显示在提示框里。</li>
- </ul>
- </div>
- <div id="section_4">
- <h4 class="editable" id="文本格式"><span>文本格式</span></h4>
- <div class="editIcon">
- <a href="../../../../en/XUL_Tutorial/Property_Files#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    <code>getFormattedString()</code>方法也根据名字从文本束中查找字符串,此外会按照格式控制代码 (如 <code>%S</code>) 将其后给出的数组内容替换入字符串。</p>
- <pre>var dir = "/usr/local/document";
-var count = 10;
-
-var strbundle = document.getElementById("strings");
-var result = strbundle.getFormattedString("resultMessage", [ dir, count ]);
-
-alert(result);
-</pre>
- <p>    本例显示如下。</p>
- <pre>10 files found in the /usr/local/document directory.</pre>
- <p>    你会注意到格式化代码 <code>%1$S</code> 及 <code>%2$S</code>被使用,替换顺序也和在数组中的不同。格式化代码 %<em>n</em>$S 直接描述替换参数的位置。尽管在不同语言中词序可能不同通过 <code>getFormattedString()</code>描述的顺序可以被写入属性文件。</p>
- </div>
- </div>
- <div id="section_5">
- <h3 class="editable" id="非ASCII码的换码符"><span>非ASCII码的换码符 </span></h3>
- <div class="editIcon">
- <a href="../../../../en/XUL_Tutorial/Property_Files#" style="" title="Edit section"><span class="icon"><img alt="Edit section" class="sectionedit" src="../../../../skins/common/icons/icon-trans.gif"></span></a></div>
- <p>    (这可能不再正确:在 <a href="../../../../en/Localizing_extension_descriptions" rel="internal">Localizing extension descriptions</a>中说 “使用 UTF-8 编码(而非 BOM) 保证外文正确显示。” UTF-8 编码文本有效, 换码符同样有用。一些新想法的引入会更有用。)</p>
- <p>    尽管大多数语言使用非ASCII字符集。属性文件只能使用ASCII字符集编制。然而,属性文件支持其他字符的换码形式: <code>\uXXXX</code> 这里的 XXXX 是字符码,因此,你的属性文件可以包含非ASCII字符,不过你需要把他们转换为换码形式。你可以使用 Sun's Java Development Kit (JDK)的 native2ascii 命令来完成它。</p>
- <p>Gecko 1.8.x (or later) 支持属性文件以 UTF-8编码。你可以直接写入非ASCII字符。</p>
- <p><br>
- 下一章,我们将讨论 XBL,它用于定义元素的行为( <a href="../../../../en/XUL_Tutorial/Introduction_to_XBL" rel="internal">behavior of an element</a>.)</p>
- <p> </p>
- <div class="prevnext">
- <p><span style="float: left;">« <a href="../../../../en/XUL_Tutorial/Localization" rel="internal">Previous</a></span> <span style="float: right;"><a href="../../../../en/XUL_Tutorial/Introduction_to_XBL" rel="internal">Next</a> »</span></p>
- </div>
- <p>  </p>
- <p> </p>
- </div>
- </div>
-</div>
-<div class="printfooter" id="printfooter">
- <hr>
- <p>Retrieved from "<a href="../../../../En/XUL_Tutorial/Property_Files">https://developer.mozilla.org/En/XUL_Tutorial/Property_Files</a>"</p>
-</div>
-<div class="collapsed" id="languages">
- <h5 id="Languages">Languages</h5>
- <ul style="display: none;">
- <li><a href="../../../../fr/Tutoriel_XUL/Les_fichiers_de_propri%c3%a9t%c3%a9s" rel="internal">Français</a></li>
- <li><a href="../../../../pl/Kurs_XUL/Plik_w%c5%82asno%c5%9bci" rel="internal">Polski</a></li>
- <li><a href="../../../../ja/XUL_Tutorial/Property_Files" rel="internal">日本語</a></li>
- </ul>
-</div>
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/rdf_datasources/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/rdf_datasources/index.html
deleted file mode 100644
index b4d4c51238..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/rdf_datasources/index.html
+++ /dev/null
@@ -1,267 +0,0 @@
----
-title: RDF Datasources
-slug: Mozilla/Tech/XUL/Tutorial/RDF_Datasources
-translation_of: Archive/Mozilla/XUL/Tutorial/RDF_Datasources
----
-<p> </p>
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Trees_and_Templates" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Advanced_Rules">下一页 »</a></p>
-</div><p></p>
-<p>Here, we'll look at additional datasources and how to use your own RDF files as datasources.</p>
-<h3 id="Other_Mozilla_Datasources" name="Other_Mozilla_Datasources">Other Mozilla Datasources</h3>
-<p>Mozilla provides a number of other built-in datasources. Some of them are listed here with a few examples. They work very similarly to the bookmarks, although the fields will be different in each case.</p>
-<h3 id="The_History_List" name="The_History_List">The History List</h3>
-<p>The history datasource provides access to the user's history list which is the list of URLs the user has visited recently. The resource can be referred to using <code>rdf:history</code> as the datasource. The table below shows the resources (or fields) that you can retrieve from the history datasource. Put the URL values below where you want the value of the resource to be used.</p>
-<table class="fullwidth-table">
- <tbody>
- <tr>
- <td>Date</td>
- <td><span class="nowiki">http://home.netscape.com/NC-rdf#Date</span></td>
- <td>Date of last visit</td>
- </tr>
- <tr>
- <td>Name</td>
- <td><span class="nowiki">http://home.netscape.com/NC-rdf#Name</span></td>
- <td>Title of the page</td>
- </tr>
- <tr>
- <td>Page</td>
- <td><span class="nowiki">http://home.netscape.com/NC-rdf#Page</span></td>
- <td>Page name</td>
- </tr>
- <tr>
- <td>Referrer</td>
- <td><span class="nowiki">http://home.netscape.com/NC-rdf#Referrer</span></td>
- <td>Referrer of the page</td>
- </tr>
- <tr>
- <td>URL</td>
- <td><span class="nowiki">http://home.netscape.com/NC-rdf#URL</span></td>
- <td>URL of the page</td>
- </tr>
- <tr>
- <td>Visit Count</td>
- <td><span class="nowiki">http://home.netscape.com/NC-rdf#VisitCount</span></td>
- <td>Number of page visits</td>
- </tr>
- </tbody>
-</table>
-<p>A typical history list will display a tree with a selection of these fields. To use them, just put the URL values above in the <code>label</code> attributes of the buttons or treecells. You can use <code>NC:HistoryRoot</code> as the value of the <code>ref</code> attribute. You can also use the value <code>NC:HistoryByDate</code> to get the history sorted into days.</p>
-<h4 id="Using_The_History_List_Example" name="Using_The_History_List_Example">Using The History List Example</h4>
-<p>Let's see an example of displaying the history list. We'll display the history in a tree with three columns, the Name, the URL and the Date.</p>
-<p><span id="Example_1"><a id="Example_1"></a><strong>Example 1</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_datasrc_1.xul.txt">Source</a></p>
-<pre>&lt;tree flex="1" datasources="rdf:history" ref="NC:HistoryRoot"&gt;
-
- &lt;treecols&gt;
- &lt;treecol id="name" label="Name" flex="1"/&gt;
- &lt;treecol id="url" label="URL" flex="1"/&gt;
- &lt;treecol id="date" label="Date" flex="1"/&gt;
- &lt;/treecols&gt;
-
- &lt;template&gt;
-
- &lt;rule&gt;
- &lt;treechildren&gt;
- &lt;treeitem uri="rdf:*"&gt;
- &lt;treerow&gt;
- &lt;treecell label="rdf:http://home.netscape.com/NC-rdf#Name"/&gt;
- &lt;treecell label="rdf:http://home.netscape.com/NC-rdf#URL"/&gt;
- &lt;treecell label="rdf:http://home.netscape.com/NC-rdf#Date"/&gt;
- &lt;/treerow&gt;
- &lt;/treeitem&gt;
- &lt;/treechildren&gt;
- &lt;/rule&gt;
-
- &lt;/template&gt;
-&lt;/tree&gt;
-</pre>
-<h3 id="Other_Datasources" name="Other_Datasources">Other Datasources</h3>
-<p>The tables below list some of the other datasources available with Mozilla. You can use any of the resources that you want.</p>
-<dl>
- <dt>
- Bookmarks (<span class="nowiki">rdf:bookmarks</span>)</dt>
- <dd>
- The bookmarks are generated from the user's bookmark list.</dd>
-</dl>
-<table class="fullwidth-table">
- <tbody>
- <tr>
- <th colspan="3">Resources</th>
- </tr>
- <tr>
- <td>Added Date</td>
- <td><span class="nowiki">http://home.netscape.com/NC-rdf#BookmarkAddDate</span></td>
- <td>Date the bookmark was added</td>
- </tr>
- <tr>
- <td>Description</td>
- <td><span class="nowiki">http://home.netscape.com/NC-rdf#Description</span></td>
- <td>Bookmark description</td>
- </tr>
- <tr>
- <td>Last Modified</td>
- <td><span class="nowiki">http://home.netscape.com/WEB-rdf#LastModifiedDate</span></td>
- <td>Date of last modification</td>
- </tr>
- <tr>
- <td>Last Visited</td>
- <td><span class="nowiki">http://home.netscape.com/WEB-rdf#LastVisitDate</span></td>
- <td>Date of last visit</td>
- </tr>
- <tr>
- <td>Name</td>
- <td><span class="nowiki">http://home.netscape.com/NC-rdf#Name</span></td>
- <td>Bookmark name</td>
- </tr>
- <tr>
- <td>Shortcut URL</td>
- <td><span class="nowiki">http://home.netscape.com/NC-rdf#ShortcutURL</span></td>
- <td>Custom keywords field</td>
- </tr>
- <tr>
- <td>URL</td>
- <td><span class="nowiki">http://home.netscape.com/NC-rdf#URL</span></td>
- <td>The URL to link to</td>
- </tr>
- </tbody>
-</table>
-<table class="fullwidth-table">
- <tbody>
- <tr>
- <th colspan="2">Possible Bookmarks Roots</th>
- </tr>
- <tr>
- <td>NC:BookmarksRoot</td>
- <td>The top level of the bookmarks hierarchy</td>
- </tr>
- <tr>
- <td>NC:IEFavoritesRoot</td>
- <td>The bookmark folder that corresponds to the user's IE favorites.</td>
- </tr>
- <tr>
- <td>NC:PersonalToolbarFolder</td>
- <td>The bookmark folder that corresponds to the personal toolbar folder.</td>
- </tr>
- </tbody>
-</table>
-<dl>
- <dt>
- Files (<span class="nowiki">rdf:files</span>)</dt>
- <dd>
- A view of the user's files.</dd>
-</dl>
-<table class="fullwidth-table">
- <tbody>
- <tr>
- <th colspan="3">Resources</th>
- </tr>
- <tr>
- <td>Name</td>
- <td><span class="nowiki">http://home.netscape.com/NC-rdf#Name</span></td>
- <td>Name of the file</td>
- </tr>
- <tr>
- <td>URL</td>
- <td><span class="nowiki">http://home.netscape.com/NC-rdf#URL</span></td>
- <td>URL of the file</td>
- </tr>
- <tr>
- <td>Content-Length</td>
- <td><span class="nowiki">http://home.netscape.com/NC-rdf#Content-Length</span></td>
- <td>The length of the file.</td>
- </tr>
- <tr>
- <td>LastModifiedDate</td>
- <td><span class="nowiki">http://home.netscape.com/NC-rdf#LastModifiedDate</span></td>
- <td>The date that URL was last modified.</td>
- </tr>
- <tr>
- <td>extension</td>
- <td><span class="nowiki">http://home.netscape.com/NC-rdf#extension</span></td>
- <td>The extension of the file, including the period. This property is only available on platforms that use file extensions.</td>
- </tr>
- </tbody>
-</table>
-<table class="fullwidth-table">
- <tbody>
- <tr>
- <th colspan="2">Possible Files Roots</th>
- </tr>
- <tr>
- <td>NC:FilesRoot</td>
- <td>Top level of the filesystem (usually the list of drives)</td>
- </tr>
- <tr>
- <td>A file URL</td>
- <td>By using a file URL for the ref attribute, you can select a specific directory to be returned. For example, you might use <a class="external" rel="freelink">file:///windows</a> or <a class="external" rel="freelink">files:///usr/local</a>.</td>
- </tr>
- </tbody>
-</table>
-<p>The files datasource is an example of a datasource that determines its resources only when necessary. We don't want every file in the filesystem to be determined before the data is displayed. Instead, only the files and directories that the tree element (or other elements) will need to display at a given time will be determined.</p>
-<h3 id="Composite_Datasources" name="Composite_Datasources">Composite Datasources</h3>
-<p>You can specify multiple datasources in the <code>datasources</code> attribute by separating them with whitespace as in the example below. This has the effect of reading the data from all the datasources mentioned.</p>
-<pre>&lt;tree datasources="rdf:bookmarks rdf:history animals.rdf" ref="NC:BookmarksRoot"&gt;
-</pre>
-<p>This example reads the resources from the bookmarks, history and the animals.rdf file. They are combined into a single composite datasource and can be used as if they were one.</p>
-<p>The special datasource <code>rdf:null</code> corresponds to nothing. You can use this datasource if you want to dynamically set the datasource using a script, but don't want one initially or don't know its exact URL.</p>
-<h3 id="Custom_RDF_Datasources" name="Custom_RDF_Datasources">Custom RDF Datasources</h3>
-<p>You can use any of the above internal datasources if you wish. There are several others for mail, address books and searching and so on. However, you might want to use your own RDF datasource stored in an RDF file. The file can be either a local file or a remote file. Just put the URL of the RDF file in the <code><code id="a-datasources"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/datasources">datasources</a></code></code> attribute.</p>
-<p>Using RDF files provides just as much functionality as any of the internal datasources. You can use rules to match specific types of content. The attributes on the <code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/rule" title="rule">rule</a></code></code> element will match if they match the attributes on an RDF <code>Description</code> element. You can also create RDF files that are hierarchical.</p>
-<h4 id="Using_RDF_file_Example" name="Using_RDF_file_Example">Using RDF file Example</h4>
-<p>The following is an example of how an RDF file can be used as a datasource. The RDF file is fairly large and can be viewed separately: <a href="https://developer.mozilla.org/samples/xultu/examples/animals.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/animals.rdf">RDF</a></p>
-<p><span id="Example_2"><a id="Example_2"></a><strong>Example 2</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_datasrc_2.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_datasrc_2.xul">View</a></p>
-<pre>&lt;tree flex="1" width="200" height="200"
- datasources="animals.rdf" ref="http://www.some-fictitious-zoo.com/all-animals"&gt;
-
- &lt;treecols&gt;
- &lt;treecol id="name" label="Name" primary="true" flex="1"/&gt;
- &lt;treecol id="species" label="Species" flex="1"/&gt;
- &lt;/treecols&gt;
-
- &lt;template&gt;
- &lt;rule&gt;
- &lt;treechildren&gt;
- &lt;treeitem uri="rdf:*"&gt;
- &lt;treerow&gt;
- &lt;treecell label="rdf:http://www.some-fictitious-zoo.com/rdf#name"/&gt;
- &lt;treecell label="rdf:http://www.some-fictitious-zoo.com/rdf#species"/&gt;
- &lt;/treerow&gt;
- &lt;/treeitem&gt;
- &lt;/treechildren&gt;
- &lt;/rule&gt;
-
- &lt;/template&gt;
-&lt;/tree&gt;
-</pre>
-<p><img alt="Image:datasrc1.jpg"></p>
-<p>Here, the data has been generated from the file. The <code><code id="a-ref"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/ref">ref</a></code></code> attribute has been set to the root element in the RDF file, which is the top-level <code>Seq</code>. This will give us a complete list of animals. If we wanted to, we could set the <code><code id="a-ref"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/ref">ref</a></code></code> attribute to any of the other <code>about</code> attribute values to limit the set of data that is returned. For example, to display only the reptiles, use a value of <code><span class="nowiki">http://www.some-fictitious-zoo.com/reptiles</span></code>.</p>
-<h4 id="Setting_the_ref_Attribute_Example" name="Setting_the_ref_Attribute_Example">Setting the <code>ref</code> Attribute Example</h4>
-<p>The example below shows how to display a particular piece of an RDF datasource by setting the <code><code id="a-ref"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/ref">ref</a></code></code> attribute.</p>
-<p><span id="Example_3"><a id="Example_3"></a><strong>Example 3</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_datasrc_3.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_datasrc_3.xul">View</a></p>
-<pre>&lt;window
- id="example-window"
- title="History List"
- xmlns:ANIMALS="http://www.some-fictitious-zoo.com/rdf#"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;
-
-&lt;button label="Click here to see the mammals the zoo has" type="menu"
- datasources="animals.rdf" ref="http://www.some-fictitious-zoo.com/mammals"&gt;
- &lt;template&gt;
- &lt;rule ANIMALS:specimens="0"&gt;&lt;/rule&gt;
- &lt;rule&gt;
- &lt;menupopup&gt;
- &lt;menuitem uri="rdf:*" label="rdf:http://www.some-fictitious-zoo.com/rdf#name"/&gt;
- &lt;/menupopup&gt;
- &lt;/rule&gt;
- &lt;/template&gt;
-&lt;/button&gt;
-
-&lt;/window&gt;
-</pre>
-<p>In this case only the mammals are desired, so we select the URI of the mammals list. You will notice that the value of the <code><code id="a-ref"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/ref">ref</a></code></code> attribute in the example is <code><span class="nowiki">http://www.some-fictitious-zoo.com/mammals</span></code> which corresponds to one of the <code>Seq</code> elements in the RDF file. This causes only the descendants of this list to be returned.</p>
-<p>Two rules have been used here. The first rule catches all the resources that have their <code>ANIMALS:specimens</code> attribute set to <code>0</code>. You can see this attribute in the RDF file on each of the <code>Description</code> elements. Some of them have a value of 0. So in these cases, rule one will match. Because rule one has no content, nothing will be displayed for these ones. This is an effective way to hide data that we don't want to display.</p>
-<p>The second rule applies to all other resources and creates a row in a popup menu. The end effect is that we get a popup menu containing all the mammals which have a specimen that is not 0.</p>
-<p>Next, we'll look at the full rule syntax.</p>
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Trees_and_Templates" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Advanced_Rules">下一页 »</a></p>
-</div><p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/scroll_bars/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/scroll_bars/index.html
deleted file mode 100644
index ea21fc9535..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/scroll_bars/index.html
+++ /dev/null
@@ -1,9 +0,0 @@
----
-title: 滚动栏
-slug: Mozilla/Tech/XUL/Tutorial/Scroll_Bars
-translation_of: Archive/Mozilla/XUL/Tutorial/Scroll_Bars
----
-<p>This page has no content. Enrich M</p><dt>DC by contributing.cxz
-<table style="width: 319px; height: 100px;"> <tbody> <tr> <td> </td> <td style="text-align: center;"> </td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> </tr> </tbody>
-</table>
-<p> </p></dt>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/scrolling_menus/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/scrolling_menus/index.html
deleted file mode 100644
index e484aba178..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/scrolling_menus/index.html
+++ /dev/null
@@ -1,45 +0,0 @@
----
-title: XUL_教程/滚动菜单
-slug: Mozilla/Tech/XUL/Tutorial/Scrolling_Menus
-tags:
- - XUL_Tutorial
-translation_of: Archive/Mozilla/XUL/Tutorial/Scrolling_Menus
----
-<p> </p>
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Popup_Menus" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Adding_Event_Handlers">下一页 »</a></p>
-</div><p></p>
-<p>本节讲述滚动菜单并且将本机制运用到其它元素中。</p>
-<h3 id=".E5.88.9B.E5.BB.BA.E4.B8.80.E4.B8.AA.E5.A4.A7.E8.8F.9C.E5.8D.95" name=".E5.88.9B.E5.BB.BA.E4.B8.80.E4.B8.AA.E5.A4.A7.E8.8F.9C.E5.8D.95">创建一个大菜单</h3>
-<p>如果创建一个菜单,里面有很多的命令在里面,会发生什么呢?这样所有的项不会一次性在屏幕上显示完。Mozilla提供一种滚动机制允许滚动这些项。</p>
-<div class="float-right">
- <img alt="Image:menuscroll1.png"></div>
-<p>如果可用空间太小,在每个菜单的末端会出现箭头。如果将鼠标移动到箭头上,菜单可以上翻或下翻。如果可用的空间足够大,箭头则不会显示。注意是否出现滚动行为完全依赖于当前的实际情况(theme)。</p>
-<p>该行为是完全自动的。你不必特意的去为得到滚动菜单而做些工作。它会应用于菜单栏上的菜单,滚动菜单或菜单列表中。执行它使用<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/arrowscrollbox" title="arrowscrollbox">arrowscrollbox</a></code></code>元素。该元素用来创建带箭头的滚动框。</p>
-<p><code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/arrowscrollbox" title="arrowscrollbox">arrowscrollbox</a></code></code>可以被用在任何使用规范框的地方。但不能用于菜单中。通常是用于垂直的框中,并且可能包括有很多元素在里面。可以将它用于下拉列表中,当你不想要它是一个下拉框的时候。</p>
-<h4 id=".E7.A4.BA.E4.BE.8B_-_.E6.8C.89.E9.92.AE.E7.9A.84.E6.BB.9A.E5.8A.A8.E5.88.97.E8.A1.A8" name=".E7.A4.BA.E4.BE.8B_-_.E6.8C.89.E9.92.AE.E7.9A.84.E6.BB.9A.E5.8A.A8.E5.88.97.E8.A1.A8">示例 - 按钮的滚动列表</h4>
-<p>下面的示例说明了如何创建多个按钮的一个滚动列表(需要改变窗口大小以查看箭头按钮):</p>
-<p><span id="Example_1"><a id="Example_1"></a><strong>Example 1</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_menuscroll_1.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_menuscroll_1.xul">View</a></p>
-<pre>&lt;arrowscrollbox orient="vertical" flex="1"&gt;
- &lt;button label="Red"/&gt;
- &lt;button label="Blue"/&gt;
- &lt;button label="Green"/&gt;
- &lt;button label="Yellow"/&gt;
- &lt;button label="Orange"/&gt;
- &lt;button label="Silver"/&gt;
- &lt;button label="Lavender"/&gt;
- &lt;button label="Gold"/&gt;
- &lt;button label="Turquoise"/&gt;
- &lt;button label="Peach"/&gt;
- &lt;button label="Maroon"/&gt;
- &lt;button label="Black"/&gt;
-&lt;/arrowscrollbox&gt;
-</pre>
-<p>试一下这个示例,首先它会以完全大小打开。但是,如果缩小窗口的高度,滚动箭头就会出现。将窗口拉大则箭头会消失。</p>
-<p>可以设置CSS中<code>arrowscrollbox</code>的<code>max-height</code>属性来限制滚动框的大小,这样使箭头能够一直显示。</p>
-<p>因此,<code>arrowscrollbox</code>在菜单和弹出菜单中相当有用。</p>
-<p>下回,我们将学习如何添加一些<a href="cn/XUL_Tutorial/Adding_Event_Handlers">XUL元素的事件句柄</a>.</p>
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Popup_Menus" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Adding_Event_Handlers">下一页 »</a></p>
-</div><p></p>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/simple_menu_bars/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/simple_menu_bars/index.html
deleted file mode 100644
index a9179852f7..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/simple_menu_bars/index.html
+++ /dev/null
@@ -1,159 +0,0 @@
----
-title: XUL_教程/简单菜单栏
-slug: Mozilla/Tech/XUL/Tutorial/Simple_Menu_Bars
-tags:
- - XUL_Tutorial
-translation_of: Archive/Mozilla/XUL/Tutorial/Simple_Menu_Bars
----
-<p> </p>
-
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Toolbars" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:More_Menu_Features">下一页 »</a></p>
-</div><p></p>
-
-<p>在本节中,我们来看看如何创建菜单栏及菜单项。</p>
-
-<h3 id=".E5.88.9B.E5.BB.BA.E8.8F.9C.E5.8D.95" name=".E5.88.9B.E5.BB.BA.E8.8F.9C.E5.8D.95">创建菜单</h3>
-
-<p>XUL有几种不同的方式来创建菜单。最基本的方式当然是类似大多数程序拥有一个菜单栏并附有一排菜单项在上面。也可以创建弹出式菜单。XUL的菜单特性由几种不同的元素组成,它可以让你创建菜单栏和弹出式菜单。菜单上的项可以轻松的进行自定义。我们在<a href="cn/XUL_Tutorial/List_Controls#Drop-down_Lists">part of how to make menus</a>一文中已经学习过使用<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code></code>了。本节我们就以此为基础。</p>
-
-<p>菜单栏通常像<code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbar" title="toolbar">toolbar</a></code>一样创建。菜单栏也可以放置于<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbox" title="toolbox">toolbox</a></code></code>中,则菜单就像在其它类型工具栏一样。XUL拥有一些特殊元素,可以提供一些特定功能的菜单。</p>
-
-<p>有五种相关的元素用来创建菜单栏及其菜单,在此我们简单解释一下,在后面我们再详述:</p>
-
-<dl>
- <dt><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menubar" title="menubar">menubar</a></code></dt>
- <dd>一排菜单的窗口。</dd>
-</dl>
-
-<dl>
- <dt><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code></dt>
- <dd>尽管名字是菜单,但它实际上在菜单栏上仅仅体现其主题而已。该元素可以放置在菜单栏中或者独立放置。</dd>
-</dl>
-
-<dl>
- <dt><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code></dt>
- <dd>当点击菜单主题时,弹出框会显现。该框包括了菜单命令的列表。</dd>
-</dl>
-
-<dl>
- <dt><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code></dt>
- <dd>菜单上的独立命令。应放置于<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code></code>中。</dd>
-</dl>
-
-<dl>
- <dt><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuseparator" title="menuseparator">menuseparator</a></code></dt>
- <dd>菜单上的分割条。应放置于<code>menupopup</code>中。</dd>
-</dl>
-
-<div class="note">
-<p>你可以在除Macintosh之外的任何平台在菜单栏中自定义任何你想要的菜单。这是因为Macintosh自己特殊的菜单置于屏幕最顶端,由系统控制着。虽然你可以创建自定义菜单,但放置于菜单上的任何特殊样式的规则或非菜单元素均不能生效。在创建菜单时头脑中留意这一点。</p>
-</div>
-
-<h5 id=".E7.AE.80.E5.8D.95.E8.8F.9C.E5.8D.95.E6.A0.8F.E7.A4.BA.E4.BE.8B" name=".E7.AE.80.E5.8D.95.E8.8F.9C.E5.8D.95.E6.A0.8F.E7.A4.BA.E4.BE.8B">简单菜单栏示例</h5>
-
-<p><span id="Example_1"><a id="Example_1"></a><strong>Example 1</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_menubar_1.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_menubar_1.xul">View</a></p>
-
-<div class="float-right"><img alt="Image:menubar-ex1.png"></div>
-
-<pre>&lt;toolbox flex="1"&gt;
- &lt;menubar id="sample-menubar"&gt;
- &lt;menu id="file-menu" label="File"&gt;
- &lt;menupopup id="file-popup"&gt;
- &lt;menuitem label="New"/&gt;
- &lt;menuitem label="Open"/&gt;
- &lt;menuitem label="Save"/&gt;
- &lt;menuseparator/&gt;
- &lt;menuitem label="Exit"/&gt;
- &lt;/menupopup&gt;
- &lt;/menu&gt;
- &lt;menu id="edit-menu" label="Edit"&gt;
- &lt;menupopup id="edit-popup"&gt;
- &lt;menuitem label="Undo"/&gt;
- &lt;menuitem label="Redo"/&gt;
- &lt;/menupopup&gt;
- &lt;/menu&gt;
- &lt;/menubar&gt;
-&lt;/toolbox&gt;
-</pre>
-
-<p>喏,使用<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menubar" title="menubar">menubar</a></code></code>元素创建了一个简单的菜单栏。上面还会创建一排菜单。<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code></code>元素在菜单顶端创建菜单主题显示于菜单栏上。使用<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code></code>元素创建弹出菜单。用户点击父菜单主题时,会弹出显示。弹出菜单框的大小会足够的大,可以容纳里面所有的菜单命令显示。菜单命令本身使用<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code></code>元素进行创建。每一个都代表菜单弹出框上的一个单独命令。</p>
-
-<p>你还可以使用<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuseparator" title="menuseparator">menuseparator</a></code></code>元素创建菜单上面的分割线。用于分割不同的菜单项组。</p>
-
-<h4 id="menubar.E5.85.83.E7.B4.A0" name="menubar.E5.85.83.E7.B4.A0"><code>menubar</code>元素</h4>
-
-<p><code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menubar" title="menubar">menubar</a></code></code>是一个包括菜单的框。注意它已经被放置于一个固定的<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbox" title="toolbox">toolbox</a></code></code>中。菜单栏没有特殊的属性一,仅仅是一种类型的框。这意味着可以创建一个垂直的工具栏,通过设置<code><code id="a-orient"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/orient">orient</a></code></code>属性为vertical。</p>
-
-<h4 id="menu.E5.85.83.E7.B4.A0" name="menu.E5.85.83.E7.B4.A0"><code>menu</code>元素</h4>
-
-<p><code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code></code>元素运行起来就像是<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/button" title="button">button</a></code></code>元素。可以接受与它相同的部分属性及额外的一些属性:</p>
-
-<dl>
- <dt><code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code></dt>
- <dd>菜单主题按钮的唯一标识符。</dd>
-</dl>
-
-<dl>
- <dt><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></dt>
- <dd>显示在菜单上的文字,例如 文件 或 编辑。</dd>
-</dl>
-
-<dl>
- <dt><code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code></dt>
- <dd>该布尔属性决定菜单是否被禁用。虽然可以,但很少情况需要禁止整个菜单。该属性值可以被设置为<code>true</code>或者<code>false</code>。当然,后者是默认值。</dd>
-</dl>
-
-<dl>
- <dt><code id="a-accesskey"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/accesskey">accesskey</a></code></dt>
- <dd>该属性值是用户可以按键盘激活菜单项的键值。该字母通常在菜单主题后面以下划线方式显示。Mozilla会视标签属性根据在此指定的字符给它加上下划线。因此,需要指定一个在文本中存在的字符(尽管指定的键不在文本中也能正常工作)。</dd>
-</dl>
-
-<div class="float-right"><img alt="Image:menubar-ex2.jpg"></div>
-
-<p><code>menu</code>元素通常放置在菜单栏上,尽管这不是必需的。但是,这将出现不一样的显示结果。此处的图片展示了早期没有菜单栏的示例看起来的效果。</p>
-
-<h4 id="menupopup.E5.85.83.E7.B4.A0" name="menupopup.E5.85.83.E7.B4.A0"><code>menupopup</code>元素</h4>
-
-<p><code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code></code>元素创建包括菜单命令的弹出窗口。它是一种类型的框,默认为垂直布局。如果你想要并且将<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code>s</code>放置在一排中,你可以将它改为水平布局。通常仅有<code>menuitem</code>s元素和<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuseparator" title="menuseparator">menuseparator</a></code>s</code>放置在<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code></code>中。你可以放置任何元素在<code>menupopup</code>中,但是在Macintosh中它们都会被忽略。</p>
-
-<h4 id="menuitem.E5.85.83.E7.B4.A0" name="menuitem.E5.85.83.E7.B4.A0"><code>menuitem</code>元素</h4>
-
-<p><code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code></code>元素与<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menu" title="menu">menu</a></code></code>元素非常相似并且拥有部分相同属性。</p>
-
-<dl>
- <dt><code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code></dt>
- <dd>菜单项的唯一标识符。</dd>
-</dl>
-
-<dl>
- <dt><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></dt>
- <dd>显示在菜单项上的文本,例如打开 或 保存。</dd>
-</dl>
-
-<dl>
- <dt><code id="a-disabled"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/disabled">disabled</a></code></dt>
- <dd>该布尔属性值决定菜单项是否被禁止。该属性可以被设置为<code>true</code>或者<code>false</code>,但默认值是后者。</dd>
-</dl>
-
-<dl>
- <dt><code id="a-accesskey"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/accesskey">accesskey</a></code></dt>
- <dd>该值是用户可以使用键盘激活菜单项的键值。该字母通常以下划线方式显示于菜单主题后面。Mozilla将视<code><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></code>属性值给指定的字母加上下划线。因此,你需要指定在文本中存在的字符。</dd>
-</dl>
-
-<dl>
- <dt><code id="a-acceltext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/acceltext">acceltext</a></code></dt>
- <dd>该值指定显示在菜单命令末尾的快捷键文本提示。但是它还没有与<code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuitem" title="menuitem">menuitem</a></code>进行键的关联。我们在后面再研究如何<a href="cn/XUL_Tutorial/Keyboard_Shortcuts">do this later</a>.</dd>
-</dl>
-
-<h4 id="menuseparator.E5.85.83.E7.B4.A0" name="menuseparator.E5.85.83.E7.B4.A0"><code>menuseparator</code>元素</h4>
-
-<p><code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menuseparator" title="menuseparator">menuseparator</a></code></code>没有特别的属性。它只是在两个相信的菜单元素之间创建一条水平的分割线。</p>
-
-<p>下一节,我们会学习一些<a href="cn/XUL_%e6%95%99%e7%a8%8b/%e6%9b%b4%e5%a4%9a%e8%8f%9c%e5%8d%95%e7%89%b9%e6%80%a7">更多菜单特性</a>.</p>
-
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Toolbars" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:More_Menu_Features">下一页 »</a></p>
-</div><p></p>
-
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/splitters/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/splitters/index.html
deleted file mode 100644
index 172190858c..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/splitters/index.html
+++ /dev/null
@@ -1,85 +0,0 @@
----
-title: 分割线
-slug: Mozilla/Tech/XUL/Tutorial/Splitters
-translation_of: Archive/Mozilla/XUL/Tutorial/Splitters
----
-<p>我们来看看如何向一个窗口添加分隔线。</p>
-<h3 id="分隔box"> 分隔box</h3>
-<p>有时候你可能会想将一个窗口分成两节,而使用户可以改变这两节的尺寸。一个例子是mozilla的浏览器窗口,你可以通过拖动两个结构之间的小条来改变侧边栏的尺寸。你也可以点击旁边的标记隐藏这个侧边栏</p>
-<h4 id="元素splitter">元素splitter</h4>
-<p>这个特性是由一个叫做splitter的元素来实现的。它可以在两个节之间创建一个较小的条,可以让用户来改变两边的大小。你可以将splitter放在任何想要放置的地方,这样就可以改变在同一个格子里前后元素的大小了当在水平box中放置一个splitter的时候,将会水平的改变大小。当放在竖直的box中的时候,就可以改变竖直方向的大小了。</p>
-<p>元素splitter的用法如下:</p>
-<table>
- <tbody>
- <tr>
- <td style="width: 568px;">
- <p>&lt;splitter</p>
- <p>    id="identifier"</p>
- <p>    state="open"</p>
- <p>    collapse="before"</p>
- <p>    resizebefore="closest"</p>
- <p>    resizeafter="closest"&gt;</p>
- </td>
- </tr>
- </tbody>
-</table>
-<p>属性如下:</p>
-<p>属性id  全局唯一标识</p>
-<p>属性state 指出splitter的状态。默认设为open,将分割面板分开,否则设置为collapse,将其中一个隐藏,另一个占据整个空间</p>
-<p>属性collapse 这表明当点击隐藏标记的时候隐藏哪一边。设置为before则隐藏前面的元素,如果设置为after则隐藏分割线后面的元素。如果设置为none,也是默认的值,当点击隐藏标记的时候都不会隐藏。</p>
-<p>属性resizebefore 当分割线被拖动的时候。其左边或者上面的元素会改变大小。这一属性说明哪一个元素改变大小。设置为closest会使左边离分割线最近的立即改变大小,设置为farther则左边离分割线最远的元素将会最先改变大小。默认值为closest。</p>
-<p>属性resizeafter当分割线被拖动的时候。其右边或者下面的元素会改变大小。这一属性说明哪一个元素改变大小。设置为closest会使右边离分割线最近的立即改变大小,设置为farther则右边离分割线最远的元素会改变大小。这个属性还可以设置为grow,这种情况下分割线右边的部分不会改变大小,相反的,整个格子会改变大小。默认值为closest。</p>
-<p>如果设置了collapse属性,还可以添加一个grippy元素在splitter里面,这个元素可以用来销毁元素。</p>
-<p>分割线旁边的元素的width和height属性会在splitter拖动的时候进行调整。准确的说是根据resizebefore和resizeafter属性来调整。</p>
-<h4 id="Splitter的例子">Splitter的例子</h4>
-<p>例子1:</p>
-<table>
- <tbody>
- <tr>
- <td style="width: 568px;">
- <p>&lt;hbox flex="1"&gt;</p>
- <p>  &lt;iframe id="content-1" width="60" height="20" src="w1.html"/&gt;</p>
- <p>  &lt;splitter collapse="before" resizeafter="farthest"&gt;</p>
- <p>    &lt;grippy/&gt;</p>
- <p>  &lt;/splitter&gt;</p>
- <p>  &lt;iframe id="content-2" width="60" height="20" src="w2.html"/&gt;</p>
- <p>  &lt;iframe id="content-3" width="60" height="20" src="w3.html"/&gt;</p>
- <p>  &lt;iframe id="content-4" width="60" height="20" src="w4.html"/&gt;</p>
- <p>&lt;/hbox&gt;</p>
- </td>
- </tr>
- </tbody>
-</table>
-<p><img alt=""></p>
-<p>这里创建了4个iframe以及一个分割线,分割线在第一个和第二个iframe之间。属性collapse设置为before,也就是当隐藏标记点击的时候,第一个frame会消失。</p>
-<p>这个splitter的resizeafter属性设置为farther。也就是说当拖动splitter的时候,其后最远的元素会改变大小。也就是frame4会改变大小。</p>
-<p>没有对resizebefore设置值,因此其默认值是closest。这里,分割线之前只有一个splitter,因此frame1会改变大小。</p>
-<p>Frame2和frame3只有在frame4达到最小值时才会改变大小。</p>
-<p><img alt="" style="">、<img alt=""></p>
-<p>也可以在一个窗口上放置多个splitter。同样的也可以隐藏其他元素,而不仅仅是frame。</p>
-<h3 id="查找文件对话框例子"> 查找文件对话框例子</h3>
-<p>让我们看看给查找文件对话框添加一个splitter之后是个什么样子。一个可能是在对话框中添加查找结果,在搜索选项和按钮之间。分割线可以让你隐藏或者查看搜索结果。</p>
-<table>
- <tbody>
- <tr>
- <td style="width: 568px;">
- <p>&lt;/tabbox&gt;</p>
- <p> </p>
- <p>  &lt;iframe src="results.html"/&gt;</p>
- <p>  &lt;splitter collapse="before" resizeafter="grow"&gt;</p>
- <p>   &lt;grippy/&gt;</p>
- <p>  &lt;/splitter&gt;</p>
- <p> </p>
- <p> &lt;hbox&gt;</p>
- </td>
- </tr>
- </tbody>
-</table>
-<p>这里添加了一个iframe和一个splitter。这里在tabbox之后不需要spacer了,可以将其移除。Frame的内容包含在一个'<code>results.html</code>'文件里面,现在创建这个文件并将其放在任何地方。以后我们会用一个结果列表来代替它。</p>
-<p>这个splitter的collapse属性设置为before,就是说分割线之前的元素将会被隐藏。这里就是这个iframe。下面又一个隐藏标志点击之后的图。</p>
-<p>属性resizeafter设置为grow,这样分割线之后的元素将会在分割线向下拖动的时候向下移动。Frame中的内容的大小可以变到任何尺寸。注意,窗口自己不会改变大小,你也会发现这是一个水平分割线,因为是放在竖直box里面的。</p>
-<p>正常状态</p>
-<p><img alt=""></p>
-<p>隐藏后状态</p>
-<p><img alt=""></p>
-<p>接下来将会介绍如何创建工具条</p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/stack_positioning/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/stack_positioning/index.html
deleted file mode 100644
index 40712df82e..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/stack_positioning/index.html
+++ /dev/null
@@ -1,30 +0,0 @@
----
-title: 定位层(stack堆)
-slug: Mozilla/Tech/XUL/Tutorial/Stack_Positioning
-translation_of: Archive/Mozilla/XUL/Tutorial/Stack_Positioning
----
-<p>这一节描述如何为堆中的元素进行定位</p>
-<h3 id="堆子元素的位置">堆子元素的位置</h3>
-<p>通常,stack的子元素为与堆的大小匹配会自动扩展。然而,你也可以将其子元素放在指定的位置。例如,如果一个堆有两个按钮子元素,一个房子左边缘20像素,距顶部50像素。第二个可以房子距离左边缘100像素而距离顶部5像素。</p>
-<p>可以通过设置两个属性来指定子元素的位置,水平方向上使用left属性,竖直方向上使用top属性。如果你在stack的子元素中不指定这些属性,就会扩展以匹配堆的尺寸。</p>
-<p>例子1:</p>
-<p><img alt="" style=""></p>
-<table>
- <tbody>
- <tr>
- <td style="width: 568px;">
- <p>&lt;stack&gt;</p>
- <p>  &lt;button label="Goblins" left="5" top="5"/&gt;</p>
- <p>  &lt;button label="Trolls" left="60" top="20"/&gt;</p>
- <p>  &lt;button label="Vampires" left="10" top="60"/&gt;</p>
- <p>&lt;/stack&gt;</p>
- </td>
- </tr>
- </tbody>
-</table>
-<p>这个堆有三个子元素,每个元素都使用了left和top属性来定位。这里所有的子元素都是按钮,但是并不是所有的子元素必须是同一类型。可以是任意元素,包括格子或者其他堆。</p>
-<p>堆的大小由所有紫云山的位置来决定,总会将大小调整到所有子元素都可见的大小。如果你将left属性设置为400,堆将会有一个400加上元素宽度的宽度。你也可以通过各种样式的不同属性如width。Max-width等来重写这个尺寸。</p>
-<p>也可以通过脚本来调整left和top的值,这样就会使元素移动。堆的优点是当一个指定位置元素位置发生变化时,其他元素不会受到影响。如果在格子中移动子元素,其他元素可能会动态的改它们的位置。</p>
-<p>你也可以将元素重叠起来。当绘制子元素的时候,元素会按照它们出现在堆中的顺序出现。就是说,第一个子元素在最后面。最后一个元素出现在顶部。你可以使用DOM函数来改变子元素的顺序。</p>
-<p>在响应鼠标事件的时候,顶部的元素会最先获取这个事件。也就是说如果有两个按钮重叠起来了,最上面的那个按钮会捕获到鼠标点击的事件。</p>
-<p>下一节描述标签格子(tabboxes),与面板相似但有自己的外观</p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/stacks_and_decks/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/stacks_and_decks/index.html
deleted file mode 100644
index 39aa1762a1..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/stacks_and_decks/index.html
+++ /dev/null
@@ -1,71 +0,0 @@
----
-title: 层和卡片
-slug: Mozilla/Tech/XUL/Tutorial/Stacks_and_Decks
-translation_of: Archive/Mozilla/XUL/Tutorial/Stacks_and_Decks
----
-<p>有时候需要将元素按照一系列重叠的卡片一样进行显示。堆和面板元素可以达到这一目的。</p>
-<h3 id="容器"> 容器</h3>
-<p>每一个XUL格子元素都是一个可以容纳其他元素的容器。有很多具有特殊样式的格子,例如工具条和标签面板。标签box可以创建不带有任何特殊属性的最简单格子。然而,具有特殊样式的格子与常规的格子一样对其内部的元素进行排列,只是他们有附加特性而已。</p>
-<p>事实上,很多组件可以容纳其他元素。我们已经看到了按钮可以容纳除了默认元素之外的其他元素。滚动条也是也是一种特殊的格子类型,如果你不提供元素的话,他们会自己创建自己的元素。它也会自己处理滑块的运动。</p>
-<p>接下来的几节,我们会介绍一些用来容纳其他元素的元素。他们都是有特殊样式的格子,可以将格子的所有属性都用在这些元素上。</p>
-<h3 id="堆">  堆</h3>
-<p>元素stack是一个简单的格子,与其他格子的工作模式一样,只是它的子元素将会处于所有其他元素的最上面。第一个子元素会在最下面。第二个紧接着第一个,接着是第三个,等等。在一个堆中可以堆上任意多的元素。</p>
-<p>属性orient没有什么意义,因为堆中的子元素都是一个在一个的上面,而不是一个紧挨一个的。堆的大小由最大的子元素的大小决定。但你可以使用CSS属性的width,height,min-width和其他相关属性来控制堆和他的子元素。</p>
-<p>元素stack可以在需要为已经存在的元素添加状态指示器时使用。例如,进度条可能会用一个直条和上面一个label来创建。</p>
-<h4 id="带有阴影的堆">带有阴影的堆</h4>
-<p>为了方便的使用stack元素,可能需要为它仿制很多CSS属性。比如像下面这样为它创建一个文字阴影的效果:</p>
-<p>例子1:</p>
-<table>
- <tbody>
- <tr>
- <td style="width: 568px;">
- <p>&lt;stack&gt;</p>
- <p>  &lt;description value="Shadowed" style="padding-left: 1px; padding-top: 1px; font-size: 15pt"/&gt;</p>
- <p>  &lt;description value="Shadowed" style="color: red; font-size: 15pt;"/&gt;</p>
- <p>&lt;/stack&gt;</p>
- </td>
- </tr>
- </tbody>
-</table>
-<p><img alt=""></p>
-<p>两个description元素都创建了一个大小为15点的文字。首先是通过在左边和顶部添加一个1像素的偏移。这样的结果是重复绘制文字'Shadowed'但会与另一个有一点点的偏移。</p>
-<p>这种方法的比使用text-shadow有一些优势,因为你可以完全将主体文字与阴</p>
-<p>影分开进行控制。它可以有自己的字体,下划线或者大小。(你甚至可以制作阴影闪烁的效果)。这在mozilla不支持CSS的文字阴影时也很有用。缺点是阴影的存在使得堆的尺寸变大了。。阴影效果对于创建禁用的按钮的外观很有用:</p>
-<p>例子2:</p>
-<table>
- <tbody>
- <tr>
- <td style="width: 568px;">
- <p>&lt;stack style="background-color: #C0C0C0"&gt;</p>
- <p>  &lt;description value="Disabled" style="color: white; padding-left: 1px; padding-top: 1px;"/&gt;</p>
- <p>  &lt;description value="Disabled" style="color: grey;"/&gt;</p>
- <p>&lt;/stack&gt;</p>
- </td>
- </tr>
- </tbody>
-</table>
-<p>这样安排文字和阴影颜色在某些平台上会产生禁用的外观</p>
-<p>注意,鼠标点击或者按键按下的事件是在堆上顶部元素,即堆中的最后一个元素。就意味着按钮只有是堆中最后一个元素的时候才能工作。</p>
-<h3 id="面板">  面板</h3>
-<p>元素deck也是和stack一样只在顶部显示一个子元素,但是面板一次只显示一个子元素。这对向导接口非常有用,其中一系列相似的面板顺序显示。你可以通过使面板中的内容发生变化而只创建一个窗口,而不是创建多个独立的窗口和导航按钮。</p>
-<p>与堆相似,deck元素的直接子元素组成ianb的页面。面板的显示页面可以通过改变设置selectedIndex属性来控制显示出来的子元素。索引是一个数字,可以指定哪一个页面将会显示。页面索引起始值为0.因此第一个子元素的page0,第二个是page1,等等。</p>
-<p>例子3:</p>
-<table>
- <tbody>
- <tr>
- <td style="width: 568px;">
- <p>&lt;deck selectedIndex="2"&gt;</p>
- <p>  &lt;description value="This is the first page"/&gt;</p>
- <p>  &lt;button label="This is the second page"/&gt;</p>
- <p>  &lt;box&gt;</p>
- <p>    &lt;description value="This is the third page"/&gt;</p>
- <p>    &lt;button label="This is also the third page"/&gt;</p>
- <p>  &lt;/box&gt;</p>
- <p>&lt;/deck&gt;</p>
- </td>
- </tr>
- </tbody>
-</table>
-<p>这里有三个页面,默认为显示第三个。第三个页面是一个格子,里面有两个元素。格子里面的元素和格子本身组成了一个页面。面板的大小是子元素中最大的大小这里就是第三个页面。</p>
-<p>你可以在脚本中改变selectedIndex属性来对页面进行切换。更多关于这个方面的介绍在事件和DOM的章节</p>
-<p>下一节将会描述如何定位堆中的元素</p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/styling_a_tree/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/styling_a_tree/index.html
deleted file mode 100644
index 7574e792b7..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/styling_a_tree/index.html
+++ /dev/null
@@ -1,12 +0,0 @@
----
-title: 样式化树
-slug: Mozilla/Tech/XUL/Tutorial/Styling_a_Tree
-translation_of: Archive/Mozilla/XUL/Tutorial/Styling_a_Tree
----
-<p>XUL:&lt;treerow properties="makeItBlue"&gt;</p>
-<p>css:<br>
- treechildren::-moz-tree-row(makeItBlue)<br>
- {<br>
-   background-color: blue;<br>
- }</p>
-<p>可以参考这里 <a href="/en/XUL_Tutorial/Styling_a_Tree" name="____">点击这里</a></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/tabboxes/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/tabboxes/index.html
deleted file mode 100644
index c8c3e527c7..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/tabboxes/index.html
+++ /dev/null
@@ -1,125 +0,0 @@
----
-title: 分页组
-slug: Mozilla/Tech/XUL/Tutorial/Tabboxes
-tags:
- - tabbox
-translation_of: Archive/Mozilla/XUL/Tutorial/Tabboxes
----
-<p>选择对话框中经常出现标签页,这里我们将会了解如何创建它们。</p>
-<h3 id="分页组">分页组</h3>
-<p>在应用程序的选择窗口中经常出现典型的标签页。在窗口的顶部会出现一系列的标签。用户可以通过点击相应的标签来查看不同的选项集合。当你有很多选项而无法在一个屏幕中完全显示的时候非常有用。</p>
-<p>XUL也提供了一种方法来创建这样的对话框。包含五种新的元素,下面详细的介绍这几个元素。</p>
-<p><strong>tabbox</strong> 最外层的格子,含有顶部的标签和标签页。</p>
-<p><strong>tabs </strong>含有独立标签页的内部格。即这是一排标签</p>
-<p><strong>tabpanels</strong> 页面的容器</p>
-<p><strong>tabpanel </strong>一个单独的页面的主体。你可以将一个页面的内容放在里面。第一个tabpanel对应于第一个标签页,第二个对应第二个,等等。</p>
-<p>元素tabbox含有两个子元素,一个tabs元素和一个tabpanels元素。用法如下:</p>
-<table>
- <tbody>
- <tr>
- <td style="width: 568px;">
- <p>&lt;tabbox id="tablist"&gt;</p>
- <p>  &lt;tabs&gt;</p>
- <p>    &lt;!-- tab elements go here --&gt;</p>
- <p>  &lt;/tabs&gt;</p>
- <p>  &lt;tabpanels&gt;</p>
- <p>    &lt;!-- tabpanel elements go here --&gt;</p>
- <p>  &lt;/tabpanels&gt;</p>
- <p>&lt;/tabbox&gt;</p>
- </td>
- </tr>
- </tbody>
-</table>
-<p>元素tab放在tabs里面,这与常规的box很像。元素tab与box其实没有什么不同的。Tab可以容纳任何类型的元素。不同的是,tab的面板一次只显示一个页面,与deck很相像。</p>
-<p>每个标签页的内容应该放到每个tabpanel元素内部。他们不是在tab元素内部的。Tab元素的内容出现在顶部。</p>
-<p>每个tabpanel元素成为显示时的一个页面。最大的页面的尺寸用作整个tabbox的尺寸。</p>
-<h4 id="分页组实例">分页组实例</h4>
-<p>例子1:</p>
-<p><img alt=""></p>
-<table>
- <tbody>
- <tr>
- <td style="width: 568px;">
- <p>&lt;tabbox&gt;</p>
- <p>  &lt;tabs&gt;</p>
- <p>    &lt;tab label="Mail"/&gt;</p>
- <p>    &lt;tab label="News"/&gt;</p>
- <p>  &lt;/tabs&gt;</p>
- <p>  &lt;tabpanels&gt;</p>
- <p>    &lt;tabpanel id="mailtab"&gt;</p>
- <p>      &lt;checkbox label="Automatically check for mail"/&gt;</p>
- <p>    &lt;/tabpanel&gt;</p>
- <p>    &lt;tabpanel id="newstab"&gt;</p>
- <p>      &lt;button label="Clear News Buffer"/&gt;</p>
- <p>    &lt;/tabpanel&gt;</p>
- <p>  &lt;/tabpanels&gt;</p>
- <p>&lt;/tabbox&gt;</p>
- </td>
- </tr>
- </tbody>
-</table>
-<p>这里有两个标签页,一个mail一个news。当点击news标签的时候,带有'Clear News Buffer'按钮的页面会出现。</p>
-<p>当前选择的标签元素有一个selected属性值为true。这可以改变当前选择的标签页。一次只能有一个标签的selected属性为true。</p>
-<h4 id="标签页的位置">标签页的位置</h4>
-<p>最后,你可以改变标签页的位置以使他们出现这个页面的任意位置。没有特殊的语法。你可以简单的使用orient和dir属性来实现。注意在布局的时候记住tab元素就像一般的格子,而tabbox元素更像是常规的竖直容器,tabs元素更像是默认为水平的容器格子。</p>
-<p>例如,要将标签放到左边,可以将tabs元素的朝向改为竖直的。然后调整tabbox使其具有水平朝向。这会使得标签出现在左边而不是顶部。注意改变tabpanels元素的朝向没有影响,因为标签页是相互覆盖的。</p>
-<p>也可以通过将tabs元素放在tabpanels元素后面来实现将标签放在右边或者下面。或者,也可以将tabbox的dir属性设置为reverse来实现。但是你最好将标签放在上面,否则在某些流行的主题下可能看起来不是很好。</p>
-<h3 id="为查找文件对话框添加标签页。">为查找文件对话框添加标签页。</h3>
-<p>让我们为查找文件的对话框添加第二个panel。我们将会创建一个选项标签(并默认选择)来包含一些搜索选项。这可能不是最好的接口。但我们使用它来说明标签的使用。顶部的文字和搜索选择各种需要放在第一个标签中,我们将会添加一些选项在第二个标签中。进度条和按钮可以放在主窗口中,在标签外部。</p>
-<table>
- <tbody>
- <tr>
- <td style="width: 568px;">
- <p>&lt;vbox flex="1"&gt;</p>
- <p> </p>
- <p>&lt;tabbox selectedIndex="1"&gt;</p>
- <p>  &lt;tabs&gt;</p>
- <p>    &lt;tab label="Search"/&gt;</p>
- <p>    &lt;tab label="Options"/&gt;</p>
- <p>  &lt;/tabs&gt;</p>
- <p>  &lt;tabpanels&gt;</p>
- <p>   &lt;tabpanel id="searchpanel" orient="vertical"&gt;</p>
- <p> </p>
- <p>    &lt;description&gt;</p>
- <p>     Enter your search criteria below and select the Find button to begin</p>
- <p>     the search.</p>
- <p>    &lt;/description&gt;</p>
- <p> </p>
- <p>    &lt;spacer style="height: 10px"/&gt;</p>
- <p> </p>
- <p>    &lt;groupbox orient="horizontal"&gt;</p>
- <p>      &lt;caption label="Search Criteria"/&gt;</p>
- <p> </p>
- <p>      &lt;menulist id="searchtype"&gt;</p>
- <p>        &lt;menupopup&gt;</p>
- <p>          &lt;menuitem label="Name"/&gt;</p>
- <p>          &lt;menuitem label="Size"/&gt;</p>
- <p>          &lt;menuitem label="Date Modified"/&gt;</p>
- <p>        &lt;/menupopup&gt;</p>
- <p>      &lt;/menulist&gt;</p>
- <p>      &lt;spacer style="width: 10px;"/&gt;</p>
- <p>      &lt;menulist id="searchmode"&gt;</p>
- <p>        &lt;menupopup&gt;</p>
- <p>          &lt;menuitem label="Is"/&gt;</p>
- <p>          &lt;menuitem label="Is Not"/&gt;</p>
- <p>        &lt;/menupopup&gt;</p>
- <p>      &lt;/menulist&gt;</p>
- <p> </p>
- <p>      &lt;spacer style="height: 10px"/&gt;</p>
- <p>      &lt;textbox id="find-text" flex="1" style="min-width: 15em;"/&gt;</p>
- <p> </p>
- <p>    &lt;/groupbox&gt;</p>
- <p>   &lt;/tabpanel&gt;</p>
- <p>   &lt;tabpanel id="optionspanel" orient="vertical"&gt;</p>
- <p>    &lt;checkbox id="casecheck" label="Case Sensitive Search"/&gt;</p>
- <p>    &lt;checkbox id="wordscheck" label="Match Entire Filename"/&gt;</p>
- <p>   &lt;/tabpanel&gt;</p>
- <p> &lt;/tabpanels&gt;</p>
- <p>&lt;/tabbox&gt;</p>
- </td>
- </tr>
- </tbody>
-</table>
-<p><img alt=""></p>
-<p>元素tab硬件放在了窗口的主要内容外面。你可以看到两标签,search和options。点击每一个都会将相应的标签页显示出来。如图中显示,两个选项出现在第二个标签上。第一个标签看起来与之前的更像,除了有顶部的标签之外。</p>
-<p>下一节,我们来看看如何创建内容的网格(grid)</p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/templates/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/templates/index.html
deleted file mode 100644
index 01b1eb0cf4..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/templates/index.html
+++ /dev/null
@@ -1,77 +0,0 @@
----
-title: XUL_教程/模板(Templates)
-slug: Mozilla/Tech/XUL/Tutorial/Templates
-translation_of: Archive/Mozilla/XUL/Tutorial/Templates
----
-<p> </p>
-<p>在这一小节,我们将学习如果使用数据填充元素。</p>
-<h3 id="填充元素(Populating_Elements)">填充元素(Populating Elements)</h3>
-<p>XUL提供了通过RDF数据建立元素的方法,来源可以是一个RDF文件,也可以是一个内部数据源。Mozilla本身提供了很多数据源,比如书签、历史记录、邮件列表等。我们在下一小节会针对这部分进行更多的讨论。</p>
-<p>我们通常会向treeitems和menuitems这类的元素填充数据。但你完全可以根据实际情况向其他元素填充数据。在这里,我们还是从这些其他元素入手开始讲解,因为实现树型和菜单需要的代码比较多。</p>
-<p>为了使用RDF数据建立元素,首先要为这些元素提供一个复制用的模板。实际上,我们只是提供了第一个元素而已,剩下的元素都是在第一个元素的基础上构造出来的。</p>
-<p>模板是通过<a class="tag external" href="http://www.xulplanet.com/references/elemref/ref_template.html">template</a>元素建立的。<a class="tag external" href="http://www.xulplanet.com/references/elemref/ref_template.html">template</a>元素里用于放置那些新构建元素的内容。<a class="tag external" href="http://www.xulplanet.com/references/elemref/ref_template.html">template</a>元素要置于包含新构建元素的容器中,比如说你要创建一个<a class="tag external" href="http://www.xulplanet.com/references/elemref/ref_tree.html">tree</a>元素,那么就要把<a class="tag external" href="http://www.xulplanet.com/references/elemref/ref_template.html">template</a>元素置于<a class="tag external" href="http://www.xulplanet.com/references/elemref/ref_tree.html">tree</a>元素中。</p>
-<p>上面这些通过一个简单的例子来说明会很直观明了,在这个例子中,我们会为每个书签都建立 一个按钮。Mozilla提供了一个书签的数据源,我们可以直接拿来使用,为了简便,我们只取最顶层的书签(也可能是文件夹)来建立按钮。对于那些子标 签,我们可能会通过树型结构或者菜单等来显示这种层叠的结构。</p>
-<p>这个例子和其他直接引用内部数据源的程序一样,只能通过chrome开头的地址来调用,处于安全考虑,Mozilla禁止从其他数据源间接调用内部数据源。</p>
-<p>为了运行这个例子,你需要建立一个chrome包并把文件都置于包中,这时就可以通过在浏览器的地址栏输入chrome地址运行了。</p>
-<p>示例 9.2.1: <a class="external" href="http://www.xulplanet.com/tutorials/xultu/examples/ex_templates_1.xul.txt">下载</a></p>
-<div class="examplec">
- <pre>&lt;vbox datasources="<a class="bodytag" href="http://www.yeeyan.com/articles/tag/rdf"><em>rdf</em></a>:bookmarks" ref="NC:BookmarksRoot" flex="1"&gt;
- &lt;<a class="bodytag" href="http://www.yeeyan.com/articles/tag/template"><em>template</em></a>&gt;
- &lt;button uri="<a class="bodytag" href="http://www.yeeyan.com/articles/tag/rdf"><em>rdf</em></a>:*" label="rdf:http://home.netscape.com/NC-rdf#Name"/&gt;
- &lt;/<a class="bodytag" href="http://www.yeeyan.com/articles/tag/template"><em>template</em></a>&gt;
-&lt;/vbox&gt;</pre>
-</div>
-<p><img align="right" alt="" height="166" src="http://www.xulplanet.com/tutorials/xultu/images/templates1.jpg" width="107"> 在这个例子中,建立了一个vbox,vbox里面包含一列的按钮,每个按钮都对应一个顶级的书签。你可以注意到<a class="tag external" href="http://www.xulplanet.com/references/elemref/ref_template.html">template</a>元素内只有一个<a class="tag external" href="http://www.xulplanet.com/references/elemref/ref_button.html">button</a>元素。这个唯一的按钮元素是所有按钮元素建立的基础。旁边的图片就是最后的运行结果,每个按钮对应于一个书签。</p>
-<p>你可以试着在保持这个例子打开的情况下,向浏览器添加一个书签,你会发现这个例子中会立刻添加一个按钮,对应于你刚刚添加的那个书签。(你可能需要重新激活这个窗口,这样才能看到结果)</p>
-<p>模板本身被置于vbox中,而box容器有两个特性专门是为模板服务的,可以标识数据的来源。第一个是datasource特性,用来声明用来建立元素的RDF数据源。在这个例子中,对应的是<a class="bodytag external" href="http://www.yeeyan.com/articles/tag/rdf"><em>rdf</em></a>:bookmarks。你一定可以猜到这个RDF对应的就是书签数据源。这个数据源是由Mozilla提供的。如果要使用自己的数据源,只需要在datasources特性中指定自定义的RDF地址就可以,就像下面例子中的一样:</p>
-<div class="sample">
- <pre>&lt;box datasources="chrome://zoo/content/animals.<a class="bodytag" href="http://www.yeeyan.com/articles/tag/rdf"><em>rdf</em></a>"
- ref="http://www.some-fictitious-zoo.com/all-animals"&gt;</pre>
-</div>
-<p>也还可以同时设置多个数据源,只要在不同的数据源地址间加上空格就可以。这通常用于显示多个来源的数据。</p>
-<p>ref特性用于说明你想从数据源获取哪些数据。在这个书签的例子中,使用的是NC:<span class="aval">BookmarksRoot</span>,对应的是最顶级的书签。ref具体取什么值依赖于要使用的数据源。如果你使用自己的RDF文件作为数据源,ref的value值通常被设置为Bag、Seq或者Alt元素的about特性的值。</p>
-<p>当向box容器添加了这两个特性以后,就可以使用模板来生成元素了。模板里的元素要使用不同的方式来声明。你应该注意到上面例子中,<a class="tag external" href="http://www.xulplanet.com/references/elemref/ref_button.html">button</a>元素设置了uri特性,同时为label特性设置了一个特殊含义的值。</p>
-<p>模板里的特性值如果是以“<a class="bodytag external" href="http://www.yeeyan.com/articles/tag/rdf"><em>rdf</em></a>:”开头的,就表明这个值是要从数据源中读取的。在上面的例子中,label特性就是这种情况。value中除了“rdf:”的剩余部分由命名空间和属性名称组成,表明要使用数据源中的name属性。如果你对这部分感到迷糊,请重新阅读《<a class="external" href="http://cuimingda.com/2008/10/xul-tutorial-introduction-to-rdf.html">XUL教程 - 9.1 - RDF概述</a>》的最后一段。那个例子描述了RDF中的资源是怎样被指向的。在这里我们只使用name属性,当然其他属性在这里也是可以使用的。</p>
-<p>我们为这些按钮的label特性设置了特定的URI,是因为我们需要用RDF数据源中的name属性来填充label。我们可以把URI放到按钮的 任何一个特性中,放到其他元素中也是可以的。不管放到哪个特性中,都会被数据源中相应的值替换。最后的结果,就是我们用按钮label显示出了每个书签的 名字。</p>
-<p>下面的例子展示了我们如何为按钮的其他特性设置数据源。当然我们已经假设数据源中包含相应的资源。如果需要的资源在数据源中没有被找到,那么特性的value就会被设置为空字符串。</p>
-<div class="sample">
- <pre>&lt;button class="<a class="bodytag" href="http://www.yeeyan.com/articles/tag/rdf"><em>rdf</em></a>:http://www.example.com/rdf#class"
- uri="<a class="bodytag" href="http://www.yeeyan.com/articles/tag/rdf"><em>rdf</em></a>:*"
- label="<a class="bodytag" href="http://www.yeeyan.com/articles/tag/rdf"><em>rdf</em></a>:http://www.example.com/rdf#name"/&gt;
- crop="<a class="bodytag" href="http://www.yeeyan.com/articles/tag/rdf"><em>rdf</em></a>:http://www.example.com/rdf#crop"/&gt;</pre>
-</div>
-<p>如上面例子所示,你可以通过不同的数据源动态设置元素的每个特性。</p>
-<p>uri特性用定义开始生成内容的元素。之前的内容只会生成一次,而之后的内容会每次都生成。在后面通过模板建立树型元素的例子中,我们将对这点进行更加详细的阐述。</p>
-<p>当我们将这些特性添加进模板所在的容器后(在这个例子中是box),就可以使用外部数据来建立各种有趣的列表了。我们当然可以在模板中多放几个元素,也可以在任何元素的特性上添加RDF引用,下面就是一个例子:</p>
-<p>实例 9.2.2: <a class="external" href="http://www.xulplanet.com/tutorials/xultu/examples/ex_templates_2.xul.txt">下载</a></p>
-<div class="examplec">
- <pre>&lt;vbox datasources="<a class="bodytag" href="http://www.yeeyan.com/articles/tag/rdf"><em>rdf</em></a>:bookmarks" ref="NC:BookmarksRoot" flex="1"&gt;
- &lt;<a class="bodytag" href="http://www.yeeyan.com/articles/tag/template"><em>template</em></a>&gt;
- &lt;vbox uri="<a class="bodytag" href="http://www.yeeyan.com/articles/tag/rdf"><em>rdf</em></a>:*"&gt;
- &lt;button label="<a class="bodytag" href="http://www.yeeyan.com/articles/tag/rdf"><em>rdf</em></a>:http://home.netscape.com/NC-rdf#Name"/&gt;
- &lt;label value="<a class="bodytag" href="http://www.yeeyan.com/articles/tag/rdf"><em>rdf</em></a>:http://home.netscape.com/NC-rdf#URL"/&gt;
- &lt;/vbox&gt;
- &lt;/<a class="bodytag" href="http://www.yeeyan.com/articles/tag/template"><em>template</em></a>&gt;
-&lt;/vbox&gt;</pre>
-</div>
-<p>这个模板建立了一个vbox,容器中每个书签都对应于一个按钮和一个标签。按钮上显示的是书签的名字,标签上显示的是书签的地址。</p>
-<p>新建立的元素从功能上来说,和直接向XUL中添加数据是没有差别的。每一个通过模板建立的元素都会被自动添加id特性,用来标识这个资源,你也可以使用这个特性对每个资源进行引用。</p>
-<p>你还可以在同一个特性的值中,定义多个不同的资源,中间用空格分隔,下面就是一个例子。可以在<a class="external" href="http://www.xulplanet.com/tutorials/xultu/templateex.html">这里</a>查看更多关于资源定义的语法。</p>
-<p>示例 9.2.3: <a class="external" href="http://www.xulplanet.com/tutorials/xultu/examples/ex_templates_3.xul.txt">源代码</a></p>
-<div class="examplec">
- <pre>&lt;vbox datasources="<a class="bodytag" href="http://www.yeeyan.com/articles/tag/rdf"><em>rdf</em></a>:bookmarks" ref="NC:BookmarksRoot"
- flex="1"&gt;
- &lt;<a class="bodytag" href="http://www.yeeyan.com/articles/tag/template"><em>template</em></a>&gt;
- &lt;label uri="<a class="bodytag" href="http://www.yeeyan.com/articles/tag/rdf"><em>rdf</em></a>:*" value="rdf:http://home.netscape.com/NC-rdf#Name
-<a class="bodytag" href="http://www.yeeyan.com/articles/tag/rdf"><em>rdf</em></a>:http://home.netscape.com/NC-rdf#URL"/&gt;
- &lt;/<a class="bodytag" href="http://www.yeeyan.com/articles/tag/template"><em>template</em></a>&gt;
-&lt;/vbox&gt;</pre>
-</div>
-<h3 id="建立模板(How_Templates_are_Built)">建立模板(How Templates are Built)</h3>
-<p>一旦为元素设置了datasources特性,就表明这个元素将会通过模板来生成。要明确这点,是否生成内容不是由<a class="tag external" href="http://www.xulplanet.com/references/elemref/ref_template.html">template</a>标 记决定的,而是由atasources特性来决定的。只要设置了这个特性,元素就会自动被添加一个叫做构造器的对象。这个对象的责任就是通过模板来构建内 容。在JavaSciprt中,你可以使用builder属性来访问这个构造器对象,但通常你只有在需要手动重新生成内容的时候才需要调用这个对象。</p>
-<p>构造器有两种类型,最常用的是内容构造器(content builder),另外一种是树型构造器(tree builder),当然只有在构造树型元素的时候才用的到。</p>
-<p>内容构造器从<a class="tag external" href="http://www.xulplanet.com/references/elemref/ref_template.html">template</a>元素中读取内容,并在每行都进行复制。比如在上面的例子中如果有十个书签,就会构建10个<a class="tag external" href="http://www.xulplanet.com/references/elemref/ref_label.html">label</a>元素,并都会添加到<a class="tag external" href="http://www.xulplanet.com/references/elemref/ref_vbox.html">vbox</a>元素下面。如果你使用DOM函数对树型结构进行遍历,你可以找到这些元素,并可以调用它们的属性。这些元素最终会在界面显示出来,但是<a class="tag external" href="http://www.xulplanet.com/references/elemref/ref_template.html">template</a>元素本身是不会显示的,虽然在DOM中是可以找到<a class="tag external" href="http://www.xulplanet.com/references/elemref/ref_template.html">template</a>元素的。另外,每个label的id特性将被设置为RDF资源中对应的值。</p>
-<p>内容构造器总是从uri="<a class="bodytag external" href="http://www.yeeyan.com/articles/tag/rdf"><em>rdf</em></a>:*"定义的地方开始操作。如果uri特性所在的元素不是在第一行,那么之前的元素都值将被建立一次。下面的例子中会建立一个hbox,hbox内会用一组label来填充。</p>
-<p>--------------------------------------------------------------------------------</p>
-<p>本文完整内容请参见:</p>
-<p><a class="external" href="http://cuimingda.com/2008/10/xul-tutorial-templates.html">http://cuimingda.com/2008/10/xul-tutorial-templates.html</a></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/the_box_model/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/the_box_model/index.html
deleted file mode 100644
index be0bf1832c..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/the_box_model/index.html
+++ /dev/null
@@ -1,39 +0,0 @@
----
-title: XUL_教程/分组方式
-slug: Mozilla/Tech/XUL/Tutorial/The_Box_Model
-tags:
- - XUL_教程
-translation_of: Archive/Mozilla/XUL/Tutorial/The_Box_Model
----
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:More_Button_Features" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Element_Positioning">下一页 »</a></p>
-</div><p></p>
-<p> </p>
-<h3 id=".E7.AE.B1.E4.BD.93.E5.85.A5.E9.97.A8" name=".E7.AE.B1.E4.BD.93.E5.85.A5.E9.97.A8">盒模型入门</h3>
-<p>在XUL里主要的布局叫做“盒模型”。这个模型允许你把窗口分割成连续的盒子。在盒子里面元素可以按水平或垂直方向排列。通过将一系列的盒子结合在一起,使用定位格和元素的<code><code id="a-flex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/flex">flex</a></code></code>属性,你可以控制窗口的布局。</p>
-<p>虽然盒模型是XUL元素布局的基础部份,但原理并不复杂,只有几条简单的规则。一个盒子可以将它的子盒布置在两个方向之一,水平或垂直。水平盒子将它的元素进行水平排列,而垂直盒子将它的元素进行垂直排列。你可以把一个盒子想像HTML表格中的一行或一列。除了可以在子元素中放置不同的属性还可以使用一些样式表属性来控制子盒的精确定位和尺寸。</p>
-<h4 id=".E7.AE.B1.E4.BD.93.E4.BE.8B.E5.AD.90" name=".E7.AE.B1.E4.BD.93.E4.BE.8B.E5.AD.90">盒的例子</h4>
-<p>下面是定义盒子的基本语法:</p>
-<pre>&lt;hbox&gt;
- &lt;!-- horizontal elements --&gt;
-&lt;/hbox&gt;
-
-&lt;vbox&gt;
- &lt;!-- vertical elements --&gt;
-&lt;/vbox&gt;
-</pre>
-<p><code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/hbox" title="hbox">hbox</a></code></code>元素用来创建一个水平方向的盒子。每个放在<code>hbox</code>中的元素将被水平地排成一行。<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/vbox" title="vbox">vbox</a></code></code> 元素用来创建一个垂直方向的盒子。添加进来的元素将会被垂直地放在前一个的下面。</p>
-<p>同样有一个普通的<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/box" title="box">box</a></code></code>元素默认是水平方向的,和<code>hbox</code>的意思相同。然而,你可以使用<code><code id="a-orient"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/orient">orient</a></code></code> 属生去操作盒子的方向。你可以设置这个属性的值为<code>horizontal</code> 去创建一个水平的盒子和<code>vertical</code>去创建一个垂直的盒子。</p>
-<p>因此,下面两行的效果是一样的:</p>
-<pre>&lt;vbox&gt;&lt;/vbox&gt;
-
-&lt;box orient="vertical"&gt;&lt;/box&gt;
-</pre>
-<p>下面例子展示怎么垂直放置三个按钮。</p>
-<p><span id="%E4%BE%8B1"><a id="%E4%BE%8B1"></a><strong>例1</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_boxes_1.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_boxes_1.xul">View</a></p>
-<div class="float-right">
- <img alt="Image:boxes-ex1.png" class="internal" src="/@api/deki/files/2644/=Boxes-ex1.png"></div>
-<pre>&lt;vbox&gt;
- &lt;button id="yes" label="Yes"/&gt;
- &lt;button id="no" label="No"/&gt;
- &lt;</pre>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/the_chrome_url/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/the_chrome_url/index.html
deleted file mode 100644
index 817869f2d2..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/the_chrome_url/index.html
+++ /dev/null
@@ -1,74 +0,0 @@
----
-title: 关于Chrome URL
-slug: Mozilla/Tech/XUL/Tutorial/The_Chrome_URL
-translation_of: Archive/Mozilla/XUL/Tutorial/The_Chrome_URL
----
-<div>
- <a href="cn/XUL_%e6%95%99%e7%a8%8b/XUL%e7%9a%84%e7%bb%93%e6%9e%84">&lt;&lt; 前页</a> <a href="cn">后页 &gt;&gt;</a></div>
-<h3 id="Chrome.E7.BB.9F.E4.B8.80.E8.B5.84.E6.BA.90.E5.AE.9A.E4.BD.8D.E5.99.A8.28URL.29" name="Chrome.E7.BB.9F.E4.B8.80.E8.B5.84.E6.BA.90.E5.AE.9A.E4.BD.8D.E5.99.A8.28URL.29">Chrome统一资源定位器(URL)</h3>
-<p>下面的部分将描述如何关联(引用)XUL文档和其他的chrome文件。</p>
-<p>&lt;big&gt;<strong>Chrome统一资源定位器(URL)</strong>&lt;/big&gt;</p>
-<p>XUL文件可以像HTML文件一样被一个普通的HTTP URL(或者其他任何类型的URL)关联。尽管如此,用于Mozilla的chrome系统的软件包可以用特殊的chrome URL关联。Mozilla自带的软件包伴随Mozilla已经安装好,但你可以注册自己的包。</p>
-<p>软件包安装过之后具有不受安全限制的优点——安全限制对于很多程序来说都是必须的。相对于其他类型的URL来说,另外一个好处是它们可以自动处理多个主题和语言选项。举例来说,一条chrome URL允许你关联(引用)某个主题当中的一个文件,比如说是图片,与此同时你不需要知道用户当前使用的是哪个主题。只要不同主题里面的对应文件名相同,你总是可以通过chrome URL来引用这个文件。Mozilla会找到文件的路径并返回正确的数据。这也就意味着,软件包安装的位置与是否能访问它没有关系。chrome URL与文件物理存放位置无关,这使得写含有很多文件的程序变得简单了,因为你无需关心文件位置的细节。</p>
-<p>Chrome统一资源定位器(URL)的基本语法规则如下:</p>
-<table>
- <tbody>
- <tr>
- <td>
- <pre>
-chrome://&lt;package name&gt;/&lt;part&gt;/&lt;file.xul&gt;</pre>
- </td>
- </tr>
- </tbody>
-</table>
-<p>上面的<code>&lt;package name&gt;</code>是软件包的名字,比如是编辑器或聊天工具。<code>&lt;part&gt;</code>可以是'content','skin'或'locale',这取决于你的需要。'file.xul'是文件名。</p>
-<p><strong>示例</strong>:<a class="external" rel="freelink">chrome://messenger/content/messenger.xul</a></p>
-<p>这个例子关联到的是'content'中的messenger窗口。将'content'替换为'skin'并改掉文件名,就可以指向皮肤中的某个文件。同样的,用'locale'替换'content'后,我们就能指向语言中的文件。</p>
-<p>当你打开一个chrome URL,Mozilla在其已安装包列表中查找,尝试定位到与URL中包名相同的JAR文件和目录.chrome URL和JAR文件之间的对应关系由chrome目录中的'清单'(manifest)文件来指定。如果你把messenger.jar移动到别的地方,并相应地更新'清单'文件中的信息,Thunderbird(译者注:此处Thunderbird是上文中提到的messenger)仍然能够正确工作,因为它不依赖特定的安装位置。利用chrome URL我们可以脱离Mozilla中例如包的位置等细节信息。类似地,如果用户改变了主题,'skin'部分的chrome URL实际所指向的就是另外的一套文件,但XUL和脚本无需改变。</p>
-<p>下面是更多的示例。注意例子中URL是如何避免指定使用某个特定的主题或者语言,以及如何避免指定特定目录的。</p>
-<table>
- <tbody>
- <tr>
- <td>
- <pre>
-chrome://messenger/content/messenger.xul
-chrome://messenger/content/attach.js
-chrome://messenger/skin/icons/folder-inbox.png
-chrome://messenger/locale/messenger.dtd
-</pre>
- </td>
- </tr>
- </tbody>
-</table>
-<p>要关联到子目录,你只要在chrome URL的最后加上目录名就可以。下面的这些URL关联到bookmarks窗口,这里列出来了适合Mozilla和Firefox的版本——因为两者软件包的名字有差异:</p>
-<table>
- <tbody>
- <tr>
- <td>
- <pre>
-chrome://communicator/content/bookmarks/bookmarksManager.xul (Mozilla)
-chrome://browser/content/bookmarks/bookmarksManager.xul (Firefox)
-</pre>
- </td>
- </tr>
- </tbody>
-</table>
-<p>chrome URL在任何普通URL可以使用地方一样能用,甚至你可以在Mozilla的浏览器窗口(译者注:地址栏)中直接输入。当在浏览器地址栏中输入上面提到的URL之一,你会发现窗口会像网页一样显示出来,而且大多数功能和在单独的窗口一样可以正常使用。但是,有些对话框可能工作不正常,那可能是因为需要由父窗口在打开他们的时候传递一些参数。</p>
-<p>你还将会遇到不带文件名的chrome URL,比如:</p>
-<table>
- <tbody>
- <tr>
- <td>
- <pre>
-chrome://browser/content/</pre>
- </td>
- </tr>
- </tbody>
-</table>
-<p>这种情况只有给出了包名和模块名。这类的引用(关联)会自动从目录中选择一个合适的文件。对于content来说,与包同名并带有.xul后缀的文件会被选中。在上面的例子中,显示的会是'browser.xul'。对于messenger包,messenger.xul会被显示。当你创建自己的包时,你需要为你的主窗口创建一个和软件包同名的文件,这样它就能被上面这种短形式的URL关联。这样带来的便利是只要用户知道包的名字,他就能打这个应用程序。当然了,对于修改浏览器界面的扩展(extensions)来说,用户不需要知道URL,因为扩展通过用户界面来显示自身。</p>
-<p>对于皮肤而言,包名.css被选中;对于语言,选中的是包名.dtd。</p>
-<p>需要记住的是,chrome URL与它在磁盘上的位置无关。URL的第一部分两个元素是包名和模块(content,skin或locale)。将内容文件放在叫'content'的目录是很普遍的事情,这和惯例不符,这些文件会被放在一个完全不同的结构中。</p>
-<hr>
-<p>(<a href="/cn" title="cn">下一部分</a>) 在接下来的部分,我们将看看如何创建'清单'(manifest)文件和包。</p>
-<div>
- <a href="/cn/XUL_%E6%95%99%E7%A8%8B/XUL%E7%9A%84%E7%BB%93%E6%9E%84" title="cn/XUL_教程/XUL的结构">&lt;&lt; 前页</a> <a href="/cn/XUL_%E6%95%99%E7%A8%8B/%E5%85%B3%E4%BA%8EContents.rdf" title="cn/XUL_教程/关于Contents.rdf">后页 &gt;&gt;</a></div>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/toolbars/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/toolbars/index.html
deleted file mode 100644
index 4ba0a4e2e3..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/toolbars/index.html
+++ /dev/null
@@ -1,101 +0,0 @@
----
-title: XUL_教程/工具栏
-slug: Mozilla/Tech/XUL/Tutorial/Toolbars
-tags:
- - XUL_Tutorial
-translation_of: Archive/Mozilla/XUL/Tutorial/Toolbars
----
-<p> </p>
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Splitters" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Simple_Menu_Bars">下一页 »</a></p>
-</div><p></p>
-<p>工具栏通常沿着窗口顶部放置,并包含许多完成普通功能的按钮。XUL有一个创建工具栏的方法。</p>
-<p>A toolbar is usually placed along the top of a window and contains a number of buttons that perform common functions. XUL has a method to create toolbars.</p>
-<p><br>
- 工具栏</p>
-<p>Like a number of elements, XUL toolbars are a type of box.像许多的界面要素, XUL工具栏也是一种界面框。 Usually, a row of buttons would appear in the toolbar, but any element can be placed in a toolbar.通常,工具栏里会出现一排按钮,但任何界面要素都可以放到工具栏里。 For example, the Mozilla browser window contains a textbox that displays the page URL.举例来说, mozilla浏览器窗口包含一个文本框 ,显示了该网页的url 。</p>
-<p>Toolbars may be placed on any side of the window, either horizontally or vertically.工具栏可被水平或垂直地放置在窗口的任一边。 Of course you wouldn't normally put a textbox in a vertical toolbar.当然,通常你不会把文本框放在一个垂直工具栏里。 Actually, because toolbars are just boxes they can actually go anywhere you want, even in the middle of a window.事实上,因为工具栏只是个界面框,它们能去你想要它们去的任何地方,即使是窗口的中间。 Typically however, a set of toolbars would appear along the top of a window.通常,一组工具栏会出现在窗口的顶部。 When more than one toolbar is placed next to each other, they are typically grouped together in something called a 'toolbox'.当多个工具栏一个接一个放置时,他们通常被一个叫做'工具箱'的东西集合在一起。 [ edit ] A simple toolbar inside a toolbox [编辑] 一个简单的工具栏里面一个工具箱</p>
-<p>Source View 来源 查看 形象: toolbar1.jpg</p>
-<pre class="eval">&lt;toolbox&gt; &lt;toolbar id="nav-toolbar"&gt; &lt;toolbarbutton label="Back"/&gt; &lt;toolbarbutton label="Forward"/&gt; &lt;/toolbar&gt; &lt;/toolbox&gt; &lt;工具箱&gt; &lt;toolbar id="nav-toolbar"&gt; &lt;toolbarbutton label="back"/&gt; &lt;toolbarbutton label="forward"/&gt; &lt; /工具栏&gt; &lt; /工具箱&gt;
-</pre>
-<p>This has created a toolbar containing two buttons, a Back button and a Forward button.这就造成了一种工具列载有两个按钮,有一个备份(后退)按钮和前进按钮。 The one toolbar has been placed inside the toolbox.在一个工具栏已被置于内工具箱。 This has involved four new tags, which are described here.这涉及到4个新的标签,这是形容这里。</p>
-<p>toolbox 工具箱</p>
-<pre class="eval"> A box that contains toolbars.一个方框,其中包含工具栏。
-</pre>
-<p>toolbar 工具栏</p>
-<pre class="eval"> A single toolbar that contains toolbar items such as buttons.一个单一的工具栏包含了工具栏的项目,如按钮。
-</pre>
-<p>toolbarbutton toolbarbutton</p>
-<pre class="eval"> A button on a toolbar, which has all the same features of a regular button but is usually drawn differently.一个按钮,一个工具条,其中已全部一样的特点,定期按钮,但通常是取用不同。
-</pre>
-<p>The toolbar is the main element that creates the actual toolbar. 该工具是主要因素,造成了实际的工具栏。 Inside it are placed the individual toolbar items, usually buttons, but they can be other elements.它里面放置了个人工具栏的项目,通常是按钮,但是它们可以被其他元素。</p>
-<p>In the example above, only one toolbar was created.在上面的例子中,只有一个工具栏被创建。 Multiple toolbars can be created just as easily by adding more toolbar elements after the first one.更多工具栏的创建就想在第一个工具栏中添加元素一样容易。</p>
-<p>The toolbox is a container for toolbars. 工具箱是一个容器工具栏。 In some applications, you will have several toolbars along the top of the window.在某些应用中,你将有几个工具栏沿顶部的窗口。 You can put them all inside a toolbox .你可以把它们都内一个工具箱。</p>
-<p>You do not have to put toolbar elements inside a toolbox .你不须要把工具栏的内容里面一个工具箱。 [ edit ] Our find files example [编辑] 我们找到档案为例</p>
-<p>Let's add a toolbar to the find files dialog.让我们添加一个工具栏,向找到的文件对话框。 We don't really need one but we'll add one anyway to demonstrate its use.我们并不真的需要一个,但我们将增加一个无论如何,以证明其使用。 Two buttons will be added, an Open button and a Save button.两个按钮将被增加,一个打开按钮和一个储存按钮。 Presumably, they would allow the user to save search results and re-open them later.据推测,它们将使用户能够保存搜寻结果,或重新打开。</p>
-<pre class="eval">&lt;vbox flex="1"&gt; &lt;toolbox&gt; &lt;toolbar id="findfiles-toolbar"&gt; &lt;toolbarbutton id="opensearch" label="Open"/&gt; &lt;toolbarbutton id="savesearch" label="Save"/&gt; &lt;/toolbar&gt; &lt;/toolbox&gt; &lt;tabbox&gt; &lt; vbox挠性= " 1 " &gt; &lt;toolbox&gt; &lt;toolbar id="findfiles-toolbar"&gt; &lt;toolbarbutton id="opensearch" label="open"/&gt; &lt;toolbarbutton id="savesearch" label="save"/&gt; &lt; /工具栏&gt; &lt; /工具箱&gt; &lt;tabbox&gt;
-</pre>
-<p>形象: toolbar5.png</p>
-<p>A toolbar with two buttons has been added here.工具栏上有两个按钮已被添加在这里。 In the image, you can see them appear horizontally along the top.在图像,你可以看到他们出现横向沿顶部。 Notice that the toolbar has been placed inside the vertical box just above the tabbox.公告说,该工具已被置于内垂直票房略高于tabbox 。 This is because we need the vertical orientation so that the toolbar will appear above everything else.这是因为,我们需要的垂直方向,使该工具栏将出现高于一切。</p>
-<p>The find files example so far: Source View这一发现的档案为例,目前为止:源观</p>
-<p>Next, we'll find out how to add a menu bar to a window .明年,我们将看看如何添加一个菜单栏,以一个窗口 。</p>
-<p> </p>
-<h3 id="Adding_a_Toolbar" name="Adding_a_Toolbar">Adding a Toolbar</h3>
-<p>Like a number of elements, XUL toolbars are a type of box. Usually, a row of <a href="cn/XUL_Tutorial/Adding_Buttons">buttons</a> would appear in the toolbar, but any element can be placed in a toolbar. For example, the Mozilla browser window contains a <a href="cn/XUL_Tutorial/Input_Controls#Text_Entry_Fields">textbox</a> that displays the page URL.</p>
-<p>Toolbars may be placed on any side of the window, either horizontally or vertically. Of course you wouldn't normally put a textbox in a vertical toolbar. Actually, because toolbars are just boxes they can actually go anywhere you want, even in the middle of a window. Typically however, a set of toolbars would appear along the top of a window. When more than one toolbar is placed next to each other, they are typically grouped together in something called a 'toolbox'.</p>
-<h5 id="A_simple_toolbar_inside_a_toolbox" name="A_simple_toolbar_inside_a_toolbox">A simple <code>toolbar</code> inside a <code>toolbox</code></h5>
-<p><a href="https://developer.mozilla.org/samples/xultu/examples/ex_toolbar_1.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_toolbar_1.xul">View</a></p>
-<div class="float-right">
- <img alt="Image:toolbar1.jpg"></div>
-<pre>&lt;toolbox&gt;
- &lt;toolbar id="nav-toolbar"&gt;
- &lt;toolbarbutton label="Back"/&gt;
- &lt;toolbarbutton label="Forward"/&gt;
- &lt;/toolbar&gt;
-&lt;/toolbox&gt;
-</pre>
-<p>This has created a toolbar containing two buttons, a Back button and a Forward button. The one toolbar has been placed inside the toolbox. This has involved four new tags, which are described here.</p>
-<dl>
- <dt>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbox" title="toolbox">toolbox</a></code></dt>
- <dd>
- A box that contains toolbars.</dd>
-</dl>
-<dl>
- <dt>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbar" title="toolbar">toolbar</a></code></dt>
- <dd>
- A single toolbar that contains toolbar items such as buttons.</dd>
-</dl>
-<dl>
- <dt>
- <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbarbutton" title="toolbarbutton">toolbarbutton</a></code></dt>
- <dd>
- A button on a toolbar, which has all the same features of a regular button but is usually drawn differently.</dd>
-</dl>
-<p>The <code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbar" title="toolbar">toolbar</a></code></code> is the main element that creates the actual toolbar. Inside it are placed the individual <code>toolbar</code> items, usually buttons, but they can be other elements.</p>
-<p>In the example above, only one toolbar was created. Multiple toolbars can be created just as easily by adding more <code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbar" title="toolbar">toolbar</a></code></code> elements after the first one.</p>
-<p>The <code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbox" title="toolbox">toolbox</a></code></code> is a container for toolbars. In some applications, you will have several toolbars along the top of the window. You can put them all inside a <code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/toolbox" title="toolbox">toolbox</a></code></code>.</p>
-<p>You do not have to put <code>toolbar</code> elements inside a <code>toolbox</code>.</p>
-<div class="highlight">
- <h4 id="Our_find_files_example" name="Our_find_files_example">Our find files example</h4>
- <p>Let's add a toolbar to the find files dialog. We don't really need one but we'll add one anyway to demonstrate its use. Two buttons will be added, an Open button and a Save button. Presumably, they would allow the user to save search results and re-open them later. <code> </code></p>
- <pre class="eval">&lt;vbox flex="1"&gt;
- <span class="highlightblue">&lt;toolbox&gt;
- &lt;toolbar id="findfiles-toolbar"&gt;
- &lt;toolbarbutton id="opensearch" label="Open"/&gt;
- &lt;toolbarbutton id="savesearch" label="Save"/&gt;
- &lt;/toolbar&gt;
- &lt;/toolbox&gt;</span>
- &lt;tabbox&gt;
-</pre>
- <p> </p>
- <div>
- <img alt="Image:toolbar5.png"></div>
- <p>A toolbar with two buttons has been added here. In the image, you can see them appear horizontally along the top. Notice that the toolbar has been placed inside the vertical box just above the tabbox. This is because we need the vertical orientation so that the toolbar will appear above everything else.</p>
- <p>The find files example so far: <a href="https://developer.mozilla.org/samples/xultu/examples/findfile/findfile-toolbar.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/findfile/findfile-toolbar.xul">View</a></p>
-</div>
-<p>Next, we'll find out how to add a <a href="cn/XUL_Tutorial/Simple_Menu_Bars">menu bar to a window</a>.</p>
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Splitters" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Simple_Menu_Bars">下一页 »</a></p>
-</div><p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/trees/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/trees/index.html
deleted file mode 100644
index 6162b31e6a..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/trees/index.html
+++ /dev/null
@@ -1,8 +0,0 @@
----
-title: 树结构
-slug: Mozilla/Tech/XUL/Tutorial/Trees
-translation_of: Archive/Mozilla/XUL/Tutorial/Trees
----
-<p>XUL提一种供用树的形式而创建表格或是分层结构的列表。</p>
-<h2 id="树">树</h2>
-<p>在XUL中树是个很复杂的元素。它用于有层次需求的结构来显示行列中的文本。树允许用户对某行进行排序、调整、隐藏等操作。比如火狐中的书签项和雷鸟邮箱结构都是用树做成的。</p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/using_spacers/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/using_spacers/index.html
deleted file mode 100644
index 7501f87216..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/using_spacers/index.html
+++ /dev/null
@@ -1,111 +0,0 @@
----
-title: XUL_教程/使用定位格
-slug: Mozilla/Tech/XUL/Tutorial/Using_Spacers
-tags:
- - XUL_教程
-translation_of: Archive/Mozilla/XUL/Tutorial/Using_Spacers
----
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Adding_HTML_Elements" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:More_Button_Features">下一页 »</a></p>
-</div><p></p>
-<p> </p>
-<h3 id=".E6.B7.BB.E5.8A.A0.E5.AE.9A.E4.BD.8D.E6.A0.BC" name=".E6.B7.BB.E5.8A.A0.E5.AE.9A.E4.BD.8D.E6.A0.BC">添加定位格</h3>
-<p>开发用户界面的问题之一是每个用户都有不同的显示器。一些用户使用较高分辨率的较大显示器而另外一些用户使用的是较低分辨率的。另外,不同的平台对用户界面的也不同。如果加上多语言支持,每种语言之间用到的文字的需要的显示空间也不一样。</p>
-<p>应用程序的窗口通常需要考虑支持多平台和多语言。某些平台和用户接口工具提供组件让用户可以轻易地去调整适合他们自己的大小和位置。(例如Java平台使用布局管理器。)</p>
-<p>XUL为元素提供能力自动调整位置和大小。 就像我们看到的文件查找窗口的尺寸是刚好能将元素放在它里面。每次我们增中一些东西,窗口就会变得更大。</p>
-<p>XUL使用一个叫做“箱状模型”(Box Model)的布局系统。我们将在<a href="/cn/XUL_教程/箱状模型" title="cn/XUL_教程/箱状模型">下一节</a>中讲到。它允许你将一个窗口划分成连续的盒子存放元素。盒子可以基于你定义的规格调整位置和大小。到现在,可以知道 <code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/window" title="window">window</a></code></code> 元素是属于盒子的类型。</p>
-<p>在了解什么是盒子之前,我们将引入其他用于布局的XUL元素,<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/spacer" title="spacer">spacer</a></code></code>。定位格很简单,它只需要一个属性,稍后将会说明。一个简单的定位格看起来就像下面:</p>
-<pre class="eval">&lt;spacer flex="1"/&gt;
-</pre>
-<p><code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/spacer" title="spacer">spacer</a></code></code>用于在窗口中放置一片空白。它多数用于用户调整窗口大小时它可以拉伸或者收缩。 这将决定是将按钮放置在一个窗口的左边或底边还是放在右边或底边 。将要看到,你可以使用一连串的空格去创建许多布局效果。</p>
-<p>上面这个语法中,定位格有一个属性,叫做<code><code id="a-flex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/flex">flex</a></code></code>。这用于定义定位格的弹性。在上面的例子中,定位格为1的弹性。这会创建一个有<em>弹力</em>的定位格。如果你直接将它放在窗口里,这个定位格会在窗口的大小被改变时自动伸缩。</p>
-<p>马上我们将会把一个定位格添加到我们的文件查找例子中。首先,让我们看一下当调整当前对话框时会发生什么。</p>
-<p><img alt="Image:springs1.jpg" class="internal" src="/@api/deki/files/2683/=Springs1.jpg"></p>
-<p>如果你改变文件查找窗口的尺寸,你会看到所有的元素都保持着它们原来的位置。它们中没有一个移动或调整了大小虽然窗口里有更多的空间。让我们再看一下当增加了一个定位格后在文本输入框和查找按钮之间发生了什么。</p>
-<p><img alt="Image:springs2.jpg" class="internal" src="/@api/deki/files/2684/=Springs2.jpg"></p>
-<p>在添加了定位格后再调整窗口的大小时,你可以看到定位格填充了空白。按钮被推到了最后面。</p>
-<div class="highlight">
- <h5 id=".E6.88.91.E4.BB.AC.E6.96.87.E4.BB.B6.E6.9F.A5.E6.89.BE.E7.9A.84.E4.BE.8B.E5.AD.90" name=".E6.88.91.E4.BB.AC.E6.96.87.E4.BB.B6.E6.9F.A5.E6.89.BE.E7.9A.84.E4.BE.8B.E5.AD.90">我们文件查找的例子</h5>
- <p>下面的代码增加一个定位格。把它插入到查找按钮的前面。</p>
- <pre class="eval"><span class="highlightred">&lt;spacer flex="1"/&gt;</span>
-
-&lt;button id="find-button" label="Find"/&gt;
-</pre>
-</div>
-<h3 id=".E5.85.B3.E4.BA.8E.E5.BC.B9.E6.80.A7.E7.9A.84.E6.9B.B4.E5.A4.9A.E4.BF.A1.E6.81.AF" name=".E5.85.B3.E4.BA.8E.E5.BC.B9.E6.80.A7.E7.9A.84.E6.9B.B4.E5.A4.9A.E4.BF.A1.E6.81.AF">关于弹性的更多信息</h3>
-<p>XUL在窗口中放置有弹性元素是通过计算元素合适的宽度和高度然后再添加空间。除非你指定元素的宽度和高度信息,元素的内容就决定了它的默认大小。你需要注意在对话框中的取消按钮总是设置了宽度因此它能在它里面放文字。如果你创建一个具有非常长的标签的按钮,按钮的默认大小将会很大使得有足够的空间可以放下标签。其它的元素,像是文本输入框会选择一个合适的默认大小。</p>
-<p><code>flex</code>属性用于指定元素可以改变自身的尺寸去填充它所在的盒子 (在这个例子中的窗口)。我们已经看到了应用于定位格的弹性属性,但它是可以应用于所有的元素的。例如,你可以改成能自动调整大小的查找按钮。</p>
-<p><img alt="Image:springs3.jpg" class="internal" src="/@api/deki/files/2685/=Springs3.jpg"></p>
-<p>如图所示,在查找按钮上增中了弹性属性,在窗口进行大小调整时它也会跟着调整。定位格实际上是没有指定任何东西。它实际上就是一个隐藏的按钮。它除了不会在屏幕上显示外大部分的使用方法就是和按钮一样的。</p>
-<p>你可以从上面的图片得到更多的提示。不仅是在查找按钮的尺寸增大了,而且在主标签和按钮之间显示了更多的空间。当然,这是我们之前放进去的定位格。它也调整了自己的尺寸。如果你更深入地观察,你会注意到在定位格和按钮之间分到的尺寸改变值是相等的。定位格拿到了一半的空余空间,按钮拿到了另外一半。</p>
-<p>我们看到这个效果是因为定位格和查找按钮都使用了 <code>flex</code> 属性。因为都是可伸缩的,按钮和定位格的尺寸调整是相等的。</p>
-<p>如果你想设置一个元素是另一个的两倍大小要怎么做呢?你可以给<code>flex</code>属性设一个更高的值。弹性元素的值是一个概率。如果一个元素的弹性值为1而另一个的弹性值是2,第二个比第一个大多少倍。在效果上,一个弹性为2说的是这个元素有一个弹性是二次的元素弹性增长。</p>
-<p><code>flex</code>属性不能用来指定一个真实的尺寸。作为替换,它说明在一个盒容器的子容器中填入多少的空白空间。我们将在下节看到盒子。一旦子盒的默认尺寸被指定,弹性值就被用于在对盒子中剩余的空白空间进行分割。例如,如果一个盒子有200像素宽并且包括2个可伸缩的按钮,第一个是50像素和另外一个是90像素,在它们的外面将还会有60像素的空白空间。如果两个按钮都有弹性的值为1,空白空间将会被分配给每个按钮伸缩长度为30像素。如果第二个按钮的弹性增加到2,第一个按钮将得到20像素的扩展空间,而第二个按钮将得到40像素的扩展空间。</p>
-<p><code>flex</code>属性可以被放在任何元素,但是当它直接放在XUL元素里面时就只有一个意思。意思是说即使你可以把<code>flex</code>放在HTML元素中,如果元素不是一个非盒元素它就得不到效果。</p>
-<h5 id=".E5.BC.B9.E6.80.A7.E4.BE.8B.E5.AD.90" name=".E5.BC.B9.E6.80.A7.E4.BE.8B.E5.AD.90">弹性例子</h5>
-<pre class="eval">例1:
- &lt;button label="Find" flex="1"/&gt;
- &lt;button label="Cancel" flex="1"/&gt;
-
-例2:
- &lt;button label="Find" flex="1"/&gt;
- &lt;button label="Cancel" flex="10"/&gt;
-
-例3:
- &lt;button label="Find" flex="2"/&gt;
- &lt;button label="Replace"/&gt;
- &lt;button label="Cancel" flex="4"/&gt;
-
-例4:
- &lt;button label="Find" flex="2"/&gt;
- &lt;button label="Replace" flex="2"/&gt;
- &lt;button label="Cancel" flex="3"/&gt;
-
-例5:
- &lt;html:div&gt;
- &lt;button label="Find" flex="2"/&gt;
- &lt;button label="Replace" flex="2"/&gt;
- &lt;/html:div&gt;
-
-例6:
- &lt;button label="Find" flex="145"/&gt;
- &lt;button label="Replace" flex="145"/&gt;
-</pre>
-<dl>
- <dt>
- 例1 </dt>
- <dd>
- 在这个例子中两个按钮平均分配弹性值。两个按钮的将会被平均地改变大小。</dd>
- <dt>
- 例2 </dt>
- <dd>
- 这,两个按钮都是可伸缩的,但查找按钮的伸展率是取消按钮的十分之一,因为取消按钮的弹性值为10,可用的空间被分割成查找按钮的一份和取消按钮的十分。</dd>
- <dt>
- 例3 </dt>
- <dd>
- 这里只有其中的两个按钮设置为可弹性。替换按钮将不会改变它的尺寸而另外两个会。 取消按钮将会比查找按钮大一倍因为它的弹性值是查找按钮的弹性值的二倍。</dd>
- <dt>
- 例4 </dt>
- <dd>
- 在这个例子,三个按钮都具有可弹性。查找和替换按钮的尺寸将是相同的,但取消按钮会更大一些(多50%的扩展)。</dd>
- <dt>
- 例5 </dt>
- <dd>
- 这里,两个按钮都放在<code>div</code>元素里面。按钮不是放在盒子里所以可申缩性在这里是无意义的。效果和没有使用<code>flex</code>属性是相同的。</dd>
- <dt>
- 例6 </dt>
- <dd>
- 因为两个按钮的弹性值是一样的,他们将得到相同的弹性。这样还不如用1来代替145。在这个例子中没有什么不同。建议你使用可读性更好的低数值。</dd>
-</dl>
-<p>注意像按钮的标签和按钮的最小尺寸等其他的因素会影响到按钮的尺寸。事实上,按钮不会收缩到比它的标签还小。</p>
-<p>将弹性值设为0与没有设置<code>flex</code>属性的效果是一样的。它的意思是元素不使用弹性。你有时可以看到弹性值会指定为一个百分率。这没有特殊的意义,这已经是处理过的就算没有百分号在那里。</p>
-<p>你也许注意到在你垂直改变查找对话框的尺寸时,按钮也会调整它自己的尺寸去适应窗口的高度。这是因为所有在窗口中的按钮都有隐含的垂直弹性。在下一节我们将会学习如何去改变这个值。</p>
-<div class="highlight">
- <h5 id=".E5.88.B0.E7.9B.AE.E5.89.8D.E4.B8.BA.E6.AD.A2.E7.9A.84.E6.96.87.E4.BB.B6.E6.9F.A5.E6.89.BE.E4.BE.8B.E5.AD.90" name=".E5.88.B0.E7.9B.AE.E5.89.8D.E4.B8.BA.E6.AD.A2.E7.9A.84.E6.96.87.E4.BB.B6.E6.9F.A5.E6.89.BE.E4.BE.8B.E5.AD.90">到目前为止的文件查找例子</h5>
- <p><a href="https://developer.mozilla.org/samples/xultu/examples/findfile/findfile-springs.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/findfile/findfile-springs.xul">View</a></p>
-</div>
-<p>接下来,我们将要学习 <a href="/cn/XUL_教程/更多按钮特性" title="cn/XUL_教程/更多按钮特性">按钮的更多特性</a>。</p>
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Adding_HTML_Elements" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:More_Button_Features">下一页 »</a></p>
-</div><p></p>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/using_xbl_from_stylesheets/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/using_xbl_from_stylesheets/index.html
deleted file mode 100644
index 04c8ab7123..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/using_xbl_from_stylesheets/index.html
+++ /dev/null
@@ -1,223 +0,0 @@
----
-title: 通过CSS和XBL创建可复用的内容
-slug: Mozilla/Tech/XUL/Tutorial/Using_XBL_from_stylesheets
-translation_of: Archive/Beginner_tutorials/Using_XBL_from_stylesheets
----
-<p></p><section id="Quick_Links">
-<ol><li><a href="/zh-CN/docs/Web/Guide/CSS/Getting_Started/What_is_CSS">What is CSS?</a></li>
- <li><a href="/zh-CN/docs/Web/Guide/CSS/Getting_Started/Why_use_CSS">Why use CSS?</a></li>
- <li><a href="/zh-CN/docs/Web/Guide/CSS/Getting_Started/How_CSS_works">How CSS works</a></li>
- <li><a href="/zh-CN/docs/Web/Guide/CSS/Getting_Started/Cascading_and_inheritance">Cascading and inheritance</a></li>
- <li><a href="/zh-CN/docs/Web/Guide/CSS/Getting_Started/Selectors">Selectors</a></li>
- <li><a href="/zh-CN/docs/Web/Guide/CSS/Getting_Started/Readable_CSS">Readable CSS</a></li>
- <li><a href="/zh-CN/docs/Web/Guide/CSS/Getting_Started/Text_styles">Text styles</a></li>
- <li><a href="/zh-CN/docs/Web/Guide/CSS/Getting_Started/Color">Color</a></li>
- <li><a href="/zh-CN/docs/Web/Guide/CSS/Getting_Started/Content">Content</a></li>
- <li><a href="/zh-CN/docs/Web/Guide/CSS/Getting_Started/Lists">Lists</a></li>
- <li><a href="/zh-CN/docs/Web/Guide/CSS/Getting_Started/Boxes">Boxes</a></li>
- <li><a href="/zh-CN/docs/Web/Guide/CSS/Getting_Started/Layout">Layout</a></li>
- <li><a href="/zh-CN/docs/Web/Guide/CSS/Getting_Started/Tables">Tables</a></li>
- <li><a href="/zh-CN/docs/Web/Guide/CSS/Getting_Started/Media">Media</a></li>
- <li><a href="/zh-CN/docs/Web/Guide/CSS/Getting_Started/JavaScript">JavaScript and CSS</a></li>
- <li><a href="/zh-CN/docs/Web/Guide/CSS/Getting_Started/SVG_and_CSS">SVG and CSS</a></li>
- <li><a href="/zh-CN/docs/Web/Guide/CSS/Getting_Started/XML_data">XML data</a></li>
- <li><a href="/zh-CN/docs/Web/Guide/CSS/Getting_Started/XBL_bindings">XBL binding</a></li>
- <li><a href="/zh-CN/docs/Web/Guide/CSS/Getting_Started/XUL_user_interfaces">XUL user interfaces</a></li>
-</ol>
-</section><p></p>
-
-<p>本页面介绍了如何在Mozilla中使用CSS来提升在复杂应用结构中的代码与资源的复用。</p>
-
-<div class="note">
-<p>提示:XBL不能通过HTTP来加载,所以XBL只能使用file:///scheme或者通过附加代码的方式进行本地访问。</p>
-</div>
-
-<p>你可以应用这项技术于一个简单的示例。</p>
-
-<h3 id="Information:_XBL_bindings" name="Information:_XBL_bindings">Information: XBL bindings</h3>
-
-<p>由标记语言和CSS提供的这个结构并不适用于组件需要自包含和复用的复杂应用。你可以将样式表(stylesheet)和脚本(script)放置在独立的文件中。但是你必须将这些文件加载到文档(html)中,最后形成一个整体。</p>
-
-<p>另一个结构上的限制则与内容有关。你可以使用CSS为选中的元素提供内容,但是内容限定在文本和图片,并且内容的位置只能是选中的元素前或者后。</p>
-
-<p>Mozilla provides a mechanism that overcomes these limitations: <em>XBL</em> (XML Bindings Language). You can use XBL to link selected elements to their own:</p>
-
-<p>Mozilla提供了一个机制来克服上述限制:XBL(XML Bindings Language)。</p>
-
-<ul>
- <li>Stylesheets</li>
- <li>Content</li>
- <li>Properties and methods</li>
- <li>Event handlers</li>
-</ul>
-
-<p>因此你可以避免在文档中链接每一个组件,你可以使用自包含的组件来方便维护和复用。</p>
-
-<table style="background-color: rgb(244, 244, 244); border: 1px solid rgb(51, 102, 187); margin-bottom: 1em; padding: 1em; width: 100%;">
- <caption>More details</caption>
- <tbody>
- <tr>
- <td>For more information about XBL bindings, see the <a href="/en-US/docs/XBL" title="en/XBL">XBL</a> page in this wiki.</td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="Action:_An_XBL_demonstration" name="Action:_An_XBL_demonstration">Action: An XBL demonstration</h3>
-
-<p>创建一个新的html文档,doc6.html。将下面的内容拷贝到文件中:</p>
-
-<div style="width: 56em;">
-<pre class="brush: html">&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"&gt;
-&lt;HTML&gt;
-
-&lt;HEAD&gt;
-&lt;TITLE&gt;Mozilla CSS Getting Started - XBL demonstration&lt;/TITLE&gt;
-&lt;LINK rel="stylesheet" type="text/css" href="style6.css"&gt;
-&lt;/HEAD&gt;
-
-&lt;BODY&gt;
-&lt;H1&gt;XBL demonstration&lt;/H1&gt;
-&lt;DIV id="square"&gt;Click Me&lt;/DIV&gt;
-&lt;/BODY&gt;
-
-&lt;/HTML&gt;
-</pre>
-</div>
-
-<p>创建一个新的CSS文件,style6.css。这个样式表包含了文档的样式。将下面的内容拷贝到CSS文件中:</p>
-
-<div style="width: 56em;">
-<pre class="brush: css">/*** XBL demonstration ***/
-#square {
- -moz-binding: url("square.xbl#square");
- }
-</pre>
-</div>
-
-<p>Make a new text file, <code>square.xbl</code>. This file contains the XBL binding. Copy and paste the content from here:</p>
-
-<p>创建一个新的文本文件,square.xbl。这个文件包含了XBL的绑定关系。将下面的内容拷贝到文件中。</p>
-
-<div style="">
-<pre class="brush: xml">&lt;?xml version="1.0"?&gt;
-&lt;!DOCTYPE bindings&gt;
-&lt;bindings xmlns="http://www.mozilla.org/xbl"
- xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- xmlns:html="http://www.w3.org/1999/xhtml"&gt;
-
-&lt;binding id="square"&gt;
-
- &lt;resources&gt;
- &lt;stylesheet src="bind6.css"/&gt;
- &lt;/resources&gt;
-
- &lt;content&gt;
- &lt;html:div anonid="square"/&gt;
- &lt;xul:button anonid="button" type="button"&gt;
- &lt;children/&gt;
- &lt;/xul:button&gt;
- &lt;/content&gt;
-
- &lt;implementation&gt;
-
- &lt;field name="square"&gt;&lt;![CDATA[
- document.getAnonymousElementByAttribute(this, "anonid", "square")
- ]]&gt;&lt;/field&gt;
-
- &lt;field name="button"&gt;&lt;![CDATA[
- document.getAnonymousElementByAttribute(this, "anonid", "button")
- ]]&gt;&lt;/field&gt;
-
- &lt;method name="doDemo"&gt;
- &lt;body&gt;&lt;![CDATA[
- this.square.style.backgroundColor = "#cf4"
- this.square.style.marginLeft = "20em"
- this.button.setAttribute("disabled", "true")
- setTimeout(this.clearDemo, 2000, this)
- ]]&gt;&lt;/body&gt;
- &lt;/method&gt;
-
- &lt;method name="clearDemo"&gt;
- &lt;parameter name="me"/&gt;
- &lt;body&gt;&lt;![CDATA[
- me.square.style.backgroundColor = "transparent"
- me.square.style.marginLeft = "0"
- me.button.removeAttribute("disabled")
- ]]&gt;&lt;/body&gt;
- &lt;/method&gt;
-
- &lt;/implementation&gt;
-
- &lt;handlers&gt;
- &lt;handler event="click" button="0"&gt;&lt;![CDATA[
- if (event.originalTarget == this.button) this.doDemo()
- ]]&gt;&lt;/handler&gt;
- &lt;/handlers&gt;
-
- &lt;/binding&gt;
-
-&lt;/bindings&gt;
-</pre>
-</div>
-
-<p>Make a new CSS file, <code>bind6.css</code>. This separate stylesheet contains style for the binding. Copy and paste the content from here:</p>
-
-<p>创建一个新的CSS文件,bind6.css。这个独立的样式表包含了</p>
-
-<div style="width: 56em;">
-<pre class="brush: css">/*** XBL demonstration ***/
-[anonid="square"] {
- width: 20em;
- height: 20em;
- border: 2px inset gray;
- }
-
-[anonid="button"] {
- margin-top: 1em;
- padding: .5em 2em;
- }
-</pre>
-</div>
-
-<p>在你的浏览器中打开文档然后按下按钮。</p>
-
-<p>这个维基页面并不支持JavaScript,所以无法再这里展示示例。示例看上去就如下面所示,分别是按下按钮之前和之后的效果。</p>
-
-<table>
- <tbody>
- <tr>
- <td><img alt="xbldemo0.png" class="default internal" src="/@api/deki/files/3377/=xbldemo0.png" style="height: 224px; width: 322px;"></td>
- <td><img alt="xbldemo1.png" class="default internal" src="/@api/deki/files/3378/=xbldemo1.png" style="height: 224px; width: 322px;"></td>
- </tr>
- </tbody>
-</table>
-
-<p>关于这个示例的提示:</p>
-
-<ul>
- <li>这个html文档如通常一样链接文档样式表,但是并没有链接任何JavaScript代码。</li>
- <li>这个文档中并没有包含任何按钮。它只包含了按钮标签的文本。这个按钮通过绑定来添加。</li>
- <li>这个文档样式表链接了绑定文件。</li>
- <li>这个绑定文件链接了它自己的样式表,并且提供了它自己的内容和JavaScript代码。所以绑定文件是自包含的。</li>
-</ul>
-
-<p>挑战</p>
-
-<table style="background-color: rgb(255, 255, 244); border: 1px solid rgb(51, 102, 187); margin-bottom: 0.5em; padding: 1em;">
- <caption> </caption>
- <tbody>
- <tr>
- <td>Change the XBL file so that the square doubles in width when it changes color, instead of jumping to the right.
- <p>Use the DOM Inspector tool to inspect the document, revealing the added content.</p>
-
- <p> </p>
- </td>
- </tr>
- </tbody>
-</table>
-
-<h3 id="What_next">What next?</h3>
-
-<p>If you had difficulty understanding this page, or if you have other comments about it, please contribute to its <a href="/Talk:en/CSS/Getting_Started/XBL_bindings" title="Talk:en/CSS/Getting_Started/XBL_bindings">Discussion</a> page.</p>
-
-<p>In this demonstration, the square and the button make a self-contained <em>widget</em> that functions within an HTML document. Mozilla has a specialized markup language for creating user interfaces. The next page demonstrates it: <strong><a href="/en/CSS/Getting_Started/XUL_user_interfaces" title="en/CSS/Getting_Started/XUL_user_interfaces">XUL user interfaces</a></strong>.</p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/xbl介绍/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/xbl介绍/index.html
deleted file mode 100644
index 6b6ef8288e..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/xbl介绍/index.html
+++ /dev/null
@@ -1,104 +0,0 @@
----
-title: XUL 教程
-slug: Mozilla/Tech/XUL/Tutorial/XBL介绍
-tags:
- - XBL
-translation_of: Archive/Mozilla/XUL/Tutorial/Introduction_to_XBL
----
-<p> </p>
-
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Property_Files" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Anonymous_Content">下一页 »</a></p>
-</div><p></p>
-
-<p> </p>
-
-<p><a href="/en/XUL" title="en/XUL">XUL</a>有一个姐妹语言,<a href="/en/XBL" title="en/XBL">XBL</a>(可扩展绑定语言)。这种语言被用于声明 XUL 窗口控件的行为。</p>
-
-<h3 id="Bindings" name="Bindings">Bindings</h3>
-
-<p>你可以用 XUL 来为应用程序定义用户界面的外观。你可以通过 <a href="/zh-CN/XUL_Tutorial/Adding_Style_Sheets" title="zh-CN/XUL_Tutorial/Adding_Style_Sheets"> 应用样式</a>自定义元素的外观。你也可以通过改变样式以 <a href="/zh-CN/XUL_Tutorial/Creating_a_Skin" title="zh-CN/XUL_Tutorial/Creating_a_Skin">创建新皮肤</a>。所有元素的基础外观,比如 <a href="/zh-CN/XUL_Tutorial/Scroll_Bars" title="zh-CN/XUL_Tutorial/Scroll_Bars">滚动条</a> 和 <a href="/zh-CN/XUL_Tutorial/Input_Controls#Checkboxes_and_Radio_Buttons" title="zh-CN/XUL_Tutorial/Input_Controls#Checkboxes_and_Radio_Buttons">复选框</a>,都可以通过调整样式或设置元素参数来进行修改。然而,XUL 没有提供改变元素的工作方式(或添加一个可重用的新元素)的方法。例如,您可能想改变滚动条的运行方式,就需要用到 <a href="/en/XBL" title="en/XBL">XBL</a>。</p>
-
-<p>一个 XBL 文件包含一组绑定(binding)。每个绑定描述一个 XUL 控件的行为。例如,一个绑定可以和一个滚动条相关联。这个行为除却描述滚动条的属性于方法之外,还描述了组成滚动条的 XUL 元素。</p>
-
-<p>类似 XUL,XBL 是一种 XML 语言,所以它有与之相似的语法规范。下述例子展示了 XBL 文件的基础结构:</p>
-
-<pre class="brush: xml">&lt;?xml version="1.0"?&gt;
-&lt;bindings xmlns="http://www.mozilla.org/xbl"&gt;
- &lt;binding id="binding1"&gt;
- &lt;!-- content, property, method and event descriptions go here --&gt;
- &lt;/binding&gt;
- &lt;binding id="binding2"&gt;
- &lt;!-- content, property, method and event descriptions go here --&gt;
- &lt;/binding&gt;
-&lt;/bindings&gt;
-</pre>
-
-<p><code><code><a href="/zh-CN/docs/XBL/XBL_1.0_Reference/Elements#bindings">bindings</a></code></code> 元素是 XBL 文件的根元素,包含了一个或多个 <code><code><a href="/zh-CN/docs/XBL/XBL_1.0_Reference/Elements#bindings">bindings</a></code></code> 元素。每个 <code><code><a href="/zh-CN/docs/XBL/XBL_1.0_Reference/Elements#bindings">bindings</a></code></code> 元素都声明一个单独的 binding,<code>id</code> 属性可以用来确定 binding,就像上述的例子一样。模板有两个 binding,分别叫做 <code>binding1</code> 和 <code>binding2</code>。一个可与滚动条关联,另一个则与菜单关联。一个 binding 可以和任意 XUL 元素相关联。如果你使用 CSS 类,就能按需使用各种不同的 binding。注意上面模板中的 <code><code><a href="/zh-CN/docs/XBL/XBL_1.0_Reference/Elements#bindings">bindings</a></code></code> 元素的命名空间。它声明了我们所使用的 XBL 语法。</p>
-
-<p>将绑定文件的链接正确设为 CSS 中 <code><a href="/en/CSS/-moz-binding" title="en/CSS/-moz-binding">-moz-binding</a></code> 的值,就可以把一个 binding 绑定到元素上。例如:</p>
-
-<pre class="brush: css">scrollbar {
- -moz-binding: url('chrome://findfile/content/findfile.xml#binding1');
-}
-</pre>
-
-<p>URL 指向了 “<a class="external" rel="freelink">chrome://findfile/content/findfile.xml</a>” 文件中的 ID“binding1”。“#binding1”语法用于指向特定的 binding,很像指向 HTML 文件中的 anchor 标签的语法。通常你会(借助此语法)把所有的 binding 放进一个单独的文件里。例中结果是“binding1”将会描述所有的滚动条元素。如果您没用-moz-binding URL中的标签,就会用到XBL文件中的第一个binding。</p>
-
-<p>binding 声明了五种类型:</p>
-
-<ol>
- <li>内容:添加到 binding 绑定到的元素的子元素</li>
- <li>属性:添加到 binding 绑定到的元素的属性。它们能通过脚本存取。</li>
- <li>方法:添加到 binding 绑定到的元素的方法。它们能从脚本调用。</li>
- <li>事件:元素将响应的例如鼠标单击和按键这类事件。 binding能添加脚本,来提供默认操作。另外,能够定义新事件。</li>
- <li>样式:被 XBL 定义的 binding 绑定到的元素所拥有的自定义样式的属性</li>
-</ol>
-
-<h3 id="Binding_Example" name="Binding_Example">Binding 示例</h3>
-
-<p><code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/box" title="box">box</a></code></code> 很通用,您能用它来创建自定义的窗口控件(虽然您能用任何元素,甚至自己构造的)。给一个 <code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/box" title="box">box</a></code></code> 标签分配一个 <code>class</code> 属性,您就可以将 binding 连接到只属于该类的 box。比如下面的例子:</p>
-
-<p><strong>XUL (example.xul):</strong></p>
-
-<pre class="brush: xml">&lt;?xml version="1.0"?&gt;
-&lt;?xml-stylesheet href="chrome://global/skin/" type="text/css"?&gt;
-&lt;?xml-stylesheet href="chrome://example/skin/example.css" type="text/css"?&gt;
-
-&lt;window
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;
- &lt;box class="okcancelbuttons"/&gt;
-&lt;/window&gt;</pre>
-
-<p><strong>CSS (example.css):</strong></p>
-
-<pre class="brush: css">box.okcancelbuttons {
- -moz-binding: url('chrome://example/skin/example.xml#okcancel');
-}</pre>
-
-<p><strong>XBL (example.xml):</strong></p>
-
-<pre class="brush: xml">&lt;?xml version="1.0"?&gt;
-&lt;bindings xmlns="http://www.mozilla.org/xbl"
- xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;
- &lt;binding id="okcancel"&gt;
- &lt;content&gt;
- &lt;xul:button label="OK"/&gt;
- &lt;xul:button label="Cancel"/&gt;
- &lt;/content&gt;
- &lt;/binding&gt;
-&lt;/bindings&gt;</pre>
-
-<p>这个例子创建了一个有单个 box 的窗口,这个 box 已经声明过含有一个 <code>okcancelbuttons</code> 类。与文件相关的样式表阐述了含类 <code>okcancelbuttons</code> 的box有在XBL文件中定义的特定的binding。除 <code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/box" title="box">box</a></code></code> 之外,可用其它元素,甚至自定义的标签。</p>
-
-<p>部分 XBL 的细节将在下一章描述。不过呢,总结来说,它使得在box里自动增加了两个按钮。一个 OK 按钮,一个 Cancel 按钮。</p>
-
-<p>在下一节中,我们将看看该如何 <a href="/en/XUL_Tutorial/Anonymous_Content" title="en/XUL_Tutorial/Anonymous_Content">使用 XBL 创建内容</a>。</p>
-
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Property_Files" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:Anonymous_Content">下一页 »</a></p>
-</div><p></p>
-
-<p>/*以下疑似是历史残余链接…*/ </p>
-
-<p> </p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/xpcom_接口/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/xpcom_接口/index.html
deleted file mode 100644
index fb2dbb3699..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/xpcom_接口/index.html
+++ /dev/null
@@ -1,179 +0,0 @@
----
-title: XPCOM 接口
-slug: Mozilla/Tech/XUL/Tutorial/XPCOM_接口
-translation_of: Archive/Mozilla/XUL/Tutorial/XPCOM_Interfaces
----
-<p> </p>
-
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Box_Objects" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:XPCOM_Examples">下一页 »</a></p>
-</div><p></p>
-
-<p>    本章简单的看看 <a href="/en/XPCOM" title="en/XPCOM">XPCOM</a> (跨平台组件对象模型)——Mozilla 使用的对象系统。</p>
-
-<h3 id="Calling_Native_Objects" name="Calling_Native_Objects">调用本地对象</h3>
-
-<p>    通过XUL我们可以建立一个复杂的用户界面,我们可以通过脚本来修改界面及处理任务。然而有很多事件是不能有JavaScript直接完成的,比如,我们像创建一个邮件程序,我们需要写一个脚本来连接到服务器发送好接收邮件,而JavaScript没有这个能力。</p>
-
-<p>    处理这种事情的唯一手段就是用本地代码写一个获得邮件的模块,同时也需要一个用脚本调用本地对象的简单方法。 Mozilla 通过了这样的模型—— <a href="/en/XPCOM" title="en/XPCOM">XPCOM</a> (Cross-platform Component Object Model)。</p>
-
-<div class="note">Mozilla 提供了不少XPCOM 组件及接口,并且大多数情况下,你不需要自己完成他们。通过学习本章,你可以在 <a class="external" href="http://xulplanet.com/references/xpcomref/">XULPlanet XPCOM Reference</a> 寻找合适的。</div>
-
-<h3 id="About_XPCOM" name="About_XPCOM">关于XPCOM</h3>
-
-<p>    Mozilla 是有一系列组件构成的。每一个组件都处理特定的任务。比如,有一个处理菜单,按钮及元素的组件。组件又建立在一系列定义(接口)上。</p>
-
-<p>    Mozilla 中的接口定义了在一个组件中需要实现的功能,组件是它的代码实现,每一个组件都要实现接口描述的功能。一个组件可以时多个接口,多个组件也可以实现同一个接口。</p>
-
-<p>    让我们来以‘文件’组件为例,需要创建一个描述‘文件’属性及功能的接口文件。文件需要有文件名、数据、大小等属性;删除、移动、复制等方法。</p>
-
-<p>    文件接口用字符文件描述而无需实现。实现的工作留给组件来完成,组件需要返回文件名、数据、大小的代码,以及复制、删除等代码。</p>
-
-<p>    我们不关心组件如何实现,只要它实现了接口。当然我们有不同的实现方法,并且对于不同的平台也会不同。然而,他们必须实现同样的接口,这样我们就可以利用从接口中得到的信息使用组件。</p>
-
-<p>    Mozilla中接口通常以'nsI'或 'mozI'开头,这样就很容易找出接口。比如 <code>nsIAddressBook</code> 用于地址表, <code>nsISound</code> 用于声音文件 , <code>nsILocalFile</code> 用于本地文件,Mozilla中的接口参见 <a href="/en/Interfaces" title="en/Interfaces">Interfaces</a>.</p>
-
-<p>    XPCOM 组件是一种本地实现,也就是说他们可以做 JavaScript 不能做的事情。我们可以调用接口定义的由组件属性的任意方法,比如,如果我们有一个组件,它实现了 <code>nsISound</code> 接口我们就可以用它来放声音。</p>
-
-<h3 id="Creating_XPCOM_Objects" name="Creating_XPCOM_Objects">创建XPCOM 对象</h3>
-
-<p>调用 XPCOM 组件分三步</p>
-
-<ol>
- <li>获取组件</li>
- <li>获取组件实现的接口</li>
- <li>调用所需函数</li>
-</ol>
-
-<p>    如果我们做了前两步,最后一步可以无限制的使用,例如,我们想要重命名文件,这个方法定义在nsILocalFile 接口中。第一步得到文件组件。第二步,我们获取它实现了的nsILocalFile 接口,最后,调用接口通过的方法。这个接口用于代表单个文件。</p>
-
-<p>    我们知道接口长椅 'nsI' 或 'mozI'开头。组件通常像使用URI一样来引用,Mozilla 储存了当前注册的组件列表。像插件一样,用户可以添加新的组件。</p>
-
-<p>    Mozilla 通过了一个文件组件,它实现了 <code><a href="/en/nsILocalFile" title="en/nsILocalFile">nsILocalFile</a></code>。可以通过<code><a class="link-mailto" href="mailto:'@mozilla.org" rel="freelink">'@mozilla.org</a>/file/local;1'</code>引用,这个字符串称作协议ID,语法如下:</p>
-
-<pre class="eval">@&lt;internetdomain&gt;/module[/submodule[...]];&lt;version&gt;[?&lt;name&gt;=&lt;value&gt;[&amp;&lt;name&gt;=&lt;value&gt;[...]]]
-</pre>
-
-<p>    其他组件也按相似的方法引用。</p>
-
-<p>    组件的协议 ID 用于获取组件,可以用下面的脚本得到组件。</p>
-
-<pre>var aFile = Components.classes["@mozilla.org/file/local;1"].createInstance();
-</pre>
-
-<p>    一个文件组件返回并储存在变量 <em>aFile</em> 中,上例中的 <code><a href="/en/Components_object" title="en/Components_object">Components</a></code> 引用一个提供相关功能的全局对象。 这里,使用 <code>classes</code> 方法获得组件组,<code>classes</code> 方法返回可用组件的数组。得到不同的组件只需把双引号中的需要ID换成你需要的<span style="font-family: monospace;">,最后用</span><code>createInstance()</code>方法创建实例。</p>
-
-<p>    你需要检查 <code>createInstance()</code> 的返回值以确保非空,如果为空则表示所需组件不存在。</p>
-
-<p>    当然,到此为止,我们只引用了文件组件本身,为了使用它的函数,我们需要得到它的接口,本例为 <code><a href="/en/nsILocalFile" title="en/nsILocalFile">nsILocalFile</a></code>。我们再加一行。</p>
-
-<pre>var aFile = Components.classes["@mozilla.org/file/local;1"].createInstance();
-if (aFile) aFile.QueryInterface(Components.interfaces.nsILocalFile);
-</pre>
-
-<p>     <code>QueryInterface()</code> 是一个所以组件都通过的函数来返回特定的接口。函数有一个参数,你想得到的接口<code>Components</code>的 <code>interfaces</code> 方法包含一个可用接口的数组,这里把 nsILocalFile 作为参数传给 <code>QueryInterface()。结果是</code>aFile会引用它所实现了 nsILocalFile 接口的那部分。</p>
-
-<p>    上面的两行脚本可以用于获取任何组件及接口,只需更换组件名及接口名。下例,获得一个 sound 接口。</p>
-
-<pre>var sound = Components.classes["@mozilla.org/sound;1"].createInstance();
-if (sound) sound.QueryInterface(Components.interfaces.nsISound);
-</pre>
-
-<p>    XPCOM 接口可以继承其它的接口。这种接口拥有它自己的功能及它所继承的接口的功能<span style="font-family: monospace;">所有的接口都继承自顶级接口</span><code>nsISupports,它有一个函数由于支持</code>JavaScript—— <code>QueryInterface()</code>。因为所以的组件都实现 nsISupports 接口所以<code>QueryInterface()</code>对每个组件都有效。</p>
-
-<p>    一些组件可能会实现相同的接口。他们可能是原件的子类但不是必须的。组件可能都会实现 nsILocalFile接口,另外一个组件可能会实现多个接口。因为这个原因我们在调用函数之前需要得到定义函数的接口。</p>
-
-<p>    这里有一个简写形式,不过一般的我们把它分成多行。</p>
-
-<pre>var aLocalFile = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
-</pre>
-
-<p>    这一行代码完成了上面两行所做的事。</p>
-
-<p>    如果你使用 <code>QueryInterface()</code> 引用一个本组件没有实现的接口,会抛出一个异常。如果不确定组件支持哪个接口请使用 <code><a href="/en/Core_JavaScript_1.5_Reference/Operators/Special_Operators/instanceof_Operator" title="en/Core_JavaScript_1.5_Reference/Operators/Special_Operators/instanceof_Operator">instanceof</a></code> 操作符检查。</p>
-
-<pre>var aFile = Components.classes["@mozilla.org/file/local;1"].createInstance();
-if (aFile instanceof Components.interfaces.nsILocalFile){
- // do something
-}
-</pre>
-
-<p>    如果aFile实现nsILocalFile 接口 <code><a href="/en/Core_JavaScript_1.5_Reference/Operators/Special_Operators/instanceof_Operator" title="en/Core_JavaScript_1.5_Reference/Operators/Special_Operators/instanceof_Operator">instanceof</a></code>返回真,在块中就可以调用 <code>QueryInterface()</code>。</p>
-
-<h3 id="Calling_the_Functions_of_an_Interface" name="Calling_the_Functions_of_an_Interface">调用接口函数</h3>
-
-<p>    现在你有了一个关联到 nsILocalFile 接口组件的一个引用,你就可以调用nsILocalFile通过的函数。下面列出了 nsILocalFile提供的属性及方法。</p>
-
-<dl>
- <dt>initWithPath </dt>
- <dd>此方法用于初始化文件名及路径,第一个参数是文件路径如 '/usr/local/mozilla'.</dd>
- <dt>leafName </dt>
- <dd>除去文件路径的文件名。</dd>
- <dt>fileSize </dt>
- <dd>文件尺寸。</dd>
- <dt>isDirectory() </dt>
- <dd> nsILocalFile 代表目录返回真。</dd>
- <dt>remove(recursive) </dt>
- <dd>删除一个文件。如果recursive 参数为true,一个目录及其中的所以文件包括子目录均被删除。</dd>
- <dt>copyTo(directory,newname) </dt>
- <dd>把文件复制到新目录,并随意更改文件名。目录应保存在 nsILocalFile对象中。</dd>
- <dt>moveTo(directory,newname) </dt>
- <dd>把文件移到新目录或重命名。 目录应保存在 nsILocalFile对象中。</dd>
-</dl>
-
-<p>    为了删除文件,需要将其赋值给 nsILocalFile。我们可以使用<code>initWithPath()</code> 方法指明所需文件,然后调用 <code>remove()</code> 函数,它带一个参数;是否递归删除,如下例。</p>
-
-<pre>var aFile = Components.classes["@mozilla.org/file/local;1"].createInstance();
-if (aFile instanceof Components.interfaces.nsILocalFile){
- aFile.initWithPath("/mozilla/testfile.txt");
- aFile.remove(false);
-}
-</pre>
-
-<p>    以上代码会定位 /mozilla/testfile.txt 并删除它。试着把它与事件处理相连。你可以把文件名改为一个需要删除的文件并把它删除。</p>
-
-<p>    上面的函数中 copyTo() 及moveTo()可以用于复制及移动文件。注意他们移动的目标目录不是保存在字符串中而是nsILocalFile,也就是说你需要两个文件字节,下面是一个复制文件的例子。</p>
-
-<pre>function copyFile(sourcefile,destdir)
-{
- // get a component for the file to copy
- var aFile = Components.classes["@mozilla.org/file/local;1"]
- .createInstance(Components.interfaces.nsILocalFile);
- if (!aFile) return false;
-
- // get a component for the directory to copy to
- var aDir = Components.classes["@mozilla.org/file/local;1"]
- .createInstance(Components.interfaces.nsILocalFile);
- if (!aDir) return false;
-
- // next, assign URLs to the file components
- aFile.initWithPath(sourcefile);
- aDir.initWithPath(destdir);
-
- // finally, copy the file, without renaming it
- aFile.copyTo(aDir,null);
-}
-
-copyFile("/mozilla/testfile.txt","/etc");
-</pre>
-
-<h3 id="XPCOM_Services" name="XPCOM_Services">XPCOM 服务器</h3>
-
-<p>    一些 XPCOM 组件是被称为服务器的特殊组件,你无需创建他们因为他们只能存在一个副本。服务器提供了类似于读取,设置全局数据或操作其他对象的方法。我们使用<code>getService()代替</code> <code>createInstance()</code>方法来获取服务器组件,除此以外,服务器并没有与其他组件相异之处。</p>
-
-<p>    如Mozilla通过了一个书签服务器,它允许你向当前用户的书签列表中添加书签。如下例。</p>
-
-<pre>var bmarks = Components.classes["@mozilla.org/browser/bookmarks-service;1"].getService();
-bmarks.QueryInterface(Components.interfaces.nsIBookmarksService);
-bmarks.addBookmarkImmediately("http://www.mozilla.org","Mozilla",0,null);
-</pre>
-
-<p>    首先组件 "@mozilla.org/browser/bookmarks-service;1"被返回,并保存在变量 <code>bmarks</code>中,我们使用 <code>QueryInterface()</code> 得到 nsIBookmarksService 接口。这个接口通过的<code>addBookmarkImmediately()</code> 函数用于添加书签。函数的前两个参数是书签的 URL 和标题。第三个参数是书签类型通常是 0 ,最后一个参数是书签页的字符集,可为空。</p>
-
-<p>    下一章看看Mozilla为我们通过的接口。 <a href="/en/XUL_Tutorial/XPCOM_Examples" title="en/XUL_Tutorial/XPCOM_Examples">interfaces provided with Mozilla that we can use</a>.</p>
-
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Box_Objects" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:XPCOM_Examples">下一页 »</a></p>
-</div><p></p>
-
-<p>。</p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/xul_structure/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/xul_structure/index.html
deleted file mode 100644
index 5983802be3..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/xul_structure/index.html
+++ /dev/null
@@ -1,43 +0,0 @@
----
-title: XUL_教程/XUL的结构
-slug: Mozilla/Tech/XUL/Tutorial/XUL_Structure
-tags:
- - XUL_Tutorial
-translation_of: Archive/Mozilla/XUL/Tutorial/XUL_Structure
----
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/1-3_关于Chrome_URL">下一页 »</a></p>
-</div><p></p>
-<p> </p>
-<h2 id=".5BXUL.E5.AD.A6.E4.B9.A0.5DXUL_Tutorial.28.E4.BA.8C.29_--_XUL_Structure" name=".5BXUL.E5.AD.A6.E4.B9.A0.5DXUL_Tutorial.28.E4.BA.8C.29_--_XUL_Structure">XUL是怎么被处理的?</h2>
-<p>XUL与HTML的处理方式一样,先读出内容,然后解析为一棵对象树,再对每个对象作处理,使其显示出来。因为XUL是用来定义用户界面的,因此它与HTML用来做显示的功能一样。实际上,在Mozilla中,HTML和XUL,甚至SVG都是使用同样的底层代码来处理的。这样意味着一些CSS属性(注意是属性,不是CSS的全部)可以用在HTML和XUL。XUL同HTML一样可以从本地文件系统或web页面读取(不过这样多少有些功能上的限制)。另外就是打成一个包,可以让别人下载和安装。安装后的包就可以有一些更强的权限,象读文本文件,读用户参数和bookmark,以及访问其它系统特性。</p>
-<p>包注册就是Firefox扩展的安装方式。包是由XUL、Javascript、CSS、HTML和图片等构成。文件名后缀为.xpi,它其实是一个zip格式的压缩包。象Firefox的扩展一般是通过overlay的方式,对Firefox进行扩展的,如增加菜单、工具条等。但这些功能的代码其实是与浏览器分离的,而且卸载也很容易(就象NewEdit中的插件一样)。</p>
-<p>注册的包不一定要使用overlay的扩展方式(overlay是对已经存在的应用的扩展)。但这样,你就不能直接通过浏览器来使用这些功能。但你仍然可以使用称为chrome(增色) URL的方式来调用注册包。这种chrome URL的形式为"<a class="external" rel="freelink">chrome://</a>"。它用来指示安装的包和扩展。</p>
-<p>通过chrome方式来访问可以获得比http方式更多的权限,而通过这种方式,你就可以做访问本地文件等操作。这一点非常重要,权限的区分是通过URL的类型来实现的。通过http方式访问HTML和XUL,没有这些特别的权限,而通过chrome方式访问,HTML和XUL都具有这样的权力。</p>
-<p>Mozilla浏览器本身就是由许多的包构成的。而这些文件就是通过chrome URL来访问的,以获得特别的权限。</p>
-<p>Mozilla中有三种主要的文档类型:HTML, XUL和XML。它们之间有些是可能共享的特性,有些是不能共享的,使用时要注意。</p>
-<p>小结:</p>
-<p>Mozilla使用同样的引擎来渲染HTML和XUL,使用CSS来指明它们的外观。 XUL可以从web站点、本地文件系统,或作为包被安装并通过chrome URL来访问(这就是浏览器扩展所做的方式)。 Chrome URL可以用来访问安装的包,并且使用特别的权限来打开它们。 HTML、XUL、XML有不同的文档类型。一些特性是互通的,然而另一些特性是各自的。</p>
-<h3 id=".E5.8C.85.E7.BB.84.E7.BB.87" name=".E5.8C.85.E7.BB.84.E7.BB.87">包的组织</h3>
-<p>由Mozilla提供的包可以在Mozilla的安装目录下的chrome子目录中找到。但仅仅把文件拷贝到chrome目录下是不会赋给它任何的权限,也不可以通过chrome URL来访问的,还需要配置才可以。需要按照chrome包格式的要求来组织才可以。</p>
-<p>一个包的文件通常被组织为一个JAR文件。注意,很象Java中的Jar包,都是Zip格式的。但里面可不是Java程序。这也造成了某些人认为开发扩展需要懂Java,其实不是的。只是后缀与Java一样。(不清楚为什么用这个后缀)同时,也可以不打成一个JAR包,就是展开的目录也可以(如果你看到另一个教程XUL App Tutorial,你会看到就没有打成一个JAR包)。</p>
-<p>通常一个chrome包有三个目录,但它们都是可选的,分别为:content、skin和locale。</p>
-<ul>
- <li>content -- 窗口和脚本</li>
-</ul>
-<p>用户界面的定义都放在XUL文件中,这些文件都以.xul为后缀。一个content目录下可以有多个XUL文件,但主窗体文件名必须与包名相同。例如editor包必须有一个叫做editor.xul的文件。其它的脚本文件(一般是.js文件,Javascript)也放在这个目录下。</p>
-<ul>
- <li>skin -- 样式表、图片,和其它与theme相关的文件</li>
-</ul>
-<p>样式表用来描述窗口显示的外观。它们与XUL分离,可以灵活地修改程序的外观。</p>
-<ul>
- <li>locale -- 与语言相关的文件</li>
-</ul>
-<p>所有界面中用到的文本都放在这里。如果支持多国语言,它们将按语言种类进行组织。只要在这里进行翻译即可实现多语言。 同时在每个目录下还应该有一个名为:contents.rdf的文件,它用来描述相关目录的信息清单。Mozilla将读取它,并使用它的内容来注册包,并给这个包分配一个chrome URL,这样这些文件就可以通过这个chrome URL来访问了。如果没有contents.rdf文件,这个包就不能被分配一个chrome URL,因此也就不能通过chrome来访问了。同时要注意,只有你需要通过chrome URL来访问的目录才需要contents.rdf文件,不需要访问的目录可能不要。再有,如果一个目录下还有子目录,但子目录通过与父目录相同的chrome URL来访问,子目录也可以不要contents.rdf文件。</p>
-<p>在locale目录中,语言化文件有两种形式:DTD和属性(properties)文件。DTD(Document Type Definition,文档类型定义)是XML中常用的文件,它一般是用来定义XML中的元素规则,还可以用来定义XML中出现的实体(entity)元素。XUL要使用DTD中的实体声明,用来显示文本信息。因此如果想实现多语言,就要按语种创建子目录,生成多个DTD文件。属性文件是给脚本使用的。</p>
-<p>Mozilla中的包通常是放在chrome目录下,但是你也可以不放在这个目录下,而是放在磁盘任意的地方。在chrome目录下的chrome.rdf文件保存了安装了的包、skin、locale的列表及它们的位置。放在chrome下是最常见的。对于存在多种skin和locale的情况,chrome.rdf中保存了激活的配置。</p>
-<p> </p>
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/1-3_关于Chrome_URL">下一页 »</a></p>
-</div><p></p>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/tutorial/更多的按钮特性/index.html b/files/zh-cn/mozilla/tech/xul/tutorial/更多的按钮特性/index.html
deleted file mode 100644
index 4a72667660..0000000000
--- a/files/zh-cn/mozilla/tech/xul/tutorial/更多的按钮特性/index.html
+++ /dev/null
@@ -1,68 +0,0 @@
----
-title: XUL_教程/更多的按钮特性
-slug: Mozilla/Tech/XUL/Tutorial/更多的按钮特性
-tags:
- - XUL_教程
-translation_of: Archive/Mozilla/XUL/Tutorial/More_Button_Features
----
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Using_Spacers" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:The_Box_Model">下一页 »</a></p>
-</div><p></p>
-<p> </p>
-<h3 id=".E6.B7.BB.E5.8A.A0.E5.9B.BE.E5.83.8F" name=".E6.B7.BB.E5.8A.A0.E5.9B.BE.E5.83.8F">添加图像</h3>
-<p>你可以使用<code><code id="a-image"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/image">image</a></code></code>属性通过指定URL为按钮添加一个图像。图像从URL进行加载,可以是一个相对或绝对的URL路径,然后在按钮上显示图像。 下面的按钮有<code><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></code> 和 <code><code id="a-image"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/image">image</a></code></code> 'happy.png'。图像显示在标签的左边。你可以使用其它两个属性去改变这个位置。这将会在后面进行解释。</p>
-<p><span id="%E4%BE%8B1"><a id="%E4%BE%8B1"></a><strong>例1</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_advbtns_1.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_advbtns_1.xul">View</a></p>
-<pre>&lt;button label="help" image="happy.png"/&gt;
-</pre>
-<h4 id=".E4.BD.BF.E7.94.A8CSS.E5.9B.BE.E5.83.8F.E7.9A.84.E6.8C.89.E9.92.AE" name=".E4.BD.BF.E7.94.A8CSS.E5.9B.BE.E5.83.8F.E7.9A.84.E6.8C.89.E9.92.AE">使用CSS图像的按钮</h4>
-<p>在按钮上指定图像的另一个方法是使用样式表(CSS <a href="/zh-CN/docs/Web/CSS/list-style-image" title="list-style-image 属性用来指定一个能用来作为列表元素标记的图片。"><code>list-style-image</code></a> )属性。这将计划允许不改变XUL文件去改变"外观"(在这个例子,外观指按钮的图片)。</p>
-<p><span id="%E4%BE%8B2"><a id="%E4%BE%8B2"></a><strong>例2</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_advbtns_2.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_advbtns_2.xul">View</a></p>
-<pre>&lt;button id="find-button"
- label="Find" style="list-style-image: url('happy.png')"/&gt;
-</pre>
-<p>在这个例子,在按钮上显示图像 'happy.png'。 <code><code id="a-style"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/style">style</a></code></code>属性的功能类似于在HTML中一样。通常,它可以使用在所有的XUL元素。注意你确实应该在一个分离的样式表里定义样式。</p>
-<h3 id=".E5.9B.BE.E5.83.8F.E5.AE.9A.E4.BD.8D" name=".E5.9B.BE.E5.83.8F.E5.AE.9A.E4.BD.8D">图像定位</h3>
-<p>默认情况下,按钮上的图像会放置在文本标签的左边。有两个属性可以用来控制定位。</p>
-<p><code><code id="a-dir"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/dir">dir</a></code></code>属性控制图像和文本的方向。设置这个属性的值为<code>reverse</code>,图像将会放在文本的右边。使用<code>normal</code>值,或者删除这个属性,图像将会放在文本的左边。</p>
-<p><code><code id="a-orient"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/orient">orient</a></code></code>属性用于在将图片放在文本的上面或下面。默认值是<code>horizontal</code>用于将用于将图像放在文本的左或右。你也可以使用值<code>vertical</code>将图像放在上方或下方。在这个例子,dir属性控制放置在上方或下方。相同的值被使用时,如果用在<code>normal</code>的意思是将图像放在文本的上方,而用在<code>reverse</code>的意思是将图像放在文本的下方。</p>
-<p><span id="%E4%BE%8B3"><a id="%E4%BE%8B3"></a><strong>例3</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_advbtns_3.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_advbtns_3.xul">View</a></p>
-<div class="float-right">
- <img alt="Image:advbtns1.png" class="internal" src="/@api/deki/files/2642/=Advbtns1.png"></div>
-<pre>&lt;button label="Left" image="happy.png"/&gt;
-&lt;button label="Right" image="happy.png" dir="reverse"/&gt;
-&lt;button label="Above" image="happy.png" orient="vertical"/&gt;
-&lt;button label="Below" image="happy.png" orient="vertical" dir="reverse"/&gt;
-</pre>
-<p><br>
- 这个例子展示了四个连续的不同类型的按钮。注意两个属性都没有指定说明使用的是默认值。</p>
-<h3 id=".E7.89.B9.E6.AE.8A.E5.86.85.E5.AE.B9.E6.8C.89.E9.92.AE" name=".E7.89.B9.E6.AE.8A.E5.86.85.E5.AE.B9.E6.8C.89.E9.92.AE">特殊内容按钮</h3>
-<p>按钮可以在内部包含任意的标记元素,这些元素将会被渲染在按钮内部。你或许不会经常使用这个,但你可以在创建自定义元素时使用它。</p>
-<p>例如,下面将创建一个有两个红字的按钮:</p>
-<p><span id="%E4%BE%8B4"><a id="%E4%BE%8B4"></a><strong>例4</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_advbtns_4.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_advbtns_4.xul">View</a></p>
-<pre>&lt;button&gt;
- &lt;description value="This is a"/&gt;
- &lt;description value="rather strange" style="color: red;"/&gt;
- &lt;description value="button"/&gt;
-&lt;/button&gt;
-</pre>
-<p>任何XUL元素都可以放在<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/button" title="button">button</a></code></code>里面。HTML元素将被忽略,因此你需要使用<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/description" title="description">description</a></code></code>元素来包装它来达到换行的目的。如果你在按钮上指定<code><code id="a-label"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/label">label</a></code></code>属性,它将会覆盖按钮内的所有内容。</p>
-<h4 id=".E5.BC.B9.E5.87.BA.E8.8F.9C.E5.8D.95.E6.8C.89.E9.92.AE" name=".E5.BC.B9.E5.87.BA.E8.8F.9C.E5.8D.95.E6.8C.89.E9.92.AE">弹出菜单按钮</h4>
-<p>你可以在按钮里面放置一个<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menupopup" title="menupopup">menupopup</a></code></code>去促使在按钮被按下时向下弹出一个菜单,就像使用 <code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code></code>。然而,在这个例子你必须设置<code><a href="/cn/XUL/Attribute/button.type" title="cn/XUL/Attribute/button.type">type</a></code> 属性的值为<code>menu</code>。</p>
-<p><span id="%E4%BE%8B5"><a id="%E4%BE%8B5"></a><strong>例5</strong></span> : <a href="https://developer.mozilla.org/samples/xultu/examples/ex_advbtns_5.xul.txt">Source</a> <a href="https://developer.mozilla.org/samples/xultu/examples/ex_advbtns_5.xul">View</a></p>
-<div class="float-right">
- <img alt="Image:advbtns2.png" class="internal" src="/@api/deki/files/2643/=Advbtns2.png"></div>
-<pre>&lt;button type="menu" label="Device"&gt;
- &lt;menupopup&gt;
- &lt;menuitem label="Printer"/&gt;
- &lt;menuitem label="Mouse"/&gt;
- &lt;menuitem label="Keyboard"/&gt;
- &lt;/menupopup&gt;
-&lt;/button&gt;
-</pre>
-<p>在这个例子中,用户可以点击按钮去弹出一个包括三个项目的菜单。注意在选择这些菜单项之中的一个时不会改变按钮的标签,不像<code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/menulist" title="menulist">menulist</a></code></code>那样。这种按钮类型是有意做成类似于菜单的,在每个项目上附上脚本去执行任务。我们将会在后面看到更多的菜单。</p>
-<p>你也可以设置 <code><a href="/cn/XUL/Attribute/button.type" title="cn/XUL/Attribute/button.type">type</a></code> 属性的值为<code>menu-button</code>。这也可以创建一个像菜单的按钮,但显示会有所不同,右边的图像显示它们的区别。左边是一个'menu'而第二个是'menu-button'。 它有一个箭头标记菜单的存在。 在'menu'上,用户可以点击按钮的任何地方去显示菜单。在 'menu-button'上,用户点击箭头去显示菜单。</p>
-<p>接下来,我们将要学习更多关于 <a href="/cn/XUL_教程/盒状模型" title="cn/XUL_教程/盒状模型">在窗口中放置元素</a>.</p>
-<p></p><div class="prevnext" style="text-align: right;">
- <p><a href="/zh-CN/docs/XUL_Tutorial:Using_Spacers" style="float: left;">« 上一页</a><a href="/zh-CN/docs/XUL_Tutorial:The_Box_Model">下一页 »</a></p>
-</div><p></p>
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/vbox/index.html b/files/zh-cn/mozilla/tech/xul/vbox/index.html
deleted file mode 100644
index eb23c89d10..0000000000
--- a/files/zh-cn/mozilla/tech/xul/vbox/index.html
+++ /dev/null
@@ -1,130 +0,0 @@
----
-title: vbox
-slug: Mozilla/Tech/XUL/vbox
-tags:
- - XUL Elements
- - XUL Reference
-translation_of: Archive/Mozilla/XUL/vbox
----
-<div class="noinclude"><span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-
-<p>A container element which can contain any number of child elements. This is equivalent to the <code><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/box" title="box">box</a></code></code> element, except it defaults to vertical orientation.<br>
- 一个可以包含任何子元素的容器元素。这相当于默认为垂直方向的<code style="font-style: normal;"><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/box" title="box">box</a></code></code> 元素。</p>
-
-<p>More information is available in the <a href="en/XUL_Tutorial/The_Box_Model">XUL tutorial</a>.<br>
- 更多信息参考<a href="en/XUL_Tutorial/The_Box_Model">XUL tutorial</a>。</p>
-
-<h3 id="Example" name="Example">Example</h3>
-
-<h3 id="示例">示例</h3>
-
-<p><img alt="vbox example" src="https://mdn.mozillademos.org/files/7213/example.png" style="width: 94px; height: 46px;"></p>
-
-<pre>&lt;!-- Two labels at bottom --&gt;
-&lt;vbox&gt;
- &lt;spacer flex="1"/&gt;
- &lt;label value="One"/&gt;
- &lt;label value="Two"/&gt;
-&lt;/vbox&gt;
-</pre>
-
-<h3 id="Attributes" name="Attributes">Attributes</h3>
-
-<h3 id="属性">属性</h3>
-
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0 0 10px 10px; padding: 0 10px; background: rgb(238, 238, 238);">
-<tbody>
-<tr>
-<td><p><strong>Inherited from XUL element</strong><br> <small>
-<code id="a-align"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/align">align</a></code>,
-<code id="a-allowevents"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/allowevents">allowevents</a></code>,
-<code id="a-allownegativeassertions"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/allownegativeassertions">allownegativeassertions</a></code>,
-<code id="a-class"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/class">class</a></code>,
-<code id="a-coalesceduplicatearcs"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/coalesceduplicatearcs">coalesceduplicatearcs</a></code>,
-<code id="a-collapsed"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/collapsed">collapsed</a></code>,
-<code id="a-container"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/container">container</a></code>,
-<code id="a-containment"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/containment">containment</a></code>,
-<code id="a-context"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/context">context</a></code>,
-<code id="a-contextmenu"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/contextmenu">contextmenu</a></code>,
-<code id="a-datasources"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/datasources">datasources</a></code>,
-<code id="a-dir"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/dir">dir</a></code>,
-<code id="a-empty"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/empty">empty</a></code>,
-<code id="a-equalsize"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/equalsize">equalsize</a></code>,
-<code id="a-flags"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/flags">flags</a></code>,
-<code id="a-flex"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/flex">flex</a></code>,
-<code id="a-height"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/height">height</a></code>,
-<code id="a-hidden"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/hidden">hidden</a></code>,
-<code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code>,
-<code id="a-insertafter"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/insertafter">insertafter</a></code>,
-<code id="a-insertbefore"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/insertbefore">insertbefore</a></code>,
-<code id="a-left"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/left">left</a></code>,
-<code id="a-maxheight"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/maxheight">maxheight</a></code>,
-<code id="a-maxwidth"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/maxwidth">maxwidth</a></code>,
-<code id="a-menu"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/menu">menu</a></code>,
-<code id="a-minheight"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/minheight">minheight</a></code>,
-<code id="a-minwidth"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/minwidth">minwidth</a></code>,
-<code id="a-mousethrough"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/mousethrough">mousethrough</a></code>,
-<code id="a-observes"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/observes">observes</a></code>,
-<code id="a-ordinal"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/ordinal">ordinal</a></code>,
-<code id="a-orient"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/orient">orient</a></code>,
-<code id="a-pack"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/pack">pack</a></code>,
-<code id="a-persist"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/persist">persist</a></code>,
-<code id="a-popup"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/popup">popup</a></code>,
-<code id="a-position"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/position">position</a></code>,
-<code id="a-preference-editable"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/preference-editable">preference-editable</a></code>,
-<code id="a-querytype"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/querytype">querytype</a></code>,
-<code id="a-ref"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/ref">ref</a></code>,
-<code id="a-removeelement"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/removeelement">removeelement</a></code>,
-<code id="a-sortDirection"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/sortDirection">sortDirection</a></code>,
-<code id="a-sortResource"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/sortResource">sortResource</a></code>,
-<code id="a-sortResource2"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/sortResource2">sortResource2</a></code>,
-<code id="a-statustext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/statustext">statustext</a></code>,
-<code id="a-style"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/style">style</a></code>,
-<code id="a-template"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/template">template</a></code>,
-<code id="a-tooltip"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tooltip">tooltip</a></code>,
-<code id="a-tooltiptext"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/tooltiptext">tooltiptext</a></code>,
-<code id="a-top"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/top">top</a></code>,
-<code id="a-uri"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/uri">uri</a></code>,
-<code id="a-wait-cursor"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/wait-cursor">wait-cursor</a></code>,
-<code id="a-width"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/width">width</a></code> </small></p>
-</td>
-</tr>
-</tbody>
-</table><p></p>
-
-<h3 id="Properties" name="Properties">Properties</h3>
-
-<h3 id="特性">特性</h3>
-
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited Properties</strong><br> <small> <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/align">align</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/allowEvents">allowEvents</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/boxObject">boxObject</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/builder">builder</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/className">className</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/collapsed">collapsed</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/contextMenu">contextMenu</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/controllers">controllers</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/database">database</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/datasources">datasources</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/dir">dir</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/flex">flex</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/height">height</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/hidden">hidden</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/id">id</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/left">left</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/maxHeight">maxHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/maxWidth">maxWidth</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/menu">menu</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/minHeight">minHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/minWidth">minWidth</a></span></code>, , , , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/observes">observes</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/ordinal">ordinal</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/orient">orient</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/pack">pack</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/persist">persist</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/ref">ref</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/resource">resource</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/statusText">statusText</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/style">style</a></span></code>, ,, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tooltip">tooltip</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tooltipText">tooltipText</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/top">top</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/width">width</a></span></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-
-<h3 id="Methods" name="Methods">Methods</h3>
-
-<h3 id="方法">方法</h3>
-
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited from XUL element</strong><br> <small> <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span></small></p> <p><strong>Inherited from DOM element</strong><br> <small> <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-
-<h3 id="Related" name="Related">Related</h3>
-
-<h3 id="相关">相关</h3>
-
-<dl>
- <dt>Elements<br>
- 元素</dt>
- <dd><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/box" title="box">box</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/hbox" title="hbox">hbox</a></code></dd>
-</dl>
-
-<p> </p>
-
-<div class="noinclude"> </div>
-
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/window/index.html b/files/zh-cn/mozilla/tech/xul/window/index.html
deleted file mode 100644
index f748259648..0000000000
--- a/files/zh-cn/mozilla/tech/xul/window/index.html
+++ /dev/null
@@ -1,281 +0,0 @@
----
-title: window
-slug: Mozilla/Tech/XUL/window
-translation_of: Archive/Mozilla/XUL/window
----
-<div class="noinclude"><span class="breadcrumbs XULRef_breadcrumbs">
- « <a href="/zh-CN/docs/XUL_Reference">XUL Reference home</a> [
- <a href="#Examples">示例</a> |
- <a href="#Attributes">属性</a> |
- <a href="#Properties">特性</a> |
- <a href="#Methods">方法</a> |
- <a href="#Related">相关</a> ]
-</span></div>
-
-<p>window标签用来描述一个窗口的顶级结构,在 XUL文档中,他是一个根节点。默认情况下,它里面的控件是水平排列的。作为一个box容器, <a class="internal" href="/en/XUL/box" title="en/XUL/box">box</a>的属性都可以被使用. 默认的, 窗口将有一个特定于平台的框架围绕着他。</p>
-
-<p>如果需要给窗口添加一个图标,你需要首先创建一个 icon 文件,也就是例如 <var>&lt;windowid&gt;</var><code>.ico</code> 和 <var>&lt;windowid&gt;</var><code>.xpm</code> ,然后将他们放置到 <var>项目文件夹的</var><code>/chrome/icons/default/</code> 目录下. 这里所说的的 <var>&lt;windowid&gt;</var> 是此窗口内window标签的id. 这样,您就能为每个窗口设置不同的图标了。</p>
-
-<p>如果没有将 "<span class="nowiki">chrome://global/skin/</span>"下的指定css文件引用进来, 此窗口将不能正常加载 ,有可能看不见 或者被打开的时候出现漏洞.</p>
-
-<div class="note">
-<p><strong>注意:</strong> 通过<span title="(Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)">Gecko 1.9.2</span>标记, 当一个窗口通过查看动作引起的“激活”或“失活”事件被“激活”或“失活”时,你可以侦测到。这方面的信息,请查看  <a href="/en/XUL/Events#Window_activation_events" title="https://developer.mozilla.org/en/XUL/Events#Window_activation_events">窗口激活事件</a>.</p>
-</div>
-
-<p>更多的信息请查看 <a href="/en/XUL_Tutorial/Creating_a_Window" title="en/XUL_Tutorial/Creating_a_Window">XUL tutorial</a>.</p>
-
-<dl>
- <dt>标记属性</dt>
- <dd><a href="#a-accelerated">accelerated</a>, <a href="#a-chromemargin">chromemargin</a>, <a href="#a-disablechrome">disablechrome</a>, <a href="#a-disablefastfind">disablefastfind</a>, <a href="#a-drawintitlebar">drawintitlebar</a>, <a href="#a-fullscreenbutton">fullscreenbutton</a>, <a href="#a-height">height</a>, <a href="#a-hidechrome">hidechrome</a>, <a href="#a-id">id</a>, <a href="#a-lightweightthemes">lightweightthemes</a>, <a href="#a-lightweightthemesfooter">lightweightthemesfooter</a>, <a href="#a-screenX">screenX</a>, <a href="#a-screenY">screenY</a>, <a href="#a-sizemode">sizemode</a>, <a href="#a-title">title</a>, <a href="#a-width">width</a>, <a href="#a-windowtype">windowtype</a></dd>
-</dl>
-
-<h3 id="Examples" name="Examples">实例</h3>
-
-<pre class="brush: xml">&lt;?xml version="1.0"?&gt;
-&lt;?xml-stylesheet href="chrome://global/skin/" type="text/css"?&gt;
-&lt;!-- Extremely recommended to keep this css include!! --&gt;
-&lt;window id="rootWnd" title="Register Online!"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;
- &lt;vbox&gt;
- &lt;hbox&gt;
- &lt;image src="application_form.png"/&gt;
- &lt;description&gt;Register Online!&lt;/description&gt;
- &lt;/hbox&gt;
- &lt;groupbox align="start"&gt;
- &lt;caption label="Your Information"/&gt;
- &lt;radiogroup&gt;
- &lt;vbox&gt;
- &lt;hbox&gt;
- &lt;label control="your-fname" value="Enter first name:"/&gt;
- &lt;textbox id="your-fname" value="Johan"/&gt;
- &lt;/hbox&gt;
- &lt;hbox&gt;
- &lt;label control="your-lname" value="Enter last name:"/&gt;
- &lt;textbox id="your-lname" value="Hernandez"/&gt;
- &lt;/hbox&gt;
- &lt;hbox&gt;
- &lt;button oncommand="alert('save!')"&gt;
- &lt;description&gt;Save&lt;/description&gt;
- &lt;/button&gt;
- &lt;/hbox&gt;
- &lt;/vbox&gt;
- &lt;/radiogroup&gt;
- &lt;/groupbox&gt;
- &lt;/vbox&gt;
-&lt;/window&gt;
-</pre>
-
-<h3 id="Attributes" name="Attributes">标记属性</h3>
-
-<p></p><div id="a-accelerated">
-<dl><dt><code id="a-accelerated"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/accelerated">accelerated</a></code> </dt><dd>Type: <em>boolean</em></dd><dd>Set this attribute to <code>true</code> to allow hardware layer managers to accelerate the window.</dd></dl>
-</div><div id="a-activetitlebarcolor">
-
-<dl>
- <dt>
- <code id="a-activetitlebarcolor"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/activetitlebarcolor">activetitlebarcolor</a></code> </dt>
- <dd>
- Type: <em>color string</em></dd>
- <dd>
- Specify background color of the window's titlebar when it is active (foreground). Moreover this hides separator between titlebar and window contents. <em>This only affects Mac OS X.</em></dd>
-</dl>
-
-<p> </p>
-</div><div id="a-chromemargin">
-
-<dl> <dt><code id="a-chromemargin"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/chromemargin">chromemargin</a></code> </dt> <dd>Type: <em>margin string</em></dd> <dd>Controls the amount of chrome that should be visible on each side of the window. The specified string should contain four numbers, separated by commas, indicating the margin in pixels for the top, right, bottom, and left edges of the window, respectively. This value may be -1 to use the default margin for that side on the current platform, 0 to have no system border (that is, to extend the client area to the edge of the window), or a value greater than zero to indicate how much less than the default default width you wish the margin on that side to be. If this value turns out to be less than 0, 0 is used.</dd>
-</dl>
-</div><div id="a-disablechrome">
-
-<dl> <dt><code id="a-disablechrome"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/disablechrome">disablechrome</a></code> </dt> <dd>Type: <em>boolean</em></dd> <dd>Set this attribute to <code>true</code> to disable chrome in the window. This is used to hide chrome when showing in-browser UI such as the <code>about:addons</code> page, and causes the toolbars to be hidden, with only the tab strip (and, if currently displayed, the add-on bar) left showing.</dd> <div class="note"><strong>Note:</strong> This has no effect if the tabs on top preference is turned off.</div>
-</dl>
-</div><div id="a-disablefastfind">
-<dl><dt><code id="a-disablefastfind"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/disablefastfind">disablefastfind</a></code></dt><dd>Type: <em>boolean</em></dd><dd>Put <code>disablefastfind="true"</code> on the root element of a XUL document, which is intended to be loaded in a tab, to disable the find bar for the tab with this document. This is used to prevent the find bar from being displayed when it's not supported by the content (such as in the Add-ons manager tab).</dd></dl>
-</div><div id="a-drawintitlebar">
-
-<dl> <dt><code id="a-drawintitlebar"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/drawintitlebar">drawintitlebar</a></code> </dt> <dd>Type: <em>boolean</em></dd> <dd>If this attribute is <code>true</code>, the top of the window's content area will begin at the top edge of the title bar, instead of below the title bar. This allows the window to draw in the title bar. This is supported only from <code><a href="/en-US/docs/Mozilla/Tech/XUL/window" title="window">window</a></code> elements, and is ignored on platforms that don't support drawing into the title bar.</dd>
-</dl>
-</div><div id="a-fullscreenbutton">
-
-<dl> <dt><code id="a-fullscreenbutton"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/fullscreenbutton">fullscreenbutton</a></code> </dt> <dd>Type: <em>boolean</em></dd> <dd>Set this attribute to <code>true</code> to display a button in the window chrome to allow the user to switch the window into full screen mode. Supported on Mac OS X 10.7 Lion and later and on Windows. The window receives a "fullscreen" event once the change has been made.</dd>
-</dl>
-</div><div id="a-height">
-
-
-<dl>
- <dt><code id="a-height"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/height">height</a></code></dt>
- <dd>Type: <em>string</em> (representing an integer)</dd>
- <dd>The preferred height of the element in pixels. The actual displayed height may be different if the element or its contents have a minimum or maximum height. The CSS height property may also be used.</dd>
-</dl>
-</div><div id="a-hidechrome">
-
-
-<dl>
- <dt><code id="a-hidechrome"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/hidechrome">hidechrome</a></code></dt>
- <dd>Type: <em>boolean</em></dd>
- <dd>Set this attribute to <code>true</code> to have the chrome including the titlebar hidden.</dd>
-</dl>
-</div><div id="a-id">
-
-<dl>
- <dt>
- <code id="a-id"><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Attribute/id">id</a></code></dt>
- <dd>
- 类型: <em>元素的ID,在主窗口中必须唯一</em></dd>
- <dd>
- 一个唯一的标识一边开发者能够定义. 你可以使用方法 <code><a href="/cn/DOM/document.getElementById" title="cn/DOM/document.getElementById">getElementById()</a></code> 或者其他 DOM 的函数并在样式表中添加对元素的引用。</dd>
-</dl>
-
-<p></p>
-</div><div id="a-inactivetitlebarcolor">
-
-
-<dl>
- <dt><code id="a-inactivetitlebarcolor"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/inactivetitlebarcolor">inactivetitlebarcolor</a></code> </dt>
- <dd>Type: <em>color string</em></dd>
- <dd>Specify background color of the window's titlebar when it is inactive (background). Moreover this hides separator between titlebar and window contents. <em>This affects only on Mac OS X.</em></dd>
-</dl>
-</div><div id="a-lightweightthemes">
-
-<dl> <dt><code id="a-lightweightthemes"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/lightweightthemes">lightweightthemes</a></code> </dt> <dd>Type: <em>boolean</em></dd> <dd><code>true</code> if the window supports <a href="/en/Themes/Lightweight_themes" title="en/Themes/Lightweight themes">lightweight themes</a>, otherwise <code>false</code>.</dd>
-</dl>
-</div><div id="a-lightweightthemesfooter">
-
-<dl> <dt><code id="a-lightweightthemesfooter"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/lightweightthemesfooter">lightweightthemesfooter</a></code> </dt> <dd>Type: <em>id</em></dd> <dd>Specifies the ID of an element to which a <a href="/en/Themes/Lightweight_themes" title="en/Themes/Lightweight themes">lightweight theme</a>'s footer image will be applied.</dd>
-</dl>
-</div><div id="a-screenX">
-
-
-<dl>
- <dt><code id="a-screenX"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/screenX">screenX</a></code></dt>
- <dd>Type: <em>integer</em></dd>
- <dd>The horizontal position at which the window appears on the screen.</dd>
-</dl>
-</div><div id="a-screenY">
-
-
-<dl>
- <dt><code id="a-screenY"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/screenY">screenY</a></code></dt>
- <dd>Type: <em>integer</em></dd>
- <dd>The vertical position at which the window appears on the screen.</dd>
-</dl>
-</div><div id="a-sizemode">
-
-
-<dl>
- <dt><code id="a-sizemode"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/sizemode">sizemode</a></code></dt>
- <dd>Type: <em>one of the values below</em></dd>
- <dd>The state of the <code><a href="/en-US/docs/Mozilla/Tech/XUL/window" title="window">window</a></code>. It can have one of the following values:</dd>
- <dd>
- <dl>
- <dt><code>maximized</code></dt>
- <dd>The window is maximized, and occupies the full size of the screen.</dd>
- <dt><code>normal</code></dt>
- <dd>The window appears in a normal state at the desired size.</dd>
- </dl>
- </dd>
-</dl>
-
-<p>This attribute is used to save and restore the state of a window (together with the <code><span><a href="https://developer.mozilla.org/en-US/docs/XUL/Property/persist">persist</a></span></code> attribute) and for CSS styles (e.g. to hide the resizer grippy on maximized windows).</p>
-
-<div class="note"><strong>Note:</strong> When a window is minimized, the <code>sizemode</code> attribute is not updated. This is done so that if a window is closed while minimized, its persisted <code>sizemode</code> attribute wouldn't be <code>minimized</code>.</div>
-
-<p>Setting this attribute does not change the window state. Use <a href="/en-US/docs/Web/API/Window/maximize" title="The documentation about this has not yet been written; please consider contributing!"><code>window.maximize()</code></a>, <a href="/en-US/docs/Web/API/Window/restore" title="This method is currently not working, but you can use:"><code>window.restore()</code></a>, or <a href="/en-US/docs/Web/API/Window/minimize" title="The Window.minimize() method sets the window to a minimized state."><code>window.minimize()</code></a> to change the window state.</p>
-
-<p>To get the window state from JavaScript code, use <a href="/en-US/docs/Web/API/Window/windowState" title="The windowState read-only property of the Window interface returns the window's current state."><code>window.windowState</code></a>. Listen to the <a href="/en/XUL/Events#Window_events" title="en/XUL/Events#Window_events"><code>sizemodechange</code> event</a> dispatched to the DOM window to get notified when the window state changes.</p>
-
-
-</div><div id="a-title">
-
-
-<dl>
- <dt><code id="a-title"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/title">title</a></code></dt>
- <dd>Type: <em>string</em></dd>
- <dd>The text to appear in the title bar of the window.</dd>
-</dl>
-</div><div id="a-width">
-
-
-<dl>
- <dt><code id="a-width"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/width">width</a></code></dt>
- <dd>Type: <em>string</em> (representing an integer)</dd>
- <dd>The preferred width of the element. The value should not include a unit as all values are in pixels. The actual displayed width may be different if the element or its contents have a minimum or maximum width, or the size is adjusted by the flexibility or alignment of its parent. The CSS width property may also be used.</dd>
-</dl>
-
-
-</div><div id="a-windowtype">
-
-<dl>
- <dt>
- <code id="a-windowtype"><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Attribute/windowtype">windowtype</a></code></dt>
- <dd>
- Type: <em>string</em></dd>
- <dd>
- Set to a string which can be used to identify the type of window. This might be used, for example, to distinguish between a browser window and an editor window. Some of Mozilla's window handling functions use this attribute to group windows of the same type together.</dd>
-</dl>
-<div class="note">
- <p>Values for window type as found on MXR: <a href="http://mxr.mozilla.org/mozilla-release/search?string=windowtype">http://mxr.mozilla.org/mozilla-release/search?string=windowtype</a></p>
- <p><strong>navigator:browser </strong>- Looks like if window has gBrowser it has this window type</p>
- <p><strong>devtools:scratchpad </strong>- Scratchpad windows</p>
- <p><strong>navigator:view-source</strong> - The view source windows</p>
-</div>
-
-<p> </p>
-</div><p></p>
-
-<h3 id="Properties" name="Properties">属性</h3>
-
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited Properties</strong><br> <small> <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/align">align</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/allowEvents">allowEvents</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/boxObject">boxObject</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/builder">builder</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/className">className</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/collapsed">collapsed</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/contextMenu">contextMenu</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/controllers">controllers</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/database">database</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/datasources">datasources</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/dir">dir</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/flex">flex</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/height">height</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/hidden">hidden</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/id">id</a></span></code>, , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/left">left</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/maxHeight">maxHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/maxWidth">maxWidth</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/menu">menu</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/minHeight">minHeight</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/minWidth">minWidth</a></span></code>, , , , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/observes">observes</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/ordinal">ordinal</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/orient">orient</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/pack">pack</a></span></code>, , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/persist">persist</a></span></code>, , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/ref">ref</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/resource">resource</a></span></code>, , , , , <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/statusText">statusText</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/style">style</a></span></code>, ,, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tooltip">tooltip</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/tooltipText">tooltipText</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/top">top</a></span></code>, <code><span><a href="https://developer.mozilla.org/zh-CN/docs/XUL/Property/width">width</a></span></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-
-<h3 id="Methods" name="Methods">方法</h3>
-
-<p></p><table style="border: 1px solid rgb(204, 204, 204); margin: 0px 0px 10px 10px; padding: 0px 10px; background: rgb(238, 238, 238) none repeat scroll 0% 50%;"> <tbody> <tr> <td> <p><strong>Inherited from XUL element</strong><br> <small> <span id="m-blur"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/blur">blur</a></code></span>, <span id="m-click"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/click">click</a></code></span>, <span id="m-doCommand"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/doCommand">doCommand</a></code></span>, <span id="m-focus"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/focus">focus</a></code></span>, <span id="m-getElementsByAttribute"><code><a href="https://developer.mozilla.org/zh-CN/docs/Mozilla/Tech/XUL/Method/getElementsByAttribute">getElementsByAttribute</a></code></span></small></p> <p><strong>Inherited from DOM element</strong><br> <small> <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.addEventListener">addEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.appendChild">appendChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.dispatchEvent">dispatchEvent()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttribute">getAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNode">getAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNodeNS">getAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getAttributeNS">getAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagName">getElementsByTagName()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.getElementsByTagNameNS">getElementsByTagNameNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttribute">hasAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributeNS">hasAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasAttributes">hasAttributes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.hasChildNodes">hasChildNodes()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.insertBefore">insertBefore()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.isSupported">isSupported()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.normalize">normalize()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttribute">removeAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNode">removeAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeAttributeNS">removeAttributeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeChild">removeChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.removeEventListener">removeEventListener()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.replaceChild">replaceChild()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttribute">setAttribute()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNode">setAttributeNode()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNodeNS">setAttributeNodeNS()</a></code>, <code><a href="https://developer.mozilla.org/zh-CN/docs/DOM/element.setAttributeNS">setAttributeNS()</a></code></small></p> </td> </tr> </tbody>
-</table><p></p>
-
-<p>另请参阅: <a href="/en/DOM/window#Methods" title="en/DOM/window#Methods">DOM <code>window</code> object methods</a><strong> </strong></p>
-
-<h3 id="Note" name="Note">请注意</h3>
-
-<p>DTD文件如果丢失或者不可访问,而XUL文件中却引用了其中的内容,将会引起 "XML Parsing Error: undefined entity...&lt;window" 的错误。DOCTYPE声明中系统关键字后如果含有文件名,将会引起没有提示的加载失败, 而唯一的错误提示将会是在下一个XUL元素加载时出现未定义实体的错误。</p>
-
-<h3 id="Related" name="Related">关联元素</h3>
-
-<dl>
- <dd><code><a href="/zh-CN/docs/Mozilla/Tech/XUL/prefwindow" title="prefwindow">prefwindow</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/dialog" title="dialog">dialog</a></code>, <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/dialogheader" title="dialogheader">dialogheader</a></code></dd>
-</dl>
-
-<h3 id="相关的话题">相关的话题</h3>
-
-<dl>
-</dl>
-
-<h4 id="用户注意事项">用户注意事项</h4>
-
-<p>如果要更改窗口标题栏中的图标, 请参考这里: <a href="/en/Window_icons" title="en/Window_icons">Window icons</a>.</p>
-
-<p>如果要将小图标添加到地址栏和浏览器选项卡(即对话框不是弹出),请使用下面的代码片段来使用html名称空间和链接。</p>
-
-<pre class="brush: xml">&lt;window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- xmlns:html="http://www.w3.org/1999/xhtml"&gt;
-
-&lt;!-- Icon from chrome --&gt;
-&lt;html:link rel="icon" href="chrome://myExtension/content/path/to/favicon.png"/&gt;
-
-&lt;!-- From a remote site --&gt;
-&lt;html:link rel="icon" href="http://www.mozilla.org/favicon.ico"/&gt;
-</pre>
-
-<p>由于Firefox3.6之前的代码不能正常工作 ——会出现以下提示: "Warning: XUL box for box element contained an inline link child, forcing all its children to be wrapped in a block". 如果这段代码放在window标签之间, 它将会使窗口内的所有其他控件都变得乱七八糟.而如果放在 <code><a href="/zh-CN/docs/Mozilla/Tech/XUL/box" title="box">box</a></code> 标签之间, 窗口控件呈现反而很不错, 但是依然会引起错误。 这一问题可以如下解决:</p>
-
-<pre class="brush: xml">&lt;html:link rel="icon" href="chrome://myExtension/content/path/to/favicon.png" style="display:none"/&gt;
-</pre>
-
-<p>or</p>
-
-<pre class="brush: xml">&lt;html:head&gt;
- &lt;html:link rel="icon" href="chrome://myExtension/content/path/to/favicon.png"/&gt;
-&lt;/html:head&gt;
-</pre>
-
-<p></p>
diff --git a/files/zh-cn/mozilla/tech/xul/xul_reference/index.html b/files/zh-cn/mozilla/tech/xul/xul_reference/index.html
deleted file mode 100644
index 829a2a260e..0000000000
--- a/files/zh-cn/mozilla/tech/xul/xul_reference/index.html
+++ /dev/null
@@ -1,20 +0,0 @@
----
-title: XUL Reference
-slug: Mozilla/Tech/XUL/XUL_Reference
-tags:
- - XUL
- - XUL Reference
-translation_of: Archive/Mozilla/XUL/XUL_Reference
----
-<p>« <a href="/en-US/docs/XUL" title="en-US/XUL">XUL Reference</a> «</p>
-<table class="fullwidth-table"> <tbody> <tr> <th colspan="3">全部 XUL 元素 (按英文字母顺序排列)</th> </tr> <tr> <td> <p><a href="/zh-cn/XUL/action" title="zh-cn/XUL/action">action</a><br> <a href="/ja/XUL/arrowscrollbox" title="ja/XUL/arrowscrollbox">arrowscrollbox</a><br> <a href="/ja/XUL/assign" title="ja/XUL/assign">assign</a><br> <a href="/ja/XUL/bbox" title="ja/XUL/bbox">bbox</a><br> <a href="/ja/XUL/binding" title="ja/XUL/binding">binding</a><br> <a href="/ja/XUL/bindings" title="ja/XUL/bindings">bindings</a><br> <a href="/ja/XUL/box" title="ja/XUL/box">box</a><br> <a href="/ja/XUL/broadcaster" title="ja/XUL/broadcaster">broadcaster</a><br> <a href="/ja/XUL/broadcasterset" title="ja/XUL/broadcasterset">broadcasterset</a><br> <a href="/ja/XUL/button" title="ja/XUL/button">button</a><br> <a href="/ja/XUL/browser" title="ja/XUL/browser">browser</a><br> <a href="/ja/XUL/checkbox" title="ja/XUL/checkbox">checkbox</a><br> <a href="/ja/XUL/caption" title="ja/XUL/caption">caption</a><br> <a href="/ja/XUL/colorpicker" title="ja/XUL/colorpicker">colorpicker</a><br> <a href="/ja/XUL/column" title="ja/XUL/column">column</a><br> <a href="/ja/XUL/columns" title="ja/XUL/columns">columns</a><br> <a href="/ja/XUL/commandset" title="ja/XUL/commandset">commandset</a><br> <a href="/ja/XUL/command" title="ja/XUL/command">command</a><br> <a href="/ja/XUL/conditions" title="ja/XUL/conditions">conditions</a><br> <a href="/ja/XUL/content" title="ja/XUL/content">content</a><br> <a href="/ja/XUL/datepicker" title="ja/XUL/datepicker">datepicker</a><br> <a href="/ja/XUL/deck" title="ja/XUL/deck">deck</a><br> <a href="/ja/XUL/description" title="ja/XUL/description">description</a><br> <a href="/ja/XUL/dialog" title="ja/XUL/dialog">dialog</a><br> <a href="/ja/XUL/dialogheader" title="ja/XUL/dialogheader">dialogheader</a><br> <a href="/ja/XUL/dropmarker" title="ja/XUL/dropmarker">dropmarker</a><br> <a href="/ja/XUL/editor" title="ja/XUL/editor">editor</a><br> <a href="/ja/XUL/grid" title="ja/XUL/grid">grid</a><br> <a href="/ja/XUL/grippy" title="ja/XUL/grippy">grippy</a><br> <a href="/ja/XUL/groupbox" title="ja/XUL/groupbox">groupbox</a><br> <a href="/ja/XUL/hbox" title="ja/XUL/hbox">hbox</a><br> <a href="/ja/XUL/iframe" title="ja/XUL/iframe">iframe</a><br> <a href="/ja/XUL/image" title="ja/XUL/image">image</a><br> <a href="/ja/XUL/key" title="ja/XUL/key">key</a><br> <a href="/ja/XUL/keyset" title="ja/XUL/keyset">keyset</a><br> <a href="/ja/XUL/label" title="ja/XUL/label">label</a><br> <a href="/ja/XUL/listbox" title="ja/XUL/listbox">listbox</a><br> <a href="/ja/XUL/listcell" title="ja/XUL/listcell">listcell</a><br> <a href="/ja/XUL/listcol" title="ja/XUL/listcol">listcol</a><br> <a href="/ja/XUL/listcols" title="ja/XUL/listcols">listcols</a><br> <a href="/ja/XUL/listhead" title="ja/XUL/listhead">listhead</a><br> <a href="/ja/XUL/listheader" title="ja/XUL/listheader">listheader</a><br> <a href="/ja/XUL/listitem" title="ja/XUL/listitem">listitem</a></p> </td> <td> <p><a href="/ja/XUL/member" title="ja/XUL/member">member</a><br> <a href="/ja/XUL/menu" title="ja/XUL/menu">menu</a><br> <a href="/ja/XUL/menubar" title="ja/XUL/menubar">menubar</a><br> <a href="/ja/XUL/menuitem" title="ja/XUL/menuitem">menuitem</a><br> <a href="/ja/XUL/menulist" title="ja/XUL/menulist">menulist</a><br> <a href="/ja/XUL/menupopup" title="ja/XUL/menupopup">menupopup</a><br> <a href="/ja/XUL/menuseparator" title="ja/XUL/menuseparator">menuseparator</a><br> <a href="/ja/XUL/notification" title="ja/XUL/notification">notification</a><br> <a href="/ja/XUL/notificationbox" title="ja/XUL/notificationbox">notificationbox</a><br> <a href="/ja/XUL/observes" title="ja/XUL/observes">observes</a><br> <a href="/ja/XUL/overlay" title="ja/XUL/overlay">overlay</a><br> <a href="/ja/XUL/page" title="ja/XUL/page">page</a><br> <a href="/ja/XUL/panel" title="ja/XUL/panel">panel</a><br> <a href="/ja/XUL/param" title="ja/XUL/param">param</a><br> <a href="/ja/XUL/popupset" title="ja/XUL/popupset">popupset</a><br> <a href="/ja/XUL/preference" title="ja/XUL/preference">preference</a><br> <a href="/ja/XUL/preferences" title="ja/XUL/preferences">preferences</a><br> <a href="/ja/XUL/prefpane" title="ja/XUL/prefpane">prefpane</a><br> <a href="/ja/XUL/prefwindow" title="ja/XUL/prefwindow">prefwindow</a><br> <a href="/ja/XUL/progressmeter" title="ja/XUL/progressmeter">progressmeter</a><br> <a href="/ja/XUL/query" title="ja/XUL/query">query</a><br> <a href="/ja/XUL/queryset" title="ja/XUL/queryset">queryset</a><br> <a href="/ja/XUL/radio" title="ja/XUL/radio">radio</a><br> <a href="/ja/XUL/radiogroup" title="ja/XUL/radiogroup">radiogroup</a><br> <a href="/ja/XUL/resizer" title="ja/XUL/resizer">resizer</a><br> <a href="/ja/XUL/richlistbox" title="ja/XUL/richlistbox">richlistbox</a><br> <a href="/ja/XUL/richlistitem" title="ja/XUL/richlistitem">richlistitem</a><br> <a href="/ja/XUL/row" title="ja/XUL/row">row</a><br> <a href="/ja/XUL/rows" title="ja/XUL/rows">rows</a><br> <a href="/ja/XUL/rule" title="ja/XUL/rule">rule</a><br> <a href="/ja/XUL/scale" title="ja/XUL/scale">scale</a><br> <a href="/ja/XUL/script" title="ja/XUL/script">script</a><br> <a href="/ja/XUL/scrollbar" title="ja/XUL/scrollbar">scrollbar</a><br> <a href="/ja/XUL/scrollbox" title="ja/XUL/scrollbox">scrollbox</a><br> <a href="/ja/XUL/scrollcorner" title="ja/XUL/scrollcorner">scrollcorner</a><br> <a href="/ja/XUL/separator" title="ja/XUL/separator">separator</a><br> <a href="/ja/XUL/spacer" title="ja/XUL/spacer">spacer</a><br> <a href="/ja/XUL/spinbuttons" title="ja/XUL/spinbuttons">spinbuttons</a><br> <a href="/ja/XUL/splitter" title="ja/XUL/splitter">splitter</a><br> <a href="/ja/XUL/stack" title="ja/XUL/stack">stack</a><br> <a href="/ja/XUL/statusbar" title="ja/XUL/statusbar">statusbar</a></p> </td> <td> <p><a href="/ja/XUL/statusbarpanel" title="ja/XUL/statusbarpanel">statusbarpanel</a><br> <a href="/ja/XUL/stringbundle" title="ja/XUL/stringbundle">stringbundle</a><br> <a href="/ja/XUL/stringbundleset" title="ja/XUL/stringbundleset">stringbundleset</a><br> <a href="/ja/XUL/tab" title="ja/XUL/tab">tab</a><br> <a href="/ja/XUL/tabbrowser" title="ja/XUL/tabbrowser">tabbrowser</a> (Firefox 3/Gecko 1.9 开始只用于Firefox本身)<br> <a href="/ja/XUL/tabbox" title="ja/XUL/tabbox">tabbox</a><br> <a href="/ja/XUL/tabpanel" title="ja/XUL/tabpanel">tabpanel</a><br> <a href="/ja/XUL/tabpanels" title="ja/XUL/tabpanels">tabpanels</a><br> <a href="/ja/XUL/tabs" title="ja/XUL/tabs">tabs</a><br> <a href="/ja/XUL/template" title="ja/XUL/template">template</a><br> <a href="/ja/XUL/textnode" title="ja/XUL/textnode">textnode</a><br> <a href="/ja/XUL/textbox" title="ja/XUL/textbox">textbox</a><br> <a href="/ja/XUL/textbox_(Firefox_autocomplete)" title="ja/XUL/textbox_(Firefox_autocomplete)">textbox (Firefox autocomplete)</a><br> <a href="/ja/XUL/textbox_(Mozilla_autocomplete)" title="ja/XUL/textbox_(Mozilla_autocomplete)">textbox (Mozilla autocomplete)</a><br> <a href="/ja/XUL/timepicker" title="ja/XUL/timepicker">timepicker</a><br> <a href="/ja/XUL/titlebar" title="ja/XUL/titlebar">titlebar</a><br> <a href="/ja/XUL/toolbar" title="ja/XUL/toolbar">toolbar</a><br> <a href="/ja/XUL/toolbarbutton" title="ja/XUL/toolbarbutton">toolbarbutton</a><br> <a href="/ja/XUL/toolbargrippy" title="ja/XUL/toolbargrippy">toolbargrippy</a><br> <a href="/ja/XUL/toolbaritem" title="ja/XUL/toolbaritem">toolbaritem</a><br> <a href="/ja/XUL/toolbarpalette" title="ja/XUL/toolbarpalette">toolbarpalette</a><br> <a href="/ja/XUL/toolbarseparator" title="ja/XUL/toolbarseparator">toolbarseparator</a><br> <a href="/ja/XUL/toolbarset" title="ja/XUL/toolbarset">toolbarset</a><br> <a href="/ja/XUL/toolbarspacer" title="ja/XUL/toolbarspacer">toolbarspacer</a><br> <a href="/ja/XUL/toolbarspring" title="ja/XUL/toolbarspring">toolbarspring</a><br> <a href="/ja/XUL/toolbox" title="ja/XUL/toolbox">toolbox</a><br> <a href="/ja/XUL/tooltip" title="ja/XUL/tooltip">tooltip</a><br> <a href="/ja/XUL/tree" title="ja/XUL/tree">tree</a><br> <a href="/ja/XUL/treecell" title="ja/XUL/treecell">treecell</a><br> <a href="/ja/XUL/treechildren" title="ja/XUL/treechildren">treechildren</a><br> <a href="/ja/XUL/treecol" title="ja/XUL/treecol">treecol</a><br> <a href="/ja/XUL/treecols" title="ja/XUL/treecols">treecols</a><br> <a href="/ja/XUL/treeitem" title="ja/XUL/treeitem">treeitem</a><br> <a href="/ja/XUL/treerow" title="ja/XUL/treerow">treerow</a><br> <a href="/ja/XUL/treeseparator" title="ja/XUL/treeseparator">treeseparator</a><br> <a href="/ja/XUL/triple" title="ja/XUL/triple">triple</a><br> <a href="/ja/XUL/vbox" title="ja/XUL/vbox">vbox</a><br> <a href="/ja/XUL/where" title="ja/XUL/where">where</a><br> <a href="/ja/XUL/window" title="ja/XUL/window">window</a><br> <a href="/ja/XUL/wizard" title="ja/XUL/wizard">wizard</a><br> <a href="/ja/XUL/wizardpage" title="ja/XUL/wizardpage">wizardpage</a></p> </td> </tr> </tbody>
-</table>
-<h1 id="XUL_参考">XUL 参考</h1>
-<p>« <a href="/en-US/docs/XUL" title="en-US/XUL">XUL Reference</a> «</p>
-<table class="fullwidth-table"> <tbody> <tr> <th colspan="3">XUL 要素 (按类别排序)</th> </tr> <tr> <td> <p><u><strong>WINDOWS</strong></u></p> <p><a href="/en/XUL/dialog" title="en/XUL/dialog">dialog</a><br> <a href="/en/XUL/overlay" title="en/XUL/overlay">overlay</a><br> <a href="/en/XUL/page" title="en/XUL/page">page</a><br> <a href="/en/XUL/window" title="en/XUL/window">window</a><br> <a href="/en/XUL/wizard" title="en/XUL/wizard">wizard</a><br> <a href="/en/XUL/wizardpage" title="en/XUL/wizardpage">wizardpage</a><br> <a href="/en/XUL/preference" title="en/XUL/preference">preference</a><br> <a href="/en/XUL/preferences" title="en/XUL/preferences">preferences</a><br> <a href="/en/XUL/prefpane" title="en/XUL/prefpane">prefpane</a><br> <a href="/en/XUL/prefwindow" title="en/XUL/prefwindow">prefwindow</a></p> <p><u><strong>WINDOW STRUCTURE</strong></u></p> <p><a href="/en/XUL/browser" title="en/XUL/browser">browser</a><br> <a href="/en/XUL/tabbrowser" title="en/XUL/tabbrowser">tabbrowser</a><br> <a href="/en/XUL/editor" title="en/XUL/editor">editor</a><br> <a href="/en/XUL/iframe" title="en/XUL/iframe">iframe</a><br> <a href="/en/XUL/titlebar" title="en/XUL/titlebar">titlebar</a><br> <a href="/en/XUL/resizer" title="en/XUL/resizer">resizer</a><br> <a href="/en/XUL/statusbar" title="en/XUL/statusbar">statusbar</a><br> <a href="/en/XUL/statusbarpanel" title="en/XUL/statusbarpanel">statusbarpanel</a><br> <a href="/en/XUL/dialogheader" title="en/XUL/dialogheader">dialogheader</a><br> <a href="/en/XUL/notification" title="en/XUL/notification">notification</a><br> <a href="/en/XUL/notificationbox" title="en/XUL/notificationbox">notificationbox</a></p> <p><u><strong>MENUS AND POPUPS</strong></u></p> <p><a href="/en/XUL/menubar" title="en/XUL/menubar">menubar</a><br> <a href="/en/XUL/menu" title="en/XUL/menu">menu</a><br> <a href="/en/XUL/menuitem" title="en/XUL/menuitem">menuitem</a><br> <a href="/en/XUL/menuseparator" title="en/XUL/menuseparator">menuseparator</a><br> <a href="/en/XUL/menupopup" title="en/XUL/menupopup">menupopup</a><br> <a href="/en/XUL/panel" title="en/XUL/panel">panel</a><br> <a href="/en/XUL/tooltip" title="en/XUL/tooltip">tooltip</a><br> <a href="/en/XUL/popupset" title="en/XUL/popupset">popupset</a></p> <p><u><strong>TOOLBARS</strong></u></p> <p><a href="/en/XUL/toolbar" title="en/XUL/toolbar">toolbar</a><br> <a href="/en/XUL/toolbarbutton" title="en/XUL/toolbarbutton">toolbarbutton</a><br> <a href="/en/XUL/toolbargrippy" title="en/XUL/toolbargrippy">toolbargrippy</a><br> <a href="/en/XUL/toolbaritem" title="en/XUL/toolbaritem">toolbaritem</a><br> <a href="/en/XUL/toolbarpalette" title="en/XUL/toolbarpalette">toolbarpalette</a><br> <a href="/en/XUL/toolbarseparator" title="en/XUL/toolbarseparator">toolbarseparator</a><br> <a href="/en/XUL/toolbarset" title="en/XUL/toolbarset">toolbarset</a><br> <a href="/en/XUL/toolbarspacer" title="en/XUL/toolbarspacer">toolbarspacer</a><br> <a href="/en/XUL/toolbarspring" title="en/XUL/toolbarspring">toolbarspring</a><br> <a href="/en/XUL/toolbox" title="en/XUL/toolbox">toolbox</a></p> <p><u><strong>TABS AND GROUPING</strong></u></p> <p><a href="/en/XUL/tabbox" title="en/XUL/tabbox">tabbox</a><br> <a href="/en/XUL/tabs" title="en/XUL/tabs">tabs</a><br> <a href="/en/XUL/tab" title="en/XUL/tab">tab</a><br> <a href="/en/XUL/tabpanels" title="en/XUL/tabpanels">tabpanels</a><br> <a href="/en/XUL/tabpanel" title="en/XUL/tabpanel">tabpanel</a><br> <a href="/en/XUL/groupbox" title="en/XUL/groupbox">groupbox</a><br> <a href="/en/XUL/caption" title="en/XUL/caption">caption</a><br> <a href="/en/XUL/separator" title="en/XUL/separator">separator</a><br> <a href="/en/XUL/spacer" title="en/XUL/spacer">spacer</a></p> </td> <td> <p><u><strong>CONTROLS</strong></u></p> <p><a href="/en/XUL/button" title="en/XUL/button">button</a><br> <a href="/en/XUL/checkbox" title="en/XUL/checkbox">checkbox</a><br> <a href="/en/XUL/colorpicker" title="en/XUL/colorpicker">colorpicker</a><br> <a href="/en/XUL/datepicker" title="en/XUL/datepicker">datepicker</a><br> <a href="/en/XUL/menulist" title="en/XUL/menulist">menulist</a><br> <a href="/en/XUL/progressmeter" title="en/XUL/progressmeter">progressmeter</a><br> <a href="/en/XUL/radio" title="en/XUL/radio">radio</a><br> <a href="/en/XUL/radiogroup" title="en/XUL/radiogroup">radiogroup</a><br> <a href="/en/XUL/scale" title="en/XUL/scale">scale</a><br> <a href="/en/XUL/splitter" title="en/XUL/splitter">splitter</a><br> <a href="/en/XUL/textbox" title="en/XUL/textbox">textbox</a><br> <a href="/En/XUL/Textbox_(Toolkit_autocomplete)" title="en/XUL/textbox_(Firefox_autocomplete)">textbox (Firefox autocomplete)</a><br> <a href="/En/XUL/Textbox_(XPFE_autocomplete)" title="en/XUL/textbox_(Mozilla_autocomplete)">textbox (Mozilla autocomplete)</a><br> <a href="/en/XUL/timepicker" title="en/XUL/timepicker">timepicker</a></p> <p><u><strong>TEXT AND IMAGES</strong></u></p> <p><a href="/en/XUL/description" title="en/XUL/description">description</a><br> <a href="/en/XUL/label" title="en/XUL/label">label</a><br> <a href="/en/XUL/image" title="en/XUL/image">image</a></p> <p><u><strong>LISTS</strong></u></p> <p><a href="/en/XUL/listbox" title="en/XUL/listbox">listbox</a><br> <a href="/en/XUL/listitem" title="en/XUL/listitem">listitem</a><br> <a href="/en/XUL/listcell" title="en/XUL/listcell">listcell</a><br> <a href="/en/XUL/listcol" title="en/XUL/listcol">listcol</a><br> <a href="/en/XUL/listcols" title="en/XUL/listcols">listcols</a><br> <a href="/en/XUL/listhead" title="en/XUL/listhead">listhead</a><br> <a href="/en/XUL/listheader" title="en/XUL/listheader">listheader</a><br> <a href="/en/XUL/richlistbox" title="en/XUL/richlistbox">richlistbox</a><br> <a href="/en/XUL/richlistitem" title="en/XUL/richlistitem">richlistitem</a></p> <p><u><strong>TREES</strong></u></p> <p><a href="/en/XUL/tree" title="en/XUL/tree">tree</a><br> <a href="/en/XUL/treecell" title="en/XUL/treecell">treecell</a><br> <a href="/en/XUL/treechildren" title="en/XUL/treechildren">treechildren</a><br> <a href="/en/XUL/treecol" title="en/XUL/treecol">treecol</a><br> <a href="/en/XUL/treecols" title="en/XUL/treecols">treecols</a><br> <a href="/en/XUL/treeitem" title="en/XUL/treeitem">treeitem</a><br> <a href="/en/XUL/treerow" title="en/XUL/treerow">treerow</a><br> <a href="/en/XUL/treeseparator" title="en/XUL/treeseparator">treeseparator</a></p> <p> </p> </td> <td> <p><u><strong>LAYOUT</strong></u></p> <p><a href="/en/XUL/box" title="en/XUL/box">box</a><br> <a href="/en/XUL/hbox" title="en/XUL/hbox">hbox</a><br> <a href="/en/XUL/vbox" title="en/XUL/vbox">vbox</a><br> <a href="/en/XUL/bbox" title="en/XUL/bbox">bbox</a><br> <a href="/en/XUL/deck" title="en/XUL/deck">deck</a><br> <a href="/en/XUL/stack" title="en/XUL/stack">stack</a><br> <a href="/en/XUL/grid" title="en/XUL/grid">grid</a><br> <a href="/en/XUL/columns" title="en/XUL/columns">columns</a><br> <a href="/en/XUL/column" title="en/XUL/column">column</a><br> <a href="/en/XUL/rows" title="en/XUL/rows">rows</a><br> <a href="/en/XUL/row" title="en/XUL/row">row</a><br> <a href="/en/XUL/scrollbox" title="en/XUL/scrollbox">scrollbox</a></p> <p><u><strong>TEMPLATES</strong></u></p> <p><a href="/en/XUL/action" title="en/XUL/action">action</a><br> <a href="/en/XUL/assign" title="en/XUL/assign">assign</a><br> <a href="/en/XUL/binding" title="en/XUL/binding">binding</a><br> <a href="/en/XUL/bindings" title="en/XUL/bindings">bindings</a><br> <a href="/en/XUL/conditions" title="en/XUL/conditions">conditions</a><br> <a href="/en/XUL/content" title="en/XUL/content">content</a><br> <a href="/en/XUL/member" title="en/XUL/member">member</a><br> <a href="/en/XUL/param" title="en/XUL/param">param</a><br> <a href="/en/XUL/query" title="en/XUL/query">query</a><br> <a href="/en/XUL/queryset" title="en/XUL/queryset">queryset</a><br> <a href="/en/XUL/rule" title="en/XUL/rule">rule</a><br> <a href="/en/XUL/template" title="en/XUL/template">template</a><br> <a href="/en/XUL/textnode" title="en/XUL/textnode">textnode</a><br> <a href="/en/XUL/triple" title="en/XUL/triple">triple</a><br> <a href="/en/XUL/where" title="en/XUL/where">where</a></p> <p><u><strong>SCRIPTING</strong></u></p> <p><a href="/en/XUL/script" title="en/XUL/script">script</a><br> <a href="/en/XUL/commandset" title="en/XUL/commandset">commandset</a><br> <a href="/en/XUL/command" title="en/XUL/command">command</a><br> <a href="/en/XUL/broadcaster" title="en/XUL/broadcaster">broadcaster</a><br> <a href="/en/XUL/broadcasterset" title="en/XUL/broadcasterset">broadcasterset</a><br> <a href="/en/XUL/observes" title="en/XUL/observes">observes</a><br> <a href="/en/XUL/key" title="en/XUL/key">key</a><br> <a href="/en/XUL/keyset" title="en/XUL/keyset">keyset</a><br> <a href="/en/XUL/stringbundle" title="en/XUL/stringbundle">stringbundle</a><br> <a href="/en/XUL/stringbundleset" title="en/XUL/stringbundleset">stringbundleset</a></p> <p><u><strong>HELPER ELEMENTS</strong></u></p> <p><a href="/en/XUL/scrollbar" title="en/XUL/scrollbar">arrowscrollbox<br> </a><a href="/en/XUL/dropmarker" title="en/XUL/dropmarker">dropmarker</a><br> <a href="/en/XUL/grippy" title="en/XUL/grippy">grippy</a><br> <a href="/en/XUL/scrollbar" title="en/XUL/scrollbar">scrollbar</a><br> <a href="/en/XUL/scrollcorner" title="en/XUL/scrollcorner">scrollcorner</a><br> <a href="/en/XUL/spinbuttons" title="en/XUL/spinbuttons">spinbuttons</a></p> </td> </tr> </tbody>
-</table>
-<h3 id="Other XUL lists" name="Other XUL lists">更多XUL相关列表</h3>
-<ul> <li><a href="/ja/XUL/Attribute" title="ja/XUL/Attribute">全部XUL属性</a></li> <li><a href="/ja/XUL/Property" title="ja/XUL/Property">全部XUL特性</a></li> <li><a href="/ja/XUL/Method" title="ja/XUL/Method">全部XUL方法</a></li> <li><a href="/ja/XUL_element_attributes" title="ja/XUL_element_attributes">Attributes defined for all XUL elements</a></li> <li><a href="/de/XUL/Style" rel="internal" title="de/XUL/Style">Style Klassen</a></li> <li><a href="/ja/XUL/Events" title="ja/XUL/Events">Event handlers</a></li> <li><a href="/Ja/XUL/Deprecated//Defunct_Markup" title="Ja/XUL/Deprecated//Defunct_Markup">Deprecated/Defunct Markup</a></li>
-</ul>
-<div class="noinclude"> <p></p>
-</div>