Merge backout on this CLOSED TREE
authorPhilipp von Weitershausen <philipp@weitershausen.de>
Thu, 20 Oct 2011 16:21:52 -0700
changeset 79722 96c48e41ce91f96ff3e69e6abba997e64010f624
parent 79721 353f5413395827fef072b15e6f30da40bfdeed27 (current diff)
parent 79720 b957b1741f6823aef6f8980cc3a7e1802c676d4d (diff)
child 79723 01942de9ff57fa60755eb1271afa7252ecb247b1
push id506
push userclegnitto@mozilla.com
push dateWed, 09 Nov 2011 02:03:18 +0000
treeherdermozilla-aurora@63587fc7bb93 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone10.0a1
Merge backout on this CLOSED TREE
browser/devtools/webconsole/test/browser/browser_webconsole_gcli_require.js
content/canvas/test/webgl/conformance/array-buffer-crash.html
content/canvas/test/webgl/conformance/array-buffer-view-crash.html
content/canvas/test/webgl/conformance/array-unit-tests.html
content/canvas/test/webgl/conformance/bad-arguments-test.html
content/canvas/test/webgl/conformance/buffer-bind-test.html
content/canvas/test/webgl/conformance/buffer-data-array-buffer.html
content/canvas/test/webgl/conformance/buffer-offscreen-test.html
content/canvas/test/webgl/conformance/buffer-preserve-test.html
content/canvas/test/webgl/conformance/canvas-test.html
content/canvas/test/webgl/conformance/canvas-zero-size.html
content/canvas/test/webgl/conformance/constants.html
content/canvas/test/webgl/conformance/context-attributes-alpha-depth-stencil-antialias.html
content/canvas/test/webgl/conformance/context-lost-restored.html
content/canvas/test/webgl/conformance/context-lost.html
content/canvas/test/webgl/conformance/context-type-test.html
content/canvas/test/webgl/conformance/copy-tex-image-and-sub-image-2d.html
content/canvas/test/webgl/conformance/draw-arrays-out-of-bounds.html
content/canvas/test/webgl/conformance/draw-elements-out-of-bounds.html
content/canvas/test/webgl/conformance/drawingbuffer-static-canvas-test.html
content/canvas/test/webgl/conformance/drawingbuffer-test.html
content/canvas/test/webgl/conformance/error-reporting.html
content/canvas/test/webgl/conformance/framebuffer-object-attachment.html
content/canvas/test/webgl/conformance/framebuffer-test.html
content/canvas/test/webgl/conformance/get-active-test.html
content/canvas/test/webgl/conformance/gl-bind-attrib-location-test.html
content/canvas/test/webgl/conformance/gl-clear.html
content/canvas/test/webgl/conformance/gl-drawelements.html
content/canvas/test/webgl/conformance/gl-enable-enum-test.html
content/canvas/test/webgl/conformance/gl-enable-vertex-attrib.html
content/canvas/test/webgl/conformance/gl-enum-tests.html
content/canvas/test/webgl/conformance/gl-fragcoord.html
content/canvas/test/webgl/conformance/gl-get-active-attribute.html
content/canvas/test/webgl/conformance/gl-get-active-uniform.html
content/canvas/test/webgl/conformance/gl-get-calls.html
content/canvas/test/webgl/conformance/gl-geterror.html
content/canvas/test/webgl/conformance/gl-getshadersource.html
content/canvas/test/webgl/conformance/gl-getstring.html
content/canvas/test/webgl/conformance/gl-min-attribs.html
content/canvas/test/webgl/conformance/gl-min-textures.html
content/canvas/test/webgl/conformance/gl-min-uniforms.html
content/canvas/test/webgl/conformance/gl-object-get-calls.html
content/canvas/test/webgl/conformance/gl-pixelstorei.html
content/canvas/test/webgl/conformance/gl-scissor-test.html
content/canvas/test/webgl/conformance/gl-shader-test.html
content/canvas/test/webgl/conformance/gl-teximage.html
content/canvas/test/webgl/conformance/gl-uniform-arrays.html
content/canvas/test/webgl/conformance/gl-uniform-bool.html
content/canvas/test/webgl/conformance/gl-uniformmatrix4fv.html
content/canvas/test/webgl/conformance/gl-unknown-uniform.html
content/canvas/test/webgl/conformance/gl-vertex-attrib-zero-issues.html
content/canvas/test/webgl/conformance/gl-vertex-attrib.html
content/canvas/test/webgl/conformance/gl-vertexattribpointer-offsets.html
content/canvas/test/webgl/conformance/gl-vertexattribpointer.html
content/canvas/test/webgl/conformance/glsl-2types-of-textures-on-same-unit.html
content/canvas/test/webgl/conformance/glsl-conformance.html
content/canvas/test/webgl/conformance/glsl-features.html
content/canvas/test/webgl/conformance/glsl-long-variable-names.html
content/canvas/test/webgl/conformance/include.vs
content/canvas/test/webgl/conformance/incorrect-context-object-behaviour.html
content/canvas/test/webgl/conformance/index-validation-copies-indices.html
content/canvas/test/webgl/conformance/index-validation-crash-with-buffer-sub-data.html
content/canvas/test/webgl/conformance/index-validation-verifies-too-many-indices.html
content/canvas/test/webgl/conformance/index-validation-with-resized-buffer.html
content/canvas/test/webgl/conformance/index-validation.html
content/canvas/test/webgl/conformance/instanceof-test.html
content/canvas/test/webgl/conformance/invalid-UTF-16.html
content/canvas/test/webgl/conformance/invalid-passed-params.html
content/canvas/test/webgl/conformance/is-object.html
content/canvas/test/webgl/conformance/methods.html
content/canvas/test/webgl/conformance/more-than-65536-points.html
content/canvas/test/webgl/conformance/null-object-behaviour.html
content/canvas/test/webgl/conformance/null-uniform-location.html
content/canvas/test/webgl/conformance/object-deletion-behaviour.html
content/canvas/test/webgl/conformance/oes-standard-derivatives.html
content/canvas/test/webgl/conformance/oes-texture-float.html
content/canvas/test/webgl/conformance/oes-vertex-array-object.html
content/canvas/test/webgl/conformance/origin-clean-conformance.html
content/canvas/test/webgl/conformance/point-size.html
content/canvas/test/webgl/conformance/premultiplyalpha-test.html
content/canvas/test/webgl/conformance/program-test.html
content/canvas/test/webgl/conformance/read-pixels-pack-alignment.html
content/canvas/test/webgl/conformance/read-pixels-test.html
content/canvas/test/webgl/conformance/renderbuffer-initialization.html
content/canvas/test/webgl/conformance/resource-sharing-test.html
content/canvas/test/webgl/conformance/tex-image-and-sub-image-2d-with-array-buffer-view.html
content/canvas/test/webgl/conformance/tex-image-and-sub-image-2d-with-canvas.html
content/canvas/test/webgl/conformance/tex-image-and-sub-image-2d-with-image-data.html
content/canvas/test/webgl/conformance/tex-image-and-sub-image-2d-with-image.html
content/canvas/test/webgl/conformance/tex-image-and-sub-image-2d-with-video.html
content/canvas/test/webgl/conformance/tex-image-and-uniform-binding-bugs.html
content/canvas/test/webgl/conformance/tex-image-with-format-and-type.html
content/canvas/test/webgl/conformance/tex-image-with-invalid-data.html
content/canvas/test/webgl/conformance/tex-input-validation.html
content/canvas/test/webgl/conformance/tex-sub-image-2d-bad-args.html
content/canvas/test/webgl/conformance/tex-sub-image-2d.html
content/canvas/test/webgl/conformance/texparameter-test.html
content/canvas/test/webgl/conformance/texture-active-bind-2.html
content/canvas/test/webgl/conformance/texture-active-bind.html
content/canvas/test/webgl/conformance/texture-complete.html
content/canvas/test/webgl/conformance/texture-formats-test.html
content/canvas/test/webgl/conformance/texture-npot-video.html
content/canvas/test/webgl/conformance/texture-npot.html
content/canvas/test/webgl/conformance/texture-transparent-pixels-initialized.html
content/canvas/test/webgl/conformance/triangle.html
content/canvas/test/webgl/conformance/type-conversion-test.html
content/canvas/test/webgl/conformance/uniform-location.html
content/canvas/test/webgl/conformance/uniform-samplers-test.html
content/canvas/test/webgl/conformance/uninitialized-test.html
content/canvas/test/webgl/conformance/viewport-unchanged-upon-resize.html
content/canvas/test/webgl/conformance/webgl-specific.html
dom/interfaces/html/nsIDOMNSHTMLFrameElement.idl
js/src/jsstaticcheck.h
js/src/xpconnect/Makefile.in
js/src/xpconnect/crashtests/117307-1.html
js/src/xpconnect/crashtests/193710.html
js/src/xpconnect/crashtests/290162-1.html
js/src/xpconnect/crashtests/326615-1.html
js/src/xpconnect/crashtests/328553-1.html
js/src/xpconnect/crashtests/346258-1.html
js/src/xpconnect/crashtests/346512-1-frame1.xhtml
js/src/xpconnect/crashtests/346512-1-frame2.xhtml
js/src/xpconnect/crashtests/346512-1.xhtml
js/src/xpconnect/crashtests/382133-1.html
js/src/xpconnect/crashtests/386680-1.html
js/src/xpconnect/crashtests/394810-1.html
js/src/xpconnect/crashtests/400349-1.html
js/src/xpconnect/crashtests/403356-1.html
js/src/xpconnect/crashtests/418139-1.svg
js/src/xpconnect/crashtests/420513-1.html
js/src/xpconnect/crashtests/453935-1.html
js/src/xpconnect/crashtests/462926.html
js/src/xpconnect/crashtests/467693-1.html
js/src/xpconnect/crashtests/468552-1.html
js/src/xpconnect/crashtests/471366-1.html
js/src/xpconnect/crashtests/475185-1.html
js/src/xpconnect/crashtests/475291-1.html
js/src/xpconnect/crashtests/503286-1.html
js/src/xpconnect/crashtests/504000-1.html
js/src/xpconnect/crashtests/509075-1.html
js/src/xpconnect/crashtests/512815-1.html
js/src/xpconnect/crashtests/515726-1.html
js/src/xpconnect/crashtests/545291-1.html
js/src/xpconnect/crashtests/558979.html
js/src/xpconnect/crashtests/582649.html
js/src/xpconnect/crashtests/601284-1.html
js/src/xpconnect/crashtests/603146-1.html
js/src/xpconnect/crashtests/603858-1.html
js/src/xpconnect/crashtests/608963.html
js/src/xpconnect/crashtests/616930-1.html
js/src/xpconnect/crashtests/639737-1.html
js/src/xpconnect/crashtests/648206-1.html
js/src/xpconnect/crashtests/crashtests.list
js/src/xpconnect/idl/Makefile.in
js/src/xpconnect/idl/mozIJSSubScriptLoader.idl
js/src/xpconnect/idl/nsIJSContextStack.idl
js/src/xpconnect/idl/nsIJSEngineTelemetryStats.idl
js/src/xpconnect/idl/nsIJSRuntimeService.idl
js/src/xpconnect/idl/nsIScriptError.idl
js/src/xpconnect/idl/nsIXPCScriptNotify.idl
js/src/xpconnect/idl/nsIXPCScriptable.idl
js/src/xpconnect/idl/nsIXPCSecurityManager.idl
js/src/xpconnect/idl/nsIXPConnect.idl
js/src/xpconnect/idl/xpcIJSGetFactory.idl
js/src/xpconnect/idl/xpcIJSModuleLoader.idl
js/src/xpconnect/idl/xpcIJSWeakReference.idl
js/src/xpconnect/idl/xpccomponents.idl
js/src/xpconnect/idl/xpcexception.idl
js/src/xpconnect/idl/xpcjsid.idl
js/src/xpconnect/loader/Makefile.in
js/src/xpconnect/loader/XPCOMUtils.jsm
js/src/xpconnect/loader/mozJSComponentLoader.cpp
js/src/xpconnect/loader/mozJSComponentLoader.h
js/src/xpconnect/loader/mozJSLoaderUtils.cpp
js/src/xpconnect/loader/mozJSLoaderUtils.h
js/src/xpconnect/loader/mozJSSubScriptLoader.cpp
js/src/xpconnect/loader/mozJSSubScriptLoader.h
js/src/xpconnect/public/Makefile.in
js/src/xpconnect/public/nsAXPCNativeCallContext.h
js/src/xpconnect/public/nsAutoJSValHolder.h
js/src/xpconnect/public/xpc_map_end.h
js/src/xpconnect/sample/Makefile.in
js/src/xpconnect/sample/README
js/src/xpconnect/sample/xpcsample1.cpp
js/src/xpconnect/sample/xpcsample1.idl
js/src/xpconnect/sample/xpcsample1.js
js/src/xpconnect/shell/Makefile.in
js/src/xpconnect/shell/jsshell.msg
js/src/xpconnect/shell/xpcshell.cpp
js/src/xpconnect/shell/xpcshellMacUtils.h
js/src/xpconnect/shell/xpcshellMacUtils.mm
js/src/xpconnect/src/Makefile.in
js/src/xpconnect/src/README
js/src/xpconnect/src/XPCWrapper.cpp
js/src/xpconnect/src/XPCWrapper.h
js/src/xpconnect/src/codegen.py
js/src/xpconnect/src/dom_quickstubs.qsconf
js/src/xpconnect/src/dombindings.conf
js/src/xpconnect/src/dombindings.cpp
js/src/xpconnect/src/dombindings.h
js/src/xpconnect/src/dombindingsgen.py
js/src/xpconnect/src/nsCSSPropertiesQS.h
js/src/xpconnect/src/nsDOMQS.h
js/src/xpconnect/src/nsScriptError.cpp
js/src/xpconnect/src/nsXPConnect.cpp
js/src/xpconnect/src/qsWinUndefs.h
js/src/xpconnect/src/qsgen.py
js/src/xpconnect/src/xpc.msg
js/src/xpconnect/src/xpcJSWeakReference.cpp
js/src/xpconnect/src/xpcJSWeakReference.h
js/src/xpconnect/src/xpccallcontext.cpp
js/src/xpconnect/src/xpccomponents.cpp
js/src/xpconnect/src/xpccontext.cpp
js/src/xpconnect/src/xpcconvert.cpp
js/src/xpconnect/src/xpcdebug.cpp
js/src/xpconnect/src/xpcexception.cpp
js/src/xpconnect/src/xpcforwards.h
js/src/xpconnect/src/xpcinlines.h
js/src/xpconnect/src/xpcjsid.cpp
js/src/xpconnect/src/xpcjsruntime.cpp
js/src/xpconnect/src/xpclocale.cpp
js/src/xpconnect/src/xpclog.cpp
js/src/xpconnect/src/xpclog.h
js/src/xpconnect/src/xpcmaps.cpp
js/src/xpconnect/src/xpcmaps.h
js/src/xpconnect/src/xpcmodule.cpp
js/src/xpconnect/src/xpcmodule.h
js/src/xpconnect/src/xpcprivate.h
js/src/xpconnect/src/xpcpublic.h
js/src/xpconnect/src/xpcquickstubs.cpp
js/src/xpconnect/src/xpcquickstubs.h
js/src/xpconnect/src/xpcruntimesvc.cpp
js/src/xpconnect/src/xpcstack.cpp
js/src/xpconnect/src/xpcstring.cpp
js/src/xpconnect/src/xpcthreadcontext.cpp
js/src/xpconnect/src/xpcthrower.cpp
js/src/xpconnect/src/xpcvariant.cpp
js/src/xpconnect/src/xpcwrappedjs.cpp
js/src/xpconnect/src/xpcwrappedjsclass.cpp
js/src/xpconnect/src/xpcwrappednative.cpp
js/src/xpconnect/src/xpcwrappednativeinfo.cpp
js/src/xpconnect/src/xpcwrappednativejsops.cpp
js/src/xpconnect/src/xpcwrappednativeproto.cpp
js/src/xpconnect/src/xpcwrappednativescope.cpp
js/src/xpconnect/tests/Makefile.in
js/src/xpconnect/tests/chrome/Makefile.in
js/src/xpconnect/tests/chrome/bug503926.xul
js/src/xpconnect/tests/chrome/file_bug618176.xul
js/src/xpconnect/tests/chrome/file_evalInSandbox.html
js/src/xpconnect/tests/chrome/test_APIExposer.xul
js/src/xpconnect/tests/chrome/test_bug448587.xul
js/src/xpconnect/tests/chrome/test_bug484459.xul
js/src/xpconnect/tests/chrome/test_bug500931.xul
js/src/xpconnect/tests/chrome/test_bug503926.xul
js/src/xpconnect/tests/chrome/test_bug517163.xul
js/src/xpconnect/tests/chrome/test_bug533596.xul
js/src/xpconnect/tests/chrome/test_bug571849.xul
js/src/xpconnect/tests/chrome/test_bug596580.xul
js/src/xpconnect/tests/chrome/test_bug601803.xul
js/src/xpconnect/tests/chrome/test_bug610390.xul
js/src/xpconnect/tests/chrome/test_bug614757.xul
js/src/xpconnect/tests/chrome/test_bug616992.xul
js/src/xpconnect/tests/chrome/test_bug618176.xul
js/src/xpconnect/tests/chrome/test_bug654370.xul
js/src/xpconnect/tests/chrome/test_bug658560.xul
js/src/xpconnect/tests/chrome/test_bug664689.xul
js/src/xpconnect/tests/chrome/test_bug679861.xul
js/src/xpconnect/tests/chrome/test_cows.xul
js/src/xpconnect/tests/chrome/test_doublewrappedcompartments.xul
js/src/xpconnect/tests/chrome/test_evalInSandbox.xul
js/src/xpconnect/tests/chrome/test_nodelists.xul
js/src/xpconnect/tests/chrome/test_precisegc.xul
js/src/xpconnect/tests/chrome/test_sandboxImport.xul
js/src/xpconnect/tests/chrome/test_wrappers-2.xul
js/src/xpconnect/tests/chrome/test_wrappers.xul
js/src/xpconnect/tests/components/js/Makefile.in
js/src/xpconnect/tests/components/js/xpctest.manifest
js/src/xpconnect/tests/components/js/xpctest_attributes.js
js/src/xpconnect/tests/components/js/xpctest_params.js
js/src/xpconnect/tests/components/native/Makefile.in
js/src/xpconnect/tests/components/native/xpctest.manifest
js/src/xpconnect/tests/components/native/xpctest_attributes.cpp
js/src/xpconnect/tests/components/native/xpctest_module.cpp
js/src/xpconnect/tests/components/native/xpctest_params.cpp
js/src/xpconnect/tests/components/native/xpctest_private.h
js/src/xpconnect/tests/idl/Makefile.in
js/src/xpconnect/tests/idl/xpctest_attributes.idl
js/src/xpconnect/tests/idl/xpctest_params.idl
js/src/xpconnect/tests/js/checkid.js
js/src/xpconnect/tests/js/evaluate.js
js/src/xpconnect/tests/js/exceptions-2.js
js/src/xpconnect/tests/js/exceptions-3.js
js/src/xpconnect/tests/js/exceptions-4.js
js/src/xpconnect/tests/js/exceptions-5.js
js/src/xpconnect/tests/js/exceptions.js
js/src/xpconnect/tests/js/javascript.js
js/src/xpconnect/tests/js/multiple-2.js
js/src/xpconnect/tests/js/multiple-3.js
js/src/xpconnect/tests/js/multiple-4.js
js/src/xpconnect/tests/js/multiple.js
js/src/xpconnect/tests/js/notscriptable.js
js/src/xpconnect/tests/js/old/simpletest.js
js/src/xpconnect/tests/js/old/speed.js
js/src/xpconnect/tests/js/old/testxpc.js
js/src/xpconnect/tests/js/old/try.js
js/src/xpconnect/tests/js/old/xpctest_array.js
js/src/xpconnect/tests/js/old/xpctest_callcontext.js
js/src/xpconnect/tests/js/old/xpctest_echo.js
js/src/xpconnect/tests/js/old/xpctest_enum_and_sort.js
js/src/xpconnect/tests/js/old/xpctest_enum_constants.js
js/src/xpconnect/tests/js/old/xpctest_enum_create.js
js/src/xpconnect/tests/js/old/xpctest_exceptions.js
js/src/xpconnect/tests/js/old/xpctest_ids.js
js/src/xpconnect/tests/js/old/xpctest_observer.js
js/src/xpconnect/tests/js/old/xpctest_overloaded.js
js/src/xpconnect/tests/js/old/xpctest_primitives.js
js/src/xpconnect/tests/js/old/xpctest_propertybag.js
js/src/xpconnect/tests/js/old/xpctest_variant.js
js/src/xpconnect/tests/js/old/xpctest_variant_array.js
js/src/xpconnect/tests/js/readonlyattributes.js
js/src/xpconnect/tests/js/scriptable.js
js/src/xpconnect/tests/js/testin.js
js/src/xpconnect/tests/js/xpcfun.js
js/src/xpconnect/tests/js/xpctest_primitives.js
js/src/xpconnect/tests/mochitest/Makefile.in
js/src/xpconnect/tests/mochitest/bug500931_helper.html
js/src/xpconnect/tests/mochitest/bug504877_helper.html
js/src/xpconnect/tests/mochitest/bug571849_helper.html
js/src/xpconnect/tests/mochitest/bug589028_helper.html
js/src/xpconnect/tests/mochitest/bug657267.jar
js/src/xpconnect/tests/mochitest/bug92773_helper.html
js/src/xpconnect/tests/mochitest/chrome_wrappers_helper.html
js/src/xpconnect/tests/mochitest/file1_bug629227.html
js/src/xpconnect/tests/mochitest/file2_bug629227.html
js/src/xpconnect/tests/mochitest/file_bug505915.html
js/src/xpconnect/tests/mochitest/file_bug650273.html
js/src/xpconnect/tests/mochitest/file_bug658560.html
js/src/xpconnect/tests/mochitest/file_doublewrappedcompartments.html
js/src/xpconnect/tests/mochitest/file_evalInSandbox.html
js/src/xpconnect/tests/mochitest/file_nodelists.html
js/src/xpconnect/tests/mochitest/file_wrappers-2.html
js/src/xpconnect/tests/mochitest/inner.html
js/src/xpconnect/tests/mochitest/test1_bug629331.html
js/src/xpconnect/tests/mochitest/test2_bug629331.html
js/src/xpconnect/tests/mochitest/test_bug361111.xul
js/src/xpconnect/tests/mochitest/test_bug384632.html
js/src/xpconnect/tests/mochitest/test_bug390488.html
js/src/xpconnect/tests/mochitest/test_bug393269.html
js/src/xpconnect/tests/mochitest/test_bug396851.html
js/src/xpconnect/tests/mochitest/test_bug428021.html
js/src/xpconnect/tests/mochitest/test_bug446584.html
js/src/xpconnect/tests/mochitest/test_bug462428.html
js/src/xpconnect/tests/mochitest/test_bug478438.html
js/src/xpconnect/tests/mochitest/test_bug484107.html
js/src/xpconnect/tests/mochitest/test_bug500691.html
js/src/xpconnect/tests/mochitest/test_bug502959.html
js/src/xpconnect/tests/mochitest/test_bug503926.html
js/src/xpconnect/tests/mochitest/test_bug504877.html
js/src/xpconnect/tests/mochitest/test_bug505915.html
js/src/xpconnect/tests/mochitest/test_bug553407.html
js/src/xpconnect/tests/mochitest/test_bug560351.html
js/src/xpconnect/tests/mochitest/test_bug564330.html
js/src/xpconnect/tests/mochitest/test_bug585745.html
js/src/xpconnect/tests/mochitest/test_bug589028.html
js/src/xpconnect/tests/mochitest/test_bug601299.html
js/src/xpconnect/tests/mochitest/test_bug605167.html
js/src/xpconnect/tests/mochitest/test_bug618017.html
js/src/xpconnect/tests/mochitest/test_bug623437.html
js/src/xpconnect/tests/mochitest/test_bug628410.html
js/src/xpconnect/tests/mochitest/test_bug628794.html
js/src/xpconnect/tests/mochitest/test_bug629227.html
js/src/xpconnect/tests/mochitest/test_bug629331.html
js/src/xpconnect/tests/mochitest/test_bug636097.html
js/src/xpconnect/tests/mochitest/test_bug650273.html
js/src/xpconnect/tests/mochitest/test_bug655297.html
js/src/xpconnect/tests/mochitest/test_bug657267.html
js/src/xpconnect/tests/mochitest/test_bug661980.html
js/src/xpconnect/tests/mochitest/test_bug691059.html
js/src/xpconnect/tests/mochitest/test_bug92773.html
js/src/xpconnect/tests/mochitest/test_frameWrapping.html
js/src/xpconnect/tests/unit/CatRegistrationComponents.manifest
js/src/xpconnect/tests/unit/bogus_element_type.jsm
js/src/xpconnect/tests/unit/bogus_exports_type.jsm
js/src/xpconnect/tests/unit/bug451678_subscript.js
js/src/xpconnect/tests/unit/bug596580_versioned.js
js/src/xpconnect/tests/unit/component-file.js
js/src/xpconnect/tests/unit/component-file.manifest
js/src/xpconnect/tests/unit/component_import.js
js/src/xpconnect/tests/unit/component_import.manifest
js/src/xpconnect/tests/unit/recursive_importA.jsm
js/src/xpconnect/tests/unit/recursive_importB.jsm
js/src/xpconnect/tests/unit/syntax_error.jsm
js/src/xpconnect/tests/unit/test_attributes.js
js/src/xpconnect/tests/unit/test_bogus_files.js
js/src/xpconnect/tests/unit/test_bug408412.js
js/src/xpconnect/tests/unit/test_bug451678.js
js/src/xpconnect/tests/unit/test_bug596580.js
js/src/xpconnect/tests/unit/test_bug604362.js
js/src/xpconnect/tests/unit/test_bug608142.js
js/src/xpconnect/tests/unit/test_bug641378.js
js/src/xpconnect/tests/unit/test_bug677864.js
js/src/xpconnect/tests/unit/test_bug_442086.js
js/src/xpconnect/tests/unit/test_file.js
js/src/xpconnect/tests/unit/test_import.js
js/src/xpconnect/tests/unit/test_js_weak_references.js
js/src/xpconnect/tests/unit/test_localeCompare.js
js/src/xpconnect/tests/unit/test_params.js
js/src/xpconnect/tests/unit/test_recursive_import.js
js/src/xpconnect/tests/unit/test_reflect_parse.js
js/src/xpconnect/tests/unit/test_unload.js
js/src/xpconnect/tests/unit/test_xpcomutils.js
js/src/xpconnect/tests/unit/xpcshell.ini
js/src/xpconnect/wrappers/AccessCheck.cpp
js/src/xpconnect/wrappers/AccessCheck.h
js/src/xpconnect/wrappers/CrossOriginWrapper.cpp
js/src/xpconnect/wrappers/CrossOriginWrapper.h
js/src/xpconnect/wrappers/FilteringWrapper.cpp
js/src/xpconnect/wrappers/FilteringWrapper.h
js/src/xpconnect/wrappers/Makefile.in
js/src/xpconnect/wrappers/WrapperFactory.cpp
js/src/xpconnect/wrappers/WrapperFactory.h
js/src/xpconnect/wrappers/XrayWrapper.cpp
js/src/xpconnect/wrappers/XrayWrapper.h
layout/base/nsIDocumentViewer.h
media/libvpx/vp8/common/arm/vpx_asm_offsets.c
media/libvpx/vp8/common/filter_c.c
media/libvpx/vp8/common/predictdc.c
media/libvpx/vp8/common/predictdc.h
media/libvpx/vp8/common/preproc.h
media/libvpx/vp8/common/vpxerrors.h
media/libvpx/vp8/decoder/arm/dboolhuff_arm.h
media/libvpx/vp8/decoder/arm/detokenize.asm
media/libvpx/vp8/decoder/arm/detokenize_arm.h
media/libvpx/vpx_ports/x86_abi_support_win32.asm
media/libvpx/vpx_scale/generic/scalesystemdependant.c
netwerk/test/unit/test_bug272541.js
netwerk/test/unit/test_bug419157.js
netwerk/test/unit/test_bug588389.js
netwerk/test/unit/test_bug651185.js
netwerk/test/unit/test_bug670333.js
services/sync/modules/policies.js
services/sync/modules/service.js
services/sync/tests/unit/head_http_server.js
services/sync/tests/unit/test_errorhandler.js
testing/mochitest/ipc-overlay.xul
testing/mochitest/ipc.js
testing/mochitest/tests/SimpleTest/quit.js
testing/mozmill/Makefile.in
testing/mozmill/README.txt
testing/mozmill/installmozmill.py
testing/mozmill/jsbridge/MANIFEST.in
testing/mozmill/jsbridge/jsbridge/__init__.py
testing/mozmill/jsbridge/jsbridge/extension/chrome.manifest
testing/mozmill/jsbridge/jsbridge/extension/chrome/content/overlay.js
testing/mozmill/jsbridge/jsbridge/extension/chrome/content/overlay.xul
testing/mozmill/jsbridge/jsbridge/extension/components/cmdarg.js
testing/mozmill/jsbridge/jsbridge/extension/install.rdf
testing/mozmill/jsbridge/jsbridge/extension/resource/modules/events.js
testing/mozmill/jsbridge/jsbridge/extension/resource/modules/init.js
testing/mozmill/jsbridge/jsbridge/extension/resource/modules/json2.js
testing/mozmill/jsbridge/jsbridge/extension/resource/modules/server.js
testing/mozmill/jsbridge/jsbridge/jsobjects.py
testing/mozmill/jsbridge/jsbridge/network.py
testing/mozmill/jsbridge/setup.py
testing/mozmill/mozmill/MANIFEST.in
testing/mozmill/mozmill/docs/Makefile
testing/mozmill/mozmill/docs/_build/doctrees/environment.pickle
testing/mozmill/mozmill/docs/_build/doctrees/index.doctree
testing/mozmill/mozmill/docs/_build/html/_sources/index.txt
testing/mozmill/mozmill/docs/_build/html/_static/contents.png
testing/mozmill/mozmill/docs/_build/html/_static/default.css
testing/mozmill/mozmill/docs/_build/html/_static/doctools.js
testing/mozmill/mozmill/docs/_build/html/_static/file.png
testing/mozmill/mozmill/docs/_build/html/_static/jquery.js
testing/mozmill/mozmill/docs/_build/html/_static/minus.png
testing/mozmill/mozmill/docs/_build/html/_static/navigation.png
testing/mozmill/mozmill/docs/_build/html/_static/plus.png
testing/mozmill/mozmill/docs/_build/html/_static/pygments.css
testing/mozmill/mozmill/docs/_build/html/_static/rightsidebar.css
testing/mozmill/mozmill/docs/_build/html/_static/searchtools.js
testing/mozmill/mozmill/docs/_build/html/_static/sphinxdoc.css
testing/mozmill/mozmill/docs/_build/html/_static/stickysidebar.css
testing/mozmill/mozmill/docs/_build/html/_static/traditional.css
testing/mozmill/mozmill/docs/_build/html/genindex.html
testing/mozmill/mozmill/docs/_build/html/index.html
testing/mozmill/mozmill/docs/_build/html/modindex.html
testing/mozmill/mozmill/docs/_build/html/objects.inv
testing/mozmill/mozmill/docs/_build/html/search.html
testing/mozmill/mozmill/docs/_build/html/searchindex.js
testing/mozmill/mozmill/docs/conf.py
testing/mozmill/mozmill/docs/index.rst
testing/mozmill/mozmill/mozmill/__init__.py
testing/mozmill/mozmill/mozmill/extension/build.xml
testing/mozmill/mozmill/mozmill/extension/chrome-jar.manifest
testing/mozmill/mozmill/mozmill/extension/chrome.manifest
testing/mozmill/mozmill/mozmill/extension/content/chrome.js
testing/mozmill/mozmill/mozmill/extension/content/css/fg.menu.css
testing/mozmill/mozmill/mozmill/extension/content/css/mozmill.css
testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png
testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png
testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png
testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png
testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png
testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png
testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png
testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png
testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-icons_222222_256x240.png
testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-icons_2e83ff_256x240.png
testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-icons_454545_256x240.png
testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-icons_888888_256x240.png
testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/images/ui-icons_cd0a0a_256x240.png
testing/mozmill/mozmill/mozmill/extension/content/css/smoothness/jquery-ui-1.7.1.custom.css
testing/mozmill/mozmill/mozmill/extension/content/dx.js
testing/mozmill/mozmill/mozmill/extension/content/dxwindow.xul
testing/mozmill/mozmill/mozmill/extension/content/editor/bespin/BespinEmbedded.css
testing/mozmill/mozmill/mozmill/extension/content/editor/bespin/BespinEmbedded.js
testing/mozmill/mozmill/mozmill/extension/content/editor/bespin/BespinMain.js
testing/mozmill/mozmill/mozmill/extension/content/editor/bespin/BespinWorker.js
testing/mozmill/mozmill/mozmill/extension/content/editor/bespin/resources/screen_theme/theme.less
testing/mozmill/mozmill/mozmill/extension/content/editor/editor.js
testing/mozmill/mozmill/mozmill/extension/content/img/wmIcon.png
testing/mozmill/mozmill/mozmill/extension/content/inspector.js
testing/mozmill/mozmill/mozmill/extension/content/jquery/fg.menu.css
testing/mozmill/mozmill/mozmill/extension/content/jquery/fg.menu.js
testing/mozmill/mozmill/mozmill/extension/content/jquery/jquery-1.3.2.min.js
testing/mozmill/mozmill/mozmill/extension/content/jquery/jquery-ui-1.7.1.custom.min.js
testing/mozmill/mozmill/mozmill/extension/content/jquery/jquery.ui.core.js
testing/mozmill/mozmill/mozmill/extension/content/jquery/jquery.ui.menu.js
testing/mozmill/mozmill/mozmill/extension/content/menus.js
testing/mozmill/mozmill/mozmill/extension/content/mozmill.html
testing/mozmill/mozmill/mozmill/extension/content/mozmill.js
testing/mozmill/mozmill/mozmill/extension/content/mozmill.xul
testing/mozmill/mozmill/mozmill/extension/content/output.js
testing/mozmill/mozmill/mozmill/extension/content/overlay.js
testing/mozmill/mozmill/mozmill/extension/content/overlay.xul
testing/mozmill/mozmill/mozmill/extension/content/overlay_tb.xul
testing/mozmill/mozmill/mozmill/extension/content/prefs.xul
testing/mozmill/mozmill/mozmill/extension/content/rec.js
testing/mozmill/mozmill/mozmill/extension/content/shell.js
testing/mozmill/mozmill/mozmill/extension/content/shortcuts.js
testing/mozmill/mozmill/mozmill/extension/content/testwindow.xul
testing/mozmill/mozmill/mozmill/extension/content/ui.js
testing/mozmill/mozmill/mozmill/extension/defaults/preferences/debug.js
testing/mozmill/mozmill/mozmill/extension/install.rdf
testing/mozmill/mozmill/mozmill/extension/locale/en-US/mozmill.dtd
testing/mozmill/mozmill/mozmill/extension/locale/en-US/overlay.dtd
testing/mozmill/mozmill/mozmill/extension/readme.txt
testing/mozmill/mozmill/mozmill/extension/resource/modules/controller.js
testing/mozmill/mozmill/mozmill/extension/resource/modules/elementslib.js
testing/mozmill/mozmill/mozmill/extension/resource/modules/events.js
testing/mozmill/mozmill/mozmill/extension/resource/modules/frame.js
testing/mozmill/mozmill/mozmill/extension/resource/modules/init.js
testing/mozmill/mozmill/mozmill/extension/resource/modules/inspection.js
testing/mozmill/mozmill/mozmill/extension/resource/modules/jum.js
testing/mozmill/mozmill/mozmill/extension/resource/modules/mozmill.js
testing/mozmill/mozmill/mozmill/extension/resource/modules/utils.js
testing/mozmill/mozmill/mozmill/extension/resource/stdlib/EventUtils.js
testing/mozmill/mozmill/mozmill/extension/resource/stdlib/arrays.js
testing/mozmill/mozmill/mozmill/extension/resource/stdlib/dom.js
testing/mozmill/mozmill/mozmill/extension/resource/stdlib/httpd.js
testing/mozmill/mozmill/mozmill/extension/resource/stdlib/json2.js
testing/mozmill/mozmill/mozmill/extension/resource/stdlib/objects.js
testing/mozmill/mozmill/mozmill/extension/resource/stdlib/os.js
testing/mozmill/mozmill/mozmill/extension/resource/stdlib/securable-module.js
testing/mozmill/mozmill/mozmill/extension/resource/stdlib/strings.js
testing/mozmill/mozmill/mozmill/extension/resource/stdlib/withs.js
testing/mozmill/mozmill/mozmill/extension/skin/chrome.css
testing/mozmill/mozmill/mozmill/extension/skin/overlay.css
testing/mozmill/mozmill/mozmill/extension/zipexclude.lst
testing/mozmill/mozmill/patches/eventUtils.patch
testing/mozmill/mozmill/patches/httpd.patch
testing/mozmill/mozmill/scripts/songmill.py
testing/mozmill/mozmill/scripts/sync_dependencies.py
testing/mozmill/mozmill/setup.py
testing/mozmill/mozmill/test/commonjs/modules1/moda.js
testing/mozmill/mozmill/test/commonjs/modules1/modb.js
testing/mozmill/mozmill/test/commonjs/modules2/modc.js
testing/mozmill/mozmill/test/commonjs/tests/test_require.js
testing/mozmill/mozmill/test/elementLib-UnitTest.js
testing/mozmill/mozmill/test/first_sunbird_test.js
testing/mozmill/mozmill/test/first_thunderbird_test.js
testing/mozmill/mozmill/test/restart/test_browser/testPost.js
testing/mozmill/mozmill/test/restart/test_browser/testPre.js
testing/mozmill/mozmill/test/restart/test_fails/testPost.js
testing/mozmill/mozmill/test/restart/test_fails/testPre.js
testing/mozmill/mozmill/test/restart/test_multi_restart/test1.js
testing/mozmill/mozmill/test/restart/test_multi_restart/test2.js
testing/mozmill/mozmill/test/restart/test_multi_restart/test3.js
testing/mozmill/mozmill/test/restart/test_multi_restart/test4.js
testing/mozmill/mozmill/test/restart/test_multi_restart/test5.js
testing/mozmill/mozmill/test/restart/test_nothing/testPost.js
testing/mozmill/mozmill/test/restart/test_nothing/testPre.js
testing/mozmill/mozmill/test/restart/test_python_callback/callbacks.py
testing/mozmill/mozmill/test/restart/test_python_callback/testPost.js
testing/mozmill/mozmill/test/restart/test_python_callback/testPre.js
testing/mozmill/mozmill/test/restart/test_user_restart/test1.js
testing/mozmill/mozmill/test/restart/test_user_restart/test2.js
testing/mozmill/mozmill/test/restart/test_user_restart/test3.js
testing/mozmill/mozmill/test/restart/test_user_restart/test4.js
testing/mozmill/mozmill/test/restart/test_user_restart/test5.js
testing/mozmill/mozmill/test/test_assert.js
testing/mozmill/mozmill/test/test_demo.js
testing/mozmill/mozmill/test/test_diggIterator.js
testing/mozmill/mozmill/test/test_focus.js
testing/mozmill/mozmill/test/test_git.js
testing/mozmill/mozmill/test/test_googleIterator.js
testing/mozmill/mozmill/test/test_menu.js
testing/mozmill/mozmill/test/test_prefs.js
testing/mozmill/mozmill/test/test_property.js
testing/mozmill/mozmill/test/test_python_callbacks.js
testing/mozmill/mozmill/test/test_python_callbacks_callbacks.py
testing/mozmill/mozmill/test/test_something/test_parents.js
testing/mozmill/mozmill/test/test_something/test_sub/test_deps.js
testing/mozmill/mozmill/test/test_synthesizeEvents.js
testing/mozmill/mozmill/test/test_unit.js
testing/mozmill/mozmill/test/test_usershutdown.js
testing/mozmill/mozmill/test/test_waitForPageLoad.js
testing/mozmill/mozrunner/mozrunner/__init__.py
testing/mozmill/mozrunner/mozrunner/killableprocess.py
testing/mozmill/mozrunner/mozrunner/qijo.py
testing/mozmill/mozrunner/mozrunner/winprocess.py
testing/mozmill/mozrunner/mozrunner/wpk.py
testing/mozmill/mozrunner/setup.py
testing/mozmill/mozrunner/tests/debub_settings.py
testing/mozmill/mozrunner/tests/jss_settings.py
testing/mozmill/simplejson-2.1.1/CHANGES.txt
testing/mozmill/simplejson-2.1.1/LICENSE.txt
testing/mozmill/simplejson-2.1.1/PKG-INFO
testing/mozmill/simplejson-2.1.1/conf.py
testing/mozmill/simplejson-2.1.1/docs/_sources/index.txt
testing/mozmill/simplejson-2.1.1/docs/_static/contents.png
testing/mozmill/simplejson-2.1.1/docs/_static/default.css
testing/mozmill/simplejson-2.1.1/docs/_static/doctools.js
testing/mozmill/simplejson-2.1.1/docs/_static/file.png
testing/mozmill/simplejson-2.1.1/docs/_static/interface.js
testing/mozmill/simplejson-2.1.1/docs/_static/jquery.js
testing/mozmill/simplejson-2.1.1/docs/_static/minus.png
testing/mozmill/simplejson-2.1.1/docs/_static/navigation.png
testing/mozmill/simplejson-2.1.1/docs/_static/plus.png
testing/mozmill/simplejson-2.1.1/docs/_static/pygments.css
testing/mozmill/simplejson-2.1.1/docs/_static/rightsidebar.css
testing/mozmill/simplejson-2.1.1/docs/_static/searchtools.js
testing/mozmill/simplejson-2.1.1/docs/_static/sphinxdoc.css
testing/mozmill/simplejson-2.1.1/docs/_static/stickysidebar.css
testing/mozmill/simplejson-2.1.1/docs/_static/traditional.css
testing/mozmill/simplejson-2.1.1/docs/genindex.html
testing/mozmill/simplejson-2.1.1/docs/index.html
testing/mozmill/simplejson-2.1.1/docs/objects.inv
testing/mozmill/simplejson-2.1.1/docs/search.html
testing/mozmill/simplejson-2.1.1/docs/searchindex.js
testing/mozmill/simplejson-2.1.1/docs/searchindex.json
testing/mozmill/simplejson-2.1.1/ez_setup.py
testing/mozmill/simplejson-2.1.1/index.rst
testing/mozmill/simplejson-2.1.1/scripts/make_docs.py
testing/mozmill/simplejson-2.1.1/setup.cfg
testing/mozmill/simplejson-2.1.1/setup.py
testing/mozmill/simplejson-2.1.1/simplejson/__init__.py
testing/mozmill/simplejson-2.1.1/simplejson/_speedups.c
testing/mozmill/simplejson-2.1.1/simplejson/decoder.py
testing/mozmill/simplejson-2.1.1/simplejson/encoder.py
testing/mozmill/simplejson-2.1.1/simplejson/ordered_dict.py
testing/mozmill/simplejson-2.1.1/simplejson/scanner.py
testing/mozmill/simplejson-2.1.1/simplejson/tests/__init__.py
testing/mozmill/simplejson-2.1.1/simplejson/tests/test_check_circular.py
testing/mozmill/simplejson-2.1.1/simplejson/tests/test_decimal.py
testing/mozmill/simplejson-2.1.1/simplejson/tests/test_decode.py
testing/mozmill/simplejson-2.1.1/simplejson/tests/test_default.py
testing/mozmill/simplejson-2.1.1/simplejson/tests/test_dump.py
testing/mozmill/simplejson-2.1.1/simplejson/tests/test_encode_basestring_ascii.py
testing/mozmill/simplejson-2.1.1/simplejson/tests/test_encode_for_html.py
testing/mozmill/simplejson-2.1.1/simplejson/tests/test_fail.py
testing/mozmill/simplejson-2.1.1/simplejson/tests/test_float.py
testing/mozmill/simplejson-2.1.1/simplejson/tests/test_indent.py
testing/mozmill/simplejson-2.1.1/simplejson/tests/test_pass1.py
testing/mozmill/simplejson-2.1.1/simplejson/tests/test_pass2.py
testing/mozmill/simplejson-2.1.1/simplejson/tests/test_pass3.py
testing/mozmill/simplejson-2.1.1/simplejson/tests/test_recursion.py
testing/mozmill/simplejson-2.1.1/simplejson/tests/test_scanstring.py
testing/mozmill/simplejson-2.1.1/simplejson/tests/test_separators.py
testing/mozmill/simplejson-2.1.1/simplejson/tests/test_speedups.py
testing/mozmill/simplejson-2.1.1/simplejson/tests/test_unicode.py
testing/mozmill/simplejson-2.1.1/simplejson/tool.py
testing/mozmill/tests/firefox/restartTests/readme.txt
testing/mozmill/tests/firefox/restartTests/testDummyTest/test1.js
testing/mozmill/tests/firefox/test-files/awesomebar/copypaste.html
testing/mozmill/tests/firefox/test-files/cookies/cookie_single.html
testing/mozmill/tests/firefox/test-files/downloading/unknown_type.fmtd
testing/mozmill/tests/firefox/test-files/downloading/unknown_type.mtdl
testing/mozmill/tests/firefox/test-files/downloading/unknown_type_pb.stbf
testing/mozmill/tests/firefox/test-files/form_manager/form.html
testing/mozmill/tests/firefox/test-files/geolocation/position.html
testing/mozmill/tests/firefox/test-files/images/firefox_favicon.ico
testing/mozmill/tests/firefox/test-files/images/mozilla_favicon.ico
testing/mozmill/tests/firefox/test-files/images/mozilla_logo.jpg
testing/mozmill/tests/firefox/test-files/images/seamonkey_favicon.ico
testing/mozmill/tests/firefox/test-files/images/thunderbird_favicon.ico
testing/mozmill/tests/firefox/test-files/layout/mozilla.html
testing/mozmill/tests/firefox/test-files/layout/mozilla_community.html
testing/mozmill/tests/firefox/test-files/layout/mozilla_contribute.html
testing/mozmill/tests/firefox/test-files/layout/mozilla_governance.html
testing/mozmill/tests/firefox/test-files/layout/mozilla_grants.html
testing/mozmill/tests/firefox/test-files/layout/mozilla_mission.html
testing/mozmill/tests/firefox/test-files/layout/mozilla_organizations.html
testing/mozmill/tests/firefox/test-files/layout/mozilla_projects.html
testing/mozmill/tests/firefox/test-files/password_manager/login_form.html
testing/mozmill/tests/firefox/test-files/plugins/default_plugin.html
testing/mozmill/tests/firefox/test-files/popups/popup.html
testing/mozmill/tests/firefox/test-files/popups/popups_2.html
testing/mozmill/tests/firefox/test-files/search/mozsearch.html
testing/mozmill/tests/firefox/test-files/search/mozsearch.xml
testing/mozmill/tests/firefox/test-files/search/opensearch.html
testing/mozmill/tests/firefox/test-files/search/opensearch.xml
testing/mozmill/tests/firefox/test-files/search/searchresults.html
testing/mozmill/tests/firefox/test-files/tabbedbrowsing/openinnewtab.html
testing/mozmill/tests/firefox/test-files/tabbedbrowsing/openinnewtab_target.html
testing/mozmill/tests/firefox/testAwesomeBar/testFaviconInAutocomplete.js
testing/mozmill/tests/firefox/testAwesomeBar/testGoButton.js
testing/mozmill/tests/firefox/testPreferences/testSetToCurrentPage.js
testing/mozmill/tests/firefox/testPrivateBrowsing/testCloseWindow.js
testing/mozmill/tests/firefox/testSessionStore/testUndoTabFromContextMenu.js
testing/mozmill/tests/firefox/testTechnicalTools/testAccessPageInfoDialog.js
testing/mozmill/tests/firefox/testToolbar/testBackForwardButtons.js
testing/mozmill/tests/shared-modules/readme.txt
testing/mozmill/tests/shared-modules/testAddonsAPI.js
testing/mozmill/tests/shared-modules/testDOMUtilsAPI.js
testing/mozmill/tests/shared-modules/testDownloadsAPI.js
testing/mozmill/tests/shared-modules/testModalDialogAPI.js
testing/mozmill/tests/shared-modules/testPlacesAPI.js
testing/mozmill/tests/shared-modules/testPrefsAPI.js
testing/mozmill/tests/shared-modules/testPrivateBrowsingAPI.js
testing/mozmill/tests/shared-modules/testSearchAPI.js
testing/mozmill/tests/shared-modules/testSessionStoreAPI.js
testing/mozmill/tests/shared-modules/testSoftwareUpdateAPI.js
testing/mozmill/tests/shared-modules/testTabbedBrowsingAPI.js
testing/mozmill/tests/shared-modules/testToolbarAPI.js
testing/mozmill/tests/shared-modules/testUtilsAPI.js
testing/mozmill/tests/shared-modules/testWidgetsAPI.js
testing/mozmill/virtualenv/MANIFEST.in
testing/mozmill/virtualenv/PKG-INFO
testing/mozmill/virtualenv/docs/_build/_sources/index.txt
testing/mozmill/virtualenv/docs/_build/_sources/license.txt
testing/mozmill/virtualenv/docs/_build/_sources/news.txt
testing/mozmill/virtualenv/docs/index.txt
testing/mozmill/virtualenv/docs/license.txt
testing/mozmill/virtualenv/docs/news.txt
testing/mozmill/virtualenv/scripts/virtualenv
testing/mozmill/virtualenv/setup.cfg
testing/mozmill/virtualenv/setup.py
testing/mozmill/virtualenv/virtualenv.py
testing/mozmill/virtualenv/virtualenv_support/__init__.py
testing/mozmill/virtualenv/virtualenv_support/distribute-0.6.8.tar.gz
testing/mozmill/virtualenv/virtualenv_support/pip-0.7.1.tar.gz
testing/mozmill/virtualenv/virtualenv_support/setuptools-0.6c11-py2.4.egg
testing/mozmill/virtualenv/virtualenv_support/setuptools-0.6c11-py2.5.egg
testing/mozmill/virtualenv/virtualenv_support/setuptools-0.6c11-py2.6.egg
widget/src/xpwidgets/nsWidgetAtomList.h
widget/src/xpwidgets/nsWidgetAtoms.cpp
widget/src/xpwidgets/nsWidgetAtoms.h
--- a/accessible/src/atk/nsAccessibleWrap.cpp
+++ b/accessible/src/atk/nsAccessibleWrap.cpp
@@ -33,16 +33,18 @@
  * 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 "nsAccessible.h"
 #include "nsAccessibleWrap.h"
 
 #include "nsAccUtils.h"
 #include "nsApplicationAccessibleWrap.h"
 #include "nsIAccessibleRelation.h"
 #include "nsRootAccessible.h"
 #include "nsDocAccessibleWrap.h"
@@ -64,16 +66,17 @@
 #include "nsMaiInterfaceHypertext.h"
 #include "nsMaiInterfaceHyperlinkImpl.h"
 #include "nsMaiInterfaceTable.h"
 #include "nsXPCOMStrings.h"
 #include "nsComponentManagerUtils.h"
 #include "nsMaiInterfaceDocument.h"
 #include "nsMaiInterfaceImage.h"
 
+using namespace mozilla;
 using namespace mozilla::a11y;
 
 nsAccessibleWrap::EAvailableAtkSignals nsAccessibleWrap::gAvailableAtkSignals =
   eUnknown;
 
 //defined in nsApplicationAccessibleWrap.cpp
 extern "C" GType g_atk_hyperlink_impl_type;
 
@@ -517,17 +520,17 @@ GetMaiAtkType(PRUint16 interfacesBits)
     static PRUint16 typeRegCount = 0;
     if (typeRegCount++ >= 4095) {
         return G_TYPE_INVALID;
     }
     type = g_type_register_static(MAI_TYPE_ATK_OBJECT,
                                   atkTypeName,
                                   &tinfo, GTypeFlags(0));
 
-    for (PRUint32 index = 0; index < NS_ARRAY_LENGTH(atk_if_infos); index++) {
+    for (PRUint32 index = 0; index < ArrayLength(atk_if_infos); index++) {
       if (interfacesBits & (1 << index)) {
         g_type_add_interface_static(type,
                                     GetAtkTypeForMai((MaiInterfaceType)index),
                                     &atk_if_infos[index]);
       }
     }
 
     return type;
@@ -958,17 +961,17 @@ refRelationSetCB(AtkObject *aAtkObj)
     nsIAccessibleRelation::RELATION_CONTROLLER_FOR,
     nsIAccessibleRelation::RELATION_EMBEDS,
     nsIAccessibleRelation::RELATION_FLOWS_TO,
     nsIAccessibleRelation::RELATION_FLOWS_FROM,
     nsIAccessibleRelation::RELATION_DESCRIBED_BY,
     nsIAccessibleRelation::RELATION_DESCRIPTION_FOR,
   };
 
-  for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(relationTypes); i++) {
+  for (PRUint32 i = 0; i < ArrayLength(relationTypes); i++) {
     AtkRelationType atkType = static_cast<AtkRelationType>(relationTypes[i]);
     AtkRelation* atkRelation =
       atk_relation_set_get_relation_by_type(relation_set, atkType);
     if (atkRelation)
       atk_relation_set_remove(relation_set, atkRelation);
 
     Relation rel(accWrap->RelationByType(relationTypes[i]));
     nsTArray<AtkObject*> targets;
--- a/accessible/src/base/NotificationController.cpp
+++ b/accessible/src/base/NotificationController.cpp
@@ -205,18 +205,20 @@ NotificationController::WillRefresh(mozi
   // Any generic notifications should be queued if we're processing content
   // insertions or generic notifications.
   mObservingState = eRefreshProcessingForUpdate;
 
   // Initial accessible tree construction.
   if (!mDocument->HasLoadState(nsDocAccessible::eTreeConstructed)) {
     // If document is not bound to parent at this point then the document is not
     // ready yet (process notifications later).
-    if (!mDocument->IsBoundToParent())
+    if (!mDocument->IsBoundToParent()) {
+      mObservingState = eRefreshObserving;
       return;
+    }
 
 #ifdef DEBUG_NOTIFICATIONS
     printf("\ninitial tree created, document: %p, document node: %p\n",
            mDocument.get(), mDocument->GetDocumentNode());
 #endif
 
     mDocument->DoInitialUpdate();
 
--- a/accessible/src/base/nsAccessibilityService.cpp
+++ b/accessible/src/base/nsAccessibilityService.cpp
@@ -31,16 +31,18 @@
  * 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"
+
 // NOTE: alphabetically ordered
 #include "nsAccessibilityService.h"
 #include "nsCoreUtils.h"
 #include "nsAccUtils.h"
 #include "nsApplicationAccessibleWrap.h"
 #include "nsARIAGridAccessibleWrap.h"
 #include "nsARIAMap.h"
 #include "FocusManager.h"
@@ -106,16 +108,17 @@
 #ifndef DISABLE_XFORMS_HOOKS
 #include "nsXFormsFormControlsAccessible.h"
 #include "nsXFormsWidgetsAccessible.h"
 #endif
 
 #include "mozilla/FunctionTimer.h"
 #include "mozilla/dom/Element.h"
 
+using namespace mozilla;
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccessibilityService
 ////////////////////////////////////////////////////////////////////////////////
 
 nsAccessibilityService *nsAccessibilityService::gAccessibilityService = nsnull;
 bool nsAccessibilityService::gIsShutdown = true;
@@ -649,17 +652,17 @@ nsAccessibilityService::GetAccessibleFor
 
   NS_IF_ADDREF(*aAccessible = GetAccessible(node));
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsAccessibilityService::GetStringRole(PRUint32 aRole, nsAString& aString)
 {
-  if ( aRole >= NS_ARRAY_LENGTH(kRoleNames)) {
+  if ( aRole >= ArrayLength(kRoleNames)) {
     aString.AssignLiteral("unknown");
     return NS_OK;
   }
 
   CopyUTF8toUTF16(kRoleNames[aRole], aString);
   return NS_OK;
 }
 
@@ -780,34 +783,34 @@ nsAccessibilityService::GetStringStates(
   return NS_OK;
 }
 
 // nsIAccessibleRetrieval::getStringEventType()
 NS_IMETHODIMP
 nsAccessibilityService::GetStringEventType(PRUint32 aEventType,
                                            nsAString& aString)
 {
-  NS_ASSERTION(nsIAccessibleEvent::EVENT_LAST_ENTRY == NS_ARRAY_LENGTH(kEventTypeNames),
+  NS_ASSERTION(nsIAccessibleEvent::EVENT_LAST_ENTRY == ArrayLength(kEventTypeNames),
                "nsIAccessibleEvent constants are out of sync to kEventTypeNames");
 
-  if (aEventType >= NS_ARRAY_LENGTH(kEventTypeNames)) {
+  if (aEventType >= ArrayLength(kEventTypeNames)) {
     aString.AssignLiteral("unknown");
     return NS_OK;
   }
 
   CopyUTF8toUTF16(kEventTypeNames[aEventType], aString);
   return NS_OK;
 }
 
 // nsIAccessibleRetrieval::getStringRelationType()
 NS_IMETHODIMP
 nsAccessibilityService::GetStringRelationType(PRUint32 aRelationType,
                                               nsAString& aString)
 {
-  if (aRelationType >= NS_ARRAY_LENGTH(kRelationTypeNames)) {
+  if (aRelationType >= ArrayLength(kRelationTypeNames)) {
     aString.AssignLiteral("unknown");
     return NS_OK;
   }
 
   CopyUTF8toUTF16(kRelationTypeNames[aRelationType], aString);
   return NS_OK;
 }
 
--- a/accessible/src/base/nsCaretAccessible.cpp
+++ b/accessible/src/base/nsCaretAccessible.cpp
@@ -221,16 +221,20 @@ nsCaretAccessible::NotifySelectionChange
 
     bool isNormalSelection =
       (type == nsISelectionController::SELECTION_NORMAL);
 
     bool isIgnored = !document || !document->IsContentLoaded();
     printf("\nSelection changed, selection type: %s, notification %s\n",
            (isNormalSelection ? "normal" : "spellcheck"),
            (isIgnored ? "ignored" : "pending"));
+  } else {
+    bool isIgnored = !document || !document->IsContentLoaded();
+    printf("\nSelection changed, selection type: unknown, notification %s\n",
+               (isIgnored ? "ignored" : "pending"));
   }
 #endif
 
   // Don't fire events until document is loaded.
   if (document && document->IsContentLoaded()) {
     // The caret accessible has the same lifetime as the root accessible, and
     // this outlives all its descendant document accessibles, so that we are
     // guaranteed that the notification is processed before the caret accessible
--- a/accessible/src/base/nsDocAccessible.cpp
+++ b/accessible/src/base/nsDocAccessible.cpp
@@ -72,17 +72,17 @@
 #include "nsIURI.h"
 #include "nsIWebNavigation.h"
 #include "nsFocusManager.h"
 #include "mozilla/dom/Element.h"
 #ifdef MOZ_XUL
 #include "nsIXULDocument.h"
 #endif
 
-namespace dom = mozilla::dom;
+using namespace mozilla;
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // Static member initialization
 
 static nsIAtom** kRelationAttrs[] =
 {
   &nsGkAtoms::aria_labelledby,
--- a/accessible/src/base/nsRootAccessible.cpp
+++ b/accessible/src/base/nsRootAccessible.cpp
@@ -30,16 +30,18 @@
  * 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"
+
 #define CreateEvent CreateEventA
 #include "nsIDOMDocument.h"
 
 #include "nsAccessibilityService.h"
 #include "nsApplicationAccessibleWrap.h"
 #include "nsAccUtils.h"
 #include "nsCoreUtils.h"
 #include "Relation.h"
@@ -78,17 +80,17 @@
 #include "nsFocusManager.h"
 
 #ifdef MOZ_XUL
 #include "nsXULTreeAccessible.h"
 #include "nsIXULDocument.h"
 #include "nsIXULWindow.h"
 #endif
 
-namespace dom = mozilla::dom;
+using namespace mozilla;
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsISupports
 
 // Expanded version of NS_IMPL_ISUPPORTS_INHERITED2 
 // so we can QI directly to concrete nsRootAccessible
 NS_IMPL_QUERY_HEAD(nsRootAccessible)
@@ -250,17 +252,17 @@ nsresult nsRootAccessible::AddEventListe
   // nsIDOMEventTarget interface allows to register event listeners to
   // receive untrusted events (synthetic events generated by untrusted code).
   // For example, XBL bindings implementations for elements that are hosted in
   // non chrome document fire untrusted events.
   nsCOMPtr<nsIDOMEventTarget> nstarget(do_QueryInterface(mDocument));
 
   if (nstarget) {
     for (const char* const* e = docEvents,
-                   * const* e_end = docEvents + NS_ARRAY_LENGTH(docEvents);
+                   * const* e_end = ArrayEnd(docEvents);
          e < e_end; ++e) {
       nsresult rv = nstarget->AddEventListener(NS_ConvertASCIItoUTF16(*e),
                                                this, PR_TRUE, PR_TRUE, 2);
       NS_ENSURE_SUCCESS(rv, rv);
     }
   }
 
   if (!mCaretAccessible) {
@@ -270,17 +272,17 @@ nsresult nsRootAccessible::AddEventListe
   return nsDocAccessible::AddEventListeners();
 }
 
 nsresult nsRootAccessible::RemoveEventListeners()
 {
   nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(mDocument));
   if (target) { 
     for (const char* const* e = docEvents,
-                   * const* e_end = docEvents + NS_ARRAY_LENGTH(docEvents);
+                   * const* e_end = ArrayEnd(docEvents);
          e < e_end; ++e) {
       nsresult rv = target->RemoveEventListener(NS_ConvertASCIItoUTF16(*e), this, PR_TRUE);
       NS_ENSURE_SUCCESS(rv, rv);
     }
   }
 
   // Do this before removing clearing caret accessible, so that it can use
   // shutdown the caret accessible's selection listener
--- a/accessible/src/html/nsHyperTextAccessible.cpp
+++ b/accessible/src/html/nsHyperTextAccessible.cpp
@@ -41,16 +41,17 @@
 
 #include "States.h"
 #include "nsAccessibilityService.h"
 #include "nsAccUtils.h"
 #include "nsTextAttrs.h"
 
 #include "nsIClipboard.h"
 #include "nsContentCID.h"
+#include "nsFocusManager.h"
 #include "nsIDOMCharacterData.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMRange.h"
 #include "nsIDOMNSRange.h"
 #include "nsIDOMXULDocument.h"
 #include "nsIEditingSession.h"
 #include "nsIEditor.h"
 #include "nsIFrame.h"
@@ -903,27 +904,19 @@ nsresult nsHyperTextAccessible::GetTextH
   if (aOffset == nsIAccessibleText::TEXT_OFFSET_CARET) {
     GetCaretOffset(&aOffset);
     if (aOffset > 0 && (aBoundaryType == BOUNDARY_LINE_START ||
                         aBoundaryType == BOUNDARY_LINE_END)) {
       // It is the same character offset when the caret is visually at the very end of a line
       // or the start of a new line. Getting text at the line should provide the line with the visual caret,
       // otherwise screen readers will announce the wrong line as the user presses up or down arrow and land
       // at the end of a line.
-      nsCOMPtr<nsISelection> domSel;
-      nsresult rv = GetSelections(nsISelectionController::SELECTION_NORMAL,
-                                  nsnull, getter_AddRefs(domSel));
-      NS_ENSURE_SUCCESS(rv, rv);
-
-      nsCOMPtr<nsISelectionPrivate> privateSelection(do_QueryInterface(domSel));
-      nsRefPtr<nsFrameSelection> frameSelection;
-      rv = privateSelection->GetFrameSelection(getter_AddRefs(frameSelection));
-      NS_ENSURE_SUCCESS(rv, rv);
-
-      if (frameSelection->GetHint() == nsFrameSelection::HINTLEFT) {
+      nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
+      if (frameSelection &&
+          frameSelection->GetHint() == nsFrameSelection::HINTLEFT) {
         -- aOffset;  // We are at the start of a line
       }
     }
   }
   else if (aOffset < 0) {
     return NS_ERROR_FAILURE;
   }
 
@@ -1582,36 +1575,43 @@ nsHyperTextAccessible::SetSelectionRange
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Set the selection
   SetSelectionBounds(0, aStartPos, aEndPos);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // If range 0 was successfully set, clear any additional selection 
   // ranges remaining from previous selection
-  nsCOMPtr<nsISelection> domSel;
-  nsCOMPtr<nsISelectionController> selCon;
-  GetSelections(nsISelectionController::SELECTION_NORMAL,
-                getter_AddRefs(selCon), getter_AddRefs(domSel));
-  if (domSel) {
-    PRInt32 numRanges;
-    domSel->GetRangeCount(&numRanges);
+  nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
+  NS_ENSURE_STATE(frameSelection);
+
+  nsCOMPtr<nsISelection> domSel =
+    frameSelection->GetSelection(nsISelectionController::SELECTION_NORMAL);
+  NS_ENSURE_STATE(domSel);
+
+  PRInt32 numRanges = 0;
+  domSel->GetRangeCount(&numRanges);
 
-    for (PRInt32 count = 0; count < numRanges - 1; count ++) {
-      nsCOMPtr<nsIDOMRange> range;
-      domSel->GetRangeAt(1, getter_AddRefs(range));
-      domSel->RemoveRange(range);
-    }
+  for (PRInt32 count = 0; count < numRanges - 1; count ++) {
+    nsCOMPtr<nsIDOMRange> range;
+    domSel->GetRangeAt(1, getter_AddRefs(range));
+    domSel->RemoveRange(range);
   }
-  
-  if (selCon) {
-    // XXX I'm not sure this can do synchronous scrolling. If the last param is
-    // set to true, this calling might flush the pending reflow. See bug 418470.
-    selCon->ScrollSelectionIntoView(nsISelectionController::SELECTION_NORMAL,
-      nsISelectionController::SELECTION_FOCUS_REGION, 0);
+
+  // Now that selection is done, move the focus to the selection.
+  nsFocusManager* DOMFocusManager = nsFocusManager::GetFocusManager();
+  if (DOMFocusManager) {
+    nsCOMPtr<nsIPresShell> shell = GetPresShell();
+    NS_ENSURE_TRUE(shell, NS_ERROR_FAILURE);
+    nsCOMPtr<nsIDocument> doc = shell->GetDocument();
+    NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
+    nsCOMPtr<nsPIDOMWindow> window = doc->GetWindow();
+    nsCOMPtr<nsIDOMElement> result;
+    DOMFocusManager->MoveFocus(window, nsnull, nsIFocusManager::MOVEFOCUS_CARET,
+                               nsIFocusManager::FLAG_BYMOVEFOCUS, getter_AddRefs(result));
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsHyperTextAccessible::SetCaretOffset(PRInt32 aCaretOffset)
 {
@@ -1630,23 +1630,25 @@ nsHyperTextAccessible::GetCaretOffset(PR
   // is not inside of focused node.
   FocusManager::FocusDisposition focusDisp =
     FocusMgr()->IsInOrContainsFocus(this);
   if (focusDisp == FocusManager::eNone)
     return NS_OK;
 
   // Turn the focus node and offset of the selection into caret hypretext
   // offset.
-  nsCOMPtr<nsISelection> domSel;
-  nsresult rv = GetSelections(nsISelectionController::SELECTION_NORMAL,
-                              nsnull, getter_AddRefs(domSel));
-  NS_ENSURE_SUCCESS(rv, rv);
+  nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
+  NS_ENSURE_STATE(frameSelection);
+
+  nsISelection* domSel =
+    frameSelection->GetSelection(nsISelectionController::SELECTION_NORMAL);
+  NS_ENSURE_STATE(domSel);
 
   nsCOMPtr<nsIDOMNode> focusDOMNode;
-  rv = domSel->GetFocusNode(getter_AddRefs(focusDOMNode));
+  nsresult rv = domSel->GetFocusNode(getter_AddRefs(focusDOMNode));
   NS_ENSURE_SUCCESS(rv, rv);
 
   PRInt32 focusOffset;
   rv = domSel->GetFocusOffset(&focusOffset);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // No caret if this DOM node is inside of focused node but the selection's
   // focus point is not inside of this DOM node.
@@ -1660,28 +1662,29 @@ nsHyperTextAccessible::GetCaretOffset(PR
         !nsCoreUtils::IsAncestorOf(thisNode, resultNode))
       return NS_OK;
   }
 
   DOMPointToHypertextOffset(focusNode, focusOffset, aCaretOffset);
   return NS_OK;
 }
 
-PRInt32 nsHyperTextAccessible::GetCaretLineNumber()
+PRInt32
+nsHyperTextAccessible::GetCaretLineNumber()
 {
   // Provide the line number for the caret, relative to the
   // currently focused node. Use a 1-based index
-  nsCOMPtr<nsISelection> domSel;
-  GetSelections(nsISelectionController::SELECTION_NORMAL, nsnull,
-                getter_AddRefs(domSel));
-  nsCOMPtr<nsISelectionPrivate> privateSelection(do_QueryInterface(domSel));
-  NS_ENSURE_TRUE(privateSelection, -1);
-  nsRefPtr<nsFrameSelection> frameSelection;
-  privateSelection->GetFrameSelection(getter_AddRefs(frameSelection));
-  NS_ENSURE_TRUE(frameSelection, -1);
+  nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
+  if (!frameSelection)
+    return -1;
+
+  nsISelection* domSel =
+    frameSelection->GetSelection(nsISelectionController::SELECTION_NORMAL);
+  if (!domSel)
+    return - 1;
 
   nsCOMPtr<nsIDOMNode> caretNode;
   domSel->GetFocusNode(getter_AddRefs(caretNode));
   nsCOMPtr<nsIContent> caretContent = do_QueryInterface(caretNode);
   if (!caretContent || !nsCoreUtils::IsAncestorOf(GetNode(), caretContent))
     return -1;
 
   PRInt32 caretOffset, returnOffsetUnused;
@@ -1726,154 +1729,123 @@ PRInt32 nsHyperTextAccessible::GetCaretL
 
     caretFrame = parentFrame;
   }
 
   NS_NOTREACHED("DOM ancestry had this hypertext but frame ancestry didn't");
   return lineNumber;
 }
 
-nsresult
-nsHyperTextAccessible::GetSelections(PRInt16 aType,
-                                     nsISelectionController **aSelCon,
-                                     nsISelection **aDomSel,
-                                     nsCOMArray<nsIDOMRange>* aRanges)
+already_AddRefed<nsFrameSelection>
+nsHyperTextAccessible::FrameSelection()
 {
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
+  nsIFrame* frame = GetFrame();
+  return frame->GetFrameSelection();
+}
 
-  if (aSelCon) {
-    *aSelCon = nsnull;
-  }
-  if (aDomSel) {
-    *aDomSel = nsnull;
-  }
-  if (aRanges) {
-    aRanges->Clear();
-  }
-  
-  nsCOMPtr<nsISelection> domSel;
-  nsCOMPtr<nsISelectionController> selCon;
+void
+nsHyperTextAccessible::GetSelectionDOMRanges(PRInt16 aType,
+                                             nsCOMArray<nsIDOMRange>* aRanges)
+{
+  nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
+  if (!frameSelection)
+    return;
+
+  nsISelection* domSel = frameSelection->GetSelection(aType);
+  if (!domSel)
+    return;
+
+  nsCOMPtr<nsINode> startNode = GetNode();
 
   nsCOMPtr<nsIEditor> editor;
   GetAssociatedEditor(getter_AddRefs(editor));
-  nsCOMPtr<nsIPlaintextEditor> peditor(do_QueryInterface(editor));
-  if (peditor) {
-    // Case 1: plain text editor
-    // This is for form controls which have their own
-    // selection controller separate from the document, for example
-    // HTML:input, HTML:textarea, XUL:textbox, etc.
-    editor->GetSelectionController(getter_AddRefs(selCon));
-  }
-  else {
-    // Case 2: rich content subtree (can be rich editor)
-    // This uses the selection controller from the entire document
-    nsIFrame *frame = GetFrame();
-    NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE);
-
-    // Get the selection and selection controller
-    frame->GetSelectionController(GetPresContext(),
-                                  getter_AddRefs(selCon));
-  }
-  NS_ENSURE_TRUE(selCon, NS_ERROR_FAILURE);
-
-  selCon->GetSelection(aType, getter_AddRefs(domSel));
-  NS_ENSURE_TRUE(domSel, NS_ERROR_FAILURE);
-
-  if (aSelCon) {
-    NS_ADDREF(*aSelCon = selCon);
-  }
-  if (aDomSel) {
-    NS_ADDREF(*aDomSel = domSel);
+  if (editor) {
+    nsCOMPtr<nsIDOMElement> editorRoot;
+    editor->GetRootElement(getter_AddRefs(editorRoot));
+    startNode = do_QueryInterface(editorRoot);
   }
 
-  if (aRanges) {
-    nsCOMPtr<nsISelectionPrivate> privSel(do_QueryInterface(domSel));
-
-    nsCOMPtr<nsINode> startNode = GetNode();
-    if (peditor) {
-      nsCOMPtr<nsIDOMElement> editorRoot;
-      editor->GetRootElement(getter_AddRefs(editorRoot));
-      startNode = do_QueryInterface(editorRoot);
-    }
-    NS_ENSURE_STATE(startNode);
+  if (!startNode)
+    return;
 
-    PRUint32 childCount = startNode->GetChildCount();
-    nsCOMPtr<nsIDOMNode> startDOMNode(do_QueryInterface(startNode));
-    nsresult rv = privSel->
-      GetRangesForIntervalCOMArray(startDOMNode, 0, startDOMNode, childCount,
-                                   PR_TRUE, aRanges);
-    NS_ENSURE_SUCCESS(rv, rv);
-    // Remove collapsed ranges
-    PRInt32 numRanges = aRanges->Count();
-    for (PRInt32 count = 0; count < numRanges; count ++) {
-      bool isCollapsed;
-      (*aRanges)[count]->GetCollapsed(&isCollapsed);
-      if (isCollapsed) {
-        aRanges->RemoveObjectAt(count);
-        -- numRanges;
-        -- count;
-      }
+  PRUint32 childCount = startNode->GetChildCount();
+  nsCOMPtr<nsIDOMNode> startDOMNode(do_QueryInterface(startNode));
+  nsCOMPtr<nsISelectionPrivate> privSel(do_QueryInterface(domSel));
+  nsresult rv = privSel->
+    GetRangesForIntervalCOMArray(startDOMNode, 0, startDOMNode, childCount,
+                                 true, aRanges);
+  NS_ENSURE_SUCCESS(rv,);
+
+  // Remove collapsed ranges
+  PRInt32 numRanges = aRanges->Count();
+  for (PRInt32 count = 0; count < numRanges; count ++) {
+    bool isCollapsed = false;
+    (*aRanges)[count]->GetCollapsed(&isCollapsed);
+    if (isCollapsed) {
+      aRanges->RemoveObjectAt(count);
+      --numRanges;
+      --count;
     }
   }
-
-  return NS_OK;
 }
 
 /*
  * Gets the number of selected regions.
  */
-NS_IMETHODIMP nsHyperTextAccessible::GetSelectionCount(PRInt32 *aSelectionCount)
+NS_IMETHODIMP
+nsHyperTextAccessible::GetSelectionCount(PRInt32* aSelectionCount)
 {
-  nsCOMPtr<nsISelection> domSel;
+  NS_ENSURE_ARG_POINTER(aSelectionCount);
+  *aSelectionCount = 0;
+
   nsCOMArray<nsIDOMRange> ranges;
-  nsresult rv = GetSelections(nsISelectionController::SELECTION_NORMAL,
-                              nsnull, nsnull, &ranges);
-  NS_ENSURE_SUCCESS(rv, rv);
-
+  GetSelectionDOMRanges(nsISelectionController::SELECTION_NORMAL, &ranges);
   *aSelectionCount = ranges.Count();
 
   return NS_OK;
 }
 
 /*
  * Gets the start and end offset of the specified selection.
  */
-NS_IMETHODIMP nsHyperTextAccessible::GetSelectionBounds(PRInt32 aSelectionNum, PRInt32 *aStartOffset, PRInt32 *aEndOffset)
+NS_IMETHODIMP
+nsHyperTextAccessible::GetSelectionBounds(PRInt32 aSelectionNum,
+                                          PRInt32* aStartOffset,
+                                          PRInt32* aEndOffset)
 {
+  NS_ENSURE_ARG_POINTER(aStartOffset);
+  NS_ENSURE_ARG_POINTER(aEndOffset);
   *aStartOffset = *aEndOffset = 0;
 
-  nsCOMPtr<nsISelection> domSel;
   nsCOMArray<nsIDOMRange> ranges;
-  nsresult rv = GetSelections(nsISelectionController::SELECTION_NORMAL,
-                              nsnull, getter_AddRefs(domSel), &ranges);
-  NS_ENSURE_SUCCESS(rv, rv);
+  GetSelectionDOMRanges(nsISelectionController::SELECTION_NORMAL, &ranges);
 
   PRInt32 rangeCount = ranges.Count();
   if (aSelectionNum < 0 || aSelectionNum >= rangeCount)
     return NS_ERROR_INVALID_ARG;
 
   nsCOMPtr<nsIDOMRange> range = ranges[aSelectionNum];
 
   // Get start point
   nsCOMPtr<nsIDOMNode> startDOMNode;
   range->GetStartContainer(getter_AddRefs(startDOMNode));
   nsCOMPtr<nsINode> startNode(do_QueryInterface(startDOMNode));
-  PRInt32 startOffset;
+  PRInt32 startOffset = 0;
   range->GetStartOffset(&startOffset);
 
   // Get end point
   nsCOMPtr<nsIDOMNode> endDOMNode;
   range->GetEndContainer(getter_AddRefs(endDOMNode));
   nsCOMPtr<nsINode> endNode(do_QueryInterface(endDOMNode));
-  PRInt32 endOffset;
+  PRInt32 endOffset = 0;
   range->GetEndOffset(&endOffset);
 
-  PRInt16 rangeCompareResult;
-  rv = range->CompareBoundaryPoints(nsIDOMRange::START_TO_END, range, &rangeCompareResult);
+  PRInt16 rangeCompareResult = 0;
+  nsresult rv = range->CompareBoundaryPoints(nsIDOMRange::START_TO_END, range,
+                                             &rangeCompareResult);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (rangeCompareResult < 0) {
     // Make sure start is before end, by swapping offsets
     // This occurs when the user selects backwards in the text
     startNode.swap(endNode);
     PRInt32 tempOffset = startOffset;
     startOffset = endOffset;
@@ -1893,85 +1865,97 @@ NS_IMETHODIMP nsHyperTextAccessible::Get
 /*
  * Changes the start and end offset of the specified selection.
  */
 NS_IMETHODIMP
 nsHyperTextAccessible::SetSelectionBounds(PRInt32 aSelectionNum,
                                           PRInt32 aStartOffset,
                                           PRInt32 aEndOffset)
 {
-  nsCOMPtr<nsISelection> domSel;
-  nsresult rv = GetSelections(nsISelectionController::SELECTION_NORMAL,
-                              nsnull, getter_AddRefs(domSel));
-  NS_ENSURE_SUCCESS(rv, rv);
+  nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
+  NS_ENSURE_STATE(frameSelection);
+
+  nsCOMPtr<nsISelection> domSel =
+    frameSelection->GetSelection(nsISelectionController::SELECTION_NORMAL);
+  NS_ENSURE_STATE(domSel);
 
   // Caret is a collapsed selection
   bool isOnlyCaret = (aStartOffset == aEndOffset);
 
-  PRInt32 rangeCount;
+  PRInt32 rangeCount = 0;
   domSel->GetRangeCount(&rangeCount);
   nsCOMPtr<nsIDOMRange> range;
   if (aSelectionNum == rangeCount) { // Add a range
     range = do_CreateInstance(kRangeCID);
     NS_ENSURE_TRUE(range, NS_ERROR_OUT_OF_MEMORY);
   }
   else if (aSelectionNum < 0 || aSelectionNum > rangeCount) {
     return NS_ERROR_INVALID_ARG;
   }
   else {
     domSel->GetRangeAt(aSelectionNum, getter_AddRefs(range));
     NS_ENSURE_TRUE(range, NS_ERROR_FAILURE);
   }
 
-  PRInt32 startOffset, endOffset;
+  PRInt32 startOffset = 0, endOffset = 0;
   nsCOMPtr<nsIDOMNode> startNode, endNode;
 
-  rv = HypertextOffsetsToDOMRange(aStartOffset, aEndOffset,
-                                  getter_AddRefs(startNode), &startOffset,
-                                  getter_AddRefs(endNode), &endOffset);
+  nsresult rv = HypertextOffsetsToDOMRange(aStartOffset, aEndOffset,
+                                           getter_AddRefs(startNode), &startOffset,
+                                           getter_AddRefs(endNode), &endOffset);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = range->SetStart(startNode, startOffset);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = isOnlyCaret ? range->Collapse(PR_TRUE) :
                      range->SetEnd(endNode, endOffset);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  if (aSelectionNum == rangeCount) { // Add successfully created new range
+  // If new range was created then add it, otherwise notify selection listeners
+  // that existing selection range was changed.
+  if (aSelectionNum == rangeCount)
     return domSel->AddRange(range);
-  }
+
+  domSel->RemoveRange(range);
+  domSel->AddRange(range);
   return NS_OK;
 }
 
 /*
  * Adds a selection bounded by the specified offsets.
  */
-NS_IMETHODIMP nsHyperTextAccessible::AddSelection(PRInt32 aStartOffset, PRInt32 aEndOffset)
+NS_IMETHODIMP
+nsHyperTextAccessible::AddSelection(PRInt32 aStartOffset, PRInt32 aEndOffset)
 {
-  nsCOMPtr<nsISelection> domSel;
-  nsresult rv = GetSelections(nsISelectionController::SELECTION_NORMAL,
-                              nsnull, getter_AddRefs(domSel));
-  NS_ENSURE_SUCCESS(rv, rv);
+  nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
+  NS_ENSURE_STATE(frameSelection);
 
-  PRInt32 rangeCount;
+  nsCOMPtr<nsISelection> domSel =
+    frameSelection->GetSelection(nsISelectionController::SELECTION_NORMAL);
+  NS_ENSURE_STATE(domSel);
+
+  PRInt32 rangeCount = 0;
   domSel->GetRangeCount(&rangeCount);
 
   return SetSelectionBounds(rangeCount, aStartOffset, aEndOffset);
 }
 
 /*
  * Removes the specified selection.
  */
-NS_IMETHODIMP nsHyperTextAccessible::RemoveSelection(PRInt32 aSelectionNum)
+NS_IMETHODIMP
+nsHyperTextAccessible::RemoveSelection(PRInt32 aSelectionNum)
 {
-  nsCOMPtr<nsISelection> domSel;
-  nsresult rv = GetSelections(nsISelectionController::SELECTION_NORMAL,
-                              nsnull, getter_AddRefs(domSel));
-  NS_ENSURE_SUCCESS(rv, rv);
+  nsRefPtr<nsFrameSelection> frameSelection = FrameSelection();
+  NS_ENSURE_STATE(frameSelection);
+
+  nsCOMPtr<nsISelection> domSel =
+    frameSelection->GetSelection(nsISelectionController::SELECTION_NORMAL);
+  NS_ENSURE_STATE(domSel);
 
   PRInt32 rangeCount;
   domSel->GetRangeCount(&rangeCount);
   if (aSelectionNum < 0 || aSelectionNum >= rangeCount)
     return NS_ERROR_INVALID_ARG;
 
   nsCOMPtr<nsIDOMRange> range;
   domSel->GetRangeAt(aSelectionNum, getter_AddRefs(range));
@@ -2343,31 +2327,29 @@ nsHyperTextAccessible::DOMRangeBoundToHy
 nsresult
 nsHyperTextAccessible::GetSpellTextAttribute(nsIDOMNode *aNode,
                                              PRInt32 aNodeOffset,
                                              PRInt32 *aHTStartOffset,
                                              PRInt32 *aHTEndOffset,
                                              nsIPersistentProperties *aAttributes)
 {
   nsCOMArray<nsIDOMRange> ranges;
-  nsresult rv = GetSelections(nsISelectionController::SELECTION_SPELLCHECK,
-                              nsnull, nsnull, &ranges);
-  NS_ENSURE_SUCCESS(rv, rv);
+  GetSelectionDOMRanges(nsISelectionController::SELECTION_SPELLCHECK, &ranges);
 
   PRInt32 rangeCount = ranges.Count();
   if (!rangeCount)
     return NS_OK;
 
   for (PRInt32 index = 0; index < rangeCount; index++) {
     nsCOMPtr<nsIDOMRange> range = ranges[index];
     nsCOMPtr<nsIDOMNSRange> nsrange(do_QueryInterface(range));
     NS_ENSURE_STATE(nsrange);
 
     PRInt16 result;
-    rv = nsrange->ComparePoint(aNode, aNodeOffset, &result);
+    nsresult rv = nsrange->ComparePoint(aNode, aNodeOffset, &result);
     NS_ENSURE_SUCCESS(rv, rv);
     // ComparePoint checks boundary points, but we need to check that
     // text at aNodeOffset is inside the range.
     // See also bug 460690.
     if (result == 0) {
       nsCOMPtr<nsIDOMNode> end;
       rv = range->GetEndContainer(getter_AddRefs(end));
       NS_ENSURE_SUCCESS(rv, rv);
@@ -2376,36 +2358,36 @@ nsHyperTextAccessible::GetSpellTextAttri
       NS_ENSURE_SUCCESS(rv, rv);
       if (aNode == end && aNodeOffset == endOffset) {
         result = 1;
       }
     }
 
     if (result == 1) { // range is before point
       PRInt32 startHTOffset = 0;
-      rv = DOMRangeBoundToHypertextOffset(range, PR_FALSE, PR_TRUE,
-                                          &startHTOffset);
+      nsresult rv = DOMRangeBoundToHypertextOffset(range, PR_FALSE, PR_TRUE,
+                                                   &startHTOffset);
       NS_ENSURE_SUCCESS(rv, rv);
 
       if (startHTOffset > *aHTStartOffset)
         *aHTStartOffset = startHTOffset;
 
     } else if (result == -1) { // range is after point
       PRInt32 endHTOffset = 0;
-      rv = DOMRangeBoundToHypertextOffset(range, PR_TRUE, PR_FALSE,
-                                          &endHTOffset);
+      nsresult rv = DOMRangeBoundToHypertextOffset(range, PR_TRUE, PR_FALSE,
+                                                   &endHTOffset);
       NS_ENSURE_SUCCESS(rv, rv);
 
       if (endHTOffset < *aHTEndOffset)
         *aHTEndOffset = endHTOffset;
 
     } else { // point is in range
       PRInt32 startHTOffset = 0;
-      rv = DOMRangeBoundToHypertextOffset(range, PR_TRUE, PR_TRUE,
-                                          &startHTOffset);
+      nsresult rv = DOMRangeBoundToHypertextOffset(range, PR_TRUE, PR_TRUE,
+                                                   &startHTOffset);
       NS_ENSURE_SUCCESS(rv, rv);
 
       PRInt32 endHTOffset = 0;
       rv = DOMRangeBoundToHypertextOffset(range, PR_FALSE, PR_FALSE,
                                           &endHTOffset);
       NS_ENSURE_SUCCESS(rv, rv);
 
       if (startHTOffset > *aHTStartOffset)
--- a/accessible/src/html/nsHyperTextAccessible.h
+++ b/accessible/src/html/nsHyperTextAccessible.h
@@ -346,32 +346,25 @@ protected:
                           nsIntRect *aBoundsRect = nsnull,
                           nsAccessible **aStartAcc = nsnull,
                           nsAccessible **aEndAcc = nsnull);
 
   nsIntRect GetBoundsForString(nsIFrame *aFrame, PRUint32 aStartRenderedOffset, PRUint32 aEndRenderedOffset);
 
   // Selection helpers
 
-    /**
-   * Get the relevant selection interfaces and ranges for the current hyper
-   * text.
-   *
-   * @param aType    [in] the selection type
-   * @param aSelCon  [out, optional] the selection controller for the current
-   *                 hyper text
-   * @param aDomSel  [out, optional] the selection interface for the current
-   *                 hyper text
-   * @param aRanges  [out, optional] the selected ranges within the current
-   *                 subtree
+  /**
+   * Return frame selection object for the accessible.
    */
-  nsresult GetSelections(PRInt16 aType,
-                         nsISelectionController **aSelCon,
-                         nsISelection **aDomSel = nsnull,
-                         nsCOMArray<nsIDOMRange>* aRanges = nsnull);
+  virtual already_AddRefed<nsFrameSelection> FrameSelection();
+
+  /**
+   * Return selection ranges within the accessible subtree.
+   */
+  void GetSelectionDOMRanges(PRInt16 aType, nsCOMArray<nsIDOMRange>* aRanges);
 
   nsresult SetSelectionRange(PRInt32 aStartPos, PRInt32 aEndPos);
 
   /**
    * Provide the line number for the caret, relative to the
    * current DOM node.
    * @return 1-based index for the line number with the caret
    */
--- a/accessible/src/xul/nsXULFormControlAccessible.cpp
+++ b/accessible/src/xul/nsXULFormControlAccessible.cpp
@@ -878,16 +878,27 @@ nsXULTextFieldAccessible::CacheChildren(
 
   nsAccTreeWalker walker(mWeakShell, inputContent, PR_FALSE);
 
   nsAccessible* child = nsnull;
   while ((child = walker.NextChild()) && AppendChild(child));
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+// nsXULTextFieldAccessible: nsHyperTextAccessible protected
+
+already_AddRefed<nsFrameSelection>
+nsXULTextFieldAccessible::FrameSelection()
+{
+  nsCOMPtr<nsIContent> inputContent(GetInputField());
+  nsIFrame* frame = inputContent->GetPrimaryFrame();
+  return frame->GetFrameSelection();
+}
+
+////////////////////////////////////////////////////////////////////////////////
 // nsXULTextFieldAccessible protected
 
 already_AddRefed<nsIContent>
 nsXULTextFieldAccessible::GetInputField() const
 {
   nsCOMPtr<nsIDOMNode> inputFieldDOMNode;
   nsCOMPtr<nsIDOMXULTextBoxElement> textBox = do_QueryInterface(mContent);
   if (textBox) {
--- a/accessible/src/xul/nsXULFormControlAccessible.h
+++ b/accessible/src/xul/nsXULFormControlAccessible.h
@@ -271,15 +271,18 @@ public:
 
   // ActionAccessible
   virtual PRUint8 ActionCount();
 
 protected:
   // nsAccessible
   virtual void CacheChildren();
 
+  // nsHyperTextAccessible
+  virtual already_AddRefed<nsFrameSelection> FrameSelection();
+
   // nsXULTextFieldAccessible
   already_AddRefed<nsIContent> GetInputField() const;
 };
 
 
 #endif  
 
--- a/accessible/src/xul/nsXULTreeAccessible.cpp
+++ b/accessible/src/xul/nsXULTreeAccessible.cpp
@@ -878,22 +878,17 @@ nsXULTreeItemAccessibleBase::DoAction(PR
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeItemAccessibleBase: nsAccessNode implementation
 
 bool
 nsXULTreeItemAccessibleBase::IsDefunct() const
 {
-  if (nsAccessibleWrap::IsDefunct() || !mTree || !mTreeView || mRow < 0)
-    return PR_TRUE;
-
-  PRInt32 rowCount = 0;
-  nsresult rv = mTreeView->GetRowCount(&rowCount);
-  return NS_FAILED(rv) || mRow >= rowCount;
+  return nsAccessibleWrap::IsDefunct() || !mTree || !mTreeView || mRow < 0;
 }
 
 void
 nsXULTreeItemAccessibleBase::Shutdown()
 {
   mTree = nsnull;
   mTreeView = nsnull;
   mRow = -1;
--- a/accessible/tests/mochitest/Makefile.in
+++ b/accessible/tests/mochitest/Makefile.in
@@ -51,16 +51,17 @@ DIRS	= \
   hyperlink \
   hypertext \
   name \
   relations \
   selectable \
   states \
   table \
   text \
+  textselection \
   tree \
   treeupdate \
   value \
   $(null)
 
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
--- a/accessible/tests/mochitest/events.js
+++ b/accessible/tests/mochitest/events.js
@@ -18,16 +18,17 @@ const EVENT_SCROLLING_START = nsIAccessi
 const EVENT_SELECTION_ADD = nsIAccessibleEvent.EVENT_SELECTION_ADD;
 const EVENT_SELECTION_WITHIN = nsIAccessibleEvent.EVENT_SELECTION_WITHIN;
 const EVENT_SHOW = nsIAccessibleEvent.EVENT_SHOW;
 const EVENT_STATE_CHANGE = nsIAccessibleEvent.EVENT_STATE_CHANGE;
 const EVENT_TEXT_ATTRIBUTE_CHANGED = nsIAccessibleEvent.EVENT_TEXT_ATTRIBUTE_CHANGED;
 const EVENT_TEXT_CARET_MOVED = nsIAccessibleEvent.EVENT_TEXT_CARET_MOVED;
 const EVENT_TEXT_INSERTED = nsIAccessibleEvent.EVENT_TEXT_INSERTED;
 const EVENT_TEXT_REMOVED = nsIAccessibleEvent.EVENT_TEXT_REMOVED;
+const EVENT_TEXT_SELECTION_CHANGED = nsIAccessibleEvent.EVENT_TEXT_SELECTION_CHANGED;
 const EVENT_VALUE_CHANGE = nsIAccessibleEvent.EVENT_VALUE_CHANGE;
 
 ////////////////////////////////////////////////////////////////////////////////
 // General
 
 /**
  * Set up this variable to dump events into DOM.
  */
--- a/accessible/tests/mochitest/test_text_caret.html
+++ b/accessible/tests/mochitest/test_text_caret.html
@@ -29,69 +29,95 @@
            aOffset,
            "Wrong caret offset for " + prettyName(aEvent.target));
       }
     }
 
     /**
      * Invokers.
      */
-    function setCaretOffsetInvoker(aID, aOffset)
+    function setCaretOffsetInvoker(aID, aOffset, aFocusableContainerID)
     {
       this.target = getAccessible(aID, [nsIAccessibleText]);
+      this.focus = aFocusableContainerID ?
+        getAccessible(aFocusableContainerID) : this.target;
 
       this.invoke = function setCaretOffsetInvoker_invoke()
       {
         this.target.caretOffset = aOffset;
       }
 
       this.getID = function setCaretOffsetInvoker_getID()
       {
-        return "nsIAccessibleText::caretOffset test";
+        return "Set caretOffset on " + prettyName(aID) + " at " + aOffset;
       }
 
       this.eventSeq = [
-        new invokerChecker(EVENT_FOCUS, this.target),
-        new caretMovedChecker(this.target, aOffset)
+        new caretMovedChecker(this.target, aOffset),
+        new asyncInvokerChecker(EVENT_FOCUS, this.focus)
       ];
     }
 
     /**
+     * Turn on/off the caret browsing mode.
+     */
+    function turnCaretBrowsing(aIsOn)
+    {
+      var prefs = Components.classes["@mozilla.org/preferences-service;1"].
+        getService(Components.interfaces.nsIPrefBranch);
+      prefs.setBoolPref("accessibility.browsewithcaret", aIsOn);
+    }
+
+    /**
      * Do tests.
      */
     var gQueue = null;
 
-    // gA11yEventDumpID = "eventdump"; // debug stuff
+    //gA11yEventDumpID = "eventdump"; // debug stuff
+    //gA11yEventDumpToConsole = true;
 
     function doTests()
     {
+      turnCaretBrowsing(true);
+
       // test caret move events and caret offsets
       gQueue = new eventQueue();
 
       gQueue.push(new setCaretOffsetInvoker("textbox", 1));
       gQueue.push(new setCaretOffsetInvoker("link", 1));
+      gQueue.push(new setCaretOffsetInvoker("heading", 1, document));
+      gQueue.onFinish = function()
+      {
+        turnCaretBrowsing(false);
+      }
 
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTests);
   </script>
 </head>
 
 <body>
 
   <a target="_blank"
      href="https://bugzilla.mozilla.org/show_bug.cgi?id=524115"
      title="HyperText accessible should get focus when the caret is positioned inside of it, text is changed or copied into clipboard by ATs">
     Mozilla Bug 524115
   </a>
+  <a target="_blank"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=546068"
+     title="Position is not being updated when atk_text_set_caret_offset is used">
+    Mozilla Bug 546068
+  </a>
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
   <input id="textbox" value="hello"/>
   <a id="link" href="about:">about mozilla</a>
+  <h5 id="heading">heading</h5>
 
   <div id="eventdump"></div>
 </body>
 </html>
new file mode 100644
--- /dev/null
+++ b/accessible/tests/mochitest/textselection/Makefile.in
@@ -0,0 +1,53 @@
+#
+# ***** 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) 2011
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Alexander Surkov <surkov.alexander@gmail.com> (original author)
+#
+# 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 *****
+
+DEPTH		= ../../../..
+topsrcdir	= @top_srcdir@
+srcdir		= @srcdir@
+VPATH		= @srcdir@
+relativesrcdir  = accessible/textselection
+
+include $(DEPTH)/config/autoconf.mk
+include $(topsrcdir)/config/rules.mk
+
+_TEST_FILES = \
+		test_general.html \
+		$(NULL)
+
+libs:: $(_TEST_FILES)
+	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir)
new file mode 100644
--- /dev/null
+++ b/accessible/tests/mochitest/textselection/test_general.html
@@ -0,0 +1,170 @@
+<html>
+
+<head>
+  <title>Text selection testing</title>
+
+  <link rel="stylesheet" type="text/css"
+        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+
+  <script type="application/javascript"
+          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
+
+  <script type="application/javascript"
+          src="../common.js"></script>
+  <script type="application/javascript"
+          src="../events.js"></script>
+
+  <script type="application/javascript">
+    /**
+     * Invokers
+     */
+    function addSelection(aID, aStartOffset, aEndOffset)
+    {
+      this.hyperTextNode = getNode(aID);
+      this.hyperText = getAccessible(aID, [ nsIAccessibleText ]);
+
+      this.eventSeq = [
+        new invokerChecker(EVENT_TEXT_SELECTION_CHANGED, aID)
+      ];
+
+      this.invoke = function addSelection_invoke()
+      {
+        this.hyperText.addSelection(aStartOffset, aEndOffset);
+      }
+
+      this.finalCheck = function addSelection_finalCheck()
+      {
+        is(this.hyperText.selectionCount, 1,
+           "addSelection: Wrong selection count for " + aID);
+        var startOffset = {}, endOffset = {};
+        this.hyperText.getSelectionBounds(0, startOffset, endOffset);
+
+        is(startOffset.value, aStartOffset,
+           "addSelection: Wrong start offset for " + aID);
+        is(endOffset.value, aEndOffset,
+           "addSelection: Wrong end offset for " + aID);
+      }
+
+      this.getID = function addSelection_getID()
+      {
+        return "nsIAccessibleText::addSelection test for " + aID;
+      }
+    }
+
+    function changeSelection(aID, aStartOffset, aEndOffset)
+    {
+      this.hyperTextNode = getNode(aID);
+      this.hyperText = getAccessible(aID, [ nsIAccessibleText ]);
+
+      this.eventSeq = [
+        new invokerChecker(EVENT_TEXT_SELECTION_CHANGED, aID)
+      ];
+
+      this.invoke = function changeSelection_invoke()
+      {
+        this.hyperText.setSelectionBounds(0, aStartOffset, aEndOffset);
+      }
+
+      this.finalCheck = function changeSelection_finalCheck()
+      {
+        is(this.hyperText.selectionCount, 1,
+           "setSelectionBounds: Wrong selection count for " + aID);
+        var startOffset = {}, endOffset = {};
+        this.hyperText.getSelectionBounds(0, startOffset, endOffset);
+
+        is(startOffset.value, aStartOffset,
+           "setSelectionBounds: Wrong start offset for " + aID);
+        is(endOffset.value, aEndOffset,
+           "setSelectionBounds: Wrong end offset for " + aID);
+      }
+
+      this.getID = function changeSelection_getID()
+      {
+        return "nsIAccessibleText::setSelectionBounds test for " + aID;
+      }
+    }
+
+    function removeSelection(aID)
+    {
+      this.hyperText = getAccessible(aID, [ nsIAccessibleText ]);
+
+      this.eventSeq = [
+        new invokerChecker(EVENT_TEXT_SELECTION_CHANGED, aID)
+      ];
+
+      this.invoke = function removeSelection_invoke()
+      {
+        this.hyperText.removeSelection(0);
+      }
+
+      this.finalCheck = function removeSelection_finalCheck()
+      {
+        is(this.hyperText.selectionCount, 0,
+           "removeSelection: Wrong selection count for " + aID);
+      }
+
+      this.getID = function removeSelection_getID()
+      {
+        return "nsIAccessibleText::removeSelection test for " + aID;
+      }
+    }
+
+    function onfocusEventSeq(aID)
+    {
+      var caretMovedChecker =
+        new invokerChecker(EVENT_TEXT_CARET_MOVED, aID);
+      var selChangedChecker =
+        new invokerChecker(EVENT_TEXT_SELECTION_CHANGED, aID);
+      selChangedChecker.unexpected = true;
+
+      return [ caretMovedChecker, selChangedChecker ];
+    }
+
+    /**
+     * Do tests
+     */
+
+    //gA11yEventDumpToConsole = true; // debug stuff
+
+    var gQueue = null;
+    function doTests()
+    {
+      gQueue = new eventQueue();
+
+      gQueue.push(new addSelection("paragraph", 1, 3));
+      gQueue.push(new changeSelection("paragraph", 2, 4));
+      //gQueue.push(new removeSelection("paragraph"));
+      todo(false, "removeSelection doesn't fire text selection changed events, see bug bug 688124.");
+
+      gQueue.push(new synthFocus("textbox", onfocusEventSeq("textbox")));
+      gQueue.push(new changeSelection("textbox", 1, 3));
+
+      gQueue.push(new synthFocus("textarea", onfocusEventSeq("textarea")));
+      gQueue.push(new changeSelection("textarea", 1, 3));
+
+      gQueue.invoke(); // Will call SimpleTest.finish();
+    }
+
+    SimpleTest.waitForExplicitFinish();
+    addA11yLoadEvent(doTests);
+  </script>
+</head>
+
+<body>
+
+  <a target="_blank"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=688126"
+     title="nsIAccessibleText::setSelectionBounds doesn't fire text selection changed events in some cases">
+    Mozilla Bug 688126
+  </a>
+  <p id="display"></p>
+  <div id="content" style="display: none"></div>
+  <pre id="test">
+  </pre>
+
+  <p id="paragraph">hello</p>
+  <input id="textbox" value="hello"/>
+  <textarea id="textarea">hello</textarea>
+
+</body>
+</html>
--- a/browser/app/blocklist.xml
+++ b/browser/app/blocklist.xml
@@ -1,19 +1,21 @@
 <?xml version="1.0"?>
-<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1317659919000">
+<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1318359094000">
   <emItems>
       <emItem  blockID="i41" id="{99079a25-328f-4bd4-be04-00955acaa0a7}">
                         <versionRange  minVersion="0.1" maxVersion="4.3.1.00" severity="1">
                     </versionRange>
                   </emItem>
       <emItem  blockID="i8" id="{B13721C7-F507-4982-B2E5-502A71474FED}">
                         <versionRange  minVersion=" " severity="1">
                     </versionRange>
                   </emItem>
+      <emItem  blockID="i43" id="supportaccessplugin@gmail.com">
+                        </emItem>
       <emItem  blockID="i38" id="{B7082FAA-CB62-4872-9106-E42DD88EDE45}">
                         <versionRange  minVersion="0.1" maxVersion="3.3.0.*">
                       <targetApplication  id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
                               <versionRange  minVersion="3.7a1" maxVersion="*" />
                           </targetApplication>
                     </versionRange>
                                 <versionRange  minVersion="3.3.1" maxVersion="*">
                       <targetApplication  id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
@@ -81,16 +83,18 @@
                   </emItem>
       <emItem  blockID="i2" id="fdm_ffext@freedownloadmanager.org">
                         <versionRange  minVersion="1.0" maxVersion="1.3.1">
                       <targetApplication  id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
                               <versionRange  minVersion="3.0a1" maxVersion="*" />
                           </targetApplication>
                     </versionRange>
                   </emItem>
+      <emItem  blockID="i44" id="sigma@labs.mozilla">
+                        </emItem>
       <emItem  blockID="i5" id="support@daemon-tools.cc">
                         <versionRange  minVersion=" " maxVersion="1.0.0.5">
                     </versionRange>
                   </emItem>
       <emItem  blockID="i6" id="{3f963a5b-e555-4543-90e2-c3908898db71}">
                         <versionRange  minVersion=" " maxVersion="8.5">
                     </versionRange>
                   </emItem>
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1005,16 +1005,19 @@ pref("devtools.inspector.enabled", true)
 pref("devtools.styleinspector.enabled", true);
 
 // Enable the Scratchpad tool.
 pref("devtools.scratchpad.enabled", true);
 
 // Enable tools for Chrome development.
 pref("devtools.chrome.enabled", false);
 
+// Disable the GCLI enhanced command line.
+pref("devtools.gcli.enable", false);
+
 // The last Web Console height. This is initially 0 which means that the Web
 // Console will use the default height next time it shows.
 // Change to -1 if you do not want the Web Console to remember its last height.
 pref("devtools.hud.height", 0);
 
 // Remember the Web Console position. Possible values:
 //   above - above the web page,
 //   below - below the web page,
--- a/browser/base/content/tabview/items.js
+++ b/browser/base/content/tabview/items.js
@@ -862,17 +862,17 @@ let Items = {
   },
 
   // ----------
   // Function: getTopLevelItems
   // Returns an array of all Items not grouped into groupItems.
   getTopLevelItems: function Items_getTopLevelItems() {
     var items = [];
 
-    iQ('.tab, .groupItem, .info-item').each(function(elem) {
+    iQ('.tab, .groupItem').each(function(elem) {
       var $this = iQ(elem);
       var item = $this.data('item');
       if (item && !item.parent && !$this.hasClass('phantom'))
         items.push(item);
     });
 
     return items;
   },
--- a/browser/base/content/tabview/tabview.css
+++ b/browser/base/content/tabview/tabview.css
@@ -127,20 +127,16 @@ input.name:focus {
 
 /* Other Items
 ----------------------------------*/
 
 .undo {
   position: absolute;
 }
 
-.info-item {
-  position: absolute;
-}
-
 /* Trenches
 ----------------------------------*/
 
 .guideTrench, 
 .visibleTrench, 
 .activeVisibleTrench {
   position: absolute;
 }
--- a/browser/base/content/test/test_contextmenu.html
+++ b/browser/base/content/test/test_contextmenu.html
@@ -18,26 +18,43 @@ Browser context menu tests.
 
 /** Test for Login Manager: multiple login autocomplete. **/
 
 netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 
-function openContextMenuFor(element, shiftkey) {
+function openContextMenuFor(element, shiftkey, shouldWaitForFocus) {
     // Context menu should be closed before we open it again.
     is(contextMenu.state, "closed", "checking if popup is closed");
 
-    if (lastElement)
-      lastElement.blur();
-    element.focus();
-    lastElement = element;
-    var eventDetails = { type : "contextmenu", button : 2, shiftKey : shiftkey };
-    synthesizeMouse(element, 2, 2, eventDetails, element.ownerDocument.defaultView);
+    //Some elements need time to focus and spellcheck before any tests are
+    //run on them.
+    if(shouldWaitForFocus)
+    {
+      if (lastElement)
+        lastElement.blur();
+      element.focus();
+      
+      SimpleTest.executeSoon(function() {
+        lastElement = element;
+        var eventDetails = { type : "contextmenu", button : 2, shiftKey : shiftkey };
+        synthesizeMouse(element, 2, 2, eventDetails, element.ownerDocument.defaultView);
+      });
+    }
+    else
+    {
+      if (lastElement)
+          lastElement.blur();
+      element.focus();
+      lastElement = element;
+      var eventDetails = { type : "contextmenu", button : 2, shiftKey : shiftkey };
+      synthesizeMouse(element, 2, 2, eventDetails, element.ownerDocument.defaultView);
+    }
 }
 
 function closeContextMenu() {
     contextMenu.hidePopup();
 }
 
 function executeCopyCommand(command, expectedValue)
 {
@@ -416,17 +433,17 @@ function runTest(testNum) {
                                "context-viewframesource",   true,
                                "context-viewframeinfo",     true], null,
                           "---",                  null,
                           "context-viewsource",   true,
                           "context-viewinfo",     true,
                           "---",                  null,
                           "context-inspect",      true]);
         closeContextMenu();
-        openContextMenuFor(textarea); // Invoke context menu for next test.
+        openContextMenuFor(textarea, false, true); // Invoke context menu for next test, but wait for the spellcheck.
         break;
 
     case 12:
         // Context menu for textarea
         checkContextMenu(["*chubbiness",         true, // spelling suggestion
                           "spell-add-to-dictionary", true,
                           "---",                 null,
                           "context-undo",        false,
--- a/browser/branding/official/pref/firefox-branding.js
+++ b/browser/branding/official/pref/firefox-branding.js
@@ -1,10 +1,9 @@
-// Fight update fatigue by suppressing whatsnew tab opening after update (bug 685727)
-pref("startup.homepage_override_url","");
+pref("startup.homepage_override_url","http://www.mozilla.com/%LOCALE%/%APP%/%VERSION%/whatsnew/");
 pref("startup.homepage_welcome_url","http://www.mozilla.com/%LOCALE%/%APP%/%VERSION%/firstrun/");
 // Interval: Time between checks for a new version (in seconds)
 // nightly=6 hours, official=24 hours
 pref("app.update.interval", 86400);
 // The time interval between the downloading of mar file chunks in the
 // background (in seconds)
 pref("app.update.download.backgroundInterval", 600);
 // Give the user x seconds to react before showing the big UI. default=24 hours
--- a/browser/components/migration/src/nsIEProfileMigrator.cpp
+++ b/browser/components/migration/src/nsIEProfileMigrator.cpp
@@ -34,16 +34,18 @@
  * 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 <stdio.h>
 #include <string.h>
 #include <windows.h>
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsBrowserProfileMigratorUtils.h"
 #include "nsCOMPtr.h"
 #include "nsCRTGlue.h"
 #include "nsNetCID.h"
@@ -104,16 +106,18 @@
   NS_LITERAL_STRING("Software\\Microsoft\\Internet Explorer\\Main")
 #define REGISTRY_IE_TYPEDURL_KEY \
   NS_LITERAL_STRING("Software\\Microsoft\\Internet Explorer\\TypedURLs")
 #define REGISTRY_IE_TOOLBAR_KEY \
   NS_LITERAL_STRING("Software\\Microsoft\\Internet Explorer\\Toolbar")
 #define REGISTRY_IE_SEARCHURL_KEY \
   NS_LITERAL_STRING("Software\\Microsoft\\Internet Explorer\\SearchUrl")
 
+using namespace mozilla;
+
 const int sInitialCookieBufferSize = 1024; // but it can grow
 const int sUsernameLengthLimit     = 80;
 const int sHostnameLengthLimit     = 255;
 
 //***********************************************************************
 //*** Replacements for comsupp.lib calls used by pstorec.dll
 //***********************************************************************
 void  __stdcall _com_issue_error(HRESULT hr)
@@ -1668,17 +1672,17 @@ nsIEProfileMigrator::ParseFavoritesFolde
   return rv;
 }
 
 nsresult
 nsIEProfileMigrator::CopyPreferences(bool aReplace) 
 {
   bool            regKeyOpen = false;
   const regEntry  *entry,
-                  *endEntry = gRegEntries + NS_ARRAY_LENGTH(gRegEntries);
+                  *endEntry = ArrayEnd(gRegEntries);
                               
 
   nsCOMPtr<nsIPrefBranch> prefs;
 
   { // scope pserve why not
     nsCOMPtr<nsIPrefService> pserve(do_GetService(NS_PREFSERVICE_CONTRACTID));
     if (pserve)
       pserve->GetBranch("", getter_AddRefs(prefs));
@@ -2163,17 +2167,17 @@ nsIEProfileMigrator::CopyProxyPreference
         { "https=",   6, PR_FALSE, "network.proxy.ssl",
           "network.proxy.ssl_port"    },
         { "socks=",   6, PR_FALSE, "network.proxy.socks",
           "network.proxy.socks_port"  },
       };
 
       PRInt32 startIndex = 0, count = 0;
       bool foundSpecificProxy = false;
-      for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(data); ++i) {
+      for (PRUint32 i = 0; i < ArrayLength(data); ++i) {
         PRInt32 offset = buf.Find(NS_ConvertASCIItoUTF16(data[i].prefix));
         if (offset >= 0) {
           foundSpecificProxy = PR_TRUE;
 
           data[i].proxyConfigured = PR_TRUE;
 
           startIndex = offset + data[i].prefixLength;
 
@@ -2186,17 +2190,17 @@ nsIEProfileMigrator::CopyProxyPreference
                        data[i].portPref, aPrefs);
         }
       }
 
       if (!foundSpecificProxy) {
         // No proxy config for any specific type was found, assume 
         // the ProxyServer value is of the form host:port and that 
         // it applies to all protocols.
-        for (PRUint32 i = 0; i < NS_ARRAY_LENGTH(data); ++i)
+        for (PRUint32 i = 0; i < ArrayLength(data); ++i)
           SetProxyPref(buf, data[i].hostPref, data[i].portPref, aPrefs);
         aPrefs->SetBoolPref("network.proxy.share_proxy_settings", PR_TRUE);
       }
     }
 
   }
 
   return NS_OK;
--- a/browser/components/migration/src/nsOperaProfileMigrator.cpp
+++ b/browser/components/migration/src/nsOperaProfileMigrator.cpp
@@ -30,16 +30,18 @@
  * 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"
@@ -63,16 +65,18 @@
 #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)
@@ -477,17 +481,17 @@ nsOperaProfileMigrator::CopyProxySetting
 
   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 < NS_ARRAY_LENGTH(protocols); ++i) {
+  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;
     }
 
--- a/browser/components/preferences/aboutPermissions.js
+++ b/browser/components/preferences/aboutPermissions.js
@@ -625,17 +625,17 @@ let AboutPermissions = {
       item.setAttribute("favicon", aURL);
     });
     aSite.listitem = item;
 
     // Make sure to only display relevant items when list is filtered
     let filterValue = document.getElementById("sites-filter").value.toLowerCase();
     item.collapsed = aSite.host.toLowerCase().indexOf(filterValue) == -1;
 
-    this.sitesList.appendChild(item);
+    (this._listFragment || this.sitesList).appendChild(item);
   },
 
   startSitesListBatch: function () {
     if (!this._listFragment)
       this._listFragment = document.createDocumentFragment();
   },
 
   endSitesListBatch: function () {
--- a/browser/components/preferences/advanced-scripts.xul
+++ b/browser/components/preferences/advanced-scripts.xul
@@ -60,18 +60,18 @@
     </preferences>
     
     <script type="application/javascript" src="chrome://browser/content/preferences/advanced-scripts.js"/>
 
     <stringbundle id="preferencesBundle" src="chrome://browser/locale/preferences/preferences.properties"/>
 
     <description value="&allowScripts.label;"/>
 
-    <checkbox id="moveResizeWindows" label="&moveResizeWindows.label;" 
-              accesskey="&moveResizeWindows.accesskey;"
+    <checkbox id="moveResizePopupWindows" label="&moveResizePopupWindows.label;"
+              accesskey="&moveResizePopupWindows.accesskey;"
               preference="dom.disable_window_move_resize"/>
     <checkbox id="raiseLowerWindows" label="&raiseLowerWindows.label;" 
               accesskey="&raiseLowerWindows.accesskey;"
               preference="dom.disable_window_flip"/>
     <checkbox id="disableContextMenus" label="&disableContextMenus.label;" 
               accesskey="&disableContextMenus.accesskey;"
               preference="dom.event.contextmenu.enabled"/>
 
--- a/browser/components/preferences/advanced.js
+++ b/browser/components/preferences/advanced.js
@@ -17,16 +17,17 @@
 # The Initial Developer of the Original Code is
 # Ben Goodger.
 # Portions created by the Initial Developer are Copyright (C) 2005
 # the Initial Developer. All Rights Reserved.
 #
 # Contributor(s):
 #   Ben Goodger <ben@mozilla.org>
 #   Jeff Walden <jwalden+code@mit.edu>
+#   Steffen Wilberg <steffen.wilberg@web.de>
 #
 # 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
@@ -56,19 +57,17 @@ var gAdvancedPane = {
       advancedPrefs.selectedTab = document.getElementById(extraArgs["advancedTab"]);
     } else {
       var preference = document.getElementById("browser.preferences.advanced.selectedTabIndex");
       if (preference.value !== null)
         advancedPrefs.selectedIndex = preference.value;
     }
 
 #ifdef MOZ_UPDATER
-    this.updateAppUpdateItems();
-    this.updateAutoItems();
-    this.updateModeItems();
+    this.updateReadPrefs();
 #endif
     this.updateOfflineApps();
 #ifdef MOZ_CRASHREPORTER
     this.initSubmitCrashes();
 #endif
     this.updateActualCacheSize();
   },
 
@@ -454,92 +453,100 @@ var gAdvancedPane = {
    * app.update.mode
    * - an integer:
    *     0    do not warn if an update will disable extensions or themes
    *     1    warn if an update will disable extensions or themes
    *     2    warn if an update will disable extensions or themes *or* if the
    *          update is a major update
    */
 
+#ifdef MOZ_UPDATER
   /**
-   * Enables and disables various UI preferences as necessary to reflect locked,
-   * disabled, and checked/unchecked states.
+   * Selects the item of the radiogroup, and sets the warnIncompatible checkbox
+   * based on the pref values and locked states.
    *
    * UI state matrix for update preference conditions
    * 
-   * UI Components:                                     Preferences
-   * 1 = Firefox checkbox                               i   = app.update.enabled
-   * 2 = When updates for Firefox are found label       ii  = app.update.auto
-   * 3 = Automatic Radiogroup (Ask vs. Automatically)   iii = app.update.mode
-   * 4 = Warn before disabling extensions checkbox
-   * 
-   * States:
-   * Element     p   val     locked    Disabled 
-   * 1           i   t/f     f         false
-   *             i   t/f     t         true
-   *             ii  t/f     t/f       false
-   *             iii 0/1/2   t/f       false
-   * 2,3         i   t       t/f       false
-   *             i   f       t/f       true
-   *             ii  t/f     f         false
-   *             ii  t/f     t         true
-   *             iii 0/1/2   t/f       false
-   * 4           i   t       t/f       false
-   *             i   f       t/f       true
-   *             ii  t       t/f       false
-   *             ii  f       t/f       true
-   *             iii 0/1/2   f         false
-   *             iii 0/1/2   t         true   
-   * 
+   * UI Components:                              Preferences
+   * Radiogroup                                  i   = app.update.enabled
+   * Warn before disabling extensions checkbox   ii  = app.update.auto
+   *                                             iii = app.update.mode
+   *
+   * Disabled states:
+   * Element           pref  value  locked  disabled
+   * radiogroup        i     t/f    f       false
+   *                   i     t/f    *t*     *true*
+   *                   ii    t/f    f       false
+   *                   ii    t/f    *t*     *true*
+   *                   iii   0/1/2  t/f     false
+   * warnIncompatible  i     t      f       false
+   *                   i     t      *t*     *true*
+   *                   i     *f*    t/f     *true*
+   *                   ii    t      f       false
+   *                   ii    t      *t*     *true*
+   *                   ii    *f*    t/f     *true*
+   *                   iii   0/1/2  f       false
+   *                   iii   0/1/2  *t*     *true*
    */
-#ifdef MOZ_UPDATER
-  updateAppUpdateItems: function () 
+  updateReadPrefs: function ()
   {
-    var aus = 
-        Components.classes["@mozilla.org/updates/update-service;1"].
-        getService(Components.interfaces.nsIApplicationUpdateService);
+    var enabledPref = document.getElementById("app.update.enabled");
+    var autoPref = document.getElementById("app.update.auto");
+    var radiogroup = document.getElementById("updateRadioGroup");
+
+    if (!enabledPref.value)   // Don't care for autoPref.value in this case.
+      radiogroup.value="manual"     // 3. Never check for updates.
+    else if (autoPref.value)  // enabledPref.value && autoPref.value
+      radiogroup.value="auto";      // 1. Automatically install updates
+    else                      // enabledPref.value && !autoPref.value
+      radiogroup.value="checkOnly"; // 2. Check, but let me choose
 
-    var enabledPref = document.getElementById("app.update.enabled");
-    var enableAppUpdate = document.getElementById("enableAppUpdate");
+    var canCheck = Components.classes["@mozilla.org/updates/update-service;1"].
+                     getService(Components.interfaces.nsIApplicationUpdateService).
+                     canCheckForUpdates;
+    // canCheck is false if the enabledPref is false and locked,
+    // or the binary platform or OS version is not known.
+    // A locked pref is sufficient to disable the radiogroup.
+    radiogroup.disabled = !canCheck || enabledPref.locked || autoPref.locked;
 
-    enableAppUpdate.disabled = !aus.canCheckForUpdates || enabledPref.locked;
+    var modePref = document.getElementById("app.update.mode");
+    var warnIncompatible = document.getElementById("warnIncompatible");
+    // the warnIncompatible checkbox value is set by readAddonWarn
+    warnIncompatible.disabled = radiogroup.disabled || modePref.locked ||
+                                !enabledPref.value || !autoPref.value;
   },
 
   /**
-   * Enables/disables UI for "when updates are found" based on the values,
-   * and "locked" states of associated preferences.
+   * Sets the pref values based on the selected item of the radiogroup,
+   * and sets the disabled state of the warnIncompatible checkbox accordingly.
    */
-  updateAutoItems: function () 
+  updateWritePrefs: function ()
   {
     var enabledPref = document.getElementById("app.update.enabled");
     var autoPref = document.getElementById("app.update.auto");
-    
-    var updateModeLabel = document.getElementById("updateModeLabel");
-    var updateMode = document.getElementById("updateMode");
-    
-    var disable = enabledPref.locked || !enabledPref.value ||
-                  autoPref.locked;
-    updateModeLabel.disabled = updateMode.disabled = disable;
-  },
+    var radiogroup = document.getElementById("updateRadioGroup");
+    switch (radiogroup.value) {
+      case "auto":      // 1. Automatically install updates
+        enabledPref.value = true;
+        autoPref.value = true;
+        break;
+      case "checkOnly": // 2. Check, but let me choose
+        enabledPref.value = true;
+        autoPref.value = false;
+        break;
+      case "manual":    // 3. Never check for updates.
+        enabledPref.value = false;
+        autoPref.value = false;
+    }
 
-  /**
-   * Enables/disables the "warn if incompatible extensions/themes exist" UI
-   * based on the values and "locked" states of various preferences.
-   */
-  updateModeItems: function () 
-  {
-    var enabledPref = document.getElementById("app.update.enabled");
-    var autoPref = document.getElementById("app.update.auto");
+    var warnIncompatible = document.getElementById("warnIncompatible");
     var modePref = document.getElementById("app.update.mode");
-    
-    var warnIncompatible = document.getElementById("warnIncompatible");
-    
-    var disable = enabledPref.locked || !enabledPref.value || autoPref.locked ||
-                  !autoPref.value || modePref.locked;
-    warnIncompatible.disabled = disable;
+    warnIncompatible.disabled = enabledPref.locked || !enabledPref.value ||
+                                autoPref.locked || !autoPref.value ||
+                                modePref.locked;
   },
 
   /**
    * Stores the value of the app.update.mode preference, which is a tristate
    * integer preference.  We store the value here so that we can properly
    * restore the preference value if the UI reflecting the preference value
    * is in a state which can represent either of two integer values (as
    * opposed to only one possible value in the other UI state).
@@ -548,28 +555,28 @@ var gAdvancedPane = {
 
   /**
    * Reads the app.update.mode preference and converts its value into a
    * true/false value for use in determining whether the "Warn me if this will
    * disable extensions or themes" checkbox is checked.  We also save the value
    * of the preference so that the preference value can be properly restored if
    * the user's preferences cannot adequately be expressed by a single checkbox.
    *
-   * app.update.modee         Checkbox State    Meaning
+   * app.update.mode          Checkbox State    Meaning
    * 0                        Unchecked         Do not warn
    * 1                        Checked           Warn if there are incompatibilities
    * 2                        Checked           Warn if there are incompatibilities,
    *                                            or the update is major.
    */
   readAddonWarn: function ()
   {
     var preference = document.getElementById("app.update.mode");
-    var doNotWarn = preference.value != 0;
-    gAdvancedPane._modePreference = doNotWarn ? preference.value : 1;
-    return doNotWarn;
+    var warn = preference.value != 0;
+    gAdvancedPane._modePreference = warn ? preference.value : 1;
+    return warn;
   },
 
   /**
    * Converts the state of the "Warn me if this will disable extensions or
    * themes" checkbox into the integer preference which represents it,
    * returning that value.
    */
   writeAddonWarn: function ()
@@ -586,26 +593,26 @@ var gAdvancedPane = {
     var prompter = Components.classes["@mozilla.org/updates/update-prompt;1"]
                              .createInstance(Components.interfaces.nsIUpdatePrompt);
     prompter.showUpdateHistory(window);
   },
 #endif
 
   /**
    * The Extensions checkbox and button are disabled only if the enable Addon
-   * update preference is locked. 
+   * update preference is locked.
    */
   updateAddonUpdateUI: function ()
   {
     var enabledPref = document.getElementById("extensions.update.enabled");
     var enableAddonUpdate = document.getElementById("enableAddonUpdate");
 
     enableAddonUpdate.disabled = enabledPref.locked;
-  },  
-  
+  },
+
   // ENCRYPTION TAB
 
   /*
    * Preferences:
    *
    * security.enable_ssl3
    * - true if SSL 3 encryption is enabled, false otherwise
    * security.enable_tls
--- a/browser/components/preferences/advanced.xul
+++ b/browser/components/preferences/advanced.xul
@@ -20,16 +20,17 @@
 # Ben Goodger.
 # Portions created by the Initial Developer are Copyright (C) 2005
 # the Initial Developer. All Rights Reserved.
 #
 # Contributor(s):
 #   Ben Goodger <ben@mozilla.org>
 #   Jeff Walden <jwalden+code@mit.edu>
 #   Ehsan Akhgari <ehsan.akhgari@gmail.com>
+#   Steffen Wilberg <steffen.wilberg@web.de>
 #
 # 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
@@ -95,25 +96,19 @@
  
       <preference id="browser.cache.disk.smart_size.enabled"
                   name="browser.cache.disk.smart_size.enabled"
                   inverted="true"
                   type="bool"/>
  
      <!-- Update tab -->
 #ifdef MOZ_UPDATER
-      <preference id="app.update.enabled"              name="app.update.enabled"              type="bool"
-                  onchange="gAdvancedPane.updateAppUpdateItems();
-                            gAdvancedPane.updateAutoItems();
-                            gAdvancedPane.updateModeItems();"/>
-      <preference id="app.update.auto"                 name="app.update.auto"                 type="bool"
-                  onchange="gAdvancedPane.updateAutoItems();
-                            gAdvancedPane.updateModeItems();"/>
-      <preference id="app.update.mode"                 name="app.update.mode"                 type="int"
-                  onchange="gAdvancedPane.updateModeItems();"/>
+      <preference id="app.update.enabled"              name="app.update.enabled"              type="bool"/>
+      <preference id="app.update.auto"                 name="app.update.auto"                 type="bool"/>
+      <preference id="app.update.mode"                 name="app.update.mode"                 type="int"/>
 
       <preference id="app.update.disable_button.showUpdateHistory"
                   name="app.update.disable_button.showUpdateHistory"
                   type="bool"/>
 #endif
 
       <preference id="extensions.update.enabled"       name="extensions.update.enabled"       type="bool"
                   onchange="gAdvancedPane.updateAddonUpdateUI();"/>
@@ -294,65 +289,61 @@
                         accesskey="&offlineAppsListRemove.accesskey;" 
                         oncommand="gAdvancedPane.removeOfflineApp();"/>
               </vbox>
             </hbox>
           </groupbox>
         </tabpanel>
 
         <!-- Update -->
-        <tabpanel id="updatePanel" orient="vertical" align="start">
-          <label control="autoUpdateGroup">&autoCheck.label;</label>
-          <vbox class="indent" id="autoUpdateGroup" role="group">
+        <tabpanel id="updatePanel" orient="vertical">
 #ifdef MOZ_UPDATER
-            <checkbox id="enableAppUpdate"
-                      label="&enableAppUpdate.label;"
-                      accesskey="&enableAppUpdate.accesskey;"
-                      preference="app.update.enabled"/>
+          <groupbox id="updateApp">
+            <caption label="&updateApp.label;"/>
+            <radiogroup id="updateRadioGroup"
+                        oncommand="gAdvancedPane.updateWritePrefs();">
+              <radio value="auto"
+                     label="&updateAuto.label;"
+                     accesskey="&updateAuto.accesskey;"/>
+              <hbox class="indent">
+                <checkbox id="warnIncompatible"
+                          label="&updateAutoAddonWarn.label;"
+                          accesskey="&updateAutoAddonWarn.accesskey;"
+                          preference="app.update.mode"
+                          onsyncfrompreference="return gAdvancedPane.readAddonWarn();"
+                          onsynctopreference="return gAdvancedPane.writeAddonWarn();"/>
+              </hbox>
+              <radio value="checkOnly"
+                     label="&updateCheck.label;"
+                     accesskey="&updateCheck.accesskey;"/>
+              <radio value="manual"
+                     label="&updateManual.label;"
+                     accesskey="&updateManual.accesskey;"/>
+            </radiogroup>
+
+            <hbox>
+              <button id="showUpdateHistory"
+                      label="&updateHistory.label;"
+                      accesskey="&updateHistory.accesskey;"
+                      preference="app.update.disable_button.showUpdateHistory"
+                      oncommand="gAdvancedPane.showUpdates();"/>
+            </hbox>
+          </groupbox>
 #endif
+          <groupbox id="updateOthers">
+            <caption label="&updateOthers.label;"/>
             <checkbox id="enableAddonUpdate"
-                      label="&enableAddonsUpdate2.label;"
-                      accesskey="&enableAddonsUpdate2.accesskey;"
+                      label="&enableAddonsUpdate3.label;"
+                      accesskey="&enableAddonsUpdate3.accesskey;"
                       preference="extensions.update.enabled"/>
             <checkbox id="enableSearchUpdate"
                       label="&enableSearchUpdate.label;"
                       accesskey="&enableSearchUpdate.accesskey;"
                       preference="browser.search.update"/>
-          </vbox>
-
-#ifdef MOZ_UPDATER
-          <separator id="updateSeparator1"/>
-
-          <label id="updateModeLabel" control="updateMode">&whenUpdatesFound.label;</label>
-          <radiogroup id="updateMode" class="indent"
-                      preference="app.update.auto">
-            <radio id="ask" value="false"
-                   label="&askMe.label;"
-                   accesskey="&askMe.accesskey;"/>
-            <radio id="automatic" value="true"
-                   label="&modeAutomatic.label;"
-                   accesskey="&modeAutomatic.accesskey;"/>
-            <hbox class="indent">
-              <checkbox id="warnIncompatible" 
-                        label="&modeAutoAddonWarn.label;" accesskey="&modeAutoAddonWarn.accesskey;"
-                        preference="app.update.mode"
-                        onsyncfrompreference="return gAdvancedPane.readAddonWarn();"
-                        onsynctopreference="return gAdvancedPane.writeAddonWarn();"/>
-            </hbox>
-          </radiogroup>
-
-          <separator id="updateSeparator2"/>
-
-          <hbox>
-            <button id="showUpdateHistory" 
-                    label="&updateHistory.label;" accesskey="&updateHistory.accesskey;"
-                    preference="app.update.disable_button.showUpdateHistory"
-                    oncommand="gAdvancedPane.showUpdates();"/>
-          </hbox>
-#endif
+          </groupbox>
         </tabpanel>
 
         <!-- Encryption -->
         <tabpanel id="encryptionPanel" orient="vertical">
 
           <!-- Protocols -->
           <groupbox id="protocolsGroup">
             <caption label="&protocols.label;"/>
--- a/browser/components/shell/src/nsGNOMEShellService.cpp
+++ b/browser/components/shell/src/nsGNOMEShellService.cpp
@@ -29,16 +29,18 @@
  * 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 "nsCOMPtr.h"
 #include "nsGNOMEShellService.h"
 #include "nsShellService.h"
 #include "nsIServiceManager.h"
 #include "nsILocalFile.h"
 #include "nsIProperties.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsIPrefService.h"
@@ -63,16 +65,18 @@
 #include <glib.h>
 #include <glib-object.h>
 #include <gtk/gtk.h>
 #include <gdk/gdk.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
 #include <limits.h>
 #include <stdlib.h>
 
+using namespace mozilla;
+
 struct ProtocolAssociation
 {
   const char *name;
   bool essential;
 };
 
 struct MimeTypeAssociation
 {
@@ -234,17 +238,17 @@ nsGNOMEShellService::IsDefaultBrowser(bo
 
   nsCOMPtr<nsIGConfService> gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
   nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
 
   bool enabled;
   nsCAutoString handler;
   nsCOMPtr<nsIGIOMimeApp> gioApp;
 
-  for (unsigned int i = 0; i < NS_ARRAY_LENGTH(appProtocols); ++i) {
+  for (unsigned int i = 0; i < ArrayLength(appProtocols); ++i) {
     if (!appProtocols[i].essential)
       continue;
 
     if (gconf) {
       handler.Truncate();
       gconf->GetAppForProtocol(nsDependentCString(appProtocols[i].name),
                                &enabled, handler);
 
@@ -290,17 +294,17 @@ nsGNOMEShellService::SetDefaultBrowser(b
       appKeyValue = tmp;
       g_free(tmp);
     } else {
       appKeyValue = mAppPath;
     }
 
     appKeyValue.AppendLiteral(" %s");
 
-    for (unsigned int i = 0; i < NS_ARRAY_LENGTH(appProtocols); ++i) {
+    for (unsigned int i = 0; i < ArrayLength(appProtocols); ++i) {
       if (appProtocols[i].essential || aClaimAllTypes) {
         gconf->SetAppForProtocol(nsDependentCString(appProtocols[i].name),
                                  appKeyValue);
       }
     }
   }
 
   if (giovfs) {
@@ -323,26 +327,26 @@ nsGNOMEShellService::SetDefaultBrowser(b
     NS_ConvertUTF16toUTF8 id(brandShortName);
     nsCOMPtr<nsIGIOMimeApp> appInfo;
     rv = giovfs->CreateAppFromCommand(mAppPath,
                                       id,
                                       getter_AddRefs(appInfo));
     NS_ENSURE_SUCCESS(rv, rv);
 
     // set handler for the protocols
-    for (unsigned int i = 0; i < NS_ARRAY_LENGTH(appProtocols); ++i) {
+    for (unsigned int i = 0; i < ArrayLength(appProtocols); ++i) {
       if (appProtocols[i].essential || aClaimAllTypes) {
         appInfo->SetAsDefaultForURIScheme(nsDependentCString(appProtocols[i].name));
       }
     }
 
     // set handler for .html and xhtml files and MIME types:
     if (aClaimAllTypes) {
       // Add mime types for html, xhtml extension and set app to just created appinfo.
-      for (unsigned int i = 0; i < NS_ARRAY_LENGTH(appTypes); ++i) {
+      for (unsigned int i = 0; i < ArrayLength(appTypes); ++i) {
         appInfo->SetAsDefaultForMimeType(nsDependentCString(appTypes[i].mimeType));
         appInfo->SetAsDefaultForFileExtensions(nsDependentCString(appTypes[i].extensions));
       }
     }
   }
 
   return NS_OK;
 }
--- a/browser/components/shell/src/nsWindowsShellService.cpp
+++ b/browser/components/shell/src/nsWindowsShellService.cpp
@@ -435,44 +435,49 @@ nsWindowsShellService::SetDefaultBrowser
   }
 
   return LaunchHelper(appHelperPath);
 }
 
 NS_IMETHODIMP
 nsWindowsShellService::GetShouldCheckDefaultBrowser(bool* aResult)
 {
+  NS_ENSURE_ARG_POINTER(aResult);
+
   // If we've already checked, the browser has been started and this is a 
   // new window open, and we don't want to check again.
   if (mCheckedThisSession) {
     *aResult = PR_FALSE;
     return NS_OK;
   }
 
   nsCOMPtr<nsIPrefBranch> prefs;
-  nsCOMPtr<nsIPrefService> pserve(do_GetService(NS_PREFSERVICE_CONTRACTID));
-  if (pserve)
-    pserve->GetBranch("", getter_AddRefs(prefs));
+  nsresult rv;
+  nsCOMPtr<nsIPrefService> pserve(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
+  NS_ENSURE_SUCCESS(rv, rv);
 
-  prefs->GetBoolPref(PREF_CHECKDEFAULTBROWSER, aResult);
+  rv = pserve->GetBranch("", getter_AddRefs(prefs));
+  NS_ENSURE_SUCCESS(rv, rv);
 
-  return NS_OK;
+  return prefs->GetBoolPref(PREF_CHECKDEFAULTBROWSER, aResult);
 }
 
 NS_IMETHODIMP
 nsWindowsShellService::SetShouldCheckDefaultBrowser(bool aShouldCheck)
 {
   nsCOMPtr<nsIPrefBranch> prefs;
-  nsCOMPtr<nsIPrefService> pserve(do_GetService(NS_PREFSERVICE_CONTRACTID));
-  if (pserve)
-    pserve->GetBranch("", getter_AddRefs(prefs));
+  nsresult rv;
 
-  prefs->SetBoolPref(PREF_CHECKDEFAULTBROWSER, aShouldCheck);
+  nsCOMPtr<nsIPrefService> pserve(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
+  NS_ENSURE_SUCCESS(rv, rv);
+  
+  rv = pserve->GetBranch("", getter_AddRefs(prefs));
+  NS_ENSURE_SUCCESS(rv, rv);
 
-  return NS_OK;
+  return prefs->SetBoolPref(PREF_CHECKDEFAULTBROWSER, aShouldCheck);
 }
 
 static nsresult
 WriteBitmap(nsIFile* aFile, imgIContainer* aImage)
 {
   nsRefPtr<gfxImageSurface> image;
   nsresult rv = aImage->CopyFrame(imgIContainer::FRAME_FIRST,
                                   imgIContainer::FLAG_SYNC_DECODE,
--- a/browser/config/mozconfigs/linux32/debug
+++ b/browser/config/mozconfigs/linux32/debug
@@ -1,28 +1,16 @@
-ac_add_options --enable-application=browser
-
 ac_add_options --enable-debug
-ac_add_options --enable-libxul
-
-ac_add_options --enable-tests
 ac_add_options --enable-trace-malloc
 
 CC=/tools/gcc-4.5/bin/gcc
 CXX=/tools/gcc-4.5/bin/g++
 # Avoid dependency on libstdc++ 4.5
 ac_add_options --enable-stdcxx-compat
 
-export CFLAGS="-gdwarf-2"
-export CXXFLAGS="-gdwarf-2"
-
-# For NSS symbols
-export MOZ_DEBUG_SYMBOLS=1
-ac_add_options --enable-debug-symbols="-gdwarf-2"
-
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 # Enable parallel compiling
 mk_add_options MOZ_MAKE_FLAGS="-j4"
 
 #Use ccache
 ac_add_options --with-ccache=/usr/bin/ccache
--- a/browser/config/mozconfigs/linux32/l10n-mozconfig
+++ b/browser/config/mozconfigs/linux32/l10n-mozconfig
@@ -1,8 +1,7 @@
 ac_add_options --with-l10n-base=../../l10n-central
-ac_add_options --enable-application=browser
 ac_add_options --enable-official-branding
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
 
 CC=/tools/gcc-4.3.3/installed/bin/gcc
 CXX=/tools/gcc-4.3.3/installed/bin/g++
--- a/browser/config/mozconfigs/linux32/nightly
+++ b/browser/config/mozconfigs/linux32/nightly
@@ -1,31 +1,20 @@
-ac_add_options --enable-application=browser
-ac_add_options --enable-optimize
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
-ac_add_options --disable-debug
-ac_add_options --enable-tests
 ac_add_options --enable-codesighs
 
 # Nightlies only since this has a cost in performance
 ac_add_options --enable-js-diagnostics
 
 CC=/tools/gcc-4.5/bin/gcc
 CXX=/tools/gcc-4.5/bin/g++
 # Avoid dependency on libstdc++ 4.5
 ac_add_options --enable-stdcxx-compat
 
-export CFLAGS="-gdwarf-2"
-export CXXFLAGS="-gdwarf-2"
-
-# For NSS symbols
-export MOZ_DEBUG_SYMBOLS=1
-ac_add_options --enable-debug-symbols="-gdwarf-2"
-
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 export MOZ_TELEMETRY_REPORTING=1
 
 # PGO
 mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) @MOZ_OBJDIR@/_profile/pgo/profileserver.py 10'
 
--- a/browser/config/mozconfigs/linux32/qt
+++ b/browser/config/mozconfigs/linux32/qt
@@ -1,28 +1,16 @@
-ac_add_options --enable-application=browser
-ac_add_options --enable-optimize
-
 ac_add_options --enable-update-packaging
-ac_add_options --disable-debug
-ac_add_options --enable-tests
 ac_add_options --enable-codesighs
 
 CC=/tools/gcc-4.5/bin/gcc
 CXX=/tools/gcc-4.5/bin/g++
 # Avoid dependency on libstdc++ 4.5
 ac_add_options --enable-stdcxx-compat
 
-export CFLAGS="-gdwarf-2"
-export CXXFLAGS="-gdwarf-2"
-
-# For NSS symbols
-export MOZ_DEBUG_SYMBOLS=1
-ac_add_options --enable-debug-symbols="-gdwarf-2"
-
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 # PGO
 mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) @MOZ_OBJDIR@/_profile/pgo/profileserver.py 10'
 
 # Enable parallel compiling
 mk_add_options MOZ_MAKE_FLAGS="-j4"
--- a/browser/config/mozconfigs/linux32/release
+++ b/browser/config/mozconfigs/linux32/release
@@ -1,28 +1,17 @@
-ac_add_options --enable-application=browser
-ac_add_options --enable-optimize
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
-ac_add_options --disable-debug
-ac_add_options --enable-tests
 ac_add_options --enable-official-branding
 
 CC=/tools/gcc-4.5/bin/gcc
 CXX=/tools/gcc-4.5/bin/g++
 # Avoid dependency on libstdc++ 4.5
 ac_add_options --enable-stdcxx-compat
 
-export CFLAGS="-gdwarf-2"
-export CXXFLAGS="-gdwarf-2"
-
-# For NSS symbols
-export MOZ_DEBUG_SYMBOLS=1
-ac_add_options --enable-debug-symbols="-gdwarf-2"
-
 # PGO
 mk_add_options MOZ_PGO=1
 mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) @MOZ_OBJDIR@/_profile/pgo/profileserver.py 10'
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 export MOZ_TELEMETRY_REPORTING=1
--- a/browser/config/mozconfigs/linux32/rpm
+++ b/browser/config/mozconfigs/linux32/rpm
@@ -1,36 +1,24 @@
-ac_add_options --enable-application=browser
-ac_add_options --enable-optimize
-
 ac_add_options --enable-update-packaging
-ac_add_options --disable-debug
-ac_add_options --enable-tests
 ac_add_options --enable-codesighs
 
 # Options for rpm versions of mozconfigs
 PREFIX=/usr
 LIBDIR=${PREFIX}/lib
 ac_add_options --with-app-name=mozilla-nightly
 ac_add_options --disable-updater
 ac_add_options --prefix=$PREFIX
 ac_add_options --libdir=$LIBDIR
 
 CC=/tools/gcc-4.5/bin/gcc
 CXX=/tools/gcc-4.5/bin/g++
 # Avoid dependency on libstdc++ 4.5
 ac_add_options --enable-stdcxx-compat
 
-export CFLAGS="-gdwarf-2"
-export CXXFLAGS="-gdwarf-2"
-
-# For NSS symbols
-export MOZ_DEBUG_SYMBOLS=1
-ac_add_options --enable-debug-symbols="-gdwarf-2"
-
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 export MOZ_TELEMETRY_REPORTING=1
 
 mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) @MOZ_OBJDIR@/_profile/pgo/profileserver.py'
 
 # Enable parallel compiling
--- a/browser/config/mozconfigs/linux64/debug
+++ b/browser/config/mozconfigs/linux64/debug
@@ -1,24 +1,13 @@
-ac_add_options --enable-application=browser
-
 ac_add_options --enable-debug
-
-ac_add_options --enable-tests
 ac_add_options --enable-trace-malloc
 
 CC=/tools/gcc-4.5/bin/gcc
 CXX=/tools/gcc-4.5/bin/g++
 # Avoid dependency on libstdc++ 4.5
 ac_add_options --enable-stdcxx-compat
 
-#export CFLAGS="-gdwarf-2"
-#export CXXFLAGS="-gdwarf-2"
-
-# For NSS symbols
-export MOZ_DEBUG_SYMBOLS=1
-ac_add_options --enable-debug-symbols="-gdwarf-2"
-
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 # Enable parallel compiling
 mk_add_options MOZ_MAKE_FLAGS="-j4"
--- a/browser/config/mozconfigs/linux64/l10n-mozconfig
+++ b/browser/config/mozconfigs/linux64/l10n-mozconfig
@@ -1,8 +1,7 @@
 ac_add_options --with-l10n-base=../../l10n-central
-ac_add_options --enable-application=browser
 ac_add_options --enable-official-branding
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
 
 CC=/tools/gcc/bin/gcc
 CXX=/tools/gcc/bin/g++
--- a/browser/config/mozconfigs/linux64/nightly
+++ b/browser/config/mozconfigs/linux64/nightly
@@ -1,31 +1,20 @@
-ac_add_options --enable-application=browser
-ac_add_options --enable-optimize
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
-ac_add_options --disable-debug
-ac_add_options --enable-tests
 ac_add_options --enable-codesighs
 
 # Nightlies only since this has a cost in performance
 ac_add_options --enable-js-diagnostics
 
 CC=/tools/gcc-4.5/bin/gcc
 CXX=/tools/gcc-4.5/bin/g++
 # Avoid dependency on libstdc++ 4.5
 ac_add_options --enable-stdcxx-compat
 
-export CFLAGS="-gdwarf-2"
-export CXXFLAGS="-gdwarf-2"
-
-# For NSS symbols
-export MOZ_DEBUG_SYMBOLS=1
-ac_add_options --enable-debug-symbols="-gdwarf-2"
-
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 export MOZ_TELEMETRY_REPORTING=1
 
 # PGO
 mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) @MOZ_OBJDIR@/_profile/pgo/profileserver.py 10'
 
--- a/browser/config/mozconfigs/linux64/release
+++ b/browser/config/mozconfigs/linux64/release
@@ -1,28 +1,17 @@
-ac_add_options --enable-application=browser
-ac_add_options --enable-optimize
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
-ac_add_options --disable-debug
-ac_add_options --enable-tests
 ac_add_options --enable-official-branding
 
 CC=/tools/gcc-4.5/bin/gcc
 CXX=/tools/gcc-4.5/bin/g++
 # Avoid dependency on libstdc++ 4.5
 ac_add_options --enable-stdcxx-compat
 
-export CFLAGS="-gdwarf-2"
-export CXXFLAGS="-gdwarf-2"
-
-# For NSS symbols
-export MOZ_DEBUG_SYMBOLS=1
-ac_add_options --enable-debug-symbols="-gdwarf-2"
-
 # PGO
 mk_add_options MOZ_PGO=1
 mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) @MOZ_OBJDIR@/_profile/pgo/profileserver.py 10'
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 export MOZ_TELEMETRY_REPORTING=1
--- a/browser/config/mozconfigs/linux64/rpm
+++ b/browser/config/mozconfigs/linux64/rpm
@@ -1,36 +1,24 @@
-ac_add_options --enable-application=browser
-ac_add_options --enable-optimize
-
 ac_add_options --enable-update-packaging
-ac_add_options --disable-debug
-ac_add_options --enable-tests
 ac_add_options --enable-codesighs
 
 # Options for rpm versions of mozconfigs
 PREFIX=/usr
 LIBDIR=${PREFIX}/lib64
 ac_add_options --with-app-name=mozilla-nightly
 ac_add_options --disable-updater
 ac_add_options --prefix=$PREFIX
 ac_add_options --libdir=$LIBDIR
 
 CC=/tools/gcc-4.5/bin/gcc
 CXX=/tools/gcc-4.5/bin/g++
 # Avoid dependency on libstdc++ 4.5
 ac_add_options --enable-stdcxx-compat
 
-export CFLAGS="-gdwarf-2"
-export CXXFLAGS="-gdwarf-2"
-
-# For NSS symbols
-export MOZ_DEBUG_SYMBOLS=1
-ac_add_options --enable-debug-symbols="-gdwarf-2"
-
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 export MOZ_TELEMETRY_REPORTING=1
 
 mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) @MOZ_OBJDIR@/_profile/pgo/profileserver.py'
 
 # Enable parallel compiling
--- a/browser/config/mozconfigs/macosx-universal/nightly
+++ b/browser/config/mozconfigs/macosx-universal/nightly
@@ -1,24 +1,18 @@
 . $topsrcdir/build/macosx/universal/mozconfig
 
+# Universal builds override the default of browser (bug 575283 comment 29)
 ac_add_options --enable-application=browser
+
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
-ac_add_options --enable-tests
 ac_add_options --enable-codesighs
 ac_add_options --disable-install-strip
 
 # Nightlies only since this has a cost in performance
 ac_add_options --enable-js-diagnostics
 
-export CFLAGS="-gdwarf-2"
-export CXXFLAGS="-gdwarf-2"
-
-# For NSS symbols
-export MOZ_DEBUG_SYMBOLS=1
-ac_add_options --enable-debug-symbols="-gdwarf-2"
-
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 export MOZ_TELEMETRY_REPORTING=1
 mk_add_options MOZ_MAKE_FLAGS="-j4"
--- a/browser/config/mozconfigs/macosx-universal/release
+++ b/browser/config/mozconfigs/macosx-universal/release
@@ -1,19 +1,13 @@
 . $topsrcdir/build/macosx/universal/mozconfig
 
+# Universal builds override the default of browser (bug 575283 comment 29)
 ac_add_options --enable-application=browser
+
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
-ac_add_options --enable-tests
 ac_add_options --enable-official-branding
 
-export CFLAGS="-gdwarf-2"
-export CXXFLAGS="-gdwarf-2"
-
-# For NSS symbols
-export MOZ_DEBUG_SYMBOLS=1
-ac_add_options --enable-debug-symbols="-gdwarf-2"
-
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 export MOZ_TELEMETRY_REPORTING=1
--- a/browser/config/mozconfigs/macosx-universal/shark
+++ b/browser/config/mozconfigs/macosx-universal/shark
@@ -1,28 +1,22 @@
 # Just like nightlies, but without tests, not on an update channel, and with
 # shark and dtrace enabled
 . $topsrcdir/build/macosx/universal/mozconfig
 
+# Universal builds override the default of browser (bug 575283 comment 29)
 ac_add_options --enable-application=browser
+
 ac_add_options --disable-tests
 ac_add_options --disable-install-strip
 
-export CFLAGS="-gdwarf-2"
-export CXXFLAGS="-gdwarf-2"
-
-# For NSS symbols
-export MOZ_DEBUG_SYMBOLS=1
-ac_add_options --enable-debug-symbols="-gdwarf-2"
-
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 # Enable parallel compiling
 mk_add_options MOZ_MAKE_FLAGS="-j4"
 
 # shark specific options
 ac_add_options --enable-shark
 ac_add_options --enable-dtrace
-ac_add_options --enable-debugger-info-modules
 
 # Need this to prevent name conflicts with the normal nightly build packages
 export MOZ_PKG_SPECIAL="shark"
--- a/browser/config/mozconfigs/macosx32/debug
+++ b/browser/config/mozconfigs/macosx32/debug
@@ -1,21 +1,12 @@
 # Don't use the standard mozconfig. We don't want universal for a debug build. 
 #. $topsrcdir/build/macosx/universal/mozconfig
 
 ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.5.sdk
-
 ac_add_options --enable-debug
-ac_add_options --enable-libxul
-
-ac_add_options --enable-application=browser
-ac_add_options --enable-tests
 ac_add_options --enable-trace-malloc
 
-# For NSS symbols
-export MOZ_DEBUG_SYMBOLS=1
-ac_add_options --enable-debug-symbols="-gdwarf-2"
-
 # Enable parallel compiling
 mk_add_options MOZ_MAKE_FLAGS="-j4"
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
--- a/browser/config/mozconfigs/macosx64/debug
+++ b/browser/config/mozconfigs/macosx64/debug
@@ -1,17 +1,9 @@
 ac_add_options --enable-debug
-ac_add_options --enable-libxul
-
-ac_add_options --enable-application=browser
-ac_add_options --enable-tests
 ac_add_options --enable-trace-malloc
 ac_add_options --enable-accessibility
 
-# For NSS symbols
-export MOZ_DEBUG_SYMBOLS=1
-ac_add_options --enable-debug-symbols="-gdwarf-2"
-
 # Enable parallel compiling
 mk_add_options MOZ_MAKE_FLAGS="-j4"
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
--- a/browser/config/mozconfigs/macosx64/l10n-mozconfig
+++ b/browser/config/mozconfigs/macosx64/l10n-mozconfig
@@ -1,5 +1,4 @@
 ac_add_options --with-l10n-base=../../l10n-central
-ac_add_options --enable-application=browser
 ac_add_options --enable-official-branding
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
--- a/browser/config/mozconfigs/win32/debug
+++ b/browser/config/mozconfigs/win32/debug
@@ -1,14 +1,7 @@
-ac_add_options --enable-application=browser
-ac_add_options --enable-jemalloc
 ac_add_options --enable-debug
-ac_add_options --enable-libxul
 ac_add_options --enable-trace-malloc
-ac_add_options --enable-tests
-
-# For NSS symbols
-export MOZ_DEBUG_SYMBOLS=1
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 mk_add_options MOZ_MAKE_FLAGS=-j1
--- a/browser/config/mozconfigs/win32/l10n-mozconfig
+++ b/browser/config/mozconfigs/win32/l10n-mozconfig
@@ -1,5 +1,4 @@
-ac_add_options --enable-application=browser
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
 ac_add_options --enable-official-branding
 ac_add_options --with-l10n-base=../../l10n-central
--- a/browser/config/mozconfigs/win32/nightly
+++ b/browser/config/mozconfigs/win32/nightly
@@ -1,21 +1,16 @@
 # for pgo
 mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) $(MOZ_OBJDIR)/_profile/pgo/profileserver.py'
 
-ac_add_options --enable-application=browser
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
 ac_add_options --enable-jemalloc
-ac_add_options --enable-tests
 
 # Nightlies only since this has a cost in performance
 ac_add_options --enable-js-diagnostics
 
-# For NSS symbols
-export MOZ_DEBUG_SYMBOLS=1
-
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 export MOZ_TELEMETRY_REPORTING=1
 
 mk_add_options MOZ_MAKE_FLAGS=-j1
--- a/browser/config/mozconfigs/win32/release
+++ b/browser/config/mozconfigs/win32/release
@@ -1,18 +1,13 @@
 # for pgo
 mk_add_options MOZ_PGO=1
 mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) $(MOZ_OBJDIR)/_profile/pgo/profileserver.py'
 
-ac_add_options --enable-application=browser
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
 ac_add_options --enable-jemalloc
-ac_add_options --enable-tests
 ac_add_options --enable-official-branding
 
-# For NSS symbols
-export MOZ_DEBUG_SYMBOLS=1
-
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 export MOZ_TELEMETRY_REPORTING=1
--- a/browser/config/mozconfigs/win64/debug
+++ b/browser/config/mozconfigs/win64/debug
@@ -1,13 +1,10 @@
 ac_add_options --target=x86_64-pc-mingw32
 ac_add_options --host=x86_64-pc-mingw32
 
-ac_add_options --enable-application=browser
-ac_add_options --enable-jemalloc
 ac_add_options --enable-debug
-ac_add_options --enable-libxul
 ac_add_options --enable-trace-malloc
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 mk_add_options MOZ_MAKE_FLAGS=-j1
--- a/browser/config/mozconfigs/win64/nightly
+++ b/browser/config/mozconfigs/win64/nightly
@@ -1,19 +1,17 @@
 ac_add_options --target=x86_64-pc-mingw32
 ac_add_options --host=x86_64-pc-mingw32
 
 # for pgo
 mk_add_options PROFILE_GEN_SCRIPT='$(PYTHON) $(MOZ_OBJDIR)/_profile/pgo/profileserver.py'
 
-ac_add_options --enable-application=browser
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 ac_add_options --enable-update-packaging
 ac_add_options --enable-jemalloc
-ac_add_options --enable-debug-symbols
 
 # Nightlies only since this has a cost in performance
 ac_add_options --enable-js-diagnostics
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 export MOZ_TELEMETRY_REPORTING=1
--- a/browser/devtools/jar.mn
+++ b/browser/devtools/jar.mn
@@ -1,9 +1,10 @@
 browser.jar:
 *   content/browser/inspector.html                (highlighter/inspector.html)
     content/browser/NetworkPanel.xhtml            (webconsole/NetworkPanel.xhtml)
 *   content/browser/scratchpad.xul                (scratchpad/scratchpad.xul)
 *   content/browser/scratchpad.js                 (scratchpad/scratchpad.js)
     content/browser/csshtmltree.xhtml             (styleinspector/csshtmltree.xhtml)
     content/browser/orion.js                      (sourceeditor/orion/orion.js)
     content/browser/orion.css                     (sourceeditor/orion/orion.css)
+    content/browser/orion-mozilla.css             (sourceeditor/orion/mozilla.css)
 
--- a/browser/devtools/shared/Makefile.in
+++ b/browser/devtools/shared/Makefile.in
@@ -7,25 +7,27 @@
 # 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  HUDService code.
+# The Original Code is the Style Inspector.
 #
-# The Initial Developer of the Original Code is Mozilla Corporation.
-# 
-# Portions created by the Initial Developer are Copyright (C) 2010
+# The Initial Developer of the Original Code is
+# The Mozilla Foundation.
+#
+# Portions created by the Initial Developer are Copyright (C) 2011
 # the Initial Developer. All Rights Reserved.
 #
 # Contributor(s):
-#     Mike Ratcliffe <mratcliffe@mozilla.com>  (Original author)
+#   Mike Ratcliffe <mratcliffe@mozilla.com> (Original author)
+#   Joe Walker <jwalker@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
@@ -39,17 +41,16 @@
 DEPTH		= ../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 ifdef ENABLE_TESTS
-ifneq (mobile,$(MOZ_BUILD_APP))
-	# DIRS += test # no tests yet
-endif
+	DIRS += test
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 libs::
 	$(NSINSTALL) $(srcdir)/Templater.jsm $(FINAL_TARGET)/modules/devtools
+	$(NSINSTALL) $(srcdir)/Promise.jsm $(FINAL_TARGET)/modules/devtools
new file mode 100644
--- /dev/null
+++ b/browser/devtools/shared/Promise.jsm
@@ -0,0 +1,215 @@
+/*
+ * Copyright 2009-2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE.txt or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+
+var EXPORTED_SYMBOLS = [ "Promise" ];
+
+/**
+ * Create an unfulfilled promise
+ * @constructor
+ */
+function Promise() {
+  this._status = Promise.PENDING;
+  this._value = undefined;
+  this._onSuccessHandlers = [];
+  this._onErrorHandlers = [];
+
+  // Debugging help
+  this._id = Promise._nextId++;
+  Promise._outstanding[this._id] = this;
+}
+
+/**
+ * We give promises and ID so we can track which are outstanding
+ */
+Promise._nextId = 0;
+
+/**
+ * Outstanding promises. Handy list for debugging only
+ */
+Promise._outstanding = [];
+
+/**
+ * Recently resolved promises. Also for debugging only
+ */
+Promise._recent = [];
+
+/**
+ * A promise can be in one of 2 states.
+ * The ERROR and SUCCESS states are terminal, the PENDING state is the only
+ * start state.
+ */
+Promise.ERROR = -1;
+Promise.PENDING = 0;
+Promise.SUCCESS = 1;
+
+/**
+ * Yeay for RTTI
+ */
+Promise.prototype.isPromise = true;
+
+/**
+ * Have we either been resolve()ed or reject()ed?
+ */
+Promise.prototype.isComplete = function() {
+  return this._status != Promise.PENDING;
+};
+
+/**
+ * Have we resolve()ed?
+ */
+Promise.prototype.isResolved = function() {
+  return this._status == Promise.SUCCESS;
+};
+
+/**
+ * Have we reject()ed?
+ */
+Promise.prototype.isRejected = function() {
+  return this._status == Promise.ERROR;
+};
+
+/**
+ * Take the specified action of fulfillment of a promise, and (optionally)
+ * a different action on promise rejection
+ */
+Promise.prototype.then = function(onSuccess, onError) {
+  if (typeof onSuccess === 'function') {
+    if (this._status === Promise.SUCCESS) {
+      onSuccess.call(null, this._value);
+    }
+    else if (this._status === Promise.PENDING) {
+      this._onSuccessHandlers.push(onSuccess);
+    }
+  }
+
+  if (typeof onError === 'function') {
+    if (this._status === Promise.ERROR) {
+      onError.call(null, this._value);
+    }
+    else if (this._status === Promise.PENDING) {
+      this._onErrorHandlers.push(onError);
+    }
+  }
+
+  return this;
+};
+
+/**
+ * Like then() except that rather than returning <tt>this</tt> we return
+ * a promise which resolves when the original promise resolves
+ */
+Promise.prototype.chainPromise = function(onSuccess) {
+  var chain = new Promise();
+  chain._chainedFrom = this;
+  this.then(function(data) {
+    try {
+      chain.resolve(onSuccess(data));
+    }
+    catch (ex) {
+      chain.reject(ex);
+    }
+  }, function(ex) {
+    chain.reject(ex);
+  });
+  return chain;
+};
+
+/**
+ * Supply the fulfillment of a promise
+ */
+Promise.prototype.resolve = function(data) {
+  return this._complete(this._onSuccessHandlers,
+                        Promise.SUCCESS, data, 'resolve');
+};
+
+/**
+ * Renege on a promise
+ */
+Promise.prototype.reject = function(data) {
+  return this._complete(this._onErrorHandlers, Promise.ERROR, data, 'reject');
+};
+
+/**
+ * Internal method to be called on resolve() or reject()
+ * @private
+ */
+Promise.prototype._complete = function(list, status, data, name) {
+  // Complain if we've already been completed
+  if (this._status != Promise.PENDING) {
+    if (typeof 'console' === 'object') {
+      console.error('Promise complete. Attempted ' + name + '() with ', data);
+      console.error('Prev status = ', this._status, ', value = ', this._value);
+    }
+    throw new Error('Promise already complete');
+  }
+
+  this._status = status;
+  this._value = data;
+
+  // Call all the handlers, and then delete them
+  list.forEach(function(handler) {
+    handler.call(null, this._value);
+  }, this);
+  delete this._onSuccessHandlers;
+  delete this._onErrorHandlers;
+
+  // Remove the given {promise} from the _outstanding list, and add it to the
+  // _recent list, pruning more than 20 recent promises from that list
+  delete Promise._outstanding[this._id];
+  // The original code includes this very useful debugging aid, however there
+  // is concern that it will create a memory leak, so we leave it out here.
+  /*
+  Promise._recent.push(this);
+  while (Promise._recent.length > 20) {
+    Promise._recent.shift();
+  }
+  */
+
+  return this;
+};
+
+/**
+ * Takes an array of promises and returns a promise that that is fulfilled once
+ * all the promises in the array are fulfilled
+ * @param promiseList The array of promises
+ * @return the promise that is fulfilled when all the array is fulfilled
+ */
+Promise.group = function(promiseList) {
+  if (!Array.isArray(promiseList)) {
+    promiseList = Array.prototype.slice.call(arguments);
+  }
+
+  // If the original array has nothing in it, return now to avoid waiting
+  if (promiseList.length === 0) {
+    return new Promise().resolve([]);
+  }
+
+  var groupPromise = new Promise();
+  var results = [];
+  var fulfilled = 0;
+
+  var onSuccessFactory = function(index) {
+    return function(data) {
+      results[index] = data;
+      fulfilled++;
+      // If the group has already failed, silently drop extra results
+      if (groupPromise._status !== Promise.ERROR) {
+        if (fulfilled === promiseList.length) {
+          groupPromise.resolve(results);
+        }
+      }
+    };
+  };
+
+  promiseList.forEach(function(promise, index) {
+    var onSuccess = onSuccessFactory(index);
+    var onError = groupPromise.reject.bind(groupPromise);
+    promise.then(onSuccess, onError);
+  });
+
+  return groupPromise;
+};
--- a/browser/devtools/shared/Templater.jsm
+++ b/browser/devtools/shared/Templater.jsm
@@ -1,28 +1,26 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
 /* ***** 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 Bespin.
+ * The Original Code is GCLI
  *
  * The Initial Developer of the Original Code is
  * The Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009
+ * Portions created by the Initial Developer are Copyright (C) 2011
  * the Initial Developer. All Rights Reserved.
  *
  * Contributor(s):
  *   Joe Walker (jwalker@mozilla.com) (original author)
  *   Mike Ratcliffe (mratcliffe@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
@@ -34,24 +32,20 @@
  * 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 ***** */
 
 
-var EXPORTED_SYMBOLS = ["Templater"];
+var EXPORTED_SYMBOLS = [ "Templater" ];
 
-const Ci = Components.interfaces;
-const Cu = Components.utils;
-
-Cu.import("resource://gre/modules/Services.jsm");
-
-const Node = Ci.nsIDOMNode;
+Components.utils.import("resource://gre/modules/Services.jsm");
+const Node = Components.interfaces.nsIDOMNode;
 
 // WARNING: do not 'use_strict' without reading the notes in _envEval();
 
 /**
  * A templater that allows one to quickly template DOM nodes.
  */
 function Templater() {
   this.stack = [];
@@ -258,19 +252,19 @@ Templater.prototype._processForEachLoop 
  * @param paramName The name given to 'member' by the foreach attribute
  * @param frame A name to push on the stack for debugging
  */
 Templater.prototype._processForEachMember = function(member, template, siblingNode, data, paramName, frame) {
   this.stack.push(frame);
   try {
     this._handleAsync(member, siblingNode, function(reply, node) {
       data[paramName] = reply;
-      if (node.nodeName.toLowerCase() === 'loop') {
-        for (var i = 0; i < node.childNodes.length; i++) {
-          var clone = node.childNodes[i].cloneNode(true);
+      if (template.nodeName.toLowerCase() === 'loop') {
+        for (var i = 0; i < template.childNodes.length; i++) {
+          var clone = template.childNodes[i].cloneNode(true);
           node.parentNode.insertBefore(clone, node);
           this.processNode(clone, data);
         }
       } else {
         var clone = template.cloneNode(true);
         clone.removeAttribute('foreach');
         node.parentNode.insertBefore(clone, node);
         this.processNode(clone, data);
@@ -326,17 +320,17 @@ Templater.prototype._processTextNode = f
  * 'typeof thing.cloneNode !== "function"' (is there a better way that will
  * work in all environments, including a .jsm?)
  * Non DOM elements are converted to a string and wrapped in a TextNode.
  */
 Templater.prototype._toNode = function(thing, document) {
   if (thing == null) {
     thing = '' + thing;
   }
-  // if (isDOMElement(reply)) { ... }
+  // if thing isn't a DOM element then wrap its string value in one
   if (typeof thing.cloneNode !== 'function') {
     thing = document.createTextNode(thing.toString());
   }
   return thing;
 };
 
 /**
  * A function to handle the fact that some nodes can be promises, so we check
@@ -382,17 +376,17 @@ Templater.prototype._stripBraces = funct
  * <ul>
  * <li>_property('a.b', { a: { b: 99 }}); // returns 99
  * <li>_property('a', { a: { b: 99 }}); // returns { b: 99 }
  * <li>_property('a', { a: { b: 99 }}, 42); // returns 99 and alters the
  * input data to be { a: { b: 42 }}
  * </ul>
  * @param path An array of strings indicating the path through the data, or
  * a string to be cut into an array using <tt>split('.')</tt>
- * @param data An object to look in for the <tt>path</tt> argument
+ * @param data the data to use for node processing
  * @param newValue (optional) If defined, this value will replace the
  * original value for the data at the path specified.
  * @return The value pointed to by <tt>path</tt> before any
  * <tt>newValue</tt> is applied.
  */
 Templater.prototype._property = function(path, data, newValue) {
   this.stack.push(path);
   try {
@@ -465,9 +459,8 @@ Templater.prototype._handleError = funct
 /**
  * A generic way of reporting errors, for easy overloading in different
  * environments.
  * @param message the error message to report.
  */
 Templater.prototype._logError = function(message) {
   Services.console.logStringMessage(message);
 };
-
new file mode 100644
--- /dev/null
+++ b/browser/devtools/shared/test/Makefile.in
@@ -0,0 +1,63 @@
+#
+# ***** 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 GCLI.
+#
+# The Initial Developer of the Original Code is
+# The Mozilla Foundation.
+#
+# Portions created by the Initial Developer are Copyright (C) 2011
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#   Joe Walker <jwalker@mozilla.com> (Original author)
+#
+# 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 *****
+
+DEPTH     = ../../../..
+topsrcdir = @top_srcdir@
+srcdir    = @srcdir@
+VPATH     = @srcdir@
+relativesrcdir  = browser/devtools/shared/test
+
+include $(DEPTH)/config/autoconf.mk
+include $(topsrcdir)/config/rules.mk
+
+_BROWSER_TEST_FILES = \
+  browser_promise_basic.js \
+  browser_templater_basic.js \
+  head.js \
+  $(NULL)
+
+_BROWSER_TEST_PAGES = \
+  browser_templater_basic.html \
+  $(NULL)
+
+libs:: $(_BROWSER_TEST_FILES)
+	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
+
+libs:: $(_BROWSER_TEST_PAGES)
+	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
new file mode 100644
--- /dev/null
+++ b/browser/devtools/shared/test/browser_promise_basic.js
@@ -0,0 +1,212 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+// Tests that our Promise implementation works properly
+
+Cu.import("resource:///modules/devtools/Promise.jsm");
+
+function test() {
+  addTab("about:blank", function() {
+    info("Starting Promise Tests");
+    testBasic();
+  });
+}
+
+var postResolution;
+
+function testBasic() {
+  postResolution = new Promise();
+  ok(postResolution.isPromise, "We have a promise");
+  ok(!postResolution.isComplete(), "Promise is initially incomplete");
+  ok(!postResolution.isResolved(), "Promise is initially unresolved");
+  ok(!postResolution.isRejected(), "Promise is initially unrejected");
+
+  // Test resolve() *after* then() in the same context
+  var reply = postResolution.then(testPostResolution, fail)
+                            .resolve("postResolution");
+  is(reply, postResolution, "return this; working ok");
+}
+
+var preResolution;
+
+function testPostResolution(data) {
+  is(data, "postResolution", "data is postResolution");
+  ok(postResolution.isComplete(), "postResolution Promise is complete");
+  ok(postResolution.isResolved(), "postResolution Promise is resolved");
+  ok(!postResolution.isRejected(), "postResolution Promise is unrejected");
+
+  try {
+    info("Expected double resolve error");
+    postResolution.resolve("double resolve");
+    ok(false, "double resolve");
+  }
+  catch (ex) {
+    // Expected
+  }
+
+  // Test resolve() *before* then() in the same context
+  preResolution = new Promise();
+  var reply = preResolution.resolve("preResolution")
+                           .then(testPreResolution, fail);
+  is(reply, preResolution, "return this; working ok");
+}
+
+var laterResolution;
+
+function testPreResolution(data) {
+  is(data, "preResolution", "data is preResolution");
+  ok(preResolution.isComplete(), "preResolution Promise is complete");
+  ok(preResolution.isResolved(), "preResolution Promise is resolved");
+  ok(!preResolution.isRejected(), "preResolution Promise is unrejected");
+
+  // Test resolve() *after* then() in a later context
+  laterResolution = new Promise();
+  laterResolution.then(testLaterResolution, fail);
+  executeSoon(function() {
+    laterResolution.resolve("laterResolution");
+  });
+}
+
+var laterRejection;
+
+function testLaterResolution(data) {
+  is(data, "laterResolution", "data is laterResolution");
+  ok(laterResolution.isComplete(), "laterResolution Promise is complete");
+  ok(laterResolution.isResolved(), "laterResolution Promise is resolved");
+  ok(!laterResolution.isRejected(), "laterResolution Promise is unrejected");
+
+  // Test reject() *after* then() in a later context
+  laterRejection = new Promise().then(fail, testLaterRejection);
+  executeSoon(function() {
+    laterRejection.reject("laterRejection");
+  });
+}
+
+function testLaterRejection(data) {
+  is(data, "laterRejection", "data is laterRejection");
+  ok(laterRejection.isComplete(), "laterRejection Promise is complete");
+  ok(!laterRejection.isResolved(), "laterRejection Promise is unresolved");
+  ok(laterRejection.isRejected(), "laterRejection Promise is rejected");
+
+  // Test chaining
+  var orig = new Promise();
+  orig.chainPromise(function(data) {
+    is(data, "origData", "data is origData");
+    return data.replace(/orig/, "new");
+  }).then(function(data) {
+    is(data, "newData", "data is newData");
+    testChain();
+  });
+  orig.resolve("origData");
+}
+
+var member1;
+var member2;
+var member3;
+var laterGroup;
+
+function testChain() {
+  // Test an empty group
+  var empty1 = Promise.group();
+  ok(empty1.isComplete(), "empty1 Promise is complete");
+  ok(empty1.isResolved(), "empty1 Promise is resolved");
+  ok(!empty1.isRejected(), "empty1 Promise is unrejected");
+
+  // Test a group with no members
+  var empty2 = Promise.group([]);
+  ok(empty2.isComplete(), "empty2 Promise is complete");
+  ok(empty2.isResolved(), "empty2 Promise is resolved");
+  ok(!empty2.isRejected(), "empty2 Promise is unrejected");
+
+  // Test grouping using resolve() in a later context
+  member1 = new Promise();
+  member2 = new Promise();
+  member3 = new Promise();
+  laterGroup = Promise.group(member1, member2, member3);
+  laterGroup.then(testLaterGroup, fail);
+
+  member1.then(function(data) {
+    is(data, "member1", "member1 is member1");
+    executeSoon(function() {
+      member2.resolve("member2");
+    });
+  }, fail);
+  member2.then(function(data) {
+    is(data, "member2", "member2 is member2");
+    executeSoon(function() {
+      member3.resolve("member3");
+    });
+  }, fail);
+  member3.then(function(data) {
+    is(data, "member3", "member3 is member3");
+    // The group should now fire
+  }, fail);
+  executeSoon(function() {
+    member1.resolve("member1");
+  });
+}
+
+var tidyGroup;
+
+function testLaterGroup(data) {
+  is(data[0], "member1", "member1 is member1");
+  is(data[1], "member2", "member2 is member2");
+  is(data[2], "member3", "member3 is member3");
+  is(data.length, 3, "data.length is right");
+  ok(laterGroup.isComplete(), "laterGroup Promise is complete");
+  ok(laterGroup.isResolved(), "laterGroup Promise is resolved");
+  ok(!laterGroup.isRejected(), "laterGroup Promise is unrejected");
+
+  // Test grouping resolve() *before* then() in the same context
+  tidyGroup = Promise.group([
+    postResolution, preResolution, laterResolution,
+    member1, member2, member3, laterGroup
+  ]);
+  tidyGroup.then(testTidyGroup, fail);
+}
+
+var failGroup;
+
+function testTidyGroup(data) {
+  is(data[0], "postResolution", "postResolution is postResolution");
+  is(data[1], "preResolution", "preResolution is preResolution");
+  is(data[2], "laterResolution", "laterResolution is laterResolution");
+  is(data[3], "member1", "member1 is member1");
+  is(data[6][1], "member2", "laterGroup is laterGroup");
+  is(data.length, 7, "data.length is right");
+  ok(tidyGroup.isComplete(), "tidyGroup Promise is complete");
+  ok(tidyGroup.isResolved(), "tidyGroup Promise is resolved");
+  ok(!tidyGroup.isRejected(), "tidyGroup Promise is unrejected");
+
+  // Test grouping resolve() *before* then() in the same context
+  failGroup = Promise.group(postResolution, laterRejection);
+  failGroup.then(fail, testFailGroup);
+}
+
+function testFailGroup(data) {
+  is(data, "laterRejection", "laterRejection is laterRejection");
+
+  postResolution = undefined;
+  preResolution = undefined;
+  laterResolution = undefined;
+  member1 = undefined;
+  member2 = undefined;
+  member3 = undefined;
+  laterGroup = undefined;
+  laterRejection = undefined;
+
+  finished();
+}
+
+function fail() {
+  gBrowser.removeCurrentTab();
+  info("Failed Promise Tests");
+  ok(false, "fail called");
+  finish();
+}
+
+function finished() {
+  gBrowser.removeCurrentTab();
+  info("Finishing Promise Tests");
+  finish();
+}
new file mode 100644
--- /dev/null
+++ b/browser/devtools/shared/test/browser_templater_basic.html
@@ -0,0 +1,13 @@
+<!doctype html>
+<!-- Any copyright is dedicated to the Public Domain.
+     http://creativecommons.org/publicdomain/zero/1.0/ -->
+
+<html>
+<head>
+  <title>DOM Template Tests</title>
+</head>
+<body>
+
+</body>
+</html>
+
new file mode 100644
--- /dev/null
+++ b/browser/devtools/shared/test/browser_templater_basic.js
@@ -0,0 +1,207 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+// Tests that the DOM Template engine works properly
+
+Cu.import("resource:///modules/devtools/Templater.jsm");
+Cu.import("resource:///modules/devtools/Promise.jsm");
+
+function test() {
+  addTab("http://example.com/browser/browser/devtools/shared/test/browser_templater_basic.html", function() {
+    info("Starting DOM Templater Tests");
+    runTest(0);
+  });
+}
+
+function runTest(index) {
+  var options = tests[index] = tests[index]();
+  var holder = content.document.createElement('div');
+  holder.id = options.name;
+  var body = content.document.body;
+  body.appendChild(holder);
+  holder.innerHTML = options.template;
+
+  info('Running ' + options.name);
+  new Templater().processNode(holder, options.data);
+
+  if (typeof options.result == 'string') {
+    is(holder.innerHTML, options.result, options.name);
+  }
+  else {
+    ok(holder.innerHTML.match(options.result), options.name);
+  }
+
+  if (options.also) {
+    options.also(options);
+  }
+
+  function runNextTest() {
+    index++;
+    if (index < tests.length) {
+      runTest(index);
+    }
+    else {
+      finished();
+    }
+  }
+
+  if (options.later) {
+    var ais = is.bind(this);
+
+    function createTester(holder, options) {
+      return function() {
+        ais(holder.innerHTML, options.later, options.name + ' later');
+        runNextTest();
+      }.bind(this);
+    }
+
+    executeSoon(createTester(holder, options));
+  }
+  else {
+    runNextTest();
+  }
+}
+
+function finished() {
+  gBrowser.removeCurrentTab();
+  info("Finishing DOM Templater Tests");
+  tests = null;
+  finish();
+}
+
+/**
+ * Why have an array of functions that return data rather than just an array
+ * of the data itself? Some of these tests contain calls to delayReply() which
+ * sets up async processing using executeSoon(). Since the execution of these
+ * tests is asynchronous, the delayed reply will probably arrive before the
+ * test is executed, making the test be synchronous. So we wrap the data in a
+ * function so we only set it up just before we use it.
+ */
+var tests = [
+  function() { return {
+    name: 'simpleNesting',
+    template: '<div id="ex1">${nested.value}</div>',
+    data: { nested:{ value:'pass 1' } },
+    result: '<div id="ex1">pass 1</div>'
+  };},
+
+  function() { return {
+    name: 'returnDom',
+    template: '<div id="ex2">${__element.ownerDocument.createTextNode(\'pass 2\')}</div>',
+    data: {},
+    result: '<div id="ex2">pass 2</div>'
+  };},
+
+  function() { return {
+    name: 'srcChange',
+    template: '<img _src="${fred}" id="ex3">',
+    data: { fred:'green.png' },
+    result: /<img( id="ex3")? src="green.png"( id="ex3")?>/
+  };},
+
+  function() { return {
+    name: 'ifTrue',
+    template: '<p if="${name !== \'jim\'}">hello ${name}</p>',
+    data: { name: 'fred' },
+    result: '<p>hello fred</p>'
+  };},
+
+  function() { return {
+    name: 'ifFalse',
+    template: '<p if="${name !== \'jim\'}">hello ${name}</p>',
+    data: { name: 'jim' },
+    result: ''
+  };},
+
+  function() { return {
+    name: 'simpleLoop',
+    template: '<p foreach="index in ${[ 1, 2, 3 ]}">${index}</p>',
+    data: {},
+    result: '<p>1</p><p>2</p><p>3</p>'
+  };},
+
+  function() { return {
+    name: 'loopElement',
+    template: '<loop foreach="i in ${array}">${i}</loop>',
+    data: { array: [ 1, 2, 3 ] },
+    result: '123'
+  };},
+
+  // Bug 692031: DOMTemplate async loops do not drop the loop element
+  function() { return {
+    name: 'asyncLoopElement',
+    template: '<loop foreach="i in ${array}">${i}</loop>',
+    data: { array: delayReply([1, 2, 3]) },
+    result: '<span></span>',
+    later: '123'
+  };},
+
+  function() { return {
+    name: 'saveElement',
+    template: '<p save="${element}">${name}</p>',
+    data: { name: 'pass 8' },
+    result: '<p>pass 8</p>',
+    also: function(options) {
+      ok(options.data.element.innerHTML, 'pass 9', 'saveElement saved');
+      delete options.data.element;
+    }
+  };},
+
+  function() { return {
+    name: 'useElement',
+    template: '<p id="pass9">${adjust(__element)}</p>',
+    data: {
+      adjust: function(element) {
+        is('pass9', element.id, 'useElement adjust');
+        return 'pass 9b'
+      }
+    },
+    result: '<p id="pass9">pass 9b</p>'
+  };},
+
+  function() { return {
+    name: 'asyncInline',
+    template: '${delayed}',
+    data: { delayed: delayReply('inline') },
+    result: '<span></span>',
+    later: 'inline'
+  };},
+
+  function() { return {
+    name: 'asyncArray',
+    template: '<p foreach="i in ${delayed}">${i}</p>',
+    data: { delayed: delayReply([1, 2, 3]) },
+    result: '<span></span>',
+    later: '<p>1</p><p>2</p><p>3</p>'
+  };},
+
+  function() { return {
+    name: 'asyncMember',
+    template: '<p foreach="i in ${delayed}">${i}</p>',
+    data: { delayed: [delayReply(4), delayReply(5), delayReply(6)] },
+    result: '<span></span><span></span><span></span>',
+    later: '<p>4</p><p>5</p><p>6</p>'
+  };},
+
+  function() { return {
+    name: 'asyncBoth',
+    template: '<p foreach="i in ${delayed}">${i}</p>',
+    data: {
+      delayed: delayReply([
+        delayReply(4),
+        delayReply(5),
+        delayReply(6)
+      ])
+    },
+    result: '<span></span>',
+    later: '<p>4</p><p>5</p><p>6</p>'
+  };}
+];
+
+function delayReply(data) {
+  var p = new Promise();
+  executeSoon(function() {
+    p.resolve(data);
+  });
+  return p;
+}
new file mode 100644
--- /dev/null
+++ b/browser/devtools/shared/test/head.js
@@ -0,0 +1,67 @@
+/* ***** 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 DevTools test code.
+ *
+ * The Initial Developer of the Original Code is
+ * The Mozilla Foundation.
+ *
+ * Portions created by the Initial Developer are Copyright (C) 2011
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Joe Walker <jwalker@mozilla.com> (Original author)
+ *
+ * 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 ***** */
+
+let tab;
+let browser;
+
+function addTab(aURL, aCallback)
+{
+  waitForExplicitFinish();
+
+  function onTabLoad() {
+    browser.removeEventListener("load", onTabLoad, true);
+    aCallback();
+  }
+
+  gBrowser.selectedTab = gBrowser.addTab();
+  content.location = aURL;
+
+  tab = gBrowser.selectedTab;
+  browser = gBrowser.getBrowserForTab(tab);
+
+  browser.addEventListener("load", onTabLoad, true);
+}
+
+registerCleanupFunction(function tearDown() {
+  while (gBrowser.tabs.length > 1) {
+    gBrowser.removeCurrentTab();
+  }
+
+  tab = undefined;
+  browser = undefined;
+});
--- a/browser/devtools/sourceeditor/orion/README
+++ b/browser/devtools/sourceeditor/orion/README
@@ -3,18 +3,18 @@
 This is the Orion editor packaged for Mozilla.
 
 The Orion editor web site: http://www.eclipse.org/orion
 
 # Upgrade
 
 To upgrade Orion to a newer version see the UPGRADE file.
 
-Orion version: git clone from 2011-07-06 (after the 0.2 release)
-               commit hash b19bc0b0f4e2843823bb1b8c8b4a64395c59e617
+Orion version: git clone from 2011-10-07
+               commit hash eedba6403b6dff4536bc0469d31126c3485deb56
 
 # License
 
 The following files are licensed according to the contents in the LICENSE
 file:
   orion.js
   orion.css
 
new file mode 100644
--- /dev/null
+++ b/browser/devtools/sourceeditor/orion/mozilla.css
@@ -0,0 +1,11 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+
+.rulerLines {
+  background: -moz-Dialog;
+  color: -moz-DialogText;
+  min-width: 1.4em;
+  padding-left: 4px;
+  padding-right: 4px;
+}
--- a/browser/devtools/sourceeditor/orion/orion.css
+++ b/browser/devtools/sourceeditor/orion/orion.css
@@ -3,63 +3,85 @@
 }
 
 .viewContainer {
 	font-family: monospace;
 	font-size: 10pt;
 }
 
 .viewContent {
-}.ruler_annotation {
-	background-color: #e1ebfb;
+}/* Styles for rulers */
+.ruler {
+	background-color: white;
+}
+.ruler.annotations {
+	border-right: 1px solid lightgray;
 	width: 16px;
 }
-
-.ruler_annotation_todo {
+.ruler.folding {
+	border-right: 1px solid lightgray;
+	width: 14px;
 }
-
-.ruler_annotation_todo_overview {
-	background-color: lightgreen;
-	border: 1px solid green;
+.ruler.lines {
+	border-right: 1px solid lightgray;
+	text-align: right;
 }
-
-.ruler_annotation_breakpoint {
+.ruler.overview {
+	width: 14px;
 }
 
-.ruler_annotation_breakpoint_overview {
-	background-color: lightblue;
-	border: 1px solid blue;
+/* Styles for the line number ruler */
+.rulerLines {
+	background-color: white;
 }
-
-.ruler_lines {
-	background-color: #e1ebfb;
-	border-right: 1px solid #b1badf;
-	text-align: right;
+.rulerLines.even
+.rulerLines.odd {
 }
 
-.ruler_overview {
-	background-color: #e1ebfb;
-}
-
-.ruler_lines_even {
-	background-color: #e1ebfb;
+/* Styles for the ruler tooltips */
+.rulerTooltip {
+	font-family: monospace;
+	font-size: 10pt;
+	background-color: InfoBackground;
+	color: InfoText;
+	padding: 2px;
+	border-radius: 4px;
+	border: 1px solid black;
+	z-index: 100;
+	position: absolute;
+	overflow: hidden;
+	white-space: pre;
 }
-
-.ruler_lines_odd {
-	background-color: white;
-}
-
-.token_comment {
+.rulerTooltip em {
+	font-style: normal;
+	font-weight: bold;
+}.token_singleline_comment {
 	color: green;
 }
 
-.token_javadoc {
+.token_multiline_comment {
+	color: green;
+}
+
+.token_doc_comment {
 	color: #00008F;
 }
 
+.token_doc_html_markup {
+	color: #7F7F9F;
+}
+
+.token_doc_tag {
+	color: #7F9FBF;
+}
+
+.token_task_tag {
+	color: #7F9FBF;
+}
+
 .token_string {
 	color: blue;
 }
 
 .token_keyword {
 	color: darkred;
 	font-weight: bold;
 }
@@ -69,30 +91,34 @@
 }
 
 .token_bracket {
 	color: white;
 	background-color: grey;
 }
 
 .token_space {
-	background-image: url('/examples/textview/images/white_space.png');
+	/* images/white_space.png */
+	background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAIAAABv85FHAAAABnRSTlMA/wAAAACkwsAdAAAAIUlEQVR4nGP4z8CAC+GUIEXuABhgkTuABEiRw2cmae4EAH05X7xDolNRAAAAAElFTkSuQmCC");
 	background-repeat: no-repeat;
  	background-position: center center;
 }
 
 .token_tab {
-	background-image: url('/examples/textview/images/white_tab.png');
+	/* images/white_tab.png */
+	background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAJCAIAAACJ2loDAAAABnRSTlMA/wD/AP83WBt9AAAAMklEQVR4nGP4TwRgoK6i52c3bz5w6zMSA6tJn28d2Lx589nnCAYu63AaSLxJRLoJPwAAeNk0aG4opfMAAAAASUVORK5CYII=");
 	background-repeat: no-repeat;
  	background-position: left center;
 }
 
 .line_caret {
 	background-color: #EAF2FE;
-}/* Styling for html syntax highlighting */
+}
+
+/* Styling for html syntax highlighting */
 .entity-name-tag {
 	color: #3f7f7f;
 }
 
 .entity-other-attribute-name {
 	color: #7f007f;
 }
 
@@ -107,9 +133,9 @@
 .string-quoted {
 	color: #2a00ff;
 	font-style: italic;
 }
 
 .invalid {
 	color: red;
 	font-weight: bold;
-}
\ No newline at end of file
+}
--- a/browser/devtools/sourceeditor/orion/orion.js
+++ b/browser/devtools/sourceeditor/orion/orion.js
@@ -103,34 +103,35 @@ if (typeof window !== "undefined" && typ
  * All rights reserved. This program and the accompanying materials are made 
  * available under the terms of the Eclipse Public License v1.0 
  * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution 
  * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html). 
  * 
  * Contributors: IBM Corporation - initial API and implementation
  ******************************************************************************/
 
-/*global window define */
+/*global window define setTimeout clearTimeout setInterval clearInterval */
 
 /**
  * @namespace The global container for Orion APIs.
  */ 
 var orion = orion || {};
 /**
  * @namespace The container for textview APIs.
  */ 
 orion.textview = orion.textview || {};
 
 /**
- * Contructs a new ruler. 
+ * Constructs a new ruler. 
  * <p>
  * The default implementation does not implement all the methods in the interface
  * and is useful only for objects implementing rulers.
  * <p/>
  * 
+ * @param {orion.textview.AnnotationModel} [annotationModel] the annotation model for the ruler.
  * @param {String} [rulerLocation="left"] the location for the ruler.
  * @param {String} [rulerOverview="page"] the overview for the ruler.
  * @param {orion.textview.Style} [rulerStyle] the style for the ruler. 
  * 
  * @class This interface represents a ruler for the text view.
  * <p>
  * A Ruler is a graphical element that is placed either on the left or on the right side of 
  * the view. It can be used to provide the view with per line decoration such as line numbering,
@@ -145,36 +146,105 @@ orion.textview = orion.textview || {};
  * {@link orion.textview.OverviewRuler}<br/> 
  * {@link orion.textview.TextView}<br/>
  * {@link orion.textview.TextView#addRuler}
  * </p>		 
  * @name orion.textview.Ruler
  */
 orion.textview.Ruler = (function() {
 	/** @private */
-	function Ruler (rulerLocation, rulerOverview, rulerStyle) {
+	function Ruler (annotationModel, rulerLocation, rulerOverview, rulerStyle) {
 		this._location = rulerLocation || "left";
 		this._overview = rulerOverview || "page";
 		this._rulerStyle = rulerStyle;
+		this._types = [];
 		this._view = null;
+		var self = this;
+		this._annotationModelListener = {
+			onChanged: function(e) {
+				self._onAnnotationModelChanged(e);
+			}
+		};
+		this.setAnnotationModel(annotationModel);
 	}
 	Ruler.prototype = /** @lends orion.textview.Ruler.prototype */ {
 		/**
-		 * Sets the view for the ruler.
-		 *
-		 * @param {orion.textview.TextView} view the text view.
-		 */
-		setView: function (view) {
-			if (this._onModelChanged && this._view) {
-				this._view.removeEventListener("ModelChanged", this, this._onModelChanged); 
-			}
-			this._view = view;
-			if (this._onModelChanged && this._view) {
-				this._view.addEventListener("ModelChanged", this, this._onModelChanged);
-			}
+		 * Adds an annotation type to the ruler.
+		 * <p>
+		 * Only annotations of the specified types will be shown by
+		 * this ruler.
+		 * </p>
+		 *
+		 * @param type {Object} the annotation type to be shown
+		 */
+		addAnnotationType: function(type) {
+			this._types.push(type);
+		},
+		/**
+		 * Returns the annotations for a given line range.
+		 * <p>
+		 * This method is called the the text view when the ruler is redrawn.
+		 * </p>
+		 *
+		 * @param {Number} startLine the line index
+		 * @param {Number} endLine the line index
+		 * @return {orion.textview.LineAnnotation} the annotations for the line range.
+		 */
+		getAnnotations: function(startLine, endLine) {
+			var annotationModel = this._annotationModel;
+			if (!annotationModel) { return []; }
+			var model = this._view.getModel();
+			var start = model.getLineStart(startLine);
+			var end = model.getLineEnd(endLine - 1);
+			var baseModel = model;
+			if (model.getBaseModel) {
+				baseModel = model.getBaseModel();
+				start = model.mapOffset(start);
+				end = model.mapOffset(end);
+			}
+			var annotations = annotationModel.getAnnotations(start, end);
+			var result = [];
+			while (annotations.hasNext()) {
+				var annotation = annotations.next();
+				if (!this.isAnnotationTypeVisible(annotation.type)) { continue; }
+				var annotationLineStart = baseModel.getLineAtOffset(annotation.start);
+				var annotationLineEnd = baseModel.getLineAtOffset(annotation.end - 1);
+				for (var lineIndex = annotationLineStart; lineIndex<=annotationLineEnd; lineIndex++) {
+					var visualLineIndex = lineIndex;
+					if (model !== baseModel) {
+						var ls = baseModel.getLineStart(lineIndex);
+						ls = model.mapOffset(ls, true);
+						if (ls === -1) { continue; }
+						visualLineIndex = model.getLineAtOffset(ls);
+					}
+					if (!(startLine <= visualLineIndex && visualLineIndex < endLine)) { continue; }
+					var rulerAnnotation = this._mergeAnnotation(result[visualLineIndex], annotation, lineIndex - annotationLineStart, annotationLineEnd - annotationLineStart + 1);
+					if (rulerAnnotation) {
+						result[visualLineIndex] = rulerAnnotation;
+					}
+				}
+			}
+			if (!this._multiAnnotation && this._multiAnnotationOverlay) {
+				for (var k in result) {
+					if (result[k]._multiple) {
+						result[k].html = result[k].html + this._multiAnnotationOverlay.rulerHTML;
+					}
+				}
+			}
+			return result;
+		},
+		/**
+		 * Returns the ruler annotation model.
+		 *
+		 * @returns {orion.textview.AnnotationModel} the ruler annotation model.
+		 *
+		 * @see #getOverview
+		 */
+		getAnnotationModel: function() {
+			return this._annotationModel;
 		},
 		/**
 		 * Returns the ruler location.
 		 *
 		 * @returns {String} the ruler location, which is either "left" or "right".
 		 *
 		 * @see #getOverview
 		 */
@@ -187,53 +257,115 @@ orion.textview.Ruler = (function() {
 		 * @returns {String} the overview type, which is either "page" or "document".
 		 *
 		 * @see #getLocation
 		 */
 		getOverview: function() {
 			return this._overview;
 		},
 		/**
-		 * Returns the CSS styling information for the decoration of a given line.
+		 * Returns the CSS styling information for the ruler.
+		 *
+		 * @returns {orion.textview.Style} the CSS styling for ruler.
+		 */
+		getRulerStyle: function() {
+			return this._rulerStyle;
+		},
+		/**
+		 * Returns the widest annotation which determines the width of the ruler.
 		 * <p>
-		 * If the line index is <code>-1</code>, the CSS styling information for the decoration
-		 * that determines the width of the ruler should be returned. If the line is
-		 * <code>undefined</code>, the ruler styling information should be returned.
+		 * If the ruler does not have a fixed width it should provide the widest
+		 * annotation to avoid the ruler from changing size as the view scrolls.
 		 * </p>
-		 *
-		 * @param {Number} lineIndex the line index
-		 * @returns {orion.textview.Style} the CSS styling for ruler, given line, or generic line.
-		 *
-		 * @see #getHTML
-		 */
-		getStyle: function(lineIndex) {
-		},
-		/**
-		 * Returns the HTML content for the decoration of a given line.
 		 * <p>
-		 * If the line index is <code>-1</code>, the HTML content for the decoration
-		 * that determines the width of the ruler should be returned.
+		 * This method is called the the text view when the ruler is redrawn.
 		 * </p>
 		 *
-		 * @param {Number} lineIndex the line index
-		 * @returns {String} the HTML content for a given line, or generic line.
-		 *
-		 * @see #getStyle
-		 */
-		getHTML: function(lineIndex) {
-		},
-		/**
-		 * Returns the indices of the lines that have decoration.
+		 * @returns {orion.textview.Annotation} the annotation for the generic line.
+		 *
+		 * @see #getAnnotations
+		 */
+		getWidestAnnotation: function() {
+			return null;
+		},
+		/**
+		 * Returns whether the ruler shows annotations of the specified type.
+		 *
+		 * @param {Object} the annotation type 
+		 * @returns {Boolean} whether the specified is shown
+		 */
+		isAnnotationTypeVisible: function(type) {
+			for (var i = 0; i < this._types.length; i++) {
+				if (this._types[i] === type) {
+					return true;
+				}
+			}
+			return false;
+		},
+		/**
+		 * Removes an annotation type from the ruler.
+		 *
+		 * @param type {Object} the annotation type to be shown
+		 */
+		removeAnnotationType: function(type) {
+			for (var i = 0; i < this._types.length; i++) {
+				if (this._types[i] === type) {
+					this._types.splice(i, 1);
+					break;
+				}
+			}
+		},
+		/**
+		 * Sets the annotation model for the ruler.
+		 *
+		 * @param {orion.textview.AnnotationModel} annotationModel the annotation model.
+		 */
+		setAnnotationModel: function (annotationModel) {
+			if (this._annotationModel) {
+				this._annotationModel.removeListener(this._annotationModelListener); 
+			}
+			this._annotationModel = annotationModel;
+			if (this._annotationModel) {
+				this._annotationModel.addListener(this._annotationModelListener); 
+			}
+		},
+		/**
+		 * Sets the annotation that is displayed when a given line contains multiple
+		 * annotations.
+		 *
+		 * @param {orion.textview.Annotation} the annotation for lines with multiple annotations.
+		 */
+		setMultiAnnotation: function(annotation) {
+			this._multiAnnotation = annotation;
+		},
+		/**
+		 * Sets the annotation that overlays a line with multiple  annotations.
+		 *
+		 * @param {orion.textview.Annotation} the annotation overlay for lines with multiple annotations.
+		 */
+		setMultiAnnotationOverlay: function(annotation) {
+			this._multiAnnotationOverlay = annotation;
+		},
+		/**
+		 * Sets the view for the ruler.
 		 * <p>
-		 * This function is only called for rulers with "document" overview type.
+		 * This method is called the the text view when the ruler
+		 * is added to the view.
 		 * </p>
-		 * 
-		 * @returns {Number[]} an array of line indices.
-		 */
-		getAnnotations: function() {
+		 *
+		 * @param {orion.textview.TextView} view the text view.
+		 */
+		setView: function (view) {
+			if (this._onTextModelChanged && this._view) {
+				this._view.removeEventListener("ModelChanged", this, this._onTextModelChanged); 
+			}
+			this._view = view;
+			if (this._onTextModelChanged && this._view) {
+				this._view.addEventListener("ModelChanged", this, this._onTextModelChanged);
+			}
 		},
 		/**
 		 * This event is sent when the user clicks a line decoration.
 		 *
 		 * @event
 		 * @param {Number} lineIndex the line index of the clicked decoration.
 		 * @param {DOMEvent} e the click event.
 		 */
@@ -242,73 +374,310 @@ orion.textview.Ruler = (function() {
 		/**
 		 * This event is sent when the user double clicks a line decoration.
 		 *
 		 * @event
 		 * @param {Number} lineIndex the line index of the double clicked decoration.
 		 * @param {DOMEvent} e the double click event.
 		 */
 		onDblClick: function(lineIndex, e) {
+		},
+		onMouseMove: function(lineIndex, e) {
+			if (this._tooltip && this._tooltipLineIndex === lineIndex) { return; }
+			var self = this;
+			self._hideTooltip();
+			self._tooltipLineIndex = lineIndex;
+			self._tooltipClientY = e.clientY;
+			self._tooltipShowTimeout = setTimeout(function() {
+				self._showTooltip();
+				if (self._tooltip) {
+					self._tooltipHideTimeout = setTimeout(function() {
+						var opacity = parseFloat(self._getNodeStyle(self._tooltip, "opacity", "1"));
+						self._tooltipFadeTimeout = setInterval(function() {
+							if (self._tooltip && opacity > 0) {
+								opacity -= 0.1;
+								self._tooltip.style.opacity = opacity;
+								return;
+							}
+							self._hideTooltip();
+						}, 50);
+					}, 5000);
+				}
+			}, 1000);
+		},
+		onMouseOver: this._onMouseMove,
+		onMouseOut: function(lineIndex, e) {
+			this._hideTooltip();
+		},
+		_getNodeStyle: function(node, prop, defaultValue) {
+			var value;
+			if (node) {
+				value = node.style[prop];
+				if (!value) {
+					if (node.currentStyle) {
+						var index = 0, p = prop;
+						while ((index = p.indexOf("-", index)) !== -1) {
+							p = p.substring(0, index) + p.substring(index + 1, index + 2).toUpperCase() + p.substring(index + 2);
+						}
+						value = node.currentStyle[p];
+					} else {
+						var css = node.ownerDocument.defaultView.getComputedStyle(node, null);
+						value = css ? css.getPropertyValue(prop) : null;
+					}
+				}
+			}
+			return value || defaultValue;
+		},
+		_getTooltip: function(document, lineIndex, annotations) {
+			if (annotations.length === 0) { return null; }
+			var model = this._view.getModel(), annotation;
+			function getText(start, end) {
+				var m = model.getBaseModel ? model.getBaseModel() : model;
+				var textStart = m.getLineStart(m.getLineAtOffset(start));
+				var textEnd = m.getLineEnd(m.getLineAtOffset(end), true);
+				return m.getText(textStart, textEnd);
+			}
+			var title;
+			if (annotations.length === 1) {
+				annotation = annotations[0];
+				if (annotation.rulerTitle) {
+					title = annotation.rulerTitle.replace(/</g, "&lt;").replace(/>/g, "&gt;");
+					return annotation.rulerHTML + "&nbsp;" + title;
+				} else {
+					//TODO show a projection textview to get coloring 
+					return document.createTextNode(getText(annotation.start, annotation.end));
+				}
+			} else {
+				var tooltipHTML = "<em>Multiple annotations:</em><br>";
+				for (var i = 0; i < annotations.length; i++) {
+					annotation = annotations[i];
+					title = annotation.rulerTitle;
+					if (!title) {
+						title = getText(annotation.start, annotation.end);
+					}
+					title = title.replace(/</g, "&lt;").replace(/>/g, "&gt;");
+					tooltipHTML += annotation.rulerHTML + "&nbsp;" + title + "<br>";
+				}
+				return tooltipHTML;
+			}
+		},	
+		_hideTooltip: function() {
+			this._tooltipLineIndex = this._tooltipEvent = undefined;
+			if (this._tooltip) {
+				var parent = this._tooltip.parentNode;
+				if (parent) { parent.removeChild(this._tooltip); }
+				this._tooltip = null;
+			}
+			if (this._tooltipShowTimeout) {
+				clearTimeout(this._tooltipShowTimeout);
+				this._tooltipShowTimeout = null;
+			}
+			if (this._tooltipHideTimeout) {
+				clearTimeout(this._tooltipHideTimeout);
+				this._tooltipHideTimeout = null;
+			}
+			if (this._tooltipFadeTimeout) {
+				clearInterval(this._tooltipFadeTimeout);
+				this._tooltipFadeTimeout = null;
+			}
+		},
+		_onAnnotationModelChanged: function(e) {
+			var view = this._view;
+			if (!view) { return; }
+			var model = view.getModel(), self = this;
+			var lineCount = model.getLineCount();
+			if (e.textModelChangedEvent) {
+				var start = e.textModelChangedEvent.start;
+				if (model.getBaseModel) { start = model.mapOffset(start, true); }
+				var startLine = model.getLineAtOffset(start);
+				view.redrawLines(startLine, lineCount, self);
+				return;
+			}
+			function redraw(changes) {
+				for (var i = 0; i < changes.length; i++) {
+					if (!self.isAnnotationTypeVisible(changes[i].type)) { continue; }
+					var start = changes[i].start;
+					var end = changes[i].end;
+					if (model.getBaseModel) {
+						start = model.mapOffset(start, true);
+						end = model.mapOffset(end, true);
+					}
+					if (start !== -1 && end !== -1) {
+						view.redrawLines(model.getLineAtOffset(start), model.getLineAtOffset(Math.max(start, end - 1)) + 1, self);
+					}
+				}
+			}
+			redraw(e.added);
+			redraw(e.removed);
+			redraw(e.changed);
+		},
+		_mergeAnnotation: function(result, annotation, annotationLineIndex, annotationLineCount) {
+			if (!result) { result = {}; }
+			if (annotationLineIndex === 0) {
+				if (result.html && annotation.rulerHTML) {
+					if (annotation.rulerHTML !== result.html) {
+						if (!result._multiple && this._multiAnnotation) {
+							result.html = this._multiAnnotation.rulerHTML;
+						}
+					} 
+					result._multiple = true;
+				} else {
+					result.html = annotation.rulerHTML;
+				}
+			}
+			result.style = this._mergeStyle(result.style, annotation.rulerStyle);
+			return result;
+		},
+		_mergeStyle: function(result, style) {
+			if (style) {
+				if (!result) { result = {}; }
+				if (result.styleClass && style.styleClass && result.styleClass !== style.styleClass) {
+					result.styleClass += " " + style.styleClass;
+				} else {
+					result.styleClass = style.styleClass;
+				}
+				var prop;
+				if (style.style) {
+					if (!result.style) { result.style  = {}; }
+					for (prop in style.style) {
+						if (!result.style[prop]) {
+							result.style[prop] = style.style[prop];
+						}
+					}
+				}
+				if (style.attributes) {
+					if (!result.attributes) { result.attributes  = {}; }
+					for (prop in style.attributes) {
+						if (!result.attributes[prop]) {
+							result.attributes[prop] = style.attributes[prop];
+						}
+					}
+				}
+			}
+			return result;
+		},
+		_showTooltip: function() {
+			var lineIndex = this._tooltipLineIndex;
+			if (lineIndex === undefined) { return; }
+			var view = this._view;
+			var model = view.getModel();
+			var annotationModel = this._annotationModel;
+			var annotations = [];
+			if (annotationModel) {
+				var start = model.getLineStart(lineIndex);
+				var end = model.getLineEnd(lineIndex);
+				if (model.getBaseModel) {
+					start = model.mapOffset(start);
+					end = model.mapOffset(end);
+				}
+				var iter = annotationModel.getAnnotations(start, end);
+				var annotation;
+				while (iter.hasNext()) {
+					annotation = iter.next();
+					if (!this.isAnnotationTypeVisible(annotation.type)) { continue; }
+					annotations.push(annotation);
+				}
+			}
+			var document = this._view._parentDocument;//TODO bad not API
+			var tooltipContent = this._getTooltip(document, lineIndex, annotations);
+			if (!tooltipContent) { return; }
+			var tooltip = this._tooltip = document.createElement("DIV");
+			tooltip.className = "rulerTooltip";
+			if (typeof tooltipContent === "string") {
+				tooltip.innerHTML = tooltipContent;
+			} else {
+				tooltip.appendChild(tooltipContent);
+			}
+			var rect = view.getClientArea();
+			if (this.getOverview() === "document") {
+				rect.y = view.convert({y: this._tooltipClientY}, "view", "document").y;
+			} else {
+				rect.y = view.getLocationAtOffset(model.getLineStart(lineIndex)).y;
+			}
+			view.convert(rect, "document", "page");
+			tooltip.style.visibility = "hidden";
+			document.body.appendChild(tooltip);
+			var left = parseInt(this._getNodeStyle(tooltip, "padding-left", "0"), 10);
+			left += parseInt(this._getNodeStyle(tooltip, "border-left-width", "0"), 10);
+			var top = parseInt(this._getNodeStyle(tooltip, "padding-top", "0"), 10);
+			top += parseInt(this._getNodeStyle(tooltip, "border-top-width", "0"), 10);
+			rect.y -= top;
+			if (this.getLocation() === "right") {
+				var right = parseInt(this._getNodeStyle(tooltip, "padding-right", "0"), 10);
+				right += parseInt(this._getNodeStyle(tooltip, "border-right-width", "0"), 10);
+				tooltip.style.right = (document.body.getBoundingClientRect().right - (rect.x + rect.width) + left + right) + "px";
+			} else {
+				tooltip.style.left = (rect.x - left) + "px";
+			}
+			tooltip.style.top = rect.y + "px";
+			tooltip.style.maxWidth = rect.width + "px";
+			tooltip.style.maxHeight = (rect.height - (rect.y - view._parent.getBoundingClientRect().top)) + "px";
+			tooltip.style.visibility = "visible";
 		}
 	};
 	return Ruler;
 }());
 
 /**
- * Contructs a new line numbering ruler. 
+ * Constructs a new line numbering ruler. 
  *
  * @param {String} [rulerLocation="left"] the location for the ruler.
  * @param {orion.textview.Style} [rulerStyle=undefined] the style for the ruler.
- * @param {orion.textview.Style} [oddStyle={backgroundColor: "white"}] the style for lines with odd line index.
+ * @param {orion.textview.Style} [oddStyle={style: {backgroundColor: "white"}] the style for lines with odd line index.
  * @param {orion.textview.Style} [evenStyle={backgroundColor: "white"}] the style for lines with even line index.
  *
  * @augments orion.textview.Ruler
  * @class This objects implements a line numbering ruler.
  *
  * <p><b>See:</b><br/>
  * {@link orion.textview.Ruler}
  * </p>
  * @name orion.textview.LineNumberRuler
  */
 orion.textview.LineNumberRuler = (function() {
 	/** @private */
-	function LineNumberRuler (rulerLocation, rulerStyle, oddStyle, evenStyle) {
-		orion.textview.Ruler.call(this, rulerLocation, "page", rulerStyle);
+	function LineNumberRuler (annotationModel, rulerLocation, rulerStyle, oddStyle, evenStyle) {
+		orion.textview.Ruler.call(this, annotationModel, rulerLocation, "page", rulerStyle);
 		this._oddStyle = oddStyle || {style: {backgroundColor: "white"}};
 		this._evenStyle = evenStyle || {style: {backgroundColor: "white"}};
 		this._numOfDigits = 0;
 	}
 	LineNumberRuler.prototype = new orion.textview.Ruler(); 
 	/** @ignore */
-	LineNumberRuler.prototype.getStyle = function(lineIndex) {
-		if (lineIndex === undefined) {
-			return this._rulerStyle;
-		} else {
-			return lineIndex & 1 ? this._oddStyle : this._evenStyle;
+	LineNumberRuler.prototype.getAnnotations = function(startLine, endLine) {
+		var result = orion.textview.Ruler.prototype.getAnnotations.call(this, startLine, endLine);
+		var model = this._view.getModel();
+		for (var lineIndex = startLine; lineIndex < endLine; lineIndex++) {
+			var style = lineIndex & 1 ? this._oddStyle : this._evenStyle;
+			var mapLine = lineIndex;
+			if (model.getBaseModel) {
+				var lineStart = model.getLineStart(mapLine);
+				mapLine = model.getBaseModel().getLineAtOffset(model.mapOffset(lineStart));
+			}
+			if (!result[lineIndex]) { result[lineIndex] = {}; }
+			result[lineIndex].html = (mapLine + 1) + "";
+			if (!result[lineIndex].style) { result[lineIndex].style = style; }
 		}
+		return result;
 	};
 	/** @ignore */
-	LineNumberRuler.prototype.getHTML = function(lineIndex) {
-		if (lineIndex === -1) {
-			var model = this._view.getModel();
-			return model.getLineCount();
-		} else {
-			return lineIndex + 1;
-		}
+	LineNumberRuler.prototype.getWidestAnnotation = function() {
+		var lineCount = this._view.getModel().getLineCount();
+		return this.getAnnotations(lineCount - 1, lineCount)[lineCount - 1];
 	};
 	/** @ignore */
-	LineNumberRuler.prototype._onModelChanged = function(e) {
+	LineNumberRuler.prototype._onTextModelChanged = function(e) {
 		var start = e.start;
 		var model = this._view.getModel();
-		var lineCount = model.getLineCount();
+		var lineCount = model.getBaseModel ? model.getBaseModel().getLineCount() : model.getLineCount();
 		var numOfDigits = (lineCount+"").length;
 		if (this._numOfDigits !== numOfDigits) {
 			this._numOfDigits = numOfDigits;
 			var startLine = model.getLineAtOffset(start);
-			this._view.redrawLines(startLine, lineCount, this);
+			this._view.redrawLines(startLine,  model.getLineCount(), this);
 		}
 	};
 	return LineNumberRuler;
 }());
 /** 
  * @class This is class represents an annotation for the AnnotationRuler. 
  * <p> 
  * <b>See:</b><br/> 
@@ -334,134 +703,21 @@ orion.textview.LineNumberRuler = (functi
  * <p><b>See:</b><br/>
  * {@link orion.textview.Ruler}<br/>
  * {@link orion.textview.Annotation}
  * </p>
  * @name orion.textview.AnnotationRuler
  */
 orion.textview.AnnotationRuler = (function() {
 	/** @private */
-	function AnnotationRuler (rulerLocation, rulerStyle, defaultAnnotation) {
-		orion.textview.Ruler.call(this, rulerLocation, "page", rulerStyle);
-		this._defaultAnnotation = defaultAnnotation;
-		this._annotations = [];
+	function AnnotationRuler (annotationModel, rulerLocation, rulerStyle) {
+		orion.textview.Ruler.call(this, annotationModel, rulerLocation, "page", rulerStyle);
 	}
 	AnnotationRuler.prototype = new orion.textview.Ruler();
-	/**
-	 * Removes all annotations in the ruler.
-	 *
-	 * @name clearAnnotations
-	 * @methodOf orion.textview.AnnotationRuler.prototype
-	 */
-	AnnotationRuler.prototype.clearAnnotations = function() {
-		this._annotations = [];
-		var lineCount = this._view.getModel().getLineCount();
-		this._view.redrawLines(0, lineCount, this);
-		if (this._overviewRuler) {
-			this._view.redrawLines(0, lineCount, this._overviewRuler);
-		}
-	};
-	/**
-	 * Returns the annotation for the given line index.
-	 *
-	 * @param {Number} lineIndex the line index
-	 *
-	 * @returns {orion.textview.Annotation} the annotation for the given line, or undefined
-	 *
-	 * @name getAnnotation
-	 * @methodOf orion.textview.AnnotationRuler.prototype
-	 * @see #setAnnotation
-	 */
-	AnnotationRuler.prototype.getAnnotation = function(lineIndex) {
-		return this._annotations[lineIndex];
-	};
-	/** @ignore */
-	AnnotationRuler.prototype.getAnnotations = function() {
-		var lines = [];
-		for (var prop in this._annotations) {
-			var i = prop >>> 0;
-			if (this._annotations[i] !== undefined) {
-				lines.push(i);
-			}
-		}
-		return lines;
-	};
-	/** @ignore */
-	AnnotationRuler.prototype.getStyle = function(lineIndex) {
-		switch (lineIndex) {
-			case undefined:
-				return this._rulerStyle;
-			case -1:
-				return this._defaultAnnotation ? this._defaultAnnotation.style : null;
-			default:
-				return this._annotations[lineIndex] && this._annotations[lineIndex].style ? this._annotations[lineIndex].style : null;
-		}
-	};
-	/** @ignore */	
-	AnnotationRuler.prototype.getHTML = function(lineIndex) {
-		if (lineIndex === -1) {
-			return this._defaultAnnotation ? this._defaultAnnotation.html : "";