Merge mozilla-central to build-system.
authorMitchell Field <mitchell.field@live.com.au>
Sun, 29 May 2011 14:10:30 +1000
changeset 70962 8f0f65f58c5cb44e425f07d7f051232b059e848a
parent 70961 c6d37338490ded2481a6ec9278299634fcc98660 (current diff)
parent 70291 5d7b5f2ea6034b386c8322755fff017ecef73169 (diff)
child 70963 bf8200c0d7538efe0227ddcd8b0d66b7aa51442d
push idunknown
push userunknown
push dateunknown
milestone7.0a1
Merge mozilla-central to build-system.
accessible/tests/mochitest/events/test_aria_hidden.html
accessible/tests/mochitest/test_elm_media.html
accessible/tests/mochitest/test_nsIAccessible_comboboxes.xul
browser/base/content/test/browser_bug420160.js
browser/base/content/test/browser_webdev_menu.js
browser/components/migration/src/nsCaminoProfileMigrator.cpp
browser/components/migration/src/nsCaminoProfileMigrator.h
browser/components/migration/src/nsDogbertProfileMigrator.cpp
browser/components/migration/src/nsDogbertProfileMigrator.h
browser/components/migration/src/nsICabProfileMigrator.cpp
browser/components/migration/src/nsICabProfileMigrator.h
browser/components/migration/src/nsMacIEProfileMigrator.cpp
browser/components/migration/src/nsMacIEProfileMigrator.h
browser/components/migration/src/nsOmniWebProfileMigrator.cpp
browser/components/migration/src/nsOmniWebProfileMigrator.h
browser/components/migration/src/nsPhoenixProfileMigrator.cpp
browser/components/migration/src/nsPhoenixProfileMigrator.h
browser/themes/winstripe/browser/places/dropDown-aero.png
browser/themes/winstripe/browser/places/libraryNavigation-aero.png
browser/themes/winstripe/browser/places/libraryNavigation.png
config/preprocessor.pl
config/preprocessor.txt
config/static-config.mk
config/static-rules.mk
configure.in
content/html/content/src/nsHTMLDelElement.cpp
content/html/document/src/nsImageDocument.cpp
content/html/document/src/nsMediaDocument.cpp
content/html/document/src/nsMediaDocument.h
content/html/document/src/nsPluginDocument.cpp
content/html/document/src/nsVideoDocument.cpp
content/xslt/public/txDouble.h
dom/interfaces/core/nsIDOM3Text.idl
dom/interfaces/core/nsIDOMNSDocument.idl
dom/interfaces/events/nsIDOM3DocumentEvent.idl
dom/interfaces/events/nsIDOMDocumentEvent.idl
dom/interfaces/html/nsIDOMNSHTMLDocument.idl
dom/interfaces/html/nsIDOMNSHTMLHRElement.idl
dom/interfaces/range/nsIDOMDocumentRange.idl
dom/interfaces/stylesheets/nsIDOMDocumentStyle.idl
dom/interfaces/stylesheets/nsIDOMNSDocumentStyle.idl
dom/plugins/base/nsIPluginInstance.idl
gfx/angle/angle-fixes.patch
gfx/angle/angle-pbuffers.patch
gfx/angle/angle-shared.patch
gfx/thebes/gfxDllDeps.cpp
js/src/config/preprocessor.pl
js/src/configure.in
js/src/tests/Patterns.pm
js/src/tests/SisyphusMakefile
js/src/tests/bisect.sh
js/src/tests/changes.sh
js/src/tests/config.mk
js/src/tests/config.sh
js/src/tests/detect-universe.sh
js/src/tests/dikdik-n.tests
js/src/tests/get-universe.sh
js/src/tests/importList.html
js/src/tests/importList.js
js/src/tests/js-test-driver-quirks.html
js/src/tests/js-test-driver-standards.html
js/src/tests/known-failures.pl
js/src/tests/menufoot.html
js/src/tests/menuhead.html
js/src/tests/menuhead.js
js/src/tests/mkhtml.pl
js/src/tests/mklistpage.pl
js/src/tests/pattern-expander.pl
js/src/tests/pattern-extracter.pl
js/src/tests/performance-1.8.0.tests
js/src/tests/performance-1.8.1.tests
js/src/tests/performance-1.9.0.tests
js/src/tests/performance-1.9.1.tests
js/src/tests/performance-1.9.2.tests
js/src/tests/post-process-logs.pl
js/src/tests/process-logs.sh
js/src/tests/remove-fixed-failures.sh
js/src/tests/runtests.sh
js/src/tests/slow-n-1.8.1-browser.tests
js/src/tests/slow-n-1.8.1.tests
js/src/tests/slow-n-1.9.0-browser.tests
js/src/tests/slow-n-1.9.0.tests
js/src/tests/slow-n-1.9.1-browser.tests
js/src/tests/slow-n-1.9.1.tests
js/src/tests/slow-n-1.9.2-browser.tests
js/src/tests/slow-n-1.9.2.tests
js/src/tests/spidermonkey-n-1.8.0.tests
js/src/tests/spidermonkey-n-1.8.1.tests
js/src/tests/spidermonkey-n-1.9.0.tests
js/src/tests/spidermonkey-n-1.9.1.tests
js/src/tests/spidermonkey-n-1.9.2.tests
js/src/tests/spidermonkey-n-1.9.3.tests
js/src/tests/test.sh
js/src/tests/userhookeach.js
layout/reftests/css-invalid/input/success-ref.html
mobile/chrome/content/content.css
mobile/themes/core/gingerbread/images/appmenu-addons-hdpi-xxx.png
mobile/themes/core/gingerbread/images/check-selected-30.png
mobile/themes/core/gingerbread/images/check-unselected-30.png
mobile/themes/core/gingerbread/images/panelrow-active-hdpi.png
mobile/themes/core/gingerbread/images/panelrow-default-hdpi.png
mobile/themes/core/gingerbread/images/panelrow-selected-hdpi.png
mobile/themes/core/gingerbread/images/popup-bg-hdpi.png
mobile/themes/core/gingerbread/images/sidebarbutton-active-hdpi.png
mobile/themes/core/honeycomb/images/appmenu-addons-hdpi-xxx.png
modules/lib7z/7zLib.cpp
modules/lib7z/7zLib.h
modules/lib7z/7zobjs.mk
modules/lib7z/LZMASDK/7zC.txt
modules/lib7z/LZMASDK/7zFormat.txt
modules/lib7z/LZMASDK/Asm/x64/7zCrcT8U.asm
modules/lib7z/LZMASDK/Asm/x86/7zCrcT8U.asm
modules/lib7z/LZMASDK/C/7z.h
modules/lib7z/LZMASDK/C/7zBuf.c
modules/lib7z/LZMASDK/C/7zBuf.h
modules/lib7z/LZMASDK/C/7zBuf2.c
modules/lib7z/LZMASDK/C/7zCrc.c
modules/lib7z/LZMASDK/C/7zCrc.h
modules/lib7z/LZMASDK/C/7zCrcT8.c
modules/lib7z/LZMASDK/C/7zDec.c
modules/lib7z/LZMASDK/C/7zFile.c
modules/lib7z/LZMASDK/C/7zFile.h
modules/lib7z/LZMASDK/C/7zIn.c
modules/lib7z/LZMASDK/C/7zStream.c
modules/lib7z/LZMASDK/C/7zVersion.h
modules/lib7z/LZMASDK/C/Alloc.c
modules/lib7z/LZMASDK/C/Alloc.h
modules/lib7z/LZMASDK/C/Bcj2.c
modules/lib7z/LZMASDK/C/Bcj2.h
modules/lib7z/LZMASDK/C/Bra.c
modules/lib7z/LZMASDK/C/Bra.h
modules/lib7z/LZMASDK/C/Bra86.c
modules/lib7z/LZMASDK/C/BraIA64.c
modules/lib7z/LZMASDK/C/CpuArch.h
modules/lib7z/LZMASDK/C/Delta.c
modules/lib7z/LZMASDK/C/Delta.h
modules/lib7z/LZMASDK/C/LzFind.c
modules/lib7z/LZMASDK/C/LzFind.h
modules/lib7z/LZMASDK/C/LzFindMt.c
modules/lib7z/LZMASDK/C/LzFindMt.h
modules/lib7z/LZMASDK/C/LzHash.h
modules/lib7z/LZMASDK/C/Lzma2Dec.c
modules/lib7z/LZMASDK/C/Lzma2Dec.h
modules/lib7z/LZMASDK/C/Lzma2Enc.c
modules/lib7z/LZMASDK/C/Lzma2Enc.h
modules/lib7z/LZMASDK/C/Lzma86.h
modules/lib7z/LZMASDK/C/Lzma86Dec.c
modules/lib7z/LZMASDK/C/Lzma86Enc.c
modules/lib7z/LZMASDK/C/LzmaDec.c
modules/lib7z/LZMASDK/C/LzmaDec.h
modules/lib7z/LZMASDK/C/LzmaEnc.c
modules/lib7z/LZMASDK/C/LzmaEnc.h
modules/lib7z/LZMASDK/C/LzmaLib.c
modules/lib7z/LZMASDK/C/LzmaLib.h
modules/lib7z/LZMASDK/C/MtCoder.c
modules/lib7z/LZMASDK/C/MtCoder.h
modules/lib7z/LZMASDK/C/RotateDefs.h
modules/lib7z/LZMASDK/C/Sha256.c
modules/lib7z/LZMASDK/C/Sha256.h
modules/lib7z/LZMASDK/C/Threads.c
modules/lib7z/LZMASDK/C/Threads.h
modules/lib7z/LZMASDK/C/Types.h
modules/lib7z/LZMASDK/C/Util/7z/7z.dsp
modules/lib7z/LZMASDK/C/Util/7z/7z.dsw
modules/lib7z/LZMASDK/C/Util/7z/7zAlloc.c
modules/lib7z/LZMASDK/C/Util/7z/7zAlloc.h
modules/lib7z/LZMASDK/C/Util/7z/7zMain.c
modules/lib7z/LZMASDK/C/Util/7z/makefile
modules/lib7z/LZMASDK/C/Util/7z/makefile.gcc
modules/lib7z/LZMASDK/C/Util/Lzma/LzmaUtil.c
modules/lib7z/LZMASDK/C/Util/Lzma/LzmaUtil.dsp
modules/lib7z/LZMASDK/C/Util/Lzma/LzmaUtil.dsw
modules/lib7z/LZMASDK/C/Util/Lzma/makefile
modules/lib7z/LZMASDK/C/Util/Lzma/makefile.gcc
modules/lib7z/LZMASDK/C/Util/LzmaLib/LzmaLib.def
modules/lib7z/LZMASDK/C/Util/LzmaLib/LzmaLib.dsp
modules/lib7z/LZMASDK/C/Util/LzmaLib/LzmaLib.dsw
modules/lib7z/LZMASDK/C/Util/LzmaLib/LzmaLibExports.c
modules/lib7z/LZMASDK/C/Util/LzmaLib/makefile
modules/lib7z/LZMASDK/C/Util/LzmaLib/resource.rc
modules/lib7z/LZMASDK/C/Xz.c
modules/lib7z/LZMASDK/C/Xz.h
modules/lib7z/LZMASDK/C/XzCrc64.c
modules/lib7z/LZMASDK/C/XzCrc64.h
modules/lib7z/LZMASDK/C/XzDec.c
modules/lib7z/LZMASDK/C/XzEnc.c
modules/lib7z/LZMASDK/C/XzEnc.h
modules/lib7z/LZMASDK/C/XzIn.c
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zCompressionMode.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zCompressionMode.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zDecode.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zDecode.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zEncode.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zEncode.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zExtract.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zFolderInStream.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zFolderInStream.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zFolderOutStream.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zFolderOutStream.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zHandler.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zHandler.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zHandlerOut.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zHeader.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zHeader.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zIn.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zIn.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zItem.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zOut.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zOut.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zProperties.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zProperties.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zRegister.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zSpecStream.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zSpecStream.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zUpdate.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/7zUpdate.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/StdAfx.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/7z/StdAfx.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/Archive.def
modules/lib7z/LZMASDK/CPP/7zip/Archive/Archive2.def
modules/lib7z/LZMASDK/CPP/7zip/Archive/ArchiveExports.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/CoderMixer2.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/CoderMixer2.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/CoderMixer2MT.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/CoderMixer2MT.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/CrossThreadProgress.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/CrossThreadProgress.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/DummyOutStream.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/DummyOutStream.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/HandlerOut.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/HandlerOut.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/InStreamWithCRC.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/InStreamWithCRC.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/ItemNameUtils.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/ItemNameUtils.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/MultiStream.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/MultiStream.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/OutStreamWithCRC.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/OutStreamWithCRC.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/ParseProperties.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/ParseProperties.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/Common/StdAfx.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/DllExports2.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/IArchive.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/Icons/7z.ico
modules/lib7z/LZMASDK/CPP/7zip/Archive/LzmaHandler.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/SplitHandler.cpp
modules/lib7z/LZMASDK/CPP/7zip/Archive/StdAfx.h
modules/lib7z/LZMASDK/CPP/7zip/Archive/XzHandler.cpp
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Alone7z/Alone.dsp
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Alone7z/Alone.dsw
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Alone7z/StdAfx.cpp
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Alone7z/StdAfx.h
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Alone7z/makefile
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Alone7z/resource.rc
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Format7zExtractR/StdAfx.cpp
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Format7zExtractR/StdAfx.h
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Format7zExtractR/makefile
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Format7zExtractR/resource.rc
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Format7zR/StdAfx.cpp
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Format7zR/StdAfx.h
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Format7zR/makefile
modules/lib7z/LZMASDK/CPP/7zip/Bundles/Format7zR/resource.rc
modules/lib7z/LZMASDK/CPP/7zip/Common/CWrappers.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/CWrappers.h
modules/lib7z/LZMASDK/CPP/7zip/Common/CreateCoder.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/CreateCoder.h
modules/lib7z/LZMASDK/CPP/7zip/Common/FilePathAutoRename.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/FilePathAutoRename.h
modules/lib7z/LZMASDK/CPP/7zip/Common/FileStreams.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/FileStreams.h
modules/lib7z/LZMASDK/CPP/7zip/Common/FilterCoder.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/FilterCoder.h
modules/lib7z/LZMASDK/CPP/7zip/Common/InBuffer.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/InBuffer.h
modules/lib7z/LZMASDK/CPP/7zip/Common/InOutTempBuffer.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/InOutTempBuffer.h
modules/lib7z/LZMASDK/CPP/7zip/Common/LimitedStreams.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/LimitedStreams.h
modules/lib7z/LZMASDK/CPP/7zip/Common/LockedStream.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/LockedStream.h
modules/lib7z/LZMASDK/CPP/7zip/Common/MethodId.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/MethodId.h
modules/lib7z/LZMASDK/CPP/7zip/Common/MethodProps.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/MethodProps.h
modules/lib7z/LZMASDK/CPP/7zip/Common/OffsetStream.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/OffsetStream.h
modules/lib7z/LZMASDK/CPP/7zip/Common/OutBuffer.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/OutBuffer.h
modules/lib7z/LZMASDK/CPP/7zip/Common/ProgressUtils.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/ProgressUtils.h
modules/lib7z/LZMASDK/CPP/7zip/Common/RegisterArc.h
modules/lib7z/LZMASDK/CPP/7zip/Common/RegisterCodec.h
modules/lib7z/LZMASDK/CPP/7zip/Common/StdAfx.h
modules/lib7z/LZMASDK/CPP/7zip/Common/StreamBinder.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/StreamBinder.h
modules/lib7z/LZMASDK/CPP/7zip/Common/StreamObjects.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/StreamObjects.h
modules/lib7z/LZMASDK/CPP/7zip/Common/StreamUtils.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/StreamUtils.h
modules/lib7z/LZMASDK/CPP/7zip/Common/VirtThread.cpp
modules/lib7z/LZMASDK/CPP/7zip/Common/VirtThread.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/Bcj2Coder.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/Bcj2Coder.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/Bcj2Register.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/BcjCoder.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/BcjCoder.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/BcjRegister.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/BranchCoder.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/BranchCoder.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/BranchMisc.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/BranchMisc.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/BranchRegister.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/ByteSwap.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/CodecExports.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/CopyCoder.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/CopyCoder.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/CopyRegister.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/DeltaFilter.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/LZMA_Alone/AloneLZMA.dsp
modules/lib7z/LZMASDK/CPP/7zip/Compress/LZMA_Alone/AloneLZMA.dsw
modules/lib7z/LZMASDK/CPP/7zip/Compress/LZMA_Alone/LzmaAlone.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/LZMA_Alone/LzmaBench.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/LZMA_Alone/LzmaBench.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/LZMA_Alone/LzmaBenchCon.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/LZMA_Alone/LzmaBenchCon.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/LZMA_Alone/StdAfx.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/LZMA_Alone/StdAfx.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/LZMA_Alone/makefile
modules/lib7z/LZMASDK/CPP/7zip/Compress/LZMA_Alone/makefile.gcc
modules/lib7z/LZMASDK/CPP/7zip/Compress/Lzma2Decoder.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/Lzma2Decoder.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/Lzma2Encoder.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/Lzma2Encoder.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/Lzma2Register.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/LzmaDecoder.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/LzmaDecoder.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/LzmaEncoder.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/LzmaEncoder.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/LzmaRegister.cpp
modules/lib7z/LZMASDK/CPP/7zip/Compress/RangeCoder.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/RangeCoderBit.h
modules/lib7z/LZMASDK/CPP/7zip/Compress/StdAfx.h
modules/lib7z/LZMASDK/CPP/7zip/Crc.mak
modules/lib7z/LZMASDK/CPP/7zip/Crc2.mak
modules/lib7z/LZMASDK/CPP/7zip/Guid.txt
modules/lib7z/LZMASDK/CPP/7zip/ICoder.h
modules/lib7z/LZMASDK/CPP/7zip/IDecl.h
modules/lib7z/LZMASDK/CPP/7zip/IPassword.h
modules/lib7z/LZMASDK/CPP/7zip/IProgress.h
modules/lib7z/LZMASDK/CPP/7zip/IStream.h
modules/lib7z/LZMASDK/CPP/7zip/MyVersion.h
modules/lib7z/LZMASDK/CPP/7zip/MyVersionInfo.rc
modules/lib7z/LZMASDK/CPP/7zip/PropID.h
modules/lib7z/LZMASDK/CPP/7zip/SubBuild.mak
modules/lib7z/LZMASDK/CPP/7zip/UI/Client7z/Client7z.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Client7z/Client7z.dsp
modules/lib7z/LZMASDK/CPP/7zip/UI/Client7z/Client7z.dsw
modules/lib7z/LZMASDK/CPP/7zip/UI/Client7z/StdAfx.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Client7z/StdAfx.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Client7z/makefile
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ArchiveCommandLine.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ArchiveCommandLine.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ArchiveExtractCallback.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ArchiveName.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ArchiveName.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ArchiveOpenCallback.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ArchiveOpenCallback.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/DefaultName.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/DefaultName.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/DirItem.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/EnumDirItems.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/EnumDirItems.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ExitCode.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/Extract.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/Extract.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ExtractMode.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ExtractingFilePath.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ExtractingFilePath.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/IFileExtractCallback.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/LoadCodecs.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/LoadCodecs.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/OpenArchive.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/OpenArchive.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/PropIDUtils.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/PropIDUtils.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/Property.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/SetProperties.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/SetProperties.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/SortUtils.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/SortUtils.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/StdAfx.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/TempFiles.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/TempFiles.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/Update.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/Update.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/UpdateAction.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/UpdateAction.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/UpdateCallback.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/UpdateCallback.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/UpdatePair.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/UpdatePair.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/UpdateProduce.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/UpdateProduce.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/WorkDir.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/WorkDir.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Common/ZipRegistry.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/ConsoleClose.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/ConsoleClose.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/ExtractCallbackConsole.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/ExtractCallbackConsole.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/List.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/List.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/Main.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/MainAr.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/OpenCallbackConsole.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/OpenCallbackConsole.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/PercentPrinter.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/PercentPrinter.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/StdAfx.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/StdAfx.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/UpdateCallbackConsole.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/UserInputUtils.cpp
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/UserInputUtils.h
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/makefile
modules/lib7z/LZMASDK/CPP/7zip/UI/Console/resource.rc
modules/lib7z/LZMASDK/CPP/Build.mak
modules/lib7z/LZMASDK/CPP/Common/AutoPtr.h
modules/lib7z/LZMASDK/CPP/Common/Buffer.h
modules/lib7z/LZMASDK/CPP/Common/CRC.cpp
modules/lib7z/LZMASDK/CPP/Common/C_FileIO.cpp
modules/lib7z/LZMASDK/CPP/Common/C_FileIO.h
modules/lib7z/LZMASDK/CPP/Common/ComTry.h
modules/lib7z/LZMASDK/CPP/Common/CommandLineParser.cpp
modules/lib7z/LZMASDK/CPP/Common/CommandLineParser.h
modules/lib7z/LZMASDK/CPP/Common/Defs.h
modules/lib7z/LZMASDK/CPP/Common/DynamicBuffer.h
modules/lib7z/LZMASDK/CPP/Common/IntToString.cpp
modules/lib7z/LZMASDK/CPP/Common/IntToString.h
modules/lib7z/LZMASDK/CPP/Common/ListFileUtils.cpp
modules/lib7z/LZMASDK/CPP/Common/ListFileUtils.h
modules/lib7z/LZMASDK/CPP/Common/MyCom.h
modules/lib7z/LZMASDK/CPP/Common/MyException.h
modules/lib7z/LZMASDK/CPP/Common/MyGuidDef.h
modules/lib7z/LZMASDK/CPP/Common/MyInitGuid.h
modules/lib7z/LZMASDK/CPP/Common/MyString.cpp
modules/lib7z/LZMASDK/CPP/Common/MyString.h
modules/lib7z/LZMASDK/CPP/Common/MyUnknown.h
modules/lib7z/LZMASDK/CPP/Common/MyVector.cpp
modules/lib7z/LZMASDK/CPP/Common/MyVector.h
modules/lib7z/LZMASDK/CPP/Common/MyWindows.h
modules/lib7z/LZMASDK/CPP/Common/NewHandler.cpp
modules/lib7z/LZMASDK/CPP/Common/NewHandler.h
modules/lib7z/LZMASDK/CPP/Common/StdAfx.h
modules/lib7z/LZMASDK/CPP/Common/StdInStream.cpp
modules/lib7z/LZMASDK/CPP/Common/StdInStream.h
modules/lib7z/LZMASDK/CPP/Common/StdOutStream.cpp
modules/lib7z/LZMASDK/CPP/Common/StdOutStream.h
modules/lib7z/LZMASDK/CPP/Common/StringConvert.cpp
modules/lib7z/LZMASDK/CPP/Common/StringConvert.h
modules/lib7z/LZMASDK/CPP/Common/StringToInt.cpp
modules/lib7z/LZMASDK/CPP/Common/StringToInt.h
modules/lib7z/LZMASDK/CPP/Common/Types.h
modules/lib7z/LZMASDK/CPP/Common/UTFConvert.cpp
modules/lib7z/LZMASDK/CPP/Common/UTFConvert.h
modules/lib7z/LZMASDK/CPP/Common/Wildcard.cpp
modules/lib7z/LZMASDK/CPP/Common/Wildcard.h
modules/lib7z/LZMASDK/CPP/Windows/DLL.cpp
modules/lib7z/LZMASDK/CPP/Windows/DLL.h
modules/lib7z/LZMASDK/CPP/Windows/Defs.h
modules/lib7z/LZMASDK/CPP/Windows/Error.cpp
modules/lib7z/LZMASDK/CPP/Windows/Error.h
modules/lib7z/LZMASDK/CPP/Windows/FileDir.cpp
modules/lib7z/LZMASDK/CPP/Windows/FileDir.h
modules/lib7z/LZMASDK/CPP/Windows/FileFind.cpp
modules/lib7z/LZMASDK/CPP/Windows/FileFind.h
modules/lib7z/LZMASDK/CPP/Windows/FileIO.cpp
modules/lib7z/LZMASDK/CPP/Windows/FileIO.h
modules/lib7z/LZMASDK/CPP/Windows/FileMapping.cpp
modules/lib7z/LZMASDK/CPP/Windows/FileMapping.h
modules/lib7z/LZMASDK/CPP/Windows/FileName.cpp
modules/lib7z/LZMASDK/CPP/Windows/FileName.h
modules/lib7z/LZMASDK/CPP/Windows/Handle.h
modules/lib7z/LZMASDK/CPP/Windows/MemoryLock.cpp
modules/lib7z/LZMASDK/CPP/Windows/MemoryLock.h
modules/lib7z/LZMASDK/CPP/Windows/NtCheck.h
modules/lib7z/LZMASDK/CPP/Windows/PropVariant.cpp
modules/lib7z/LZMASDK/CPP/Windows/PropVariant.h
modules/lib7z/LZMASDK/CPP/Windows/PropVariantConversions.cpp
modules/lib7z/LZMASDK/CPP/Windows/PropVariantConversions.h
modules/lib7z/LZMASDK/CPP/Windows/Registry.cpp
modules/lib7z/LZMASDK/CPP/Windows/Registry.h
modules/lib7z/LZMASDK/CPP/Windows/StdAfx.h
modules/lib7z/LZMASDK/CPP/Windows/Synchronization.cpp
modules/lib7z/LZMASDK/CPP/Windows/Synchronization.h
modules/lib7z/LZMASDK/CPP/Windows/System.cpp
modules/lib7z/LZMASDK/CPP/Windows/System.h
modules/lib7z/LZMASDK/CPP/Windows/Thread.h
modules/lib7z/LZMASDK/CPP/Windows/Time.cpp
modules/lib7z/LZMASDK/CPP/Windows/Time.h
modules/lib7z/LZMASDK/CS/7zip/Common/CRC.cs
modules/lib7z/LZMASDK/CS/7zip/Common/CommandLineParser.cs
modules/lib7z/LZMASDK/CS/7zip/Common/InBuffer.cs
modules/lib7z/LZMASDK/CS/7zip/Common/OutBuffer.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/LZ/IMatchFinder.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/LZ/LzBinTree.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/LZ/LzInWindow.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/LZ/LzOutWindow.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/LZMA/LzmaBase.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/LZMA/LzmaDecoder.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/LZMA/LzmaEncoder.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/LzmaAlone/LzmaAlone.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/LzmaAlone/LzmaAlone.csproj
modules/lib7z/LZMASDK/CS/7zip/Compress/LzmaAlone/LzmaAlone.sln
modules/lib7z/LZMASDK/CS/7zip/Compress/LzmaAlone/LzmaBench.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/LzmaAlone/Properties/AssemblyInfo.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/LzmaAlone/Properties/Resources.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/LzmaAlone/Properties/Settings.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/RangeCoder/RangeCoder.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/RangeCoder/RangeCoderBit.cs
modules/lib7z/LZMASDK/CS/7zip/Compress/RangeCoder/RangeCoderBitTree.cs
modules/lib7z/LZMASDK/CS/7zip/ICoder.cs
modules/lib7z/LZMASDK/Java/SevenZip/CRC.java
modules/lib7z/LZMASDK/Java/SevenZip/Compression/LZ/BinTree.java
modules/lib7z/LZMASDK/Java/SevenZip/Compression/LZ/InWindow.java
modules/lib7z/LZMASDK/Java/SevenZip/Compression/LZ/OutWindow.java
modules/lib7z/LZMASDK/Java/SevenZip/Compression/LZMA/Base.java
modules/lib7z/LZMASDK/Java/SevenZip/Compression/LZMA/Decoder.java
modules/lib7z/LZMASDK/Java/SevenZip/Compression/LZMA/Encoder.java
modules/lib7z/LZMASDK/Java/SevenZip/Compression/RangeCoder/BitTreeDecoder.java
modules/lib7z/LZMASDK/Java/SevenZip/Compression/RangeCoder/BitTreeEncoder.java
modules/lib7z/LZMASDK/Java/SevenZip/Compression/RangeCoder/Decoder.java
modules/lib7z/LZMASDK/Java/SevenZip/Compression/RangeCoder/Encoder.java
modules/lib7z/LZMASDK/Java/SevenZip/ICodeProgress.java
modules/lib7z/LZMASDK/Java/SevenZip/LzmaAlone.java
modules/lib7z/LZMASDK/Java/SevenZip/LzmaBench.java
modules/lib7z/LZMASDK/Methods.txt
modules/lib7z/LZMASDK/README.mozilla
modules/lib7z/LZMASDK/history.txt
modules/lib7z/LZMASDK/lzma.txt
modules/lib7z/Makefile.in
modules/libpref/src/nsPrefService.cpp
modules/libpref/src/nsPrefService.h
modules/plugin/Makefile.in
modules/plugin/test/Makefile.in
modules/plugin/test/crashtests/110650-1.html
modules/plugin/test/crashtests/41276-1.html
modules/plugin/test/crashtests/48856-1.html
modules/plugin/test/crashtests/539897-1.html
modules/plugin/test/crashtests/540114-1.html
modules/plugin/test/crashtests/570884.html
modules/plugin/test/crashtests/598862.html
modules/plugin/test/crashtests/626602-1.html
modules/plugin/test/crashtests/crashtests.list
modules/plugin/test/mochitest/307-xo-redirect.sjs
modules/plugin/test/mochitest/Makefile.in
modules/plugin/test/mochitest/cocoa_focus.html
modules/plugin/test/mochitest/cocoa_window_focus.html
modules/plugin/test/mochitest/crashing_subpage.html
modules/plugin/test/mochitest/large-pic.jpg
modules/plugin/test/mochitest/loremipsum.txt
modules/plugin/test/mochitest/loremipsum.xtest
modules/plugin/test/mochitest/loremipsum.xtest^headers^
modules/plugin/test/mochitest/loremipsum_file.txt
modules/plugin/test/mochitest/loremipsum_nocache.txt
modules/plugin/test/mochitest/loremipsum_nocache.txt^headers^
modules/plugin/test/mochitest/neverending.sjs
modules/plugin/test/mochitest/plugin_visibility_loader.html
modules/plugin/test/mochitest/plugin_window.html
modules/plugin/test/mochitest/pluginstream.js
modules/plugin/test/mochitest/post.sjs
modules/plugin/test/mochitest/test_GCrace.html
modules/plugin/test/mochitest/test_bug479979.xul
modules/plugin/test/mochitest/test_bug532208.html
modules/plugin/test/mochitest/test_bug539565-1.html
modules/plugin/test/mochitest/test_bug539565-2.html
modules/plugin/test/mochitest/test_clear_site_data.html
modules/plugin/test/mochitest/test_cocoa_focus.html
modules/plugin/test/mochitest/test_cocoa_window_focus.html
modules/plugin/test/mochitest/test_convertpoint.xul
modules/plugin/test/mochitest/test_cookies.html
modules/plugin/test/mochitest/test_copyText.html
modules/plugin/test/mochitest/test_crash_nested_loop.html
modules/plugin/test/mochitest/test_crash_notify.xul
modules/plugin/test/mochitest/test_crash_notify_no_report.xul
modules/plugin/test/mochitest/test_crash_submit.xul
modules/plugin/test/mochitest/test_crashing.html
modules/plugin/test/mochitest/test_crashing2.html
modules/plugin/test/mochitest/test_enumerate.html
modules/plugin/test/mochitest/test_fullpage.html
modules/plugin/test/mochitest/test_getauthenticationinfo.html
modules/plugin/test/mochitest/test_hanging.html
modules/plugin/test/mochitest/test_instantiation.html
modules/plugin/test/mochitest/test_multipleinstanceobjects.html
modules/plugin/test/mochitest/test_newstreamondestroy.html
modules/plugin/test/mochitest/test_npn_asynccall.html
modules/plugin/test/mochitest/test_npn_timers.html
modules/plugin/test/mochitest/test_npobject_getters.html
modules/plugin/test/mochitest/test_npruntime.xul
modules/plugin/test/mochitest/test_npruntime_construct.html
modules/plugin/test/mochitest/test_npruntime_identifiers.html
modules/plugin/test/mochitest/test_npruntime_npnevaluate.html
modules/plugin/test/mochitest/test_npruntime_npninvoke.html
modules/plugin/test/mochitest/test_npruntime_npninvokedefault.html
modules/plugin/test/mochitest/test_npruntime_npnsetexception.html
modules/plugin/test/mochitest/test_painting.html
modules/plugin/test/mochitest/test_plugin_scroll_painting.html
modules/plugin/test/mochitest/test_pluginstream_asfile.html
modules/plugin/test/mochitest/test_pluginstream_asfileonly.html
modules/plugin/test/mochitest/test_pluginstream_err.html
modules/plugin/test/mochitest/test_pluginstream_geturl.html
modules/plugin/test/mochitest/test_pluginstream_geturlnotify.html
modules/plugin/test/mochitest/test_pluginstream_newstream.html
modules/plugin/test/mochitest/test_pluginstream_post.html
modules/plugin/test/mochitest/test_pluginstream_poststream.html
modules/plugin/test/mochitest/test_pluginstream_seek.html
modules/plugin/test/mochitest/test_pluginstream_seek_close.html
modules/plugin/test/mochitest/test_pluginstream_src.html
modules/plugin/test/mochitest/test_positioning.html
modules/plugin/test/mochitest/test_privatemode.xul
modules/plugin/test/mochitest/test_propertyAndMethod.html
modules/plugin/test/mochitest/test_redirect_handling.html
modules/plugin/test/mochitest/test_streamNotify.html
modules/plugin/test/mochitest/test_streamatclose.html
modules/plugin/test/mochitest/test_twostreams.html
modules/plugin/test/mochitest/test_visibility.html
modules/plugin/test/mochitest/test_windowed_invalidate.html
modules/plugin/test/mochitest/test_wmode.xul
modules/plugin/test/mochitest/test_xulbrowser_plugin_visibility.xul
modules/plugin/test/mochitest/utils.js
modules/plugin/test/mochitest/xulbrowser_plugin_visibility.xul
modules/plugin/test/reftest/border-padding-1-ref.html
modules/plugin/test/reftest/border-padding-1.html
modules/plugin/test/reftest/border-padding-2-ref.html
modules/plugin/test/reftest/border-padding-2.html
modules/plugin/test/reftest/border-padding-3-ref.html
modules/plugin/test/reftest/border-padding-3.html
modules/plugin/test/reftest/div-alpha-opacity.html
modules/plugin/test/reftest/div-alpha-zindex.html
modules/plugin/test/reftest/div-sanity.html
modules/plugin/test/reftest/plugin-alpha-opacity.html
modules/plugin/test/reftest/plugin-alpha-zindex.html
modules/plugin/test/reftest/plugin-background-1-step.html
modules/plugin/test/reftest/plugin-background-10-step.html
modules/plugin/test/reftest/plugin-background-2-step.html
modules/plugin/test/reftest/plugin-background-5-step.html
modules/plugin/test/reftest/plugin-background-ref.html
modules/plugin/test/reftest/plugin-background.css
modules/plugin/test/reftest/plugin-background.html
modules/plugin/test/reftest/plugin-background.js
modules/plugin/test/reftest/plugin-busy-alpha-zindex.html
modules/plugin/test/reftest/plugin-canvas-alpha-zindex.html
modules/plugin/test/reftest/plugin-sanity.html
modules/plugin/test/reftest/plugin-transform-1-ref.html
modules/plugin/test/reftest/plugin-transform-1.html
modules/plugin/test/reftest/plugin-transform-2-ref.html
modules/plugin/test/reftest/plugin-transform-2.html
modules/plugin/test/reftest/plugin-transform-alpha-zindex.html
modules/plugin/test/reftest/pluginproblemui-direction-1-ref.html
modules/plugin/test/reftest/pluginproblemui-direction-1.html
modules/plugin/test/reftest/pluginproblemui-direction-2-ref.html
modules/plugin/test/reftest/pluginproblemui-direction-2.html
modules/plugin/test/reftest/reftest.list
modules/plugin/test/reftest/windowless-clipping-1-ref.html
modules/plugin/test/reftest/windowless-clipping-1.html
modules/plugin/test/testplugin/Info.plist
modules/plugin/test/testplugin/Makefile.in
modules/plugin/test/testplugin/README
modules/plugin/test/testplugin/nptest.cpp
modules/plugin/test/testplugin/nptest.def
modules/plugin/test/testplugin/nptest.h
modules/plugin/test/testplugin/nptest.rc
modules/plugin/test/testplugin/nptest_droid.cpp
modules/plugin/test/testplugin/nptest_gtk2.cpp
modules/plugin/test/testplugin/nptest_macosx.mm
modules/plugin/test/testplugin/nptest_os2.cpp
modules/plugin/test/testplugin/nptest_platform.h
modules/plugin/test/testplugin/nptest_qt.cpp
modules/plugin/test/testplugin/nptest_utils.cpp
modules/plugin/test/testplugin/nptest_utils.h
modules/plugin/test/testplugin/nptest_windows.cpp
modules/plugin/test/unit/head_plugins.js
modules/plugin/test/unit/test_bug455213.js
modules/plugin/test/unit/test_bug471245.js
services/sync/tests/unit/test_utils_lazy.js
services/sync/tests/unit/test_utils_lazy2.js
services/sync/tests/unit/test_utils_lazySvc.js
services/sync/tests/unit/test_utils_status.js
testing/mochitest/harness-a11y.xul
testing/mochitest/pywebsocket/mod_pywebsocket/handshake/handshake.py
testing/mochitest/pywebsocket_ignore_sigint.py
testing/mochitest/redirect-a11y.html
xpcom/base/nsTelemetry.cpp
xpcom/build/dlldeps.cpp
--- a/.hgtags
+++ b/.hgtags
@@ -57,8 +57,12 @@ 138f593553b66c9f815e8f57870c19d6347f7702
 138f593553b66c9f815e8f57870c19d6347f7702 UPDATE_PACKAGING_R11_1_MU
 e56ecd8b3a68c158025207c5fd081d043e28f5ce GECKO_2_0_BASE
 e273946b74c8d631ed86bd74ba9afe0e67b12378 GECKO_2_1_BASE
 b70744835d94e54eec97b8fd186c96da5708a506 PRE_MOBILE_MERGE
 b70744835d94e54eec97b8fd186c96da5708a506 PRE_MOBILE_MERGE_20110406
 a71bd564ebf5bf4f93d13e84114f759c263130b0 MOBILE_MERGE_DONE
 a71bd564ebf5bf4f93d13e84114f759c263130b0 MOBILE_MERGE_DONE_20110406
 a95d426422816513477e5863add1b00ac7041dcb AURORA_BASE_20110412
+138f593553b66c9f815e8f57870c19d6347f7702 UPDATE_PACKAGING_R14
+9eae975b3d6fb7748fe5a3c0113d449b1c7cc0b2 AURORA_BASE_20110524
+138f593553b66c9f815e8f57870c19d6347f7702 UPDATE_PACKAGING_R14
+462c726144bc1fb45b61e774f64ac5d61b4e047c UPDATE_PACKAGING_R14
--- a/Makefile.in
+++ b/Makefile.in
@@ -157,17 +157,17 @@ endif
 SYM_STORE_SOURCE_DIRS := $(topsrcdir)
 
 include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
 
 ifdef MOZ_SYMBOLS_EXTRA_BUILDID
 EXTRA_BUILDID := -$(MOZ_SYMBOLS_EXTRA_BUILDID)
 endif
 
-export SYMBOL_INDEX_NAME = \
+SYMBOL_INDEX_NAME = \
   $(MOZ_APP_NAME)-$(MOZ_APP_VERSION)-$(OS_TARGET)-$(BUILDID)$(EXTRA_BUILDID)-symbols.txt
 
 buildsymbols:
 ifdef MOZ_CRASHREPORTER
 ifdef USE_ELF_HACK
 	$(MAKE) -C $(MOZ_BUILD_APP)/installer elfhack
 endif
 	echo building symbol store
@@ -189,17 +189,17 @@ endif
 	grep "sym" $(SYMBOL_INDEX_NAME) > $(SYMBOL_INDEX_NAME).tmp && \
 	  mv $(SYMBOL_INDEX_NAME).tmp $(SYMBOL_INDEX_NAME)
 	cd $(DIST)/crashreporter-symbols && \
           zip -r9D "../$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip" . -i "*.sym" -i "*.txt"
 endif # MOZ_CRASHREPORTER
 
 uploadsymbols:
 ifdef MOZ_CRASHREPORTER
-	$(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh "$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip"
+	$(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh $(SYMBOL_INDEX_NAME) "$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip"
 endif
 
 # defined in package-name.mk
 export MOZ_SOURCE_STAMP
 
 #XXX: this is a hack, since we don't want to clobber for MSVC
 # PGO support, but we can't do this test in client.mk
 ifneq ($(OS_ARCH)_$(GNU_CC), WINNT_)
--- a/accessible/src/atk/nsAccessibleWrap.cpp
+++ b/accessible/src/atk/nsAccessibleWrap.cpp
@@ -336,19 +336,17 @@ void nsAccessibleWrap::SetMaiHyperlink(M
 {
     NS_ASSERTION(quark_mai_hyperlink, "quark_mai_hyperlink not initialized");
     NS_ASSERTION(IS_MAI_OBJECT(mAtkObject), "Invalid AtkObject");
     if (quark_mai_hyperlink && IS_MAI_OBJECT(mAtkObject)) {
         MaiHyperlink* maiHyperlink = GetMaiHyperlink(PR_FALSE);
         if (!maiHyperlink && !aMaiHyperlink) {
             return; // Never set and we're shutting down
         }
-        if (maiHyperlink) {
-            delete maiHyperlink;
-        }
+        delete maiHyperlink;
         g_object_set_qdata(G_OBJECT(mAtkObject), quark_mai_hyperlink,
                            aMaiHyperlink);
     }
 }
 
 NS_IMETHODIMP nsAccessibleWrap::GetNativeInterface(void **aOutAccessible)
 {
     *aOutAccessible = nsnull;
--- a/accessible/src/base/nsARIAMap.cpp
+++ b/accessible/src/base/nsARIAMap.cpp
@@ -472,17 +472,18 @@ nsRoleMapEntry nsARIAMap::gWAIRoleMap[] 
   },
   {
     "tab",
     nsIAccessibleRole::ROLE_PAGETAB,
     kUseMapRole,
     eNoValue,
     eSwitchAction,
     eNoLiveAttr,
-    kNoReqStates
+    kNoReqStates,
+    eARIASelectable
   },
   {
     "tablist",
     nsIAccessibleRole::ROLE_PAGETABLIST,
     kUseMapRole,
     eNoValue,
     eNoAction,
     ePoliteLiveAttr,
--- a/accessible/src/base/nsAccDocManager.h
+++ b/accessible/src/base/nsAccDocManager.h
@@ -194,33 +194,42 @@ private:
 
 #define NS_LOG_ACCDOC_URI(aDocument)                                           \
   nsIURI *uri = aDocument->GetDocumentURI();                                   \
   nsCAutoString spec;                                                          \
   uri->GetSpec(spec);                                                          \
   printf("uri: %s", spec);
 
 #define NS_LOG_ACCDOC_TYPE(aDocument)                                          \
-  PRBool isContent = nsCoreUtils::IsContentDocument(aDocument);                \
-  printf("%s document", (isContent ? "content" : "chrome"));
+  if (aDocument->IsActive()) {                                                 \
+    PRBool isContent = nsCoreUtils::IsContentDocument(aDocument);              \
+    printf("%s document", (isContent ? "content" : "chrome"));                 \
+  } else {                                                                     \
+    printf("document type: [failed]");                                         \
+  }
 
 #define NS_LOG_ACCDOC_SHELLSTATE(aDocument)                                    \
+  nsCAutoString docShellBusy;                                                  \
   nsCOMPtr<nsISupports> container = aDocument->GetContainer();                 \
-  nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);               \
-  PRUint32 busyFlags = nsIDocShell::BUSY_FLAGS_NONE;                           \
-  docShell->GetBusyFlags(&busyFlags);                                          \
-  nsCAutoString docShellBusy;                                                  \
-  if (busyFlags == nsIDocShell::BUSY_FLAGS_NONE)                               \
-    docShellBusy.AppendLiteral("'none'");                                      \
-  if (busyFlags & nsIDocShell::BUSY_FLAGS_BUSY)                                \
-    docShellBusy.AppendLiteral("'busy'");                                      \
-  if (busyFlags & nsIDocShell::BUSY_FLAGS_BEFORE_PAGE_LOAD)                    \
-    docShellBusy.AppendLiteral(", 'before page load'");                        \
-  if (busyFlags & nsIDocShell::BUSY_FLAGS_PAGE_LOADING)                        \
-    docShellBusy.AppendLiteral(", 'page loading'");                            \
+  if (container) {                                                             \
+    nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);             \
+    PRUint32 busyFlags = nsIDocShell::BUSY_FLAGS_NONE;                         \
+    docShell->GetBusyFlags(&busyFlags);                                        \
+    if (busyFlags == nsIDocShell::BUSY_FLAGS_NONE)                             \
+      docShellBusy.AppendLiteral("'none'");                                    \
+    if (busyFlags & nsIDocShell::BUSY_FLAGS_BUSY)                              \
+      docShellBusy.AppendLiteral("'busy'");                                    \
+    if (busyFlags & nsIDocShell::BUSY_FLAGS_BEFORE_PAGE_LOAD)                  \
+      docShellBusy.AppendLiteral(", 'before page load'");                      \
+    if (busyFlags & nsIDocShell::BUSY_FLAGS_PAGE_LOADING)                      \
+      docShellBusy.AppendLiteral(", 'page loading'");                          \
+  }                                                                            \
+  else {                                                                       \
+    docShellBusy.AppendLiteral("[failed]");                                    \
+  }                                                                            \
   printf("docshell busy: %s", docShellBusy.get());
 
 #define NS_LOG_ACCDOC_DOCSTATES(aDocument)                                     \
   const char *docState = 0;                                                    \
   nsIDocument::ReadyState docStateFlag = aDocument->GetReadyStateEnum();       \
   switch (docStateFlag) {                                                      \
     case nsIDocument::READYSTATE_UNINITIALIZED:                                \
      docState = "uninitialized";                                               \
@@ -331,30 +340,32 @@ private:
 
 #define NS_LOG_ACCDOC_DOCINFO_BEGIN                                            \
   printf("  {\n");
 #define NS_LOG_ACCDOC_DOCINFO_BODY(aDocument, aDocAcc)                         \
   {                                                                            \
     printf("    ");                                                            \
     NS_LOG_ACCDOC_ADDRESS(aDocument, aDocAcc)                                  \
     printf("\n    ");                                                          \
-    NS_LOG_ACCDOC_URI(aDocument)                                               \
-    printf("\n    ");                                                          \
-    NS_LOG_ACCDOC_SHELLSTATE(aDocument)                                        \
-    printf("; ");                                                              \
-    NS_LOG_ACCDOC_TYPE(aDocument)                                              \
-    printf("\n    ");                                                          \
-    NS_LOG_ACCDOC_DOCSTATES(aDocument)                                         \
-    printf("\n    ");                                                          \
-    NS_LOG_ACCDOC_DOCPRESSHELL(aDocument)                                      \
-    printf("\n    ");                                                          \
-    NS_LOG_ACCDOC_DOCLOADGROUP(aDocument)                                      \
-    printf(", ");                                                              \
-    NS_LOG_ACCDOC_DOCPARENT(aDocument)                                         \
-    printf("\n");                                                              \
+    if (aDocument) {                                                           \
+      NS_LOG_ACCDOC_URI(aDocument)                                             \
+      printf("\n    ");                                                        \
+      NS_LOG_ACCDOC_SHELLSTATE(aDocument)                                      \
+      printf("; ");                                                            \
+      NS_LOG_ACCDOC_TYPE(aDocument)                                            \
+      printf("\n    ");                                                        \
+      NS_LOG_ACCDOC_DOCSTATES(aDocument)                                       \
+      printf("\n    ");                                                        \
+      NS_LOG_ACCDOC_DOCPRESSHELL(aDocument)                                    \
+      printf("\n    ");                                                        \
+      NS_LOG_ACCDOC_DOCLOADGROUP(aDocument)                                    \
+      printf(", ");                                                            \
+      NS_LOG_ACCDOC_DOCPARENT(aDocument)                                       \
+      printf("\n");                                                            \
+    }                                                                          \
   }
 #define NS_LOG_ACCDOC_DOCINFO_END                                              \
   printf("  }\n");
 
 #define NS_LOG_ACCDOC_DOCINFO(aDocument, aDocAcc)                              \
   NS_LOG_ACCDOC_DOCINFO_BEGIN                                                  \
   NS_LOG_ACCDOC_DOCINFO_BODY(aDocument, aDocAcc)                               \
   NS_LOG_ACCDOC_DOCINFO_END
--- a/accessible/src/base/nsAccTreeWalker.cpp
+++ b/accessible/src/base/nsAccTreeWalker.cpp
@@ -62,17 +62,17 @@ struct WalkState
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccTreeWalker
 ////////////////////////////////////////////////////////////////////////////////
 
 nsAccTreeWalker::
   nsAccTreeWalker(nsIWeakReference* aShell, nsIContent* aContent,
                   PRBool aWalkAnonContent, bool aWalkCache) :
-  mWeakShell(aShell), mState(nsnull), mWalkCache(aWalkCache)
+  mWeakShell(aShell), mWalkCache(aWalkCache), mState(nsnull)
 {
   NS_ASSERTION(aContent, "No node for the accessible tree walker!");
 
   if (aContent)
     mState = new WalkState(aContent);
 
   mChildFilter = aWalkAnonContent ? nsIContent::eAllChildren :
                                   nsIContent::eAllButXBL;
--- a/accessible/src/base/nsAccUtils.cpp
+++ b/accessible/src/base/nsAccUtils.cpp
@@ -155,17 +155,18 @@ nsAccUtils::GetPositionAndSizeForXULSele
   *aSetSize = itemsCount;
   *aPosInSet = indexOf;
 
   for (PRUint32 index = 0; index < itemsCount; index++) {
     nsCOMPtr<nsIDOMXULSelectControlItemElement> currItem;
     control->GetItemAtIndex(index, getter_AddRefs(currItem));
     nsCOMPtr<nsINode> currNode(do_QueryInterface(currItem));
 
-    nsAccessible* itemAcc = GetAccService()->GetAccessible(currNode);
+    nsAccessible* itemAcc = currNode ?
+      GetAccService()->GetAccessible(currNode) : nsnull;
 
     if (!itemAcc || itemAcc->State() & states::INVISIBLE) {
       (*aSetSize)--;
       if (index < static_cast<PRUint32>(indexOf))
         (*aPosInSet)--;
     }
   }
 
@@ -196,17 +197,18 @@ nsAccUtils::GetPositionAndSizeForXULCont
 
   // Calculate set size and position in the set.
   *aSetSize = 0, *aPosInSet = 0;
   for (PRInt32 index = indexOf; index >= 0; index--) {
     nsCOMPtr<nsIDOMXULElement> item;
     container->GetItemAtIndex(index, getter_AddRefs(item));
     nsCOMPtr<nsINode> itemNode(do_QueryInterface(item));
 
-    nsAccessible* itemAcc = GetAccService()->GetAccessible(itemNode);
+    nsAccessible* itemAcc = itemNode ?
+      GetAccService()->GetAccessible(itemNode) : nsnull;
 
     if (itemAcc) {
       PRUint32 itemRole = Role(itemAcc);
       if (itemRole == nsIAccessibleRole::ROLE_SEPARATOR)
         break; // We reached the beginning of our group.
 
       if (!(itemAcc->State() & states::INVISIBLE)) {
         (*aSetSize)++;
@@ -215,18 +217,19 @@ nsAccUtils::GetPositionAndSizeForXULCont
     }
   }
 
   for (PRInt32 index = indexOf + 1; index < static_cast<PRInt32>(itemsCount);
        index++) {
     nsCOMPtr<nsIDOMXULElement> item;
     container->GetItemAtIndex(index, getter_AddRefs(item));
     nsCOMPtr<nsINode> itemNode(do_QueryInterface(item));
-    
-    nsAccessible* itemAcc = GetAccService()->GetAccessible(itemNode);
+
+    nsAccessible* itemAcc =
+      itemNode ? GetAccService()->GetAccessible(itemNode) : nsnull;
 
     if (itemAcc) {
       PRUint32 itemRole = Role(itemAcc);
       if (itemRole == nsIAccessibleRole::ROLE_SEPARATOR)
         break; // We reached the end of our group.
 
       if (!(itemAcc->State() & states::INVISIBLE))
         (*aSetSize)++;
--- a/accessible/src/base/nsAccessNode.cpp
+++ b/accessible/src/base/nsAccessNode.cpp
@@ -50,19 +50,16 @@
 #include "nsApplicationAccessibleWrap.h"
 #include "nsIAccessibleDocument.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIDocument.h"
 #include "nsIDOMCSSPrimitiveValue.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMElement.h"
-#include "nsIDOMHTMLDocument.h"
-#include "nsIDOMHTMLElement.h"
-#include "nsIDOMNSDocument.h"
 #include "nsIDOMNSHTMLElement.h"
 #include "nsIDOMWindow.h"
 #include "nsPIDOMWindow.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIFrame.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsPresContext.h"
@@ -130,16 +127,22 @@ void nsAccessNode::LastRelease()
   }
   // ... then die.
   delete this;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccessNode public
 
+bool
+nsAccessNode::IsDefunct() const
+{
+  return !mContent;
+}
+
 PRBool
 nsAccessNode::Init()
 {
   return PR_TRUE;
 }
 
 
 void
--- a/accessible/src/base/nsAccessNode.h
+++ b/accessible/src/base/nsAccessNode.h
@@ -116,31 +116,31 @@ public:
    * Return focused node within accessible window.
    *
    * XXX: it shouldn't break us if we return focused node not depending on
    * window so that we can turn this method into util method.
    */
   already_AddRefed<nsINode> GetCurrentFocus();
 
   /**
-   * Returns true when the accessible is defunct.
-   */
-  virtual PRBool IsDefunct() { return !mContent; }
-
-  /**
    * Initialize the access node object, add it to the cache.
    */
   virtual PRBool Init();
 
   /**
    * Shutdown the access node object.
    */
   virtual void Shutdown();
 
   /**
+   * Returns true when the accessible is defunct.
+   */
+  virtual bool IsDefunct() const;
+
+  /**
    * Return frame for the given access node object.
    */
   virtual nsIFrame* GetFrame() const;
 
   /**
    * Return DOM node associated with this accessible.
    */
   already_AddRefed<nsIDOMNode> GetDOMNode() const
@@ -166,17 +166,17 @@ public:
   {
     return GetNode() && GetNode()->IsNodeOfType(nsINode::eCONTENT);
   }
   bool IsElement() const
   {
     nsINode* node = GetNode();
     return node && node->IsElement();
   }
-  PRBool IsDocument() const
+  bool IsDocumentNode() const
   {
     return GetNode() && GetNode()->IsNodeOfType(nsINode::eDOCUMENT);
   }
 
   /**
    * Return the corresponding press shell for this accessible.
    */
   already_AddRefed<nsIPresShell> GetPresShell();
--- a/accessible/src/base/nsAccessibilityService.cpp
+++ b/accessible/src/base/nsAccessibilityService.cpp
@@ -63,17 +63,17 @@
 #include "nsIDOMHTMLObjectElement.h"
 #include "nsIDOMHTMLOptGroupElement.h"
 #include "nsIDOMHTMLOptionElement.h"
 #include "nsIDOMXULElement.h"
 #include "nsIHTMLDocument.h"
 #include "nsImageFrame.h"
 #include "nsILink.h"
 #include "nsIObserverService.h"
-#include "nsIPluginInstance.h"
+#include "nsNPAPIPluginInstance.h"
 #include "nsISupportsUtils.h"
 #include "nsObjectFrame.h"
 #include "nsOuterDocAccessible.h"
 #include "nsRootAccessibleWrap.h"
 #include "nsTextFragment.h"
 #include "mozilla/Services.h"
 #include "nsEventStates.h"
 
@@ -341,18 +341,18 @@ nsAccessibilityService::CreateHTMLObject
     nsCOMPtr<nsIDOMDocument> domDoc;
     obj->GetContentDocument(getter_AddRefs(domDoc));
     if (domDoc)
       return CreateOuterDocAccessible(aContent, aPresShell);
   }
 
 #if defined(XP_WIN) || defined(MOZ_ACCESSIBILITY_ATK)
   // 2) for plugins
-  nsCOMPtr<nsIPluginInstance> pluginInstance;
-  if (NS_SUCCEEDED(aFrame->GetPluginInstance(*getter_AddRefs(pluginInstance))) &&
+  nsRefPtr<nsNPAPIPluginInstance> pluginInstance;
+  if (NS_SUCCEEDED(aFrame->GetPluginInstance(getter_AddRefs(pluginInstance))) &&
       pluginInstance) {
 #ifdef XP_WIN
     // Note: pluginPort will be null if windowless.
     HWND pluginPort = nsnull;
     aFrame->GetPluginPort(&pluginPort);
 
     nsAccessible* accessible = new nsHTMLWin32ObjectOwnerAccessible(aContent,
                                                                     weakShell,
@@ -837,16 +837,18 @@ nsAccessibilityService::GetAccessibleInS
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccessibilityService public
 
 nsAccessible*
 nsAccessibilityService::GetAccessible(nsINode* aNode)
 {
+  NS_PRECONDITION(aNode, "Getting an accessible for null node! Crash.");
+
   nsDocAccessible* document = GetDocAccessible(aNode->GetOwnerDoc());
   return document ? document->GetAccessible(aNode) : nsnull;
 }
 
 nsAccessible*
 nsAccessibilityService::GetAccessibleOrContainer(nsINode* aNode,
                                                  nsIWeakReference* aWeakShell)
 {
--- a/accessible/src/base/nsAccessible.cpp
+++ b/accessible/src/base/nsAccessible.cpp
@@ -52,17 +52,16 @@
 #include "nsAccTreeWalker.h"
 #include "nsRelUtils.h"
 #include "nsTextEquivUtils.h"
 #include "States.h"
 
 #include "nsIDOMElement.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMDocumentXBL.h"
-#include "nsIDOMDocumentTraversal.h"
 #include "nsIDOMHTMLDocument.h"
 #include "nsIDOMHTMLFormElement.h"
 #include "nsIDOMNodeFilter.h"
 #include "nsIDOMNSHTMLElement.h"
 #include "nsIDOMTreeWalker.h"
 #include "nsIDOMXULButtonElement.h"
 #include "nsIDOMXULDocument.h"
 #include "nsIDOMXULElement.h"
@@ -1529,25 +1528,30 @@ nsAccessible::GetState(PRUint32* aState,
 
 PRUint64
 nsAccessible::State()
 {
   if (IsDefunct())
     return states::DEFUNCT;
 
   PRUint64 state = NativeState();
-  // Apply ARIA states to be sure accessible states will be overriden.
+  // Apply ARIA states to be sure accessible states will be overridden.
   ApplyARIAState(&state);
 
-  if (mRoleMapEntry && mRoleMapEntry->role == nsIAccessibleRole::ROLE_PAGETAB) {
+  if (mRoleMapEntry && mRoleMapEntry->role == nsIAccessibleRole::ROLE_PAGETAB &&
+      !(state & states::SELECTED) &&
+      !mContent->AttrValueIs(kNameSpaceID_None,
+                             nsAccessibilityAtoms::aria_selected,
+                             nsAccessibilityAtoms::_false, eCaseMatters)) {
+    // Special case: for tabs, focused implies selected, unless explicitly
+    // false, i.e. aria-selected="false".
     if (state & states::FOCUSED) {
       state |= states::SELECTED;
     } else {
-      // Expose 'selected' state on ARIA tab if the focus is on internal element
-      // of related tabpanel.
+      // If focus is in a child of the tab panel surely the tab is selected!
       nsCOMPtr<nsIAccessible> tabPanel = nsRelUtils::
         GetRelatedAccessible(this, nsIAccessibleRelation::RELATION_LABEL_FOR);
 
       if (nsAccUtils::Role(tabPanel) == nsIAccessibleRole::ROLE_PROPERTYPAGE) {
         nsRefPtr<nsAccessible> tabPanelAcc(do_QueryObject(tabPanel));
         nsINode *tabPanelNode = tabPanelAcc->GetNode();
         if (nsCoreUtils::IsAncestorOf(tabPanelNode, gLastFocusedNode))
           state |= states::SELECTED;
@@ -3215,26 +3219,25 @@ nsAccessible::GetSiblingAtOffset(PRInt32
 nsAccessible *
 nsAccessible::GetFirstAvailableAccessible(nsINode *aStartNode) const
 {
   nsAccessible* accessible =
     GetAccService()->GetAccessibleInWeakShell(aStartNode, mWeakShell);
   if (accessible)
     return accessible;
 
-  nsCOMPtr<nsIDOMDocumentTraversal> trav =
-    do_QueryInterface(aStartNode->GetOwnerDoc());
-  NS_ENSURE_TRUE(trav, nsnull);
+  nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(aStartNode->GetOwnerDoc());
+  NS_ENSURE_TRUE(domDoc, nsnull);
 
   nsCOMPtr<nsIDOMNode> currentNode = do_QueryInterface(aStartNode);
-  nsCOMPtr<nsIDOMNode> rootNode(do_QueryInterface(GetNode()));
+  nsCOMPtr<nsIDOMNode> rootNode = do_QueryInterface(GetNode());
   nsCOMPtr<nsIDOMTreeWalker> walker;
-  trav->CreateTreeWalker(rootNode,
-                         nsIDOMNodeFilter::SHOW_ELEMENT | nsIDOMNodeFilter::SHOW_TEXT,
-                         nsnull, PR_FALSE, getter_AddRefs(walker));
+  domDoc->CreateTreeWalker(rootNode,
+                           nsIDOMNodeFilter::SHOW_ELEMENT | nsIDOMNodeFilter::SHOW_TEXT,
+                           nsnull, PR_FALSE, getter_AddRefs(walker));
   NS_ENSURE_TRUE(walker, nsnull);
 
   walker->SetCurrentNode(currentNode);
   while (true) {
     walker->NextNode(getter_AddRefs(currentNode));
     if (!currentNode)
       return nsnull;
 
--- a/accessible/src/base/nsAccessible.h
+++ b/accessible/src/base/nsAccessible.h
@@ -371,16 +371,19 @@ public:
    */
   void TestChildCache(nsAccessible* aCachedChild) const;
 
   //////////////////////////////////////////////////////////////////////////////
   // Downcasting
 
   inline bool IsApplication() const { return mFlags & eApplicationAccessible; }
 
+  inline bool IsDoc() const { return mFlags & eDocAccessible; }
+  nsDocAccessible* AsDoc();
+
   inline bool IsHyperText() const { return mFlags & eHyperTextAccessible; }
   nsHyperTextAccessible* AsHyperText();
 
   inline bool IsHTMLListItem() const { return mFlags & eHTMLListItemAccessible; }
   nsHTMLLIAccessible* AsHTMLListItem();
 
   inline bool IsRoot() const { return mFlags & eRootAccessible; }
   nsRootAccessible* AsRoot();
@@ -524,20 +527,21 @@ protected:
     { mFlags = (mFlags & ~kChildrenFlagsMask) | aFlag; }
 
   /**
    * Flags describing the accessible itself.
    * @note keep these flags in sync with ChildrenFlags
    */
   enum AccessibleTypes {
     eApplicationAccessible = 1 << 2,
-    eHyperTextAccessible = 1 << 3,
-    eHTMLListItemAccessible = 1 << 4,
-    eRootAccessible = 1 << 5,
-    eTextLeafAccessible = 1 << 6
+    eDocAccessible = 1 << 3,
+    eHyperTextAccessible = 1 << 4,
+    eHTMLListItemAccessible = 1 << 5,
+    eRootAccessible = 1 << 6,
+    eTextLeafAccessible = 1 << 7
   };
 
   //////////////////////////////////////////////////////////////////////////////
   // Miscellaneous helpers
 
   /**
    * Return ARIA role (helper method).
    */
--- a/accessible/src/base/nsApplicationAccessible.cpp
+++ b/accessible/src/base/nsApplicationAccessible.cpp
@@ -327,18 +327,18 @@ nsApplicationAccessible::GetPlatformVers
 
   AppendUTF8toUTF16(cversion, aVersion);
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccessNode public methods
 
-PRBool
-nsApplicationAccessible::IsDefunct()
+bool
+nsApplicationAccessible::IsDefunct() const
 {
   return nsAccessibilityService::IsShutdown();
 }
 
 PRBool
 nsApplicationAccessible::Init()
 {
   mAppInfo = do_GetService("@mozilla.org/xre/app-info;1");
--- a/accessible/src/base/nsApplicationAccessible.h
+++ b/accessible/src/base/nsApplicationAccessible.h
@@ -110,17 +110,17 @@ public:
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString &aName);
   NS_IMETHOD GetActionDescription(PRUint8 aIndex, nsAString &aDescription);
   NS_IMETHOD DoAction(PRUint8 aIndex);
 
   // nsIAccessibleApplication
   NS_DECL_NSIACCESSIBLEAPPLICATION
 
   // nsAccessNode
-  virtual PRBool IsDefunct();
+  virtual bool IsDefunct() const;
   virtual PRBool Init();
   virtual void Shutdown();
   virtual bool IsPrimaryForNode() const;
 
   // nsAccessible
   virtual void ApplyARIAState(PRUint64* aState);
   virtual void Description(nsString& aDescription);
   virtual PRUint32 NativeRole();
--- a/accessible/src/base/nsBaseWidgetAccessible.cpp
+++ b/accessible/src/base/nsBaseWidgetAccessible.cpp
@@ -88,76 +88,65 @@ nsLeafAccessible::CacheChildren()
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsLinkableAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 nsLinkableAccessible::
   nsLinkableAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
   nsAccessibleWrap(aContent, aShell),
-  mActionContent(nsnull),
+  mActionAcc(nsnull),
   mIsLink(PR_FALSE),
   mIsOnclick(PR_FALSE)
 {
 }
 
 NS_IMPL_ISUPPORTS_INHERITED0(nsLinkableAccessible, nsAccessibleWrap)
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsLinkableAccessible. nsIAccessible
 
 NS_IMETHODIMP
 nsLinkableAccessible::TakeFocus()
 {
-  nsAccessible *actionAcc = GetActionAccessible();
-  if (actionAcc)
-    return actionAcc->TakeFocus();
-
-  return nsAccessibleWrap::TakeFocus();
+  return mActionAcc ? mActionAcc->TakeFocus() : nsAccessibleWrap::TakeFocus();
 }
 
 PRUint64
 nsLinkableAccessible::NativeState()
 {
   PRUint64 states = nsAccessibleWrap::NativeState();
   if (mIsLink) {
     states |= states::LINKED;
-    nsAccessible* actionAcc = GetActionAccessible();
-    if (actionAcc->State() & states::TRAVERSED)
+    if (mActionAcc->State() & states::TRAVERSED)
       states |= states::TRAVERSED;
   }
 
   return states;
 }
 
 NS_IMETHODIMP
 nsLinkableAccessible::GetValue(nsAString& aValue)
 {
   aValue.Truncate();
 
   nsAccessible::GetValue(aValue);
   if (!aValue.IsEmpty())
     return NS_OK;
 
-  if (mIsLink) {
-    nsAccessible *actionAcc = GetActionAccessible();
-    if (actionAcc)
-      return actionAcc->GetValue(aValue);
-  }
-
-  return NS_ERROR_NOT_IMPLEMENTED;
+  return mIsLink ? mActionAcc->GetValue(aValue) : NS_ERROR_NOT_IMPLEMENTED;
 }
 
 
 NS_IMETHODIMP
 nsLinkableAccessible::GetNumActions(PRUint8 *aNumActions)
 {
   NS_ENSURE_ARG_POINTER(aNumActions);
 
-  *aNumActions = mActionContent ? 1 : 0;
+  *aNumActions = (mIsOnclick || mIsLink) ? 1 : 0;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsLinkableAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
 {
   aName.Truncate();
 
@@ -177,125 +166,98 @@ nsLinkableAccessible::GetActionName(PRUi
 }
 
 NS_IMETHODIMP
 nsLinkableAccessible::DoAction(PRUint8 aIndex)
 {
   if (aIndex != eAction_Jump)
     return NS_ERROR_INVALID_ARG;
 
-  nsAccessible *actionAcc = GetActionAccessible();
-  if (actionAcc)
-    return actionAcc->DoAction(aIndex);
-  
-  return nsAccessibleWrap::DoAction(aIndex);
+  return mActionAcc ? mActionAcc->DoAction(aIndex) :
+    nsAccessibleWrap::DoAction(aIndex);
 }
 
 NS_IMETHODIMP
 nsLinkableAccessible::GetKeyboardShortcut(nsAString& aKeyboardShortcut)
 {
   aKeyboardShortcut.Truncate();
 
-  nsAccessible *actionAcc = GetActionAccessible();
-  if (actionAcc)
-    return actionAcc->GetKeyboardShortcut(aKeyboardShortcut);
-
-  return nsAccessible::GetKeyboardShortcut(aKeyboardShortcut);
+  return mActionAcc ? mActionAcc->GetKeyboardShortcut(aKeyboardShortcut) :
+    nsAccessible::GetKeyboardShortcut(aKeyboardShortcut);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsLinkableAccessible. nsAccessNode
 
 void
 nsLinkableAccessible::Shutdown()
 {
-  mActionContent = nsnull;
+  mIsLink = PR_FALSE;
+  mIsOnclick = PR_FALSE;
+  mActionAcc = nsnull;
   nsAccessibleWrap::Shutdown();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsLinkableAccessible: HyperLinkAccessible
 
 already_AddRefed<nsIURI>
 nsLinkableAccessible::GetAnchorURI(PRUint32 aAnchorIndex)
 {
   if (mIsLink) {
-    nsAccessible* link = GetActionAccessible();
-    if (link) {
-      NS_ASSERTION(link->IsHyperLink(),
-                   "nsIAccessibleHyperLink isn't implemented.");
+    NS_ASSERTION(mActionAcc->IsHyperLink(),
+                 "nsIAccessibleHyperLink isn't implemented.");
 
-      if (link->IsHyperLink())
-        return link->GetAnchorURI(aAnchorIndex);
-    }
+    if (mActionAcc->IsHyperLink())
+      return mActionAcc->GetAnchorURI(aAnchorIndex);
   }
 
   return nsnull;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsLinkableAccessible: nsAccessible protected
 
 void
 nsLinkableAccessible::BindToParent(nsAccessible* aParent,
                                    PRUint32 aIndexInParent)
 {
   nsAccessibleWrap::BindToParent(aParent, aIndexInParent);
 
   // Cache action content.
-  mActionContent = nsnull;
+  mActionAcc = nsnull;
   mIsLink = PR_FALSE;
   mIsOnclick = PR_FALSE;
 
-  nsIContent* walkUpContent = mContent;
-  PRBool isOnclick = nsCoreUtils::HasClickListener(walkUpContent);
-
-  if (isOnclick) {
-    mActionContent = walkUpContent;
+  if (nsCoreUtils::HasClickListener(mContent)) {
     mIsOnclick = PR_TRUE;
     return;
   }
 
-  while ((walkUpContent = walkUpContent->GetParent())) {
-    nsAccessible* walkUpAcc =
-      GetAccService()->GetAccessibleInWeakShell(walkUpContent, mWeakShell);
-
+  // XXX: The logic looks broken since the click listener may be registered
+  // on non accessible node in parent chain but this node is skipped when tree
+  // is traversed.
+  nsAccessible* walkUpAcc = this;
+  while ((walkUpAcc = walkUpAcc->GetParent()) && !walkUpAcc->IsDoc()) {
     if (walkUpAcc && walkUpAcc->Role() == nsIAccessibleRole::ROLE_LINK &&
         walkUpAcc->State() & states::LINKED) {
       mIsLink = PR_TRUE;
-      mActionContent = walkUpContent;
+      mActionAcc = walkUpAcc;
       return;
     }
 
-    isOnclick = nsCoreUtils::HasClickListener(walkUpContent);
-    if (isOnclick) {
-      mActionContent = walkUpContent;
+    if (nsCoreUtils::HasClickListener(walkUpAcc->GetContent())) {
+      mActionAcc = walkUpAcc;
       mIsOnclick = PR_TRUE;
       return;
     }
   }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsLinkableAccessible: protected
-
-nsAccessible *
-nsLinkableAccessible::GetActionAccessible() const
-{
-  // Return accessible for the action content if it's different from node of
-  // this accessible. If the action accessible is not null then it is used to
-  // redirect methods calls otherwise we use method implementation from the
-  // base class.
-  if (!mActionContent || mContent == mActionContent)
-    return nsnull;
-
-  return GetAccService()->GetAccessibleInWeakShell(mActionContent, mWeakShell);
-}
-
-////////////////////////////////////////////////////////////////////////////////
 // nsEnumRoleAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 nsEnumRoleAccessible::
   nsEnumRoleAccessible(nsIContent *aNode, nsIWeakReference *aShell,
                        PRUint32 aRole) :
   nsAccessibleWrap(aNode, aShell), mRole(aRole)
 {
--- a/accessible/src/base/nsBaseWidgetAccessible.h
+++ b/accessible/src/base/nsBaseWidgetAccessible.h
@@ -103,24 +103,20 @@ public:
 
   // HyperLinkAccessible
   virtual already_AddRefed<nsIURI> GetAnchorURI(PRUint32 aAnchorIndex);
 
 protected:
   // nsAccessible
   virtual void BindToParent(nsAccessible* aParent, PRUint32 aIndexInParent);
 
-  // nsLinkableAccessible
-
   /**
-   * Return an accessible for cached action node.
+   * Parent accessible that provides an action for this linkable accessible.
    */
-  nsAccessible *GetActionAccessible() const;
-
-  nsCOMPtr<nsIContent> mActionContent;
+  nsAccessible* mActionAcc;
   PRPackedBool mIsLink;
   PRPackedBool mIsOnclick;
 };
 
 /**
  * A simple accessible that gets its enumerated role passed into constructor.
  */ 
 class nsEnumRoleAccessible : public nsAccessibleWrap
--- a/accessible/src/base/nsCaretAccessible.cpp
+++ b/accessible/src/base/nsCaretAccessible.cpp
@@ -347,22 +347,25 @@ nsCaretAccessible::GetCaretRect(nsIWidge
 
   nsRect rect;
   nsIFrame* frame = caret->GetGeometry(caretSelection, &rect);
   if (!frame || rect.IsEmpty()) {
     return nsIntRect(); // Return empty rect
   }
 
   nsPoint offset;
+  // Offset from widget origin to the frame origin, which includes chrome
+  // on the widget.
   *aOutWidget = frame->GetNearestWidget(offset);
   NS_ENSURE_TRUE(*aOutWidget, nsIntRect());
   rect.MoveBy(offset);
 
   caretRect = rect.ToOutsidePixels(frame->PresContext()->AppUnitsPerDevPixel());
-  caretRect.MoveBy((*aOutWidget)->WidgetToScreenOffset());
+  // ((content screen origin) - (content offset in the widget)) = widget origin on the screen
+  caretRect.MoveBy((*aOutWidget)->WidgetToScreenOffset() - (*aOutWidget)->GetClientOffset());
 
   // Correct for character size, so that caret always matches the size of the character
   // This is important for font size transitions, and is necessary because the Gecko caret uses the
   // previous character's size as the user moves forward in the text by character.
   PRInt32 charX, charY, charWidth, charHeight;
   if (NS_SUCCEEDED(mLastTextAccessible->GetCharacterExtents(mLastCaretOffset, &charX, &charY,
                                                             &charWidth, &charHeight,
                                                             nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE))) {
--- a/accessible/src/base/nsCoreUtils.cpp
+++ b/accessible/src/base/nsCoreUtils.cpp
@@ -488,22 +488,20 @@ nsCoreUtils::IsErrorPage(nsIDocument *aD
   PRBool isAboutScheme = PR_FALSE;
   uri->SchemeIs("about", &isAboutScheme);
   if (!isAboutScheme)
     return PR_FALSE;
 
   nsCAutoString path;
   uri->GetPath(path);
 
-  nsCAutoString::const_iterator start, end;
-  path.BeginReading(start);
-  path.EndReading(end);
+  NS_NAMED_LITERAL_CSTRING(neterror, "neterror");
+  NS_NAMED_LITERAL_CSTRING(certerror, "certerror");
 
-  NS_NAMED_LITERAL_CSTRING(neterror, "neterror");
-  return FindInReadable(neterror, start, end);
+  return StringBeginsWith(path, neterror) || StringBeginsWith(path, certerror);
 }
 
 PRBool
 nsCoreUtils::IsCorrectFrameType(nsIFrame *aFrame, nsIAtom *aAtom)
 {
   NS_ASSERTION(aFrame != nsnull,
                "aFrame is null in call to IsCorrectFrameType!");
   NS_ASSERTION(aAtom != nsnull,
--- a/accessible/src/base/nsDocAccessible.cpp
+++ b/accessible/src/base/nsDocAccessible.cpp
@@ -49,18 +49,16 @@
 #include "nsICommandManager.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIDocument.h"
 #include "nsIDOMAttr.h"
 #include "nsIDOMCharacterData.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMDocumentType.h"
-#include "nsIDOMNSDocument.h"
-#include "nsIDOMNSHTMLDocument.h"
 #include "nsIDOMXULDocument.h"
 #include "nsIDOMMutationEvent.h"
 #include "nsPIDOMWindow.h"
 #include "nsIDOMXULPopupElement.h"
 #include "nsIEditingSession.h"
 #include "nsEventStateManager.h"
 #include "nsIFrame.h"
 #include "nsHTMLSelectAccessible.h"
@@ -104,16 +102,18 @@ static const PRUint32 kRelationAttrsLen 
 
 nsDocAccessible::
   nsDocAccessible(nsIDocument *aDocument, nsIContent *aRootContent,
                   nsIWeakReference *aShell) :
   nsHyperTextAccessibleWrap(aRootContent, aShell),
   mDocument(aDocument), mScrollPositionChangedTicks(0), mIsLoaded(PR_FALSE),
   mCacheRoot(nsnull), mIsPostCacheProcessing(PR_FALSE)
 {
+  mFlags |= eDocAccessible;
+
   mDependentIDsHash.Init();
   // XXX aaronl should we use an algorithm for the initial cache size?
   mAccessibleCache.Init(kDefaultCacheSize);
   mNodeToAccessibleMap.Init(kDefaultCacheSize);
 
   // If this is a XUL Document, it should not implement nsHyperText
   if (mDocument && mDocument->IsXUL())
     mFlags &= ~eHyperTextAccessible;
@@ -404,32 +404,34 @@ NS_IMETHODIMP nsDocAccessible::GetURL(ns
     webNav->GetCurrentURI(getter_AddRefs(pURI));
     if (pURI)
       pURI->GetSpec(theURL);
   }
   CopyUTF8toUTF16(theURL, aURL);
   return NS_OK;
 }
 
-NS_IMETHODIMP nsDocAccessible::GetTitle(nsAString& aTitle)
+NS_IMETHODIMP
+nsDocAccessible::GetTitle(nsAString& aTitle)
 {
-  nsCOMPtr<nsIDOMNSDocument> domnsDocument(do_QueryInterface(mDocument));
-  if (domnsDocument) {
-    return domnsDocument->GetTitle(aTitle);
+  nsCOMPtr<nsIDOMDocument> domDocument = do_QueryInterface(mDocument);
+  if (!domDocument) {
+    return NS_ERROR_FAILURE;
   }
-  return NS_ERROR_FAILURE;
+  return domDocument->GetTitle(aTitle);
 }
 
-NS_IMETHODIMP nsDocAccessible::GetMimeType(nsAString& aMimeType)
+NS_IMETHODIMP
+nsDocAccessible::GetMimeType(nsAString& aMimeType)
 {
-  nsCOMPtr<nsIDOMNSDocument> domnsDocument(do_QueryInterface(mDocument));
-  if (domnsDocument) {
-    return domnsDocument->GetContentType(aMimeType);
+  nsCOMPtr<nsIDOMDocument> domDocument = do_QueryInterface(mDocument);
+  if (!domDocument) {
+    return NS_ERROR_FAILURE;
   }
-  return NS_ERROR_FAILURE;
+  return domDocument->GetContentType(aMimeType);
 }
 
 NS_IMETHODIMP nsDocAccessible::GetDocType(nsAString& aDocType)
 {
   nsCOMPtr<nsIDOMDocument> domDoc(do_QueryInterface(mDocument));
   nsCOMPtr<nsIDOMDocumentType> docType;
 
 #ifdef MOZ_XUL
@@ -600,16 +602,22 @@ nsDocAccessible::Init()
   NS_LOG_ACCDOCCREATE_FOR("document initialize", mDocument, this)
 
   // Initialize notification controller.
   nsCOMPtr<nsIPresShell> shell(GetPresShell());
   mNotificationController = new NotificationController(this, shell);
   if (!mNotificationController)
     return PR_FALSE;
 
+  // Mark the document accessible as loaded if its DOM document was loaded at
+  // this point (this can happen because a11y is started late or DOM document
+  // having no container was loaded.
+  if (mDocument->GetReadyStateEnum() == nsIDocument::READYSTATE_COMPLETE)
+    mIsLoaded = PR_TRUE;
+
   AddEventListeners();
   return PR_TRUE;
 }
 
 void
 nsDocAccessible::Shutdown()
 {
   if (!mWeakShell) // already shutdown
@@ -663,18 +671,18 @@ nsDocAccessible::GetFrame() const
 
   nsIFrame* root = nsnull;
   if (shell)
     root = shell->GetRootFrame();
 
   return root;
 }
 
-PRBool
-nsDocAccessible::IsDefunct()
+bool
+nsDocAccessible::IsDefunct() const
 {
   return nsHyperTextAccessibleWrap::IsDefunct() || !mDocument;
 }
 
 // nsDocAccessible protected member
 void nsDocAccessible::GetBoundsRect(nsRect& aBounds, nsIFrame** aRelativeFrame)
 {
   *aRelativeFrame = GetFrame();
@@ -1030,16 +1038,24 @@ nsDocAccessible::AttributeChangedImpl(ns
       aAttribute == nsAccessibilityAtoms::title ||
       aAttribute == nsAccessibilityAtoms::aria_label ||
       aAttribute == nsAccessibilityAtoms::aria_labelledby) {
     FireDelayedAccessibleEvent(nsIAccessibleEvent::EVENT_NAME_CHANGE,
                                aContent);
     return;
   }
 
+  if (aAttribute == nsAccessibilityAtoms::aria_busy) {
+    PRBool isOn = !aContent->AttrValueIs(aNameSpaceID, aAttribute,
+                                         nsAccessibilityAtoms::_true, eCaseMatters);
+    nsRefPtr<AccEvent> event = new AccStateChangeEvent(aContent, states::BUSY, isOn);
+    FireDelayedAccessibleEvent(event);
+    return;
+  }
+
   if (aAttribute == nsAccessibilityAtoms::selected ||
       aAttribute == nsAccessibilityAtoms::aria_selected) {
     // ARIA or XUL selection
 
     nsAccessible *multiSelect =
       nsAccUtils::GetMultiSelectableContainer(aContent);
     // Multi selects use selection_add and selection_remove
     // Single select widgets just mirror event_selection for
@@ -1109,17 +1125,18 @@ nsDocAccessible::ARIAAttributeChanged(ns
     }
     return;
   }
 
   // For aria drag and drop changes we fire a generic attribute change event;
   // at least until native API comes up with a more meaningful event.
   if (aAttribute == nsAccessibilityAtoms::aria_grabbed ||
       aAttribute == nsAccessibilityAtoms::aria_dropeffect ||
-      aAttribute == nsAccessibilityAtoms::aria_hidden) {
+      aAttribute == nsAccessibilityAtoms::aria_hidden ||
+      aAttribute == nsAccessibilityAtoms::aria_sort) {
     FireDelayedAccessibleEvent(nsIAccessibleEvent::EVENT_OBJECT_ATTRIBUTE_CHANGED,
                                aContent);
   }
 
   // We treat aria-expanded as a global ARIA state for historical reasons
   if (aAttribute == nsAccessibilityAtoms::aria_expanded) {
     nsRefPtr<AccEvent> event =
       new AccStateChangeEvent(aContent, states::EXPANDED);
--- a/accessible/src/base/nsDocAccessible.h
+++ b/accessible/src/base/nsDocAccessible.h
@@ -103,17 +103,17 @@ public:
 
   // nsIDocumentObserver
   NS_DECL_NSIDOCUMENTOBSERVER
 
   // nsAccessNode
   virtual PRBool Init();
   virtual void Shutdown();
   virtual nsIFrame* GetFrame() const;
-  virtual PRBool IsDefunct();
+  virtual bool IsDefunct() const;
   virtual nsINode* GetNode() const { return mDocument; }
   virtual nsIDocument* GetDocumentNode() const { return mDocument; }
 
   // nsAccessible
   virtual void Description(nsString& aDescription);
   virtual PRUint32 NativeRole();
   virtual PRUint64 NativeState();
   virtual void ApplyARIAState(PRUint64* aState);
@@ -547,9 +547,16 @@ protected:
    */
   nsRefPtr<NotificationController> mNotificationController;
   friend class NotificationController;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsDocAccessible,
                               NS_DOCACCESSIBLE_IMPL_CID)
 
+inline nsDocAccessible*
+nsAccessible::AsDoc()
+{
+  return mFlags & eDocAccessible ?
+    static_cast<nsDocAccessible*>(this) : nsnull;
+}
+
 #endif
--- a/accessible/src/base/nsOuterDocAccessible.cpp
+++ b/accessible/src/base/nsOuterDocAccessible.cpp
@@ -208,18 +208,18 @@ PRBool
 nsOuterDocAccessible::RemoveChild(nsAccessible *aAccessible)
 {
   nsAccessible *child = mChildren.SafeElementAt(0, nsnull);
   if (child != aAccessible) {
     NS_ERROR("Wrong child to remove!");
     return PR_FALSE;
   }
 
-  NS_LOG_ACCDOCDESTROY("remove document from outerdoc",
-                       child->GetDocumentNode())
+  NS_LOG_ACCDOCDESTROY_FOR("remove document from outerdoc",
+                           child->GetDocumentNode(), child)
   NS_LOG_ACCDOCDESTROY_ACCADDRESS("outerdoc", this)
 
   PRBool wasRemoved = nsAccessible::RemoveChild(child);
 
   NS_ASSERTION(!mChildren.Length(),
                "This child document of outerdoc accessible wasn't removed!");
 
   return wasRemoved;
--- a/accessible/src/base/nsRootAccessible.cpp
+++ b/accessible/src/base/nsRootAccessible.cpp
@@ -30,39 +30,40 @@
  * 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 ***** */
 
+#define CreateEvent CreateEventA
+#include "nsIDOMDocument.h"
+
 #include "States.h"
 #include "nsAccessibilityService.h"
 #include "nsApplicationAccessibleWrap.h"
 #include "nsAccUtils.h"
 #include "nsCoreUtils.h"
 #include "nsRelUtils.h"
 
 #include "mozilla/dom/Element.h"
 #include "nsHTMLSelectAccessible.h"
 #include "nsIDocShell.h"
 #include "nsIDocShellTreeItem.h"
 #include "nsIDocShellTreeNode.h"
 #include "nsIDocShellTreeOwner.h"
-#include "nsIDOMDocument.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMEventListener.h"
 #include "nsIDOMEventTarget.h"
 #include "nsIDOMHTMLAnchorElement.h"
 #include "nsIDOMHTMLImageElement.h"
 #include "nsIDOMHTMLInputElement.h"
 #include "nsIDOMHTMLSelectElement.h"
 #include "nsIDOMDataContainerEvent.h"
-#include "nsIDOMNSDocument.h"
 #include "nsIDOMNSEvent.h"
 #include "nsIDOMXULMenuListElement.h"
 #include "nsIDOMXULMultSelectCntrlEl.h"
 #include "nsIDOMXULSelectCntrlItemEl.h"
 #include "nsIDOMXULPopupElement.h"
 #include "nsIDocument.h"
 #include "nsIEventListenerManager.h"
 #include "nsIFrame.h"
@@ -71,21 +72,18 @@
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsISelectionPrivate.h"
 #include "nsIServiceManager.h"
 #include "nsPIDOMWindow.h"
 #include "nsIWebBrowserChrome.h"
 #include "nsReadableUtils.h"
 #include "nsRootAccessible.h"
 #include "nsIDOMNSEventTarget.h"
-#include "nsIDOMDocumentEvent.h"
 #include "nsIPrivateDOMEvent.h"
 #include "nsFocusManager.h"
-#include "mozilla/dom/Element.h"
-
 
 #ifdef MOZ_XUL
 #include "nsXULTreeAccessible.h"
 #include "nsIXULDocument.h"
 #include "nsIXULWindow.h"
 #endif
 
 using namespace mozilla;
@@ -135,17 +133,17 @@ nsRootAccessible::GetName(nsAString& aNa
 
   if (mRoleMapEntry) {
     nsAccessible::GetName(aName);
     if (!aName.IsEmpty()) {
       return NS_OK;
     }
   }
 
-  nsCOMPtr<nsIDOMNSDocument> document(do_QueryInterface(mDocument));
+  nsCOMPtr<nsIDOMDocument> document = do_QueryInterface(mDocument);
   return document->GetTitle(aName);
 }
 
 PRUint32
 nsRootAccessible::NativeRole()
 {
   // If it's a <dialog> or <wizard>, use nsIAccessibleRole::ROLE_DIALOG instead
   dom::Element *root = mDocument->GetRootElement();
@@ -410,21 +408,21 @@ nsRootAccessible::FireCurrentFocusEvent(
 
   // Simulate a focus event so that we can reuse code that fires focus for
   // container children like treeitems.
   nsCOMPtr<nsINode> focusedNode = GetCurrentFocus();
   if (!focusedNode) {
     return; // No current focus
   }
 
-  nsCOMPtr<nsIDOMDocumentEvent> docEvent = do_QueryInterface(mDocument);
-  if (docEvent) {
+  nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(mDocument);
+  if (domDoc) {
     nsCOMPtr<nsIDOMEvent> event;
-    if (NS_SUCCEEDED(docEvent->CreateEvent(NS_LITERAL_STRING("Events"),
-                                           getter_AddRefs(event))) &&
+    if (NS_SUCCEEDED(domDoc->CreateEvent(NS_LITERAL_STRING("Events"),
+                                         getter_AddRefs(event))) &&
         NS_SUCCEEDED(event->InitEvent(NS_LITERAL_STRING("focus"), PR_TRUE, PR_TRUE))) {
 
       nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(event));
       nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(focusedNode));
       privateEvent->SetTarget(target);
       HandleEvent(event);
     }
   }
--- a/accessible/src/base/nsTextEquivUtils.cpp
+++ b/accessible/src/base/nsTextEquivUtils.cpp
@@ -292,17 +292,17 @@ nsTextEquivUtils::AppendFromValue(nsAcce
     nsresult rv = aAccessible->GetValue(text);
     NS_ENSURE_SUCCESS(rv, rv);
 
     return AppendString(aString, text) ?
       NS_OK : NS_OK_NO_NAME_CLAUSE_HANDLED;
   }
 
   //XXX: is it necessary to care the accessible is not a document?
-  if (aAccessible->IsDocument())
+  if (aAccessible->IsDocumentNode())
     return NS_ERROR_UNEXPECTED;
 
   nsIContent *content = aAccessible->GetContent();
 
   nsCOMPtr<nsIContent> parent = content->GetParent();
   PRInt32 indexOf = parent->IndexOf(content);
 
   for (PRInt32 i = indexOf - 1; i >= 0; i--) {
--- a/accessible/src/html/nsHTMLTableAccessible.cpp
+++ b/accessible/src/html/nsHTMLTableAccessible.cpp
@@ -44,17 +44,16 @@
 #include "nsAccTreeWalker.h"
 #include "nsAccUtils.h"
 #include "nsDocAccessible.h"
 #include "nsRelUtils.h"
 #include "nsTextEquivUtils.h"
 
 #include "nsIDOMElement.h"
 #include "nsIDOMDocument.h"
-#include "nsIDOMDocumentRange.h"
 #include "nsIDOMRange.h"
 #include "nsISelection2.h"
 #include "nsISelectionPrivate.h"
 #include "nsINameSpaceManager.h"
 #include "nsIDOMHTMLCollection.h"
 #include "nsIDOMHTMLTableCellElement.h"
 #include "nsIDOMHTMLTableElement.h"
 #include "nsIDOMHTMLTableRowElement.h"
--- a/accessible/src/html/nsHyperTextAccessible.cpp
+++ b/accessible/src/html/nsHyperTextAccessible.cpp
@@ -911,17 +911,17 @@ nsresult nsHyperTextAccessible::GetTextH
       // 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));
-      nsCOMPtr<nsFrameSelection> frameSelection;
+      nsRefPtr<nsFrameSelection> frameSelection;
       rv = privateSelection->GetFrameSelection(getter_AddRefs(frameSelection));
       NS_ENSURE_SUCCESS(rv, rv);
 
       if (frameSelection->GetHint() == nsFrameSelection::HINTLEFT) {
         -- aOffset;  // We are at the start of a line
       }
     }
   }
@@ -1009,17 +1009,17 @@ nsresult nsHyperTextAccessible::GetTextH
   else {
     finalStartOffset = GetRelativeOffset(presShell, startFrame, startOffset,
                                          startAcc, amount, eDirPrevious,
                                          needsStart);
     NS_ENSURE_TRUE(finalStartOffset >= 0, NS_ERROR_FAILURE);
   }
 
   if (aType == eGetBefore) {
-    endOffset = aOffset;
+    finalEndOffset = aOffset;
   }
   else {
     // Start moving forward from the start so that we don't get 
     // 2 words/lines if the offset occurred on whitespace boundary
     // Careful, startOffset and endOffset are passed by reference to GetPosAndText() and changed
     // For BOUNDARY_LINE_END, make sure we start of this line
     startOffset = endOffset = finalStartOffset + (aBoundaryType == BOUNDARY_LINE_END);
     nsRefPtr<nsAccessible> endAcc;
@@ -1675,17 +1675,17 @@ PRInt32 nsHyperTextAccessible::GetCaretL
 {
   // 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);
-  nsCOMPtr<nsFrameSelection> frameSelection;
+  nsRefPtr<nsFrameSelection> frameSelection;
   privateSelection->GetFrameSelection(getter_AddRefs(frameSelection));
   NS_ENSURE_TRUE(frameSelection, -1);
 
   nsCOMPtr<nsIDOMNode> caretNode;
   domSel->GetFocusNode(getter_AddRefs(caretNode));
   nsCOMPtr<nsIContent> caretContent = do_QueryInterface(caretNode);
   if (!caretContent || !nsCoreUtils::IsAncestorOf(GetNode(), caretContent))
     return -1;
--- a/accessible/src/mac/mozAccessible.mm
+++ b/accessible/src/mac/mozAccessible.mm
@@ -233,25 +233,25 @@ GetNativeFromGeckoAccessible(nsIAccessib
   if ([attribute isEqualToString:NSAccessibilityEnabledAttribute])
     return [NSNumber numberWithBool:[self isEnabled]];
   if ([attribute isEqualToString:NSAccessibilityValueAttribute])
     return [self value];
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
   if ([attribute isEqualToString:NSAccessibilityRoleDescriptionAttribute])
     return NSAccessibilityRoleDescription([self role], nil);
 #endif
-  if ([attribute isEqualToString:kInstanceDescriptionAttribute])
+  if ([attribute isEqualToString: (NSString*) kInstanceDescriptionAttribute])
     return [self customDescription];
   if ([attribute isEqualToString:NSAccessibilityFocusedAttribute])
     return [NSNumber numberWithBool:[self isFocused]];
   if ([attribute isEqualToString:NSAccessibilitySizeAttribute])
     return [self size];
   if ([attribute isEqualToString:NSAccessibilityWindowAttribute])
     return [self window];
-  if ([attribute isEqualToString:kTopLevelUIElementAttribute])
+  if ([attribute isEqualToString: (NSString*) kTopLevelUIElementAttribute])
     return [self window];
   if ([attribute isEqualToString:NSAccessibilityTitleAttribute] || 
       [attribute isEqualToString:NSAccessibilityTitleUIElementAttribute])
     return [self title];
   if ([attribute isEqualToString:NSAccessibilityHelpAttribute])
     return [self help];
     
 #ifdef DEBUG
@@ -466,17 +466,17 @@ GetNativeFromGeckoAccessible(nsIAccessib
 }
 
 - (NSString*)role
 {
 #ifdef DEBUG_A11Y
   NS_ASSERTION(nsAccUtils::IsTextInterfaceSupportCorrect(mGeckoAccessible),
                "Does not support nsIAccessibleText when it should");
 #endif
-  return AXRoles[mRole];
+  return (NSString*) AXRoles[mRole];
 }
 
 - (NSString*)subrole
 {
   return nil;
 }
 
 - (NSString*)title
--- a/accessible/src/mac/nsAccessibleWrap.h
+++ b/accessible/src/mac/nsAccessibleWrap.h
@@ -38,45 +38,46 @@
 
 /* For documentation of the accessibility architecture, 
  * see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html
  */
 
 #ifndef _nsAccessibleWrap_H_
 #define _nsAccessibleWrap_H_
 
+#include <objc/objc.h>
+
 #include "nsAccessible.h"
 #include "nsAccUtils.h"
 #include "States.h"
 
 #include "nsCOMPtr.h"
 #include "nsRect.h"
 
 #include "nsTArray.h"
 #include "nsAutoPtr.h"
 
 struct AccessibleWrapper;
-struct objc_class;
 
 class nsAccessibleWrap : public nsAccessible
 {
   public: // construction, destruction
     nsAccessibleWrap(nsIContent *aContent, nsIWeakReference *aShell);
     virtual ~nsAccessibleWrap();
     
     // creates the native accessible connected to this one.
     virtual PRBool Init ();
     
     // get the native obj-c object (mozAccessible)
     NS_IMETHOD GetNativeInterface (void **aOutAccessible);
     
     // the objective-c |Class| type that this accessible's native object
     // should be instantied with.   used on runtime to determine the
     // right type for this accessible's associated native object.
-    virtual objc_class* GetNativeType ();
+    virtual Class GetNativeType ();
 
     virtual void Shutdown ();
     virtual void InvalidateChildren();
 
     virtual nsresult HandleAccEvent(AccEvent* aEvent);
 
     // ignored means that the accessible might still have children, but is not displayed
     // to the user. it also has no native accessible object represented for it.
--- a/accessible/src/mac/nsAccessibleWrap.mm
+++ b/accessible/src/mac/nsAccessibleWrap.mm
@@ -83,17 +83,17 @@ nsAccessibleWrap::GetNativeInterface (vo
     *aOutInterface = (void**)mNativeWrapper->getNativeObject();
     return NS_OK;
   }
   return NS_ERROR_FAILURE;
 }
 
 // overridden in subclasses to create the right kind of object. by default we create a generic
 // 'mozAccessible' node.
-objc_class*
+Class
 nsAccessibleWrap::GetNativeType () 
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
 
   PRUint32 role = Role();
   switch (role) {
     case nsIAccessibleRole::ROLE_PUSHBUTTON:
     case nsIAccessibleRole::ROLE_SPLITBUTTON:
--- a/accessible/src/mac/nsRootAccessibleWrap.h
+++ b/accessible/src/mac/nsRootAccessibleWrap.h
@@ -49,17 +49,17 @@ struct objc_class;
 
 class nsRootAccessibleWrap : public nsRootAccessible
 {
 public:
   nsRootAccessibleWrap(nsIDocument *aDocument, nsIContent *aRootContent,
                        nsIWeakReference *aShell);
   virtual ~nsRootAccessibleWrap();
 
-    objc_class* GetNativeType ();
+    Class GetNativeType ();
     
     // let's our native accessible get in touch with the
     // native cocoa view that is our accessible parent.
     void GetNativeWidget (void **aOutView);
 };
 
 
 #endif
--- a/accessible/src/mac/nsRootAccessibleWrap.mm
+++ b/accessible/src/mac/nsRootAccessibleWrap.mm
@@ -54,17 +54,17 @@ nsRootAccessibleWrap::
   nsRootAccessible(aDocument, aRootContent, aShell)
 {
 }
 
 nsRootAccessibleWrap::~nsRootAccessibleWrap()
 {
 }
 
-objc_class*
+Class
 nsRootAccessibleWrap::GetNativeType ()
 {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
 
   return [mozRootAccessible class];
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
--- a/accessible/src/msaa/nsAccessNodeWrap.cpp
+++ b/accessible/src/msaa/nsAccessNodeWrap.cpp
@@ -270,17 +270,17 @@ STDMETHODIMP nsAccessNodeWrap::get_attri
     /* [length_is][size_is][out] */ BSTR __RPC_FAR *aAttribNames,
     /* [length_is][size_is][out] */ short __RPC_FAR *aNameSpaceIDs,
     /* [length_is][size_is][out] */ BSTR __RPC_FAR *aAttribValues,
     /* [out] */ unsigned short __RPC_FAR *aNumAttribs)
 {
 __try{
   *aNumAttribs = 0;
 
-  if (IsDefunct() || IsDocument())
+  if (IsDefunct() || IsDocumentNode())
     return E_FAIL;
 
   PRUint32 numAttribs = mContent->GetAttrCount();
   if (numAttribs > aMaxAttribs)
     numAttribs = aMaxAttribs;
   *aNumAttribs = static_cast<unsigned short>(numAttribs);
 
   for (PRUint32 index = 0; index < numAttribs; index++) {
@@ -343,17 +343,17 @@ STDMETHODIMP nsAccessNodeWrap::get_compu
     /* [in] */ boolean aUseAlternateView,
     /* [length_is][size_is][out] */ BSTR __RPC_FAR *aStyleProperties,
     /* [length_is][size_is][out] */ BSTR __RPC_FAR *aStyleValues,
     /* [out] */ unsigned short __RPC_FAR *aNumStyleProperties)
 {
 __try{
   *aNumStyleProperties = 0;
 
-  if (IsDefunct() || IsDocument())
+  if (IsDefunct() || IsDocumentNode())
     return E_FAIL;
 
   nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl =
     nsCoreUtils::GetComputedStyleDeclaration(EmptyString(), mContent);
   NS_ENSURE_TRUE(cssDecl, E_FAIL);
 
   PRUint32 length;
   cssDecl->GetLength(&length);
@@ -378,17 +378,17 @@ STDMETHODIMP nsAccessNodeWrap::get_compu
 
 STDMETHODIMP nsAccessNodeWrap::get_computedStyleForProperties( 
     /* [in] */ unsigned short aNumStyleProperties,
     /* [in] */ boolean aUseAlternateView,
     /* [length_is][size_is][in] */ BSTR __RPC_FAR *aStyleProperties,
     /* [length_is][size_is][out] */ BSTR __RPC_FAR *aStyleValues)
 {
 __try {
-  if (IsDefunct() || IsDocument())
+  if (IsDefunct() || IsDocumentNode())
     return E_FAIL;
  
   nsCOMPtr<nsIDOMCSSStyleDeclaration> cssDecl =
     nsCoreUtils::GetComputedStyleDeclaration(EmptyString(), mContent);
   NS_ENSURE_TRUE(cssDecl, E_FAIL);
 
   PRUint32 index;
   for (index = 0; index < aNumStyleProperties; index ++) {
--- a/accessible/src/msaa/nsAccessibleWrap.cpp
+++ b/accessible/src/msaa/nsAccessibleWrap.cpp
@@ -1757,16 +1757,48 @@ nsAccessibleWrap::GetXPAccessibleFor(con
 
   // if its us real easy - this seems to always be the case
   if (aVarChild.lVal == CHILDID_SELF)
     return this;
 
   if (nsAccUtils::MustPrune(this))
     return nsnull;
 
+  // If lVal negative then it is treated as child ID and we should look for
+  // accessible through whole accessible subtree including subdocuments.
+  // Otherwise we treat lVal as index in parent.
+
+  if (aVarChild.lVal < 0) {
+    // Convert child ID to unique ID.
+    void* uniqueID = reinterpret_cast<void*>(-aVarChild.lVal);
+
+    // Document.
+    if (IsDoc())
+      return AsDoc()->GetAccessibleByUniqueIDInSubtree(uniqueID);
+
+    // ARIA document.
+    if (ARIARole() == nsIAccessibleRole::ROLE_DOCUMENT) {
+      nsDocAccessible* document = GetDocAccessible();
+      nsAccessible* child =
+        document->GetAccessibleByUniqueIDInSubtree(uniqueID);
+
+      // Check whether the accessible for the given ID is a child of ARIA
+      // document.
+      nsAccessible* parent = child ? child->GetParent() : nsnull;
+      while (parent && parent != document) {
+        if (parent == this)
+          return child;
+
+        parent = parent->GetParent();
+      }
+    }
+
+    return nsnull;
+  }
+
   // Gecko child indices are 0-based in contrast to indices used in MSAA.
   return GetChildAt(aVarChild.lVal - 1);
 }
 
 void nsAccessibleWrap::UpdateSystemCaret()
 {
   // Move the system caret so that Windows Tablet Edition and tradional ATs with 
   // off-screen model can follow the caret
--- a/accessible/src/msaa/nsAccessibleWrap.h
+++ b/accessible/src/msaa/nsAccessibleWrap.h
@@ -322,17 +322,17 @@ public: // construction, destruction
    * We will use an invisible system caret.
    * Gecko is still responsible for drawing its own caret
    */
   void UpdateSystemCaret();
 
   /**
    * Find an accessible by the given child ID in cached documents.
    */
-  virtual nsAccessible *GetXPAccessibleFor(const VARIANT& aVarChild);
+  nsAccessible* GetXPAccessibleFor(const VARIANT& aVarChild);
 
   NS_IMETHOD GetNativeInterface(void **aOutAccessible);
 
   // NT4 does not have the oleacc that defines these methods. So we define copies here that automatically
   // load the library only if needed.
   static STDMETHODIMP AccessibleObjectFromWindow(HWND hwnd,DWORD dwObjectID,REFIID riid,void **ppvObject);
   static STDMETHODIMP NotifyWinEvent(DWORD event,HWND hwnd,LONG idObjectType,LONG idObject);
 
--- a/accessible/src/msaa/nsDocAccessibleWrap.cpp
+++ b/accessible/src/msaa/nsDocAccessibleWrap.cpp
@@ -94,32 +94,16 @@ STDMETHODIMP nsDocAccessibleWrap::QueryI
 
   if (NULL == *ppv)
     return nsHyperTextAccessibleWrap::QueryInterface(iid, ppv);
     
   (reinterpret_cast<IUnknown*>(*ppv))->AddRef();
   return S_OK;
 }
 
-nsAccessible*
-nsDocAccessibleWrap::GetXPAccessibleFor(const VARIANT& aVarChild)
-{
-  // If lVal negative then it is treated as child ID and we should look for
-  // accessible through whole accessible subtree including subdocuments.
-  // Otherwise we treat lVal as index in parent.
-
-  if (aVarChild.vt == VT_I4 && aVarChild.lVal < 0) {
-    // Convert child ID to unique ID.
-    void* uniqueID = reinterpret_cast<void*>(-aVarChild.lVal);
-    return GetAccessibleByUniqueIDInSubtree(uniqueID);
-  }
-
-  return nsAccessibleWrap::GetXPAccessibleFor(aVarChild);
-}
-
 STDMETHODIMP nsDocAccessibleWrap::get_URL(/* [out] */ BSTR __RPC_FAR *aURL)
 {
 __try {
   *aURL = NULL;
 
   nsAutoString URL;
   nsresult rv = GetURL(URL);
   if (NS_FAILED(rv))
--- a/accessible/src/msaa/nsDocAccessibleWrap.h
+++ b/accessible/src/msaa/nsDocAccessibleWrap.h
@@ -87,19 +87,16 @@ public:
     // Override get_accValue to provide URL when no other value is available
     virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_accValue( 
         /* [optional][in] */ VARIANT varChild,
         /* [retval][out] */ BSTR __RPC_FAR *pszValue);
 
   // nsAccessNode
   virtual void Shutdown();
 
-  // nsAccessibleWrap
-  virtual nsAccessible *GetXPAccessibleFor(const VARIANT& varChild);
-
   // nsDocAccessible
   virtual void* GetNativeWindow() const;
 
 protected:
   // nsDocAccessible
   virtual void NotifyOfInitialUpdate();
 
 protected:
--- a/accessible/src/xul/nsXULTreeAccessible.cpp
+++ b/accessible/src/xul/nsXULTreeAccessible.cpp
@@ -151,18 +151,18 @@ nsXULTreeAccessible::GetValue(nsAString&
   }
 
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeAccessible: nsAccessNode implementation
 
-PRBool
-nsXULTreeAccessible::IsDefunct()
+bool
+nsXULTreeAccessible::IsDefunct() const
 {
   return nsAccessibleWrap::IsDefunct() || !mTree || !mTreeView;
 }
 
 void
 nsXULTreeAccessible::Shutdown()
 {
   // XXX: we don't remove accessible from document cache if shutdown wasn't
@@ -829,18 +829,18 @@ nsXULTreeItemAccessibleBase::DoAction(PR
 
   DoCommand(nsnull, aIndex);
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeItemAccessibleBase: nsAccessNode implementation
 
-PRBool
-nsXULTreeItemAccessibleBase::IsDefunct()
+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;
 }
@@ -1086,18 +1086,18 @@ nsXULTreeItemAccessible::GetName(nsAStri
     mTreeView->GetCellValue(mRow, mColumn, aName);
 
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeItemAccessible: nsAccessNode implementation
 
-PRBool
-nsXULTreeItemAccessible::IsDefunct()
+bool
+nsXULTreeItemAccessible::IsDefunct() const
 {
   return nsXULTreeItemAccessibleBase::IsDefunct() || !mColumn;
 }
 
 PRBool
 nsXULTreeItemAccessible::Init()
 {
   if (!nsXULTreeItemAccessibleBase::Init())
--- a/accessible/src/xul/nsXULTreeAccessible.h
+++ b/accessible/src/xul/nsXULTreeAccessible.h
@@ -75,17 +75,17 @@ public:
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXULTreeAccessible,
                                            nsAccessible)
 
   // nsIAccessible
   NS_IMETHOD GetValue(nsAString& aValue);
   NS_IMETHOD GetFocusedChild(nsIAccessible **aFocusedChild);
 
   // nsAccessNode
-  virtual PRBool IsDefunct();
+  virtual bool IsDefunct() const;
   virtual void Shutdown();
 
   // nsAccessible
   virtual PRUint32 NativeRole();
   virtual PRUint64 NativeState();
   virtual nsAccessible* GetChildAtPoint(PRInt32 aX, PRInt32 aY,
                                         EWhichChildAtPoint aWhichChild);
 
@@ -196,17 +196,17 @@ public:
                            PRInt32 *aSimilarItemsInGroup,
                            PRInt32 *aPositionInGroup);
 
   NS_IMETHOD GetNumActions(PRUint8 *aCount);
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
   NS_IMETHOD DoAction(PRUint8 aIndex);
 
   // nsAccessNode
-  virtual PRBool IsDefunct();
+  virtual bool IsDefunct() const;
   virtual void Shutdown();
   virtual bool IsPrimaryForNode() const;
 
   // nsAccessible
   virtual PRUint64 NativeState();
   virtual PRInt32 GetIndexInParent() const;
 
   // nsXULTreeItemAccessibleBase
@@ -261,17 +261,17 @@ class nsXULTreeItemAccessible : public n
 public:
   nsXULTreeItemAccessible(nsIContent *aContent, nsIWeakReference *aShell,
                           nsAccessible *aParent, nsITreeBoxObject *aTree,
                           nsITreeView *aTreeView, PRInt32 aRow);
 
   NS_IMETHOD GetName(nsAString& aName);
 
   // nsAccessNode
-  virtual PRBool IsDefunct();
+  virtual bool IsDefunct() const;
   virtual PRBool Init();
   virtual void Shutdown();
 
   // nsAccessible
   virtual PRUint32 NativeRole();
 
   // nsXULTreeItemAccessibleBase
   virtual void RowInvalidated(PRInt32 aStartColIdx, PRInt32 aEndColIdx);
--- a/accessible/src/xul/nsXULTreeGridAccessible.cpp
+++ b/accessible/src/xul/nsXULTreeGridAccessible.cpp
@@ -1082,18 +1082,18 @@ nsXULTreeGridCellAccessible::IsSelected(
   NS_ENSURE_SUCCESS(rv, rv);
 
   return selection->IsSelected(mRow, aIsSelected);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeGridCellAccessible: nsAccessNode implementation
 
-PRBool
-nsXULTreeGridCellAccessible::IsDefunct()
+bool
+nsXULTreeGridCellAccessible::IsDefunct() const
 {
   return nsLeafAccessible::IsDefunct() || !mParent || !mTree || !mTreeView ||
     !mColumn;
 }
 
 PRBool
 nsXULTreeGridCellAccessible::Init()
 {
--- a/accessible/src/xul/nsXULTreeGridAccessible.h
+++ b/accessible/src/xul/nsXULTreeGridAccessible.h
@@ -150,17 +150,17 @@ public:
   NS_IMETHOD GetNumActions(PRUint8 *aCount);
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
   NS_IMETHOD DoAction(PRUint8 aIndex);
 
   // nsIAccessibleTableCell
   NS_DECL_NSIACCESSIBLETABLECELL
 
   // nsAccessNode
-  virtual PRBool IsDefunct();
+  virtual bool IsDefunct() const;
   virtual PRBool Init();
   virtual bool IsPrimaryForNode() const;
 
   // nsAccessible
   virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
   virtual PRUint32 NativeRole();
   virtual PRUint64 NativeState();
   virtual PRInt32 GetIndexInParent() const;
--- a/accessible/tests/mochitest/Makefile.in
+++ b/accessible/tests/mochitest/Makefile.in
@@ -85,26 +85,24 @@ include $(topsrcdir)/config/rules.mk
 		value.js \
 		test_aria_activedescendant.html \
 		test_aria_role_article.html \
 		test_aria_role_equation.html \
 		test_aria_roles.html \
 		test_aria_roles.xul \
 		test_aria_token_attrs.html \
 		test_bug420863.html \
-	$(warning   test_childAtPoint.html temporarily disabled) \
-	$(warning	test_childAtPoint.xul temporarily disabled) \
+		test_childAtPoint.html \
+		test_childAtPoint.xul \
 		test_descr.html \
 		test_elm_landmarks.html \
 		test_elm_listbox.xul \
-	$(warning   test_elm_media.html temporarily disabled) \
 		test_elm_nsApplicationAcc.html \
 		test_elm_plugin.html \
 		test_keys.html \
-	$(warning test_nsIAccessible_comboboxes.xul temporarily disabled) \
  		test_nsIAccessible_selects.html \
 		test_nsIAccessibleDocument.html \
 		test_nsIAccessibleImage.html \
 		test_nsIAccessNode_utils.html \
 		test_nsOuterDocAccessible.html \
 		test_role_nsHyperTextAcc.html \
 		test_takeFocus.html \
 		test_text_caret.html \
--- a/accessible/tests/mochitest/actions/Makefile.in
+++ b/accessible/tests/mochitest/actions/Makefile.in
@@ -47,14 +47,15 @@ include $(topsrcdir)/config/rules.mk
 
 _TEST_FILES =\
 		test_anchors.html \
 		test_aria.html \
 		test_general.html \
 		test_general.xul \
 		test_inputs.html \
 		test_link.html \
+		test_media.html \
 		test_tree.xul \
 		test_treegrid.xul \
 		$(NULL)
 
 libs:: $(_TEST_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir)
--- a/accessible/tests/mochitest/actions/test_general.html
+++ b/accessible/tests/mochitest/actions/test_general.html
@@ -31,19 +31,29 @@
           ID: "li_clickable2",
           actionName: "click",
           events: CLICK_EVENTS
         },
         {
           ID: "li_clickable3",
           actionName: "click",
           events: CLICK_EVENTS
+        },
+        {
+          ID: "onclick_img",
+          actionName: "click",
+          events: CLICK_EVENTS
         }
       ];
+
       testActions(actionsArray);
+
+      getAccessible("onclick_img").takeFocus();
+is(getAccessible("link1").numActions, 1, "links should have one action");
+is(getAccessible("link2").numActions, 1, "link with onclick handler should have 1 action");
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
   </script>
 </head>
 
 <body>
@@ -53,20 +63,31 @@
      title="nsHTMLLiAccessible shouldn't be inherited from linkable accessible">
     Mozilla Bug 523789
   </a><br>
   <a target="_blank"
      href="https://bugzilla.mozilla.org/show_bug.cgi?id=423409"
      title="Expose click action if mouseup and mousedown are registered">
     Mozilla Bug 423409
   </a>
+  <a target="_blank"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=659620"
+     title="hang when trying to edit a page on wikimo with NVDA running">
+    Mozilla Bug 659620
+  </a>
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
   <ul>
     <li id="li_clickable1" onclick="">Clickable list item</li>
     <li id="li_clickable2" onmousedown="">Clickable list item</li>
     <li id="li_clickable3" onmouseup="">Clickable list item</li>
   </ul>
+
+  <!-- linkable accessibles -->
+  <img id="onclick_img" onclick="" src="../moz.png">
+
+  <a id="link1" href="www">linkable textleaf accessible</a>
+  <div id="link2" onclick="">linkable textleaf accessible</div>
 </body>
 </html>
rename from accessible/tests/mochitest/test_elm_media.html
rename to accessible/tests/mochitest/actions/test_media.html
--- a/accessible/tests/mochitest/test_elm_media.html
+++ b/accessible/tests/mochitest/actions/test_media.html
@@ -8,25 +8,25 @@ https://bugzilla.mozilla.org/show_bug.cg
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="events.js"></script>
+          src="../events.js"></script>
   <script type="application/javascript"
-          src="actions.js"></script>
+          src="../actions.js"></script>
   <script type="application/javascript"
-          src="role.js"></script>
+          src="../role.js"></script>
   <script type="application/javascript"
-          src="states.js"></script>
+          src="../states.js"></script>
 
   <script type="application/javascript">
 
     // gA11yEventDumpID = "eventDump";
 
     function focusChecker(aAcc)
     {
       this.type = EVENT_FOCUS;
@@ -54,87 +54,49 @@ https://bugzilla.mozilla.org/show_bug.cg
         is(aEvent.accessible.name, aName,
            "Wrong name of " + prettyName(aEvent.accessible) + " on focus");
       }
     }
 
     function doTest()
     {
       //////////////////////////////////////////////////////////////////////////
-      // test the accessible tree
+      // test actions of audio controls
 
-      var accTree = {
-        role: ROLE_GROUPING,
-        children: [
-          { // start/stop button
-            role: ROLE_PUSHBUTTON,
-            name: "Play",
-            states: {
-              states: STATE_FOCUSABLE
-            }
-          },
-          { // buffer bar
-            role: ROLE_PROGRESSBAR
-          },
-          { // progress bar
-            role: ROLE_PROGRESSBAR
-          },
-          { // slider of progress bar
-            role: ROLE_SLIDER,
-            name: "0:00 of 0:01 elapsed",
-            states: {
-              states: STATE_FOCUSABLE
-            }
-          },
-          { // duration label, role="presentation"
-            role: ROLE_NOTHING
-          },
-          { // mute button
-            role: ROLE_PUSHBUTTON,
-            name: "Mute",
-            states: {
-              states: STATE_FOCUSABLE
-            }
-          }
-        ]
-      };
-      testAccessibleTree("audio", accTree);
-
-      //////////////////////////////////////////////////////////////////////////
-      // test actions of audio controls
+      todo(false, "Focus test are disabled until bug 494175 is fixed.");
 
       var audioElm = getAccessible("audio");
       var playBtn = audioElm.firstChild;
       var scrubber = playBtn.nextSibling.nextSibling.nextSibling;
       var muteBtn = audioElm.lastChild;
 
       var actions = [
         {
           ID: muteBtn,
           actionName: "press",
           events: CLICK_EVENTS,
           eventSeq: [
-            new focusChecker(muteBtn),
+     //       new focusChecker(muteBtn),
             new nameChecker(muteBtn, "Unmute"),
           ]
         },
-        {
-          ID: scrubber,
-          actionName: "activate",
-          events: null,
-          eventSeq: [
-            new focusChecker(scrubber)
-          ]
-        },
+     //   {
+     //     ID: scrubber,
+     //     actionName: "activate",
+     //     events: null,
+     //     eventSeq: [
+     //       new focusChecker(scrubber)
+     //     ]
+     //   },
         {
           ID: playBtn,
           actionName: "press",
           events: CLICK_EVENTS,
           eventSeq: [
-            new focusChecker(playBtn),
+     //       new focusChecker(playBtn),
             new nameChecker(playBtn, "Pause"),
           ]
         }
       ];
 
       testActions(actions); // Will call SimpleTest.finish();
     }
 
@@ -147,14 +109,14 @@ https://bugzilla.mozilla.org/show_bug.cg
   <a target="_blank"
      title="Expose HTML5 video and audio elements' embedded controls through accessibility APIs"
      href="https://bugzilla.mozilla.org/show_bug.cgi?id=483573">Mozilla Bug 483573</a>
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
-  <audio id="audio" src="bug461281.ogg"
+  <audio id="audio" src="../bug461281.ogg"
          controls="true"></audio>
 
   <div id="eventDump"></div>
 </body>
 </html>
--- a/accessible/tests/mochitest/attributes/test_obj_group.xul
+++ b/accessible/tests/mochitest/attributes/test_obj_group.xul
@@ -25,31 +25,34 @@
       testGroupAttrs("item1", 1, 2);
       testGroupAttrs("item2", 2, 2);
 
       //////////////////////////////////////////////////////////////////////////
       // xul:menu (bug 443881)
       var menu1 = document.getElementById("menu_item1");
       menu1.open = true;
 
-      window.setTimeout(function() {
+      menu1.addEventListener("popupshown", function() {
         var menu2 = document.getElementById("menu_item2");
         menu2.open = true;
 
-        window.setTimeout(function() {
+        menu2.addEventListener("popupshown", function() {
           testGroupAttrs("menu_item1.1", 1, 1);
           testGroupAttrs("menu_item1.2", 1, 3);
           testGroupAttrs("menu_item1.4", 2, 3);
           testGroupAttrs("menu_item2", 3, 3);
           testGroupAttrs("menu_item2.1", 1, 2, 1);
           testGroupAttrs("menu_item2.2", 2, 2, 1);
 
+          menu1.open = false;
+          menu2.open = false;
+
           SimpleTest.finish();
-        }, 200);
-      }, 200);
+        }, false);
+      }, false);
 
       //////////////////////////////////////////////////////////////////////////
       // xul:tab
       testGroupAttrs("tab1", 1, 2);
       testGroupAttrs("tab2", 2, 2);
 
       //////////////////////////////////////////////////////////////////////////
       // xul:radio
--- a/accessible/tests/mochitest/common.js
+++ b/accessible/tests/mochitest/common.js
@@ -88,17 +88,17 @@ function addA11yLoadEvent(aFunc)
       function()
       {
         var accDoc = getAccessible(document);
         var state = {};
         accDoc.getState(state, {});
         if (state.value & STATE_BUSY)
           return waitForDocLoad();
 
-        window.setTimeout(aFunc, 150);
+        window.setTimeout(aFunc, 0);
       },
       0
     );
   }
 
   SimpleTest.waitForFocus(waitForDocLoad);
 }
 
--- a/accessible/tests/mochitest/events/Makefile.in
+++ b/accessible/tests/mochitest/events/Makefile.in
@@ -46,18 +46,18 @@ include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
 _TEST_FILES =\
 		docload_wnd.html \
 		docload_wnd.xul \
 		focus.html \
 		scroll.html \
 		test_aria_alert.html \
-		test_aria_hidden.html \
 		test_aria_menu.html \
+		test_aria_objattr.html \
 		test_aria_statechange.html \
 		test_attrs.html \
 		test_caretmove.html \
 		test_caretmove.xul \
 		test_coalescence.html \
 		test_contextmenu.html \
 		test_docload.html \
 		test_docload.xul \
--- a/accessible/tests/mochitest/events/docload_wnd.xul
+++ b/accessible/tests/mochitest/events/docload_wnd.xul
@@ -187,34 +187,34 @@
       {
         return "reload page";
       }
     }
 
     /**
      * Load wrong URI what results in error page loading.
      */
-    function loadErrorPageInvoker()
+    function loadErrorPageInvoker(aURL, aURLDescr)
     {
       this.invoke = function loadErrorPageInvoker_invoke()
       {
-        gTabBrowser.loadURI("www.wronguri.wronguri");
+        gTabBrowser.loadURI(aURL);
       }
 
       this.eventSeq = [
         // We don't expect state change for busy true, load stopped events since
         // things happen quickly and it's coalesced.
         new invokerChecker(EVENT_REORDER, getContainer),
         new invokerChecker(EVENT_DOCUMENT_LOAD_COMPLETE, getDocument),
         new stateBusyChecker(false)
       ];
 
       this.getID = function loadErrorPageInvoker_getID()
       {
-        return "load error page";
+        return "load error page: '" + aURLDescr + "'";
       }
     }
 
     ////////////////////////////////////////////////////////////////////////////
     // Tests
 
     var gQueue = null;
 
@@ -225,17 +225,21 @@
     {
       gTabBrowser = document.getElementById("content");
 
       gQueue = new gOpenerWnd.eventQueue();
       gQueue.push(new loadURIInvoker("about:"));
       gQueue.push(new clickReloadBtnInvoker());
       gQueue.push(new loadURIInvoker("about:mozilla"));
       gQueue.push(new reloadInvoker());
-      gQueue.push(new loadErrorPageInvoker());
+      gQueue.push(new loadErrorPageInvoker("www.wronguri.wronguri",
+                                           "Server not found"));
+      gQueue.push(new loadErrorPageInvoker("https://nocert.example.com:443",
+                                          "Untrusted Connection"));
+
       gQueue.onFinish = function() { window.close(); }
       gQueue.invoke();
     }
 
     gOpenerWnd.addA11yLoadEvent(doTest);
   ]]>
   </script>
 
rename from accessible/tests/mochitest/events/test_aria_hidden.html
rename to accessible/tests/mochitest/events/test_aria_objattr.html
--- a/accessible/tests/mochitest/events/test_aria_hidden.html
+++ b/accessible/tests/mochitest/events/test_aria_objattr.html
@@ -1,12 +1,12 @@
 <html>
 
 <head>
-  <title>Accessible ARIA hidden attribute</title>
+  <title>Accessible ARIA object attribute changes</title>
 
   <link rel="stylesheet" type="text/css"
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
@@ -38,42 +38,73 @@
       }
 
       this.getID = function hideNode_getID()
       {
         return "aria-hidden for " + aID + " " + bHide;
       }
     }
 
+    function updateSort(aID, aSort)
+    {
+      this.node = getNode(aID);
+      this.accessible = getAccessible(this.node);
+
+      this.eventSeq = [
+        new invokerChecker(EVENT_OBJECT_ATTRIBUTE_CHANGED, this.accessible),
+      ];
+
+      this.invoke = function updateSort_invoke()
+      {
+        this.node.setAttribute("aria-sort", aSort);
+      }
+
+      this.getID = function updateSort_getID()
+      {
+        return "aria-sort for " + aID + " " + aSort;
+      }
+    }
+
+    // Debug stuff.
+    // gA11yEventDumpID = "eventdump";
+    // gA11yEventDumpToConsole = true;
+    
     function doTests()
     {
-      //gA11yEventDumpID = "eventdump"; // debug stuff
-
       gQueue = new eventQueue();
 
       gQueue.push(new hideNode("hideable", "true"));
 
+      gQueue.push(new updateSort("sortable", "ascending"));
+
       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=581096"
      title="Add support for aria-hidden">
     Mozilla Bug 581096
   </a>
 
+  <a target="_blank"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=640707"
+     title="Add event support for aria-sort">
+    Mozilla Bug 640707
+  </a>
+
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
   <div id="eventdump"></div>
 
   <div id="hideable"><div>Hi</div><div>there</div></div>
 
+  <div id="sortable" role="columnheader" aria-sort"none">aria-sort</div>
 </body>
 </html>
--- a/accessible/tests/mochitest/events/test_aria_statechange.html
+++ b/accessible/tests/mochitest/events/test_aria_statechange.html
@@ -21,65 +21,97 @@
   <script type="application/javascript">
 
 
     /**
      * Do tests.
      */
     var gQueue = null;
 
+    // Debug stuff.
+    //gA11yEventDumpID = "eventdump";
+    // gA11yEventDumpToConsole = true;
+
     function expandNode(aNodeOrID, bExpand)
     {
       this.DOMNode = getNode(aNodeOrID);
 
-      this.invoke = function expand_invoke() {
+      this.invoke = function expandNode_invoke() {
         // Note: this should fire an EVENT_STATE_CHANGE
         this.DOMNode.setAttribute("aria-expanded", bExpand);
       };
 
-      this.check = function expand_check() {
+      this.check = function expandNode_check() {
         testStates(aNodeOrID,
                    bExpand ? STATE_EXPANDED : STATE_COLLAPSED,
                    EXT_STATE_EXPANDABLE);
       };
 
-      this.getID = function changeValue_getID() {
+      this.getID = function expandNode_getID() {
         return prettyName(aNodeOrID) + " aria-expanded changed";
       };
     }
 
+    function busyify(aNodeOrID, aBusy)
+    {
+      this.DOMNode = getNode(aNodeOrID);
+
+      this.invoke = function busyify_invoke() {
+        this.DOMNode.setAttribute("aria-busy", aBusy);
+      };
+
+      this.check = function busyify_check(event) {
+        testStates(aNodeOrID,
+                   (aBusy ? STATE_BUSY : 0), 0,
+                   (aBusy ? 0 : STATE_BUSY), 0);
+      };
+
+      this.getID = function busyify_getID() {
+        return prettyName(aNodeOrID) + " aria-busy changed to " + aBusy;
+      };
+    }
+
     function doTests()
     {
-      gQueue = new eventQueue(nsIAccessibleEvent.EVENT_STATE_CHANGE);
+      gQueue = new eventQueue(EVENT_STATE_CHANGE);
 
       gQueue.push(new expandNode("section", true));
       gQueue.push(new expandNode("section", false));
       gQueue.push(new expandNode("div", true));
       gQueue.push(new expandNode("div", false));
 
+      gQueue.push(new busyify("aria_doc", true));
+      gQueue.push(new busyify("aria_doc", 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=551684"
      title="No statechange event for aria-expanded on native HTML elements, is fired on ARIA widgets">
     Mozilla Bug 551684
   </a>
 
+  <a target="_blank"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=648133"
+     title="fire state change event for aria-busy"
+    Mozilla Bug 648133
+  </a>
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
   <div id="eventdump"></div>
 
   <!-- aria-expanded -->
   <div id="section" role="section" aria-expanded="false">expandable section</div>
   <div id="div" aria-expanded="false">expandable native div</div>
 
+  <!-- aria-busy -->
+  <div id="aria_doc" role="document" tabindex="0">A document</div>
 </body>
 </html>
--- a/accessible/tests/mochitest/events/test_docload.html
+++ b/accessible/tests/mochitest/events/test_docload.html
@@ -113,16 +113,35 @@
         if (aAction == kRemove)
           return "remove iframe";
 
         return "change display style of iframe to " +
           ((aAction == kHide) ? "none" : "block");
       }
     }
 
+    function makeIFrameVisible(aID)
+    {
+      this.DOMNode = getNode(aID);
+
+      this.eventSeq = [
+        new invokerChecker(EVENT_REORDER, this.DOMNode.parentNode)
+      ];
+
+      this.invoke = function makeIFrameVisible_invoke()
+      {
+        this.DOMNode.style.visibility = "visible";
+      }
+
+      this.getID = function makeIFrameVisible_getID()
+      {
+        return "The accessible for DOM document loaded before it's shown shouldn't have busy state.";
+      }
+    }
+
     function openDialogWnd(aURL)
     {
       // Get application root accessible.
       var docAcc = getAccessible(document);
       while (docAcc) {
         this.mRootAcc = docAcc;
         try {
           docAcc = docAcc.parent;
@@ -219,33 +238,51 @@
 
     ////////////////////////////////////////////////////////////////////////////
     // Do tests
 
     var gQueue = null;
 
     // Debug stuff.
     // gA11yEventDumpID = "eventdump";
-    // gA11yEventDumpToConsole = true;
+    //gA11yEventDumpToConsole = true;
 
     function doTests()
     {
       gQueue = new eventQueue();
 
       gQueue.push(new changeIframeSrc("iframe", "about:"));
       gQueue.push(new changeIframeSrc("iframe", "about:buildconfig"));
       gQueue.push(new morphIFrame("iframe", kHide));
       gQueue.push(new morphIFrame("iframe", kShow));
       gQueue.push(new morphIFrame("iframe", kRemove));
+      gQueue.push(new makeIFrameVisible("iframe2"));
       gQueue.push(new openDialogWnd("about:"));
       gQueue.push(new openWndShutdownDoc());
 
+      gQueue.onFinish = doLastCallTests;
+
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
 
+    function doLastCallTests()
+    {
+      //////////////////////////////////////////////////////////////////////////
+      // makeIFrameVisible() test, part2
+
+      // The document shouldn't have busy state (the DOM document was loaded
+      // before its accessible was created). Do this test lately to make sure
+      // the content of document accessible was created initially, prior to this
+      // the document accessible keeps busy state. The initial creation happens
+      // asynchronously after document creation, there are no events we could
+      // use to catch it.
+      var iframeDoc = getAccessible("iframe2").firstChild;
+      testStates(iframeDoc, 0, 0, STATE_BUSY);
+    }
+
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTests);
   </script>
 </head>
 
 <body>
 
   <a target="_blank"
@@ -263,18 +300,24 @@
      title="Reorganize accessible document handling">
     Mozilla Bug 566103
   </a><br>
   <a target="_blank"
      href="https://bugzilla.mozilla.org/show_bug.cgi?id=571459"
      title="Shutdown document accessible when presshell goes away">
     Mozilla Bug 571459
   </a>
+  <a target="_blank"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=658185"
+     title="The DOM document loaded before it's shown shouldn't have busy state">
+    Mozilla Bug 658185
+  </a>
 
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
   <div id="testContainer"><iframe id="iframe"></iframe></div>
+  <div id="testContainer2"><iframe id="iframe2" src="about:" style="visibility: hidden;"></iframe></div>
   <div id="eventdump"></div>
 </body>
 </html>
--- a/accessible/tests/mochitest/states/Makefile.in
+++ b/accessible/tests/mochitest/states/Makefile.in
@@ -43,16 +43,18 @@ VPATH		= @srcdir@
 relativesrcdir  = accessible/states
 
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
 _TEST_FILES =\
 		test_aria.html \
 		test_aria_imgmap.html \
+		test_aria_tabs.html \
+		test_comboboxes.xul \
 		test_doc.html \
 		test_docarticle.html \
 		test_editablebody.html \
 		test_frames.html \
 		test_inputs.html \
 		test_inputs.xul \
 		test_link.html \
 		test_popup.xul \
new file mode 100644
--- /dev/null
+++ b/accessible/tests/mochitest/states/test_aria_tabs.html
@@ -0,0 +1,137 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+  <title>Test ARIA tab accessible selected state</title>
+
+  <link rel="stylesheet" type="text/css"
+        href="chrome://mochikit/content/tests/SimpleTest/test.css" />
+
+  <script type="application/javascript"
+          src="chrome://mochikit/content/MochiKit/packed.js"></script>
+  <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="../states.js"></script>
+  <script type="application/javascript"
+          src="../events.js"></script>
+
+  <script type="application/javascript">
+    function focusARIATab(aID, aIsSelected)
+    {
+      this.DOMNode = getNode(aID);
+
+      this.invoke = function focusARIATab_invoke()
+      {
+        this.DOMNode.focus();
+      }
+
+      this.check = function focusARIATab_check(aEvent)
+      {
+        testStates(this.DOMNode, aIsSelected ? STATE_SELECTED : 0, 0,
+                   aIsSelected ? 0 : STATE_SELECTED);
+      }
+
+      this.getID = function focusARIATab_getID()
+      {
+        return "Focused ARIA Tab with aria-selected=" +
+                (aIsSelected ? "true, should" : "false, shouldn't") +
+                " have selected state on " + prettyName(aID);
+      }
+    }
+
+    function focusActiveDescendantTab(aTabID, aTabListID, aIsSelected)
+    {
+      this.DOMNode = getNode(aTabID);
+      this.tabListDOMNode = getNode(aTabListID);
+
+      this.invoke = function focusActiveDescendantTab_invoke()
+      {
+        this.tabListDOMNode.setAttribute("aria-activedescendant", aTabID);
+        this.tabListDOMNode.focus();
+      }
+
+      this.check = function focusActiveDescendantTab_check(aEvent)
+      {
+        testStates(this.DOMNode, aIsSelected ? STATE_SELECTED : 0, 0,
+                   aIsSelected ? 0 : STATE_SELECTED);
+      }
+
+      this.getID = function tabActiveDescendant_getID()
+      {
+        return "ARIA Tab with activedescendant " +
+                (aIsSelected ? "should" : "shouldn't") +
+                " have the selected state on " + prettyName(aTabID);
+      }
+    }
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Test
+
+    //gA11yEventDumpID = "eventdump"; // debug stuff
+    //gA11yEventDumpToConsole = true;
+
+    var gQueue = null;
+
+    function doTest()
+    {
+      // simple tabs
+      testStates("aria_tab1", 0, 0, STATE_SELECTED);
+      testStates("aria_tab2", STATE_SELECTED);
+
+      // To make sure our focus != selected is truly under test, we need to
+      // make sure our cache of what currently has focus is correct, which
+      // we update asyncronously.
+      gQueue = new eventQueue(EVENT_FOCUS);
+
+      gQueue.push(new focusARIATab("aria_tab1", true));
+      gQueue.push(new focusARIATab("aria_tab3", false));
+      gQueue.push(new focusARIATab("aria_tab2", true));
+
+      // selection through aria-activedescendant
+      // Make sure initially setting it selects the tab.
+      gQueue.push(new focusActiveDescendantTab("aria_tab5", "aria_tablist2", true));
+
+      // Now, make sure if one is selected selection gets transferred properly.
+      gQueue.push(new focusActiveDescendantTab("aria_tab6", "aria_tablist2", true));
+
+      // Now, make sure the focused but explicitly unselected one behaves.
+      gQueue.push(new focusActiveDescendantTab("aria_tab4", "aria_tablist2", false));
+
+      gQueue.invoke(); // SimpleTest.finish() will be called in the end
+    }
+
+    SimpleTest.waitForExplicitFinish();
+    addA11yLoadEvent(doTest);
+  </script>
+</head>
+<body>
+
+  <a target="_blank"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=653601"
+     title="aria-selected ignored for ARIA tabs">
+    Mozilla Bug 653601
+  </a>
+  <p id="display"></p>
+  <div id="content" style="display: none"></div>
+  <pre id="test">
+  </pre>
+
+  <!-- tab -->
+  <div id="aria_tablist" role="tablist">
+    <div id="aria_tab1" role="tab" tabindex="0">unselected tab</div>
+    <div id="aria_tab2" role="tab" tabindex="0" aria-selected="true">selected tab</div>
+    <div id="aria_tab3" role="tab" tabindex="0" aria-selected="false">focused explicitly unselected tab</div>
+  </div>
+  
+  <!-- test activeDescendant -->
+  <div id="aria_tablist2" role="tablist" tabindex="0">
+    <div id="aria_tab4" role="tab" aria-selected="false">focused explicitly unselected tab</div>
+    <div id="aria_tab5" role="tab">initially selected tab</div>
+    <div id="aria_tab6" role="tab">later selected tab</div>
+  </div>
+</body>
+</html>
rename from accessible/tests/mochitest/test_nsIAccessible_comboboxes.xul
rename to accessible/tests/mochitest/states/test_comboboxes.xul
--- a/accessible/tests/mochitest/test_nsIAccessible_comboboxes.xul
+++ b/accessible/tests/mochitest/states/test_comboboxes.xul
@@ -11,19 +11,19 @@
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" />
 
   <script type="application/javascript"
-          src="common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="events.js" />        
+          src="../events.js" />
 
   <script type="application/javascript">
   <![CDATA[
     function openHideCombobox(aComboboxNodeOrID, aIsOpen)
     {
       this.invoke = function invoke()
       {
         synthesizeMouse(this.DOMNode, 5, 5, {});
@@ -59,16 +59,17 @@
       gQueue.push(new openHideCombobox(ID, true));
       gQueue.push(new openHideCombobox(ID, false));
 
       // XXX: searchbar doesn't fire state change events because accessible
       // parent of combobox_list accessible is pushbutton accessible.
       //var searchbar = document.getElementById("searchbar");
       //gQueue.push(new openHideCombobox(searchbar, true));
       //gQueue.push(new openHideCombobox(searchbar, false));
+      todo(false, "Enable states test for XUL searchbar widget!");
 
       gQueue.invoke(); // Will call SimpleTest.finish();
     }
 
     // This is the hack needed for searchbar work outside of browser.
     function getBrowser()
     {
       return {
--- a/accessible/tests/mochitest/test_childAtPoint.html
+++ b/accessible/tests/mochitest/test_childAtPoint.html
@@ -20,29 +20,29 @@
       // Not specific case, child and deepchild testing.
       var list = getAccessible("list");
       var listitem = getAccessible("listitem");
       var image = getAccessible("image");
       testChildAtPoint(list, 1, 1, false, listitem);
       testChildAtPoint(list, 1, 1, true, image.firstChild);
 
       // ::MustPrune case (in this case childAtPoint doesn't look inside a
-      // button), point is inside of button.
-      var btn = getAccessible("btn");
-      testChildAtPoint(btn, 1, 1, false, btn);
-      testChildAtPoint(btn, 1, 1, true, btn);
+      // textbox), point is inside of textbox.
+      var txt = getAccessible("txt");
+      testChildAtPoint(txt, 1, 1, false, txt);
+      testChildAtPoint(txt, 1, 1, true, txt);
 
-      // ::MustPrune case, point is outside of button accessible but is in
+      // ::MustPrune case, point is outside of textbox accessible but is in
       // document.
-      testChildAtPoint(btn, -1, 1, false, null);
-      testChildAtPoint(btn, -1, 1, true, null);
+      testChildAtPoint(txt, -1, 1, false, null);
+      testChildAtPoint(txt, -1, 1, true, null);
 
       // ::MustPrune case, point is outside of root accessible.
-      testChildAtPoint(btn, -10000, 10000, false, null);
-      testChildAtPoint(btn, -10000, 10000, true, null);
+      testChildAtPoint(txt, -10000, 10000, false, null);
+      testChildAtPoint(txt, -10000, 10000, true, null);
 
       // Not specific case, point is inside of label accessible.
       var label = getAccessible("label");
       var labelText = label.firstChild;
       testChildAtPoint(label, 1, 1, false, labelText);
       testChildAtPoint(label, 1, 1, true, labelText);
   
       // Not specific case, point is outside of label accessible.
@@ -77,16 +77,16 @@
   </pre>
 
   <div role="list" id="list">
     <div role="listitem" id="listitem"><span role="image" id="image">img</span>item</div>
   </div>
 
   <span role="label">label1</span><span role="label" id="label">label2</span>
 
-  <span role="button">btn1</span><span role="button" id="btn">btn2</span>
+  <span role="textbox">textbox1</span><span role="textbox" id="txt">textbox2</span>
 
   <div id="outofflow" style="width: 10px; height: 10px; position: absolute; left: 0px; top: 0px; background-color: yellow;">
   </div>
   <div id="area" style="width: 100px; height: 100px; background-color: blue;"></div>
 
 </body>
 </html>
--- a/accessible/tests/mochitest/test_childAtPoint.xul
+++ b/accessible/tests/mochitest/test_childAtPoint.xul
@@ -19,18 +19,17 @@
   <script type="application/javascript"
           src="layout.js" />
 
   <script type="application/javascript">
   <![CDATA[
     function doTest()
     {
       // Initialize the tree
-      var view = new inTreeView();
-      view.mRowCount = 5;
+      var view = new nsTableTreeView(5);
 
       var tree = getNode("tree");
       var treeBox = tree.treeBoxObject;
       treeBox.view = view;
 
       // Tests
       var treecols = getNode("treecols");
       var x = treecols.boxObject.x;
--- a/accessible/tests/mochitest/text/Makefile.in
+++ b/accessible/tests/mochitest/text/Makefile.in
@@ -45,15 +45,15 @@ relativesrcdir  = accessible/text
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
 _TEST_FILES = \
 		doc.html \
 		test_doc.html \
 		test_hypertext.html \
 		test_passwords.html \
-	$(warning test_singleline.html disabled due to bug 652459) \
-	$(warning test_whitespaces.html disabled due to bug 652459) \
+		test_singleline.html \
+		test_whitespaces.html \
 		test_words.html \
 		$(NULL)
 
 libs:: $(_TEST_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir)
--- a/accessible/tests/mochitest/text/test_singleline.html
+++ b/accessible/tests/mochitest/text/test_singleline.html
@@ -211,50 +211,50 @@
       // BOUNDARY_CHAR
       testCharBeforeOffset(IDs, 0, "", 0, 0);
       testCharBeforeOffset(IDs, 1, "h", 0, 1);
       testCharBeforeOffset(IDs, 14, "n", 13, 14);
       testCharBeforeOffset(IDs, 15, "d", 14, 15);
 
       // BOUNDARY_WORD_START
       testTextBeforeOffset(0, BOUNDARY_WORD_START, "", 0, 0,
-                           "input", kTodo, kOk, kTodo,
-                           "div", kTodo, kOk, kTodo,
-                           "editable", kTodo, kOk, kTodo,
-                           "textarea", kTodo, kOk, kTodo);
+                           "input", kOk, kOk, kOk,
+                           "div", kOk, kOk, kOk,
+                           "editable", kOk, kOk, kOk,
+                           "textarea", kOk, kOk, kOk);
       testTextBeforeOffset(1, BOUNDARY_WORD_START, "", 0, 0,
                            "input", kTodo, kOk, kTodo,
                            "div", kTodo, kOk, kTodo,
                            "editable", kTodo, kOk, kTodo,
                            "textarea", kTodo, kOk, kTodo);
       testTextBeforeOffset(5, BOUNDARY_WORD_START, "", 0, 0,
                            "input", kTodo, kOk, kTodo,
                            "div", kTodo, kOk, kTodo,
                            "editable", kTodo, kOk, kTodo,
                            "textarea", kTodo, kOk, kTodo);
       testTextBeforeOffset(6, BOUNDARY_WORD_START, "hello ", 0, 6,
-                           "input", kTodo, kOk, kTodo,
-                           "div", kTodo, kOk, kTodo,
-                           "editable", kTodo, kOk, kTodo,
-                           "textarea", kTodo, kOk, kTodo);
+                           "input", kOk, kOk, kOk,
+                           "div", kOk, kOk, kOk,
+                           "editable", kOk, kOk, kOk,
+                           "textarea", kOk, kOk, kOk);
       testTextBeforeOffset(7, BOUNDARY_WORD_START, "hello ", 0, 6,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
       testTextBeforeOffset(8, BOUNDARY_WORD_START, "hello ", 0, 6,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
       testTextBeforeOffset(9, BOUNDARY_WORD_START, "my ", 6, 9,
-                           "input", kTodo, kOk, kTodo,
-                           "div", kTodo, kOk, kTodo,
-                           "editable", kTodo, kOk, kTodo,
-                           "textarea", kTodo, kOk, kTodo);
+                           "input", kOk, kOk, kOk,
+                           "div", kOk, kOk, kOk,
+                           "editable", kOk, kOk, kOk,
+                           "textarea", kOk, kOk, kOk);
       testTextBeforeOffset(10, BOUNDARY_WORD_START, "my ", 6, 9,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
       testTextBeforeOffset(14, BOUNDARY_WORD_START, "my ", 6, 9,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
@@ -263,35 +263,35 @@
       testTextBeforeOffset(15, BOUNDARY_WORD_START, "my ", 6, 9,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
 
       // BOUNDARY_WORD_END
       testTextBeforeOffset(0, BOUNDARY_WORD_END, "", 0, 0,
-                           "input", kTodo, kOk, kTodo,
-                           "div", kTodo, kOk, kTodo,
-                           "editable", kTodo, kOk, kTodo,
-                           "textarea", kTodo, kOk, kTodo);
+                           "input", kOk, kOk, kOk,
+                           "div", kOk, kOk, kOk,
+                           "editable", kOk, kOk, kOk,
+                           "textarea", kOk, kOk, kOk);
       testTextBeforeOffset(1, BOUNDARY_WORD_END, "", 0, 0,
                            "input", kTodo, kOk, kTodo,
                            "div", kTodo, kOk, kTodo,
                            "editable", kTodo, kOk, kTodo,
                            "textarea", kTodo, kOk, kTodo);
       testTextBeforeOffset(5, BOUNDARY_WORD_END, "", 0, 0,
                            "input", kTodo, kOk, kTodo,
                            "div", kTodo, kOk, kTodo,
                            "editable", kTodo, kOk, kTodo,
                            "textarea", kTodo, kOk, kTodo);
       testTextBeforeOffset(6, BOUNDARY_WORD_END, "hello ", 0, 6,
-                           "input", kTodo, kTodo, kTodo,
-                           "div", kTodo, kTodo, kTodo,
-                           "editable", kTodo, kTodo, kTodo,
-                           "textarea", kTodo, kTodo, kTodo);
+                           "input", kTodo, kTodo, kOk,
+                           "div", kTodo, kTodo, kOk,
+                           "editable", kTodo, kTodo, kOk,
+                           "textarea", kTodo, kTodo, kOk);
       testTextBeforeOffset(7, BOUNDARY_WORD_END, "hello ", 0, 6,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
       testTextBeforeOffset(8, BOUNDARY_WORD_END, "hello ", 0, 6,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
@@ -315,20 +315,20 @@
       testTextBeforeOffset(15, BOUNDARY_WORD_END, " my", 5, 8,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
 
       // BOUNDARY_LINE_START
       testTextBeforeOffset(0, BOUNDARY_LINE_START, "", 0, 0,
-                           "input", kTodo, kOk, kTodo,
-                           "div", kTodo, kOk, kTodo,
-                           "editable", kTodo, kOk, kTodo,
-                           "textarea", kTodo, kOk, kTodo);
+                           "input", kOk, kOk, kOk,
+                           "div", kOk, kOk, kOk,
+                           "editable", kOk, kOk, kOk,
+                           "textarea", kOk, kOk, kOk);
       testTextBeforeOffset(1, BOUNDARY_LINE_START, "", 0, 0,
                            "input", kTodo, kOk, kTodo,
                            "div", kTodo, kOk, kTodo,
                            "editable", kTodo, kOk, kTodo,
                            "textarea", kTodo, kOk, kTodo);
       testTextBeforeOffset(14, BOUNDARY_LINE_START, "", 0, 0,
                            "input", kTodo, kOk, kTodo,
                            "div", kTodo, kOk, kTodo,
@@ -337,20 +337,20 @@
       testTextBeforeOffset(15, BOUNDARY_LINE_START, "", 0, 0,
                            "input", kTodo, kOk, kTodo,
                            "div", kTodo, kOk, kTodo,
                            "editable", kTodo, kOk, kTodo,
                            "textarea", kTodo, kOk, kTodo);
 
       // BOUNDARY_LINE_END
       testTextBeforeOffset(0, BOUNDARY_LINE_END, "", 0, 0,
-                           "input", kTodo, kOk, kTodo,
-                           "div", kTodo, kOk, kTodo,
-                           "editable", kTodo, kOk, kTodo,
-                           "textarea", kTodo, kOk, kTodo);
+                           "input", kOk, kOk, kOk,
+                           "div", kOk, kOk, kOk,
+                           "editable", kOk, kOk, kOk,
+                           "textarea", kOk, kOk, kOk);
       testTextBeforeOffset(1, BOUNDARY_LINE_END, "", 0, 0,
                            "input", kTodo, kOk, kTodo,
                            "div", kTodo, kOk, kTodo,
                            "editable", kTodo, kOk, kTodo,
                            "textarea", kTodo, kOk, kTodo);
       testTextBeforeOffset(14, BOUNDARY_LINE_END, "", 0, 0,
                            "input", kOk, kOk, kOk,
                            "div", kOk, kOk, kOk,
--- a/accessible/tests/mochitest/text/test_whitespaces.html
+++ b/accessible/tests/mochitest/text/test_whitespaces.html
@@ -191,50 +191,50 @@
       testCharBeforeOffset(IDs, 6, " ", 5, 6);
       testCharBeforeOffset(IDs, 10, " ", 9, 10);
       testCharBeforeOffset(IDs, 11, " ", 10, 11);
       testCharBeforeOffset(IDs, 17, " ", 16, 17);
       testCharBeforeOffset(IDs, 19, " ", 18, 19);
 
       // BOUNDARY_WORD_START
       testTextBeforeOffset(0, BOUNDARY_WORD_START, "", 0, 0,
-                           "input", kTodo, kOk, kTodo,
-                           "div", kTodo, kOk, kTodo,
-                           "editable", kTodo, kOk, kTodo,
-                           "textarea", kTodo, kOk, kTodo);
+                           "input", kOk, kOk, kOk,
+                           "div", kOk, kOk, kOk,
+                           "editable", kOk, kOk, kOk,
+                           "textarea", kOk, kOk, kOk);
       testTextBeforeOffset(1, BOUNDARY_WORD_START, "", 0, 0,
                            "input", kTodo, kOk, kTodo,
                            "div", kTodo, kOk, kTodo,
                            "editable", kTodo, kOk, kTodo,
                            "textarea", kTodo, kOk, kTodo);
       testTextBeforeOffset(5, BOUNDARY_WORD_START, "", 0, 0,
                            "input", kTodo, kOk, kTodo,
                            "div", kTodo, kOk, kTodo,
                            "editable", kTodo, kOk, kTodo,
                            "textarea", kTodo, kOk, kTodo);
       testTextBeforeOffset(6, BOUNDARY_WORD_START, "Brave ", 0, 6,
-                           "input", kTodo, kOk, kTodo,
-                           "div", kTodo, kOk, kTodo,
-                           "editable", kTodo, kOk, kTodo,
-                           "textarea", kTodo, kOk, kTodo);
+                           "input", kOk, kOk, kOk,
+                           "div", kOk, kOk, kOk,
+                           "editable", kOk, kOk, kOk,
+                           "textarea", kOk, kOk, kOk);
       testTextBeforeOffset(9, BOUNDARY_WORD_START, "Brave ", 0, 6,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
       testTextBeforeOffset(10, BOUNDARY_WORD_START, "Brave ", 0, 6,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
       testTextBeforeOffset(11, BOUNDARY_WORD_START, "Sir  ", 6, 11,
-                           "input", kTodo, kOk, kTodo,
-                           "div", kTodo, kOk, kTodo,
-                           "editable", kTodo, kOk, kTodo,
-                           "textarea", kTodo, kOk, kTodo);
+                           "input", kOk, kOk, kOk,
+                           "div", kOk, kOk, kOk,
+                           "editable", kOk, kOk, kOk,
+                           "textarea", kOk, kOk, kOk);
       testTextBeforeOffset(15, BOUNDARY_WORD_START, "Sir  ", 6, 11,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
       testTextBeforeOffset(16, BOUNDARY_WORD_START, "Sir  ", 6, 11,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
@@ -246,37 +246,37 @@
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
       testTextBeforeOffset(18, BOUNDARY_WORD_START, "Sir  ", 6, 11,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
       testTextBeforeOffset(19, BOUNDARY_WORD_START, "Robin   ", 11, 19,
-                           "input", kTodo, kOk, kTodo,
-                           "div", kTodo, kOk, kTodo,
-                           "editable", kTodo, kOk, kTodo,
-                           "textarea", kTodo, kOk, kTodo);
+                           "input", kOk, kOk, kOk,
+                           "div", kOk, kOk, kOk,
+                           "editable", kOk, kOk, kOk,
+                           "textarea", kOk, kOk, kOk);
       testTextBeforeOffset(20, BOUNDARY_WORD_START, "Robin   ", 11, 19,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
       testTextBeforeOffset(21, BOUNDARY_WORD_START, "Robin   ", 11, 19,
                            "input", kTodo, kTodo, kTodo,
                            "div", kTodo, kTodo, kTodo,
                            "editable", kTodo, kTodo, kTodo,
                            "textarea", kTodo, kTodo, kTodo);
 
       // BOUNDARY_WORD_END
       testTextBeforeOffset(0, BOUNDARY_WORD_END, "", 0, 0,
-                           "input", kTodo, kOk, kTodo,
-                           "div", kTodo, kOk, kTodo,
-                           "editable", kTodo, kOk, kTodo,
-                           "textarea", kTodo, kOk, kTodo);
+                           "input", kOk, kOk, kOk,
+                           "div", kOk, kOk, kOk,
+                           "editable", kOk, kOk, kOk,
+                           "textarea", kOk, kOk, kOk);
       testTextBeforeOffset(1, BOUNDARY_WORD_END, "", 0, 0,
                            "input", kTodo, kOk, kTodo,
                            "div", kTodo, kOk, kTodo,
                            "editable", kTodo, kOk, kTodo,
                            "textarea", kTodo, kOk, kTodo);
       testTextBeforeOffset(4, BOUNDARY_WORD_END, "", 0, 0,
                            "input", kTodo, kOk, kTodo,
                            "div", kTodo, kOk, kTodo,
--- a/accessible/tests/mochitest/tree/test_media.html
+++ b/accessible/tests/mochitest/tree/test_media.html
@@ -25,34 +25,43 @@ https://bugzilla.mozilla.org/show_bug.cg
     {
       //////////////////////////////////////////////////////////////////////////
       // test the accessible tree
 
       var accTree = {
         role: ROLE_GROUPING,
         children: [
           { // start/stop button
-            role: ROLE_PUSHBUTTON
+            role: ROLE_PUSHBUTTON,
+            name: "Play",
+            children: []
           },
           { // buffer bar
-            role: ROLE_PROGRESSBAR
+            role: ROLE_PROGRESSBAR,
+            children: []
           },
           { // progress bar
-            role: ROLE_PROGRESSBAR
+            role: ROLE_PROGRESSBAR,
+            children: []
           },
           { // slider of progress bar
-            role: ROLE_SLIDER
+            role: ROLE_SLIDER,
+            //name: "0:00 of 0:02 elapsed",
+            children: []
           },
           { // mute button
-            role: ROLE_PUSHBUTTON
+            role: ROLE_PUSHBUTTON,
+            name: "Mute",
+            children: []
           }
         ]
       };
       testAccessibleTree("audio", accTree);
 
+      todo(false, "Enable name test for slider. Fail on Linux.");
       SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
   </script>
 </head>
 <body>
--- a/accessible/tests/mochitest/tree/test_txtctrl.xul
+++ b/accessible/tests/mochitest/tree/test_txtctrl.xul
@@ -10,16 +10,18 @@
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
           src="../common.js" />
   <script type="application/javascript"
           src="../role.js" />
+  <script type="application/javascript"
+          src="../events.js" />
 
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     function doTest()
     {
@@ -103,16 +105,21 @@
           {
             // xul:menupopup
             role: ROLE_COMBOBOX_LIST,
             children: []
           }
         ]
       };
 
+      function test_txc7() {
+        testAccessibleTree("txc7", accTree);
+        SimpleTest.finish();
+      }
+
       // XPFE and Toolkit autocomplete widgets differ.
       var txc7 = document.getElementById("txc7");
       if ("clearResults" in txc7) {
         SimpleTest.ok(true, "Testing (Old) XPFE autocomplete widget.");
 
         // Popup is always created. (See code below.)
 
         accTree.children.push(
@@ -134,21 +141,24 @@
                         children: []
                       }
                     ]
                   }
                 ]
               }
             ]
           }
-          );
+        );
+        test_txc7();
+
       } else {
         SimpleTest.ok(true, "Testing (New) Toolkit autocomplete widget.");
 
-        // Dumb access to trigger popup lazy creation. (See code below.)
+        // Dumb access to trigger popup lazy creation.
+        waitForEvent(EVENT_REORDER, txc7, test_txc7);
         txc7.popup;
 
         accTree.children.push(
           {
             role: ROLE_LIST,
             children: [
               {
                 role: ROLE_LIST,
@@ -156,27 +166,18 @@
                   {
                     role: ROLE_COLUMNHEADER,
                     children: []
                   }
                 ]
               }
             ]
           }
-          );
+        );
       }
-
-      // Delay txc7 test a bit, to let Toolkit popup lazy creation complete.
-      function test_txc7() {
-        testAccessibleTree("txc7", accTree);
-  
-        SimpleTest.finish();
-      }
-      // SimpleTest.executeSoon() doesn't help here: use setTimeout() with a little delay.
-      setTimeout(test_txc7, 25);
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
   ]]>
   </script>
 
   <hbox flex="1" style="overflow: auto;">
--- a/browser/app/Makefile.in
+++ b/browser/app/Makefile.in
@@ -97,61 +97,30 @@ else
 PROGRAM = $(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
 endif
 
 CPPSRCS = nsBrowserApp.cpp
 
 LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
 LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/base
 
-ifdef BUILD_STATIC_LIBS
-ifdef _MSC_VER
-STATIC_COMPONENTS_LINKER_PATH = -LIBPATH:$(DEPTH)/staticlib
-else
-STATIC_COMPONENTS_LINKER_PATH = -L$(DEPTH)/staticlib
-endif
-LIBS += $(DEPTH)/toolkit/xre/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
-else
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 LIBS += $(DIST)/bin/XUL
+TK_LIBS := $(TK_LIBS)
 else
 EXTRA_DSO_LIBS += xul
 endif
-endif
-
-ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-TK_LIBS := $(TK_LIBS)
-endif
-
-ifdef MOZ_ENABLE_LIBXUL
-APP_XPCOM_LIBS = $(XPCOM_GLUE_LDOPTS)
-else
-MOZILLA_INTERNAL_API = 1
-APP_XPCOM_LIBS = $(XPCOM_LIBS)
-endif
 
 LIBS += \
 	$(STATIC_COMPONENTS_LINKER_PATH) \
 	$(EXTRA_DSO_LIBS) \
-	$(APP_XPCOM_LIBS) \
+	$(XPCOM_GLUE_LDOPTS) \
 	$(NSPR_LIBS) \
 	$(NULL)
 
-ifdef BUILD_STATIC_LIBS
-LIBS += \
-	$(MOZ_JS_LIBS) \
-	$(TK_LIBS) \
-	$(NULL)
-
-# Add explicit X11 dependency when building against X11 toolkits
-ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
-LIBS += $(XLDFLAGS) $(XLIBS) $(ZLIB_LIBS)
-endif
-endif
-
 ifdef MOZ_JPROF
 LIBS += -ljprof
 endif
 
 ifndef MOZ_WINCONSOLE
 ifdef MOZ_DEBUG
 MOZ_WINCONSOLE = 1
 else
@@ -166,69 +135,44 @@ NSDISTMODE = copy
 include $(topsrcdir)/config/config.mk
 
 ifdef _MSC_VER
 # Always enter a Windows program through wmain, whether or not we're
 # a console application.
 WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
 endif
 
-ifdef BUILD_STATIC_LIBS
-include $(topsrcdir)/config/static-config.mk
-
-EXTRA_DEPS	+= \
-	$(STATIC_EXTRA_DEPS) \
-	$(NULL)
-DEFINES		+= $(STATIC_DEFINES)
-CPPSRCS		+= $(STATIC_CPPSRCS)
-EXTRA_DSO_LIBS	+= $(STATIC_EXTRA_DSO_LIBS)
-EXTRA_LIBS	+= $(STATIC_EXTRA_LIBS)
-endif
-
 ifeq ($(OS_ARCH),WINNT)
 OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 version winspool)
-OS_LIBS += $(call EXPAND_LIBNAME,usp10 msimg32 delayimp)
-LDFLAGS += -delayload:xul.dll -delayload:xpcom.dll -delayload:plc4.dll -delayload:nspr4.dll -delayload:mozalloc.dll
+OS_LIBS += $(call EXPAND_LIBNAME,usp10 msimg32)
 endif
 
 ifeq ($(OS_ARCH),WINNT)
 RCINCLUDE = splash.rc
 ifndef GNU_CC
 RCFLAGS += -DMOZ_PHOENIX -I$(srcdir)
 else
 RCFLAGS += -DMOZ_PHOENIX --include-dir $(srcdir)
 endif
-ifdef BUILD_STATIC_LIBS
-RCFLAGS += -DMOZ_STATIC_BUILD
-endif
 ifdef DEBUG
 RCFLAGS += -DDEBUG
 endif
 endif
 
 ifeq ($(OS_ARCH),OS2)
 RESFILE=splashos2.res
 RCFLAGS += -DMOZ_PHOENIX
-ifdef BUILD_STATIC_LIBS
-RCFLAGS += -DMOZ_STATIC_BUILD -i $(DIST)/include
-endif
 ifdef DEBUG
 RCFLAGS += -DDEBUG
 endif
 RCFLAGS += -DFIREFOX_ICO=\"$(DIST)/branding/firefox-os2.ico\" -DDOCUMENT_ICO=\"$(DIST)/branding/document-os2.ico\"
 endif
 
 include $(topsrcdir)/config/rules.mk
 
-ifdef BUILD_STATIC_LIBS
-include $(topsrcdir)/config/static-rules.mk
-
-DEFINES += -DIMPL_XREAPI
-endif
-
 ifeq ($(MOZ_WIDGET_TOOLKIT),photon)
 LIBS += -lphexlib
 endif
 
 ifeq ($(OS_ARCH),WINNT)
 #
 # Control the default heap size.
 # This is the heap returned by GetProcessHeap().
--- a/browser/app/blocklist.xml
+++ b/browser/app/blocklist.xml
@@ -92,16 +92,21 @@
       <versionRange severity="1"/>
     </emItem>
     <emItem 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}">
+           <versionRange minVersion="5.0a1" maxVersion="*"/>
+        </targetApplication>
+      </versionRange>
     </emItem>
     <emItem id="{E8E88AB0-7182-11DF-904E-6045E0D72085}"/>
   </emItems>
 <pluginItems>
   <pluginItem>
     <match name="name" exp="^Yahoo Application State Plugin$"/>
     <match name="description" exp="^Yahoo Application State Plugin$"/>
     <match name="filename" exp="npYState.dll"/>
--- a/browser/app/macbuild/Contents/Info.plist.in
+++ b/browser/app/macbuild/Contents/Info.plist.in
@@ -87,16 +87,65 @@
 			<array>
 				<string>GIFf</string>
 				<string>JPEG</string>
 				<string>PNGf</string>
 			</array>
 			<key>CFBundleTypeRole</key>
 			<string>Viewer</string>
 		</dict>
+		<dict>
+			<key>CFBundleTypeExtensions</key>
+			<array>
+				<string>oga</string>
+				<string>ogg</string>
+			</array>
+			<key>CFBundleTypeIconFile</key>
+			<string>document.icns</string>
+			<key>CFBundleTypeMIMETypes</key>
+			<array>
+				<string>audio/ogg</string>
+			</array>
+			<key>CFBundleTypeName</key>
+			<string>HTML5 Audio (Ogg)</string>
+			<key>CFBundleTypeRole</key>
+			<string>Viewer</string>
+		</dict>
+		<dict>
+			<key>CFBundleTypeExtensions</key>
+			<array>
+				<string>ogv</string>
+			</array>
+			<key>CFBundleTypeIconFile</key>
+			<string>document.icns</string>
+			<key>CFBundleTypeMIMETypes</key>
+			<array>
+				<string>video/ogg</string>
+			</array>
+			<key>CFBundleTypeName</key>
+			<string>HTML5 Video (Ogg)</string>
+			<key>CFBundleTypeRole</key>
+			<string>Viewer</string>
+		</dict>
+		<dict>
+			<key>CFBundleTypeExtensions</key>
+			<array>
+				<string>webm</string>
+			</array>
+			<key>CFBundleTypeIconFile</key>
+			<string>document.icns</string>
+			<key>CFBundleTypeMIMETypes</key>
+			<array>
+				<string>video/webm</string>
+			</array>
+			<key>CFBundleTypeName</key>
+			<string>HTML5 Video (WebM)</string>
+			<key>CFBundleTypeRole</key>
+			<string>Viewer</string>
+		</dict>
 	</array>
 	<key>CFBundleExecutable</key>
 	<string>firefox-bin</string>
 	<key>CFBundleGetInfoString</key>
 	<string>%APP_NAME% %APP_VERSION%</string>
 	<key>CFBundleIconFile</key>
 	<string>firefox</string>
 	<key>CFBundleIdentifier</key>
--- a/browser/app/nsBrowserApp.cpp
+++ b/browser/app/nsBrowserApp.cpp
@@ -51,17 +51,16 @@
 
 #include "nsCOMPtr.h"
 #include "nsILocalFile.h"
 #include "nsStringGlue.h"
 
 #ifdef XP_WIN
 // we want to use the DLL blocklist if possible
 #define XRE_WANT_DLL_BLOCKLIST
-#define XRE_PRELOAD_XUL
 // we want a wmain entry point
 #include "nsWindowsWMain.cpp"
 #endif
 
 static void Output(const char *fmt, ... )
 {
   va_list ap;
   va_start(ap, fmt);
--- a/browser/app/profile/extensions/testpilot@labs.mozilla.com/content/experiment-page.js
+++ b/browser/app/profile/extensions/testpilot@labs.mozilla.com/content/experiment-page.js
@@ -118,17 +118,17 @@ var stringBundle;
 	response == nsIFilePicker.returnReplace) {
       const nsIWebBrowserPersist = Components.interfaces.nsIWebBrowserPersist;
       let file = filePicker.file;
 
       // create a data url from the canvas and then create URIs of the source
       // and targets
       let io = Components.classes["@mozilla.org/network/io-service;1"].
 	getService(Components.interfaces.nsIIOService);
-      let source = io.newURI(canvas.toDataURL("image/png", ""), "UTF8", null);
+      let source = io.newURI(canvas.toDataURL("image/png"), "UTF8", null);
       let target = io.newFileURI(file);
 
       // prepare to save the canvas data
       let persist = Components.classes[
 	"@mozilla.org/embedding/browser/nsWebBrowserPersist;1"].
 	  createInstance(nsIWebBrowserPersist);
       persist.persistFlags = nsIWebBrowserPersist.
 	PERSIST_FLAGS_REPLACE_EXISTING_FILES;
--- a/browser/app/profile/extensions/testpilot@labs.mozilla.com/content/survey-generator.js
+++ b/browser/app/profile/extensions/testpilot@labs.mozilla.com/content/survey-generator.js
@@ -86,16 +86,19 @@ function onBuiltinSurveyLoad() {
   } else {
     contentDiv.innerHTML = "";
     if (task.surveyExplanation) {
       explanation.innerHTML = task.surveyExplanation;
     } else {
       explanation.innerHTML = "";
     }
     drawSurveyForm(task, contentDiv);
+    // Allow surveys to define arbitrary page load handlers - call them
+    // after creating the rest of the page:
+    task.onPageLoad(task, document);
   }
 }
 
 function drawSurveyForm(task, contentDiv) {
   let surveyQuestions = task.surveyQuestions;
 
   /* Fill form fields with old survey answers if available --
    * but not if the survey version has changed since you stored them!!
@@ -109,32 +112,32 @@ function drawSurveyForm(task, contentDiv
   submitButton.setAttribute("style", "");
   let changeButton = document.getElementById("change-answers");
   changeButton.setAttribute("style", "display:none");
   // Loop through questions and render html form input elements for each
   // one.
   for (let i = 0; i < surveyQuestions.length; i++) {
     let question = surveyQuestions[i].question;
     let explanation = surveyQuestions[i].explanation;
-    let elem;
+    let elem, j;
 
     elem = document.createElement("h3");
     elem.innerHTML = (i+1) + ". " + question;
     contentDiv.appendChild(elem);
     if (explanation) {
       elem = document.createElement("p");
       elem.setAttribute("class", "survey-question-explanation");
       elem.innerHTML = explanation;
       contentDiv.appendChild(elem);
     }
     // If you've done this survey before, preset all inputs using old answers
     let choices = surveyQuestions[i].choices;
     switch (surveyQuestions[i].type) {
     case MULTIPLE_CHOICE:
-      for (let j = 0; j < choices.length; j++) {
+      for (j = 0; j < choices.length; j++) {
         let newRadio = document.createElement("input");
         newRadio.setAttribute("type", "radio");
         newRadio.setAttribute("name", "answer_to_" + i);
         newRadio.setAttribute("value", j);
         if (oldAnswers && oldAnswers[i] == String(j)) {
           newRadio.setAttribute("checked", "true");
         }
         let label = document.createElement("span");
@@ -143,17 +146,17 @@ function drawSurveyForm(task, contentDiv
         contentDiv.appendChild(label);
         contentDiv.appendChild(document.createElement("br"));
       }
       break;
     case CHECK_BOXES:
     case CHECK_BOXES_WITH_FREE_ENTRY:
       let checkboxName = "answer_to_" + i;
       // Check boxes:
-      for (let j = 0; j < choices.length; j++) {
+      for (j = 0; j < choices.length; j++) {
         let newCheck = document.createElement("input");
         newCheck.setAttribute("type", "checkbox");
         newCheck.setAttribute("name", checkboxName);
         newCheck.setAttribute("value", j);
         if (oldAnswers && oldAnswers[i]) {
           for each (let an in oldAnswers[i]) {
             if (an == String(j)) {
               newCheck.setAttribute("checked", "true");
@@ -183,17 +186,17 @@ function drawSurveyForm(task, contentDiv
           }, false);
         let label = document.createElement("span");
         label.innerHTML = surveyQuestions[i].free_entry + "&nbsp:&nbsp";
         let inputBox = document.createElement("textarea");
         inputBox.setAttribute("id", freeformId);
         inputBox.addEventListener(
           "keypress", function() {
             let elements = document.getElementsByName(checkboxName);
-            for (let j = (elements.length - 1); j >= 0; j--) {
+            for (j = (elements.length - 1); j >= 0; j--) {
               if (elements[j].value == freeformId) {
                 elements[j].checked = true;
                 break;
               }
             }
           }, false);
         if (oldAnswers && oldAnswers[i]) {
           for each (let an in oldAnswers[i]) {
@@ -208,17 +211,17 @@ function drawSurveyForm(task, contentDiv
         contentDiv.appendChild(label);
         contentDiv.appendChild(inputBox);
       }
       break;
     case SCALE:
       let label = document.createElement("span");
       label.innerHTML = surveyQuestions[i].min_label;
       contentDiv.appendChild(label);
-      for (let j = surveyQuestions[i].scale_minimum;
+      for (j = surveyQuestions[i].scale_minimum;
            j <= surveyQuestions[i].scale_maximum;
            j++) {
         let newRadio = document.createElement("input");
         newRadio.setAttribute("type", "radio");
         newRadio.setAttribute("name", "answer_to_" + i);
         newRadio.setAttribute("value", j);
         if (oldAnswers && oldAnswers[i] == String(j)) {
           newRadio.setAttribute("checked", "true");
@@ -238,17 +241,17 @@ function drawSurveyForm(task, contentDiv
       }
       contentDiv.appendChild(inputBox);
       break;
     case MULTIPLE_CHOICE_WITH_FREE_ENTRY:
       let checked = false;
       let freeformId = "freeform_" + i;
       let radioName = "answer_to_" + i;
 
-      for (let j = 0; j < choices.length; j++) {
+      for (j = 0; j < choices.length; j++) {
         let newRadio = document.createElement("input");
         newRadio.setAttribute("type", "radio");
         newRadio.setAttribute("name", radioName);
         newRadio.setAttribute("value", j);
         newRadio.addEventListener(
           "click", function() {
             let inputBox = document.getElementById(freeformId);
             if (inputBox) {
--- a/browser/app/profile/extensions/testpilot@labs.mozilla.com/install.rdf
+++ b/browser/app/profile/extensions/testpilot@labs.mozilla.com/install.rdf
@@ -1,24 +1,24 @@
 <?xml version="1.0"?>
 
 <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
      xmlns:em="http://www.mozilla.org/2004/em-rdf#">
   <Description about="urn:mozilla:install-manifest">
     <em:id>testpilot@labs.mozilla.com</em:id>
-    <em:version>1.1.1</em:version>
+    <em:version>1.1.2</em:version>
     <em:type>2</em:type>
 
     <!-- Target Application this extension can install into, 
          with minimum and maximum supported versions. --> 
     <em:targetApplication>
       <Description>
         <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
         <em:minVersion>3.5</em:minVersion>
-        <em:maxVersion>5.0</em:maxVersion>
+        <em:maxVersion>6.0</em:maxVersion>
       </Description>
     </em:targetApplication>
    
     <!-- Front End MetaData -->
     <em:name>Feedback</em:name>
     <em:description>Help make Firefox better by giving feedback.</em:description>
     <em:creator>Mozilla Corporation</em:creator>
     <em:homepageURL>http://testpilot.mozillalabs.com/</em:homepageURL>
--- a/browser/app/profile/extensions/testpilot@labs.mozilla.com/modules/remote-experiment-loader.js
+++ b/browser/app/profile/extensions/testpilot@labs.mozilla.com/modules/remote-experiment-loader.js
@@ -507,25 +507,25 @@ exports.RemoteExperimentLoader.prototype
     let remoteExperiments = {};
     this._loadErrors = [];
     for each (filename in this._experimentFileNames) {
       this._logger.debug("GetExperiments is loading " + filename);
       try {
         remoteExperiments[filename] = this._loader.require(filename);
         this._logger.info("Loaded " + filename + " OK.");
       } catch(e) {
-      /* Turn the load-time errors into strings and store them, so we can display
-       * them on a debug page or include them with a data upload!  (Don't store
-       * exception objects directly as that causes garbage collector problems-
-       * aka bug 646122) */
-      let errStr = e.name + " on line " + e.lineNumber + " of file " +
-        e.fileName + ": " + e.message;
+        /* Turn the load-time errors into strings and store them, so we can display
+         * them on a debug page or include them with a data upload!  (Don't store
+         * exception objects directly as that causes garbage collector problems-
+         * aka bug 646122) */
+        let errStr = e.name + " on line " + e.lineNumber + " of file " +
+          e.fileName + ": " + e.message;
         this._loadErrors.push(errStr);
         this._logger.warn("Error loading " + filename);
-        this._logger.warn(e);
+        this._logger.warn(errStr);
       }
     }
     return remoteExperiments;
   },
 
   getStudyResults: function() {
     return this._studyResults;
   },
--- a/browser/app/profile/extensions/testpilot@labs.mozilla.com/modules/setup.js
+++ b/browser/app/profile/extensions/testpilot@labs.mozilla.com/modules/setup.js
@@ -249,28 +249,25 @@ let TestPilotSetup = {
       { notify: function(timer) {
           self.reloadRemoteExperiments(function() {
             self._notifyUserOfTasks();
 	  });
       }}, this._prefs.getValue(POPUP_REMINDER_INTERVAL, 86400000),
       Ci.nsITimer.TYPE_REPEATING_SLACK);
 
       this.getVersion(function() {
-      // Show first run page (in front window) if newly installed or upgraded.
-        let currVersion = self._prefs.getValue(VERSION_PREF, "firstrun");
-
-        if (currVersion != self.version) {
-          if(!self._isBetaChannel()) {
-            // Don't show first run page in ffx4 beta version.
+        /* Show first run page (in front window) only the first time after install;
+         * Don't show first run page in Feedback UI version. */
+        if ((self._prefs.getValue(VERSION_PREF, "") == "") &&
+           (!self._interfaceBuilder.channelUsesFeedback())) {
             self._prefs.setValue(VERSION_PREF, self.version);
             let browser = self._getFrontBrowserWindow().getBrowser();
             let url = self._prefs.getValue(FIRST_RUN_PREF, "");
             let tab = browser.addTab(url);
             browser.selectedTab = tab;
-          }
         }
 
         // Install tasks. (This requires knowing the version, so it is
         // inside the callback from getVersion.)
         self.checkForTasks(function() {
           /* Callback to complete startup after we finish
            * checking for tasks. */
          self.startupComplete = true;
--- a/browser/app/profile/extensions/testpilot@labs.mozilla.com/modules/tasks.js
+++ b/browser/app/profile/extensions/testpilot@labs.mozilla.com/modules/tasks.js
@@ -592,17 +592,17 @@ TestPilotExperiment.prototype = {
       if (this._handlers.getStudyMetadata) {
         let metadata = this._handlers.getStudyMetadata();
         if (metadata.length) {
           // getStudyMetadata must return an array, otherwise it is invalid.
           return metadata;
         }
       }
     } catch(e) {
-      this._logger.warn("Error in getStudyMetadata: " + e);
+      this._dataStore.logException("getStudyMetadata: " + e);
     }
     return null;
   },
 
   _reschedule: function TestPilotExperiment_reschedule() {
     // Schedule next run of test:
     // add recurrence interval to start date and store!
     let ms = this._recurrenceInterval * (24 * 60 * 60 * 1000);
@@ -655,16 +655,17 @@ TestPilotExperiment.prototype = {
     return Application.prefs.getValue(
       DATE_FOR_DATA_DELETION_PREFIX + this._id, "");
   },
 
   checkDate: function TestPilotExperiment_checkDate() {
     // This method handles all date-related status changes and should be
     // called periodically.
     let currentDate = this._now();
+    let self = this;
 
     // Reset automatically recurring tests:
     if (this._recursAutomatically &&
         this._status >= TaskConstants.STATUS_FINISHED &&
         currentDate >= this._startDate &&
 	currentDate <= this._endDate) {
       // if we've done a permanent opt-out, then don't start over-
       // just keep rescheduling.
@@ -698,28 +699,26 @@ TestPilotExperiment.prototype = {
 
     // If a study is STARTING, and we're in the right date range,
     // then start it, and move it to IN_PROGRESS.
     if ( this._status == TaskConstants.STATUS_STARTING &&
         currentDate >= this._startDate &&
         currentDate <= this._endDate) {
       this._logger.info("Study now starting.");
       // clear the data before starting.
-      let self = this;
       this._dataStore.wipeAllData(function() {
         // Experiment is now in progress.
         self.changeStatus(TaskConstants.STATUS_IN_PROGRESS, true);
         self.onExperimentStartup();
       });
     }
 
     // What happens when a test finishes:
     if (this._status < TaskConstants.STATUS_FINISHED &&
 	currentDate > this._endDate) {
-      let self = this;
       let setDataDeletionDate = true;
       this._logger.info("Passed End Date - Switched Task Status to Finished");
       this.changeStatus(TaskConstants.STATUS_FINISHED);
       this.onExperimentShutdown();
       this.doExperimentCleanup();
 
       if (this._recursAutomatically) {
         this._reschedule();
@@ -891,55 +890,61 @@ TestPilotExperiment.prototype = {
       };
       req.send(dataString);
     });
   },
 
   optOut: function TestPilotExperiment_optOut(reason, callback) {
     // Regardless of study ID, post the opt-out message to a special
     // database table of just opt-out messages; include study ID in metadata.
-    let url = Application.prefs.getValue(DATA_UPLOAD_PREF, "") + "opt-out";
     let logger = this._logger;
 
     this.onExperimentShutdown();
     this.changeStatus(TaskConstants.STATUS_CANCELLED);
     this._dataStore.wipeAllData();
     this.doExperimentCleanup();
     this._dateForDataDeletion = null;
     this._expirationDateForDataSubmission = null;
     logger.info("Opting out of test with reason " + reason);
     if (reason) {
       // Send us the reason...
       // (TODO: include metadata?)
+      let url = Application.prefs.getValue(DATA_UPLOAD_PREF, "") + "opt-out";
       let answer = {id: this._id,
                     reason: reason};
       let dataString = JSON.stringify(answer);
       var req =
         Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].
 	  createInstance(Ci.nsIXMLHttpRequest);
       logger.trace("Posting " + dataString + " to " + url);
       req.open('POST', url, true);
       req.setRequestHeader("Content-type", "application/json");
       req.setRequestHeader("Content-length", dataString.length);
       req.setRequestHeader("Connection", "close");
       req.onreadystatechange = function(aEvt) {
         if (req.readyState == 4) {
           if (req.status == 200 || req.status == 201 || req.status == 202) {
 	    logger.info("Quit reason posted successfully " + req.responseText);
-    	    callback(true);
+            if (callback) {
+              callback(true);
+            }
 	  } else {
 	    logger.warn(req.status + " posting error " + req.responseText);
-	    callback(false);
+            if (callback) {
+              callback(false);
+            }
 	  }
 	}
       };
       logger.trace("Sending quit reason.");
       req.send(dataString);
     } else {
-      callback(false);
+      if (callback) {
+        callback(false);
+      }
     }
   },
 
   setRecurPref: function TPE_setRecurPrefs(value) {
     // value is NEVER_SUBMIT, ALWAYS_SUBMIT, or ASK_EACH_TIME
     let prefName = RECUR_PREF_PREFIX + this._id;
     this._logger.info("Setting recur pref to " + value);
     Application.prefs.setValue(prefName, value);
@@ -956,16 +961,17 @@ TestPilotBuiltinSurvey.prototype = {
                    surveyInfo.surveyName,
                    surveyInfo.surveyUrl,
                    surveyInfo.summary,
                    surveyInfo.thumbnail);
     this._studyId = surveyInfo.uploadWithExperiment; // what study do we belong to
     this._versionNumber = surveyInfo.versionNumber;
     this._questions = surveyInfo.surveyQuestions;
     this._explanation = surveyInfo.surveyExplanation;
+    this._onPageLoad = surveyInfo.onPageLoad;
   },
 
   get taskType() {
     return TaskConstants.TYPE_SURVEY;
   },
 
   get surveyExplanation() {
     return this._explanation;
@@ -983,16 +989,22 @@ TestPilotBuiltinSurvey.prototype = {
   get defaultUrl() {
     return this.currentStatusUrl;
   },
 
   get relatedStudyId() {
     return this._studyId;
   },
 
+  onPageLoad: function(task, document) {
+    if (this._onPageLoad) {
+      this._onPageLoad(task, document);
+    }
+  },
+
   onDetailPageOpened: function TPS_onDetailPageOpened() {
     if (this._status < TaskConstants.STATUS_IN_PROGRESS) {
       this.changeStatus( TaskConstants.STATUS_IN_PROGRESS, true );
     }
   },
 
   get oldAnswers() {
     let surveyResults =
@@ -1199,9 +1211,9 @@ TestPilotLegacyStudy.prototype = {
   },
 
   get taskType() {
     return TaskConstants.TYPE_LEGACY;
   }
   // TODO test that they don't say "thanks for contributing" if the
   // user didn't actually complete them...
 };
-TestPilotLegacyStudy.prototype.__proto__ = TestPilotTask;
\ No newline at end of file
+TestPilotLegacyStudy.prototype.__proto__ = TestPilotTask;
--- a/browser/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/Makefile.in
+++ b/browser/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/Makefile.in
@@ -38,18 +38,16 @@
 DEPTH		= ../../../../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
-DEFINES += -DFIREFOX_VERSION=$(FIREFOX_VERSION)
-
 FILES := \
 	install.rdf \
 	$(NULL)
 
 libs::
 	$(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(srcdir)/install.rdf.in > install.rdf
 	$(INSTALL) $(FILES) $(DIST)/bin/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
  
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -65,16 +65,17 @@ pref("extensions.webservice.discoverURL"
 // Blocklist preferences
 pref("extensions.blocklist.enabled", true);
 pref("extensions.blocklist.interval", 86400);
 // Controls what level the blocklist switches from warning about items to forcibly
 // blocking them.
 pref("extensions.blocklist.level", 2);
 pref("extensions.blocklist.url", "https://addons.mozilla.org/blocklist/3/%APP_ID%/%APP_VERSION%/%PRODUCT%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/%PING_COUNT%/%TOTAL_PING_COUNT%/%DAYS_SINCE_LAST_PING%/");
 pref("extensions.blocklist.detailsURL", "https://www.mozilla.com/%LOCALE%/blocklist/");
+pref("extensions.blocklist.itemURL", "https://addons.mozilla.org/%LOCALE%/%APP%/blocked/%blockID%");
 
 pref("extensions.update.autoUpdateDefault", true);
 
 // Dictionary download preference
 pref("browser.dictionaries.download.url", "https://addons.mozilla.org/%LOCALE%/firefox/dictionaries/");
 
 // The minimum delay in seconds for the timer to fire.
 // default=2 minutes
@@ -780,16 +781,18 @@ pref("browser.sessionstore.max_windows_u
 // (this pref has no effect if more than 6 hours have passed since the last crash)
 pref("browser.sessionstore.max_resumed_crashes", 1);
 // The number of tabs that can restore concurrently:
 // < 0 = All tabs can restore at the same time
 //   0 = Only the selected tab in each window will be restored
 //       Other tabs won't be restored until they are selected
 //   N = The number of tabs to restore at the same time
 pref("browser.sessionstore.max_concurrent_tabs", 3);
+// Whether to automatically restore hidden tabs (i.e., tabs in other tab groups) or not
+pref("browser.sessionstore.restore_hidden_tabs", false);
 
 // allow META refresh by default
 pref("accessibility.blockautorefresh", false);
 
 // Whether history is enabled or not.
 pref("places.history.enabled", true);
 
 // The percentage of system memory that the Places database can use.  Out of the
@@ -894,16 +897,27 @@ pref("dom.ipc.plugins.enabled.i386.flash
 pref("dom.ipc.plugins.enabled.i386.javaplugin2_npapi.plugin", true);
 pref("dom.ipc.plugins.enabled.i386.javaappletplugin.plugin", true);
 // x86_64 ipc preferences
 pref("dom.ipc.plugins.enabled.x86_64", true);
 #else
 pref("dom.ipc.plugins.enabled", true);
 #endif
 
+// This pref governs whether we attempt to work around problems caused by
+// plugins using OS calls to manipulate the cursor while running out-of-
+// process.  These workarounds all involve intercepting (hooking) certain
+// OS calls in the plugin process, then arranging to make certain OS calls
+// in the browser process.  Eventually plugins will be required to use the
+// NPAPI to manipulate the cursor, and these workarounds will be removed.
+// See bug 621117.
+#ifdef XP_MACOSX
+pref("dom.ipc.plugins.nativeCursorSupport", true);
+#endif
+
 #ifdef XP_WIN
 pref("browser.taskbar.previews.enable", false);
 pref("browser.taskbar.previews.max", 20);
 pref("browser.taskbar.previews.cachetime", 5);
 pref("browser.taskbar.lists.enabled", true);
 pref("browser.taskbar.lists.frequent.enabled", true);
 pref("browser.taskbar.lists.recent.enabled", false);
 pref("browser.taskbar.lists.maxListItemCount", 7);
@@ -998,16 +1012,29 @@ pref("devtools.scratchpad.enabled", true
 // Enable tools for Chrome development.
 pref("devtools.chrome.enabled", 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,
+//   window - in a separate window/popup panel.
+pref("devtools.webconsole.position", "above");
+
+// The number of lines that are displayed in the web console for the Net,
+// CSS, JS and Web Developer categories.
+pref("devtools.hud.loglimit.network", 200);
+pref("devtools.hud.loglimit.cssparser", 200);
+pref("devtools.hud.loglimit.exception", 200);
+pref("devtools.hud.loglimit.console", 200);
+
 // Whether the character encoding menu is under the main Firefox button. This
 // preference is a string so that localizers can alter it.
 pref("browser.menu.showCharacterEncoding", "chrome://browser/locale/browser.properties");
 
 // Allow using tab-modal prompts when possible.
 pref("prompts.tab_modal.enabled", true);
 // Whether the Panorama should animate going in/out of tabs
 pref("browser.panorama.animate_zoom", true);
--- a/browser/base/content/aboutDialog.js
+++ b/browser/base/content/aboutDialog.js
@@ -354,17 +354,16 @@ appUpdater.prototype =
      * See nsIUpdateService.idl
      */
     onError: function(aRequest, aUpdate) {
       // Errors in the update check are treated as no updates found. If the
       // update check fails repeatedly without a success the user will be
       // notified with the normal app update user interface so this is safe.
       gAppUpdater.isChecking = false;
       gAppUpdater.selectPanel("noUpdatesFound");
-      return;
     },
 
     /**
      * See nsISupports.idl
      */
     QueryInterface: function(aIID) {
       if (!aIID.equals(Components.interfaces.nsIUpdateCheckListener) &&
           !aIID.equals(Components.interfaces.nsISupports))
@@ -608,16 +607,18 @@ var gChannelSelector = {
 
   apply: function() {
     this.channelValue = document.getElementById("channelMenulist").selectedItem.value;
     this.setChannelLabel(this.channelValue);
 
     // Change app update channel.
     Services.prefs.setCharPref("app.update.desiredChannel", this.channelValue);
 
+    // Stop any downloads in progress
+    gAppUpdater.aus.pauseDownload();
     // App updater will look at app.update.desiredChannel for new channel value
     // and will clear it when the update is complete.
     gAppUpdater.isChecking = true;
     gAppUpdater.checker.checkForUpdates(gAppUpdater.updateCheckListener, true);
 
     this.hide();
   },
 
--- a/browser/base/content/browser-appmenu.inc
+++ b/browser/base/content/browser-appmenu.inc
@@ -196,16 +196,20 @@
                     label="&viewPageSourceCmd.label;"
                     command="View:PageSource"
                     key="key_viewSource"/>
           <menuitem id="appmenu_errorConsole"
                     hidden="true"
                     label="&errorConsoleCmd.label;"
                     key="key_errorConsole"
                     oncommand="toJavaScriptConsole();"/>
+          <menuseparator id="appmenu_devToolsEndSeparator"/>
+          <menuitem id="appmenu_getMoreDevtools"
+                    label="&getMoreDevtoolsCmd.label;"
+                    oncommand="openUILinkIn('https://addons.mozilla.org/firefox/collections/mozilla/webdeveloper/', 'tab');"/>
           <menuseparator/>
 #define ID_PREFIX appmenu_developer_
 #define OMIT_ACCESSKEYS
 #include browser-charsetmenu.inc
 #undef ID_PREFIX
 #undef OMIT_ACCESSKEYS
           <menuitem label="&goOfflineCmd.label;"
                     type="checkbox"
--- a/browser/base/content/browser-menubar.inc
+++ b/browser/base/content/browser-menubar.inc
@@ -562,16 +562,21 @@
                             key="key_viewSource"
                             command="View:PageSource"/>
                   <menuitem id="javascriptConsole"
                             hidden="true"
                             label="&errorConsoleCmd.label;"
                             accesskey="&errorConsoleCmd.accesskey;"
                             key="key_errorConsole"
                             oncommand="toJavaScriptConsole();"/>
+                  <menuseparator id="devToolsEndSeparator"/>
+                  <menuitem id="getMoreDevtools"
+                            label="&getMoreDevtoolsCmd.label;"
+                            accesskey="&getMoreDevtoolsCmd.accesskey;"
+                            oncommand="openUILinkIn('https://addons.mozilla.org/firefox/collections/mozilla/webdeveloper/', 'tab');"/>
                 </menupopup>
               </menu>
               <menuitem id="menu_pageInfo"
                         accesskey="&pageInfoCmd.accesskey;"
                         label="&pageInfoCmd.label;"
 #ifndef XP_WIN
                         key="key_viewInfo"
 #endif
--- a/browser/base/content/browser-tabview.js
+++ b/browser/base/content/browser-tabview.js
@@ -35,96 +35,116 @@
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 
 let TabView = {
   _deck: null,
   _iframe: null,
   _window: null,
-  _firstUseExperienced: false,
   _browserKeyHandlerInitialized: false,
   _isFrameLoading: false,
   _initFrameCallbacks: [],
+  PREF_BRANCH: "browser.panorama.",
+  PREF_FIRST_RUN: "browser.panorama.experienced_first_run",
+  PREF_STARTUP_PAGE: "browser.startup.page",
+  PREF_RESTORE_ENABLED_ONCE: "browser.panorama.session_restore_enabled_once",
   VISIBILITY_IDENTIFIER: "tabview-visibility",
+  GROUPS_IDENTIFIER: "tabview-groups",
 
   // ----------
   get windowTitle() {
     delete this.windowTitle;
     let brandBundle = document.getElementById("bundle_brand");
     let brandShortName = brandBundle.getString("brandShortName");
     let title = gNavigatorBundle.getFormattedString("tabView2.title", [brandShortName]);
     return this.windowTitle = title;
   },
 
   // ----------
   get firstUseExperienced() {
-    return this._firstUseExperienced;
+    let pref = this.PREF_FIRST_RUN;
+    if (Services.prefs.prefHasUserValue(pref))
+      return Services.prefs.getBoolPref(pref);
+
+    return false;
   },
 
   // ----------
   set firstUseExperienced(val) {
-    if (val != this._firstUseExperienced)
-      Services.prefs.setBoolPref("browser.panorama.experienced_first_run", val);
+    Services.prefs.setBoolPref(this.PREF_FIRST_RUN, val);
+  },
+
+  // ----------
+  get sessionRestoreEnabledOnce() {
+    let pref = this.PREF_RESTORE_ENABLED_ONCE;
+    if (Services.prefs.prefHasUserValue(pref))
+      return Services.prefs.getBoolPref(pref);
+
+    return false;
+  },
+
+  // ----------
+  set sessionRestoreEnabledOnce(val) {
+    Services.prefs.setBoolPref(this.PREF_RESTORE_ENABLED_ONCE, val);
   },
 
   // ----------
   init: function TabView_init() {
-    if (!Services.prefs.prefHasUserValue("browser.panorama.experienced_first_run") ||
-        !Services.prefs.getBoolPref("browser.panorama.experienced_first_run")) {
-      Services.prefs.addObserver(
-        "browser.panorama.experienced_first_run", this, false);
-    } else {
-      this._firstUseExperienced = true;
-
+    if (this.firstUseExperienced) {
       if ((gBrowser.tabs.length - gBrowser.visibleTabs.length) > 0)
         this._setBrowserKeyHandlers();
 
       // ___ visibility
       let sessionstore =
         Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
+
       let data = sessionstore.getWindowValue(window, this.VISIBILITY_IDENTIFIER);
-
       if (data && data == "true") {
         this.show();
       } else {
-        let self = this;
+        try {
+          data = sessionstore.getWindowValue(window, this.GROUPS_IDENTIFIER);
+          if (data) {
+            let parsedData = JSON.parse(data);
+            this.updateGroupNumberBroadcaster(parsedData.totalNumber || 0);
+          }
+        } catch (e) { }
 
-        // if a tab is changed from hidden to unhidden and the iframe is not 
+        let self = this;
+        // if a tab is changed from hidden to unhidden and the iframe is not
         // initialized, load the iframe and setup the tab.
         this._tabShowEventListener = function (event) {
           if (!self._window)
             self._initFrame(function() {
               self._window.UI.onTabSelect(gBrowser.selectedTab);
             });
         };
         gBrowser.tabContainer.addEventListener(
           "TabShow", this._tabShowEventListener, true);
       }
     }
+
+    Services.prefs.addObserver(this.PREF_BRANCH, this, false);
   },
 
   // ----------
   // Observes topic changes.
   observe: function TabView_observe(subject, topic, data) {
-    if (topic == "nsPref:changed") {
-      Services.prefs.removeObserver(
-        "browser.panorama.experienced_first_run", this);
-      this._firstUseExperienced = true;
+    if (data == this.PREF_FIRST_RUN && this.firstUseExperienced) {
       this._addToolbarButton();
+      this.enableSessionRestore();
     }
   },
 
   // ----------
   // Uninitializes TabView.
   uninit: function TabView_uninit() {
-    if (!this._firstUseExperienced) {
-      Services.prefs.removeObserver(
-        "browser.panorama.experienced_first_run", this);
-    }
+    Services.prefs.removeObserver(this.PREF_BRANCH, this);
+
     if (this._tabShowEventListener) {
       gBrowser.tabContainer.removeEventListener(
         "TabShow", this._tabShowEventListener, true);
     }
   },
 
   // ----------
   // Creates the frame and calls the callback once it's loaded. 
@@ -361,10 +381,36 @@ let TabView = {
     if (-1 == alltabsPos)
       return;
 
     currentSet[alltabsPos] += "," + buttonId;
     currentSet = currentSet.join(",");
     toolbar.currentSet = currentSet;
     toolbar.setAttribute("currentset", currentSet);
     document.persist(toolbar.id, "currentset");
+  },
+
+  // ----------
+  // Function: updateGroupNumberBroadcaster
+  // Updates the group number broadcaster.
+  updateGroupNumberBroadcaster: function TabView_updateGroupNumberBroadcaster(number) {
+    let groupsNumber = document.getElementById("tabviewGroupsNumber");
+    groupsNumber.setAttribute("groups", number);
+  },
+
+  // ----------
+  // Function: enableSessionRestore
+  // Enables automatic session restore when the browser is started. Does
+  // nothing if we already did that once in the past.
+  enableSessionRestore: function UI_enableSessionRestore() {
+    if (!this._window || !this.firstUseExperienced)
+      return;
+
+    // do nothing if we already enabled session restore once
+    if (this.sessionRestoreEnabledOnce)
+      return;
+
+    this.sessionRestoreEnabledOnce = true;
+
+    // enable session restore
+    Services.prefs.setIntPref(this.PREF_STARTUP_PAGE, 3);
   }
 };
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -457,17 +457,16 @@ browser[tabmodalPromptShowing] {
 /* Status panel */
 
 statuspanel {
   -moz-binding: url("chrome://browser/content/tabbrowser.xml#statuspanel");
   position: fixed;
   margin-top: -3em;
   left: 0;
   max-width: 50%;
-  -moz-transition: opacity 100ms ease-out;
 }
 
 statuspanel:-moz-locale-dir(ltr)[mirror],
 statuspanel:-moz-locale-dir(rtl):not([mirror]) {
   left: auto;
   right: 0;
 }
 
@@ -477,22 +476,27 @@ statuspanel[type=status] {
 
 @media all and (max-width: 800px) {
   statuspanel[type=status] {
     min-width: 33%;
   }
 }
 
 statuspanel[type=overLink] {
+  -moz-transition: opacity 100ms ease-out;
   direction: ltr;
 }
 
 statuspanel[label=""] {
   -moz-transition: none;
   opacity: 0;
   pointer-events: none;
 }
 
 .statuspanel-inner {
   height: 3em;
   width: 100%;
   -moz-box-align: end;
 }
+
+.panel-inner-arrowcontentfooter[footertype="promobox"] {
+  -moz-binding: url("chrome://browser/content/urlbarBindings.xml#promobox");
+}
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -256,77 +256,96 @@ function UpdateBackForwardCommands(aWebN
 
 /**
  * Click-and-Hold implementation for the Back and Forward buttons
  * XXXmano: should this live in toolbarbutton.xml?
  */
 function SetClickAndHoldHandlers() {
   var timer;
 
-  function timerCallback(aButton) {
+  function openMenu(aButton) {
+    cancelHold(aButton);
     aButton.firstChild.hidden = false;
     aButton.open = true;
-    timer = null;
   }
 
   function mousedownHandler(aEvent) {
     if (aEvent.button != 0 ||
         aEvent.currentTarget.open ||
         aEvent.currentTarget.disabled)
       return;
 
     // Prevent the menupopup from opening immediately
     aEvent.currentTarget.firstChild.hidden = true;
 
-    timer = setTimeout(timerCallback, 500, aEvent.currentTarget);
+    aEvent.currentTarget.addEventListener("mouseout", mouseoutHandler, false);
+    aEvent.currentTarget.addEventListener("mouseup", mouseupHandler, false);
+    timer = setTimeout(openMenu, 500, aEvent.currentTarget);
+  }
+
+  function mouseoutHandler(aEvent) {
+    let buttonRect = aEvent.currentTarget.getBoundingClientRect();
+    if (aEvent.clientX >= buttonRect.left &&
+        aEvent.clientX <= buttonRect.right &&
+        aEvent.clientY >= buttonRect.bottom)
+      openMenu(aEvent.currentTarget);
+    else
+      cancelHold(aEvent.currentTarget);
+  }
+
+  function mouseupHandler(aEvent) {
+    cancelHold(aEvent.currentTarget);
+  }
+
+  function cancelHold(aButton) {
+    clearTimeout(timer);
+    aButton.removeEventListener("mouseout", mouseoutHandler, false);
+    aButton.removeEventListener("mouseup", mouseupHandler, false);
   }
 
   function clickHandler(aEvent) {
     if (aEvent.button == 0 &&
         aEvent.target == aEvent.currentTarget &&
         !aEvent.currentTarget.open &&
         !aEvent.currentTarget.disabled) {
       let cmdEvent = document.createEvent("xulcommandevent");
       cmdEvent.initCommandEvent("command", true, true, window, 0,
                                 aEvent.ctrlKey, aEvent.altKey, aEvent.shiftKey,
                                 aEvent.metaKey, null);
       aEvent.currentTarget.dispatchEvent(cmdEvent);
     }
   }
 
-  function stopTimer(aEvent) {
-    if (timer) {
-      clearTimeout(timer);
-      timer = null;
-    }
-  }
-
   function _addClickAndHoldListenersOnElement(aElm) {
     aElm.addEventListener("mousedown", mousedownHandler, true);
-    aElm.addEventListener("mouseup", stopTimer, false);
-    aElm.addEventListener("mouseout", stopTimer, false);
     aElm.addEventListener("click", clickHandler, true);
   }
 
-  // Bug 414797: Clone the dropmarker's menu into both the back and
-  // the forward buttons.
+  // Bug 414797: Clone unified-back-forward-button's context menu into both the
+  // back and the forward buttons.
   var unifiedButton = document.getElementById("unified-back-forward-button");
   if (unifiedButton && !unifiedButton._clickHandlersAttached) {
-    var popup = document.getElementById("backForwardMenu").cloneNode(true);
+    unifiedButton._clickHandlersAttached = true;
+
+    let popup = document.getElementById("backForwardMenu").cloneNode(true);
     popup.removeAttribute("id");
-    var backButton = document.getElementById("back-button");
+    // Prevent the context attribute on unified-back-forward-button from being
+    // inherited.
+    popup.setAttribute("context", "");
+
+    let backButton = document.getElementById("back-button");
     backButton.setAttribute("type", "menu");
     backButton.appendChild(popup);
     _addClickAndHoldListenersOnElement(backButton);
-    var forwardButton = document.getElementById("forward-button");
+
+    let forwardButton = document.getElementById("forward-button");
     popup = popup.cloneNode(true);
     forwardButton.setAttribute("type", "menu");
     forwardButton.appendChild(popup);
     _addClickAndHoldListenersOnElement(forwardButton);
-    unifiedButton._clickHandlersAttached = true;
   }
 }
 
 const gSessionHistoryObserver = {
   observe: function(subject, topic, data)
   {
     if (topic != "browser:purge-session-history")
       return;
@@ -1374,17 +1393,17 @@ function prepareForStartup() {
   gBrowser.addEventListener("PluginNotFound",     gPluginHandler, true);
   gBrowser.addEventListener("PluginCrashed",      gPluginHandler, true);
   gBrowser.addEventListener("PluginBlocklisted",  gPluginHandler, true);
   gBrowser.addEventListener("PluginOutdated",     gPluginHandler, true);
   gBrowser.addEventListener("PluginDisabled",     gPluginHandler, true);
   gBrowser.addEventListener("NewPluginInstalled", gPluginHandler.newPluginInstalled, true);
 #ifdef XP_MACOSX
   gBrowser.addEventListener("npapi-carbon-event-model-failure", gPluginHandler, true);
-#endif 
+#endif
 
   Services.obs.addObserver(gPluginHandler.pluginCrashed, "plugin-crashed", false);
 
   window.addEventListener("AppCommand", HandleAppCommandEvent, true);
 
   var webNavigation;
   try {
     webNavigation = getWebNavigation();
@@ -3322,27 +3341,27 @@ const BrowserSearch = {
    * or focuses an existing window, if necessary.
    */
   webSearch: function BrowserSearch_webSearch() {
 #ifdef XP_MACOSX
     if (window.location.href != getBrowserURL()) {
       var win = getTopWin();
       if (win) {
         // If there's an open browser window, it should handle this command
-        win.focus()
+        win.focus();
         win.BrowserSearch.webSearch();
       } else {
         // If there are no open browser windows, open a new one
         function observer(subject, topic, data) {
           if (subject == win) {
             BrowserSearch.webSearch();
             Services.obs.removeObserver(observer, "browser-delayed-startup-finished");
           }
         }
-        win = window.openDialog("chrome://browser/content/", "_blank",
+        win = window.openDialog(getBrowserURL(), "_blank",
                                 "chrome,all,dialog=no", "about:blank");
         Services.obs.addObserver(observer, "browser-delayed-startup-finished", false); 
       }
       return;
     }
 #endif
     var searchBar = this.searchBar;
     if (searchBar && window.fullScreen)
@@ -4113,17 +4132,17 @@ var XULBrowserWindow = {
   status: "",
   defaultStatus: "",
   jsStatus: "",
   jsDefaultStatus: "",
   overLink: "",
   startTime: 0,
   statusText: "",
   isBusy: false,
-  inContentWhitelist: ["about:addons"],
+  inContentWhitelist: ["about:addons", "about:permissions"],
 
   QueryInterface: function (aIID) {
     if (aIID.equals(Ci.nsIWebProgressListener) ||
         aIID.equals(Ci.nsIWebProgressListener2) ||
         aIID.equals(Ci.nsISupportsWeakReference) ||
         aIID.equals(Ci.nsIXULBrowserWindow) ||
         aIID.equals(Ci.nsISupports))
       return this;
@@ -6687,56 +6706,65 @@ var gPluginHandler = {
                                 }
                               },
                               true);
   },
 
   handleEvent : function(event) {
     let self = gPluginHandler;
     let plugin = event.target;
-    let hideBarPrefName;
+    let doc = plugin.ownerDocument;
 
     // We're expecting the target to be a plugin.
     if (!(plugin instanceof Ci.nsIObjectLoadingContent))
       return;
 
+    // Force a style flush, so that we ensure our binding is attached.
+    plugin.clientTop;
+
     switch (event.type) {
       case "PluginCrashed":
         self.pluginInstanceCrashed(plugin, event);
         break;
 
       case "PluginNotFound":
         // For non-object plugin tags, register a click handler to install the
         // plugin. Object tags can, and often do, deal with that themselves,
         // so don't stomp on the page developers toes.
-        if (!(plugin instanceof HTMLObjectElement))
-          self.addLinkClickCallback(plugin, "installSinglePlugin");
+        if (!(plugin instanceof HTMLObjectElement)) {
+          // We don't yet check to see if there's actually an installer available.
+          let installStatus = doc.getAnonymousElementByAttribute(plugin, "class", "installStatus");
+          installStatus.setAttribute("status", "ready");
+          let iconStatus = doc.getAnonymousElementByAttribute(plugin, "class", "icon");
+          iconStatus.setAttribute("status", "ready");
+
+          let installLink = doc.getAnonymousElementByAttribute(plugin, "class", "installPluginLink");
+          self.addLinkClickCallback(installLink, "installSinglePlugin", plugin);
+        }
         /* FALLTHRU */
+
       case "PluginBlocklisted":
       case "PluginOutdated":
-        hideBarPrefName = event.type == "PluginOutdated" ?
-                                "plugins.hide_infobar_for_outdated_plugin" :
-                                "plugins.hide_infobar_for_missing_plugin";
-        if (gPrefService.getBoolPref(hideBarPrefName))
-          return;
-
+#ifdef XP_MACOSX
+      case "npapi-carbon-event-model-failure":
+#endif
         self.pluginUnavailable(plugin, event.type);
         break;
-#ifdef XP_MACOSX
-      case "npapi-carbon-event-model-failure":
-        hideBarPrefName = "plugins.hide_infobar_for_carbon_failure_plugin";
-        if (gPrefService.getBoolPref(hideBarPrefName))
-          return;
-
-        self.pluginUnavailable(plugin, event.type);
+
+      case "PluginDisabled":
+        let manageLink = doc.getAnonymousElementByAttribute(plugin, "class", "managePluginsLink");
+        self.addLinkClickCallback(manageLink, "managePlugins");
         break;
-#endif
-      case "PluginDisabled":
-        self.addLinkClickCallback(plugin, "managePlugins");
-        break;
+    }
+
+    // Hide the in-content UI if it's too big. The crashed plugin handler already did this.
+    if (event.type != "PluginCrashed") {
+      let overlay = doc.getAnonymousElementByAttribute(plugin, "class", "mainBox");
+      if (self.isTooSmall(plugin, overlay))
+          overlay.style.visibility = "hidden";
     }
   },
 
   newPluginInstalled : function(event) {
     // browser elements are anonymous so we can't just use target.
     var browser = event.originalTarget;
     // clear the plugin list, now that at least one plugin has been installed
     browser.missingPlugins = null;
@@ -6746,20 +6774,20 @@ var gPluginHandler = {
     if (notification)
       notificationBox.removeNotification(notification);
 
     // reload the browser to make the new plugin show.
     browser.reload();
   },
 
   // Callback for user clicking on a missing (unsupported) plugin.
-  installSinglePlugin: function (aEvent) {
+  installSinglePlugin: function (plugin) {
     var missingPluginsArray = {};
 
-    var pluginInfo = getPluginInfo(aEvent.target);
+    var pluginInfo = getPluginInfo(plugin);
     missingPluginsArray[pluginInfo.mimetype] = pluginInfo;
 
     openDialog("chrome://mozapps/content/plugins/pluginInstallerWizard.xul",
                "PFSWindow", "chrome,centerscreen,resizable=yes",
                {plugins: missingPluginsArray, browser: gBrowser.selectedBrowser});
   },
 
   // Callback for user clicking on a disabled plugin
@@ -6799,19 +6827,16 @@ var gPluginHandler = {
     var notificationBox = gBrowser.getNotificationBox(browser);
 
     // Should only display one of these warnings per page.
     // In order of priority, they are: outdated > missing > blocklisted
     let outdatedNotification = notificationBox.getNotificationWithValue("outdated-plugins");
     let blockedNotification  = notificationBox.getNotificationWithValue("blocked-plugins");
     let missingNotification  = notificationBox.getNotificationWithValue("missing-plugins");
 
-    // If there is already an outdated plugin notification then do nothing
-    if (outdatedNotification)
-      return;
 
     function showBlocklistInfo() {
       var url = formatURL("extensions.blocklist.detailsURL", true);
       gBrowser.loadOneTab(url, {inBackground: false});
       return true;
     }
 
     function showOutdatedPluginsInfo() {
@@ -6833,17 +6858,17 @@ var gPluginHandler = {
 
 #ifdef XP_MACOSX
     function carbonFailurePluginsRestartBrowser()
     {
       // Notify all windows that an application quit has been requested.
       let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].
                          createInstance(Ci.nsISupportsPRBool);
       Services.obs.notifyObservers(cancelQuit, "quit-application-requested", null);
- 
+
       // Something aborted the quit process.
       if (cancelQuit.data)
         return;
 
       let as = Cc["@mozilla.org/toolkit/app-startup;1"].getService(Ci.nsIAppStartup);
       as.quit(Ci.nsIAppStartup.eRestarti386 | Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eAttemptQuit);
     }
 #endif
@@ -6897,43 +6922,60 @@ var gPluginHandler = {
                                                          label     : gNavigatorBundle.getString("carbonFailurePluginsMessage.restartButton.label"),
                                                          accessKey : gNavigatorBundle.getString("carbonFailurePluginsMessage.restartButton.accesskey"),
                                                          popup     : null,
                                                          callback  : carbonFailurePluginsRestartBrowser
                                                       }],
                             }
 #endif
     };
+
+    // If there is already an outdated plugin notification then do nothing
+    if (outdatedNotification)
+      return;
+
 #ifdef XP_MACOSX
     if (eventType == "npapi-carbon-event-model-failure") {
-
-      let carbonFailureNotification = 
+      if (gPrefService.getBoolPref("plugins.hide_infobar_for_carbon_failure_plugin"))
+        return;
+
+      let carbonFailureNotification =
         notificationBox.getNotificationWithValue("carbon-failure-plugins");
 
       if (carbonFailureNotification)
          carbonFailureNotification.close();
 
       let macutils = Cc["@mozilla.org/xpcom/mac-utils;1"].getService(Ci.nsIMacUtils);
       // if this is not a Universal build, just follow PluginNotFound path
       if (!macutils.isUniversalBinary)
         eventType = "PluginNotFound";
     }
 #endif
+
     if (eventType == "PluginBlocklisted") {
+      if (gPrefService.getBoolPref("plugins.hide_infobar_for_missing_plugin")) // XXX add a new pref?
+        return;
+
       if (blockedNotification || missingNotification)
         return;
     }
     else if (eventType == "PluginOutdated") {
+      if (gPrefService.getBoolPref("plugins.hide_infobar_for_outdated_plugin"))
+        return;
+
       // Cancel any notification about blocklisting/missing plugins
       if (blockedNotification)
         blockedNotification.close();
       if (missingNotification)
         missingNotification.close();
     }
     else if (eventType == "PluginNotFound") {
+      if (gPrefService.getBoolPref("plugins.hide_infobar_for_missing_plugin"))
+        return;
+
       if (missingNotification)
         return;
 
       // Cancel any notification about blocklisting plugins
       if (blockedNotification)
         blockedNotification.close();
     }
 
@@ -6979,32 +7021,23 @@ var gPluginHandler = {
     let pluginName      = aEvent.getData("pluginName");
     let pluginFilename  = aEvent.getData("pluginFilename");
     let pluginDumpID    = aEvent.getData("pluginDumpID");
     let browserDumpID   = aEvent.getData("browserDumpID");
 
     // Remap the plugin name to a more user-presentable form.
     pluginName = this.makeNicePluginName(pluginName, pluginFilename);
 
-    // Force a style flush, so that we ensure our binding is attached.
-    plugin.clientTop;
-
     let messageString = gNavigatorBundle.getFormattedString("crashedpluginsMessage.title", [pluginName]);
 
     //
     // Configure the crashed-plugin placeholder.
     //
     let doc = plugin.ownerDocument;
     let overlay = doc.getAnonymousElementByAttribute(plugin, "class", "mainBox");
-
-    // The binding has role="link" here, since missing/disabled/blocked
-    // plugin UI has a onclick handler on the whole thing. This isn't needed
-    // for the plugin-crashed UI, because we use actual HTML links in the text.
-    overlay.removeAttribute("role");
-
     let statusDiv = doc.getAnonymousElementByAttribute(plugin, "class", "submitStatus");
 #ifdef MOZ_CRASHREPORTER
     let status;
 
     // Determine which message to show regarding crash reports.
     if (submittedReport) { // submitReports && !doPrompt, handled in observer
       status = "submitted";
     }
@@ -7648,32 +7681,31 @@ var gIdentityHandler = {
       switch (gPrefService.getIntPref("browser.identity.ssl_domain_display")) {
         case 2 : // Show full domain
           icon_label = this._lastLocation.hostname;
           break;
         case 1 : // Show eTLD.
           icon_label = this.getEffectiveHost();
       }
 
-      // We need a port number for all lookups.  If one hasn't been specified, use
-      // the https default
-      var lookupHost = this._lastLocation.host;
-      if (lookupHost.indexOf(':') < 0)
-        lookupHost += ":443";
-
       // Verifier is either the CA Org, for a normal cert, or a special string
       // for certs that are trusted because of a security exception.
       var tooltip = gNavigatorBundle.getFormattedString("identity.identified.verifier",
                                                         [iData.caOrg]);
 
       // Check whether this site is a security exception. XPConnect does the right
       // thing here in terms of converting _lastLocation.port from string to int, but
       // the overrideService doesn't like undefined ports, so make sure we have
       // something in the default case (bug 432241).
-      if (this._overrideService.hasMatchingOverride(this._lastLocation.hostname,
+      // .hostname can return an empty string in some exceptional cases -
+      // hasMatchingOverride does not handle that, so avoid calling it.
+      // Updating the tooltip value in those cases isn't critical.
+      // FIXME: Fixing bug 646690 would probably makes this check unnecessary
+      if (this._lastLocation.hostname &&
+          this._overrideService.hasMatchingOverride(this._lastLocation.hostname,
                                                     (this._lastLocation.port || 443),
                                                     iData.cert, {}, {}))
         tooltip = gNavigatorBundle.getString("identity.identified.verified_by_you");
     }
     else if (newMode == this.IDENTITY_MODE_IDENTIFIED) {
       // If it's identified, then we can populate the dialog with credentials
       iData = this.getIdentityData();
       tooltip = gNavigatorBundle.getFormattedString("identity.identified.verifier",
@@ -8483,26 +8515,31 @@ function restoreLastSession() {
   ss.restoreLastSession();
 }
 
 var TabContextMenu = {
   contextTab: null,
   updateContextMenu: function updateContextMenu(aPopupMenu) {
     this.contextTab = document.popupNode.localName == "tab" ?
                       document.popupNode : gBrowser.selectedTab;
-    let disabled = gBrowser.visibleTabs.length == 1;
+    let disabled = gBrowser.tabs.length == 1;
 
     // Enable the "Close Tab" menuitem when the window doesn't close with the last tab.
     document.getElementById("context_closeTab").disabled =
       disabled && gBrowser.tabContainer._closeWindowWithLastTab;
 
     var menuItems = aPopupMenu.getElementsByAttribute("tbattr", "tabbrowser-multiple");
     for (var i = 0; i < menuItems.length; i++)
       menuItems[i].disabled = disabled;
 
+    disabled = gBrowser.visibleTabs.length == 1;
+    menuItems = aPopupMenu.getElementsByAttribute("tbattr", "tabbrowser-multiple-visible");
+    for (var i = 0; i < menuItems.length; i++)
+      menuItems[i].disabled = disabled;
+
     // Session store
     document.getElementById("context_undoCloseTab").disabled =
       Cc["@mozilla.org/browser/sessionstore;1"].
       getService(Ci.nsISessionStore).
       getClosedTabCount(window) == 0;
 
     // Only one of pin/unpin should be visible
     document.getElementById("context_pinTab").hidden = this.contextTab.pinned;
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -134,17 +134,17 @@
         </menupopup>
       </menu>
       <menuitem id="context_openTabInWindow" label="&moveToNewWindow.label;"
                 accesskey="&moveToNewWindow.accesskey;"
                 tbattr="tabbrowser-multiple"
                 oncommand="gBrowser.replaceTabWithWindow(TabContextMenu.contextTab);"/>
       <menuseparator/>
       <menuitem id="context_reloadAllTabs" label="&reloadAllTabs.label;" accesskey="&reloadAllTabs.accesskey;"
-                tbattr="tabbrowser-multiple"
+                tbattr="tabbrowser-multiple-visible"
                 oncommand="gBrowser.reloadAllTabs();"/>
       <menuitem id="context_bookmarkAllTabs"
                 label="&bookmarkAllTabs.label;"
                 accesskey="&bookmarkAllTabs.accesskey;"
                 command="Browser:BookmarkAllTabs"/>
       <menuitem id="context_closeOtherTabs" label="&closeOtherTabs.label;" accesskey="&closeOtherTabs.accesskey;"
                 oncommand="gBrowser.removeAllTabsBut(TabContextMenu.contextTab);"/>
       <menuseparator/>
@@ -172,16 +172,17 @@
 
     <!-- for invalid form error message -->
     <panel id="invalid-form-popup" type="arrow" orient="vertical" noautofocus="true" hidden="true" level="parent">
       <description/>
     </panel>
 
     <panel id="editBookmarkPanel"
            type="arrow"
+           footertype="promobox"
            orient="vertical"
            ignorekeys="true"
            hidden="true"
            onpopupshown="StarUI.panelShown(event);"
            aria-labelledby="editBookmarkPanelTitle">
       <row id="editBookmarkPanelHeader" align="center" hidden="true">
         <vbox align="center">
           <image id="editBookmarkPanelStarIcon"/>
@@ -332,18 +333,23 @@
                                  updateEditUIVisibility();
                                return gContextMenu.shouldDisplay;"
                onpopuphiding="if (event.target == this) { gContextMenu = null; updateEditUIVisibility(); }">
 #include browser-context.inc
     </menupopup>
 
     <menupopup id="placesContext"/>
 
-    <panel id="notification-popup" type="arrow" position="after_start"
-           hidden="true" orient="vertical"/>
+    <panel id="notification-popup"
+           type="arrow"
+           footertype="promobox"
+           position="after_start"
+           hidden="true"
+           orient="vertical"
+           role="alert"/>
 
     <!-- Popup for site identity information -->
     <panel id="identity-popup"
            type="arrow"
            hidden="true"
            noautofocus="true"
            onpopupshown="document.getElementById('identity-popup-more-info-button').focus();"
            level="top">
@@ -839,19 +845,18 @@
                      removable="true">
         <menupopup id="alltabs-popup"
                    position="after_end">
           <menuitem id="menu_tabview"
                     class="menuitem-iconic"
                     key="key_tabview"
                     label="&viewTabGroups.label;"
                     command="Browser:ToggleTabView"
-                    observes="tabviewGroupsNumber"
-                    keepme="true"/>
-          <menuseparator id="alltabs-popup-separator" keepme="true"/>
+                    observes="tabviewGroupsNumber"/>
+          <menuseparator id="alltabs-popup-separator"/>
         </menupopup>
       </toolbarbutton>
 
       <toolbarbutton id="tabs-closebutton"
                      class="close-button tabs-closebutton"
                      command="cmd_close"
                      label="&closeTab.label;"
                      tooltiptext="&closeTab.label;"/>
--- a/browser/base/content/scratchpad.js
+++ b/browser/base/content/scratchpad.js
@@ -53,34 +53,34 @@ const Ci = Components.interfaces;
 const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/NetUtil.jsm");
 Cu.import("resource:///modules/PropertyPanel.jsm");
 
 const SCRATCHPAD_CONTEXT_CONTENT = 1;
-const SCRATCHPAD_CONTEXT_CHROME = 2;
+const SCRATCHPAD_CONTEXT_BROWSER = 2;
 const SCRATCHPAD_WINDOW_URL = "chrome://browser/content/scratchpad.xul";
 const SCRATCHPAD_L10N = "chrome://browser/locale/scratchpad.properties";
 const SCRATCHPAD_WINDOW_FEATURES = "chrome,titlebar,toolbar,centerscreen,resizable,dialog=no";
 const DEVTOOLS_CHROME_ENABLED = "devtools.chrome.enabled";
 
 /**
  * The scratchpad object handles the Scratchpad window functionality.
  */
 var Scratchpad = {
   /**
    * The script execution context. This tells Scratchpad in which context the
    * script shall execute.
    *
    * Possible values:
    *   - SCRATCHPAD_CONTEXT_CONTENT to execute code in the context of the current
    *   tab content window object.
-   *   - SCRATCHPAD_CONTEXT_CHROME to execute code in the context of the
+   *   - SCRATCHPAD_CONTEXT_BROWSER to execute code in the context of the
    *   currently active chrome window object.
    */
   executionContext: SCRATCHPAD_CONTEXT_CONTENT,
 
   /**
    * Retrieve the xul:textbox DOM element. This element holds the source code
    * the user writes and executes.
    */
@@ -116,42 +116,52 @@ var Scratchpad = {
    * Get the gBrowser object of the most recent browser window.
    */
   get gBrowser()
   {
     let recentWin = this.browserWindow;
     return recentWin ? recentWin.gBrowser : null;
   },
 
+  insertIntro: function SP_insertIntro()
+  {
+    this.textbox.value = this.strings.GetStringFromName("scratchpadIntro");
+  },
+
   /**
    * Cached Cu.Sandbox object for the active tab content window object.
    */
   _contentSandbox: null,
 
   /**
    * Get the Cu.Sandbox object for the active tab content window object. Note
    * that the returned object is cached for later reuse. The cached object is
-   * kept only for the current browser window and it is reset for each context
-   * switch or navigator:browser window switch.
+   * kept only for the current location in the current tab of the current
+   * browser window and it is reset for each context switch,
+   * navigator:browser window switch, tab switch or navigation.
    */
   get contentSandbox()
   {
     if (!this.browserWindow) {
       Cu.reportError(this.strings.
                      GetStringFromName("browserWindow.unavailable"));
       return;
     }
 
     if (!this._contentSandbox ||
-        this.browserWindow != this._previousBrowserWindow) {
+        this.browserWindow != this._previousBrowserWindow ||
+        this._previousBrowser != this.gBrowser.selectedBrowser ||
+        this._previousLocation != this.gBrowser.contentWindow.location.href) {
       let contentWindow = this.gBrowser.selectedBrowser.contentWindow;
       this._contentSandbox = new Cu.Sandbox(contentWindow,
         { sandboxPrototype: contentWindow, wantXrays: false });
 
       this._previousBrowserWindow = this.browserWindow;
+      this._previousBrowser = this.gBrowser.selectedBrowser;
+      this._previousLocation = contentWindow.location.href;
     }
 
     return this._contentSandbox;
   },
 
   /**
    * Cached Cu.Sandbox object for the most recently active navigator:browser
    * chrome window object.
@@ -278,53 +288,53 @@ var Scratchpad = {
            this.evalInContentSandbox(aString) :
            this.evalInChromeSandbox(aString);
   },
 
   /**
    * Execute the selected text (if any) or the entire textbox content in the
    * current context.
    */
-  execute: function SP_execute()
+  run: function SP_run()
   {
     let selection = this.selectedText || this.textbox.value;
     let result = this.evalForContext(selection);
     this.deselect();
     return [selection, result];
   },
 
   /**
    * Execute the selected text (if any) or the entire textbox content in the
    * current context. The resulting object is opened up in the Property Panel
    * for inspection.
    */
   inspect: function SP_inspect()
   {
-    let [selection, result] = this.execute();
+    let [selection, result] = this.run();
 
     if (result) {
       this.openPropertyPanel(selection, result);
     }
   },
 
   /**
    * Execute the selected text (if any) or the entire textbox content in the
-   * current context. The evaluation result is "printed" in the textbox after
+   * current context. The evaluation result is inserted into the textbox after
    * the selected text, or at the end of the textbox value if there is no
    * selected text.
    */
-  print: function SP_print()
+  display: function SP_display()
   {
     let selectionStart = this.textbox.selectionStart;
     let selectionEnd = this.textbox.selectionEnd;
     if (selectionStart == selectionEnd) {
       selectionEnd = this.textbox.value.length;
     }
 
-    let [selection, result] = this.execute();
+    let [selection, result] = this.run();
     if (!result) {
       return;
     }
 
     let firstPiece = this.textbox.value.slice(0, selectionEnd);
     let lastPiece = this.textbox.value.
                     slice(selectionEnd, this.textbox.value.length);
 
@@ -551,44 +561,46 @@ var Scratchpad = {
   },
 
   /**
    * Set the current execution context to be the active tab content window.
    */
   setContentContext: function SP_setContentContext()
   {
     let content = document.getElementById("sp-menu-content");
-    document.getElementById("sp-menu-chrome").removeAttribute("checked");
+    document.getElementById("sp-menu-browser").removeAttribute("checked");
     content.setAttribute("checked", true);
+    this.executionContext = SCRATCHPAD_CONTEXT_CONTENT;
     this.statusbarStatus.label = content.getAttribute("label");
-    this.executionContext = SCRATCHPAD_CONTEXT_CONTENT;
     this.resetContext();
   },
 
   /**
    * Set the current execution context to be the most recent chrome window.
    */
-  setChromeContext: function SP_setChromeContext()
+  setBrowserContext: function SP_setBrowserContext()
   {
-    let chrome = document.getElementById("sp-menu-chrome");
+    let browser = document.getElementById("sp-menu-browser");
     document.getElementById("sp-menu-content").removeAttribute("checked");
-    chrome.setAttribute("checked", true);
-    this.statusbarStatus.label = chrome.getAttribute("label");
-    this.executionContext = SCRATCHPAD_CONTEXT_CHROME;
+    browser.setAttribute("checked", true);
+    this.executionContext = SCRATCHPAD_CONTEXT_BROWSER;
+    this.statusbarStatus.label = browser.getAttribute("label");
     this.resetContext();
   },
 
   /**
    * Reset the cached Cu.Sandbox object for the current context.
    */
   resetContext: function SP_resetContext()
   {
     this._chromeSandbox = null;
     this._contentSandbox = null;
     this._previousWindow = null;
+    this._previousBrowser = null;
+    this._previousLocation = null;
   },
 
   /**
    * Gets the ID of the outer window of the given DOM window object.
    *
    * @param nsIDOMWindow aWindow
    * @return integer
    *         the outer window ID
@@ -599,28 +611,29 @@ var Scratchpad = {
            getInterface(Ci.nsIDOMWindowUtils).outerWindowID;
   },
 
   /**
    * The Scratchpad window DOMContentLoaded event handler.
    */
   onLoad: function SP_onLoad()
   {
-    let chromeContextMenu = document.getElementById("sp-menu-chrome");
+    let chromeContextMenu = document.getElementById("sp-menu-browser");
     let errorConsoleMenu = document.getElementById("sp-menu-errorConsole");
     let errorConsoleCommand = document.getElementById("sp-cmd-errorConsole");
-    let chromeContextCommand = document.getElementById("sp-cmd-chromeContext");
+    let chromeContextCommand = document.getElementById("sp-cmd-browserContext");
 
     let chrome = Services.prefs.getBoolPref(DEVTOOLS_CHROME_ENABLED);
     if (chrome) {
       chromeContextMenu.removeAttribute("hidden");
       errorConsoleMenu.removeAttribute("hidden");
       errorConsoleCommand.removeAttribute("disabled");
       chromeContextCommand.removeAttribute("disabled");
     }
+    this.insertIntro();
   },
 };
 
 XPCOMUtils.defineLazyGetter(Scratchpad, "strings", function () {
   return Services.strings.createBundle(SCRATCHPAD_L10N);
 });
 
 addEventListener("DOMContentLoaded", Scratchpad.onLoad.bind(Scratchpad), false);
--- a/browser/base/content/scratchpad.xul
+++ b/browser/base/content/scratchpad.xul
@@ -65,21 +65,21 @@
   <command id="sp-cmd-save" oncommand="Scratchpad.saveFile();"/>
   <command id="sp-cmd-saveas" oncommand="Scratchpad.saveFileAs();"/>
 
   <!-- TODO: bug 650340 - implement printFile()
   <command id="sp-cmd-printFile" oncommand="Scratchpad.printFile();" disabled="true"/>
  -->
 
   <command id="sp-cmd-close" oncommand="window.close();"/>
-  <command id="sp-cmd-execute" oncommand="Scratchpad.execute();"/>
+  <command id="sp-cmd-run" oncommand="Scratchpad.run();"/>
   <command id="sp-cmd-inspect" oncommand="Scratchpad.inspect();"/>
-  <command id="sp-cmd-print" oncommand="Scratchpad.print();"/>
+  <command id="sp-cmd-display" oncommand="Scratchpad.display();"/>
   <command id="sp-cmd-contentContext" oncommand="Scratchpad.setContentContext();"/>
-  <command id="sp-cmd-chromeContext" oncommand="Scratchpad.setChromeContext();" disabled="true"/>
+  <command id="sp-cmd-browserContext" oncommand="Scratchpad.setBrowserContext();" disabled="true"/>
   <command id="sp-cmd-resetContext" oncommand="Scratchpad.resetContext();"/>
   <command id="sp-cmd-errorConsole" oncommand="Scratchpad.openErrorConsole();" disabled="true"/>
   <command id="sp-cmd-webConsole" oncommand="Scratchpad.openWebConsole();"/>
 </commandset>
 
 <keyset id="sp-keyset">
   <key id="sp-key-window"
        key="&newWindowCmd.commandkey;"
@@ -113,27 +113,27 @@
        key="&copyCmd.key;"
        modifiers="accel"/>
   <key id="key_paste"
        key="&pasteCmd.key;"
        modifiers="accel"/>
   <key id="key_selectAll" key="&selectAllCmd.key;" modifiers="accel"/>
   <key id="key_undo" key="&undoCmd.key;" modifiers="accel"/>
   <key id="key_redo" key="&undoCmd.key;" modifiers="accel,shift"/>
-  <key id="sp-key-execute"
-       key="&execute.key;"
-       command="sp-cmd-execute"
+  <key id="sp-key-run"
+       key="&run.key;"
+       command="sp-cmd-run"
        modifiers="accel"/>
   <key id="sp-key-inspect"
        key="&inspect.key;"
        command="sp-cmd-inspect"
        modifiers="accel"/>
-  <key id="sp-key-print"
-       key="&print.key;"
-       command="sp-cmd-print"
+  <key id="sp-key-display"
+       key="&display.key;"
+       command="sp-cmd-display"
        modifiers="accel"/>
   <key id="sp-key-errorConsole"
        key="&errorConsoleCmd.commandkey;"
        command="sp-cmd-errorConsole"
        modifiers="accel,shift"/>
   <key id="sp-key-webConsole"
        key="&webConsoleCmd.commandkey;"
        command="sp-cmd-webConsole"
@@ -215,17 +215,16 @@
                 accesskey="&pasteCmd.accesskey;"
                 command="cmd_paste"/>
       <menuseparator/>
       <menuitem id="sp-menu-selectAll"
                 label="&selectAllCmd.label;"
                 key="key_selectAll"
                 accesskey="&selectAllCmd.accesskey;"
                 command="cmd_selectAll"/>
-      <menuseparator/>
 
       <!-- TODO: bug 650345 - implement search and replace
       <menuitem id="sp-menu-find"
                 label="&findOnCmd.label;"
                 accesskey="&findOnCmd.accesskey;"
                 key="key_find"
                 disabled="true"
                 command="cmd_find"/>
@@ -233,48 +232,54 @@
                 label="&findAgainCmd.label;"
                 accesskey="&findAgainCmd.accesskey;"
                 key="key_findAgain"
                 disabled="true"
                 command="cmd_findAgain"/>
       <menuseparator id="sp-execute-separator"/>
       -->
 
-      <menuitem id="sp-text-execute"
-                label="&execute.label;"
-                accesskey="&execute.accesskey;"
-                key="sp-key-execute"
-                command="sp-cmd-execute"/>
+    </menupopup>
+  </menu>
+
+  <menu id="sp-execute-menu" label="&executeMenu.label;"
+        accesskey="&executeMenu.accesskey;">
+    <menupopup id="sp-menu_executepopup">
+      <menuitem id="sp-text-run"
+                label="&run.label;"
+                accesskey="&run.accesskey;"
+                key="sp-key-run"
+                command="sp-cmd-run"/>
       <menuitem id="sp-text-inspect"
                 label="&inspect.label;"
                 accesskey="&inspect.accesskey;"
                 key="sp-key-inspect"
                 command="sp-cmd-inspect"/>
-      <menuitem id="sp-text-print"
-                label="&print.label;"
-                accesskey="&print.accesskey;"
-                key="sp-key-print"
-                command="sp-cmd-print"/>
+      <menuitem id="sp-text-display"
+                label="&display.label;"
+                accesskey="&display.accesskey;"
+                key="sp-key-display"
+                command="sp-cmd-display"/>
     </menupopup>
   </menu>
 
-  <menu id="sp-context-menu"
-        label="&contextMenu.label;"
-        accesskey="&contextMenu.accesskey;">
-    <menupopup id="sp-menu-context">
+  <menu id="sp-environment-menu"
+        label="&environmentMenu.label;"
+        accesskey="&environmentMenu.accesskey;">
+    <menupopup id="sp-menu-environment">
       <menuitem id="sp-menu-content"
                 label="&contentContext.label;"
                 accesskey="&contentContext.accesskey;"
                 command="sp-cmd-contentContext"
                 checked="true"
                 type="radio"/>
-      <menuitem id="sp-menu-chrome" hidden="true"
-                command="sp-cmd-chromeContext"
-                label="&chromeContext.label;"
-                accesskey="&chromeContext.accesskey;"
+      <menuitem id="sp-menu-browser" hidden="true"
+                command="sp-cmd-browserContext"
+                label="&browserContext.label;"
+                accesskey="&browserContext.accesskey;"
                 type="radio"/>
       <menuseparator/>
       <menuitem id="sp-menu-resetContext"
                 command="sp-cmd-resetContext"
                 label="&resetContext.label;"
                 accesskey="&resetContext.accesskey;"/>
     </menupopup>
   </menu>
@@ -301,38 +306,38 @@
   <menupopup id="scratchpad-text-popup">
     <menuitem id="menu_cut"/>
     <menuitem id="menu_copy"/>
     <menuitem id="menu_paste"/>
     <menuitem id="menu_delete"/>
     <menuseparator/>
     <menuitem id="menu_selectAll"/>
     <menuseparator/>
-    <menuitem id="sp-text-execute"
-              label="&execute.label;"
-              accesskey="&execute.accesskey;"
-              key="sp-key-execute"
-              command="sp-cmd-execute"/>
+    <menuitem id="sp-text-run"
+              label="&run.label;"
+              accesskey="&run.accesskey;"
+              key="sp-key-run"
+              command="sp-cmd-run"/>
     <menuitem id="sp-text-inspect"
               label="&inspect.label;"
               accesskey="&inspect.accesskey;"
               key="sp-key-inspect"
               command="sp-cmd-inspect"/>
-    <menuitem id="sp-text-print"
-              label="&print.label;"
-              accesskey="&print.accesskey;"
-              key="sp-key-print"
-              command="sp-cmd-print"/>
+    <menuitem id="sp-text-display"
+              label="&display.label;"
+              accesskey="&display.accesskey;"
+              key="sp-key-display"
+              command="sp-cmd-display"/>
   </menupopup>
 </popupset>
 
 <textbox id="scratchpad-textbox"
          multiline="true"
          flex="1"
          context="scratchpad-text-popup"
-         placeholder="&textbox.placeholder;" />
+         placeholder="&textbox.placeholder1;" />
 <statusbar id="scratchpad-statusbar" align="end">
   <statusbarpanel id="scratchpad-status"
                   label="&contentContext.label;"
                   class="statusbarpanel-iconic-text"/>
   <spacer flex="1"/>
 </statusbar>
 </window>
--- a/browser/base/content/syncSetup.js
+++ b/browser/base/content/syncSetup.js
@@ -59,16 +59,17 @@ const SETUP_SUCCESS_PAGE            = 8;
 // Broader than we'd like, but after this changed from api-secure.recaptcha.net
 // we had no choice. At least we only do this for the duration of setup.
 // See discussion in Bugs 508112 and 653307.
 const RECAPTCHA_DOMAIN = "https://www.google.com";
 
 Cu.import("resource://services-sync/main.js");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
+Cu.import("resource://gre/modules/PlacesUtils.jsm");
 Cu.import("resource://gre/modules/PluralForm.jsm");
 
 var gSyncSetup = {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports,
                                          Ci.nsIWebProgressListener,
                                          Ci.nsISupportsWeakReference]),
 
   captchaBrowser: null,
@@ -87,19 +88,19 @@ var gSyncSetup = {
     if (this._settingUpNew)
       return document.getElementById("server").selectedIndex == 0;
     return document.getElementById("existingServer").selectedIndex == 0;
   },
 
   init: function () {
     let obs = [
       ["weave:service:changepph:finish", "onResetPassphrase"],
-      ["weave:service:verify-login:start",  "onLoginStart"],
-      ["weave:service:verify-login:error",  "onLoginEnd"],
-      ["weave:service:verify-login:finish", "onLoginEnd"]];
+      ["weave:service:login:start",  "onLoginStart"],
+      ["weave:service:login:error",  "onLoginEnd"],
+      ["weave:service:login:finish", "onLoginEnd"]];
 
     // Add the observers now and remove them on unload
     let self = this;
     let addRem = function(add) {
       obs.forEach(function([topic, func]) {
         //XXXzpao This should use Services.obs.* but Weave's Obs does nice handling
         //        of `this`. Fix in a followup. (bug 583347)
         if (add)
@@ -211,16 +212,18 @@ var gSyncSetup = {
 
     let feedback;
     switch (Weave.Status.login) {
       case Weave.LOGIN_FAILED_NETWORK_ERROR:
       case Weave.LOGIN_FAILED_SERVER_ERROR:
         feedback = server;
         break;
       case Weave.LOGIN_FAILED_LOGIN_REJECTED:
+      case Weave.LOGIN_FAILED_NO_USERNAME:
+      case Weave.LOGIN_FAILED_NO_PASSWORD:
         feedback = password;
         break;
       case Weave.LOGIN_FAILED_INVALID_PASSPHRASE:
         feedback = passphrase;
         break;
     }
     this._setFeedbackMessage(feedback, false, Weave.Status.login);
   },
@@ -815,17 +818,19 @@ var gSyncSetup = {
   _handleChoice: function () {
     let desc = document.getElementById("mergeChoiceRadio").selectedIndex;
     document.getElementById("chosenActionDeck").selectedIndex = desc;
     switch (desc) {
       case 1:
         if (this._case1Setup)
           break;
 
-        let places_db = Weave.Svc.History.DBConnection;
+        let places_db = PlacesUtils.history
+                                   .QueryInterface(Ci.nsPIPlacesDatabase)
+                                   .DBConnection;
         if (Weave.Engines.get("history").enabled) {
           let daysOfHistory = 0;
           let stm = places_db.createStatement(
             "SELECT ROUND(( " +
               "strftime('%s','now','localtime','utc') - " +
               "( " +
                 "SELECT visit_date FROM moz_historyvisits " +
                 "ORDER BY visit_date ASC LIMIT 1 " +
@@ -846,31 +851,31 @@ var gSyncSetup = {
 
         if (Weave.Engines.get("bookmarks").enabled) {
           let bookmarks = 0;
           let stm = places_db.createStatement(
             "SELECT count(*) AS bookmarks " +
             "FROM moz_bookmarks b " +
             "LEFT JOIN moz_bookmarks t ON " +
             "b.parent = t.id WHERE b.type = 1 AND t.parent <> :tag");
-          stm.params.tag = Weave.Svc.Bookmark.tagsFolder;
+          stm.params.tag = PlacesUtils.tagsFolderId;
           if (stm.executeStep())
             bookmarks = stm.row.bookmarks;
           // Support %S for historical reasons (see bug 600141)
           document.getElementById("bookmarkCount").value =
             PluralForm.get(bookmarks,
                            this._stringBundle.GetStringFromName("bookmarksCount.label"))
                       .replace("%S", bookmarks)
                       .replace("#1", bookmarks);
         } else {
           document.getElementById("bookmarkCount").hidden = true;
         }
 
         if (Weave.Engines.get("passwords").enabled) {
-          let logins = Weave.Svc.Login.getAllLogins({});
+          let logins = Services.logins.getAllLogins({});
           // Support %S for historical reasons (see bug 600141)
           document.getElementById("passwordCount").value =
             PluralForm.get(logins.length,
                            this._stringBundle.GetStringFromName("passwordsCount.label"))
                       .replace("%S", logins.length)
                       .replace("#1", logins.length);
         } else {
           document.getElementById("passwordCount").hidden = true;
--- a/browser/base/content/syncUtils.js
+++ b/browser/base/content/syncUtils.js
@@ -50,41 +50,41 @@ let gSyncUtils = {
     let thisDocEl = document.documentElement,
         openerDocEl = window.opener && window.opener.document.documentElement;
     if (thisDocEl.id == "accountSetup" && window.opener &&
         openerDocEl.id == "BrowserPreferences" && !openerDocEl.instantApply)
       openUILinkIn(url, "window");
     else if (thisDocEl.id == "BrowserPreferences" && !thisDocEl.instantApply)
       openUILinkIn(url, "window");
     else if (document.documentElement.id == "change-dialog")
-      Weave.Svc.WinMediator.getMostRecentWindow("navigator:browser")
-        .openUILinkIn(url, "tab");
+      Services.wm.getMostRecentWindow("navigator:browser")
+              .openUILinkIn(url, "tab");
     else
       openUILinkIn(url, "tab");
   },
 
   changeName: function changeName(input) {
     // Make sure to update to a modified name, e.g., empty-string -> default
     Weave.Clients.localName = input.value;
     input.value = Weave.Clients.localName;
   },
 
   openChange: function openChange(type, duringSetup) {
     // Just re-show the dialog if it's already open
-    let openedDialog = Weave.Svc.WinMediator.getMostRecentWindow("Sync:" + type);
+    let openedDialog = Services.wm.getMostRecentWindow("Sync:" + type);
     if (openedDialog != null) {
       openedDialog.focus();
       return;
     }
 
     // Open up the change dialog
     let changeXUL = "chrome://browser/content/syncGenericChange.xul";
     let changeOpt = "centerscreen,chrome,resizable=no";
-    Weave.Svc.WinWatcher.activeWindow.openDialog(changeXUL, "", changeOpt,
-                                                 type, duringSetup);
+    Services.ww.activeWindow.openDialog(changeXUL, "", changeOpt,
+                                        type, duringSetup);
   },
 
   changePassword: function () {
     if (Weave.Utils.ensureMPUnlocked())
       this.openChange("ChangePassword");
   },
 
   resetPassphrase: function (duringSetup) {
@@ -189,22 +189,23 @@ let gSyncUtils = {
 
   /**
    * Save passphrase backup document to disk as HTML file.
    * 
    * @param elid : ID of the form element containing the passphrase.
    */
   passphraseSave: function(elid) {
     let dialogTitle = this.bundle.GetStringFromName("save.synckey.title");
+    let defaultSaveName = this.bundle.GetStringFromName("save.default.label");
     this._preparePPiframe(elid, function(iframe) {
       let filepicker = Cc["@mozilla.org/filepicker;1"]
                          .createInstance(Ci.nsIFilePicker);
       filepicker.init(window, dialogTitle, Ci.nsIFilePicker.modeSave);