Merge from mozilla-central.
authorDavid Anderson <danderson@mozilla.com>
Fri, 16 Dec 2011 15:06:51 -0800
changeset 105425 40d9cac97367d6680dff27dda793a89f78d7616e
parent 105423 885782dc302aaa982d08593a28e127ca5130e560 (current diff)
parent 82783 cbb0233c7ba868e9be6603d5a3591a33b4072088 (diff)
child 105426 45d78c48063883d06582bb1e30af0fccd446f674
push id23447
push userdanderson@mozilla.com
push dateTue, 11 Sep 2012 17:34:27 +0000
treeherderautoland@fdfaef738a00 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone11.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge from mozilla-central.
accessible/src/atk/nsApplicationAccessibleWrap.cpp
accessible/src/base/nsAccessNode.h
accessible/src/base/nsAccessibilityService.cpp
accessible/src/mac/mozAccessibleWrapper.h
accessible/src/mac/mozTextAccessible.mm
accessible/src/mac/nsAccessibleWrap.h
accessible/src/mac/nsAccessibleWrap.mm
accessible/src/mac/nsDocAccessibleWrap.h
accessible/src/mac/nsDocAccessibleWrap.mm
browser/app/macbuild/Contents/Info.plist.in
browser/app/profile/firefox.js
browser/base/content/NetworkPrioritizer.jsm
browser/base/content/browser.js
browser/base/content/browser.xul
browser/base/content/openLocationLastURL.jsm
browser/base/content/test/browser_NetworkPrioritizer.js
browser/components/migration/src/nsBrowserProfileMigratorUtils.cpp
browser/components/migration/src/nsBrowserProfileMigratorUtils.h
browser/components/migration/src/nsOperaProfileMigrator.cpp
browser/components/migration/src/nsOperaProfileMigrator.h
browser/components/migration/src/nsProfileMigrator.cpp
browser/components/migration/src/nsProfileMigrator.h
browser/components/migration/src/nsSafariProfileMigrator.h
browser/components/sessionstore/src/nsSessionStore.js
browser/components/sessionstore/test/Makefile.in
browser/components/sessionstore/test/browser/Makefile.in
browser/components/sessionstore/test/browser/browser_248970_a.js
browser/components/sessionstore/test/browser/browser_248970_b.js
browser/components/sessionstore/test/browser/browser_248970_b_sample.html
browser/components/sessionstore/test/browser/browser_339445.js
browser/components/sessionstore/test/browser/browser_339445_sample.html
browser/components/sessionstore/test/browser/browser_345898.js
browser/components/sessionstore/test/browser/browser_346337.js
browser/components/sessionstore/test/browser/browser_346337_sample.html
browser/components/sessionstore/test/browser/browser_350525.js
browser/components/sessionstore/test/browser/browser_354894.js
browser/components/sessionstore/test/browser/browser_367052.js
browser/components/sessionstore/test/browser/browser_393716.js
browser/components/sessionstore/test/browser/browser_394759_basic.js
browser/components/sessionstore/test/browser/browser_394759_behavior.js
browser/components/sessionstore/test/browser/browser_394759_privatebrowsing.js
browser/components/sessionstore/test/browser/browser_394759_purge.js
browser/components/sessionstore/test/browser/browser_408470.js
browser/components/sessionstore/test/browser/browser_408470_sample.html
browser/components/sessionstore/test/browser/browser_423132.js
browser/components/sessionstore/test/browser/browser_423132_sample.html
browser/components/sessionstore/test/browser/browser_447951.js
browser/components/sessionstore/test/browser/browser_447951_sample.html
browser/components/sessionstore/test/browser/browser_448741.js
browser/components/sessionstore/test/browser/browser_454908.js
browser/components/sessionstore/test/browser/browser_454908_sample.html
browser/components/sessionstore/test/browser/browser_456342.js
browser/components/sessionstore/test/browser/browser_456342_sample.xhtml
browser/components/sessionstore/test/browser/browser_459906.js
browser/components/sessionstore/test/browser/browser_459906_empty.html
browser/components/sessionstore/test/browser/browser_459906_sample.html
browser/components/sessionstore/test/browser/browser_461634.js
browser/components/sessionstore/test/browser/browser_461743.js
browser/components/sessionstore/test/browser/browser_461743_sample.html
browser/components/sessionstore/test/browser/browser_463205.js
browser/components/sessionstore/test/browser/browser_463205_helper.html
browser/components/sessionstore/test/browser/browser_463205_sample.html
browser/components/sessionstore/test/browser/browser_463206.js
browser/components/sessionstore/test/browser/browser_463206_sample.html
browser/components/sessionstore/test/browser/browser_464199.js
browser/components/sessionstore/test/browser/browser_464620_a.html
browser/components/sessionstore/test/browser/browser_464620_a.js
browser/components/sessionstore/test/browser/browser_464620_b.html
browser/components/sessionstore/test/browser/browser_464620_b.js
browser/components/sessionstore/test/browser/browser_464620_xd.html
browser/components/sessionstore/test/browser/browser_465215.js
browser/components/sessionstore/test/browser/browser_465223.js
browser/components/sessionstore/test/browser/browser_466937.js
browser/components/sessionstore/test/browser/browser_466937_sample.html
browser/components/sessionstore/test/browser/browser_467409-backslashplosion.js
browser/components/sessionstore/test/browser/browser_477657.js
browser/components/sessionstore/test/browser/browser_480148.js
browser/components/sessionstore/test/browser/browser_480893.js
browser/components/sessionstore/test/browser/browser_483330.js
browser/components/sessionstore/test/browser/browser_485482.js
browser/components/sessionstore/test/browser/browser_485482_sample.html
browser/components/sessionstore/test/browser/browser_485563.js
browser/components/sessionstore/test/browser/browser_490040.js
browser/components/sessionstore/test/browser/browser_491168.js
browser/components/sessionstore/test/browser/browser_491577.js
browser/components/sessionstore/test/browser/browser_493467.js
browser/components/sessionstore/test/browser/browser_495495.js
browser/components/sessionstore/test/browser/browser_500328.js
browser/components/sessionstore/test/browser/browser_506482.js
browser/components/sessionstore/test/browser/browser_514751.js
browser/components/sessionstore/test/browser/browser_522375.js
browser/components/sessionstore/test/browser/browser_522545.js
browser/components/sessionstore/test/browser/browser_524745.js
browser/components/sessionstore/test/browser/browser_526613.js
browser/components/sessionstore/test/browser/browser_528776.js
browser/components/sessionstore/test/browser/browser_579868.js
browser/components/sessionstore/test/browser/browser_579879.js
browser/components/sessionstore/test/browser/browser_580512.js
browser/components/sessionstore/test/browser/browser_581593.js
browser/components/sessionstore/test/browser/browser_581937.js
browser/components/sessionstore/test/browser/browser_586068-cascaded_restore.js
browser/components/sessionstore/test/browser/browser_586147.js
browser/components/sessionstore/test/browser/browser_588426.js
browser/components/sessionstore/test/browser/browser_589246.js
browser/components/sessionstore/test/browser/browser_590268.js
browser/components/sessionstore/test/browser/browser_590563.js
browser/components/sessionstore/test/browser/browser_595601-restore_hidden.js
browser/components/sessionstore/test/browser/browser_597071.js
browser/components/sessionstore/test/browser/browser_597315.js
browser/components/sessionstore/test/browser/browser_597315_a.html
browser/components/sessionstore/test/browser/browser_597315_b.html
browser/components/sessionstore/test/browser/browser_597315_c.html
browser/components/sessionstore/test/browser/browser_597315_c1.html
browser/components/sessionstore/test/browser/browser_597315_c2.html
browser/components/sessionstore/test/browser/browser_597315_index.html
browser/components/sessionstore/test/browser/browser_599909.js
browser/components/sessionstore/test/browser/browser_600545.js
browser/components/sessionstore/test/browser/browser_601955.js
browser/components/sessionstore/test/browser/browser_607016.js
browser/components/sessionstore/test/browser/browser_615394-SSWindowState_events.js
browser/components/sessionstore/test/browser/browser_618151.js
browser/components/sessionstore/test/browser/browser_623779.js
browser/components/sessionstore/test/browser/browser_624727.js
browser/components/sessionstore/test/browser/browser_625016.js
browser/components/sessionstore/test/browser/browser_625257.js
browser/components/sessionstore/test/browser/browser_628270.js
browser/components/sessionstore/test/browser/browser_635418.js
browser/components/sessionstore/test/browser/browser_636279.js
browser/components/sessionstore/test/browser/browser_644409-scratchpads.js
browser/components/sessionstore/test/browser/browser_645428.js
browser/components/sessionstore/test/browser/browser_659591.js
browser/components/sessionstore/test/browser/browser_662812.js
browser/components/sessionstore/test/browser/browser_665702-state_session.js
browser/components/sessionstore/test/browser/browser_682507.js
browser/components/sessionstore/test/browser/browser_687710.js
browser/components/sessionstore/test/browser/browser_687710_2.js
browser/components/sessionstore/test/browser/browser_694378.js
browser/components/sessionstore/test/browser/browser_form_restore_events.js
browser/components/sessionstore/test/browser/browser_form_restore_events_sample.html
browser/components/sessionstore/test/browser/head.js
browser/components/sidebar/src/Makefile.in
browser/components/sidebar/src/nsSidebar.js
browser/components/sidebar/src/nsSidebar.manifest
browser/components/tabview/test/Makefile.in
browser/components/tabview/ui.js
browser/components/test/browser/Makefile.in
browser/components/test/browser/browser_bug538331.js
browser/components/wintaskbar/WindowsJumpLists.jsm
browser/components/wintaskbar/WindowsPreviewPerTab.jsm
browser/components/wintaskbar/test/browser_taskbar_preview.js
browser/devtools/highlighter/test/browser_inspector_initialization.js
browser/devtools/jar.mn
browser/devtools/shared/Templater.jsm
browser/devtools/styleinspector/CssHtmlTree.jsm
browser/devtools/styleinspector/test/browser/Makefile.in
browser/devtools/styleinspector/test/browser/browser_bug683672.html
browser/devtools/styleinspector/test/browser/browser_bug683672.js
browser/devtools/styleinspector/test/browser/browser_bug_692400_element_style.js
browser/devtools/styleinspector/test/browser/browser_csslogic_inherited.js
browser/devtools/styleinspector/test/browser/browser_ruleview_editor.js
browser/devtools/styleinspector/test/browser/browser_ruleview_inherit.js
browser/devtools/styleinspector/test/browser/browser_ruleview_manipulation.js
browser/devtools/styleinspector/test/browser/browser_ruleview_override.js
browser/devtools/styleinspector/test/browser/browser_ruleview_ui.js
browser/devtools/styleinspector/test/browser/browser_styleinspector.js
browser/devtools/styleinspector/test/browser/browser_styleinspector_bug_672744_search_filter.js
browser/devtools/styleinspector/test/browser/browser_styleinspector_bug_672746_default_styles.js
browser/devtools/styleinspector/test/browser/browser_styleinspector_bug_689759_no_results_placeholder.js
browser/devtools/styleinspector/test/browser/head.js
browser/devtools/webconsole/HUDService.jsm
browser/devtools/webconsole/test/Makefile.in
browser/devtools/webconsole/test/browser/Makefile.in
browser/devtools/webconsole/test/browser/browser_gcli_inspect.html
browser/devtools/webconsole/test/browser/browser_gcli_inspect.js
browser/devtools/webconsole/test/browser/browser_gcli_integrate.js
browser/devtools/webconsole/test/browser/browser_gcli_require.js
browser/devtools/webconsole/test/browser/browser_gcli_web.js
browser/devtools/webconsole/test/browser/browser_warn_user_about_replaced_api.js
browser/devtools/webconsole/test/browser/browser_webconsole_abbreviate_source_url.js
browser/devtools/webconsole/test/browser/browser_webconsole_basic_net_logging.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_578437_page_reload.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_579412_input_focus.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_580001_closing_after_completion.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_580030_errors_after_page_reload.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_580400_groups.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_580454_timestamp_l10n.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_581231_close_button.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_582201_duplicate_errors.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_583816_tab_focus.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_585237_line_limit.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_585956_console_trace.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_585991_autocomplete_keys.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_585991_autocomplete_popup.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_586388_select_all.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_587617_output_copy.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_588342_document_focus.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_588730_text_node_insertion.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_588967_input_expansion.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_589162_css_filter.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_592442_closing_brackets.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_593003_iframe_wrong_hud.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_594477_clickable_output.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_594497_history_arrow_keys.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_595223_file_uri.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_595350_multiple_windows_and_tabs.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_595934_message_categories.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_597103_deactivateHUDForContext_unfocused_window.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_597136_external_script_errors.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_597136_network_requests_from_chrome.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_597460_filter_scroll.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_597756_reopen_closed_tab.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_598357_jsterm_output.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_599725_response_headers.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_600183_charset.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_601177_log_levels.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_601352_scroll.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_601667_filter_buttons.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_601909_remember_height.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_602572_log_bodies_checkbox.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_603750_websocket.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_611795.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_613013_console_api_iframe.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_613280_jsterm_copy.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_613642_maintain_scroll.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_613642_prune_scroll.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_614793_jsterm_scroll.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_618078_network_exceptions.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_618311_close_panels.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_618311_private_browsing.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_621644_jsterm_dollar.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_622303_persistent_filters.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_626484_output_copy_order.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_630733_response_redirect_headers.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_632275_getters_document_width.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_632347_iterators_generators.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_632817.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_642108_pruneTest.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_642615_autocomplete.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_644419_log_limits.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_646025_console_file_location.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_651501_document_body_autocomplete.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_653531_highlighter_console_helper.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_658368_time_methods.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_659907_console_dir.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_660806_history_nav.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_663443_panel_title.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_664131_console_group.js
browser/devtools/webconsole/test/browser/browser_webconsole_bug_678816.js
browser/devtools/webconsole/test/browser/browser_webconsole_chrome.js
browser/devtools/webconsole/test/browser/browser_webconsole_completion.js
browser/devtools/webconsole/test/browser/browser_webconsole_console_extras.js
browser/devtools/webconsole/test/browser/browser_webconsole_console_logging_api.js
browser/devtools/webconsole/test/browser/browser_webconsole_consoleonpage.js
browser/devtools/webconsole/test/browser/browser_webconsole_copying_multiple_messages_inserts_newlines_in_between.js
browser/devtools/webconsole/test/browser/browser_webconsole_execution_scope.js
browser/devtools/webconsole/test/browser/browser_webconsole_history.js
browser/devtools/webconsole/test/browser/browser_webconsole_hud_getters.js
browser/devtools/webconsole/test/browser/browser_webconsole_js_input_and_output_styling.js
browser/devtools/webconsole/test/browser/browser_webconsole_js_input_expansion.js
browser/devtools/webconsole/test/browser/browser_webconsole_jsterm.js
browser/devtools/webconsole/test/browser/browser_webconsole_live_filtering_of_message_types.js
browser/devtools/webconsole/test/browser/browser_webconsole_live_filtering_on_search_strings.js
browser/devtools/webconsole/test/browser/browser_webconsole_log_node_classes.js
browser/devtools/webconsole/test/browser/browser_webconsole_message_node_id.js
browser/devtools/webconsole/test/browser/browser_webconsole_netlogging.js
browser/devtools/webconsole/test/browser/browser_webconsole_network_panel.js
browser/devtools/webconsole/test/browser/browser_webconsole_notifications.js
browser/devtools/webconsole/test/browser/browser_webconsole_null_and_undefined_output.js
browser/devtools/webconsole/test/browser/browser_webconsole_output_order.js
browser/devtools/webconsole/test/browser/browser_webconsole_position_ui.js
browser/devtools/webconsole/test/browser/browser_webconsole_property_panel.js
browser/devtools/webconsole/test/browser/browser_webconsole_property_provider.js
browser/devtools/webconsole/test/browser/browser_webconsole_registries.js
browser/devtools/webconsole/test/browser/browser_webconsole_view_source.js
browser/devtools/webconsole/test/browser/browser_webconsole_window_zombie.js
browser/devtools/webconsole/test/browser/head.js
browser/devtools/webconsole/test/browser/test-bug-585956-console-trace.html
browser/devtools/webconsole/test/browser/test-bug-593003-iframe-wrong-hud-iframe.html
browser/devtools/webconsole/test/browser/test-bug-593003-iframe-wrong-hud.html
browser/devtools/webconsole/test/browser/test-bug-595934-canvas-css.html
browser/devtools/webconsole/test/browser/test-bug-595934-canvas-css.js
browser/devtools/webconsole/test/browser/test-bug-595934-canvas.html
browser/devtools/webconsole/test/browser/test-bug-595934-canvas.js
browser/devtools/webconsole/test/browser/test-bug-595934-css-loader.css
browser/devtools/webconsole/test/browser/test-bug-595934-css-loader.css^headers^
browser/devtools/webconsole/test/browser/test-bug-595934-css-loader.html
browser/devtools/webconsole/test/browser/test-bug-595934-css-parser.css
browser/devtools/webconsole/test/browser/test-bug-595934-css-parser.html
browser/devtools/webconsole/test/browser/test-bug-595934-dom-events-external2.html
browser/devtools/webconsole/test/browser/test-bug-595934-dom-events-external2.js
browser/devtools/webconsole/test/browser/test-bug-595934-dom-events.html
browser/devtools/webconsole/test/browser/test-bug-595934-dom-html-external.html
browser/devtools/webconsole/test/browser/test-bug-595934-dom-html-external.js
browser/devtools/webconsole/test/browser/test-bug-595934-dom-html.html
browser/devtools/webconsole/test/browser/test-bug-595934-empty-getelementbyid.html
browser/devtools/webconsole/test/browser/test-bug-595934-empty-getelementbyid.js
browser/devtools/webconsole/test/browser/test-bug-595934-html.html
browser/devtools/webconsole/test/browser/test-bug-595934-image.html
browser/devtools/webconsole/test/browser/test-bug-595934-image.jpg
browser/devtools/webconsole/test/browser/test-bug-595934-imagemap.html
browser/devtools/webconsole/test/browser/test-bug-595934-malformedxml-external.html
browser/devtools/webconsole/test/browser/test-bug-595934-malformedxml-external.xml
browser/devtools/webconsole/test/browser/test-bug-595934-malformedxml.xhtml
browser/devtools/webconsole/test/browser/test-bug-595934-svg.xhtml
browser/devtools/webconsole/test/browser/test-bug-595934-workers.html
browser/devtools/webconsole/test/browser/test-bug-595934-workers.js
browser/devtools/webconsole/test/browser/test-bug-597136-external-script-errors.html
browser/devtools/webconsole/test/browser/test-bug-597136-external-script-errors.js
browser/devtools/webconsole/test/browser/test-bug-597756-reopen-closed-tab.html
browser/devtools/webconsole/test/browser/test-bug-599725-response-headers.sjs
browser/devtools/webconsole/test/browser/test-bug-600183-charset.html
browser/devtools/webconsole/test/browser/test-bug-600183-charset.html^headers^
browser/devtools/webconsole/test/browser/test-bug-601177-log-levels.html
browser/devtools/webconsole/test/browser/test-bug-601177-log-levels.js
browser/devtools/webconsole/test/browser/test-bug-603750-websocket.html
browser/devtools/webconsole/test/browser/test-bug-603750-websocket.js
browser/devtools/webconsole/test/browser/test-bug-613013-console-api-iframe.html
browser/devtools/webconsole/test/browser/test-bug-618078-network-exceptions.html
browser/devtools/webconsole/test/browser/test-bug-621644-jsterm-dollar.html
browser/devtools/webconsole/test/browser/test-bug-630733-response-redirect-headers.sjs
browser/devtools/webconsole/test/browser/test-bug-632275-getters.html
browser/devtools/webconsole/test/browser/test-bug-632347-iterators-generators.html
browser/devtools/webconsole/test/browser/test-bug-644419-log-limits.html
browser/devtools/webconsole/test/browser/test-bug-646025-console-file-location.html
browser/devtools/webconsole/test/browser/test-bug-658368-time-methods.html
browser/devtools/webconsole/test/browser/test-bug-678816-content.js
browser/devtools/webconsole/test/browser/test-console-extras.html
browser/devtools/webconsole/test/browser/test-console-replaced-api.html
browser/devtools/webconsole/test/browser/test-console.html
browser/devtools/webconsole/test/browser/test-data.json
browser/devtools/webconsole/test/browser/test-duplicate-error.html
browser/devtools/webconsole/test/browser/test-encoding-ISO-8859-1.html
browser/devtools/webconsole/test/browser/test-error.html
browser/devtools/webconsole/test/browser/test-file-location.js
browser/devtools/webconsole/test/browser/test-filter.html
browser/devtools/webconsole/test/browser/test-image.png
browser/devtools/webconsole/test/browser/test-mutation.html
browser/devtools/webconsole/test/browser/test-network-request.html
browser/devtools/webconsole/test/browser/test-network.html
browser/devtools/webconsole/test/browser/test-observe-http-ajax.html
browser/devtools/webconsole/test/browser/test-own-console.html
browser/devtools/webconsole/test/browser/test-property-provider.html
browser/devtools/webconsole/test/browser/testscript.js
browser/devtools/webconsole/test/browser_gcli_integrate.js
browser/devtools/webconsole/test/browser_gcli_web.js
browser/devtools/webconsole/test/browser_webconsole_bug_595934_message_categories.js
browser/devtools/webconsole/test/browser_webconsole_bug_642108_pruneTest.js
browser/devtools/webconsole/test/browser_webconsole_bug_653531_highlighter_console_helper.js
browser/devtools/webconsole/test/test-console-extras.html
browser/locales/en-US/chrome/browser/browser.dtd
browser/locales/en-US/chrome/browser/devtools/styleinspector.properties
caps/src/nsJSPrincipals.cpp
config/autoconf.mk.in
config/system-headers
configure.in
content/base/public/nsContentUtils.h
content/base/public/nsDOMFile.h
content/base/public/nsDeprecatedOperationList.h
content/base/public/nsIContent.h
content/base/public/nsIDocument.h
content/base/src/nsCSPService.cpp
content/base/src/nsContentAreaDragDrop.cpp
content/base/src/nsContentUtils.cpp
content/base/src/nsDOMAttribute.cpp
content/base/src/nsDOMFile.cpp
content/base/src/nsDocument.cpp
content/base/src/nsDocument.h
content/base/src/nsGenericElement.cpp
content/base/src/nsObjectLoadingContent.cpp
content/base/src/nsObjectLoadingContent.h
content/base/src/nsTextFragment.h
content/base/src/nsWebSocket.cpp
content/base/src/nsWebSocket.h
content/base/src/nsXMLContentSerializer.cpp
content/base/src/nsXMLHttpRequest.cpp
content/base/src/nsXMLHttpRequest.h
content/base/src/nsXMLNameSpaceMap.cpp
content/base/test/Makefile.in
content/canvas/src/CustomQS_Canvas2D.h
content/canvas/src/CustomQS_WebGL.h
content/canvas/src/WebGLContext.cpp
content/canvas/src/WebGLContextGL.cpp
content/canvas/src/nsCanvasRenderingContext2D.cpp
content/canvas/src/nsCanvasRenderingContext2DAzure.cpp
content/events/public/nsIPrivateDOMEvent.h
content/events/src/nsDOMCloseEvent.cpp
content/events/src/nsDOMCloseEvent.h
content/events/src/nsDOMCustomEvent.cpp
content/events/src/nsDOMEvent.cpp
content/events/src/nsDOMEvent.h
content/events/src/nsDOMHashChangeEvent.cpp
content/events/src/nsDOMMouseEvent.cpp
content/events/src/nsDOMPageTransitionEvent.cpp
content/events/src/nsDOMPageTransitionEvent.h
content/events/src/nsDOMPopStateEvent.cpp
content/events/src/nsDOMUIEvent.cpp
content/events/src/nsDOMUIEvent.h
content/events/test/Makefile.in
content/html/content/public/nsHTMLMediaElement.h
content/html/content/src/nsFormSubmission.cpp
content/html/content/src/nsGenericHTMLElement.cpp
content/html/content/src/nsHTMLImageElement.cpp
content/html/content/src/nsHTMLMediaElement.cpp
content/html/content/src/nsHTMLSharedObjectElement.cpp
content/html/document/src/ImageDocument.cpp
content/html/document/src/MediaDocument.cpp
content/html/document/src/MediaDocument.h
content/html/document/src/nsHTMLContentSink.cpp
content/html/document/src/nsHTMLDocument.cpp
content/media/nsBuiltinDecoder.cpp
content/media/nsMediaCache.cpp
content/media/nsMediaCache.h
content/media/nsMediaStream.cpp
content/media/nsMediaStream.h
content/media/webm/nsWebMReader.cpp
content/smil/nsSMILAnimationController.cpp
content/smil/nsSMILAnimationController.h
content/smil/nsSMILCSSValueType.cpp
content/svg/content/src/SVGMotionSMILAnimationFunction.cpp
content/svg/content/src/nsSVGElement.cpp
content/svg/content/src/nsSVGMpathElement.cpp
content/svg/content/src/nsSVGSVGElement.cpp
content/svg/content/src/nsSVGSVGElement.h
content/xbl/src/nsBindingManager.cpp
content/xbl/src/nsXBLContentSink.cpp
content/xbl/src/nsXBLPrototypeBinding.cpp
content/xbl/src/nsXBLPrototypeHandler.cpp
content/xbl/src/nsXBLService.cpp
content/xml/document/src/nsXMLContentSink.cpp
content/xml/document/src/nsXMLDocument.cpp
content/xml/document/src/nsXMLFragmentContentSink.cpp
content/xslt/src/xslt/txMozillaXMLOutput.cpp
content/xul/document/src/nsXULDocument.cpp
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMWindowUtils.cpp
dom/base/nsFocusManager.cpp
dom/base/nsGlobalWindow.cpp
dom/base/nsJSEnvironment.cpp
dom/base/nsJSEnvironment.h
dom/base/nsJSTimeoutHandler.cpp
dom/base/nsStructuredCloneContainer.cpp
dom/indexedDB/AsyncConnectionHelper.cpp
dom/indexedDB/AsyncConnectionHelper.h
dom/indexedDB/IDBCursor.cpp
dom/indexedDB/IDBDatabase.cpp
dom/indexedDB/IDBIndex.cpp
dom/indexedDB/IDBObjectStore.cpp
dom/indexedDB/IDBObjectStore.h
dom/indexedDB/IDBTransaction.cpp
dom/indexedDB/IndexedDatabaseManager.cpp
dom/indexedDB/test/test_bad_keypath.html
dom/interfaces/base/nsIDOMWindowUtils.idl
dom/locales/en-US/chrome/dom/dom.properties
dom/plugins/base/nsNPAPIPlugin.cpp
dom/plugins/base/nsPluginHost.cpp
dom/plugins/base/nsPluginHost.h
dom/plugins/base/nsPluginInstanceOwner.cpp
dom/src/json/nsJSON.cpp
dom/workers/Events.cpp
dom/workers/WorkerPrivate.cpp
dom/workers/WorkerScope.cpp
editor/libeditor/base/EditAggregateTxn.cpp
editor/libeditor/base/EditAggregateTxn.h
editor/libeditor/base/nsEditorUtils.cpp
editor/libeditor/base/nsEditorUtils.h
editor/libeditor/html/TypeInState.cpp
editor/libeditor/html/TypeInState.h
editor/libeditor/html/nsHTMLEditRules.cpp
editor/libeditor/html/nsHTMLEditRules.h
editor/libeditor/html/nsHTMLEditUtils.cpp
editor/libeditor/html/nsHTMLEditUtils.h
editor/libeditor/html/nsHTMLEditor.cpp
editor/libeditor/html/nsHTMLEditor.h
embedding/android/GeckoAppShell.java
embedding/browser/webBrowser/nsDocShellTreeOwner.cpp
embedding/browser/webBrowser/nsDocShellTreeOwner.h
embedding/components/printingui/src/win/nsPrintDialogUtil.cpp
extensions/spellcheck/hunspell/src/mozHunspell.cpp
gfx/angle/Makefile.in
gfx/gl/GLContext.cpp
gfx/gl/GLContext.h
gfx/gl/GLContextProviderEGL.cpp
gfx/layers/ImageLayers.h
gfx/layers/basic/BasicLayers.h
gfx/layers/opengl/ImageLayerOGL.h
gfx/layers/opengl/LayerManagerOGL.cpp
gfx/src/nsRenderingContext.cpp
gfx/src/nsRenderingContext.h
gfx/thebes/gfxDWriteFonts.cpp
gfx/thebes/gfxDWriteFonts.h
gfx/thebes/gfxFT2FontBase.cpp
gfx/thebes/gfxFT2FontBase.h
gfx/thebes/gfxFT2Fonts.cpp
gfx/thebes/gfxFont.cpp
gfx/thebes/gfxFont.h
gfx/thebes/gfxFontconfigUtils.h
gfx/thebes/gfxGDIFont.cpp
gfx/thebes/gfxGDIFont.h
gfx/thebes/gfxMacFont.cpp
gfx/thebes/gfxMacFont.h
gfx/thebes/gfxMacPlatformFontList.mm
gfx/thebes/gfxOS2Fonts.cpp
gfx/thebes/gfxOS2Fonts.h
gfx/thebes/gfxPangoFonts.cpp
gfx/thebes/gfxPlatform.cpp
gfx/thebes/gfxPlatform.h
gfx/thebes/gfxUserFontSet.cpp
image/encoders/bmp/nsBMPEncoder.cpp
image/encoders/ico/nsICOEncoder.cpp
image/encoders/jpeg/nsJPEGEncoder.cpp
image/encoders/png/nsPNGEncoder.cpp
image/encoders/png/nsPNGEncoder.h
image/src/SVGDocumentWrapper.cpp
image/src/SVGDocumentWrapper.h
image/src/imgFrame.cpp
image/src/imgFrame.h
intl/chardet/public/nsICharsetResolver.idl
ipc/chromium/src/base/sha2.cc
ipc/chromium/src/base/sha2.h
ipc/chromium/src/base/sha2_unittest.cc
ipc/chromium/src/base/third_party/nss/README.chromium
ipc/chromium/src/base/third_party/nss/blapi.h
ipc/chromium/src/base/third_party/nss/blapit.h
ipc/chromium/src/base/third_party/nss/sha256.h
ipc/chromium/src/base/third_party/nss/sha512.cc
ipc/testshell/XPCShellEnvironment.cpp
js/jsd/jsd_val.c
js/src/Makefile.in
js/src/assembler/assembler/ARMAssembler.h
js/src/assembler/assembler/AssemblerBufferWithConstantPool.h
js/src/assembler/assembler/MacroAssemblerARM.h
js/src/assembler/assembler/X86Assembler.h
js/src/config/system-headers
js/src/configure.in
js/src/find-child.py
js/src/frontend/BytecodeCompiler.cpp
js/src/frontend/BytecodeCompiler.h
js/src/frontend/BytecodeEmitter.cpp
js/src/frontend/BytecodeEmitter.h
js/src/frontend/FoldConstants.cpp
js/src/frontend/ParseNode.h
js/src/frontend/Parser.cpp
js/src/frontend/Parser.h
js/src/frontend/SemanticAnalysis.cpp
js/src/gc/Barrier.h
js/src/gc/Statistics.h
js/src/ion/Bailouts.h
js/src/ion/IonBuilder.cpp
js/src/ion/IonCode.h
js/src/ion/IonFrameIterator.h
js/src/ion/IonFrames.h
js/src/ion/IonRegisters.h
js/src/ion/IonTypes.h
js/src/ion/TypeOracle.h
js/src/jsanalyze.cpp
js/src/jsanalyze.h
js/src/jsapi-tests/Makefile.in
js/src/jsapi-tests/testDebugger.cpp
js/src/jsapi.cpp
js/src/jsapi.h
js/src/jsarray.cpp
js/src/jsarray.h
js/src/jsatom.cpp
js/src/jsatom.h
js/src/jsatominlines.h
js/src/jscell.h
js/src/jsclass.h
js/src/jscntxt.cpp
js/src/jscntxt.h
js/src/jscntxtinlines.h
js/src/jscompartment.cpp
js/src/jscompartment.h
js/src/jsdate.cpp
js/src/jsdate.h
js/src/jsdbgapi.cpp
js/src/jsdbgapi.h
js/src/jsexn.cpp
js/src/jsfriendapi.cpp
js/src/jsfriendapi.h
js/src/jsfun.cpp
js/src/jsfun.h
js/src/jsfuninlines.h
js/src/jsgc.cpp
js/src/jsgc.h
js/src/jsgcinlines.h
js/src/jsgcmark.cpp
js/src/jsgcstats.h
js/src/jsinfer.cpp
js/src/jsinfer.h
js/src/jsinterp.cpp
js/src/jsinterp.h
js/src/jsinttypes.h
js/src/jsiter.cpp
js/src/jsiter.h
js/src/jsnum.cpp
js/src/jsobj.cpp
js/src/jsobj.h
js/src/jsobjinlines.h
js/src/json.cpp
js/src/jsopcode.cpp
js/src/jsopcode.h
js/src/jsopcode.tbl
js/src/jsotypes.h
js/src/jsprobes.cpp
js/src/jspropertycache.cpp
js/src/jsproxy.cpp
js/src/jsproxy.h
js/src/jsprvtd.h
js/src/jspubtd.h
js/src/jsreflect.cpp
js/src/jsscope.cpp
js/src/jsscript.cpp
js/src/jsscript.h
js/src/jsscriptinlines.h
js/src/jsstr.cpp
js/src/jsstr.h
js/src/jstypedarray.cpp
js/src/jstypedarray.h
js/src/jstypedarrayinlines.h
js/src/jsutil.h
js/src/jsval.h
js/src/jsweakmap.cpp
js/src/jsxdrapi.h
js/src/jsxml.cpp
js/src/methodjit/BaseAssembler.h
js/src/methodjit/Compiler.cpp
js/src/methodjit/Compiler.h
js/src/methodjit/FastArithmetic.cpp
js/src/methodjit/FastOps.cpp
js/src/methodjit/InvokeHelpers.cpp
js/src/methodjit/LoopState.cpp
js/src/methodjit/MethodJIT.h
js/src/methodjit/MonoIC.cpp
js/src/methodjit/PolyIC.cpp
js/src/methodjit/RematInfo.h
js/src/methodjit/StubCalls.cpp
js/src/methodjit/StubCalls.h
js/src/methodjit/TypedArrayIC.h
js/src/shell/js.cpp
js/src/shell/jsworkers.cpp
js/src/vm/Debugger.cpp
js/src/vm/GlobalObject.cpp
js/src/vm/RegExpObject.cpp
js/src/vm/Stack-inl.h
js/src/vm/Stack.cpp
js/src/vm/Stack.h
js/src/vm/StackSpace.h
js/xpconnect/shell/xpcshell.cpp
js/xpconnect/src/XPCComponents.cpp
js/xpconnect/src/XPCConvert.cpp
js/xpconnect/src/XPCDebug.cpp
js/xpconnect/src/XPCJSRuntime.cpp
js/xpconnect/src/XPCMaps.cpp
js/xpconnect/src/XPCMaps.h
js/xpconnect/src/XPCQuickStubs.h
js/xpconnect/src/XPCVariant.cpp
js/xpconnect/src/XPCWrappedJSClass.cpp
js/xpconnect/src/XPCWrappedNative.cpp
js/xpconnect/src/XPCWrappedNativeProto.cpp
js/xpconnect/src/XPCWrappedNativeScope.cpp
js/xpconnect/src/nsXPConnect.cpp
js/xpconnect/src/qsgen.py
js/xpconnect/src/xpcprivate.h
layout/base/RestyleTracker.cpp
layout/base/RestyleTracker.h
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsCSSFrameConstructor.h
layout/base/nsPresArena.cpp
layout/base/nsPresContext.cpp
layout/base/nsPresContext.h
layout/base/nsPresShell.cpp
layout/base/nsPresShell.h
layout/build/Makefile.in
layout/build/nsLayoutModule.cpp
layout/build/nsLayoutStatics.cpp
layout/generic/nsImageMap.cpp
layout/reftests/text/reftest.list
layout/style/AnimationCommon.cpp
layout/style/AnimationCommon.h
layout/style/Loader.cpp
layout/style/nsAnimationManager.cpp
layout/style/nsAnimationManager.h
layout/style/nsCSSParser.cpp
layout/style/nsCSSProps.cpp
layout/style/nsCSSRuleProcessor.cpp
layout/style/nsCSSRuleProcessor.h
layout/style/nsComputedDOMStyle.cpp
layout/style/nsHTMLCSSStyleSheet.cpp
layout/style/nsHTMLCSSStyleSheet.h
layout/style/nsHTMLStyleSheet.cpp
layout/style/nsHTMLStyleSheet.h
layout/style/nsIStyleRuleProcessor.h
layout/style/nsRuleNode.cpp
layout/style/nsStyleAnimation.cpp
layout/style/nsStyleSet.cpp
layout/style/nsStyleSet.h
layout/style/nsTransitionManager.cpp
layout/style/nsTransitionManager.h
layout/style/test/Makefile.in
layout/svg/base/src/nsSVGImageFrame.cpp
layout/svg/base/src/nsSVGPatternFrame.cpp
layout/svg/base/src/nsSVGUtils.cpp
layout/tools/reftest/reftest.js
layout/xul/base/src/nsXULTooltipListener.cpp
layout/xul/base/src/nsXULTooltipListener.h
media/libsydneyaudio/src/sydney_audio_gonk.c
mfbt/Util.h
mobile/android/base/AndroidManifest.xml.in
mobile/android/base/GeckoApp.java
mobile/android/base/GeckoAppShell.java
mobile/android/base/Makefile.in
mobile/android/base/db/BrowserProvider.java
mobile/android/base/resources/drawable/rounded_grey_border.xml
mobile/android/base/resources/drawable/rounded_grey_box.xml
mobile/android/base/resources/layout/abouthome_addon_list_item.xml
mobile/android/base/resources/layout/abouthome_grid_box.xml
mobile/xul/chrome/content/Util.js
mobile/xul/chrome/content/browser.js
mobile/xul/chrome/tests/Makefile.in
mobile/xul/installer/package-manifest.in
mobile/xul/themes/core/jar.mn
modules/libpref/src/Preferences.cpp
modules/libpref/src/init/all.js
modules/libpref/src/nsPrefBranch.cpp
modules/libpref/src/prefapi.cpp
modules/libreg/Makefile.in
modules/libreg/include/Makefile.in
modules/libreg/include/NSReg.h
modules/libreg/include/VerReg.h
modules/libreg/src/Makefile.in
modules/libreg/src/VerReg.c
modules/libreg/src/nr_bufio.c
modules/libreg/src/nr_bufio.h
modules/libreg/src/objs.mk
modules/libreg/src/reg.c
modules/libreg/src/reg.h
modules/libreg/src/vr_stubs.c
modules/libreg/src/vr_stubs.h
modules/libreg/tests/interp.c
modules/libreg/tests/regtest.c
netwerk/base/src/nsSocketTransport2.cpp
netwerk/protocol/http/HttpBaseChannel.cpp
netwerk/protocol/http/HttpBaseChannel.h
netwerk/protocol/http/HttpChannelChild.cpp
netwerk/protocol/http/HttpChannelParent.cpp
netwerk/protocol/http/HttpChannelParent.h
netwerk/protocol/http/PHttpChannel.ipdl
netwerk/protocol/http/SpdySession.cpp
netwerk/protocol/http/SpdySession.h
netwerk/protocol/http/SpdyStream.cpp
netwerk/protocol/http/nsAHttpConnection.h
netwerk/protocol/http/nsAHttpTransaction.h
netwerk/protocol/http/nsHttp.h
netwerk/protocol/http/nsHttpChannel.cpp
netwerk/protocol/http/nsHttpConnection.cpp
netwerk/protocol/http/nsHttpConnection.h
netwerk/protocol/http/nsHttpConnectionInfo.h
netwerk/protocol/http/nsHttpConnectionMgr.cpp
netwerk/protocol/http/nsHttpConnectionMgr.h
netwerk/protocol/http/nsHttpHandler.cpp
netwerk/protocol/http/nsHttpHandler.h
netwerk/protocol/http/nsHttpPipeline.cpp
netwerk/protocol/http/nsHttpPipeline.h
netwerk/protocol/http/nsHttpTransaction.cpp
netwerk/protocol/http/nsHttpTransaction.h
netwerk/protocol/websocket/WebSocketChannel.cpp
netwerk/protocol/websocket/WebSocketChannel.h
netwerk/streamconv/converters/nsIndexedToHTML.cpp
nsprpub/TAG-INFO
nsprpub/config/prdepend.h
other-licenses/android/APKOpen.cpp
parser/html/nsHtml5StreamParser.cpp
parser/html/nsHtml5TreeBuilderCppSupplement.h
parser/html/nsHtml5TreeOperation.cpp
parser/htmlparser/public/nsScannerString.h
parser/htmlparser/src/nsParser.cpp
parser/htmlparser/src/nsParserModule.cpp
parser/htmlparser/src/nsViewSourceHTML.cpp
parser/htmlparser/src/nsViewSourceHTML.h
security/manager/ssl/src/SSLServerCertVerification.cpp
security/manager/ssl/src/nsNSSCallbacks.cpp
security/manager/ssl/src/nsNSSIOLayer.cpp
security/manager/ssl/src/nsNSSIOLayer.h
security/manager/ssl/src/nsSSLStatus.h
services/makefiles.sh
storage/src/mozStorageConnection.cpp
testing/jetpack/jetpack-location.txt
testing/mochitest/pywebsocket/mod_pywebsocket/_stream_hybi06.py
testing/mochitest/pywebsocket/mod_pywebsocket/handshake/hybi06.py
toolkit/components/aboutmemory/tests/chrome/Makefile.in
toolkit/components/aboutmemory/tests/chrome/test_aboutmemory.xul
toolkit/components/aboutmemory/tests/chrome/test_asyncClose_leak.xul
toolkit/components/intl/nsCharsetMenu.cpp
toolkit/components/places/AsyncFaviconHelpers.cpp
toolkit/components/places/History.cpp
toolkit/components/places/nsFaviconService.cpp
toolkit/components/places/nsFaviconService.h
toolkit/components/startup/tests/browser/Makefile.in
toolkit/components/startup/tests/browser/beforeunload.html
toolkit/components/startup/tests/browser/browser_bug511456.js
toolkit/components/startup/tests/browser/browser_bug537449.js
toolkit/components/telemetry/Telemetry.cpp
toolkit/components/telemetry/TelemetryHistograms.h
toolkit/components/telemetry/TelemetryPing.js
toolkit/components/telemetry/tests/unit/test_TelemetryPing.js
toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
toolkit/components/url-classifier/nsUrlClassifierPrefixSet.cpp
toolkit/components/url-classifier/nsUrlClassifierPrefixSet.h
toolkit/content/widgets/videocontrols.xml
toolkit/locales/en-US/chrome/global/videocontrols.dtd
toolkit/mozapps/extensions/AddonRepository.jsm
toolkit/mozapps/extensions/content/extensions.js
toolkit/mozapps/extensions/test/browser/browser_inlinesettings.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_AllOS1.js
toolkit/mozapps/extensions/test/xpcshell/test_gfxBlacklist_AllOS2.js
toolkit/mozapps/installer/packager.mk
toolkit/mozapps/update/nsUpdateService.js
toolkit/xre/nsAppRunner.cpp
view/src/nsViewManager.cpp
widget/public/LookAndFeel.h
widget/public/nsIWidget.h
widget/src/android/AndroidBridge.cpp
widget/src/android/AndroidBridge.h
widget/src/android/AndroidJNI.cpp
widget/src/android/GfxInfo.cpp
widget/src/android/GfxInfo.h
widget/src/android/nsLookAndFeel.cpp
widget/src/android/nsWindow.cpp
widget/src/cocoa/GfxInfo.h
widget/src/cocoa/GfxInfo.mm
widget/src/cocoa/nsCocoaWindow.h
widget/src/cocoa/nsCocoaWindow.mm
widget/src/cocoa/nsMenuItemIconX.mm
widget/src/gtk2/nsDeviceContextSpecG.cpp
widget/src/gtk2/nsDeviceContextSpecG.h
widget/src/gtk2/nsFilePicker.cpp
widget/src/gtk2/nsLookAndFeel.cpp
widget/src/gtk2/nsWindow.cpp
widget/src/gtk2/nsWindow.h
widget/src/windows/GfxInfo.cpp
widget/src/windows/GfxInfo.h
widget/src/windows/JumpListItem.cpp
widget/src/windows/JumpListItem.h
widget/src/windows/nsDragService.cpp
widget/src/windows/nsDragService.h
widget/src/windows/nsFilePicker.cpp
widget/src/windows/nsToolkit.cpp
widget/src/windows/nsToolkit.h
widget/src/windows/nsWindow.h
widget/src/xpwidgets/GfxInfoX11.cpp
widget/src/xpwidgets/GfxInfoX11.h
widget/src/xpwidgets/nsBaseWidget.cpp
widget/src/xpwidgets/nsBaseWidget.h
widget/src/xpwidgets/nsXPLookAndFeel.cpp
xpcom/base/nsAutoPtr.h
xpcom/base/nsMemoryReporterManager.cpp
xpcom/base/nsStackWalk.cpp
xpcom/base/nsTraceRefcntImpl.cpp
xpcom/build/nsXPCOM.h
xpcom/build/nsXPCOMStrings.cpp
xpcom/build/nsXPComInit.cpp
xpcom/ds/nsVariant.cpp
xpcom/glue/nsCOMPtr.h
xpcom/glue/pldhash.cpp
xpcom/glue/pldhash.h
xpcom/io/nsAppFileLocationProvider.cpp
xpcom/io/nsStringStream.cpp
xpcom/string/src/nsStringObsolete.cpp
xpcom/string/src/nsTStringObsolete.cpp
xpcom/stub/nsXPComStub.cpp
xpcom/threads/nsThread.cpp
xpcom/threads/nsThread.h
--- a/accessible/src/atk/nsApplicationAccessibleWrap.cpp
+++ b/accessible/src/atk/nsApplicationAccessibleWrap.cpp
@@ -39,17 +39,16 @@
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsApplicationAccessibleWrap.h"
 
 #include "nsCOMPtr.h"
 #include "nsMai.h"
 #include "prlink.h"
 #include "prenv.h"
-#include "mozilla/Preferences.h"
 #include "nsIGConfService.h"
 #include "nsIServiceManager.h"
 #include "nsAutoPtr.h"
 #include "nsAccessibilityService.h"
 #include "AtkSocketAccessible.h"
 
 #include <gtk/gtk.h>
 #include <atk/atk.h>
@@ -59,20 +58,16 @@ using namespace mozilla;
 typedef GType (* AtkGetTypeType) (void);
 GType g_atk_hyperlink_impl_type = G_TYPE_INVALID;
 static bool sATKChecked = false;
 static PRLibrary *sATKLib = nsnull;
 static const char sATKLibName[] = "libatk-1.0.so.0";
 static const char sATKHyperlinkImplGetTypeSymbol[] =
     "atk_hyperlink_impl_get_type";
 static const char sAccEnv [] = "GNOME_ACCESSIBILITY";
-static const char sUseSystemPrefsKey[] =
-    "config.use_system_prefs";
-static const char sAccessibilityKey [] =
-    "config.use_system_prefs.accessibility";
 static const char sGconfAccessibilityKey[] =
     "/desktop/gnome/interface/accessibility";
 
 /* gail function pointer */
 static guint (* gail_add_global_event_listener) (GSignalEmissionHook listener,
                                                  const gchar *event_type);
 static void (* gail_remove_global_event_listener) (guint remove_listener);
 static void (* gail_remove_key_event_listener) (guint remove_listener);
@@ -625,28 +620,23 @@ nsApplicationAccessibleWrap::Init()
 
     // check if accessibility enabled/disabled by environment variable
     bool isGnomeATEnabled = false;
     const char *envValue = PR_GetEnv(sAccEnv);
     if (envValue) {
         isGnomeATEnabled = !!atoi(envValue);
     } else {
         //check gconf-2 setting
-        if (Preferences::GetBool(sUseSystemPrefsKey, false)) {
-            nsresult rv;
-            nsCOMPtr<nsIGConfService> gconf =
-                do_GetService(NS_GCONFSERVICE_CONTRACTID, &rv);
-            if (NS_SUCCEEDED(rv) && gconf) {
-                gconf->GetBool(NS_LITERAL_CSTRING(sGconfAccessibilityKey),
-                               &isGnomeATEnabled);
-            }
-        } else {
-            isGnomeATEnabled =
-                Preferences::GetBool(sAccessibilityKey, false);
-        }
+      nsresult rv;
+      nsCOMPtr<nsIGConfService> gconf =
+        do_GetService(NS_GCONFSERVICE_CONTRACTID, &rv);
+      if (NS_SUCCEEDED(rv) && gconf) {
+          gconf->GetBool(NS_LITERAL_CSTRING(sGconfAccessibilityKey),
+                         &isGnomeATEnabled);
+      }
     }
 
     if (isGnomeATEnabled) {
         // load and initialize gail library
         nsresult rv = LoadGtkModule(sGail);
         if (NS_SUCCEEDED(rv)) {
             (*sGail.init)();
         }
--- a/accessible/src/base/nsAccessNode.h
+++ b/accessible/src/base/nsAccessNode.h
@@ -209,16 +209,20 @@ protected:
     static void NotifyA11yInitOrShutdown(bool aIsInit);
 
     // Static data, we do our own refcounting for our static data
     static nsIStringBundle *gStringBundle;
 
     static bool gIsFormFillEnabled;
 
 private:
+  nsAccessNode();
+  nsAccessNode(const nsAccessNode&);
+  nsAccessNode& operator =(const nsAccessNode&);
+  
   static nsApplicationAccessible *gApplicationAccessible;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsAccessNode,
                               NS_ACCESSNODE_IMPL_CID)
 
 #endif
 
--- a/accessible/src/base/nsAccessibilityService.cpp
+++ b/accessible/src/base/nsAccessibilityService.cpp
@@ -1194,23 +1194,21 @@ nsAccessibilityService::GetOrCreateAcces
   if (!newAcc) {
     // Elements may implement nsIAccessibleProvider via XBL. This allows them to
     // say what kind of accessible to create.
     newAcc = CreateAccessibleByType(content, aWeakShell);
   }
 
   if (!newAcc) {
     // Create generic accessibles for SVG and MathML nodes.
-    if (content->GetNameSpaceID() == kNameSpaceID_SVG &&
-        content->Tag() == nsGkAtoms::svg) {
+    if (content->IsSVG(nsGkAtoms::svg)) {
       newAcc = new nsEnumRoleAccessible(content, aWeakShell,
                                         nsIAccessibleRole::ROLE_DIAGRAM);
     }
-    else if (content->GetNameSpaceID() == kNameSpaceID_MathML &&
-             content->Tag() == nsGkAtoms::math) {
+    else if (content->IsMathML(nsGkAtoms::math)) {
       newAcc = new nsEnumRoleAccessible(content, aWeakShell,
                                         nsIAccessibleRole::ROLE_EQUATION);
     }
   }
 
   if (!newAcc) {
     newAcc = CreateAccessibleForDeckChild(weakFrame.GetFrame(), content,
                                           aWeakShell);
--- a/accessible/src/mac/Makefile.in
+++ b/accessible/src/mac/Makefile.in
@@ -70,17 +70,16 @@ EXPORTS = \
   nsXULListboxAccessibleWrap.h \
   nsXULTreeGridAccessibleWrap.h \
   nsHyperTextAccessibleWrap.h \
   nsHTMLImageAccessibleWrap.h \
   nsHTMLTableAccessibleWrap.h \
   nsApplicationAccessibleWrap.h \
   mozDocAccessible.h \
   mozAccessible.h \
-  mozAccessibleWrapper.h \
   mozAccessibleProtocol.h \
   mozActionElements.h \
   mozTextAccessible.h \
   nsRoleMap.h \
   $(NULL)
 
 # we don't want the shared lib, but we want to force the creation of a static lib.
 FORCE_STATIC_LIB = 1
--- a/accessible/src/mac/mozAccessible.mm
+++ b/accessible/src/mac/mozAccessible.mm
@@ -51,23 +51,16 @@
 #include "nsIAccessibleText.h"
 #include "nsIAccessibleEditableText.h"
 #include "Relation.h"
 
 #include "nsRootAccessible.h"
 
 using namespace mozilla::a11y;
 
-// These constants are only defined in OS X SDK 10.4, so we define them in order
-// to be able to use for earlier OS versions.
-const NSString *kInstanceDescriptionAttribute = @"AXDescription";       // NSAccessibilityDescriptionAttribute
-const NSString *kTopLevelUIElementAttribute   = @"AXTopLevelUIElement"; // NSAccessibilityTopLevelUIElementAttribute
-const NSString *kTextLinkSubrole              = @"AXTextLink";          // NSAccessibilitySecureTextFieldSubrole
-const NSString *kURLAttribute                 = @"AXURL";
-
 // converts a screen-global point in the cocoa coordinate system (with origo in the bottom-left corner
 // of the screen), into a top-left screen point, that gecko can use.
 static inline void
 ConvertCocoaToGeckoPoint(NSPoint &aInPoint, nsPoint &aOutPoint)
 {
   float mainScreenHeight = [(NSView*)[[NSScreen screens] objectAtIndex:0] frame].size.height;
   aOutPoint.MoveTo ((nscoord)aInPoint.x, (nscoord)(mainScreenHeight - aInPoint.y));
 }
@@ -195,18 +188,18 @@ GetNativeFromGeckoAccessible(nsIAccessib
                                                            NSAccessibilityRoleDescriptionAttribute,
                                                            NSAccessibilityPositionAttribute,
                                                            NSAccessibilityEnabledAttribute,
                                                            NSAccessibilitySizeAttribute,
                                                            NSAccessibilityWindowAttribute,
                                                            NSAccessibilityFocusedAttribute,
                                                            NSAccessibilityHelpAttribute,
                                                            NSAccessibilityTitleUIElementAttribute,
-                                                           kTopLevelUIElementAttribute,
-                                                           kInstanceDescriptionAttribute,
+                                                           NSAccessibilityTopLevelUIElementAttribute,
+                                                           NSAccessibilityDescriptionAttribute,
                                                            nil];
   }
 
   return generalAttributes;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
@@ -233,25 +226,25 @@ GetNativeFromGeckoAccessible(nsIAccessib
   if ([attribute isEqualToString:NSAccessibilitySubroleAttribute])
     return [self subrole];
   if ([attribute isEqualToString:NSAccessibilityEnabledAttribute])
     return [NSNumber numberWithBool:[self isEnabled]];
   if ([attribute isEqualToString:NSAccessibilityValueAttribute])
     return [self value];
   if ([attribute isEqualToString:NSAccessibilityRoleDescriptionAttribute])
     return NSAccessibilityRoleDescription([self role], nil);
-  if ([attribute isEqualToString: (NSString*) kInstanceDescriptionAttribute])
+  if ([attribute isEqualToString:NSAccessibilityDescriptionAttribute])
     return [self customDescription];
   if ([attribute isEqualToString:NSAccessibilityFocusedAttribute])
     return [NSNumber numberWithBool:[self isFocused]];
   if ([attribute isEqualToString:NSAccessibilitySizeAttribute])
     return [self size];
   if ([attribute isEqualToString:NSAccessibilityWindowAttribute])
     return [self window];
-  if ([attribute isEqualToString: (NSString*) kTopLevelUIElementAttribute])
+  if ([attribute isEqualToString:NSAccessibilityTopLevelUIElementAttribute])
     return [self window];
   if ([attribute isEqualToString:NSAccessibilityTitleAttribute])
     return [self title];
   if ([attribute isEqualToString:NSAccessibilityTitleUIElementAttribute]) {
     Relation rel = mGeckoAccessible->RelationByType(nsIAccessibleRelation::RELATION_LABELLED_BY);
     nsAccessible* tempAcc = rel.Next();
     return tempAcc ? GetNativeFromGeckoAccessible(tempAcc) : nil;
   }
@@ -356,32 +349,30 @@ GetNativeFromGeckoAccessible(nsIAccessib
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
 
   if (mParent)
     return mParent;
 
   nsCOMPtr<nsIAccessible> accessibleParent(mGeckoAccessible->GetUnignoredParent());
   if (accessibleParent) {
     id nativeParent = GetNativeFromGeckoAccessible(accessibleParent);
-    if (nativeParent) {
+    if (nativeParent)
       return mParent = GetClosestInterestingAccessible(nativeParent);
-    }
   }
   
   // GetUnignoredParent() returns null when there is no unignored accessible all the way up to
   // the root accessible. so we'll have to return whatever native accessible is above our root accessible 
   // (which might be the owning NSWindow in the application, for example).
   //
   // get the native root accessible, and tell it to return its first parent unignored accessible.
   nsRootAccessible* root = mGeckoAccessible->RootAccessible();
   id nativeParent = GetNativeFromGeckoAccessible(static_cast<nsIAccessible*>(root));
   NSAssert1 (nativeParent, @"!!! we can't find a parent for %@", self);
   
-  mParent = GetClosestInterestingAccessible(nativeParent);
-  return mParent;
+  return mParent = GetClosestInterestingAccessible(nativeParent);
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
 - (BOOL)hasRepresentedView
 {
   return NO;
 }
deleted file mode 100644
--- a/accessible/src/mac/mozAccessibleWrapper.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2006
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Original Author: Håkan Waara <hwaara@gmail.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
- 
-#include "nsAccessibleWrap.h"
-
-#include "nsObjCExceptions.h"
-
-#import "mozAccessible.h"
-
-/* Wrapper class.  
-
-   This is needed because C++-only headers such as nsAccessibleWrap.h must not depend
-   on Objective-C and Cocoa. Classes in accessible/src/base depend on them, and other modules in turn
-   depend on them, so in the end all of Mozilla would end up having to link against Cocoa and be renamed .mm :-)
-
-   In order to have a mozAccessible object wrapped, the user passes itself (nsAccessible*) and the subclass of
-   mozAccessible that should be instantiated.
-
-   In the header file, the AccessibleWrapper is used as the member, and is forward-declared (because this header
-   cannot be #included directly.
-*/
-
-struct AccessibleWrapper {
-  mozAccessible *object;
-  AccessibleWrapper (nsAccessibleWrap *parent, Class classType) {
-    NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
-
-    object = (mozAccessible*)[[classType alloc] initWithAccessible:parent];
-
-    NS_OBJC_END_TRY_ABORT_BLOCK;
-  }
-
-  ~AccessibleWrapper () {
-    NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
-
-    // if some third-party still holds on to the object, it's important that it is marked
-    // as expired, so it can't do any harm (e.g., walk into an expired hierarchy of nodes).
-    [object expire];
-    
-    [object release];
-
-    NS_OBJC_END_TRY_ABORT_BLOCK;
-  }
-
-  mozAccessible* getNativeObject () {
-    return object;
-  }
- 
-  bool isIgnored () {
-    NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
-
-    return (bool)[object accessibilityIsIgnored];
-
-    NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(false);
-  }
-};
--- a/accessible/src/mac/mozActionElements.mm
+++ b/accessible/src/mac/mozActionElements.mm
@@ -38,19 +38,16 @@
 
 #import "mozActionElements.h"
 #import "nsIAccessible.h"
 
 #include "nsObjCExceptions.h"
 
 using namespace mozilla::a11y;
 
-extern const NSString *kInstanceDescriptionAttribute; // NSAccessibilityDescriptionAttribute
-extern const NSString *kTopLevelUIElementAttribute;   // NSAccessibilityTopLevelUIElementAttribute
-
 enum CheckboxValue {
   // these constants correspond to the values in the OS
   kUnchecked = 0,
   kChecked = 1,
   kMixed = 2
 };
 
 @implementation mozButtonAccessible
@@ -62,22 +59,22 @@ enum CheckboxValue {
   static NSArray *attributes = nil;
   if (!attributes) {
     attributes = [[NSArray alloc] initWithObjects:NSAccessibilityParentAttribute, // required
                                                   NSAccessibilityRoleAttribute, // required
                                                   NSAccessibilityPositionAttribute, // required
                                                   NSAccessibilitySizeAttribute, // required
                                                   NSAccessibilityWindowAttribute, // required
                                                   NSAccessibilityPositionAttribute, // required
-                                                  kTopLevelUIElementAttribute, // required
+                                                  NSAccessibilityTopLevelUIElementAttribute, // required
                                                   NSAccessibilityHelpAttribute,
                                                   NSAccessibilityEnabledAttribute, // required
                                                   NSAccessibilityFocusedAttribute, // required
                                                   NSAccessibilityTitleAttribute, // required
-                                                  kInstanceDescriptionAttribute,
+                                                  NSAccessibilityDescriptionAttribute,
                                                   nil];
   }
   return attributes;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
 - (id)accessibilityAttributeValue:(NSString *)attribute
@@ -189,23 +186,23 @@ enum CheckboxValue {
   static NSArray *attributes = nil;
   
   if (!attributes) {
     attributes = [[NSArray alloc] initWithObjects:NSAccessibilityParentAttribute, // required
                                                   NSAccessibilityPositionAttribute, // required
                                                   NSAccessibilityRoleAttribute, // required
                                                   NSAccessibilitySizeAttribute, // required
                                                   NSAccessibilityWindowAttribute, // required
-                                                  kTopLevelUIElementAttribute, // required
+                                                  NSAccessibilityTopLevelUIElementAttribute, // required
                                                   NSAccessibilityHelpAttribute,
                                                   NSAccessibilityEnabledAttribute, // required
                                                   NSAccessibilityFocusedAttribute, // required
                                                   NSAccessibilityTitleAttribute, // required for popupmenus, and for menubuttons with a title
                                                   NSAccessibilityChildrenAttribute, // required
-                                                  kInstanceDescriptionAttribute, // required if it has no title attr
+                                                  NSAccessibilityDescriptionAttribute, // required if it has no title attr
                                                   nil];
   }
   return attributes;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
 - (id)accessibilityAttributeValue:(NSString *)attribute
--- a/accessible/src/mac/mozDocAccessible.mm
+++ b/accessible/src/mac/mozDocAccessible.mm
@@ -76,22 +76,21 @@ static id <mozAccessible, mozView> getNa
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
 - (id)accessibilityAttributeValue:(NSString *)attribute
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
   
-  if ([attribute isEqualToString:NSAccessibilityMainAttribute]) {
+  if ([attribute isEqualToString:NSAccessibilityMainAttribute])
     return [NSNumber numberWithBool:[[self window] isMainWindow]];
-  }
-  if ([attribute isEqualToString:NSAccessibilityMinimizedAttribute]) {
+  if ([attribute isEqualToString:NSAccessibilityMinimizedAttribute])
     return [NSNumber numberWithBool:[[self window] isMiniaturized]];
-  }
+
   return [super accessibilityAttributeValue:attribute];
   
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
 
 // return the AXParent that our parallell NSView tells us about.
 - (id)parent
--- a/accessible/src/mac/mozTextAccessible.mm
+++ b/accessible/src/mac/mozTextAccessible.mm
@@ -1,18 +1,15 @@
 #include "nsAccessibleWrap.h"
 #include "nsObjCExceptions.h"
 
 #import "mozTextAccessible.h"
 
 using namespace mozilla::a11y;
 
-extern const NSString *kInstanceDescriptionAttribute; // NSAccessibilityDescriptionAttribute
-extern const NSString *kTopLevelUIElementAttribute;   // NSAccessibilityTopLevelUIElementAttribute
-
 @interface mozTextAccessible (Private)
 - (NSString*)subrole;
 - (NSString*)selectedText;
 - (NSValue*)selectedTextRange;
 - (long)textLength;
 - (BOOL)isReadOnly;
 - (void)setText:(NSString*)newText;
 @end
@@ -50,18 +47,18 @@ extern const NSString *kTopLevelUIElemen
                                                            NSAccessibilityValueAttribute, // required
                                                            NSAccessibilitySubroleAttribute,
                                                            NSAccessibilityRoleDescriptionAttribute,
                                                            NSAccessibilityPositionAttribute, // required
                                                            NSAccessibilitySizeAttribute, // required
                                                            NSAccessibilityWindowAttribute, // required
                                                            NSAccessibilityFocusedAttribute, // required
                                                            NSAccessibilityEnabledAttribute, // required
-                                                           kTopLevelUIElementAttribute, // required (on OS X 10.4+)
-                                                           kInstanceDescriptionAttribute, // required (on OS X 10.4+)
+                                                           NSAccessibilityTopLevelUIElementAttribute, // required
+                                                           NSAccessibilityDescriptionAttribute, // required
                                                            /* text-specific attributes */
                                                            NSAccessibilitySelectedTextAttribute, // required
                                                            NSAccessibilitySelectedTextRangeAttribute, // required
                                                            NSAccessibilityNumberOfCharactersAttribute, // required
                                                            // TODO: NSAccessibilityVisibleCharacterRangeAttribute, // required
                                                            // TODO: NSAccessibilityInsertionPointLineNumberAttribute
                                                            nil];
   }
@@ -251,18 +248,18 @@ extern const NSString *kTopLevelUIElemen
                                                            NSAccessibilityPositionAttribute, // required
                                                            NSAccessibilitySizeAttribute, // required
                                                            NSAccessibilityWindowAttribute, // required
                                                            NSAccessibilityFocusedAttribute, // required
                                                            NSAccessibilityEnabledAttribute, // required
                                                            NSAccessibilityChildrenAttribute, // required
                                                            NSAccessibilityHelpAttribute,
                                                            // NSAccessibilityExpandedAttribute, // required
-                                                           kTopLevelUIElementAttribute, // required (on OS X 10.4+)
-                                                           kInstanceDescriptionAttribute, // required (on OS X 10.4+)
+                                                           NSAccessibilityTopLevelUIElementAttribute, // required
+                                                           NSAccessibilityDescriptionAttribute, // required
                                                            /* text-specific attributes */
                                                            NSAccessibilitySelectedTextAttribute, // required
                                                            NSAccessibilitySelectedTextRangeAttribute, // required
                                                            NSAccessibilityNumberOfCharactersAttribute, // required
                                                            // TODO: NSAccessibilityVisibleCharacterRangeAttribute, // required
                                                            // TODO: NSAccessibilityInsertionPointLineNumberAttribute
                                                            nil];
   }
--- a/accessible/src/mac/nsAccessibleWrap.h
+++ b/accessible/src/mac/nsAccessibleWrap.h
@@ -50,27 +50,26 @@
 #include "States.h"
 
 #include "nsCOMPtr.h"
 #include "nsRect.h"
 
 #include "nsTArray.h"
 #include "nsAutoPtr.h"
 
-struct AccessibleWrapper;
+#if defined(__OBJC__)
+@class mozAccessible;
+#endif
 
 class nsAccessibleWrap : public nsAccessible
 {
   public: // construction, destruction
     nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell);
     virtual ~nsAccessibleWrap();
     
-    // creates the native accessible connected to this one.
-    virtual bool Init ();
-    
     // get the native obj-c object (mozAccessible)
     NS_IMETHOD GetNativeInterface (void **aOutAccessible);
     
     // the objective-c |Class| type that this accessible's native object
     // should be instantied with.   used on runtime to determine the
     // right type for this accessible's associated native object.
     virtual Class GetNativeType ();
 
@@ -86,26 +85,52 @@ class nsAccessibleWrap : public nsAccess
     bool HasPopup () {
       return (NativeState() & mozilla::a11y::states::HASPOPUP);
     }
     
     // return this accessible's all children, adhering to "flat" accessibles by not returning their children.
     void GetUnignoredChildren(nsTArray<nsRefPtr<nsAccessibleWrap> > &aChildrenArray);
     virtual already_AddRefed<nsIAccessible> GetUnignoredParent();
     
-  protected:
+protected:
 
-    virtual nsresult FirePlatformEvent(AccEvent* aEvent);
+  virtual nsresult FirePlatformEvent(AccEvent* aEvent);
 
   /**
    * Return true if the parent doesn't have children to expose to AT.
    */
   bool AncestorIsFlat();
 
-    // Wrapper around our native object.
-    AccessibleWrapper *mNativeWrapper;
+  /**
+   * Get the native object. Create it if needed.
+   */
+#if defined(__OBJC__)
+  mozAccessible* GetNativeObject();
+#else
+  id GetNativeObject();
+#endif
+
+private:
+
+  /**
+   * Our native object. Private because its creation is done lazily.
+   * Don't access it directly. Ever. Unless you are GetNativeObject() or Shutdown()
+   */
+#if defined(__OBJC__)
+  // if we are in Objective-C, we use the actual Obj-C class.
+  mozAccessible* mNativeObject;
+#else
+  id mNativeObject;
+#endif
+
+  /**
+   * We have created our native. This does not mean there is one.
+   * This can never go back to false.
+   * We need it because checking whether we need a native object cost time.
+   */
+  bool mNativeInited;  
 };
 
 // Define unsupported wrap classes here
 typedef class nsHTMLTableCellAccessible    nsHTMLTableCellAccessibleWrap;
 typedef class nsHTMLTableAccessible        nsHTMLTableAccessibleWrap;
 
 #endif
--- a/accessible/src/mac/nsAccessibleWrap.mm
+++ b/accessible/src/mac/nsAccessibleWrap.mm
@@ -36,59 +36,54 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsDocAccessible.h"
 #include "nsObjCExceptions.h"
 
 #import "nsRoleMap.h"
 
-#import "mozAccessibleWrapper.h"
 #import "mozAccessible.h"
 #import "mozActionElements.h"
 #import "mozTextAccessible.h"
 
 nsAccessibleWrap::
   nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell) :
-  nsAccessible(aContent, aShell), mNativeWrapper(nsnull)
+  nsAccessible(aContent, aShell), mNativeObject(nil),
+  mNativeInited(false)
 {
 }
 
 nsAccessibleWrap::~nsAccessibleWrap()
 {
-  if (mNativeWrapper) {
-    delete mNativeWrapper;
-    mNativeWrapper = nsnull;
-  }
 }
 
-bool
-nsAccessibleWrap::Init () 
+mozAccessible* 
+nsAccessibleWrap::GetNativeObject()
 {
-  if (!nsAccessible::Init())
-    return false;
-
-  if (!mNativeWrapper && !AncestorIsFlat()) {
-    // Create our native object using the class type specified in GetNativeType().
-    mNativeWrapper = new AccessibleWrapper (this, GetNativeType());
-    if (!mNativeWrapper)
-      return false;
-  }
-
-  return true;
+  NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
+  
+  if (!mNativeInited && !mNativeObject && !IsDefunct() && !AncestorIsFlat())
+    mNativeObject = [[GetNativeType() alloc] initWithAccessible:this];
+  
+  mNativeInited = true;
+  
+  return mNativeObject;
+  
+  NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
 NS_IMETHODIMP
 nsAccessibleWrap::GetNativeInterface (void **aOutInterface) 
 {
-  if (mNativeWrapper) {
-    *aOutInterface = (void**)mNativeWrapper->getNativeObject();
-    return NS_OK;
-  }
-  return NS_ERROR_FAILURE;
+  NS_ENSURE_ARG_POINTER(aOutInterface);
+
+  *aOutInterface = static_cast<void*>(GetNativeObject());
+    
+  return *aOutInterface ? NS_OK : NS_ERROR_FAILURE;
 }
 
 // overridden in subclasses to create the right kind of object. by default we create a generic
 // 'mozAccessible' node.
 Class
 nsAccessibleWrap::GetNativeType () 
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
@@ -136,21 +131,26 @@ nsAccessibleWrap::GetNativeType ()
 }
 
 // this method is very important. it is fired when an accessible object "dies". after this point
 // the object might still be around (because some 3rd party still has a ref to it), but it is
 // in fact 'dead'.
 void
 nsAccessibleWrap::Shutdown ()
 {
-  if (mNativeWrapper) {
-    delete mNativeWrapper;
-    mNativeWrapper = nsnull;
+  // this ensure we will not try to re-create the native object.
+  mNativeInited = true;
+
+  // we really intend to access the member directly.
+  if (mNativeObject) {
+    [mNativeObject expire];
+    [mNativeObject release];
+    mNativeObject = nil;
   }
-  
+
   nsAccessible::Shutdown();
 }
 
 nsresult
 nsAccessibleWrap::HandleAccEvent(AccEvent* aEvent)
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
@@ -196,31 +196,34 @@ nsAccessibleWrap::FirePlatformEvent(AccE
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 void
 nsAccessibleWrap::InvalidateChildren()
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
 
-  if (mNativeWrapper) {
-    mozAccessible *object = mNativeWrapper->getNativeObject();
-    [object invalidateChildren];
-  }
+  [GetNativeObject() invalidateChildren];
+
   nsAccessible::InvalidateChildren();
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 // if we for some reason have no native accessible, we should be skipped over (and traversed)
 // when fetching all unignored children, etc.  when counting unignored children, we will not be counted.
 bool 
 nsAccessibleWrap::IsIgnored() 
 {
-  return (mNativeWrapper == nsnull) || mNativeWrapper->isIgnored();
+  NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
+  
+  mozAccessible* nativeObject = GetNativeObject();
+  return (!nativeObject) || [nativeObject accessibilityIsIgnored];
+  
+  NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(false);
 }
 
 void
 nsAccessibleWrap::GetUnignoredChildren(nsTArray<nsRefPtr<nsAccessibleWrap> > &aChildrenArray)
 {
   // we're flat; there are no children.
   if (nsAccUtils::MustPrune(this))
     return;
--- a/accessible/src/mac/nsDocAccessibleWrap.h
+++ b/accessible/src/mac/nsDocAccessibleWrap.h
@@ -43,17 +43,11 @@
 
 class nsDocAccessibleWrap: public nsDocAccessible
 {
 public:
   nsDocAccessibleWrap(nsIDocument *aDocument, nsIContent *aRootContent,
                       nsIWeakReference *aShell);
   virtual ~nsDocAccessibleWrap();
 
-  // nsIAccessNode
-
-  /**
-   * Creates the native accessible connected to this one.
-   */
-  virtual bool Init();
 };
 
 #endif
--- a/accessible/src/mac/nsDocAccessibleWrap.mm
+++ b/accessible/src/mac/nsDocAccessibleWrap.mm
@@ -32,38 +32,21 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsDocAccessibleWrap.h"
 
-#import "mozAccessibleWrapper.h"
+#import "mozAccessible.h"
 
 nsDocAccessibleWrap::
   nsDocAccessibleWrap(nsIDocument *aDocument, nsIContent *aRootContent,
                       nsIWeakReference *aShell) :
   nsDocAccessible(aDocument, aRootContent, aShell)
 {
 }
 
 nsDocAccessibleWrap::~nsDocAccessibleWrap()
 {
 }
 
-bool
-nsDocAccessibleWrap::Init () 
-{
-  if (!nsDocAccessible::Init())
-    return false;
-
-  NS_ASSERTION(!mNativeWrapper, "nsDocAccessibleWrap::Init() called more than once!");
-
-  if (!mNativeWrapper) {
-    // Create our native object using the class type specified in GetNativeType().
-    mNativeWrapper = new AccessibleWrapper (this, GetNativeType());
-    if (!mNativeWrapper)
-      return false;
-  }
-
-  return true;
-}
--- a/accessible/src/mac/nsRootAccessibleWrap.mm
+++ b/accessible/src/mac/nsRootAccessibleWrap.mm
@@ -40,19 +40,16 @@
 
 #include "mozDocAccessible.h"
 
 #include "nsCOMPtr.h"
 #include "nsObjCExceptions.h"
 #include "nsIWidget.h"
 #include "nsIViewManager.h"
 
-#import "mozAccessibleWrapper.h"
-
-
 nsRootAccessibleWrap::
   nsRootAccessibleWrap(nsIDocument *aDocument, nsIContent *aRootContent,
                        nsIWeakReference *aShell) :
   nsRootAccessible(aDocument, aRootContent, aShell)
 {
 }
 
 nsRootAccessibleWrap::~nsRootAccessibleWrap()
--- a/b2g/Makefile.in
+++ b/b2g/Makefile.in
@@ -37,12 +37,12 @@
 
 DEPTH      = ..
 topsrcdir  = @top_srcdir@
 srcdir     = @srcdir@
 VPATH      = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-DIRS = chrome locales app
+DIRS = chrome components locales app
 
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/testing/testsuite-targets.mk
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -60,21 +60,18 @@ pref("browser.cache.disk.smart_size.firs
 
 pref("browser.cache.memory.enable", true);
 pref("browser.cache.memory.capacity", 1024); // kilobytes
 
 /* image cache prefs */
 pref("image.cache.size", 1048576); // bytes
 
 /* offline cache prefs */
-pref("browser.offline-apps.notify", true);
-pref("browser.cache.offline.enable", true);
-pref("browser.cache.offline.capacity", 5120); // kilobytes
-pref("offline-apps.quota.max", 2048); // kilobytes
-pref("offline-apps.quota.warn", 1024); // kilobytes
+pref("browser.offline-apps.notify", false);
+pref("browser.cache.offline.enable", false);
 
 /* protocol warning prefs */
 pref("network.protocol-handler.warn-external.tel", false);
 pref("network.protocol-handler.warn-external.mailto", false);
 pref("network.protocol-handler.warn-external.vnd.youtube", false);
 
 /* http prefs */
 pref("network.http.pipelining", true);
--- a/b2g/chrome/content/shell.js
+++ b/b2g/chrome/content/shell.js
@@ -63,24 +63,33 @@ XPCOMUtils.defineLazyGetter(Services, 'f
 // a local http server listening on http://127.0.0.1:8888 and
 // http://localhost:8888.
 function startupHttpd(baseDir, port) {
   const httpdURL = 'chrome://browser/content/httpd.js';
   let httpd = {};
   Services.scriptloader.loadSubScript(httpdURL, httpd);
   let server = new httpd.nsHttpServer();
   server.registerDirectory('/', new LocalFile(baseDir));
+  server.registerContentType('appcache', 'text/cache-manifest');
   server.start(port);
 }
 
-// XXX until we have a security model, just let the pre-installed
-// app used indexedDB.
-function allowIndexedDB(url) {
-  let uri = Services.io.newURI(url, null, null);
-  Services.perms.add(uri, 'indexedDB', Ci.nsIPermissionManager.ALLOW_ACTION);
+// FIXME Bug 707625
+// until we have a proper security model, add some rights to
+// the pre-installed web applications 
+function addPermissions(urls) {
+  let permissions = ['indexedDB', 'webapps-manage', 'offline-app'];
+  urls.forEach(function(url) {
+    let uri = Services.io.newURI(url, null, null);
+    let allow = Ci.nsIPermissionManager.ALLOW_ACTION;
+    
+    permissions.forEach(function(permission) {
+      Services.perms.add(uri, permission, allow);
+    });
+  });
 }
 
 
 var shell = {
   get home() {
     delete this.home;
     return this.home = document.getElementById('homescreen');
   },
@@ -109,16 +118,17 @@ var shell = {
     let homeURL = this.homeURL;
     if (!homeURL) {
       let msg = 'Fatal error during startup: [No homescreen found]';
       return alert(msg);
     }
 
     window.controllers.appendController(this);
     window.addEventListener('keypress', this);
+    window.addEventListener('MozApplicationManifest', this);
     this.home.addEventListener('load', this, true);
 
     try {
       Services.io.offline = false;
 
       let fileScheme = 'file://';
       if (homeURL.substring(0, fileScheme.length) == fileScheme) {
         homeURL = homeURL.replace(fileScheme, '');
@@ -128,30 +138,31 @@ var shell = {
         baseDir = baseDir.join('/');
 
         const SERVER_PORT = 8888;
         startupHttpd(baseDir, SERVER_PORT);
 
         let baseHost = 'http://localhost';
         homeURL = homeURL.replace(baseDir, baseHost + ':' + SERVER_PORT);
       }
-      allowIndexedDB(homeURL);
+      addPermissions([homeURL]);
     } catch (e) {
       let msg = 'Fatal error during startup: [' + e + '[' + homeURL + ']';
       return alert(msg);
     }
 
     let browser = this.home;
     browser.homePage = homeURL;
     browser.goHome();
   },
 
   stop: function shell_stop() {
     window.controllers.removeController(this);
     window.removeEventListener('keypress', this);
+    window.removeEventListener('MozApplicationManifest', this);
   },
 
   supportsCommand: function shell_supportsCommand(cmd) {
     let isSupported = false;
     switch (cmd) {
       case 'cmd_close':
         isSupported = true;
         break;
@@ -164,17 +175,17 @@ var shell = {
 
   isCommandEnabled: function shell_isCommandEnabled(cmd) {
     return true;
   },
 
   doCommand: function shell_doCommand(cmd) {
     switch (cmd) {
       case 'cmd_close':
-        this.sendEvent(this.home.contentWindow, 'appclose');
+        this.home.contentWindow.postMessage('appclose', '*');
         break;
     }
   },
 
   handleEvent: function shell_handleEvent(evt) {
     switch (evt.type) {
       case 'keypress':
         switch (evt.keyCode) {
@@ -190,16 +201,50 @@ var shell = {
             this.doCommand('cmd_close');
             break;
         }
         break;
       case 'load':
         this.home.removeEventListener('load', this, true);
         this.sendEvent(window, 'ContentStart');
         break;
+      case 'MozApplicationManifest':
+        try {
+          if (!Services.prefs.getBoolPref('browser.cache.offline.enable'))
+            return;
+
+          let contentWindow = evt.originalTarget.defaultView;
+          let documentElement = contentWindow.document.documentElement;
+          if (!documentElement)
+            return;
+
+          let manifest = documentElement.getAttribute("manifest");
+          if (!manifest)
+            return;
+
+          let documentURI = contentWindow.document.documentURIObject;
+          if (!Services.perms.testPermission(documentURI, 'offline-app')) {
+            if (Services.prefs.getBoolPref('browser.offline-apps.notify')) {
+              // FIXME Bug 710729 - Add a UI for offline cache notifications
+              return;
+            }
+            return;
+          }
+
+          Services.perms.add(documentURI, 'offline-app',
+                             Ci.nsIPermissionManager.ALLOW_ACTION);
+
+          let manifestURI = Services.io.newURI(manifest, null, documentURI);
+          let updateService = Cc['@mozilla.org/offlinecacheupdate-service;1']
+                              .getService(Ci.nsIOfflineCacheUpdateService);
+          updateService.scheduleUpdate(manifestURI, documentURI, window);
+        } catch (e) {
+          dump('Error while creating offline cache: ' + e + '\n');
+        }
+        break;
     }
   },
   sendEvent: function shell_sendEvent(content, type, details) {
     let event = content.document.createEvent('CustomEvent');
     event.initCustomEvent(type, true, true, details ? details : {});
     content.dispatchEvent(event);
   }
 };
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/b2g/components/Makefile.in
@@ -0,0 +1,51 @@
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is Mozilla.
+#
+# The Initial Developer of the Original Code is
+# the Mozilla Foundation <http://www.mozilla.org/>.
+# Portions created by the Initial Developer are Copyright (C) 2011
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 2 or later (the "GPL"), or
+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
+
+DEPTH      = ../..
+topsrcdir  = @top_srcdir@
+srcdir     = @srcdir@
+VPATH      = @srcdir@
+
+include $(DEPTH)/config/autoconf.mk
+
+MODULE = B2GComponents
+XPIDL_MODULE = B2GComponents
+
+EXTRA_PP_COMPONENTS = \
+        B2GComponents.manifest \
+        $(NULL)
+
+include $(topsrcdir)/config/rules.mk
--- a/b2g/makefiles.sh
+++ b/b2g/makefiles.sh
@@ -37,16 +37,17 @@
 add_makefiles "
 netwerk/locales/Makefile
 dom/locales/Makefile
 toolkit/locales/Makefile
 security/manager/locales/Makefile
 b2g/app/Makefile
 $MOZ_BRANDING_DIRECTORY/Makefile
 b2g/chrome/Makefile
+b2g/components/Makefile
 b2g/installer/Makefile
 b2g/locales/Makefile
 b2g/Makefile"
 
 if test -n "$MOZ_UPDATE_PACKAGING"; then
    add_makefiles "
      tools/update-packaging/Makefile
    "
--- a/browser/Makefile.in
+++ b/browser/Makefile.in
@@ -42,16 +42,17 @@ VPATH     = @srcdir@
 
 include $(topsrcdir)/config/config.mk
 
 PARALLEL_DIRS = \
   base \
   components \
   fuel \
   locales \
+  modules \
   themes \
   $(NULL)
 
 DIRS = \
   devtools \
   app \
   $(NULL)
 
--- a/browser/app/Makefile.in
+++ b/browser/app/Makefile.in
@@ -175,69 +175,67 @@ endif
 libs:: $(srcdir)/profile/prefs.js
 	$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/defaults/profile
 
 libs:: $(srcdir)/blocklist.xml
 	$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 
-APP_NAME = $(MOZ_APP_DISPLAYNAME)
+MAC_APP_NAME = $(MOZ_APP_DISPLAYNAME)
 
 ifdef MOZ_DEBUG
-APP_NAME := $(APP_NAME)Debug
+MAC_APP_NAME := $(MAC_APP_NAME)Debug
 endif
 
-LOWER_APP_NAME = $(shell echo $(APP_NAME) | tr '[A-Z]' '[a-z]')
+LOWER_MAC_APP_NAME = $(shell echo $(MAC_APP_NAME) | tr '[A-Z]' '[a-z]')
 
 AB_CD = $(MOZ_UI_LOCALE)
 
 AB := $(firstword $(subst -, ,$(AB_CD)))
 
 clean clobber repackage::
-	$(RM) -r $(DIST)/$(APP_NAME).app
+	$(RM) -r $(DIST)/$(MOZ_MACBUNDLE_NAME)
 
 ifdef LIBXUL_SDK
 APPFILES = Resources
 else
 APPFILES = MacOS
 endif
 
 libs repackage:: $(PROGRAM)
-	$(MKDIR) -p $(DIST)/$(APP_NAME).app/Contents/MacOS
-	rsync -a --exclude CVS --exclude "*.in" $(srcdir)/macbuild/Contents $(DIST)/$(APP_NAME).app --exclude English.lproj
-	$(MKDIR) -p $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj
-	rsync -a --exclude CVS --exclude "*.in" $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj
-	sed -e "s/%APP_VERSION%/$(APP_VERSION)/" -e "s/%APP_NAME%/$(APP_NAME)/" -e "s/%LOWER_APP_NAME%/$(LOWER_APP_NAME)/" $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/$(APP_NAME).app/Contents/Info.plist
-	sed -e "s/%APP_NAME%/$(APP_NAME)/" $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj/InfoPlist.strings
-	rsync -a $(DIST)/bin/ $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)
-	$(RM) $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)/mangle $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)/shlibsign
+	$(MKDIR) -p $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS
+	rsync -a --exclude "*.in" $(srcdir)/macbuild/Contents $(DIST)/$(MOZ_MACBUNDLE_NAME) --exclude English.lproj
+	$(MKDIR) -p $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/$(AB).lproj
+	rsync -a --exclude "*.in" $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/$(AB).lproj
+	sed -e "s/%APP_VERSION%/$(APP_VERSION)/" -e "s/%MAC_APP_NAME%/$(MAC_APP_NAME)/" -e "s/%LOWER_MAC_APP_NAME%/$(LOWER_MAC_APP_NAME)/" $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Info.plist
+	sed -e "s/%MAC_APP_NAME%/$(MAC_APP_NAME)/" $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/$(AB).lproj/InfoPlist.strings
+	rsync -a $(DIST)/bin/ $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/$(APPFILES)
+	$(RM) $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/$(APPFILES)/mangle $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/$(APPFILES)/shlibsign
 ifdef LIBXUL_SDK
-	cp $(LIBXUL_DIST)/bin/$(XR_STUB_NAME) $(DIST)/$(APP_NAME).app/Contents/MacOS/firefox
+	cp $(LIBXUL_DIST)/bin/$(XR_STUB_NAME) $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/firefox
 else
-	$(RM) $(DIST)/$(APP_NAME).app/Contents/MacOS/$(PROGRAM)
-	rsync -aL $(PROGRAM) $(DIST)/$(APP_NAME).app/Contents/MacOS
+	$(RM) $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/$(PROGRAM)
+	rsync -aL $(PROGRAM) $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS
 endif
-	-cp -L $(DIST)/bin/mangle $(DIST)/bin/shlibsign $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)
-	cp -RL $(DIST)/branding/firefox.icns $(DIST)/$(APP_NAME).app/Contents/Resources/firefox.icns
-	cp -RL $(DIST)/branding/document.icns $(DIST)/$(APP_NAME).app/Contents/Resources/document.icns
-	printf APPLMOZB > $(DIST)/$(APP_NAME).app/Contents/PkgInfo
-#       remove CVS dirs from packaged app
-	find $(DIST)/$(APP_NAME).app -type d -name "CVS" -prune -exec rm -rf {} \;
+	-cp -L $(DIST)/bin/mangle $(DIST)/bin/shlibsign $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/$(APPFILES)
+	cp -RL $(DIST)/branding/firefox.icns $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/firefox.icns
+	cp -RL $(DIST)/branding/document.icns $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/document.icns
+	printf APPLMOZB > $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/PkgInfo
 
 else
 ifdef LIBXUL_SDK
 libs::
 	cp $(LIBXUL_DIST)/bin/$(XULRUNNER_STUB_NAME)$(BIN_SUFFIX) $(DIST)/bin/firefox$(BIN_SUFFIX)
 endif
 endif
 
 ifdef LIBXUL_SDK
 ifndef SKIP_COPY_XULRUNNER
 libs::
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-	rsync -a --copy-unsafe-links $(LIBXUL_DIST)/XUL.framework $(DIST)/$(APP_NAME).app/Contents/Frameworks
+	rsync -a --copy-unsafe-links $(LIBXUL_DIST)/XUL.framework $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Frameworks
 else
 	$(NSINSTALL) -D $(DIST)/bin/xulrunner
 	(cd $(LIBXUL_SDK)/bin && tar $(TAR_CREATE_FLAGS) - .) | (cd $(DIST)/bin/xulrunner && tar -xf -)
 endif # cocoa
 endif # SKIP_COPY_XULRUNNER
 endif # LIBXUL_SDK
--- a/browser/app/blocklist.xml
+++ b/browser/app/blocklist.xml
@@ -220,9 +220,9 @@
             <feature>DIRECT3D_9_LAYERS</feature>
       <featureStatus>BLOCKED_DRIVER_VERSION</featureStatus>
       <driverVersion>7.0.0.0</driverVersion>
       <driverVersionComparator>GREATER_THAN_OR_EQUAL</driverVersionComparator>
     </gfxBlacklistEntry>
     </gfxItems>
 
 
-</blocklist>
\ No newline at end of file
+</blocklist>
--- a/browser/app/macbuild/Contents/Info.plist.in
+++ b/browser/app/macbuild/Contents/Info.plist.in
@@ -140,25 +140,25 @@
 			<string>HTML5 Video (WebM)</string>
 			<key>CFBundleTypeRole</key>
 			<string>Viewer</string>
 		</dict>
 	</array>
 	<key>CFBundleExecutable</key>
 	<string>firefox</string>
 	<key>CFBundleGetInfoString</key>
-	<string>%APP_NAME% %APP_VERSION%</string>
+	<string>%MAC_APP_NAME% %APP_VERSION%</string>
 	<key>CFBundleIconFile</key>
 	<string>firefox</string>
 	<key>CFBundleIdentifier</key>
-	<string>org.mozilla.%LOWER_APP_NAME%</string>
+	<string>org.mozilla.%LOWER_MAC_APP_NAME%</string>
 	<key>CFBundleInfoDictionaryVersion</key>
 	<string>6.0</string>
 	<key>CFBundleName</key>
-	<string>%APP_NAME%</string>
+	<string>%MAC_APP_NAME%</string>
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
 	<string>%APP_VERSION%</string>
 	<key>CFBundleSignature</key>
 	<string>MOZB</string>
 	<key>CFBundleURLTypes</key>
 	<array>
--- a/browser/app/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in
+++ b/browser/app/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in
@@ -1,1 +1,1 @@
-CFBundleName = "%APP_NAME%";
+CFBundleName = "%MAC_APP_NAME%";
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -61,17 +61,17 @@ pref("extensions.strictCompatibility", f
 // for it to be compatible by default.
 pref("extensions.minCompatibleAppVersion", "4.0");
 
 // Preferences for AMO integration
 pref("extensions.getAddons.cache.enabled", true);
 pref("extensions.getAddons.maxResults", 15);
 pref("extensions.getAddons.get.url", "https://services.addons.mozilla.org/%LOCALE%/firefox/api/%API_VERSION%/search/guid:%IDS%?src=firefox&appOS=%OS%&appVersion=%VERSION%");
 pref("extensions.getAddons.search.browseURL", "https://addons.mozilla.org/%LOCALE%/firefox/search?q=%TERMS%");
-pref("extensions.getAddons.search.url", "https://services.addons.mozilla.org/%LOCALE%/firefox/api/%API_VERSION%/search/%TERMS%/all/%MAX_RESULTS%/%OS%/%VERSION%?src=firefox");
+pref("extensions.getAddons.search.url", "https://services.addons.mozilla.org/%LOCALE%/firefox/api/%API_VERSION%/search/%TERMS%/all/%MAX_RESULTS%/%OS%/%VERSION%/%COMPATIBILITY_MODE%?src=firefox");
 pref("extensions.webservice.discoverURL", "https://services.addons.mozilla.org/%LOCALE%/firefox/discovery/pane/%VERSION%/%OS%");
 
 // Blocklist preferences
 pref("extensions.blocklist.enabled", true);
 pref("extensions.blocklist.interval", 86400);
 // Controls what level the blocklist switches from warning about items to forcibly
 // blocking them.
 pref("extensions.blocklist.level", 2);
@@ -940,16 +940,17 @@ pref("services.sync.prefs.sync.browser.d
 pref("services.sync.prefs.sync.browser.download.manager.showWhenStarting", true);
 pref("services.sync.prefs.sync.browser.formfill.enable", true);
 pref("services.sync.prefs.sync.browser.link.open_newwindow", true);
 pref("services.sync.prefs.sync.browser.offline-apps.notify", true);
 pref("services.sync.prefs.sync.browser.safebrowsing.enabled", true);
 pref("services.sync.prefs.sync.browser.safebrowsing.malware.enabled", true);
 pref("services.sync.prefs.sync.browser.search.selectedEngine", true);
 pref("services.sync.prefs.sync.browser.search.update", true);
+pref("services.sync.prefs.sync.browser.sessionstore.restore_on_demand", true);
 pref("services.sync.prefs.sync.browser.startup.homepage", true);
 pref("services.sync.prefs.sync.browser.startup.page", true);
 pref("services.sync.prefs.sync.browser.tabs.autoHide", true);
 pref("services.sync.prefs.sync.browser.tabs.closeButtons", true);
 pref("services.sync.prefs.sync.browser.tabs.loadInBackground", true);
 pref("services.sync.prefs.sync.browser.tabs.warnOnClose", true);
 pref("services.sync.prefs.sync.browser.tabs.warnOnOpen", true);
 pref("services.sync.prefs.sync.browser.urlbar.autocomplete.enabled", true);
@@ -1007,16 +1008,22 @@ pref("devtools.errorconsole.enabled", fa
 
 // Enable the Inspector
 pref("devtools.inspector.enabled", true);
 pref("devtools.inspector.htmlHeight", 112);
 
 // Enable the style inspector
 pref("devtools.styleinspector.enabled", true);
 
+// Enable the Tilt inspector
+pref("devtools.tilt.enabled", true);
+
+// Enable the Tilt inspector even if WebGL capabilities are not detected
+pref("devtools.tilt.force-enabled", false);
+
 // Enable the rules view
 pref("devtools.ruleview.enabled", true);
 
 // Enable the Scratchpad tool.
 pref("devtools.scratchpad.enabled", true);
 
 // Enable the Style Editor.
 pref("devtools.styleeditor.enabled", true);
--- a/browser/base/Makefile.in
+++ b/browser/base/Makefile.in
@@ -48,21 +48,16 @@ include $(topsrcdir)/config/config.mk
 abs_srcdir = $(call core_abspath,$(srcdir))
 
 CHROME_DEPS += $(abs_srcdir)/content/overrides/app-license.html
 
 ifdef ENABLE_TESTS
 DIRS += content/test
 endif
 
-EXTRA_JS_MODULES = \
-	content/openLocationLastURL.jsm \
-	content/NetworkPrioritizer.jsm \
-	$(NULL)
-
 include $(topsrcdir)/config/rules.mk
 
 PRE_RELEASE_SUFFIX := ""
 
 DEFINES += \
 	-DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
 	-DAPP_LICENSE_BLOCK=$(abs_srcdir)/content/overrides/app-license.html \
 	-DPRE_RELEASE_SUFFIX="$(PRE_RELEASE_SUFFIX)" \
--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -143,16 +143,18 @@
              oncommand="PlacesCommandHook.showPlacesOrganizer('History');"/>
   </commandset>
 
   <commandset id="inspectorCommands">
     <command id="Inspector:Inspect"
              oncommand="InspectorUI.toggleInspection();"/>
     <command id="Inspector:Sidebar"
              oncommand="InspectorUI.toggleSidebar();"/>
+    <command id="Inspector:Tilt"
+             oncommand="Tilt.initialize();"/>
   </commandset>
 
   <broadcasterset id="mainBroadcasterSet">
     <broadcaster id="viewBookmarksSidebar" autoCheck="false" label="&bookmarksButton.label;"
                  type="checkbox" group="sidebar" sidebarurl="chrome://browser/content/bookmarks/bookmarksPanel.xul"
                  oncommand="toggleSidebar('viewBookmarksSidebar');"/>
 
     <!-- for both places and non-places, the sidebar lives at
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -50,16 +50,17 @@
 #   Rob Arnold <robarnold@cmu.edu>
 #   Dietrich Ayala <dietrich@mozilla.com>
 #   Gavin Sharp <gavin@gavinsharp.com>
 #   Justin Dolske <dolske@mozilla.com>
 #   Rob Campbell <rcampbell@mozilla.com>
 #   David Dahl <ddahl@mozilla.com>
 #   Patrick Walton <pcwalton@mozilla.com>
 #   Mihai Sucan <mihai.sucan@gmail.com>
+#   Victor Porof <vporof@mozilla.com>
 #
 # Alternatively, the contents of this file may be used under the terms of
 # either the GNU General Public License Version 2 or later (the "GPL"), or
 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 # in which case the provisions of the GPL or the LGPL are applicable instead
 # of those above. If you wish to allow use of your version of this file only
 # under the terms of either the GPL or the LGPL, and not to allow others to
 # use your version of this file under the terms of the MPL, indicate your
@@ -174,16 +175,22 @@ XPCOMUtils.defineLazyGetter(this, "Popup
 });
 
 XPCOMUtils.defineLazyGetter(this, "InspectorUI", function() {
   let tmp = {};
   Cu.import("resource:///modules/inspector.jsm", tmp);
   return new tmp.InspectorUI(window);
 });
 
+XPCOMUtils.defineLazyGetter(this, "Tilt", function() {
+  let tmp = {};
+  Cu.import("resource:///modules/devtools/Tilt.jsm", tmp);
+  return new tmp.Tilt(window);
+});
+
 let gInitialPages = [
   "about:blank",
   "about:privatebrowsing",
   "about:sessionrestore"
 ];
 
 #include browser-fullZoom.js
 #include browser-places.js
@@ -195,17 +202,17 @@ let gInitialPages = [
 #endif
 
 XPCOMUtils.defineLazyGetter(this, "Win7Features", function () {
 #ifdef XP_WIN
   const WINTASKBAR_CONTRACTID = "@mozilla.org/windows-taskbar;1";
   if (WINTASKBAR_CONTRACTID in Cc &&
       Cc[WINTASKBAR_CONTRACTID].getService(Ci.nsIWinTaskbar).available) {
     let temp = {};
-    Cu.import("resource://gre/modules/WindowsPreviewPerTab.jsm", temp);
+    Cu.import("resource:///modules/WindowsPreviewPerTab.jsm", temp);
     let AeroPeek = temp.AeroPeek;
     return {
       onOpenWindow: function () {
         AeroPeek.onOpenWindow(window);
       },
       onCloseWindow: function () {
         AeroPeek.onCloseWindow(window);
       }
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -32,16 +32,17 @@
 #   Johnathan Nightingale <johnath@mozilla.com>
 #   Dão Gottwald <dao@mozilla.com>
 #   Ehsan Akhgari <ehsan.akhgari@gmail.com>
 #   Robert Strong <robert.bugzilla@gmail.com>
 #   Rob Campbell <rcampbell@mozilla.com>
 #   Patrick Walton <pcwalton@mozilla.com>
 #   David Dahl <ddahl@mozilla.com>
 #   Frank Yan <fyan@mozilla.com>
+#   Victor Porof <vporof@mozilla.com>
 #
 # Alternatively, the contents of this file may be used under the terms of
 # either the GNU General Public License Version 2 or later (the "GPL"), or
 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 # in which case the provisions of the GPL or the LGPL are applicable instead
 # of those above. If you wish to allow use of your version of this file only
 # under the terms of either the GPL or the LGPL, and not to allow others to
 # use your version of this file under the terms of the MPL, indicate your
@@ -1002,16 +1003,21 @@
           <toolbarbutton id="inspector-inspect-toolbutton"
                          label="&inspectButton.label;"
                          accesskey="&inspectButton.accesskey;"
                          command="Inspector:Inspect"/>
           <arrowscrollbox id="inspector-breadcrumbs"
                           flex="1" orient="horizontal"
                           clicktoscroll="true"/>
           <hbox id="inspector-tools">
+            <toolbarbutton id="inspector-3D-button"
+                           hidden="true"
+                           label="&inspect3DButton.label;"
+                           accesskey="&inspect3DButton.accesskey;"
+                           command="Inspector:Tilt"/>
             <toolbarbutton id="inspector-style-button"
                            label="&inspectStyleButton.label;"
                            accesskey="&inspectStyleButton.accesskey;"
                            command="Inspector:Sidebar"/>
             <!-- registered tools go here -->
           </hbox>
 #ifndef XP_MACOSX
           <toolbarbutton id="highlighter-closebutton"
--- a/browser/base/content/pageinfo/permissions.js
+++ b/browser/base/content/pageinfo/permissions.js
@@ -221,17 +221,17 @@ function onIndexedDBClear()
 
   var permissionManager = Components.classes[PERMISSION_CONTRACTID]
                                     .getService(nsIPermissionManager);
   permissionManager.remove(gPermURI.host, "indexedDB");
   permissionManager.remove(gPermURI.host, "indexedDB-unlimited");
   initIndexedDBRow();
 }
 
-function onIndexedDBUsageCallback(uri, usage)
+function onIndexedDBUsageCallback(uri, usage, fileUsage)
 {
   if (!uri.equals(gPermURI)) {
     throw new Error("Callback received for bad URI: " + uri);
   }
 
   if (usage) {
     if (!("DownloadUtils" in window)) {
       Components.utils.import("resource://gre/modules/DownloadUtils.jsm");
--- a/browser/base/content/test/Makefile.in
+++ b/browser/base/content/test/Makefile.in
@@ -86,17 +86,16 @@ endif
 # back to the clear recent history dialog (santize.xul), if it ever is (bug
 # 480169)
 
 # browser_drag.js is disabled, as it needs to be updated for the new behavior from bug 320638.
 
 _BROWSER_FILES = \
                  browser_typeAheadFind.js \
                  browser_keywordSearch.js \
-                 browser_NetworkPrioritizer.js \
                  browser_allTabsPanel.js \
                  browser_alltabslistener.js \
                  browser_bug304198.js \
                  browser_bug321000.js \
                  title_test.svg \
                  browser_bug329212.js \
                  browser_bug356571.js \
                  browser_bug380960.js \
@@ -165,16 +164,17 @@ endif
                  browser_bug599325.js \
                  browser_bug609700.js \
                  browser_bug616836.js \
                  browser_bug623893.js \
                  browser_bug624734.js \
                  browser_bug647886.js \
                  browser_bug655584.js \
                  browser_bug664672.js \
+                 browser_bug710878.js \
                  browser_canonizeURL.js \
                  browser_findbarClose.js \
                  browser_keywordBookmarklets.js \
                  browser_contextSearchTabPosition.js \
                  browser_ctrlTab.js \
                  browser_customize_popupNotification.js \
                  browser_disablechrome.js \
                  browser_discovery.js \
--- a/browser/base/content/test/browser_bug462289.js
+++ b/browser/base/content/test/browser_bug462289.js
@@ -1,75 +1,85 @@
 var tab1, tab2;
 
-function focus_in_navbar() {
+function focus_in_navbar()
+{
   var parent = document.activeElement.parentNode;
   while (parent && parent.id != "nav-bar")
     parent = parent.parentNode;
 
-  return (parent != null);
+  return parent != null;
 }
 
-function test() {
+function test()
+{
   waitForExplicitFinish();
 
   tab1 = gBrowser.addTab("about:blank", {skipAnimation: true});
   tab2 = gBrowser.addTab("about:blank", {skipAnimation: true});
 
   EventUtils.synthesizeMouseAtCenter(tab1, {});
   setTimeout(step2, 0);
 }
 
 function step2()
 {
-  isnot(document.activeElement, tab1, "mouse on tab not activeElement");
+  is(gBrowser.selectedTab, tab1, "1st click on tab1 selects tab");
+  isnot(document.activeElement, tab1, "1st click on tab1 does not activate tab");
 
   EventUtils.synthesizeMouseAtCenter(tab1, {});
   setTimeout(step3, 0);
 }
 
 function step3()
 {
-  isnot(document.activeElement, tab1, "mouse on tab again activeElement");
+  is(gBrowser.selectedTab, tab1, "2nd click on selected tab1 keeps tab selected");
+  isnot(document.activeElement, tab1, "2nd click on selected tab1 does not activate tab");
 
   if (gNavToolbox.getAttribute("tabsontop") == "true") {
+    ok(true, "[tabsontop=true] focusing URLBar then sending 1 Shift+Tab.");
     gURLBar.focus();
     EventUtils.synthesizeKey("VK_TAB", {shiftKey: true});
   } else {
+    ok(true, "[tabsontop=false] focusing SearchBar then sending Tab(s) until out of nav-bar.");
     document.getElementById("searchbar").focus();
-
     while (focus_in_navbar())
       EventUtils.synthesizeKey("VK_TAB", { });
   }
-  is(document.activeElement, tab1, "tab key to tab activeElement");
+  is(gBrowser.selectedTab, tab1, "tab key to selected tab1 keeps tab selected");
+  is(document.activeElement, tab1, "tab key to selected tab1 activates tab");
 
   EventUtils.synthesizeMouseAtCenter(tab1, {});
   setTimeout(step4, 0);
 }
 
 function step4()
 {
-  is(document.activeElement, tab1, "mouse on tab while focused still activeElement");
+  is(gBrowser.selectedTab, tab1, "3rd click on activated tab1 keeps tab selected");
+  is(document.activeElement, tab1, "3rd click on activated tab1 keeps tab activated");
 
   EventUtils.synthesizeMouseAtCenter(tab2, {});
   setTimeout(step5, 0);
 }
 
 function step5()
 {
   // The tabbox selects a tab within a setTimeout in a bubbling mousedown event
-  // listener, and focuses the current tab if another tab previously had focus
-  is(document.activeElement, tab2, "mouse on another tab while focused still activeElement");
+  // listener, and focuses the current tab if another tab previously had focus.
+  is(gBrowser.selectedTab, tab2, "click on tab2 while tab1 is activated selects tab");
+  is(document.activeElement, tab2, "click on tab2 while tab1 is activated activates tab");
 
+  ok(true, "focusing content then sending middle-button mousedown to tab2.");
   content.focus();
   EventUtils.synthesizeMouseAtCenter(tab2, {button: 1, type: "mousedown"});
   setTimeout(step6, 0);
 }
 
 function step6()
 {
-  isnot(document.activeElement, tab2, "tab not focused via middle click");
+  is(gBrowser.selectedTab, tab2, "middle-button mousedown on selected tab2 keeps tab selected");
+  isnot(document.activeElement, tab2, "middle-button mousedown on selected tab2 does not activate tab");
 
+  gBrowser.removeTab(tab2);
   gBrowser.removeTab(tab1);
-  gBrowser.removeTab(tab2);
 
   finish();
 }
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/browser_bug710878.js
@@ -0,0 +1,29 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+function test()
+{
+  waitForExplicitFinish();
+
+  let doc;
+
+  gBrowser.selectedTab = gBrowser.addTab();
+  gBrowser.selectedBrowser.addEventListener("load", function onload() {
+    gBrowser.selectedBrowser.removeEventListener("load", onload, true);
+    doc = content.document;
+    waitForFocus(performTest, content);
+  }, true);
+
+  content.location = "data:text/html,<a href='%23xxx'><span>word1 <span> word2 </span></span><span> word3</span></a>";
+
+  function performTest()
+  {
+    let link = doc.querySelector("a");;
+    let text = gatherTextUnder(link);
+    is(text, "word1 word2 word3", "Text under link is correctly computed.");
+    doc = null;
+    gBrowser.removeCurrentTab();
+    finish();
+  }
+}
+
--- a/browser/base/content/utilityOverlay.js
+++ b/browser/base/content/utilityOverlay.js
@@ -363,23 +363,23 @@ function gatherTextUnder ( root )
     }
     // Find next node to test.
     // First, see if this node has children.
     if ( node.hasChildNodes() ) {
       // Go to first child.
       node = node.firstChild;
       depth++;
     } else {
-      // No children, try next sibling.
+      // No children, try next sibling (or parent next sibling).
+      while ( depth > 0 && !node.nextSibling ) {
+        node = node.parentNode;
+        depth--;
+      }
       if ( node.nextSibling ) {
         node = node.nextSibling;
-      } else {
-        // Last resort is our next oldest uncle/aunt.
-        node = node.parentNode.nextSibling;
-        depth--;
       }
     }
   }
   // Strip leading whitespace.
   text = text.replace( /^\s+/, "" );
   // Strip trailing whitespace.
   text = text.replace( /\s+$/, "" );
   // Compress remaining whitespace.
--- a/browser/components/Makefile.in
+++ b/browser/components/Makefile.in
@@ -64,32 +64,26 @@ PARALLEL_DIRS = \
   dirprovider \
   feeds \
   places \
   preferences \
   privatebrowsing \
   search \
   sessionstore \
   shell \
-  sidebar/src \
+  sidebar \
   tabview \
   migration \
   $(NULL)
 
-ifeq ($(MOZ_WIDGET_TOOLKIT),windows) 
-PARALLEL_DIRS += wintaskbar
-endif
-
 ifdef MOZ_SAFE_BROWSING
 PARALLEL_DIRS += safebrowsing
 endif
 
-ifdef ENABLE_TESTS
-DIRS += test/browser
-endif
+TEST_DIRS += test
 
 DIRS += build
 
 ifdef MOZILLA_OFFICIAL
 DEFINES += -DOFFICIAL_BUILD=1
 endif
 
 include $(topsrcdir)/config/rules.mk
--- a/browser/components/build/Makefile.in
+++ b/browser/components/build/Makefile.in
@@ -47,30 +47,25 @@ SHARED_LIBRARY_LIBS = \
 	../about/$(LIB_PREFIX)browserabout_s.$(LIB_SUFFIX) \
 	../dirprovider/$(LIB_PREFIX)browserdir_s.$(LIB_SUFFIX) \
 	$(NULL)
 
 ifneq (,$(filter windows cocoa gtk2, $(MOZ_WIDGET_TOOLKIT)))
 SHARED_LIBRARY_LIBS += ../shell/src/$(LIB_PREFIX)shellservice_s.$(LIB_SUFFIX)
 endif
 
-EXTRA_DSO_LDOPTS += $(call EXPAND_LIBNAME_PATH,unicharutil_external_s,$(LIBXUL_DIST)/lib)
-
-# migration requires mozreg
-LOCAL_INCLUDES += -I$(srcdir)/../migration/src
-SHARED_LIBRARY_LIBS += ../migration/src/$(LIB_PREFIX)migration_s.$(LIB_SUFFIX)
-EXTRA_DSO_LDOPTS += $(LIBXUL_DIST)/lib/$(LIB_PREFIX)mozreg_s.$(LIB_SUFFIX)
-
-# This has to come after the above chunk, because mozreg_s has dependencies on
-# stuff in MOZ_COMPONENT_LIBS.
 EXTRA_DSO_LDOPTS += \
+	$(call EXPAND_LIBNAME_PATH,unicharutil_external_s,$(LIBXUL_DIST)/lib) \
 	$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
 	$(MOZ_COMPONENT_LIBS) \
 	$(NULL)
 
+LOCAL_INCLUDES += -I$(srcdir)/../migration/src
+SHARED_LIBRARY_LIBS += ../migration/src/$(LIB_PREFIX)migration_s.$(LIB_SUFFIX)
+
 # Mac: Need to link with CoreFoundation for Mac Migrators (PList reading code)
 # GTK2: Need to link with glib for GNOME shell service
 ifneq (,$(filter cocoa gtk2,$(MOZ_WIDGET_TOOLKIT)))
 EXTRA_DSO_LDOPTS += \
   $(TK_LIBS) \
   $(NULL)
 endif
 
--- a/browser/components/build/nsBrowserCompsCID.h
+++ b/browser/components/build/nsBrowserCompsCID.h
@@ -43,19 +43,16 @@
 { 0xbc15c73d, 0xc05b, 0x497b, { 0xa3, 0x73, 0x4b, 0xae, 0x6c, 0x17, 0x86, 0x31 } }
 #endif
 
 #ifdef XP_MACOSX
 #define NS_SAFARIPROFILEMIGRATOR_CID \
 { 0x29e3b139, 0xad19, 0x44f3, { 0xb2, 0xc2, 0xe9, 0xf1, 0x3b, 0xa2, 0xbb, 0xc6 } }
 #endif
 
-#define NS_OPERAPROFILEMIGRATOR_CID \
-{ 0xf34ff792, 0x722e, 0x4490, { 0xb1, 0x95, 0x47, 0xd2, 0x42, 0xed, 0xca, 0x1c } }
-
 #define NS_SHELLSERVICE_CID \
 { 0x63c7b9f4, 0xcc8, 0x43f8, { 0xb6, 0x66, 0xa, 0x66, 0x16, 0x55, 0xcb, 0x73 } }
 
 #define NS_SHELLSERVICE_CONTRACTID \
   "@mozilla.org/browser/shell-service;1"
 
 #define NS_RDF_FORWARDPROXY_INFER_DATASOURCE_CID \
 { 0x7a024bcf, 0xedd5, 0x4d9a, { 0x86, 0x14, 0xd4, 0x4b, 0xe1, 0xda, 0xda, 0xd3 } }
--- a/browser/components/build/nsModule.cpp
+++ b/browser/components/build/nsModule.cpp
@@ -45,19 +45,16 @@
 #include "nsWindowsShellService.h"
 #elif defined(XP_MACOSX)
 #include "nsMacShellService.h"
 #elif defined(MOZ_WIDGET_GTK2)
 #include "nsGNOMEShellService.h"
 #endif
 
 #include "nsProfileMigrator.h"
-#if !defined(XP_OS2)
-#include "nsOperaProfileMigrator.h"
-#endif
 #if defined(XP_WIN) && !defined(__MINGW32__)
 #include "nsIEProfileMigrator.h"
 #elif defined(XP_MACOSX)
 #include "nsSafariProfileMigrator.h"
 #endif
 
 #include "rdf.h"
 #include "nsFeedSniffer.h"
@@ -75,19 +72,16 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(Directory
 #if defined(XP_WIN)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindowsShellService)
 #elif defined(XP_MACOSX)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacShellService)
 #elif defined(MOZ_WIDGET_GTK2)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init)
 #endif
 
-#if !defined(XP_OS2)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsOperaProfileMigrator)
-#endif
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsProfileMigrator)
 #if defined(XP_WIN) && !defined(__MINGW32__)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsIEProfileMigrator)
 #elif defined(XP_MACOSX)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSafariProfileMigrator)
 #endif
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsFeedSniffer)
@@ -104,19 +98,16 @@ NS_DEFINE_NAMED_CID(NS_FEEDSNIFFER_CID);
 NS_DEFINE_NAMED_CID(NS_BROWSER_ABOUT_REDIRECTOR_CID);
 NS_DEFINE_NAMED_CID(NS_FIREFOX_PROFILEMIGRATOR_CID);
 #if defined(XP_WIN) && !defined(__MINGW32__)
 NS_DEFINE_NAMED_CID(NS_WINIEPROFILEMIGRATOR_CID);
 #elif defined(XP_MACOSX)
 NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_SAFARIPROFILEMIGRATOR_CID);
 #endif
-#if !defined(XP_OS2)
-NS_DEFINE_NAMED_CID(NS_OPERAPROFILEMIGRATOR_CID);
-#endif
 NS_DEFINE_NAMED_CID(NS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID);
 
 static const mozilla::Module::CIDEntry kBrowserCIDs[] = {
     { &kNS_BROWSERDIRECTORYPROVIDER_CID, false, NULL, DirectoryProviderConstructor },
 #if defined(XP_WIN)
     { &kNS_SHELLSERVICE_CID, false, NULL, nsWindowsShellServiceConstructor },
 #elif defined(MOZ_WIDGET_GTK2)
     { &kNS_SHELLSERVICE_CID, false, NULL, nsGNOMEShellServiceConstructor },
@@ -125,19 +116,16 @@ static const mozilla::Module::CIDEntry k
     { &kNS_BROWSER_ABOUT_REDIRECTOR_CID, false, NULL, AboutRedirector::Create },
     { &kNS_FIREFOX_PROFILEMIGRATOR_CID, false, NULL, nsProfileMigratorConstructor },
 #if defined(XP_WIN) && !defined(__MINGW32__)
     { &kNS_WINIEPROFILEMIGRATOR_CID, false, NULL, nsIEProfileMigratorConstructor },
 #elif defined(XP_MACOSX)
     { &kNS_SHELLSERVICE_CID, false, NULL, nsMacShellServiceConstructor },
     { &kNS_SAFARIPROFILEMIGRATOR_CID, false, NULL, nsSafariProfileMigratorConstructor },
 #endif
-#if !defined(XP_OS2)
-    { &kNS_OPERAPROFILEMIGRATOR_CID, false, NULL, nsOperaProfileMigratorConstructor },
-#endif
     { &kNS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID, false, NULL, nsPrivateBrowsingServiceWrapperConstructor },
     { NULL }
 };
 
 static const mozilla::Module::ContractIDEntry kBrowserContracts[] = {
     { NS_BROWSERDIRECTORYPROVIDER_CONTRACTID, &kNS_BROWSERDIRECTORYPROVIDER_CID },
 #if defined(XP_WIN)
     { NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID },
@@ -162,19 +150,16 @@ static const mozilla::Module::ContractID
     { NS_ABOUT_MODULE_CONTRACTID_PREFIX "permissions", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
     { NS_PROFILEMIGRATOR_CONTRACTID, &kNS_FIREFOX_PROFILEMIGRATOR_CID },
 #if defined(XP_WIN) && !defined(__MINGW32__)
     { NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "ie", &kNS_WINIEPROFILEMIGRATOR_CID },
 #elif defined(XP_MACOSX)
     { NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID },
     { NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "safari", &kNS_SAFARIPROFILEMIGRATOR_CID },
 #endif
-#if !defined(XP_OS2)
-    { NS_BROWSERPROFILEMIGRATOR_CONTRACTID_PREFIX "opera", &kNS_OPERAPROFILEMIGRATOR_CID },
-#endif
     { NS_PRIVATE_BROWSING_SERVICE_CONTRACTID, &kNS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID },
     { NULL }
 };
 
 static const mozilla::Module::CategoryEntry kBrowserCategories[] = {
     { XPCOM_DIRECTORY_PROVIDER_CATEGORY, "browser-directory-provider", NS_BROWSERDIRECTORYPROVIDER_CONTRACTID },
     { NS_CONTENT_SNIFFER_CATEGORY, "Feed Sniffer", NS_FEEDSNIFFER_CONTRACTID },
     { NULL }
--- a/browser/components/feeds/src/FeedWriter.js
+++ b/browser/components/feeds/src/FeedWriter.js
@@ -760,17 +760,17 @@ FeedWriter.prototype = {
         if (this._selectedApp) {
           // XXXben - we need to compare this with the running instance executable
           //          just don't know how to do that via script...
           // XXXmano TBD: can probably add this to nsIShellService
 #ifdef XP_WIN
 #expand           if (fp.file.leafName != "__MOZ_APP_NAME__.exe") {
 #else
 #ifdef XP_MACOSX
-#expand           if (fp.file.leafName != "__MOZ_APP_DISPLAYNAME__.app") {
+#expand           if (fp.file.leafName != "__MOZ_MACBUNDLE_NAME__") {
 #else
 #expand           if (fp.file.leafName != "__MOZ_APP_NAME__-bin") {
 #endif
 #endif
             this._initMenuItemWithFile(this._contentSandbox.selectedAppMenuItem,
                                        this._selectedApp);
 
             // Show and select the selected application menuitem
--- a/browser/components/feeds/src/Makefile.in
+++ b/browser/components/feeds/src/Makefile.in
@@ -45,17 +45,17 @@ MODULE = browser_feeds
 LIBRARY_NAME = browser_feeds_s
 FORCE_STATIC_LIB = 1
 ifndef MOZ_MEMORY
 USE_STATIC_LIBS = 1
 endif
 
 DEFINES += \
 	-DMOZ_APP_NAME=$(MOZ_APP_NAME) \
-	-DMOZ_APP_DISPLAYNAME=$(MOZ_APP_DISPLAYNAME) \
+	-DMOZ_MACBUNDLE_NAME=$(MOZ_MACBUNDLE_NAME) \
 	$(NULL)
 
 EXTRA_COMPONENTS = \
   BrowserFeeds.manifest \
   $(NULL)
 
 EXTRA_PP_COMPONENTS = \
 	FeedConverter.js \
--- a/browser/components/migration/content/migration.js
+++ b/browser/components/migration/content/migration.js
@@ -328,19 +328,16 @@ var MigrationWizard = {
     singleStart.setAttribute("label", mainStr);
     singleStart.setAttribute("value", "DEFAULT");
 
     var source = null;
     switch (this._source) {
       case "ie":
         source = "sourceNameIE";
         break;
-      case "opera":
-        source = "sourceNameOpera";
-        break;
       case "safari":
         source = "sourceNameSafari";
         break;
       case "chrome":
         source = "sourceNameChrome";
         break;
     }
 
--- a/browser/components/migration/content/migration.xul
+++ b/browser/components/migration/content/migration.xul
@@ -65,24 +65,20 @@
     <description id="importBookmarks" control="importSourceGroup" hidden="true">&importFromBookmarks.label;</description>
 
     <radiogroup id="importSourceGroup" align="start">
       <!-- If you are adding a migrator, please add the appropriate
            hooks to GetDefaultBrowserMigratorKey in
            browser/components/migration/src/nsProfileMigrator.cpp -->
 #ifdef XP_MACOSX
       <radio id="safari"    label="&importFromSafari.label;"    accesskey="&importFromSafari.accesskey;"/>
-      <radio id="opera"     label="&importFromOpera.label;"     accesskey="&importFromOpera.accesskey;"/>
-#elifdef XP_UNIX
-      <radio id="opera"     label="&importFromOpera.label;"     accesskey="&importFromOpera.accesskey;"/>
 #elifdef XP_WIN
 #ifndef NO_IE_MIGRATOR
       <radio id="ie"        label="&importFromIE.label;"        accesskey="&importFromIE.accesskey;"/>
 #endif
-      <radio id="opera"     label="&importFromOpera.label;"     accesskey="&importFromOpera.accesskey;"/>
 #endif
       <radio id="chrome"    label="&importFromChrome.label;"    accesskey="&importFromChrome.accesskey;"/>
       <radio id="fromfile"  label="&importFromHTMLFile.label;"  accesskey="&importFromHTMLFile.accesskey;" hidden="true"/>
       <radio id="nothing"   label="&importFromNothing.label;"   accesskey="&importFromNothing.accesskey;" hidden="true"/>
     </radiogroup>
     <label id="noSources" hidden="true">&noMigrationSources.label;</label>
   </wizardpage>
 
--- a/browser/components/migration/src/Makefile.in
+++ b/browser/components/migration/src/Makefile.in
@@ -48,20 +48,16 @@ ifndef MOZ_MEMORY
 USE_STATIC_LIBS = 1
 endif
 
 
 CPPSRCS  = nsProfileMigrator.cpp \
            nsBrowserProfileMigratorUtils.cpp \
            $(NULL)
 
-ifneq ($(OS_ARCH),OS2)
-CPPSRCS += nsOperaProfileMigrator.cpp
-endif
-
 ifeq ($(OS_ARCH)_$(GNU_CXX),WINNT_)
 CPPSRCS += nsIEProfileMigrator.cpp \
            $(NULL)
 endif
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 CPPSRCS += nsSafariProfileMigrator.cpp \
            $(NULL)
--- a/browser/components/migration/src/nsBrowserProfileMigratorUtils.cpp
+++ b/browser/components/migration/src/nsBrowserProfileMigratorUtils.cpp
@@ -37,18 +37,16 @@
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsBrowserProfileMigratorUtils.h"
 #include "nsINavBookmarksService.h"
 #include "nsBrowserCompsCID.h"
 #include "nsToolkitCompsCID.h"
 #include "nsIPlacesImportExportService.h"
 #include "nsIFile.h"
-#include "nsIInputStream.h"
-#include "nsILineInputStream.h"
 #include "nsIProperties.h"
 #include "nsIProfileMigrator.h"
 
 #include "nsIURI.h"
 #include "nsNetUtil.h"
 #include "nsISupportsPrimitives.h"
 
 #include "nsAppDirectoryServiceDefs.h"
@@ -160,67 +158,16 @@ GetProfilePath(nsIProfileStartup* aStart
       (do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID));
     if (dirSvc) {
       dirSvc->Get(NS_APP_USER_PROFILE_50_DIR, NS_GET_IID(nsIFile),
                   (void**) getter_AddRefs(aProfileDir));
     }
   }
 }
 
-nsresult 
-AnnotatePersonalToolbarFolder(nsIFile* aSourceBookmarksFile,
-                              nsIFile* aTargetBookmarksFile,
-                              const char* aToolbarFolderName)
-{
-  nsCOMPtr<nsIInputStream> fileInputStream;
-  nsresult rv = NS_NewLocalFileInputStream(getter_AddRefs(fileInputStream),
-                                           aSourceBookmarksFile);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsIOutputStream> outputStream;
-  rv = NS_NewLocalFileOutputStream(getter_AddRefs(outputStream),
-                                   aTargetBookmarksFile);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsILineInputStream> lineInputStream =
-    do_QueryInterface(fileInputStream, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCAutoString sourceBuffer;
-  nsCAutoString targetBuffer;
-  bool moreData = false;
-  PRUint32 bytesWritten = 0;
-  do {
-    lineInputStream->ReadLine(sourceBuffer, &moreData);
-    if (!moreData)
-      break;
-
-    PRInt32 nameOffset = sourceBuffer.Find(aToolbarFolderName);
-    if (nameOffset >= 0) {
-      // Found the personal toolbar name on a line, check to make sure it's
-      // actually a folder. 
-      NS_NAMED_LITERAL_CSTRING(folderPrefix, "<DT><H3 ");
-      PRInt32 folderPrefixOffset = sourceBuffer.Find(folderPrefix);
-      if (folderPrefixOffset >= 0)
-        sourceBuffer.Insert(NS_LITERAL_CSTRING("PERSONAL_TOOLBAR_FOLDER=\"true\" "), 
-                            folderPrefixOffset + folderPrefix.Length());
-    }
-
-    targetBuffer.Assign(sourceBuffer);
-    targetBuffer.Append("\r\n");
-    outputStream->Write(targetBuffer.get(), targetBuffer.Length(),
-                        &bytesWritten);
-  }
-  while (1);
-  
-  outputStream->Close();
-  
-  return NS_OK;
-}
-
 nsresult
 ImportBookmarksHTML(nsIFile* aBookmarksFile, 
                     bool aImportIntoRoot,
                     bool aOverwriteDefaults,
                     const PRUnichar* aImportSourceNameKey)
 {
   nsresult rv;
 
--- a/browser/components/migration/src/nsBrowserProfileMigratorUtils.h
+++ b/browser/components/migration/src/nsBrowserProfileMigratorUtils.h
@@ -94,25 +94,16 @@ void GetMigrateDataFromArray(MigrationDa
                              nsIFile* aSourceProfile, 
                              PRUint16* aResult);
 
 
 // get the base directory of the *target* profile
 // this is already cloned, modify it to your heart's content
 void GetProfilePath(nsIProfileStartup* aStartup, nsCOMPtr<nsIFile>& aProfileDir);
 
-// The Netscape Bookmarks Format (bookmarks.html) is fairly standard but
-// each browser vendor seems to have their own way of identifying the 
-// Personal Toolbar Folder. This function scans for the vendor-specific
-// name in the source Bookmarks file and then writes out a normalized
-// variant into the target folder. 
-nsresult AnnotatePersonalToolbarFolder(nsIFile* aSourceBookmarksFile,
-                                       nsIFile* aTargetBookmarksFile,
-                                       const char* aToolbarFolderName);
-
 // In-place import from aBookmarksFile into a folder in the user's bookmarks.
 // If the importIntoRoot parameter has a value of true, the bookmarks will be
 // imported into the bookmarks root folder. Otherwise, they'll be imported into
 // a new folder with the name "From (STR:aImportSourceNameKey)".
 // aImportSourceNameKey is a key into migration.properties with the pretty name
 // of the application.
 nsresult ImportBookmarksHTML(nsIFile* aBookmarksFile, 
                              bool aImportIntoRoot,
deleted file mode 100644
--- a/browser/components/migration/src/nsOperaProfileMigrator.cpp
+++ /dev/null
@@ -1,1459 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is The Browser Profile Migrator.
- *
- * The Initial Developer of the Original Code is Ben Goodger.
- * Portions created by the Initial Developer are Copyright (C) 2004
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Ben Goodger <ben@bengoodger.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "mozilla/Util.h"
-
-#include "nsAppDirectoryServiceDefs.h"
-#include "nsBrowserProfileMigratorUtils.h"
-#include "nsDirectoryServiceDefs.h"
-#include "nsDirectoryServiceUtils.h"
-#include "nsDocShellCID.h"
-#include "nsINavBookmarksService.h"
-#include "nsBrowserCompsCID.h"
-#include "nsIBrowserProfileMigrator.h"
-#include "nsIBrowserHistory.h"
-#include "nsICookieManager2.h"
-#include "nsIGlobalHistory.h"
-#include "nsIInputStream.h"
-#include "nsILineInputStream.h"
-#include "nsILocalFile.h"
-#include "nsINIParser.h"
-#include "nsIObserverService.h"
-#include "nsIPermissionManager.h"
-#include "nsIPrefLocalizedString.h"
-#include "nsIPrefService.h"
-#include "nsIProfileMigrator.h"
-#include "nsIProperties.h"
-#include "nsIRDFContainer.h"
-#include "nsIRDFService.h"
-#include "nsIServiceManager.h"
-#include "nsIStringBundle.h"
-#include "nsISupportsPrimitives.h"
-#include "nsNetUtil.h"
-#include "nsOperaProfileMigrator.h"
-#include "nsToolkitCompsCID.h"
-#ifdef XP_WIN
-#include <windows.h>
-#endif
-
-using namespace mozilla;
-
-#define MIGRATION_BUNDLE "chrome://browser/locale/migration/migration.properties"
-
-#ifdef XP_WIN
-#define OPERA_PREFERENCES_FOLDER_NAME NS_LITERAL_STRING("Opera")
-#define OPERA_PREFERENCES_FILE_NAME NS_LITERAL_STRING("opera6.ini")
-#define OPERA_HISTORY_FILE_NAME NS_LITERAL_STRING("global.dat")
-#define OPERA_BOOKMARKS_FILE_NAME NS_LITERAL_STRING("opera6.adr")
-#elif defined(XP_MACOSX)
-#define OPERA_PREFERENCES_FOLDER_NAME NS_LITERAL_STRING("Opera 6 Preferences")
-#define OPERA_PREFERENCES_FILE_NAME NS_LITERAL_STRING("Opera 6 Preferences")
-#define OPERA_HISTORY_FILE_NAME NS_LITERAL_STRING("Opera Global History")
-#define OPERA_BOOKMARKS_FILE_NAME NS_LITERAL_STRING("Bookmarks")
-#elif defined (XP_UNIX)
-#define OPERA_PREFERENCES_FOLDER_NAME NS_LITERAL_STRING(".opera")
-#define OPERA_PREFERENCES_FILE_NAME NS_LITERAL_STRING("opera6.ini")
-#define OPERA_HISTORY_FILE_NAME NS_LITERAL_STRING("global.dat")
-#define OPERA_BOOKMARKS_FILE_NAME NS_LITERAL_STRING("opera6.adr")
-#else
-#error Need to define location of Opera Profile data.
-#endif
-
-#define OPERA_COOKIES_FILE_NAME NS_LITERAL_STRING("cookies4.dat")
-
-///////////////////////////////////////////////////////////////////////////////
-// nsBrowserProfileMigrator
-
-NS_IMPL_ISUPPORTS1(nsOperaProfileMigrator, nsIBrowserProfileMigrator)
-
-nsOperaProfileMigrator::nsOperaProfileMigrator()
-{
-  mObserverService = do_GetService("@mozilla.org/observer-service;1");
-}
-
-nsOperaProfileMigrator::~nsOperaProfileMigrator()
-{
-}
-
-NS_IMETHODIMP
-nsOperaProfileMigrator::Migrate(PRUint16 aItems, nsIProfileStartup* aStartup, const PRUnichar* aProfile)
-{
-  nsresult rv = NS_OK;
-  bool aReplace = aStartup ? true : false;
-
-  if (aStartup) {
-    rv = aStartup->DoStartup();
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-
-  if (!mOperaProfile)
-    GetOperaProfile(aProfile, getter_AddRefs(mOperaProfile));
-
-  NOTIFY_OBSERVERS(MIGRATION_STARTED, nsnull);
-
-  COPY_DATA(CopyPreferences,  aReplace, nsIBrowserProfileMigrator::SETTINGS);
-  COPY_DATA(CopyCookies,      aReplace, nsIBrowserProfileMigrator::COOKIES);
-  COPY_DATA(CopyHistory,      aReplace, nsIBrowserProfileMigrator::HISTORY);
-  COPY_DATA(CopyBookmarks,    aReplace, nsIBrowserProfileMigrator::BOOKMARKS);
-
-  NOTIFY_OBSERVERS(MIGRATION_ENDED, nsnull);
-
-  return rv;
-}
-
-NS_IMETHODIMP
-nsOperaProfileMigrator::GetMigrateData(const PRUnichar* aProfile, 
-                                       bool aReplace,
-                                       PRUint16* aResult)
-{
-  *aResult = 0;
-  if (!mOperaProfile) {
-    GetOperaProfile(aProfile, getter_AddRefs(mOperaProfile));
-    if (!mOperaProfile)
-      return NS_ERROR_FILE_NOT_FOUND;
-  }
-
-  MigrationData data[] = { { ToNewUnicode(OPERA_PREFERENCES_FILE_NAME),
-                             nsIBrowserProfileMigrator::SETTINGS,
-                             false },
-                           { ToNewUnicode(OPERA_COOKIES_FILE_NAME),
-                             nsIBrowserProfileMigrator::COOKIES,
-                             false },
-                           { ToNewUnicode(OPERA_HISTORY_FILE_NAME),
-                             nsIBrowserProfileMigrator::HISTORY,
-                             false },
-                           { ToNewUnicode(OPERA_BOOKMARKS_FILE_NAME),
-                             nsIBrowserProfileMigrator::BOOKMARKS,
-                             false } };
-                                                                  
-  // Frees file name strings allocated above.
-  GetMigrateDataFromArray(data, sizeof(data)/sizeof(MigrationData), 
-                          aReplace, mOperaProfile, aResult);
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsOperaProfileMigrator::GetSourceExists(bool* aResult)
-{
-  nsCOMPtr<nsIArray> profiles;
-  GetSourceProfiles(getter_AddRefs(profiles));
-
-  if (profiles) { 
-    PRUint32 count;
-    profiles->GetLength(&count);
-    *aResult = count > 0;
-  }
-  else
-    *aResult = false;
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsOperaProfileMigrator::GetSourceHasMultipleProfiles(bool* aResult)
-{
-  nsCOMPtr<nsIArray> profiles;
-  GetSourceProfiles(getter_AddRefs(profiles));
-
-#ifdef XP_WIN
-  if (profiles) {
-    PRUint32 count;
-    profiles->GetLength(&count);
-    *aResult = count > 1;
-  }
-  else
-#endif
-    *aResult = false;
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsOperaProfileMigrator::GetSourceProfiles(nsIArray** aResult)
-{
-  if (!mProfiles) {
-    nsresult rv;
-
-    mProfiles = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
-    if (NS_FAILED(rv)) return rv;
-
-    nsCOMPtr<nsIProperties> fileLocator(do_GetService("@mozilla.org/file/directory_service;1"));
-    nsCOMPtr<nsILocalFile> file;
-#ifdef XP_WIN
-    fileLocator->Get(NS_WIN_APPDATA_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(file));
-
-    // Opera profile lives under %APP_DATA%\Opera\<operaver>\profile 
-    file->Append(OPERA_PREFERENCES_FOLDER_NAME);
-
-    nsCOMPtr<nsISimpleEnumerator> e;
-    rv = file->GetDirectoryEntries(getter_AddRefs(e));
-    if (NS_FAILED(rv))
-      return rv;
-
-    bool hasMore;
-    e->HasMoreElements(&hasMore);
-    while (hasMore) {
-      nsCOMPtr<nsILocalFile> curr;
-      e->GetNext(getter_AddRefs(curr));
-
-      bool isDirectory = false;
-      curr->IsDirectory(&isDirectory);
-      if (isDirectory) {
-        nsCOMPtr<nsISupportsString> string(do_CreateInstance("@mozilla.org/supports-string;1"));
-        nsAutoString leafName;
-        curr->GetLeafName(leafName);
-        string->SetData(leafName);
-        mProfiles->AppendElement(string, false);
-      }
-
-      e->HasMoreElements(&hasMore);
-    }
-#elif defined (XP_MACOSX)
-    fileLocator->Get(NS_MAC_USER_LIB_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(file));
-    
-    file->Append(NS_LITERAL_STRING("Preferences"));
-    file->Append(OPERA_PREFERENCES_FOLDER_NAME);
-    
-    bool exists;
-    file->Exists(&exists);
-    
-    if (exists) {
-      nsCOMPtr<nsISupportsString> string(do_CreateInstance("@mozilla.org/supports-string;1"));
-      string->SetData(OPERA_PREFERENCES_FOLDER_NAME);
-      mProfiles->AppendElement(string, false);
-    }
-#elif defined (XP_UNIX)
-    fileLocator->Get(NS_UNIX_HOME_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(file));
-    
-    file->Append(OPERA_PREFERENCES_FOLDER_NAME);
-    
-    bool exists;
-    file->Exists(&exists);
-    
-    if (exists) {
-      nsCOMPtr<nsISupportsString> string(do_CreateInstance("@mozilla.org/supports-string;1"));
-      string->SetData(OPERA_PREFERENCES_FOLDER_NAME);
-      mProfiles->AppendElement(string, false);
-    }
-#endif
-  }
-
-  *aResult = mProfiles;
-  NS_IF_ADDREF(*aResult);
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsOperaProfileMigrator::GetSourceHomePageURL(nsACString& aResult)
-{
-  nsresult rv;
-  nsCAutoString val;
-
-  nsCOMPtr<nsIFile> operaPrefs;
-  mOperaProfile->Clone(getter_AddRefs(operaPrefs));
-  operaPrefs->Append(OPERA_PREFERENCES_FILE_NAME);
-
-  nsCOMPtr<nsILocalFile> lf(do_QueryInterface(operaPrefs));
-  NS_ENSURE_TRUE(lf, NS_ERROR_UNEXPECTED);
-
-  nsINIParser parser;
-  rv = parser.Init(lf);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = parser.GetString("User Prefs",
-                        "Home URL",
-                        val);
-
-  if (NS_SUCCEEDED(rv))
-    aResult.Assign(val);
-
-  return NS_OK;
-}
- 
-
-#define _OPM(type) nsOperaProfileMigrator::type
-
-static
-nsOperaProfileMigrator::PrefTransform gTransforms[] = {
-  { "User Prefs", "Download Directory", _OPM(STRING), "browser.download.dir", _OPM(SetFile), false, { -1 } },
-  { nsnull, "Enable Cookies", _OPM(INT), "network.cookie.cookieBehavior", _OPM(SetCookieBehavior), false, { -1 } },
-  { nsnull, "Accept Cookies Session Only", _OPM(BOOL), "network.cookie.lifetimePolicy", _OPM(SetCookieLifetime), false, { -1 } },
-  { nsnull, "Allow script to resize window", _OPM(BOOL), "dom.disable_window_move_resize", _OPM(SetBool), false, { -1 } },
-  { nsnull, "Allow script to move window", _OPM(BOOL), "dom.disable_window_move_resize", _OPM(SetBool), false, { -1 } },
-  { nsnull, "Allow script to raise window", _OPM(BOOL), "dom.disable_window_flip", _OPM(SetBool), false, { -1 } },
-  { nsnull, "Allow script to change status", _OPM(BOOL), "dom.disable_window_status_change", _OPM(SetBool), false, { -1 } },
-  { nsnull, "Ignore Unrequested Popups", _OPM(BOOL), "dom.disable_open_during_load", _OPM(SetBool), false, { -1 } },
-  { nsnull, "Load Figures", _OPM(BOOL), "permissions.default.image", _OPM(SetImageBehavior), false, { -1 } },
-
-  { "Visited link", nsnull, _OPM(COLOR), "browser.visited_color", _OPM(SetString), false, { -1 } },
-  { "Link", nsnull, _OPM(COLOR), "browser.anchor_color", _OPM(SetString), false, { -1 } },
-  { nsnull, "Underline", _OPM(BOOL), "browser.underline_anchors", _OPM(SetBool), false, { -1 } },
-
-  { nsnull, "Enable SSL v3", _OPM(BOOL), "security.enable_ssl3", _OPM(SetBool), false, { -1 } },
-  { nsnull, "Enable TLS v1.0", _OPM(BOOL), "security.enable_tls", _OPM(SetBool), false, { -1 } },
-
-  { "Extensions", "Scripting", _OPM(BOOL), "javascript.enabled", _OPM(SetBool), false, { -1 } }
-};
-
-nsresult 
-nsOperaProfileMigrator::SetFile(void* aTransform, nsIPrefBranch* aBranch)
-{
-  PrefTransform* xform = (PrefTransform*)aTransform;
-  nsCOMPtr<nsILocalFile> lf(do_CreateInstance("@mozilla.org/file/local;1"));
-  lf->InitWithPath(NS_ConvertUTF8toUTF16(xform->stringValue));
-  return aBranch->SetComplexValue(xform->targetPrefName, NS_GET_IID(nsILocalFile), lf);
-}
-
-nsresult 
-nsOperaProfileMigrator::SetCookieBehavior(void* aTransform, nsIPrefBranch* aBranch)
-{
-  PrefTransform* xform = (PrefTransform*)aTransform;
-  PRInt32 val = (xform->intValue == 3) ? 0 : (xform->intValue == 0) ? 2 : 1;
-  return aBranch->SetIntPref(xform->targetPrefName, val);
-}
-
-nsresult 
-nsOperaProfileMigrator::SetCookieLifetime(void* aTransform, nsIPrefBranch* aBranch)
-{
-  PrefTransform* xform = (PrefTransform*)aTransform;
-  return aBranch->SetIntPref(xform->targetPrefName, xform->boolValue ? 2 : 0);
-}
-
-nsresult 
-nsOperaProfileMigrator::SetImageBehavior(void* aTransform, nsIPrefBranch* aBranch)
-{
-  PrefTransform* xform = (PrefTransform*)aTransform;
-  return aBranch->SetIntPref(xform->targetPrefName, xform->boolValue ? 1 : 2);
-}
-
-nsresult 
-nsOperaProfileMigrator::SetBool(void* aTransform, nsIPrefBranch* aBranch)
-{
-  PrefTransform* xform = (PrefTransform*)aTransform;
-  return aBranch->SetBoolPref(xform->targetPrefName, xform->boolValue);
-}
-
-nsresult 
-nsOperaProfileMigrator::SetWString(void* aTransform, nsIPrefBranch* aBranch)
-{
-  PrefTransform* xform = (PrefTransform*)aTransform;
-  nsCOMPtr<nsIPrefLocalizedString> pls(do_CreateInstance("@mozilla.org/pref-localizedstring;1"));
-  NS_ConvertUTF8toUTF16 data(xform->stringValue); 
-  pls->SetData(data.get());
-  return aBranch->SetComplexValue(xform->targetPrefName, NS_GET_IID(nsIPrefLocalizedString), pls);
-}
-
-nsresult 
-nsOperaProfileMigrator::SetInt(void* aTransform, nsIPrefBranch* aBranch)
-{
-  PrefTransform* xform = (PrefTransform*)aTransform;
-  return aBranch->SetIntPref(xform->targetPrefName, xform->intValue);
-}
-
-nsresult 
-nsOperaProfileMigrator::SetString(void* aTransform, nsIPrefBranch* aBranch)
-{
-  PrefTransform* xform = (PrefTransform*)aTransform;
-  return aBranch->SetCharPref(xform->targetPrefName, xform->stringValue);
-}
-
-nsresult
-nsOperaProfileMigrator::CopyPreferences(bool aReplace)
-{
-  nsresult rv;
-
-  nsCOMPtr<nsIFile> operaPrefs;
-  mOperaProfile->Clone(getter_AddRefs(operaPrefs));
-  operaPrefs->Append(OPERA_PREFERENCES_FILE_NAME);
-
-  nsCOMPtr<nsILocalFile> lf(do_QueryInterface(operaPrefs));
-  NS_ENSURE_TRUE(lf, NS_ERROR_UNEXPECTED);
-
-  nsINIParser parser;
-  rv = parser.Init(lf);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  nsCOMPtr<nsIPrefBranch> branch(do_GetService(NS_PREFSERVICE_CONTRACTID));
-
-  // Traverse the standard transforms
-  PrefTransform* transform;
-  PrefTransform* end = gTransforms + sizeof(gTransforms)/sizeof(PrefTransform);
-
-  const char* lastSectionName = nsnull;
-  for (transform = gTransforms; transform < end; ++transform) {
-    if (transform->sectionName)
-      lastSectionName = transform->sectionName;
-
-    if (transform->type == _OPM(COLOR)) {
-      char* colorString = nsnull;
-      nsresult rv = ParseColor(parser, lastSectionName, &colorString);
-      if (NS_SUCCEEDED(rv)) {
-        transform->stringValue = colorString;
-
-        transform->prefHasValue = true;
-        transform->prefSetterFunc(transform, branch);
-      }
-      if (colorString)
-        free(colorString);
-    }
-    else {
-      nsCAutoString val;
-      rv = parser.GetString(lastSectionName,
-                            transform->keyName,
-                            val);
-      if (NS_SUCCEEDED(rv)) {
-        nsresult strerr;
-        switch (transform->type) {
-        case _OPM(STRING):
-          transform->stringValue = ToNewCString(val);
-          break;
-        case _OPM(INT): {
-            transform->intValue = val.ToInteger(&strerr);
-          }
-          break;
-        case _OPM(BOOL): {
-            transform->boolValue = val.ToInteger(&strerr) != 0;
-          }
-          break;
-        default:
-          break;
-        }
-        transform->prefHasValue = true;
-        transform->prefSetterFunc(transform, branch);
-        if (transform->type == _OPM(STRING) && transform->stringValue) {
-          NS_Free(transform->stringValue);
-          transform->stringValue = nsnull;
-        }
-      }
-    }
-  }
-  
-  // Copy Proxy Settings
-  CopyProxySettings(parser, branch);
-
-  // Copy User Content Sheet
-  if (aReplace)
-    CopyUserContentSheet(parser);
-
-  return NS_OK;
-}
-
-nsresult
-nsOperaProfileMigrator::CopyProxySettings(nsINIParser &aParser, 
-                                          nsIPrefBranch* aBranch)
-{
-  nsresult rv;
-
-  PRInt32 networkProxyType = 0;
-
-  const char* protocols[] = { "HTTP", "HTTPS", "FTP"  };
-  const char* protocols_l[] = { "http", "https", "ftp" };
-  char toggleBuf[15], serverBuf[20], serverPrefBuf[20], 
-       serverPortPrefBuf[25];
-  PRInt32 enabled;
-  for (PRUint32 i = 0; i < ArrayLength(protocols); ++i) {
-    sprintf(toggleBuf, "Use %s", protocols[i]);
-    GetInteger(aParser, "Proxy", toggleBuf, &enabled);
-    if (enabled) {
-      // Enable the "manual configuration" setting if we have at least
-      // one protocol using a Proxy. 
-      networkProxyType = 1;
-    }
-
-    sprintf(serverBuf, "%s Server", protocols[i]);
-    nsCAutoString proxyServer;
-    rv = aParser.GetString("Proxy", serverBuf, proxyServer);
-    if (NS_FAILED(rv))
-      continue;
-
-    sprintf(serverPrefBuf, "network.proxy.%s", protocols_l[i]);
-    sprintf(serverPortPrefBuf, "network.proxy.%s_port", protocols_l[i]);
-    // strings in Opera pref. file are in UTF-8
-    SetProxyPref(NS_ConvertUTF8toUTF16(proxyServer),
-                 serverPrefBuf, serverPortPrefBuf, aBranch);
-  }
-
-  GetInteger(aParser, "Proxy", "Use Automatic Proxy Configuration", &enabled);
-  if (enabled)
-    networkProxyType = 2;
-
-  nsCAutoString configURL;
-  rv = aParser.GetString("Proxy", "Automatic Proxy Configuration URL",
-                         configURL);
-  if (NS_SUCCEEDED(rv))
-    aBranch->SetCharPref("network.proxy.autoconfig_url", configURL.get());
-
-  GetInteger(aParser, "Proxy", "No Proxy Servers Check", &enabled);
-  if (enabled) {
-    nsCAutoString servers;
-    rv = aParser.GetString("Proxy", "No Proxy Servers", servers);
-    if (NS_SUCCEEDED(rv))
-      // strings in Opera pref. file are in UTF-8
-      ParseOverrideServers(NS_ConvertUTF8toUTF16(servers), aBranch);
-  }
-
-  aBranch->SetIntPref("network.proxy.type", networkProxyType);
-
-  return NS_OK;
-}
-
-nsresult
-nsOperaProfileMigrator::GetInteger(nsINIParser &aParser, 
-                                   const char* aSectionName, 
-                                   const char* aKeyName, 
-                                   PRInt32* aResult)
-{
-  nsCAutoString val;
-
-  nsresult rv = aParser.GetString(aSectionName, aKeyName, val);
-  if (NS_FAILED(rv))
-    return rv;
-
-  *aResult = val.ToInteger(&rv);
-
-  return rv;
-}
-
-
-nsresult
-nsOperaProfileMigrator::ParseColor(nsINIParser &aParser,
-                                   const char* aSectionName, char** aResult)
-{
-  nsresult rv;
-  PRInt32 r, g, b;
-
-  rv = GetInteger(aParser, aSectionName, "Red", &r);
-  rv |= GetInteger(aParser, aSectionName, "Green", &g);
-  rv |= GetInteger(aParser, aSectionName, "Blue", &b);
-  if (NS_FAILED(rv)) 
-    return NS_OK; // This Preference has no value. Bail now before we get in trouble.
-
-  *aResult = (char*)malloc(sizeof(char) * 8);
-  if (!*aResult)
-    return NS_ERROR_OUT_OF_MEMORY;
-
-  sprintf(*aResult, "#%02X%02X%02X", r, g, b);
-
-  return NS_OK;
-}
-
-nsresult 
-nsOperaProfileMigrator::CopyUserContentSheet(nsINIParser &aParser)
-{
-  nsresult rv;
-
-  nsCAutoString userContentCSS;
-  rv = aParser.GetString("User Prefs", "Local CSS File", userContentCSS);
-  if (NS_FAILED(rv) || userContentCSS.Length() == 0)
-    return NS_OK;
-
-  // Copy the file
-  nsCOMPtr<nsILocalFile> userContentCSSFile;
-  rv = NS_NewNativeLocalFile(userContentCSS, true,
-                             getter_AddRefs(userContentCSSFile));
-  if (NS_FAILED(rv))
-    return NS_OK;
-
-  bool exists;
-  rv = userContentCSSFile->Exists(&exists);
-  if (NS_FAILED(rv) || !exists)
-    return NS_OK;
-
-  nsCOMPtr<nsIFile> profileChromeDir;
-  NS_GetSpecialDirectory(NS_APP_USER_CHROME_DIR,
-                         getter_AddRefs(profileChromeDir));
-  if (!profileChromeDir)
-    return NS_OK;
-
-  userContentCSSFile->CopyToNative(profileChromeDir,
-                                   NS_LITERAL_CSTRING("userContent.css"));
-
-  return NS_OK;
-}
-
-nsresult
-nsOperaProfileMigrator::CopyCookies(bool aReplace)
-{
-  nsresult rv = NS_OK;
-
-  nsCOMPtr<nsIFile> temp;
-  mOperaProfile->Clone(getter_AddRefs(temp));
-  nsCOMPtr<nsILocalFile> historyFile(do_QueryInterface(temp));
-
-  historyFile->Append(OPERA_COOKIES_FILE_NAME);
-
-  nsCOMPtr<nsIInputStream> fileStream;
-  NS_NewLocalFileInputStream(getter_AddRefs(fileStream), historyFile);
-  if (!fileStream) 
-    return NS_ERROR_OUT_OF_MEMORY;
-
-  nsOperaCookieMigrator* ocm = new nsOperaCookieMigrator(fileStream);
-  if (!ocm)
-    return NS_ERROR_OUT_OF_MEMORY;
-
-  rv = ocm->Migrate();
-
-  if (ocm) {
-    delete ocm;
-    ocm = nsnull;
-  }
-
-  return rv;
-}
-
-nsOperaCookieMigrator::nsOperaCookieMigrator(nsIInputStream* aSourceStream) :
-  mAppVersion(0), mFileVersion(0), mTagTypeLength(0), mPayloadTypeLength(0), 
-  mCookieOpen(false), mCurrHandlingInfo(0)
-{
-  mStream = do_CreateInstance("@mozilla.org/binaryinputstream;1");
-  if (mStream)
-    mStream->SetInputStream(aSourceStream);
-
-  mCurrCookie.isSecure = false;
-  mCurrCookie.expiryTime = 0;
-}
-
-nsOperaCookieMigrator::~nsOperaCookieMigrator() 
-{ 
-  if (mStream)
-    mStream->SetInputStream(nsnull);
-}
-
-
-nsresult
-nsOperaCookieMigrator::Migrate()
-{
-  if (!mStream)
-    return NS_ERROR_FAILURE;
-
-  nsresult rv;
-
-  rv = ReadHeader();
-  if (NS_FAILED(rv)) 
-    return NS_OK;
-
-  nsCOMPtr<nsICookieManager2> manager(do_GetService(NS_COOKIEMANAGER_CONTRACTID));
-  nsCOMPtr<nsIPermissionManager> permissionManager(do_GetService("@mozilla.org/permissionmanager;1"));
-
-  PRUint8 tag;
-  PRUint16 length, segmentLength;
-
-  char* buf = nsnull;
-  do {
-    if (NS_FAILED(mStream->Read8(&tag))) 
-      return NS_OK; // EOF.
-
-    switch (tag) {
-    case BEGIN_DOMAIN_SEGMENT:
-      mStream->Read16(&length);
-      break;
-    case DOMAIN_COMPONENT: 
-      {
-        mStream->Read16(&length);
-        
-        mStream->ReadBytes(length, &buf);
-        buf = (char*)nsMemory::Realloc(buf, length+1);
-        buf[length] = '\0';
-        mDomainStack.AppendElement(buf);
-      }
-      break;
-    case END_DOMAIN_SEGMENT:
-      {
-        if (mCurrHandlingInfo)
-          AddCookieOverride(permissionManager);
-
-        // Pop the domain stack
-        PRUint32 count = mDomainStack.Length();
-        if (count > 0) {
-          char* segment = mDomainStack.ElementAt(count - 1);
-          if (segment) 
-            nsMemory::Free(segment);
-          mDomainStack.RemoveElementAt(count - 1);
-        }
-      }
-      break;
-
-    case BEGIN_PATH_SEGMENT:
-      mStream->Read16(&length);
-      break;
-    case PATH_COMPONENT:
-      {
-        mStream->Read16(&length);
-        
-        mStream->ReadBytes(length, &buf);
-        buf = (char*)nsMemory::Realloc(buf, length+1);
-        buf[length] = '\0';
-        mPathStack.AppendElement(buf);
-      }
-      break;
-    case END_PATH_SEGMENT:
-      {
-        // Add the last remaining cookie for this path.
-        if (mCookieOpen) 
-          AddCookie(manager);
-
-        // We receive one "End Path Segment" even if the path stack is empty
-        // i.e. telling us that we are done processing cookies for "/"
-
-        // Pop the path stack
-        PRUint32 count = mPathStack.Length();
-        if (count > 0) {
-          char* segment = mPathStack.ElementAt(count - 1);
-          if (segment)
-            nsMemory::Free(segment);
-          mPathStack.RemoveElementAt(count - 1);
-        }
-      }
-      break;
-
-    case FILTERING_INFO:
-      mStream->Read16(&length);
-      mStream->Read8(&mCurrHandlingInfo);
-      break;
-    case PATH_HANDLING_INFO:
-    case THIRD_PARTY_HANDLING_INFO: 
-      {
-        mStream->Read16(&length);
-        PRUint8 temp;
-        mStream->Read8(&temp);
-      }
-      break;
-
-    case BEGIN_COOKIE_SEGMENT:
-      {
-        // Be sure to save the last cookie before overwriting the buffers
-        // with data from subsequent cookies. 
-        if (mCookieOpen)
-          AddCookie(manager);
-
-        mStream->Read16(&segmentLength);
-        mCookieOpen = true;
-      }
-      break;
-    case COOKIE_ID:
-      {
-        mStream->Read16(&length);
-        mStream->ReadBytes(length, &buf);
-        buf = (char*)nsMemory::Realloc(buf, length+1);
-        buf[length] = '\0';
-        mCurrCookie.id.Assign(buf);
-        if (buf) {
-          nsMemory::Free(buf);
-          buf = nsnull;
-        }
-      }
-      break;
-    case COOKIE_DATA:
-      {
-        mStream->Read16(&length);
-        mStream->ReadBytes(length, &buf);
-        buf = (char*)nsMemory::Realloc(buf, length+1);
-        buf[length] = '\0';
-        mCurrCookie.data.Assign(buf);
-        if (buf) {
-          nsMemory::Free(buf);
-          buf = nsnull;
-        }
-      }
-      break;
-    case COOKIE_EXPIRY:
-      mStream->Read16(&length);
-      mStream->Read32(reinterpret_cast<PRUint32*>(&(mCurrCookie.expiryTime)));
-      break;
-    case COOKIE_SECURE:
-      mCurrCookie.isSecure = true;
-      break;
-
-    // We don't support any of these fields but we must read them in
-    // to advance the stream cursor. 
-    case COOKIE_LASTUSED: 
-      {
-        mStream->Read16(&length);
-        PRTime temp;
-        mStream->Read32(reinterpret_cast<PRUint32*>(&temp));
-      }
-      break;
-    case COOKIE_COMMENT:
-    case COOKIE_COMMENT_URL:
-    case COOKIE_V1_DOMAIN:
-    case COOKIE_V1_PATH:
-    case COOKIE_V1_PORT_LIMITATIONS:
-      {
-        mStream->Read16(&length);
-        mStream->ReadBytes(length, &buf);
-        if (buf) {
-          nsMemory::Free(buf);
-          buf = nsnull;
-        }
-      }
-      break;
-    case COOKIE_VERSION: 
-      {
-        mStream->Read16(&length);
-        PRUint8 temp;
-        mStream->Read8(&temp);
-      }
-      break;
-    case COOKIE_OTHERFLAG_1:
-    case COOKIE_OTHERFLAG_2:
-    case COOKIE_OTHERFLAG_3:
-    case COOKIE_OTHERFLAG_4:
-    case COOKIE_OTHERFLAG_5:
-    case COOKIE_OTHERFLAG_6: 
-      break;
-    }
-  }
-  while (1);
-  
-  // Make sure the path and domain stacks are clear. 
-  char* segment = nsnull;
-  PRUint32 i;
-  PRUint32 count = mPathStack.Length();
-  for (i = 0; i < count; ++i) {
-    segment = mPathStack.ElementAt(i);
-    if (segment) {
-      nsMemory::Free(segment);
-      segment = nsnull;
-    }
-  }
-  count = mDomainStack.Length();
-  for (i = 0; i < count; ++i) {
-    segment = mDomainStack.ElementAt(i);
-    if (segment) {
-      nsMemory::Free(segment);
-      segment = nsnull;
-    }
-  }
-  
-  return NS_OK;
-}
-
-nsresult
-nsOperaCookieMigrator::AddCookieOverride(nsIPermissionManager* aManager)
-{
-  nsresult rv;
-
-  nsCString domain;
-  SynthesizeDomain(getter_Copies(domain));
-  nsCOMPtr<nsIURI> uri(do_CreateInstance("@mozilla.org/network/standard-url;1"));
-  if (!uri)
-    return NS_ERROR_OUT_OF_MEMORY;
-  uri->SetHost(domain);
-
-  rv = aManager->Add(uri, "cookie",
-                     (mCurrHandlingInfo == 1 || mCurrHandlingInfo == 3)
-                     ? (PRUint32) nsIPermissionManager::ALLOW_ACTION
-                     : (PRUint32) nsIPermissionManager::DENY_ACTION,
-                     nsIPermissionManager::EXPIRE_NEVER,